import { w as bD, h as xD, _ as wD, K as _D, E as Ev } from "./index-B-W0fnek.js"; import { C as SD } from "./ContentMixin-Bvii7mm_.js"; import { ref as we, defineComponent as Le, computed as ee, openBlock as Q, createElementBlock as be, mergeProps as Nr, unref as N, renderSlot as Fe, useAttrs as AT, useSlots as co, shallowRef as mr, watch as ze, nextTick as st, onMounted as Lt, toRef as pr, createCommentVNode as Pe, Fragment as pt, normalizeClass as xe, createElementVNode as Ee, createBlock as Re, withCtx as le, resolveDynamicComponent as Yt, withModifiers as Tt, createVNode as oe, toDisplayString as Ze, normalizeStyle as yt, provide as Dt, reactive as _r, onActivated as LT, onUpdated as jh, inject as Ye, onBeforeUnmount as Sr, withDirectives as ht, cloneVNode as kT, Text as sg, Comment as PT, Transition as Zn, vShow as Ot, readonly as U1, onDeactivated as RT, createTextVNode as et, isRef as cn, vModelCheckbox as Sm, toRefs as Zi, toHandlers as OT, getCurrentInstance as Ct, watchEffect as lg, withKeys as ti, h as an, warn as DT, onBeforeMount as IT, onUnmounted as j1, toRaw as gl, getCurrentScope as H1, onScopeDispose as G1, Teleport as NT, renderList as ir, resolveComponent as qt, resolveDirective as BT, toHandlerKey as FT, vModelText as zT, pushScopeId as Hh, popScopeId as Gh, createApp as $T, createSlots as MD, markRaw as Si, isVNode as oy, hasInjectionContext as ED, effectScope as TD, isReactive as W1 } from "vue"; const $a = (t, e, { checkForDefaultPrevented: r = !0 } = {}) => (i) => { const n = t == null ? void 0 : t(i); if (r === !1 || !n) return e == null ? void 0 : e(i); }; var Pw; const $r = typeof window < "u", CD = (t) => typeof t == "string", VT = () => { }, sy = $r && ((Pw = window == null ? void 0 : window.navigator) == null ? void 0 : Pw.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent); function UT(t) { return typeof t == "function" ? t() : N(t); } function AD(t) { return t; } function cg(t) { return H1() ? (G1(t), !0) : !1; } function LD(t, e = !0) { Ct() ? Lt(t) : e ? t() : st(t); } function qa(t) { var e; const r = UT(t); return (e = r == null ? void 0 : r.$el) != null ? e : r; } const ug = $r ? window : void 0; function xn(...t) { let e, r, i, n; if (CD(t[0]) || Array.isArray(t[0]) ? ([r, i, n] = t, e = ug) : [e, r, i, n] = t, !e) return VT; Array.isArray(r) || (r = [r]), Array.isArray(i) || (i = [i]); const a = [], o = () => { a.forEach((u) => u()), a.length = 0; }, s = (u, d, h, f) => (u.addEventListener(d, h, f), () => u.removeEventListener(d, h, f)), c = ze(() => [qa(e), UT(n)], ([u, d]) => { o(), u && a.push(...r.flatMap((h) => i.map((f) => s(u, h, f, d)))); }, { immediate: !0, flush: "post" }), l = () => { c(), o(); }; return cg(l), l; } let Rw = !1; function kD(t, e, r = {}) { const { window: i = ug, ignore: n = [], capture: a = !0, detectIframe: o = !1 } = r; if (!i) return; sy && !Rw && (Rw = !0, Array.from(i.document.body.children).forEach((u) => u.addEventListener("click", VT))); let s = !0; const c = (u) => n.some((d) => { if (typeof d == "string") return Array.from(i.document.querySelectorAll(d)).some((h) => h === u.target || u.composedPath().includes(h)); { const h = qa(d); return h && (u.target === h || u.composedPath().includes(h)); } }), l = [ xn(i, "click", (u) => { const d = qa(t); if (!(!d || d === u.target || u.composedPath().includes(d))) { if (u.detail === 0 && (s = !c(u)), !s) { s = !0; return; } e(u); } }, { passive: !0, capture: a }), xn(i, "pointerdown", (u) => { const d = qa(t); d && (s = !u.composedPath().includes(d) && !c(u)); }, { passive: !0 }), o && xn(i, "blur", (u) => { var d; const h = qa(t); ((d = i.document.activeElement) == null ? void 0 : d.tagName) === "IFRAME" && !(h != null && h.contains(i.document.activeElement)) && e(u); }) ].filter(Boolean); return () => l.forEach((u) => u()); } function jT(t, e = !1) { const r = we(), i = () => r.value = !!t(); return i(), LD(i, e), r; } const Ow = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Dw = "__vueuse_ssr_handlers__"; Ow[Dw] = Ow[Dw] || {}; var Iw = Object.getOwnPropertySymbols, PD = Object.prototype.hasOwnProperty, RD = Object.prototype.propertyIsEnumerable, OD = (t, e) => { var r = {}; for (var i in t) PD.call(t, i) && e.indexOf(i) < 0 && (r[i] = t[i]); if (t != null && Iw) for (var i of Iw(t)) e.indexOf(i) < 0 && RD.call(t, i) && (r[i] = t[i]); return r; }; function Ua(t, e, r = {}) { const i = r, { window: n = ug } = i, a = OD(i, ["window"]); let o; const s = jT(() => n && "ResizeObserver" in n), c = () => { o && (o.disconnect(), o = void 0); }, l = ze(() => qa(t), (d) => { c(), s.value && n && d && (o = new ResizeObserver(e), o.observe(d, a)); }, { immediate: !0, flush: "post" }), u = () => { c(), l(); }; return cg(u), { isSupported: s, stop: u }; } var Nw = Object.getOwnPropertySymbols, DD = Object.prototype.hasOwnProperty, ID = Object.prototype.propertyIsEnumerable, ND = (t, e) => { var r = {}; for (var i in t) DD.call(t, i) && e.indexOf(i) < 0 && (r[i] = t[i]); if (t != null && Nw) for (var i of Nw(t)) e.indexOf(i) < 0 && ID.call(t, i) && (r[i] = t[i]); return r; }; function BD(t, e, r = {}) { const i = r, { window: n = ug } = i, a = ND(i, ["window"]); let o; const s = jT(() => n && "MutationObserver" in n), c = () => { o && (o.disconnect(), o = void 0); }, l = ze(() => qa(t), (d) => { c(), s.value && n && d && (o = new MutationObserver(e), o.observe(d, a)); }, { immediate: !0 }), u = () => { c(), l(); }; return cg(u), { isSupported: s, stop: u }; } var Bw; (function(t) { t.UP = "UP", t.RIGHT = "RIGHT", t.DOWN = "DOWN", t.LEFT = "LEFT", t.NONE = "NONE"; })(Bw || (Bw = {})); var FD = Object.defineProperty, Fw = Object.getOwnPropertySymbols, zD = Object.prototype.hasOwnProperty, $D = Object.prototype.propertyIsEnumerable, zw = (t, e, r) => e in t ? FD(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, VD = (t, e) => { for (var r in e || (e = {})) zD.call(e, r) && zw(t, r, e[r]); if (Fw) for (var r of Fw(e)) $D.call(e, r) && zw(t, r, e[r]); return t; }; const UD = { 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] }; VD({ linear: AD }, UD); const jD = () => $r && /firefox/i.test(window.navigator.userAgent), q1 = (t) => { let e, r; return t.type === "touchend" ? (r = t.changedTouches[0].clientY, e = t.changedTouches[0].clientX) : t.type.startsWith("touch") ? (r = t.touches[0].clientY, e = t.touches[0].clientX) : (r = t.clientY, e = t.clientX), { clientX: e, clientY: r }; }; /** * @vue/shared v3.4.27 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ process.env.NODE_ENV !== "production" && Object.freeze({}); process.env.NODE_ENV !== "production" && Object.freeze([]); const oh = () => { }, HD = Object.prototype.hasOwnProperty, vl = (t, e) => HD.call(t, e), Ui = Array.isArray, Di = (t) => typeof t == "function", Ei = (t) => typeof t == "string", di = (t) => t !== null && typeof t == "object", GD = Object.prototype.toString, WD = (t) => GD.call(t), Tv = (t) => WD(t).slice(8, -1), HT = (t) => { const e = /* @__PURE__ */ Object.create(null); return (r) => e[r] || (e[r] = t(r)); }, qD = /-(\w)/g, XD = HT((t) => t.replace(qD, (e, r) => r ? r.toUpperCase() : "")), ZD = /\B([A-Z])/g, YD = HT( (t) => t.replace(ZD, "-$1").toLowerCase() ); var GT = typeof global == "object" && global && global.Object === Object && global, KD = typeof self == "object" && self && self.Object === Object && self, Ma = GT || KD || Function("return this")(), ga = Ma.Symbol, WT = Object.prototype, JD = WT.hasOwnProperty, QD = WT.toString, ld = ga ? ga.toStringTag : void 0; function eI(t) { var e = JD.call(t, ld), r = t[ld]; try { t[ld] = void 0; var i = !0; } catch { } var n = QD.call(t); return i && (e ? t[ld] = r : delete t[ld]), n; } var tI = Object.prototype, rI = tI.toString; function iI(t) { return rI.call(t); } var nI = "[object Null]", aI = "[object Undefined]", $w = ga ? ga.toStringTag : void 0; function Ou(t) { return t == null ? t === void 0 ? aI : nI : $w && $w in Object(t) ? eI(t) : iI(t); } function Xc(t) { return t != null && typeof t == "object"; } var oI = "[object Symbol]"; function dg(t) { return typeof t == "symbol" || Xc(t) && Ou(t) == oI; } function sI(t, e) { for (var r = -1, i = t == null ? 0 : t.length, n = Array(i); ++r < i; ) n[r] = e(t[r], r, t); return n; } var Gn = Array.isArray, lI = 1 / 0, Vw = ga ? ga.prototype : void 0, Uw = Vw ? Vw.toString : void 0; function qT(t) { if (typeof t == "string") return t; if (Gn(t)) return sI(t, qT) + ""; if (dg(t)) return Uw ? Uw.call(t) : ""; var e = t + ""; return e == "0" && 1 / t == -lI ? "-0" : e; } var cI = /\s/; function uI(t) { for (var e = t.length; e-- && cI.test(t.charAt(e)); ) ; return e; } var dI = /^\s+/; function hI(t) { return t && t.slice(0, uI(t) + 1).replace(dI, ""); } function ls(t) { var e = typeof t; return t != null && (e == "object" || e == "function"); } var jw = NaN, pI = /^[-+]0x[0-9a-f]+$/i, fI = /^0b[01]+$/i, mI = /^0o[0-7]+$/i, gI = parseInt; function Hw(t) { if (typeof t == "number") return t; if (dg(t)) return jw; if (ls(t)) { var e = typeof t.valueOf == "function" ? t.valueOf() : t; t = ls(e) ? e + "" : e; } if (typeof t != "string") return t === 0 ? t : +t; t = hI(t); var r = fI.test(t); return r || mI.test(t) ? gI(t.slice(2), r ? 2 : 8) : pI.test(t) ? jw : +t; } function XT(t) { return t; } var vI = "[object AsyncFunction]", yI = "[object Function]", bI = "[object GeneratorFunction]", xI = "[object Proxy]"; function ZT(t) { if (!ls(t)) return !1; var e = Ou(t); return e == yI || e == bI || e == vI || e == xI; } var Cv = Ma["__core-js_shared__"], Gw = function() { var t = /[^.]+$/.exec(Cv && Cv.keys && Cv.keys.IE_PROTO || ""); return t ? "Symbol(src)_1." + t : ""; }(); function wI(t) { return !!Gw && Gw in t; } var _I = Function.prototype, SI = _I.toString; function Bl(t) { if (t != null) { try { return SI.call(t); } catch { } try { return t + ""; } catch { } } return ""; } var MI = /[\\^$.*+?()[\]{}|]/g, EI = /^\[object .+?Constructor\]$/, TI = Function.prototype, CI = Object.prototype, AI = TI.toString, LI = CI.hasOwnProperty, kI = RegExp( "^" + AI.call(LI).replace(MI, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); function PI(t) { if (!ls(t) || wI(t)) return !1; var e = ZT(t) ? kI : EI; return e.test(Bl(t)); } function RI(t, e) { return t == null ? void 0 : t[e]; } function Fl(t, e) { var r = RI(t, e); return PI(r) ? r : void 0; } var ly = Fl(Ma, "WeakMap"); function OI(t, e, r) { switch (r.length) { case 0: return t.call(e); case 1: return t.call(e, r[0]); case 2: return t.call(e, r[0], r[1]); case 3: return t.call(e, r[0], r[1], r[2]); } return t.apply(e, r); } var DI = 800, II = 16, NI = Date.now; function BI(t) { var e = 0, r = 0; return function() { var i = NI(), n = II - (i - r); if (r = i, n > 0) { if (++e >= DI) return arguments[0]; } else e = 0; return t.apply(void 0, arguments); }; } function FI(t) { return function() { return t; }; } var Mm = function() { try { var t = Fl(Object, "defineProperty"); return t({}, "", {}), t; } catch { } }(), zI = Mm ? function(t, e) { return Mm(t, "toString", { configurable: !0, enumerable: !1, value: FI(e), writable: !0 }); } : XT, $I = BI(zI); function VI(t, e, r, i) { t.length; for (var n = r + 1; n--; ) if (e(t[n], n, t)) return n; return -1; } var UI = 9007199254740991, jI = /^(?:0|[1-9]\d*)$/; function X1(t, e) { var r = typeof t; return e = e ?? UI, !!e && (r == "number" || r != "symbol" && jI.test(t)) && t > -1 && t % 1 == 0 && t < e; } function HI(t, e, r) { e == "__proto__" && Mm ? Mm(t, e, { configurable: !0, enumerable: !0, value: r, writable: !0 }) : t[e] = r; } function Z1(t, e) { return t === e || t !== t && e !== e; } var GI = Object.prototype, WI = GI.hasOwnProperty; function qI(t, e, r) { var i = t[e]; (!(WI.call(t, e) && Z1(i, r)) || r === void 0 && !(e in t)) && HI(t, e, r); } var Ww = Math.max; function XI(t, e, r) { return e = Ww(e === void 0 ? t.length - 1 : e, 0), function() { for (var i = arguments, n = -1, a = Ww(i.length - e, 0), o = Array(a); ++n < a; ) o[n] = i[e + n]; n = -1; for (var s = Array(e + 1); ++n < e; ) s[n] = i[n]; return s[e] = r(o), OI(t, this, s); }; } var ZI = 9007199254740991; function Y1(t) { return typeof t == "number" && t > -1 && t % 1 == 0 && t <= ZI; } function YI(t) { return t != null && Y1(t.length) && !ZT(t); } var KI = Object.prototype; function JI(t) { var e = t && t.constructor, r = typeof e == "function" && e.prototype || KI; return t === r; } function QI(t, e) { for (var r = -1, i = Array(t); ++r < t; ) i[r] = e(r); return i; } var eN = "[object Arguments]"; function qw(t) { return Xc(t) && Ou(t) == eN; } var YT = Object.prototype, tN = YT.hasOwnProperty, rN = YT.propertyIsEnumerable, K1 = qw(/* @__PURE__ */ function() { return arguments; }()) ? qw : function(t) { return Xc(t) && tN.call(t, "callee") && !rN.call(t, "callee"); }; function iN() { return !1; } var KT = typeof exports == "object" && exports && !exports.nodeType && exports, Xw = KT && typeof module == "object" && module && !module.nodeType && module, nN = Xw && Xw.exports === KT, Zw = nN ? Ma.Buffer : void 0, aN = Zw ? Zw.isBuffer : void 0, cy = aN || iN, oN = "[object Arguments]", sN = "[object Array]", lN = "[object Boolean]", cN = "[object Date]", uN = "[object Error]", dN = "[object Function]", hN = "[object Map]", pN = "[object Number]", fN = "[object Object]", mN = "[object RegExp]", gN = "[object Set]", vN = "[object String]", yN = "[object WeakMap]", bN = "[object ArrayBuffer]", xN = "[object DataView]", wN = "[object Float32Array]", _N = "[object Float64Array]", SN = "[object Int8Array]", MN = "[object Int16Array]", EN = "[object Int32Array]", TN = "[object Uint8Array]", CN = "[object Uint8ClampedArray]", AN = "[object Uint16Array]", LN = "[object Uint32Array]", ur = {}; ur[wN] = ur[_N] = ur[SN] = ur[MN] = ur[EN] = ur[TN] = ur[CN] = ur[AN] = ur[LN] = !0; ur[oN] = ur[sN] = ur[bN] = ur[lN] = ur[xN] = ur[cN] = ur[uN] = ur[dN] = ur[hN] = ur[pN] = ur[fN] = ur[mN] = ur[gN] = ur[vN] = ur[yN] = !1; function kN(t) { return Xc(t) && Y1(t.length) && !!ur[Ou(t)]; } function PN(t) { return function(e) { return t(e); }; } var JT = typeof exports == "object" && exports && !exports.nodeType && exports, Hd = JT && typeof module == "object" && module && !module.nodeType && module, RN = Hd && Hd.exports === JT, Av = RN && GT.process, Yw = function() { try { var t = Hd && Hd.require && Hd.require("util").types; return t || Av && Av.binding && Av.binding("util"); } catch { } }(), Kw = Yw && Yw.isTypedArray, QT = Kw ? PN(Kw) : kN, ON = Object.prototype, DN = ON.hasOwnProperty; function IN(t, e) { var r = Gn(t), i = !r && K1(t), n = !r && !i && cy(t), a = !r && !i && !n && QT(t), o = r || i || n || a, s = o ? QI(t.length, String) : [], c = s.length; for (var l in t) DN.call(t, l) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode. (l == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. n && (l == "offset" || l == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. a && (l == "buffer" || l == "byteLength" || l == "byteOffset") || // Skip index properties. X1(l, c))) && s.push(l); return s; } function NN(t, e) { return function(r) { return t(e(r)); }; } var BN = NN(Object.keys, Object), FN = Object.prototype, zN = FN.hasOwnProperty; function $N(t) { if (!JI(t)) return BN(t); var e = []; for (var r in Object(t)) zN.call(t, r) && r != "constructor" && e.push(r); return e; } function eC(t) { return YI(t) ? IN(t) : $N(t); } var VN = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, UN = /^\w*$/; function J1(t, e) { if (Gn(t)) return !1; var r = typeof t; return r == "number" || r == "symbol" || r == "boolean" || t == null || dg(t) ? !0 : UN.test(t) || !VN.test(t) || e != null && t in Object(e); } var sh = Fl(Object, "create"); function jN() { this.__data__ = sh ? sh(null) : {}, this.size = 0; } function HN(t) { var e = this.has(t) && delete this.__data__[t]; return this.size -= e ? 1 : 0, e; } var GN = "__lodash_hash_undefined__", WN = Object.prototype, qN = WN.hasOwnProperty; function XN(t) { var e = this.__data__; if (sh) { var r = e[t]; return r === GN ? void 0 : r; } return qN.call(e, t) ? e[t] : void 0; } var ZN = Object.prototype, YN = ZN.hasOwnProperty; function KN(t) { var e = this.__data__; return sh ? e[t] !== void 0 : YN.call(e, t); } var JN = "__lodash_hash_undefined__"; function QN(t, e) { var r = this.__data__; return this.size += this.has(t) ? 0 : 1, r[t] = sh && e === void 0 ? JN : e, this; } function yl(t) { var e = -1, r = t == null ? 0 : t.length; for (this.clear(); ++e < r; ) { var i = t[e]; this.set(i[0], i[1]); } } yl.prototype.clear = jN; yl.prototype.delete = HN; yl.prototype.get = XN; yl.prototype.has = KN; yl.prototype.set = QN; function e4() { this.__data__ = [], this.size = 0; } function hg(t, e) { for (var r = t.length; r--; ) if (Z1(t[r][0], e)) return r; return -1; } var t4 = Array.prototype, r4 = t4.splice; function i4(t) { var e = this.__data__, r = hg(e, t); if (r < 0) return !1; var i = e.length - 1; return r == i ? e.pop() : r4.call(e, r, 1), --this.size, !0; } function n4(t) { var e = this.__data__, r = hg(e, t); return r < 0 ? void 0 : e[r][1]; } function a4(t) { return hg(this.__data__, t) > -1; } function o4(t, e) { var r = this.__data__, i = hg(r, t); return i < 0 ? (++this.size, r.push([t, e])) : r[i][1] = e, this; } function uo(t) { var e = -1, r = t == null ? 0 : t.length; for (this.clear(); ++e < r; ) { var i = t[e]; this.set(i[0], i[1]); } } uo.prototype.clear = e4; uo.prototype.delete = i4; uo.prototype.get = n4; uo.prototype.has = a4; uo.prototype.set = o4; var lh = Fl(Ma, "Map"); function s4() { this.size = 0, this.__data__ = { hash: new yl(), map: new (lh || uo)(), string: new yl() }; } function l4(t) { var e = typeof t; return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null; } function pg(t, e) { var r = t.__data__; return l4(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map; } function c4(t) { var e = pg(this, t).delete(t); return this.size -= e ? 1 : 0, e; } function u4(t) { return pg(this, t).get(t); } function d4(t) { return pg(this, t).has(t); } function h4(t, e) { var r = pg(this, t), i = r.size; return r.set(t, e), this.size += r.size == i ? 0 : 1, this; } function ho(t) { var e = -1, r = t == null ? 0 : t.length; for (this.clear(); ++e < r; ) { var i = t[e]; this.set(i[0], i[1]); } } ho.prototype.clear = s4; ho.prototype.delete = c4; ho.prototype.get = u4; ho.prototype.has = d4; ho.prototype.set = h4; var p4 = "Expected a function"; function Q1(t, e) { if (typeof t != "function" || e != null && typeof e != "function") throw new TypeError(p4); var r = function() { var i = arguments, n = e ? e.apply(this, i) : i[0], a = r.cache; if (a.has(n)) return a.get(n); var o = t.apply(this, i); return r.cache = a.set(n, o) || a, o; }; return r.cache = new (Q1.Cache || ho)(), r; } Q1.Cache = ho; var f4 = 500; function m4(t) { var e = Q1(t, function(i) { return r.size === f4 && r.clear(), i; }), r = e.cache; return e; } var g4 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, v4 = /\\(\\)?/g, y4 = m4(function(t) { var e = []; return t.charCodeAt(0) === 46 && e.push(""), t.replace(g4, function(r, i, n, a) { e.push(n ? a.replace(v4, "$1") : i || r); }), e; }); function b4(t) { return t == null ? "" : qT(t); } function fg(t, e) { return Gn(t) ? t : J1(t, e) ? [t] : y4(b4(t)); } var x4 = 1 / 0; function Wh(t) { if (typeof t == "string" || dg(t)) return t; var e = t + ""; return e == "0" && 1 / t == -x4 ? "-0" : e; } function eb(t, e) { e = fg(e, t); for (var r = 0, i = e.length; t != null && r < i; ) t = t[Wh(e[r++])]; return r && r == i ? t : void 0; } function ja(t, e, r) { var i = t == null ? void 0 : eb(t, e); return i === void 0 ? r : i; } function tC(t, e) { for (var r = -1, i = e.length, n = t.length; ++r < i; ) t[n + r] = e[r]; return t; } var Jw = ga ? ga.isConcatSpreadable : void 0; function w4(t) { return Gn(t) || K1(t) || !!(Jw && t && t[Jw]); } function _4(t, e, r, i, n) { var a = -1, o = t.length; for (r || (r = w4), n || (n = []); ++a < o; ) { var s = t[a]; r(s) ? tC(n, s) : n[n.length] = s; } return n; } function S4(t) { var e = t == null ? 0 : t.length; return e ? _4(t) : []; } function M4(t) { return $I(XI(t, void 0, S4), t + ""); } function qo() { if (!arguments.length) return []; var t = arguments[0]; return Gn(t) ? t : [t]; } function E4() { this.__data__ = new uo(), this.size = 0; } function T4(t) { var e = this.__data__, r = e.delete(t); return this.size = e.size, r; } function C4(t) { return this.__data__.get(t); } function A4(t) { return this.__data__.has(t); } var L4 = 200; function k4(t, e) { var r = this.__data__; if (r instanceof uo) { var i = r.__data__; if (!lh || i.length < L4 - 1) return i.push([t, e]), this.size = ++r.size, this; r = this.__data__ = new ho(i); } return r.set(t, e), this.size = r.size, this; } function Za(t) { var e = this.__data__ = new uo(t); this.size = e.size; } Za.prototype.clear = E4; Za.prototype.delete = T4; Za.prototype.get = C4; Za.prototype.has = A4; Za.prototype.set = k4; function P4(t, e) { for (var r = -1, i = t == null ? 0 : t.length, n = 0, a = []; ++r < i; ) { var o = t[r]; e(o, r, t) && (a[n++] = o); } return a; } function R4() { return []; } var O4 = Object.prototype, D4 = O4.propertyIsEnumerable, Qw = Object.getOwnPropertySymbols, I4 = Qw ? function(t) { return t == null ? [] : (t = Object(t), P4(Qw(t), function(e) { return D4.call(t, e); })); } : R4; function N4(t, e, r) { var i = e(t); return Gn(t) ? i : tC(i, r(t)); } function e2(t) { return N4(t, eC, I4); } var uy = Fl(Ma, "DataView"), dy = Fl(Ma, "Promise"), hy = Fl(Ma, "Set"), t2 = "[object Map]", B4 = "[object Object]", r2 = "[object Promise]", i2 = "[object Set]", n2 = "[object WeakMap]", a2 = "[object DataView]", F4 = Bl(uy), z4 = Bl(lh), $4 = Bl(dy), V4 = Bl(hy), U4 = Bl(ly), Ho = Ou; (uy && Ho(new uy(new ArrayBuffer(1))) != a2 || lh && Ho(new lh()) != t2 || dy && Ho(dy.resolve()) != r2 || hy && Ho(new hy()) != i2 || ly && Ho(new ly()) != n2) && (Ho = function(t) { var e = Ou(t), r = e == B4 ? t.constructor : void 0, i = r ? Bl(r) : ""; if (i) switch (i) { case F4: return a2; case z4: return t2; case $4: return r2; case V4: return i2; case U4: return n2; } return e; }); var o2 = Ma.Uint8Array, j4 = "__lodash_hash_undefined__"; function H4(t) { return this.__data__.set(t, j4), this; } function G4(t) { return this.__data__.has(t); } function Em(t) { var e = -1, r = t == null ? 0 : t.length; for (this.__data__ = new ho(); ++e < r; ) this.add(t[e]); } Em.prototype.add = Em.prototype.push = H4; Em.prototype.has = G4; function W4(t, e) { for (var r = -1, i = t == null ? 0 : t.length; ++r < i; ) if (e(t[r], r, t)) return !0; return !1; } function q4(t, e) { return t.has(e); } var X4 = 1, Z4 = 2; function rC(t, e, r, i, n, a) { var o = r & X4, s = t.length, c = e.length; if (s != c && !(o && c > s)) return !1; var l = a.get(t), u = a.get(e); if (l && u) return l == e && u == t; var d = -1, h = !0, f = r & Z4 ? new Em() : void 0; for (a.set(t, e), a.set(e, t); ++d < s; ) { var p = t[d], m = e[d]; if (i) var y = o ? i(m, p, d, e, t, a) : i(p, m, d, t, e, a); if (y !== void 0) { if (y) continue; h = !1; break; } if (f) { if (!W4(e, function(g, v) { if (!q4(f, v) && (p === g || n(p, g, r, i, a))) return f.push(v); })) { h = !1; break; } } else if (!(p === m || n(p, m, r, i, a))) { h = !1; break; } } return a.delete(t), a.delete(e), h; } function Y4(t) { var e = -1, r = Array(t.size); return t.forEach(function(i, n) { r[++e] = [n, i]; }), r; } function K4(t) { var e = -1, r = Array(t.size); return t.forEach(function(i) { r[++e] = i; }), r; } var J4 = 1, Q4 = 2, e5 = "[object Boolean]", t5 = "[object Date]", r5 = "[object Error]", i5 = "[object Map]", n5 = "[object Number]", a5 = "[object RegExp]", o5 = "[object Set]", s5 = "[object String]", l5 = "[object Symbol]", c5 = "[object ArrayBuffer]", u5 = "[object DataView]", s2 = ga ? ga.prototype : void 0, Lv = s2 ? s2.valueOf : void 0; function d5(t, e, r, i, n, a, o) { switch (r) { case u5: if (t.byteLength != e.byteLength || t.byteOffset != e.byteOffset) return !1; t = t.buffer, e = e.buffer; case c5: return !(t.byteLength != e.byteLength || !a(new o2(t), new o2(e))); case e5: case t5: case n5: return Z1(+t, +e); case r5: return t.name == e.name && t.message == e.message; case a5: case s5: return t == e + ""; case i5: var s = Y4; case o5: var c = i & J4; if (s || (s = K4), t.size != e.size && !c) return !1; var l = o.get(t); if (l) return l == e; i |= Q4, o.set(t, e); var u = rC(s(t), s(e), i, n, a, o); return o.delete(t), u; case l5: if (Lv) return Lv.call(t) == Lv.call(e); } return !1; } var h5 = 1, p5 = Object.prototype, f5 = p5.hasOwnProperty; function m5(t, e, r, i, n, a) { var o = r & h5, s = e2(t), c = s.length, l = e2(e), u = l.length; if (c != u && !o) return !1; for (var d = c; d--; ) { var h = s[d]; if (!(o ? h in e : f5.call(e, h))) return !1; } var f = a.get(t), p = a.get(e); if (f && p) return f == e && p == t; var m = !0; a.set(t, e), a.set(e, t); for (var y = o; ++d < c; ) { h = s[d]; var g = t[h], v = e[h]; if (i) var x = o ? i(v, g, h, e, t, a) : i(g, v, h, t, e, a); if (!(x === void 0 ? g === v || n(g, v, r, i, a) : x)) { m = !1; break; } y || (y = h == "constructor"); } if (m && !y) { var w = t.constructor, S = e.constructor; w != S && "constructor" in t && "constructor" in e && !(typeof w == "function" && w instanceof w && typeof S == "function" && S instanceof S) && (m = !1); } return a.delete(t), a.delete(e), m; } var g5 = 1, l2 = "[object Arguments]", c2 = "[object Array]", Rp = "[object Object]", v5 = Object.prototype, u2 = v5.hasOwnProperty; function y5(t, e, r, i, n, a) { var o = Gn(t), s = Gn(e), c = o ? c2 : Ho(t), l = s ? c2 : Ho(e); c = c == l2 ? Rp : c, l = l == l2 ? Rp : l; var u = c == Rp, d = l == Rp, h = c == l; if (h && cy(t)) { if (!cy(e)) return !1; o = !0, u = !1; } if (h && !u) return a || (a = new Za()), o || QT(t) ? rC(t, e, r, i, n, a) : d5(t, e, c, r, i, n, a); if (!(r & g5)) { var f = u && u2.call(t, "__wrapped__"), p = d && u2.call(e, "__wrapped__"); if (f || p) { var m = f ? t.value() : t, y = p ? e.value() : e; return a || (a = new Za()), n(m, y, r, i, a); } } return h ? (a || (a = new Za()), m5(t, e, r, i, n, a)) : !1; } function mg(t, e, r, i, n) { return t === e ? !0 : t == null || e == null || !Xc(t) && !Xc(e) ? t !== t && e !== e : y5(t, e, r, i, mg, n); } var b5 = 1, x5 = 2; function w5(t, e, r, i) { var n = r.length, a = n; if (t == null) return !a; for (t = Object(t); n--; ) { var o = r[n]; if (o[2] ? o[1] !== t[o[0]] : !(o[0] in t)) return !1; } for (; ++n < a; ) { o = r[n]; var s = o[0], c = t[s], l = o[1]; if (o[2]) { if (c === void 0 && !(s in t)) return !1; } else { var u = new Za(), d; if (!(d === void 0 ? mg(l, c, b5 | x5, i, u) : d)) return !1; } } return !0; } function iC(t) { return t === t && !ls(t); } function _5(t) { for (var e = eC(t), r = e.length; r--; ) { var i = e[r], n = t[i]; e[r] = [i, n, iC(n)]; } return e; } function nC(t, e) { return function(r) { return r == null ? !1 : r[t] === e && (e !== void 0 || t in Object(r)); }; } function S5(t) { var e = _5(t); return e.length == 1 && e[0][2] ? nC(e[0][0], e[0][1]) : function(r) { return r === t || w5(r, t, e); }; } function M5(t, e) { return t != null && e in Object(t); } function E5(t, e, r) { e = fg(e, t); for (var i = -1, n = e.length, a = !1; ++i < n; ) { var o = Wh(e[i]); if (!(a = t != null && r(t, o))) break; t = t[o]; } return a || ++i != n ? a : (n = t == null ? 0 : t.length, !!n && Y1(n) && X1(o, n) && (Gn(t) || K1(t))); } function aC(t, e) { return t != null && E5(t, e, M5); } var T5 = 1, C5 = 2; function A5(t, e) { return J1(t) && iC(e) ? nC(Wh(t), e) : function(r) { var i = ja(r, t); return i === void 0 && i === e ? aC(r, t) : mg(e, i, T5 | C5); }; } function L5(t) { return function(e) { return e == null ? void 0 : e[t]; }; } function k5(t) { return function(e) { return eb(e, t); }; } function P5(t) { return J1(t) ? L5(Wh(t)) : k5(t); } function R5(t) { return typeof t == "function" ? t : t == null ? XT : typeof t == "object" ? Gn(t) ? A5(t[0], t[1]) : S5(t) : P5(t); } var kv = function() { return Ma.Date.now(); }, O5 = "Expected a function", D5 = Math.max, I5 = Math.min; function oC(t, e, r) { var i, n, a, o, s, c, l = 0, u = !1, d = !1, h = !0; if (typeof t != "function") throw new TypeError(O5); e = Hw(e) || 0, ls(r) && (u = !!r.leading, d = "maxWait" in r, a = d ? D5(Hw(r.maxWait) || 0, e) : a, h = "trailing" in r ? !!r.trailing : h); function f(_) { var b = i, T = n; return i = n = void 0, l = _, o = t.apply(T, b), o; } function p(_) { return l = _, s = setTimeout(g, e), u ? f(_) : o; } function m(_) { var b = _ - c, T = _ - l, E = e - b; return d ? I5(E, a - T) : E; } function y(_) { var b = _ - c, T = _ - l; return c === void 0 || b >= e || b < 0 || d && T >= a; } function g() { var _ = kv(); if (y(_)) return v(_); s = setTimeout(g, m(_)); } function v(_) { return s = void 0, h && i ? f(_) : (i = n = void 0, o); } function x() { s !== void 0 && clearTimeout(s), l = 0, i = c = n = s = void 0; } function w() { return s === void 0 ? o : v(kv()); } function S() { var _ = kv(), b = y(_); if (i = arguments, n = this, c = _, b) { if (s === void 0) return p(c); if (d) return clearTimeout(s), s = setTimeout(g, e), f(c); } return s === void 0 && (s = setTimeout(g, e)), o; } return S.cancel = x, S.flush = w, S; } function N5(t, e, r) { var i = t == null ? 0 : t.length; if (!i) return -1; var n = i - 1; return VI(t, R5(e), n); } function Tm(t) { for (var e = -1, r = t == null ? 0 : t.length, i = {}; ++e < r; ) { var n = t[e]; i[n[0]] = n[1]; } return i; } function Cm(t, e) { return mg(t, e); } function ts(t) { return t == null; } function B5(t) { return t === void 0; } function F5(t, e, r, i) { if (!ls(t)) return t; e = fg(e, t); for (var n = -1, a = e.length, o = a - 1, s = t; s != null && ++n < a; ) { var c = Wh(e[n]), l = r; if (c === "__proto__" || c === "constructor" || c === "prototype") return t; if (n != o) { var u = s[c]; l = void 0, l === void 0 && (l = ls(u) ? u : X1(e[n + 1]) ? [] : {}); } qI(s, c, l), s = s[c]; } return t; } function z5(t, e, r) { for (var i = -1, n = e.length, a = {}; ++i < n; ) { var o = e[i], s = eb(t, o); r(s, o) && F5(a, fg(o, t), s); } return a; } function $5(t, e) { return z5(t, e, function(r, i) { return aC(t, i); }); } var sC = M4(function(t, e) { return t == null ? {} : $5(t, e); }); const Yo = (t) => t === void 0, Zc = (t) => typeof t == "boolean", hi = (t) => typeof t == "number", ol = (t) => typeof Element > "u" ? !1 : t instanceof Element, Am = (t) => ts(t), V5 = (t) => Ei(t) ? !Number.isNaN(Number(t)) : !1, U5 = (t = "") => t.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"), d2 = (t) => Object.keys(t); let lC = class extends Error { constructor(e) { super(e), this.name = "ElementPlusError"; } }; function j5(t, e) { throw new lC(`[${t}] ${e}`); } function Vr(t, e) { if (process.env.NODE_ENV !== "production") { const r = Ei(t) ? new lC(`[${t}] ${e}`) : t; console.warn(r); } } const H5 = "utils/dom/style", cC = (t = "") => t.split(" ").filter((e) => !!e.trim()), py = (t, e) => { !t || !e.trim() || t.classList.add(...cC(e)); }, sl = (t, e) => { !t || !e.trim() || t.classList.remove(...cC(e)); }, cd = (t, e) => { var r; if (!$r || !t || !e) return ""; let i = XD(e); i === "float" && (i = "cssFloat"); try { const n = t.style[i]; if (n) return n; const a = (r = document.defaultView) == null ? void 0 : r.getComputedStyle(t, ""); return a ? a[i] : ""; } catch { return t.style[i]; } }; function Yc(t, e = "px") { if (!t) return ""; if (hi(t) || V5(t)) return `${t}${e}`; if (Ei(t)) return t; Vr(H5, "binding value must be a string or number"); } function G5(t, e) { if (!$r) return; if (!e) { t.scrollTop = 0; return; } const r = []; let i = e.offsetParent; for (; i !== null && t !== i && t.contains(i); ) r.push(i), i = i.offsetParent; const n = e.offsetTop + r.reduce((c, l) => c + l.offsetTop, 0), a = n + e.offsetHeight, o = t.scrollTop, s = o + t.clientHeight; n < o ? t.scrollTop = n : a > s && (t.scrollTop = a - t.clientHeight); } /*! Element Plus Icons Vue v2.3.1 */ var W5 = /* @__PURE__ */ Le({ name: "ArrowDown", __name: "arrow-down", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("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" }) ])); } }), gg = W5, q5 = /* @__PURE__ */ Le({ name: "ArrowUp", __name: "arrow-up", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("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" }) ])); } }), uC = q5, X5 = /* @__PURE__ */ Le({ name: "CaretRight", __name: "caret-right", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("path", { fill: "currentColor", d: "M384 192v640l384-320.064z" }) ])); } }), Z5 = X5, Y5 = /* @__PURE__ */ Le({ name: "CircleCheck", __name: "circle-check", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("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" }), Ee("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" }) ])); } }), K5 = Y5, J5 = /* @__PURE__ */ Le({ name: "CircleClose", __name: "circle-close", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("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" }), Ee("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" }) ])); } }), tb = J5, Q5 = /* @__PURE__ */ Le({ name: "Close", __name: "close", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("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" }) ])); } }), Lm = Q5, eB = /* @__PURE__ */ Le({ name: "Delete", __name: "delete", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("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" }) ])); } }), tB = eB, rB = /* @__PURE__ */ Le({ name: "Edit", __name: "edit", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("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" }), Ee("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" }) ])); } }), iB = rB, nB = /* @__PURE__ */ Le({ name: "Finished", __name: "finished", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("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" }) ])); } }), aB = nB, oB = /* @__PURE__ */ Le({ name: "Hide", __name: "hide", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("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" }), Ee("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" }) ])); } }), sB = oB, lB = /* @__PURE__ */ Le({ name: "Loading", __name: "loading", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("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" }) ])); } }), rb = lB, cB = /* @__PURE__ */ Le({ name: "Notebook", __name: "notebook", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("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" }), Ee("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" }) ])); } }), uB = cB, dB = /* @__PURE__ */ Le({ name: "View", __name: "view", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("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" }) ])); } }), hB = dB, pB = /* @__PURE__ */ Le({ name: "Warning", __name: "warning", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("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" }) ])); } }), fB = pB; const dC = "__epPropKey", vt = (t) => t, mB = (t) => di(t) && !!t[dC], vg = (t, e) => { if (!di(t) || mB(t)) return t; const { values: r, required: i, default: n, type: a, validator: o } = t, s = { type: a, required: !!i, validator: r || o ? (c) => { let l = !1, u = []; if (r && (u = Array.from(r), vl(t, "default") && u.push(n), l || (l = u.includes(c))), o && (l || (l = o(c))), !l && u.length > 0) { const d = [...new Set(u)].map((h) => JSON.stringify(h)).join(", "); DT(`Invalid prop: validation failed${e ? ` for prop "${e}"` : ""}. Expected one of [${d}], got value ${JSON.stringify(c)}.`); } return l; } : void 0, [dC]: !0 }; return vl(t, "default") && (s.default = n), s; }, Kt = (t) => Tm(Object.entries(t).map(([e, r]) => [ e, vg(r, e) ])), cs = vt([ String, Object, Function ]), hC = { validating: rb, success: K5, error: tb }, ni = (t, e) => { if (t.install = (r) => { for (const i of [t, ...Object.values(e ?? {})]) r.component(i.name, i); }, e) for (const [r, i] of Object.entries(e)) t[r] = i; return t; }, gB = (t, e) => (t.install = (r) => { r.directive(e, t); }, t), po = (t) => (t.install = oh, t), Gr = { 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" }, ui = "update:modelValue", ib = "change", pC = ["", "default", "small", "large"], vB = (t) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(t), Lc = (t) => t, yB = ["class", "style"], bB = /^on[A-Z]/, xB = (t = {}) => { const { excludeListeners: e = !1, excludeKeys: r } = t, i = ee(() => ((r == null ? void 0 : r.value) || []).concat(yB)), n = Ct(); return n ? ee(() => { var a; return Tm(Object.entries((a = n.proxy) == null ? void 0 : a.$attrs).filter(([o]) => !i.value.includes(o) && !(e && bB.test(o)))); }) : (Vr("use-attrs", "getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"), ee(() => ({}))); }, tm = ({ from: t, replacement: e, scope: r, version: i, ref: n, type: a = "API" }, o) => { ze(() => N(o), (s) => { s && Vr(r, `[${a}] ${t} is about to be deprecated in version ${i}, please use ${e} instead. For more detail, please visit: ${n} `); }, { immediate: !0 }); }; var wB = { name: "en", el: { breadcrumb: { label: "Breadcrumb" }, colorpicker: { confirm: "OK", clear: "Clear", defaultLabel: "color picker", description: "current color is {color}. press enter to select a new color.", alphaLabel: "pick alpha value" }, datepicker: { now: "Now", today: "Today", cancel: "Cancel", clear: "Clear", confirm: "OK", dateTablePrompt: "Use the arrow keys and enter to select the day of the month", monthTablePrompt: "Use the arrow keys and enter to select the month", yearTablePrompt: "Use the arrow keys and enter to select the year", selectedDate: "Selected date", selectDate: "Select date", selectTime: "Select time", startDate: "Start Date", startTime: "Start Time", endDate: "End Date", endTime: "End Time", prevYear: "Previous Year", nextYear: "Next Year", prevMonth: "Previous Month", nextMonth: "Next Month", year: "", month1: "January", month2: "February", month3: "March", month4: "April", month5: "May", month6: "June", month7: "July", month8: "August", month9: "September", month10: "October", month11: "November", month12: "December", week: "week", weeks: { sun: "Sun", mon: "Mon", tue: "Tue", wed: "Wed", thu: "Thu", fri: "Fri", sat: "Sat" }, weeksFull: { sun: "Sunday", mon: "Monday", tue: "Tuesday", wed: "Wednesday", thu: "Thursday", fri: "Friday", sat: "Saturday" }, months: { jan: "Jan", feb: "Feb", mar: "Mar", apr: "Apr", may: "May", jun: "Jun", jul: "Jul", aug: "Aug", sep: "Sep", oct: "Oct", nov: "Nov", dec: "Dec" } }, inputNumber: { decrease: "decrease number", increase: "increase number" }, select: { loading: "Loading", noMatch: "No matching data", noData: "No data", placeholder: "Select" }, mention: { loading: "Loading" }, dropdown: { toggleDropdown: "Toggle Dropdown" }, cascader: { noMatch: "No matching data", loading: "Loading", placeholder: "Select", noData: "No data" }, pagination: { goto: "Go to", pagesize: "/page", total: "Total {total}", pageClassifier: "", page: "Page", prev: "Go to previous page", next: "Go to next page", currentPage: "page {pager}", prevPages: "Previous {pager} pages", nextPages: "Next {pager} pages", deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details" }, dialog: { close: "Close this dialog" }, drawer: { close: "Close this dialog" }, messagebox: { title: "Message", confirm: "OK", cancel: "Cancel", error: "Illegal input", close: "Close this dialog" }, upload: { deleteTip: "press delete to remove", delete: "Delete", preview: "Preview", continue: "Continue" }, slider: { defaultLabel: "slider between {min} and {max}", defaultRangeStartLabel: "pick start value", defaultRangeEndLabel: "pick end value" }, table: { emptyText: "No Data", confirmFilter: "Confirm", resetFilter: "Reset", clearFilter: "All", sumText: "Sum" }, tour: { next: "Next", previous: "Previous", finish: "Finish" }, tree: { emptyText: "No Data" }, transfer: { noMatch: "No matching data", noData: "No data", titles: ["List 1", "List 2"], filterPlaceholder: "Enter keyword", noCheckedFormat: "{total} items", hasCheckedFormat: "{checked}/{total} checked" }, image: { error: "FAILED" }, pageHeader: { title: "Back" }, popconfirm: { confirmButtonText: "Yes", cancelButtonText: "No" }, carousel: { leftArrow: "Carousel arrow left", rightArrow: "Carousel arrow right", indicator: "Carousel switch to index {index}" } } }; const _B = (t) => (e, r) => SB(e, r, N(t)), SB = (t, e, r) => ja(r, t, t).replace(/\{(\w+)\}/g, (i, n) => { var a; return `${(a = e == null ? void 0 : e[n]) != null ? a : `{${n}}`}`; }), MB = (t) => { const e = ee(() => N(t).name), r = cn(t) ? t : we(t); return { lang: e, locale: r, t: _B(t) }; }, fC = Symbol("localeContextKey"), qh = (t) => { const e = t || Ye(fC, we()); return MB(ee(() => e.value || wB)); }, rm = "el", EB = "is-", Bs = (t, e, r, i, n) => { let a = `${t}-${e}`; return r && (a += `-${r}`), i && (a += `__${i}`), n && (a += `--${n}`), a; }, mC = Symbol("namespaceContextKey"), nb = (t) => { const e = t || (Ct() ? Ye(mC, we(rm)) : we(rm)); return ee(() => N(e) || rm); }, Et = (t, e) => { const r = nb(e); return { namespace: r, b: (i = "") => Bs(r.value, t, i, "", ""), e: (i) => i ? Bs(r.value, t, "", i, "") : "", m: (i) => i ? Bs(r.value, t, "", "", i) : "", be: (i, n) => i && n ? Bs(r.value, t, i, n, "") : "", em: (i, n) => i && n ? Bs(r.value, t, "", i, n) : "", bm: (i, n) => i && n ? Bs(r.value, t, i, "", n) : "", bem: (i, n, a) => i && n && a ? Bs(r.value, t, i, n, a) : "", is: (i, ...n) => { const a = n.length >= 1 ? n[0] : !0; return i && a ? `${EB}${i}` : ""; }, cssVar: (i) => { const n = {}; for (const a in i) i[a] && (n[`--${r.value}-${a}`] = i[a]); return n; }, cssVarName: (i) => `--${r.value}-${i}`, cssVarBlock: (i) => { const n = {}; for (const a in i) i[a] && (n[`--${r.value}-${t}-${a}`] = i[a]); return n; }, cssVarBlockName: (i) => `--${r.value}-${t}-${i}` }; }, TB = vg({ type: vt(Boolean), default: null }), CB = vg({ type: vt(Function) }), AB = (t) => { const e = `update:${t}`, r = `onUpdate:${t}`, i = [e], n = { [t]: TB, [r]: CB }; return { useModelToggle: ({ indicator: a, toggleReason: o, shouldHideWhenRouteChanges: s, shouldProceed: c, onShow: l, onHide: u }) => { const d = Ct(), { emit: h } = d, f = d.props, p = ee(() => Di(f[r])), m = ee(() => f[t] === null), y = (_) => { a.value !== !0 && (a.value = !0, o && (o.value = _), Di(l) && l(_)); }, g = (_) => { a.value !== !1 && (a.value = !1, o && (o.value = _), Di(u) && u(_)); }, v = (_) => { if (f.disabled === !0 || Di(c) && !c()) return; const b = p.value && $r; b && h(e, !0), (m.value || !b) && y(_); }, x = (_) => { if (f.disabled === !0 || !$r) return; const b = p.value && $r; b && h(e, !1), (m.value || !b) && g(_); }, w = (_) => { Zc(_) && (f.disabled && _ ? p.value && h(e, !1) : a.value !== _ && (_ ? y() : g())); }, S = () => { a.value ? x() : v(); }; return ze(() => f[t], w), s && d.appContext.config.globalProperties.$route !== void 0 && ze(() => ({ ...d.proxy.$route }), () => { s.value && a.value && x(); }), Lt(() => { w(f[t]); }), { hide: x, show: v, toggle: S, hasUpdateHandler: p }; }, useModelToggleProps: n, useModelToggleEmits: i }; }, gC = (t) => { const e = Ct(); return ee(() => { var r, i; return (i = (r = e == null ? void 0 : e.proxy) == null ? void 0 : r.$props) == null ? void 0 : i[t]; }); }; var Gi = "top", Mn = "bottom", En = "right", Wi = "left", ab = "auto", Xh = [Gi, Mn, En, Wi], Kc = "start", ch = "end", LB = "clippingParents", vC = "viewport", ud = "popper", kB = "reference", h2 = Xh.reduce(function(t, e) { return t.concat([e + "-" + Kc, e + "-" + ch]); }, []), yg = [].concat(Xh, [ab]).reduce(function(t, e) { return t.concat([e, e + "-" + Kc, e + "-" + ch]); }, []), PB = "beforeRead", RB = "read", OB = "afterRead", DB = "beforeMain", IB = "main", NB = "afterMain", BB = "beforeWrite", FB = "write", zB = "afterWrite", $B = [PB, RB, OB, DB, IB, NB, BB, FB, zB]; function va(t) { return t ? (t.nodeName || "").toLowerCase() : null; } function Yn(t) { if (t == null) return window; if (t.toString() !== "[object Window]") { var e = t.ownerDocument; return e && e.defaultView || window; } return t; } function Jc(t) { var e = Yn(t).Element; return t instanceof e || t instanceof Element; } function _n(t) { var e = Yn(t).HTMLElement; return t instanceof e || t instanceof HTMLElement; } function ob(t) { if (typeof ShadowRoot > "u") return !1; var e = Yn(t).ShadowRoot; return t instanceof e || t instanceof ShadowRoot; } function VB(t) { var e = t.state; Object.keys(e.elements).forEach(function(r) { var i = e.styles[r] || {}, n = e.attributes[r] || {}, a = e.elements[r]; !_n(a) || !va(a) || (Object.assign(a.style, i), Object.keys(n).forEach(function(o) { var s = n[o]; s === !1 ? a.removeAttribute(o) : a.setAttribute(o, s === !0 ? "" : s); })); }); } function UB(t) { var e = t.state, r = { popper: { position: e.options.strategy, left: "0", top: "0", margin: "0" }, arrow: { position: "absolute" }, reference: {} }; return Object.assign(e.elements.popper.style, r.popper), e.styles = r, e.elements.arrow && Object.assign(e.elements.arrow.style, r.arrow), function() { Object.keys(e.elements).forEach(function(i) { var n = e.elements[i], a = e.attributes[i] || {}, o = Object.keys(e.styles.hasOwnProperty(i) ? e.styles[i] : r[i]), s = o.reduce(function(c, l) { return c[l] = "", c; }, {}); !_n(n) || !va(n) || (Object.assign(n.style, s), Object.keys(a).forEach(function(c) { n.removeAttribute(c); })); }); }; } var yC = { name: "applyStyles", enabled: !0, phase: "write", fn: VB, effect: UB, requires: ["computeStyles"] }; function ha(t) { return t.split("-")[0]; } var ll = Math.max, km = Math.min, Qc = Math.round; function eu(t, e) { e === void 0 && (e = !1); var r = t.getBoundingClientRect(), i = 1, n = 1; if (_n(t) && e) { var a = t.offsetHeight, o = t.offsetWidth; o > 0 && (i = Qc(r.width) / o || 1), a > 0 && (n = Qc(r.height) / a || 1); } return { width: r.width / i, height: r.height / n, top: r.top / n, right: r.right / i, bottom: r.bottom / n, left: r.left / i, x: r.left / i, y: r.top / n }; } function sb(t) { var e = eu(t), r = t.offsetWidth, i = t.offsetHeight; return Math.abs(e.width - r) <= 1 && (r = e.width), Math.abs(e.height - i) <= 1 && (i = e.height), { x: t.offsetLeft, y: t.offsetTop, width: r, height: i }; } function bC(t, e) { var r = e.getRootNode && e.getRootNode(); if (t.contains(e)) return !0; if (r && ob(r)) { var i = e; do { if (i && t.isSameNode(i)) return !0; i = i.parentNode || i.host; } while (i); } return !1; } function to(t) { return Yn(t).getComputedStyle(t); } function jB(t) { return ["table", "td", "th"].indexOf(va(t)) >= 0; } function Es(t) { return ((Jc(t) ? t.ownerDocument : t.document) || window.document).documentElement; } function bg(t) { return va(t) === "html" ? t : t.assignedSlot || t.parentNode || (ob(t) ? t.host : null) || Es(t); } function p2(t) { return !_n(t) || to(t).position === "fixed" ? null : t.offsetParent; } function HB(t) { var e = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1, r = navigator.userAgent.indexOf("Trident") !== -1; if (r && _n(t)) { var i = to(t); if (i.position === "fixed") return null; } var n = bg(t); for (ob(n) && (n = n.host); _n(n) && ["html", "body"].indexOf(va(n)) < 0; ) { var a = to(n); if (a.transform !== "none" || a.perspective !== "none" || a.contain === "paint" || ["transform", "perspective"].indexOf(a.willChange) !== -1 || e && a.willChange === "filter" || e && a.filter && a.filter !== "none") return n; n = n.parentNode; } return null; } function Zh(t) { for (var e = Yn(t), r = p2(t); r && jB(r) && to(r).position === "static"; ) r = p2(r); return r && (va(r) === "html" || va(r) === "body" && to(r).position === "static") ? e : r || HB(t) || e; } function lb(t) { return ["top", "bottom"].indexOf(t) >= 0 ? "x" : "y"; } function Gd(t, e, r) { return ll(t, km(e, r)); } function GB(t, e, r) { var i = Gd(t, e, r); return i > r ? r : i; } function xC() { return { top: 0, right: 0, bottom: 0, left: 0 }; } function wC(t) { return Object.assign({}, xC(), t); } function _C(t, e) { return e.reduce(function(r, i) { return r[i] = t, r; }, {}); } var WB = function(t, e) { return t = typeof t == "function" ? t(Object.assign({}, e.rects, { placement: e.placement })) : t, wC(typeof t != "number" ? t : _C(t, Xh)); }; function qB(t) { var e, r = t.state, i = t.name, n = t.options, a = r.elements.arrow, o = r.modifiersData.popperOffsets, s = ha(r.placement), c = lb(s), l = [Wi, En].indexOf(s) >= 0, u = l ? "height" : "width"; if (!(!a || !o)) { var d = WB(n.padding, r), h = sb(a), f = c === "y" ? Gi : Wi, p = c === "y" ? Mn : En, m = r.rects.reference[u] + r.rects.reference[c] - o[c] - r.rects.popper[u], y = o[c] - r.rects.reference[c], g = Zh(a), v = g ? c === "y" ? g.clientHeight || 0 : g.clientWidth || 0 : 0, x = m / 2 - y / 2, w = d[f], S = v - h[u] - d[p], _ = v / 2 - h[u] / 2 + x, b = Gd(w, _, S), T = c; r.modifiersData[i] = (e = {}, e[T] = b, e.centerOffset = b - _, e); } } function XB(t) { var e = t.state, r = t.options, i = r.element, n = i === void 0 ? "[data-popper-arrow]" : i; n != null && (typeof n == "string" && (n = e.elements.popper.querySelector(n), !n) || !bC(e.elements.popper, n) || (e.elements.arrow = n)); } var ZB = { name: "arrow", enabled: !0, phase: "main", fn: qB, effect: XB, requires: ["popperOffsets"], requiresIfExists: ["preventOverflow"] }; function tu(t) { return t.split("-")[1]; } var YB = { top: "auto", right: "auto", bottom: "auto", left: "auto" }; function KB(t) { var e = t.x, r = t.y, i = window, n = i.devicePixelRatio || 1; return { x: Qc(e * n) / n || 0, y: Qc(r * n) / n || 0 }; } function f2(t) { var e, r = t.popper, i = t.popperRect, n = t.placement, a = t.variation, o = t.offsets, s = t.position, c = t.gpuAcceleration, l = t.adaptive, u = t.roundOffsets, d = t.isFixed, h = o.x, f = h === void 0 ? 0 : h, p = o.y, m = p === void 0 ? 0 : p, y = typeof u == "function" ? u({ x: f, y: m }) : { x: f, y: m }; f = y.x, m = y.y; var g = o.hasOwnProperty("x"), v = o.hasOwnProperty("y"), x = Wi, w = Gi, S = window; if (l) { var _ = Zh(r), b = "clientHeight", T = "clientWidth"; if (_ === Yn(r) && (_ = Es(r), to(_).position !== "static" && s === "absolute" && (b = "scrollHeight", T = "scrollWidth")), _ = _, n === Gi || (n === Wi || n === En) && a === ch) { w = Mn; var E = d && _ === S && S.visualViewport ? S.visualViewport.height : _[b]; m -= E - i.height, m *= c ? 1 : -1; } if (n === Wi || (n === Gi || n === Mn) && a === ch) { x = En; var C = d && _ === S && S.visualViewport ? S.visualViewport.width : _[T]; f -= C - i.width, f *= c ? 1 : -1; } } var L = Object.assign({ position: s }, l && YB), A = u === !0 ? KB({ x: f, y: m }) : { x: f, y: m }; if (f = A.x, m = A.y, c) { var k; return Object.assign({}, L, (k = {}, k[w] = v ? "0" : "", k[x] = g ? "0" : "", k.transform = (S.devicePixelRatio || 1) <= 1 ? "translate(" + f + "px, " + m + "px)" : "translate3d(" + f + "px, " + m + "px, 0)", k)); } return Object.assign({}, L, (e = {}, e[w] = v ? m + "px" : "", e[x] = g ? f + "px" : "", e.transform = "", e)); } function JB(t) { var e = t.state, r = t.options, i = r.gpuAcceleration, n = i === void 0 ? !0 : i, a = r.adaptive, o = a === void 0 ? !0 : a, s = r.roundOffsets, c = s === void 0 ? !0 : s, l = { placement: ha(e.placement), variation: tu(e.placement), popper: e.elements.popper, popperRect: e.rects.popper, gpuAcceleration: n, isFixed: e.options.strategy === "fixed" }; e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, f2(Object.assign({}, l, { offsets: e.modifiersData.popperOffsets, position: e.options.strategy, adaptive: o, roundOffsets: c })))), e.modifiersData.arrow != null && (e.styles.arrow = Object.assign({}, e.styles.arrow, f2(Object.assign({}, l, { offsets: e.modifiersData.arrow, position: "absolute", adaptive: !1, roundOffsets: c })))), e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-placement": e.placement }); } var SC = { name: "computeStyles", enabled: !0, phase: "beforeWrite", fn: JB, data: {} }, Op = { passive: !0 }; function QB(t) { var e = t.state, r = t.instance, i = t.options, n = i.scroll, a = n === void 0 ? !0 : n, o = i.resize, s = o === void 0 ? !0 : o, c = Yn(e.elements.popper), l = [].concat(e.scrollParents.reference, e.scrollParents.popper); return a && l.forEach(function(u) { u.addEventListener("scroll", r.update, Op); }), s && c.addEventListener("resize", r.update, Op), function() { a && l.forEach(function(u) { u.removeEventListener("scroll", r.update, Op); }), s && c.removeEventListener("resize", r.update, Op); }; } var MC = { name: "eventListeners", enabled: !0, phase: "write", fn: function() { }, effect: QB, data: {} }, eF = { left: "right", right: "left", bottom: "top", top: "bottom" }; function im(t) { return t.replace(/left|right|bottom|top/g, function(e) { return eF[e]; }); } var tF = { start: "end", end: "start" }; function m2(t) { return t.replace(/start|end/g, function(e) { return tF[e]; }); } function cb(t) { var e = Yn(t), r = e.pageXOffset, i = e.pageYOffset; return { scrollLeft: r, scrollTop: i }; } function ub(t) { return eu(Es(t)).left + cb(t).scrollLeft; } function rF(t) { var e = Yn(t), r = Es(t), i = e.visualViewport, n = r.clientWidth, a = r.clientHeight, o = 0, s = 0; return i && (n = i.width, a = i.height, /^((?!chrome|android).)*safari/i.test(navigator.userAgent) || (o = i.offsetLeft, s = i.offsetTop)), { width: n, height: a, x: o + ub(t), y: s }; } function iF(t) { var e, r = Es(t), i = cb(t), n = (e = t.ownerDocument) == null ? void 0 : e.body, a = ll(r.scrollWidth, r.clientWidth, n ? n.scrollWidth : 0, n ? n.clientWidth : 0), o = ll(r.scrollHeight, r.clientHeight, n ? n.scrollHeight : 0, n ? n.clientHeight : 0), s = -i.scrollLeft + ub(t), c = -i.scrollTop; return to(n || r).direction === "rtl" && (s += ll(r.clientWidth, n ? n.clientWidth : 0) - a), { width: a, height: o, x: s, y: c }; } function db(t) { var e = to(t), r = e.overflow, i = e.overflowX, n = e.overflowY; return /auto|scroll|overlay|hidden/.test(r + n + i); } function EC(t) { return ["html", "body", "#document"].indexOf(va(t)) >= 0 ? t.ownerDocument.body : _n(t) && db(t) ? t : EC(bg(t)); } function Wd(t, e) { var r; e === void 0 && (e = []); var i = EC(t), n = i === ((r = t.ownerDocument) == null ? void 0 : r.body), a = Yn(i), o = n ? [a].concat(a.visualViewport || [], db(i) ? i : []) : i, s = e.concat(o); return n ? s : s.concat(Wd(bg(o))); } function fy(t) { return Object.assign({}, t, { left: t.x, top: t.y, right: t.x + t.width, bottom: t.y + t.height }); } function nF(t) { var e = eu(t); return e.top = e.top + t.clientTop, e.left = e.left + t.clientLeft, e.bottom = e.top + t.clientHeight, e.right = e.left + t.clientWidth, e.width = t.clientWidth, e.height = t.clientHeight, e.x = e.left, e.y = e.top, e; } function g2(t, e) { return e === vC ? fy(rF(t)) : Jc(e) ? nF(e) : fy(iF(Es(t))); } function aF(t) { var e = Wd(bg(t)), r = ["absolute", "fixed"].indexOf(to(t).position) >= 0, i = r && _n(t) ? Zh(t) : t; return Jc(i) ? e.filter(function(n) { return Jc(n) && bC(n, i) && va(n) !== "body"; }) : []; } function oF(t, e, r) { var i = e === "clippingParents" ? aF(t) : [].concat(e), n = [].concat(i, [r]), a = n[0], o = n.reduce(function(s, c) { var l = g2(t, c); return s.top = ll(l.top, s.top), s.right = km(l.right, s.right), s.bottom = km(l.bottom, s.bottom), s.left = ll(l.left, s.left), s; }, g2(t, a)); return o.width = o.right - o.left, o.height = o.bottom - o.top, o.x = o.left, o.y = o.top, o; } function TC(t) { var e = t.reference, r = t.element, i = t.placement, n = i ? ha(i) : null, a = i ? tu(i) : null, o = e.x + e.width / 2 - r.width / 2, s = e.y + e.height / 2 - r.height / 2, c; switch (n) { case Gi: c = { x: o, y: e.y - r.height }; break; case Mn: c = { x: o, y: e.y + e.height }; break; case En: c = { x: e.x + e.width, y: s }; break; case Wi: c = { x: e.x - r.width, y: s }; break; default: c = { x: e.x, y: e.y }; } var l = n ? lb(n) : null; if (l != null) { var u = l === "y" ? "height" : "width"; switch (a) { case Kc: c[l] = c[l] - (e[u] / 2 - r[u] / 2); break; case ch: c[l] = c[l] + (e[u] / 2 - r[u] / 2); break; } } return c; } function uh(t, e) { e === void 0 && (e = {}); var r = e, i = r.placement, n = i === void 0 ? t.placement : i, a = r.boundary, o = a === void 0 ? LB : a, s = r.rootBoundary, c = s === void 0 ? vC : s, l = r.elementContext, u = l === void 0 ? ud : l, d = r.altBoundary, h = d === void 0 ? !1 : d, f = r.padding, p = f === void 0 ? 0 : f, m = wC(typeof p != "number" ? p : _C(p, Xh)), y = u === ud ? kB : ud, g = t.rects.popper, v = t.elements[h ? y : u], x = oF(Jc(v) ? v : v.contextElement || Es(t.elements.popper), o, c), w = eu(t.elements.reference), S = TC({ reference: w, element: g, strategy: "absolute", placement: n }), _ = fy(Object.assign({}, g, S)), b = u === ud ? _ : w, T = { top: x.top - b.top + m.top, bottom: b.bottom - x.bottom + m.bottom, left: x.left - b.left + m.left, right: b.right - x.right + m.right }, E = t.modifiersData.offset; if (u === ud && E) { var C = E[n]; Object.keys(T).forEach(function(L) { var A = [En, Mn].indexOf(L) >= 0 ? 1 : -1, k = [Gi, Mn].indexOf(L) >= 0 ? "y" : "x"; T[L] += C[k] * A; }); } return T; } function sF(t, e) { e === void 0 && (e = {}); var r = e, i = r.placement, n = r.boundary, a = r.rootBoundary, o = r.padding, s = r.flipVariations, c = r.allowedAutoPlacements, l = c === void 0 ? yg : c, u = tu(i), d = u ? s ? h2 : h2.filter(function(p) { return tu(p) === u; }) : Xh, h = d.filter(function(p) { return l.indexOf(p) >= 0; }); h.length === 0 && (h = d); var f = h.reduce(function(p, m) { return p[m] = uh(t, { placement: m, boundary: n, rootBoundary: a, padding: o })[ha(m)], p; }, {}); return Object.keys(f).sort(function(p, m) { return f[p] - f[m]; }); } function lF(t) { if (ha(t) === ab) return []; var e = im(t); return [m2(t), e, m2(e)]; } function cF(t) { var e = t.state, r = t.options, i = t.name; if (!e.modifiersData[i]._skip) { for (var n = r.mainAxis, a = n === void 0 ? !0 : n, o = r.altAxis, s = o === void 0 ? !0 : o, c = r.fallbackPlacements, l = r.padding, u = r.boundary, d = r.rootBoundary, h = r.altBoundary, f = r.flipVariations, p = f === void 0 ? !0 : f, m = r.allowedAutoPlacements, y = e.options.placement, g = ha(y), v = g === y, x = c || (v || !p ? [im(y)] : lF(y)), w = [y].concat(x).reduce(function(re, K) { return re.concat(ha(K) === ab ? sF(e, { placement: K, boundary: u, rootBoundary: d, padding: l, flipVariations: p, allowedAutoPlacements: m }) : K); }, []), S = e.rects.reference, _ = e.rects.popper, b = /* @__PURE__ */ new Map(), T = !0, E = w[0], C = 0; C < w.length; C++) { var L = w[C], A = ha(L), k = tu(L) === Kc, P = [Gi, Mn].indexOf(A) >= 0, R = P ? "width" : "height", M = uh(e, { placement: L, boundary: u, rootBoundary: d, altBoundary: h, padding: l }), O = P ? k ? En : Wi : k ? Mn : Gi; S[R] > _[R] && (O = im(O)); var D = im(O), I = []; if (a && I.push(M[A] <= 0), s && I.push(M[O] <= 0, M[D] <= 0), I.every(function(re) { return re; })) { E = L, T = !1; break; } b.set(L, I); } if (T) for (var F = p ? 3 : 1, z = function(re) { var K = w.find(function(V) { var H = b.get(V); if (H) return H.slice(0, re).every(function(G) { return G; }); }); if (K) return E = K, "break"; }, U = F; U > 0; U--) { var Z = z(U); if (Z === "break") break; } e.placement !== E && (e.modifiersData[i]._skip = !0, e.placement = E, e.reset = !0); } } var uF = { name: "flip", enabled: !0, phase: "main", fn: cF, requiresIfExists: ["offset"], data: { _skip: !1 } }; function v2(t, e, r) { return r === void 0 && (r = { x: 0, y: 0 }), { top: t.top - e.height - r.y, right: t.right - e.width + r.x, bottom: t.bottom - e.height + r.y, left: t.left - e.width - r.x }; } function y2(t) { return [Gi, En, Mn, Wi].some(function(e) { return t[e] >= 0; }); } function dF(t) { var e = t.state, r = t.name, i = e.rects.reference, n = e.rects.popper, a = e.modifiersData.preventOverflow, o = uh(e, { elementContext: "reference" }), s = uh(e, { altBoundary: !0 }), c = v2(o, i), l = v2(s, n, a), u = y2(c), d = y2(l); e.modifiersData[r] = { referenceClippingOffsets: c, popperEscapeOffsets: l, isReferenceHidden: u, hasPopperEscaped: d }, e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-reference-hidden": u, "data-popper-escaped": d }); } var hF = { name: "hide", enabled: !0, phase: "main", requiresIfExists: ["preventOverflow"], fn: dF }; function pF(t, e, r) { var i = ha(t), n = [Wi, Gi].indexOf(i) >= 0 ? -1 : 1, a = typeof r == "function" ? r(Object.assign({}, e, { placement: t })) : r, o = a[0], s = a[1]; return o = o || 0, s = (s || 0) * n, [Wi, En].indexOf(i) >= 0 ? { x: s, y: o } : { x: o, y: s }; } function fF(t) { var e = t.state, r = t.options, i = t.name, n = r.offset, a = n === void 0 ? [0, 0] : n, o = yg.reduce(function(u, d) { return u[d] = pF(d, e.rects, a), u; }, {}), s = o[e.placement], c = s.x, l = s.y; e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += c, e.modifiersData.popperOffsets.y += l), e.modifiersData[i] = o; } var mF = { name: "offset", enabled: !0, phase: "main", requires: ["popperOffsets"], fn: fF }; function gF(t) { var e = t.state, r = t.name; e.modifiersData[r] = TC({ reference: e.rects.reference, element: e.rects.popper, strategy: "absolute", placement: e.placement }); } var CC = { name: "popperOffsets", enabled: !0, phase: "read", fn: gF, data: {} }; function vF(t) { return t === "x" ? "y" : "x"; } function yF(t) { var e = t.state, r = t.options, i = t.name, n = r.mainAxis, a = n === void 0 ? !0 : n, o = r.altAxis, s = o === void 0 ? !1 : o, c = r.boundary, l = r.rootBoundary, u = r.altBoundary, d = r.padding, h = r.tether, f = h === void 0 ? !0 : h, p = r.tetherOffset, m = p === void 0 ? 0 : p, y = uh(e, { boundary: c, rootBoundary: l, padding: d, altBoundary: u }), g = ha(e.placement), v = tu(e.placement), x = !v, w = lb(g), S = vF(w), _ = e.modifiersData.popperOffsets, b = e.rects.reference, T = e.rects.popper, E = typeof m == "function" ? m(Object.assign({}, e.rects, { placement: e.placement })) : m, C = typeof E == "number" ? { mainAxis: E, altAxis: E } : Object.assign({ mainAxis: 0, altAxis: 0 }, E), L = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, A = { x: 0, y: 0 }; if (_) { if (a) { var k, P = w === "y" ? Gi : Wi, R = w === "y" ? Mn : En, M = w === "y" ? "height" : "width", O = _[w], D = O + y[P], I = O - y[R], F = f ? -T[M] / 2 : 0, z = v === Kc ? b[M] : T[M], U = v === Kc ? -T[M] : -b[M], Z = e.elements.arrow, re = f && Z ? sb(Z) : { width: 0, height: 0 }, K = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : xC(), V = K[P], H = K[R], G = Gd(0, b[M], re[M]), W = x ? b[M] / 2 - F - G - V - C.mainAxis : z - G - V - C.mainAxis, Y = x ? -b[M] / 2 + F + G + H + C.mainAxis : U + G + H + C.mainAxis, X = e.elements.arrow && Zh(e.elements.arrow), ie = X ? w === "y" ? X.clientTop || 0 : X.clientLeft || 0 : 0, ue = (k = L == null ? void 0 : L[w]) != null ? k : 0, $ = O + W - ue - ie, J = O + Y - ue, ne = Gd(f ? km(D, $) : D, O, f ? ll(I, J) : I); _[w] = ne, A[w] = ne - O; } if (s) { var j, q = w === "x" ? Gi : Wi, ge = w === "x" ? Mn : En, ye = _[S], _e = S === "y" ? "height" : "width", Me = ye + y[q], Ce = ye - y[ge], B = [Gi, Wi].indexOf(g) !== -1, ce = (j = L == null ? void 0 : L[S]) != null ? j : 0, ve = B ? Me : ye - b[_e] - T[_e] - ce + C.altAxis, te = B ? ye + b[_e] + T[_e] - ce - C.altAxis : Ce, pe = f && B ? GB(ve, ye, te) : Gd(f ? ve : Me, ye, f ? te : Ce); _[S] = pe, A[S] = pe - ye; } e.modifiersData[i] = A; } } var bF = { name: "preventOverflow", enabled: !0, phase: "main", fn: yF, requiresIfExists: ["offset"] }; function xF(t) { return { scrollLeft: t.scrollLeft, scrollTop: t.scrollTop }; } function wF(t) { return t === Yn(t) || !_n(t) ? cb(t) : xF(t); } function _F(t) { var e = t.getBoundingClientRect(), r = Qc(e.width) / t.offsetWidth || 1, i = Qc(e.height) / t.offsetHeight || 1; return r !== 1 || i !== 1; } function SF(t, e, r) { r === void 0 && (r = !1); var i = _n(e), n = _n(e) && _F(e), a = Es(e), o = eu(t, n), s = { scrollLeft: 0, scrollTop: 0 }, c = { x: 0, y: 0 }; return (i || !i && !r) && ((va(e) !== "body" || db(a)) && (s = wF(e)), _n(e) ? (c = eu(e, !0), c.x += e.clientLeft, c.y += e.clientTop) : a && (c.x = ub(a))), { x: o.left + s.scrollLeft - c.x, y: o.top + s.scrollTop - c.y, width: o.width, height: o.height }; } function MF(t) { var e = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), i = []; t.forEach(function(a) { e.set(a.name, a); }); function n(a) { r.add(a.name); var o = [].concat(a.requires || [], a.requiresIfExists || []); o.forEach(function(s) { if (!r.has(s)) { var c = e.get(s); c && n(c); } }), i.push(a); } return t.forEach(function(a) { r.has(a.name) || n(a); }), i; } function EF(t) { var e = MF(t); return $B.reduce(function(r, i) { return r.concat(e.filter(function(n) { return n.phase === i; })); }, []); } function TF(t) { var e; return function() { return e || (e = new Promise(function(r) { Promise.resolve().then(function() { e = void 0, r(t()); }); })), e; }; } function CF(t) { var e = t.reduce(function(r, i) { var n = r[i.name]; return r[i.name] = n ? Object.assign({}, n, i, { options: Object.assign({}, n.options, i.options), data: Object.assign({}, n.data, i.data) }) : i, r; }, {}); return Object.keys(e).map(function(r) { return e[r]; }); } var b2 = { placement: "bottom", modifiers: [], strategy: "absolute" }; function x2() { for (var t = arguments.length, e = new Array(t), r = 0; r < t; r++) e[r] = arguments[r]; return !e.some(function(i) { return !(i && typeof i.getBoundingClientRect == "function"); }); } function hb(t) { t === void 0 && (t = {}); var e = t, r = e.defaultModifiers, i = r === void 0 ? [] : r, n = e.defaultOptions, a = n === void 0 ? b2 : n; return function(o, s, c) { c === void 0 && (c = a); var l = { placement: "bottom", orderedModifiers: [], options: Object.assign({}, b2, a), modifiersData: {}, elements: { reference: o, popper: s }, attributes: {}, styles: {} }, u = [], d = !1, h = { state: l, setOptions: function(m) { var y = typeof m == "function" ? m(l.options) : m; p(), l.options = Object.assign({}, a, l.options, y), l.scrollParents = { reference: Jc(o) ? Wd(o) : o.contextElement ? Wd(o.contextElement) : [], popper: Wd(s) }; var g = EF(CF([].concat(i, l.options.modifiers))); return l.orderedModifiers = g.filter(function(v) { return v.enabled; }), f(), h.update(); }, forceUpdate: function() { if (!d) { var m = l.elements, y = m.reference, g = m.popper; if (x2(y, g)) { l.rects = { reference: SF(y, Zh(g), l.options.strategy === "fixed"), popper: sb(g) }, l.reset = !1, l.placement = l.options.placement, l.orderedModifiers.forEach(function(T) { return l.modifiersData[T.name] = Object.assign({}, T.data); }); for (var v = 0; v < l.orderedModifiers.length; v++) { if (l.reset === !0) { l.reset = !1, v = -1; continue; } var x = l.orderedModifiers[v], w = x.fn, S = x.options, _ = S === void 0 ? {} : S, b = x.name; typeof w == "function" && (l = w({ state: l, options: _, name: b, instance: h }) || l); } } } }, update: TF(function() { return new Promise(function(m) { h.forceUpdate(), m(l); }); }), destroy: function() { p(), d = !0; } }; if (!x2(o, s)) return h; h.setOptions(c).then(function(m) { !d && c.onFirstUpdate && c.onFirstUpdate(m); }); function f() { l.orderedModifiers.forEach(function(m) { var y = m.name, g = m.options, v = g === void 0 ? {} : g, x = m.effect; if (typeof x == "function") { var w = x({ state: l, name: y, instance: h, options: v }), S = function() { }; u.push(w || S); } }); } function p() { u.forEach(function(m) { return m(); }), u = []; } return h; }; } hb(); var AF = [MC, CC, SC, yC]; hb({ defaultModifiers: AF }); var LF = [MC, CC, SC, yC, mF, uF, bF, ZB, hF], kF = hb({ defaultModifiers: LF }); const PF = (t, e, r = {}) => { const i = { name: "updateState", enabled: !0, phase: "write", fn: ({ state: c }) => { const l = RF(c); Object.assign(o.value, l); }, requires: ["computeStyles"] }, n = ee(() => { const { onFirstUpdate: c, placement: l, strategy: u, modifiers: d } = N(r); return { onFirstUpdate: c, placement: l || "bottom", strategy: u || "absolute", modifiers: [ ...d || [], i, { name: "applyStyles", enabled: !1 } ] }; }), a = mr(), o = we({ styles: { popper: { position: N(n).strategy, left: "0", top: "0" }, arrow: { position: "absolute" } }, attributes: {} }), s = () => { a.value && (a.value.destroy(), a.value = void 0); }; return ze(n, (c) => { const l = N(a); l && l.setOptions(c); }, { deep: !0 }), ze([t, e], ([c, l]) => { s(), !(!c || !l) && (a.value = kF(c, l, N(n))); }), Sr(() => { s(); }), { state: ee(() => { var c; return { ...((c = N(a)) == null ? void 0 : c.state) || {} }; }), styles: ee(() => N(o).styles), attributes: ee(() => N(o).attributes), update: () => { var c; return (c = N(a)) == null ? void 0 : c.update(); }, forceUpdate: () => { var c; return (c = N(a)) == null ? void 0 : c.forceUpdate(); }, instanceRef: ee(() => N(a)) }; }; function RF(t) { const e = Object.keys(t.elements), r = Tm(e.map((n) => [n, t.styles[n] || {}])), i = Tm(e.map((n) => [n, t.attributes[n]])); return { styles: r, attributes: i }; } function w2() { let t; const e = (i, n) => { r(), t = window.setTimeout(i, n); }, r = () => window.clearTimeout(t); return cg(() => r()), { registerTimeout: e, cancelTimeout: r }; } const my = { prefix: Math.floor(Math.random() * 1e4), current: 0 }, OF = Symbol("elIdInjection"), AC = () => Ct() ? Ye(OF, my) : my, xg = (t) => { const e = AC(); !$r && e === my && Vr("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 = nb(); return ee(() => N(t) || `${r.value}-id-${e.prefix}-${e.current++}`); }; let kc = []; const _2 = (t) => { const e = t; e.key === Gr.esc && kc.forEach((r) => r(e)); }, DF = (t) => { Lt(() => { kc.length === 0 && document.addEventListener("keydown", _2), $r && kc.push(t); }), Sr(() => { kc = kc.filter((e) => e !== t), kc.length === 0 && $r && document.removeEventListener("keydown", _2); }); }; let S2; const LC = () => { const t = nb(), e = AC(), r = ee(() => `${t.value}-popper-container-${e.prefix}`), i = ee(() => `#${r.value}`); return { id: r, selector: i }; }, IF = (t) => { const e = document.createElement("div"); return e.id = t, document.body.appendChild(e), e; }, NF = () => { const { id: t, selector: e } = LC(); return IT(() => { $r && (process.env.NODE_ENV === "test" || !S2 || !document.body.querySelector(e.value)) && (S2 = IF(t.value)); }), { id: t, selector: e }; }, BF = Kt({ showAfter: { type: Number, default: 0 }, hideAfter: { type: Number, default: 200 }, autoClose: { type: Number, default: 0 } }), FF = ({ showAfter: t, hideAfter: e, autoClose: r, open: i, close: n }) => { const { registerTimeout: a } = w2(), { registerTimeout: o, cancelTimeout: s } = w2(); return { onOpen: (c) => { a(() => { i(c); const l = N(r); hi(l) && l > 0 && o(() => { n(c); }, l); }, N(t)); }, onClose: (c) => { s(), a(() => { n(c); }, N(e)); } }; }, kC = Symbol("elForwardRef"), zF = (t) => { Dt(kC, { setForwardRef: (e) => { t.value = e; } }); }, $F = (t) => ({ mounted(e) { t(e); }, updated(e) { t(e); }, unmounted() { t(null); } }), M2 = { current: 0 }, E2 = we(0), PC = 2e3, T2 = Symbol("elZIndexContextKey"), RC = Symbol("zIndexContextKey"), OC = (t) => { const e = Ct() ? Ye(T2, M2) : M2, r = t || (Ct() ? Ye(RC, void 0) : void 0), i = ee(() => { const o = N(r); return hi(o) ? o : PC; }), n = ee(() => i.value + E2.value), a = () => (e.current++, E2.value = e.current, n.value); return !$r && !Ye(T2) && Vr("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: i, currentZIndex: n, nextZIndex: a }; }; function VF(t) { let e; function r() { if (t.value == null) return; const { selectionStart: n, selectionEnd: a, value: o } = t.value; if (n == null || a == null) return; const s = o.slice(0, Math.max(0, n)), c = o.slice(Math.max(0, a)); e = { selectionStart: n, selectionEnd: a, value: o, beforeTxt: s, afterTxt: c }; } function i() { if (t.value == null || e == null) return; const { value: n } = t.value, { beforeTxt: a, afterTxt: o, selectionStart: s } = e; if (a == null || o == null || s == null) return; let c = n.length; if (n.endsWith(o)) c = n.length - o.length; else if (n.startsWith(a)) c = a.length; else { const l = a[s - 1], u = n.indexOf(l, s - 1); u !== -1 && (c = u + 1); } t.value.setSelectionRange(c, c); } return [r, i]; } const Du = vg({ type: String, values: pC, required: !1 }), DC = Symbol("size"), UF = () => { const t = Ye(DC, {}); return ee(() => N(t.size) || ""); }; function pb(t, { beforeFocus: e, afterFocus: r, beforeBlur: i, afterBlur: n } = {}) { const a = Ct(), { emit: o } = a, s = mr(), c = we(!1), l = (h) => { Di(e) && e(h) || c.value || (c.value = !0, o("focus", h), r == null || r()); }, u = (h) => { var f; Di(i) && i(h) || h.relatedTarget && (f = s.value) != null && f.contains(h.relatedTarget) || (c.value = !1, o("blur", h), n == null || n()); }, d = () => { var h, f; (h = s.value) != null && h.contains(document.activeElement) && s.value !== document.activeElement || (f = t.value) == null || f.focus(); }; return ze(s, (h) => { h && h.setAttribute("tabindex", "-1"); }), xn(s, "focus", l, !0), xn(s, "blur", u, !0), xn(s, "click", d, !0), process.env.NODE_ENV === "test" && Lt(() => { const h = ol(t.value) ? t.value : document.querySelector("input,textarea"); h && (xn(h, "focus", l, !0), xn(h, "blur", u, !0)); }), { isFocused: c, wrapperRef: s, handleFocus: l, handleBlur: u }; } function IC({ afterComposition: t, emit: e }) { const r = we(!1), i = (o) => { e == null || e("compositionstart", o), r.value = !0; }, n = (o) => { var s; e == null || e("compositionupdate", o); const c = (s = o.target) == null ? void 0 : s.value, l = c[c.length - 1] || ""; r.value = !vB(l); }, a = (o) => { e == null || e("compositionend", o), r.value && (r.value = !1, st(() => t(o))); }; return { isComposing: r, handleComposition: (o) => { o.type === "compositionend" ? a(o) : n(o); }, handleCompositionStart: i, handleCompositionUpdate: n, handleCompositionEnd: a }; } const NC = Symbol("emptyValuesContextKey"), jF = "use-empty-values", HF = ["", void 0, null], GF = void 0, WF = Kt({ emptyValues: Array, valueOnClear: { type: [String, Number, Boolean, Function], default: void 0, validator: (t) => Di(t) ? !t() : !t } }), qF = (t, e) => { const r = Ct() ? Ye(NC, we({})) : we({}), i = ee(() => t.emptyValues || r.value.emptyValues || HF), n = ee(() => Di(t.valueOnClear) ? t.valueOnClear() : t.valueOnClear !== void 0 ? t.valueOnClear : Di(r.value.valueOnClear) ? r.value.valueOnClear() : r.value.valueOnClear !== void 0 ? r.value.valueOnClear : GF), a = (o) => i.value.includes(o); return i.value.includes(n.value) || Vr(jF, "value-on-clear should be a value of empty-values"), { emptyValues: i, valueOnClear: n, isEmptyValue: a }; }, XF = Kt({ ariaLabel: String, ariaOrientation: { type: String, values: ["horizontal", "vertical", "undefined"] }, ariaControls: String }), Ts = (t) => sC(XF, t), BC = Symbol(), Pm = we(); function fb(t, e = void 0) { const r = Ct() ? Ye(BC, Pm) : Pm; return t ? ee(() => { var i, n; return (n = (i = r.value) == null ? void 0 : i[t]) != null ? n : e; }) : r; } function ZF(t, e) { const r = fb(), i = Et(t, ee(() => { var s; return ((s = r.value) == null ? void 0 : s.namespace) || rm; })), n = qh(ee(() => { var s; return (s = r.value) == null ? void 0 : s.locale; })), a = OC(ee(() => { var s; return ((s = r.value) == null ? void 0 : s.zIndex) || PC; })), o = ee(() => { var s; return N(e) || ((s = r.value) == null ? void 0 : s.size) || ""; }); return YF(ee(() => N(r) || {})), { ns: i, locale: n, zIndex: a, size: o }; } const YF = (t, e, r = !1) => { var i; const n = !!Ct(), a = n ? fb() : void 0, o = (i = void 0) != null ? i : n ? Dt : void 0; if (!o) { Vr("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup()."); return; } const s = ee(() => { const c = N(t); return a != null && a.value ? KF(a.value, c) : c; }); return o(BC, s), o(fC, ee(() => s.value.locale)), o(mC, ee(() => s.value.namespace)), o(RC, ee(() => s.value.zIndex)), o(DC, { size: ee(() => s.value.size || "") }), o(NC, ee(() => ({ emptyValues: s.value.emptyValues, valueOnClear: s.value.valueOnClear }))), (r || !Pm.value) && (Pm.value = s.value), s; }, KF = (t, e) => { const r = [.../* @__PURE__ */ new Set([...d2(t), ...d2(e)])], i = {}; for (const n of r) i[n] = e[n] !== void 0 ? e[n] : t[n]; return i; }; var Mt = (t, e) => { const r = t.__vccOpts || t; for (const [i, n] of e) r[i] = n; return r; }; const JF = Kt({ size: { type: vt([Number, String]) }, color: { type: String } }), QF = Le({ name: "ElIcon", inheritAttrs: !1 }), ez = /* @__PURE__ */ Le({ ...QF, props: JF, setup(t) { const e = t, r = Et("icon"), i = ee(() => { const { size: n, color: a } = e; return !n && !a ? {} : { fontSize: Yo(n) ? void 0 : Yc(n), "--color": a }; }); return (n, a) => (Q(), be("i", Nr({ class: N(r).b(), style: N(i) }, n.$attrs), [ Fe(n.$slots, "default") ], 16)); } }); var tz = /* @__PURE__ */ Mt(ez, [["__file", "icon.vue"]]); const Oi = ni(tz), mb = Symbol("formContextKey"), dh = Symbol("formItemContextKey"), bl = (t, e = {}) => { const r = we(void 0), i = e.prop ? r : gC("size"), n = e.global ? r : UF(), a = e.form ? { size: void 0 } : Ye(mb, void 0), o = e.formItem ? { size: void 0 } : Ye(dh, void 0); return ee(() => i.value || N(t) || (o == null ? void 0 : o.size) || (a == null ? void 0 : a.size) || n.value || ""); }, Yh = (t) => { const e = gC("disabled"), r = Ye(mb, void 0); return ee(() => e.value || N(t) || (r == null ? void 0 : r.disabled) || !1); }, zl = () => { const t = Ye(mb, void 0), e = Ye(dh, void 0); return { form: t, formItem: e }; }, Kh = (t, { formItemContext: e, disableIdGeneration: r, disableIdManagement: i }) => { r || (r = we(!1)), i || (i = we(!1)); const n = we(); let a; const o = ee(() => { var s; return !!(!(t.label || t.ariaLabel) && e && e.inputIds && ((s = e.inputIds) == null ? void 0 : s.length) <= 1); }); return Lt(() => { a = ze([pr(t, "id"), r], ([s, c]) => { const l = s ?? (c ? void 0 : xg().value); l !== n.value && (e != null && e.removeInputId && (n.value && e.removeInputId(n.value), !(i != null && i.value) && !c && l && e.addInputId(l)), n.value = l); }, { immediate: !0 }); }), j1(() => { a && a(), e != null && e.removeInputId && n.value && e.removeInputId(n.value); }), { isLabeledByFormItem: o, inputId: n }; }; let kn; const rz = ` height:0 !important; visibility:hidden !important; ${jD() ? "" : "overflow:hidden !important;"} position:absolute !important; z-index:-1000 !important; top:0 !important; right:0 !important; `, iz = [ "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 nz(t) { const e = window.getComputedStyle(t), r = e.getPropertyValue("box-sizing"), i = Number.parseFloat(e.getPropertyValue("padding-bottom")) + Number.parseFloat(e.getPropertyValue("padding-top")), n = Number.parseFloat(e.getPropertyValue("border-bottom-width")) + Number.parseFloat(e.getPropertyValue("border-top-width")); return { contextStyle: iz.map((a) => `${a}:${e.getPropertyValue(a)}`).join(";"), paddingSize: i, borderSize: n, boxSizing: r }; } function C2(t, e = 1, r) { var i; kn || (kn = document.createElement("textarea"), document.body.appendChild(kn)); const { paddingSize: n, borderSize: a, boxSizing: o, contextStyle: s } = nz(t); kn.setAttribute("style", `${s};${rz}`), kn.value = t.value || t.placeholder || ""; let c = kn.scrollHeight; const l = {}; o === "border-box" ? c = c + a : o === "content-box" && (c = c - n), kn.value = ""; const u = kn.scrollHeight - n; if (hi(e)) { let d = u * e; o === "border-box" && (d = d + n + a), c = Math.max(d, c), l.minHeight = `${d}px`; } if (hi(r)) { let d = u * r; o === "border-box" && (d = d + n + a), c = Math.min(d, c); } return l.height = `${c}px`, (i = kn.parentNode) == null || i.removeChild(kn), kn = void 0, l; } const az = Kt({ id: { type: String, default: void 0 }, size: Du, disabled: Boolean, modelValue: { type: vt([ 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: vt([Boolean, Object]), default: !1 }, autocomplete: { type: String, default: "off" }, formatter: { type: Function }, parser: { type: Function }, placeholder: { type: String }, form: { type: String }, readonly: Boolean, clearable: Boolean, showPassword: Boolean, showWordLimit: Boolean, suffixIcon: { type: cs }, prefixIcon: { type: cs }, containerRole: { type: String, default: void 0 }, tabindex: { type: [String, Number], default: 0 }, validateEvent: { type: Boolean, default: !0 }, inputStyle: { type: vt([Object, Array, String]), default: () => Lc({}) }, autofocus: Boolean, rows: { type: Number, default: 2 }, ...Ts(["ariaLabel"]) }), oz = { [ui]: (t) => Ei(t), input: (t) => Ei(t), change: (t) => Ei(t), focus: (t) => t instanceof FocusEvent, blur: (t) => t instanceof FocusEvent, clear: () => !0, mouseleave: (t) => t instanceof MouseEvent, mouseenter: (t) => t instanceof MouseEvent, keydown: (t) => t instanceof Event, compositionstart: (t) => t instanceof CompositionEvent, compositionupdate: (t) => t instanceof CompositionEvent, compositionend: (t) => t instanceof CompositionEvent }, sz = Le({ name: "ElInput", inheritAttrs: !1 }), lz = /* @__PURE__ */ Le({ ...sz, props: az, emits: oz, setup(t, { expose: e, emit: r }) { const i = t, n = AT(), a = co(), o = ee(() => { const B = {}; return i.containerRole === "combobox" && (B["aria-haspopup"] = n["aria-haspopup"], B["aria-owns"] = n["aria-owns"], B["aria-expanded"] = n["aria-expanded"]), B; }), s = ee(() => [ i.type === "textarea" ? y.b() : m.b(), m.m(f.value), m.is("disabled", p.value), m.is("exceed", Z.value), { [m.b("group")]: a.prepend || a.append, [m.m("prefix")]: a.prefix || i.prefixIcon, [m.m("suffix")]: a.suffix || i.suffixIcon || i.clearable || i.showPassword, [m.bm("suffix", "password-clear")]: I.value && F.value, [m.b("hidden")]: i.type === "hidden" }, n.class ]), c = ee(() => [ m.e("wrapper"), m.is("focus", E.value) ]), l = xB({ excludeKeys: ee(() => Object.keys(o.value)) }), { form: u, formItem: d } = zl(), { inputId: h } = Kh(i, { formItemContext: d }), f = bl(), p = Yh(), m = Et("input"), y = Et("textarea"), g = mr(), v = mr(), x = we(!1), w = we(!1), S = we(), _ = mr(i.inputStyle), b = ee(() => g.value || v.value), { wrapperRef: T, isFocused: E, handleFocus: C, handleBlur: L } = pb(b, { beforeFocus() { return p.value; }, afterBlur() { var B; i.validateEvent && ((B = d == null ? void 0 : d.validate) == null || B.call(d, "blur").catch((ce) => Vr(ce))); } }), A = ee(() => { var B; return (B = u == null ? void 0 : u.statusIcon) != null ? B : !1; }), k = ee(() => (d == null ? void 0 : d.validateState) || ""), P = ee(() => k.value && hC[k.value]), R = ee(() => w.value ? hB : sB), M = ee(() => [ n.style ]), O = ee(() => [ i.inputStyle, _.value, { resize: i.resize } ]), D = ee(() => ts(i.modelValue) ? "" : String(i.modelValue)), I = ee(() => i.clearable && !p.value && !i.readonly && !!D.value && (E.value || x.value)), F = ee(() => i.showPassword && !p.value && !i.readonly && !!D.value && (!!D.value || E.value)), z = ee(() => i.showWordLimit && !!i.maxlength && (i.type === "text" || i.type === "textarea") && !p.value && !i.readonly && !i.showPassword), U = ee(() => D.value.length), Z = ee(() => !!z.value && U.value > Number(i.maxlength)), re = ee(() => !!a.suffix || !!i.suffixIcon || I.value || i.showPassword || z.value || !!k.value && A.value), [K, V] = VF(g); Ua(v, (B) => { if (G(), !z.value || i.resize !== "both") return; const ce = B[0], { width: ve } = ce.contentRect; S.value = { right: `calc(100% - ${ve + 15 + 6}px)` }; }); const H = () => { const { type: B, autosize: ce } = i; if (!(!$r || B !== "textarea" || !v.value)) if (ce) { const ve = di(ce) ? ce.minRows : void 0, te = di(ce) ? ce.maxRows : void 0, pe = C2(v.value, ve, te); _.value = { overflowY: "hidden", ...pe }, st(() => { v.value.offsetHeight, _.value = pe; }); } else _.value = { minHeight: C2(v.value).minHeight }; }, G = /* @__PURE__ */ ((B) => { let ce = !1; return () => { var ve; ce || !i.autosize || ((ve = v.value) == null ? void 0 : ve.offsetParent) === null || (B(), ce = !0); }; })(H), W = () => { const B = b.value, ce = i.formatter ? i.formatter(D.value) : D.value; !B || B.value === ce || (B.value = ce); }, Y = async (B) => { K(); let { value: ce } = B.target; if (i.formatter && (ce = i.parser ? i.parser(ce) : ce), !ie.value) { if (ce === D.value) { W(); return; } r(ui, ce), r("input", ce), await st(), W(), V(); } }, X = (B) => { r("change", B.target.value); }, { isComposing: ie, handleCompositionStart: ue, handleCompositionUpdate: $, handleCompositionEnd: J } = IC({ emit: r, afterComposition: Y }), ne = () => { w.value = !w.value, j(); }, j = async () => { var B; await st(), (B = b.value) == null || B.focus(); }, q = () => { var B; return (B = b.value) == null ? void 0 : B.blur(); }, ge = (B) => { x.value = !1, r("mouseleave", B); }, ye = (B) => { x.value = !0, r("mouseenter", B); }, _e = (B) => { r("keydown", B); }, Me = () => { var B; (B = b.value) == null || B.select(); }, Ce = () => { r(ui, ""), r("change", ""), r("clear"), r("input", ""); }; return ze(() => i.modelValue, () => { var B; st(() => H()), i.validateEvent && ((B = d == null ? void 0 : d.validate) == null || B.call(d, "change").catch((ce) => Vr(ce))); }), ze(D, () => W()), ze(() => i.type, async () => { await st(), W(), H(); }), Lt(() => { !i.formatter && i.parser && Vr("ElInput", "If you set the parser, you also need to set the formatter."), W(), st(H); }), e({ input: g, textarea: v, ref: b, textareaStyle: O, autosize: pr(i, "autosize"), isComposing: ie, focus: j, blur: q, select: Me, clear: Ce, resizeTextarea: H }), (B, ce) => (Q(), be("div", Nr(N(o), { class: [ N(s), { [N(m).bm("group", "append")]: B.$slots.append, [N(m).bm("group", "prepend")]: B.$slots.prepend } ], style: N(M), role: B.containerRole, onMouseenter: ye, onMouseleave: ge }), [ Pe(" input "), B.type !== "textarea" ? (Q(), be(pt, { key: 0 }, [ Pe(" prepend slot "), B.$slots.prepend ? (Q(), be("div", { key: 0, class: xe(N(m).be("group", "prepend")) }, [ Fe(B.$slots, "prepend") ], 2)) : Pe("v-if", !0), Ee("div", { ref_key: "wrapperRef", ref: T, class: xe(N(c)) }, [ Pe(" prefix slot "), B.$slots.prefix || B.prefixIcon ? (Q(), be("span", { key: 0, class: xe(N(m).e("prefix")) }, [ Ee("span", { class: xe(N(m).e("prefix-inner")) }, [ Fe(B.$slots, "prefix"), B.prefixIcon ? (Q(), Re(N(Oi), { key: 0, class: xe(N(m).e("icon")) }, { default: le(() => [ (Q(), Re(Yt(B.prefixIcon))) ]), _: 1 }, 8, ["class"])) : Pe("v-if", !0) ], 2) ], 2)) : Pe("v-if", !0), Ee("input", Nr({ id: N(h), ref_key: "input", ref: g, class: N(m).e("inner") }, N(l), { minlength: B.minlength, maxlength: B.maxlength, type: B.showPassword ? w.value ? "text" : "password" : B.type, disabled: N(p), readonly: B.readonly, autocomplete: B.autocomplete, tabindex: B.tabindex, "aria-label": B.ariaLabel, placeholder: B.placeholder, style: B.inputStyle, form: B.form, autofocus: B.autofocus, onCompositionstart: N(ue), onCompositionupdate: N($), onCompositionend: N(J), onInput: Y, onChange: X, onKeydown: _e }), null, 16, ["id", "minlength", "maxlength", "type", "disabled", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form", "autofocus", "onCompositionstart", "onCompositionupdate", "onCompositionend"]), Pe(" suffix slot "), N(re) ? (Q(), be("span", { key: 1, class: xe(N(m).e("suffix")) }, [ Ee("span", { class: xe(N(m).e("suffix-inner")) }, [ !N(I) || !N(F) || !N(z) ? (Q(), be(pt, { key: 0 }, [ Fe(B.$slots, "suffix"), B.suffixIcon ? (Q(), Re(N(Oi), { key: 0, class: xe(N(m).e("icon")) }, { default: le(() => [ (Q(), Re(Yt(B.suffixIcon))) ]), _: 1 }, 8, ["class"])) : Pe("v-if", !0) ], 64)) : Pe("v-if", !0), N(I) ? (Q(), Re(N(Oi), { key: 1, class: xe([N(m).e("icon"), N(m).e("clear")]), onMousedown: Tt(N(oh), ["prevent"]), onClick: Ce }, { default: le(() => [ oe(N(tb)) ]), _: 1 }, 8, ["class", "onMousedown"])) : Pe("v-if", !0), N(F) ? (Q(), Re(N(Oi), { key: 2, class: xe([N(m).e("icon"), N(m).e("password")]), onClick: ne }, { default: le(() => [ (Q(), Re(Yt(N(R)))) ]), _: 1 }, 8, ["class"])) : Pe("v-if", !0), N(z) ? (Q(), be("span", { key: 3, class: xe(N(m).e("count")) }, [ Ee("span", { class: xe(N(m).e("count-inner")) }, Ze(N(U)) + " / " + Ze(B.maxlength), 3) ], 2)) : Pe("v-if", !0), N(k) && N(P) && N(A) ? (Q(), Re(N(Oi), { key: 4, class: xe([ N(m).e("icon"), N(m).e("validateIcon"), N(m).is("loading", N(k) === "validating") ]) }, { default: le(() => [ (Q(), Re(Yt(N(P)))) ]), _: 1 }, 8, ["class"])) : Pe("v-if", !0) ], 2) ], 2)) : Pe("v-if", !0) ], 2), Pe(" append slot "), B.$slots.append ? (Q(), be("div", { key: 1, class: xe(N(m).be("group", "append")) }, [ Fe(B.$slots, "append") ], 2)) : Pe("v-if", !0) ], 64)) : (Q(), be(pt, { key: 1 }, [ Pe(" textarea "), Ee("textarea", Nr({ id: N(h), ref_key: "textarea", ref: v, class: [N(y).e("inner"), N(m).is("focus", N(E))] }, N(l), { minlength: B.minlength, maxlength: B.maxlength, tabindex: B.tabindex, disabled: N(p), readonly: B.readonly, autocomplete: B.autocomplete, style: N(O), "aria-label": B.ariaLabel, placeholder: B.placeholder, form: B.form, autofocus: B.autofocus, rows: B.rows, onCompositionstart: N(ue), onCompositionupdate: N($), onCompositionend: N(J), onInput: Y, onFocus: N(C), onBlur: N(L), onChange: X, onKeydown: _e }), null, 16, ["id", "minlength", "maxlength", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form", "autofocus", "rows", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onFocus", "onBlur"]), N(z) ? (Q(), be("span", { key: 0, style: yt(S.value), class: xe(N(m).e("count")) }, Ze(N(U)) + " / " + Ze(B.maxlength), 7)) : Pe("v-if", !0) ], 64)) ], 16, ["role"])); } }); var cz = /* @__PURE__ */ Mt(lz, [["__file", "input.vue"]]); const Jh = ni(cz), Jl = 4, uz = { 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" } }, dz = ({ move: t, size: e, bar: r }) => ({ [r.size]: e, transform: `translate${r.axis}(${t}%)` }), gb = Symbol("scrollbarContextKey"), hz = Kt({ vertical: Boolean, size: String, move: Number, ratio: { type: Number, required: !0 }, always: Boolean }), pz = "Thumb", fz = /* @__PURE__ */ Le({ __name: "thumb", props: hz, setup(t) { const e = t, r = Ye(gb), i = Et("scrollbar"); r || j5(pz, "can not inject scrollbar context"); const n = we(), a = we(), o = we({}), s = we(!1); let c = !1, l = !1, u = $r ? document.onselectstart : null; const d = ee(() => uz[e.vertical ? "vertical" : "horizontal"]), h = ee(() => dz({ size: e.size, move: e.move, bar: d.value })), f = ee(() => n.value[d.value.offset] ** 2 / r.wrapElement[d.value.scrollSize] / e.ratio / a.value[d.value.offset]), p = (_) => { var b; if (_.stopPropagation(), _.ctrlKey || [1, 2].includes(_.button)) return; (b = window.getSelection()) == null || b.removeAllRanges(), y(_); const T = _.currentTarget; T && (o.value[d.value.axis] = T[d.value.offset] - (_[d.value.client] - T.getBoundingClientRect()[d.value.direction])); }, m = (_) => { if (!a.value || !n.value || !r.wrapElement) return; const b = Math.abs(_.target.getBoundingClientRect()[d.value.direction] - _[d.value.client]), T = a.value[d.value.offset] / 2, E = (b - T) * 100 * f.value / n.value[d.value.offset]; r.wrapElement[d.value.scroll] = E * r.wrapElement[d.value.scrollSize] / 100; }, y = (_) => { _.stopImmediatePropagation(), c = !0, document.addEventListener("mousemove", g), document.addEventListener("mouseup", v), u = document.onselectstart, document.onselectstart = () => !1; }, g = (_) => { if (!n.value || !a.value || c === !1) return; const b = o.value[d.value.axis]; if (!b) return; const T = (n.value.getBoundingClientRect()[d.value.direction] - _[d.value.client]) * -1, E = a.value[d.value.offset] - b, C = (T - E) * 100 * f.value / n.value[d.value.offset]; r.wrapElement[d.value.scroll] = C * r.wrapElement[d.value.scrollSize] / 100; }, v = () => { c = !1, o.value[d.value.axis] = 0, document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", v), S(), l && (s.value = !1); }, x = () => { l = !1, s.value = !!e.size; }, w = () => { l = !0, s.value = c; }; Sr(() => { S(), document.removeEventListener("mouseup", v); }); const S = () => { document.onselectstart !== u && (document.onselectstart = u); }; return xn(pr(r, "scrollbarElement"), "mousemove", x), xn(pr(r, "scrollbarElement"), "mouseleave", w), (_, b) => (Q(), Re(Zn, { name: N(i).b("fade"), persisted: "" }, { default: le(() => [ ht(Ee("div", { ref_key: "instance", ref: n, class: xe([N(i).e("bar"), N(i).is(N(d).key)]), onMousedown: m }, [ Ee("div", { ref_key: "thumb", ref: a, class: xe(N(i).e("thumb")), style: yt(N(h)), onMousedown: p }, null, 38) ], 34), [ [Ot, _.always || s.value] ]) ]), _: 1 }, 8, ["name"])); } }); var A2 = /* @__PURE__ */ Mt(fz, [["__file", "thumb.vue"]]); const mz = Kt({ always: { type: Boolean, default: !0 }, minSize: { type: Number, required: !0 } }), gz = /* @__PURE__ */ Le({ __name: "bar", props: mz, setup(t, { expose: e }) { const r = t, i = Ye(gb), n = we(0), a = we(0), o = we(""), s = we(""), c = we(1), l = we(1); return e({ handleScroll: (u) => { if (u) { const d = u.offsetHeight - Jl, h = u.offsetWidth - Jl; a.value = u.scrollTop * 100 / d * c.value, n.value = u.scrollLeft * 100 / h * l.value; } }, update: () => { const u = i == null ? void 0 : i.wrapElement; if (!u) return; const d = u.offsetHeight - Jl, h = u.offsetWidth - Jl, f = d ** 2 / u.scrollHeight, p = h ** 2 / u.scrollWidth, m = Math.max(f, r.minSize), y = Math.max(p, r.minSize); c.value = f / (d - f) / (m / (d - m)), l.value = p / (h - p) / (y / (h - y)), s.value = m + Jl < d ? `${m}px` : "", o.value = y + Jl < h ? `${y}px` : ""; } }), (u, d) => (Q(), be(pt, null, [ oe(A2, { move: n.value, ratio: l.value, size: o.value, always: u.always }, null, 8, ["move", "ratio", "size", "always"]), oe(A2, { move: a.value, ratio: c.value, size: s.value, vertical: "", always: u.always }, null, 8, ["move", "ratio", "size", "always"]) ], 64)); } }); var vz = /* @__PURE__ */ Mt(gz, [["__file", "bar.vue"]]); const yz = Kt({ height: { type: [String, Number], default: "" }, maxHeight: { type: [String, Number], default: "" }, native: { type: Boolean, default: !1 }, wrapStyle: { type: vt([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, ...Ts(["ariaLabel", "ariaOrientation"]) }), bz = { scroll: ({ scrollTop: t, scrollLeft: e }) => [t, e].every(hi) }, gy = "ElScrollbar", xz = Le({ name: gy }), wz = /* @__PURE__ */ Le({ ...xz, props: yz, emits: bz, setup(t, { expose: e, emit: r }) { const i = t, n = Et("scrollbar"); let a, o, s = 0, c = 0; const l = we(), u = we(), d = we(), h = we(), f = ee(() => { const S = {}; return i.height && (S.height = Yc(i.height)), i.maxHeight && (S.maxHeight = Yc(i.maxHeight)), [i.wrapStyle, S]; }), p = ee(() => [ i.wrapClass, n.e("wrap"), { [n.em("wrap", "hidden-default")]: !i.native } ]), m = ee(() => [n.e("view"), i.viewClass]), y = () => { var S; u.value && ((S = h.value) == null || S.handleScroll(u.value), s = u.value.scrollTop, c = u.value.scrollLeft, r("scroll", { scrollTop: u.value.scrollTop, scrollLeft: u.value.scrollLeft })); }; function g(S, _) { di(S) ? u.value.scrollTo(S) : hi(S) && hi(_) && u.value.scrollTo(S, _); } const v = (S) => { if (!hi(S)) { Vr(gy, "value must be a number"); return; } u.value.scrollTop = S; }, x = (S) => { if (!hi(S)) { Vr(gy, "value must be a number"); return; } u.value.scrollLeft = S; }, w = () => { var S; (S = h.value) == null || S.update(); }; return ze(() => i.noresize, (S) => { S ? (a == null || a(), o == null || o()) : ({ stop: a } = Ua(d, w), o = xn("resize", w)); }, { immediate: !0 }), ze(() => [i.maxHeight, i.height], () => { i.native || st(() => { var S; w(), u.value && ((S = h.value) == null || S.handleScroll(u.value)); }); }), Dt(gb, _r({ scrollbarElement: l, wrapElement: u })), LT(() => { u.value && (u.value.scrollTop = s, u.value.scrollLeft = c); }), Lt(() => { i.native || st(() => { w(); }); }), jh(() => w()), e({ wrapRef: u, update: w, scrollTo: g, setScrollTop: v, setScrollLeft: x, handleScroll: y }), (S, _) => (Q(), be("div", { ref_key: "scrollbarRef", ref: l, class: xe(N(n).b()) }, [ Ee("div", { ref_key: "wrapRef", ref: u, class: xe(N(p)), style: yt(N(f)), tabindex: S.tabindex, onScroll: y }, [ (Q(), Re(Yt(S.tag), { id: S.id, ref_key: "resizeRef", ref: d, class: xe(N(m)), style: yt(S.viewStyle), role: S.role, "aria-label": S.ariaLabel, "aria-orientation": S.ariaOrientation }, { default: le(() => [ Fe(S.$slots, "default") ]), _: 3 }, 8, ["id", "class", "style", "role", "aria-label", "aria-orientation"])) ], 46, ["tabindex"]), S.native ? Pe("v-if", !0) : (Q(), Re(vz, { key: 0, ref_key: "barRef", ref: h, always: S.always, "min-size": S.minSize }, null, 8, ["always", "min-size"])) ], 2)); } }); var _z = /* @__PURE__ */ Mt(wz, [["__file", "scrollbar.vue"]]); const Sz = ni(_z), vb = Symbol("popper"), FC = Symbol("popperContent"), Mz = [ "dialog", "grid", "group", "listbox", "menu", "navigation", "tooltip", "tree" ], zC = Kt({ role: { type: String, values: Mz, default: "tooltip" } }), Ez = Le({ name: "ElPopper", inheritAttrs: !1 }), Tz = /* @__PURE__ */ Le({ ...Ez, props: zC, setup(t, { expose: e }) { const r = t, i = we(), n = we(), a = we(), o = we(), s = ee(() => r.role), c = { triggerRef: i, popperInstanceRef: n, contentRef: a, referenceRef: o, role: s }; return e(c), Dt(vb, c), (l, u) => Fe(l.$slots, "default"); } }); var Cz = /* @__PURE__ */ Mt(Tz, [["__file", "popper.vue"]]); const $C = Kt({ arrowOffset: { type: Number, default: 5 } }), Az = Le({ name: "ElPopperArrow", inheritAttrs: !1 }), Lz = /* @__PURE__ */ Le({ ...Az, props: $C, setup(t, { expose: e }) { const r = t, i = Et("popper"), { arrowOffset: n, arrowRef: a, arrowStyle: o } = Ye(FC, void 0); return ze(() => r.arrowOffset, (s) => { n.value = s; }), Sr(() => { a.value = void 0; }), e({ arrowRef: a }), (s, c) => (Q(), be("span", { ref_key: "arrowRef", ref: a, class: xe(N(i).e("arrow")), style: yt(N(o)), "data-popper-arrow": "" }, null, 6)); } }); var kz = /* @__PURE__ */ Mt(Lz, [["__file", "arrow.vue"]]); const Pv = "ElOnlyChild", Pz = Le({ name: Pv, setup(t, { slots: e, attrs: r }) { var i; const n = Ye(kC), a = $F((i = n == null ? void 0 : n.setForwardRef) != null ? i : oh); return () => { var o; const s = (o = e.default) == null ? void 0 : o.call(e, r); if (!s) return null; if (s.length > 1) return Vr(Pv, "requires exact only one valid child."), null; const c = VC(s); return c ? ht(kT(c, r), [[a]]) : (Vr(Pv, "no valid child node found"), null); }; } }); function VC(t) { if (!t) return null; const e = t; for (const r of e) { if (di(r)) switch (r.type) { case PT: continue; case sg: case "svg": return L2(r); case pt: return VC(r.children); default: return r; } return L2(r); } return null; } function L2(t) { const e = Et("only-child"); return oe("span", { class: e.e("content") }, [t]); } const UC = Kt({ virtualRef: { type: vt(Object) }, virtualTriggering: Boolean, onMouseenter: { type: vt(Function) }, onMouseleave: { type: vt(Function) }, onClick: { type: vt(Function) }, onKeydown: { type: vt(Function) }, onFocus: { type: vt(Function) }, onBlur: { type: vt(Function) }, onContextmenu: { type: vt(Function) }, id: String, open: Boolean }), Rz = Le({ name: "ElPopperTrigger", inheritAttrs: !1 }), Oz = /* @__PURE__ */ Le({ ...Rz, props: UC, setup(t, { expose: e }) { const r = t, { role: i, triggerRef: n } = Ye(vb, void 0); zF(n); const a = ee(() => s.value ? r.id : void 0), o = ee(() => { if (i && i.value === "tooltip") return r.open && r.id ? r.id : void 0; }), s = ee(() => { if (i && i.value !== "tooltip") return i.value; }), c = ee(() => s.value ? `${r.open}` : void 0); let l; const u = [ "onMouseenter", "onMouseleave", "onClick", "onKeydown", "onFocus", "onBlur", "onContextmenu" ]; return Lt(() => { ze(() => r.virtualRef, (d) => { d && (n.value = qa(d)); }, { immediate: !0 }), ze(n, (d, h) => { l == null || l(), l = void 0, ol(d) && (u.forEach((f) => { var p; const m = r[f]; m && (d.addEventListener(f.slice(2).toLowerCase(), m), (p = h == null ? void 0 : h.removeEventListener) == null || p.call(h, f.slice(2).toLowerCase(), m)); }), l = ze([a, o, s, c], (f) => { [ "aria-controls", "aria-describedby", "aria-haspopup", "aria-expanded" ].forEach((p, m) => { ts(f[m]) ? d.removeAttribute(p) : d.setAttribute(p, f[m]); }); }, { immediate: !0 })), ol(h) && [ "aria-controls", "aria-describedby", "aria-haspopup", "aria-expanded" ].forEach((f) => h.removeAttribute(f)); }, { immediate: !0 }); }), Sr(() => { if (l == null || l(), l = void 0, n.value && ol(n.value)) { const d = n.value; u.forEach((h) => { const f = r[h]; f && d.removeEventListener(h.slice(2).toLowerCase(), f); }), n.value = void 0; } }), e({ triggerRef: n }), (d, h) => d.virtualTriggering ? Pe("v-if", !0) : (Q(), Re(N(Pz), Nr({ key: 0 }, d.$attrs, { "aria-controls": N(a), "aria-describedby": N(o), "aria-expanded": N(c), "aria-haspopup": N(s) }), { default: le(() => [ Fe(d.$slots, "default") ]), _: 3 }, 16, ["aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup"])); } }); var Dz = /* @__PURE__ */ Mt(Oz, [["__file", "trigger.vue"]]); const Rv = "focus-trap.focus-after-trapped", Ov = "focus-trap.focus-after-released", Iz = "focus-trap.focusout-prevented", k2 = { cancelable: !0, bubbles: !1 }, Nz = { cancelable: !0, bubbles: !1 }, P2 = "focusAfterTrapped", R2 = "focusAfterReleased", Bz = Symbol("elFocusTrap"), yb = we(), wg = we(0), bb = we(0); let Dp = 0; const jC = (t) => { const e = [], r = document.createTreeWalker(t, NodeFilter.SHOW_ELEMENT, { acceptNode: (i) => { const n = i.tagName === "INPUT" && i.type === "hidden"; return i.disabled || i.hidden || n ? NodeFilter.FILTER_SKIP : i.tabIndex >= 0 || i === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; } }); for (; r.nextNode(); ) e.push(r.currentNode); return e; }, O2 = (t, e) => { for (const r of t) if (!Fz(r, e)) return r; }, Fz = (t, e) => { if (process.env.NODE_ENV === "test") return !1; if (getComputedStyle(t).visibility === "hidden") return !0; for (; t; ) { if (e && t === e) return !1; if (getComputedStyle(t).display === "none") return !0; t = t.parentElement; } return !1; }, zz = (t) => { const e = jC(t), r = O2(e, t), i = O2(e.reverse(), t); return [r, i]; }, $z = (t) => t instanceof HTMLInputElement && "select" in t, zo = (t, e) => { if (t && t.focus) { const r = document.activeElement; t.focus({ preventScroll: !0 }), bb.value = window.performance.now(), t !== r && $z(t) && e && t.select(); } }; function D2(t, e) { const r = [...t], i = t.indexOf(e); return i !== -1 && r.splice(i, 1), r; } const Vz = () => { let t = []; return { push: (e) => { const r = t[0]; r && e !== r && r.pause(), t = D2(t, e), t.unshift(e); }, remove: (e) => { var r, i; t = D2(t, e), (i = (r = t[0]) == null ? void 0 : r.resume) == null || i.call(r); } }; }, Uz = (t, e = !1) => { const r = document.activeElement; for (const i of t) if (zo(i, e), document.activeElement !== r) return; }, I2 = Vz(), jz = () => wg.value > bb.value, Ip = () => { yb.value = "pointer", wg.value = window.performance.now(); }, N2 = () => { yb.value = "keyboard", wg.value = window.performance.now(); }, Hz = () => (Lt(() => { Dp === 0 && (document.addEventListener("mousedown", Ip), document.addEventListener("touchstart", Ip), document.addEventListener("keydown", N2)), Dp++; }), Sr(() => { Dp--, Dp <= 0 && (document.removeEventListener("mousedown", Ip), document.removeEventListener("touchstart", Ip), document.removeEventListener("keydown", N2)); }), { focusReason: yb, lastUserFocusTimestamp: wg, lastAutomatedFocusTimestamp: bb }), Np = (t) => new CustomEvent(Iz, { ...Nz, detail: t }), Gz = Le({ name: "ElFocusTrap", inheritAttrs: !1, props: { loop: Boolean, trapped: Boolean, focusTrapEl: Object, focusStartEl: { type: [Object, String], default: "first" } }, emits: [ P2, R2, "focusin", "focusout", "focusout-prevented", "release-requested" ], setup(t, { emit: e }) { const r = we(); let i, n; const { focusReason: a } = Hz(); DF((p) => { t.trapped && !o.paused && e("release-requested", p); }); const o = { paused: !1, pause() { this.paused = !0; }, resume() { this.paused = !1; } }, s = (p) => { if (!t.loop && !t.trapped || o.paused) return; const { key: m, altKey: y, ctrlKey: g, metaKey: v, currentTarget: x, shiftKey: w } = p, { loop: S } = t, _ = m === Gr.tab && !y && !g && !v, b = document.activeElement; if (_ && b) { const T = x, [E, C] = zz(T); if (E && C) { if (!w && b === C) { const L = Np({ focusReason: a.value }); e("focusout-prevented", L), L.defaultPrevented || (p.preventDefault(), S && zo(E, !0)); } else if (w && [E, T].includes(b)) { const L = Np({ focusReason: a.value }); e("focusout-prevented", L), L.defaultPrevented || (p.preventDefault(), S && zo(C, !0)); } } else if (b === T) { const L = Np({ focusReason: a.value }); e("focusout-prevented", L), L.defaultPrevented || p.preventDefault(); } } }; Dt(Bz, { focusTrapRef: r, onKeydown: s }), ze(() => t.focusTrapEl, (p) => { p && (r.value = p); }, { immediate: !0 }), ze([r], ([p], [m]) => { p && (p.addEventListener("keydown", s), p.addEventListener("focusin", u), p.addEventListener("focusout", d)), m && (m.removeEventListener("keydown", s), m.removeEventListener("focusin", u), m.removeEventListener("focusout", d)); }); const c = (p) => { e(P2, p); }, l = (p) => e(R2, p), u = (p) => { const m = N(r); if (!m) return; const y = p.target, g = p.relatedTarget, v = y && m.contains(y); t.trapped || g && m.contains(g) || (i = g), v && e("focusin", p), !o.paused && t.trapped && (v ? n = y : zo(n, !0)); }, d = (p) => { const m = N(r); if (!(o.paused || !m)) if (t.trapped) { const y = p.relatedTarget; !ts(y) && !m.contains(y) && setTimeout(() => { if (!o.paused && t.trapped) { const g = Np({ focusReason: a.value }); e("focusout-prevented", g), g.defaultPrevented || zo(n, !0); } }, 0); } else { const y = p.target; y && m.contains(y) || e("focusout", p); } }; async function h() { await st(); const p = N(r); if (p) { I2.push(o); const m = p.contains(document.activeElement) ? i : document.activeElement; if (i = m, !p.contains(m)) { const y = new Event(Rv, k2); p.addEventListener(Rv, c), p.dispatchEvent(y), y.defaultPrevented || st(() => { let g = t.focusStartEl; Ei(g) || (zo(g), document.activeElement !== g && (g = "first")), g === "first" && Uz(jC(p), !0), (document.activeElement === m || g === "container") && zo(p); }); } } } function f() { const p = N(r); if (p) { p.removeEventListener(Rv, c); const m = new CustomEvent(Ov, { ...k2, detail: { focusReason: a.value } }); p.addEventListener(Ov, l), p.dispatchEvent(m), !m.defaultPrevented && (a.value == "keyboard" || !jz() || p.contains(document.activeElement)) && zo(i ?? document.body), p.removeEventListener(Ov, l), I2.remove(o); } } return Lt(() => { t.trapped && h(), ze(() => t.trapped, (p) => { p ? h() : f(); }); }), Sr(() => { t.trapped && f(), r.value && (r.value.removeEventListener("keydown", s), r.value.removeEventListener("focusin", u), r.value.removeEventListener("focusout", d), r.value = void 0); }), { onKeydown: s }; } }); function Wz(t, e, r, i, n, a) { return Fe(t.$slots, "default", { handleKeydown: t.onKeydown }); } var qz = /* @__PURE__ */ Mt(Gz, [["render", Wz], ["__file", "focus-trap.vue"]]); const Xz = ["fixed", "absolute"], Zz = Kt({ boundariesPadding: { type: Number, default: 0 }, fallbackPlacements: { type: vt(Array), default: void 0 }, gpuAcceleration: { type: Boolean, default: !0 }, offset: { type: Number, default: 12 }, placement: { type: String, values: yg, default: "bottom" }, popperOptions: { type: vt(Object), default: () => ({}) }, strategy: { type: String, values: Xz, default: "absolute" } }), HC = Kt({ ...Zz, id: String, style: { type: vt([String, Array, Object]) }, className: { type: vt([String, Array, Object]) }, effect: { type: vt(String), default: "dark" }, visible: Boolean, enterable: { type: Boolean, default: !0 }, pure: Boolean, focusOnShow: { type: Boolean, default: !1 }, trapping: { type: Boolean, default: !1 }, popperClass: { type: vt([String, Array, Object]) }, popperStyle: { type: vt([String, Array, Object]) }, referenceEl: { type: vt(Object) }, triggerTargetEl: { type: vt(Object) }, stopPopperMouseEvent: { type: Boolean, default: !0 }, virtualTriggering: Boolean, zIndex: Number, ...Ts(["ariaLabel"]) }), Yz = { mouseenter: (t) => t instanceof MouseEvent, mouseleave: (t) => t instanceof MouseEvent, focus: () => !0, blur: () => !0, close: () => !0 }, Kz = (t, e = []) => { const { placement: r, strategy: i, popperOptions: n } = t, a = { placement: r, strategy: i, ...n, modifiers: [...Qz(t), ...e] }; return e$(a, n == null ? void 0 : n.modifiers), a; }, Jz = (t) => { if ($r) return qa(t); }; function Qz(t) { const { offset: e, gpuAcceleration: r, fallbackPlacements: i } = t; return [ { name: "offset", options: { offset: [0, e ?? 12] } }, { name: "preventOverflow", options: { padding: { top: 2, bottom: 2, left: 5, right: 5 } } }, { name: "flip", options: { padding: 5, fallbackPlacements: i } }, { name: "computeStyles", options: { gpuAcceleration: r } } ]; } function e$(t, e) { e && (t.modifiers = [...t.modifiers, ...e ?? []]); } const t$ = 0, r$ = (t) => { const { popperInstanceRef: e, contentRef: r, triggerRef: i, role: n } = Ye(vb, void 0), a = we(), o = we(), s = ee(() => ({ name: "eventListeners", enabled: !!t.visible })), c = ee(() => { var g; const v = N(a), x = (g = N(o)) != null ? g : t$; return { name: "arrow", enabled: !B5(v), options: { element: v, padding: x } }; }), l = ee(() => ({ onFirstUpdate: () => { p(); }, ...Kz(t, [ N(c), N(s) ]) })), u = ee(() => Jz(t.referenceEl) || N(i)), { attributes: d, state: h, styles: f, update: p, forceUpdate: m, instanceRef: y } = PF(u, r, l); return ze(y, (g) => e.value = g), Lt(() => { ze(() => { var g; return (g = N(u)) == null ? void 0 : g.getBoundingClientRect(); }, () => { p(); }); }), { attributes: d, arrowRef: a, contentRef: r, instanceRef: y, state: h, styles: f, role: n, forceUpdate: m, update: p }; }, i$ = (t, { attributes: e, styles: r, role: i }) => { const { nextZIndex: n } = OC(), a = Et("popper"), o = ee(() => N(e).popper), s = we(hi(t.zIndex) ? t.zIndex : n()), c = ee(() => [ a.b(), a.is("pure", t.pure), a.is(t.effect), t.popperClass ]), l = ee(() => [ { zIndex: N(s) }, N(r).popper, t.popperStyle || {} ]), u = ee(() => i.value === "dialog" ? "false" : void 0), d = ee(() => N(r).arrow || {}); return { ariaModal: u, arrowStyle: d, contentAttrs: o, contentClass: c, contentStyle: l, contentZIndex: s, updateZIndex: () => { s.value = hi(t.zIndex) ? t.zIndex : n(); } }; }, n$ = (t, e) => { const r = we(!1), i = we(); return { focusStartRef: i, trapped: r, onFocusAfterReleased: (n) => { var a; ((a = n.detail) == null ? void 0 : a.focusReason) !== "pointer" && (i.value = "first", e("blur")); }, onFocusAfterTrapped: () => { e("focus"); }, onFocusInTrap: (n) => { t.visible && !r.value && (n.target && (i.value = n.target), r.value = !0); }, onFocusoutPrevented: (n) => { t.trapping || (n.detail.focusReason === "pointer" && n.preventDefault(), r.value = !1); }, onReleaseRequested: () => { r.value = !1, e("close"); } }; }, a$ = Le({ name: "ElPopperContent" }), o$ = /* @__PURE__ */ Le({ ...a$, props: HC, emits: Yz, setup(t, { expose: e, emit: r }) { const i = t, { focusStartRef: n, trapped: a, onFocusAfterReleased: o, onFocusAfterTrapped: s, onFocusInTrap: c, onFocusoutPrevented: l, onReleaseRequested: u } = n$(i, r), { attributes: d, arrowRef: h, contentRef: f, styles: p, instanceRef: m, role: y, update: g } = r$(i), { ariaModal: v, arrowStyle: x, contentAttrs: w, contentClass: S, contentStyle: _, updateZIndex: b } = i$(i, { styles: p, attributes: d, role: y }), T = Ye(dh, void 0), E = we(); Dt(FC, { arrowStyle: x, arrowRef: h, arrowOffset: E }), T && Dt(dh, { ...T, addInputId: oh, removeInputId: oh }); let C; const L = (k = !0) => { g(), k && b(); }, A = () => { L(!1), i.visible && i.focusOnShow ? a.value = !0 : i.visible === !1 && (a.value = !1); }; return Lt(() => { ze(() => i.triggerTargetEl, (k, P) => { C == null || C(), C = void 0; const R = N(k || f.value), M = N(P || f.value); ol(R) && (C = ze([y, () => i.ariaLabel, v, () => i.id], (O) => { ["role", "aria-label", "aria-modal", "id"].forEach((D, I) => { ts(O[I]) ? R.removeAttribute(D) : R.setAttribute(D, O[I]); }); }, { immediate: !0 })), M !== R && ol(M) && ["role", "aria-label", "aria-modal", "id"].forEach((O) => { M.removeAttribute(O); }); }, { immediate: !0 }), ze(() => i.visible, A, { immediate: !0 }); }), Sr(() => { C == null || C(), C = void 0; }), e({ popperContentRef: f, popperInstanceRef: m, updatePopper: L, contentStyle: _ }), (k, P) => (Q(), be("div", Nr({ ref_key: "contentRef", ref: f }, N(w), { style: N(_), class: N(S), tabindex: "-1", onMouseenter: (R) => k.$emit("mouseenter", R), onMouseleave: (R) => k.$emit("mouseleave", R) }), [ oe(N(qz), { trapped: N(a), "trap-on-focus-in": !0, "focus-trap-el": N(f), "focus-start-el": N(n), onFocusAfterTrapped: N(s), onFocusAfterReleased: N(o), onFocusin: N(c), onFocusoutPrevented: N(l), onReleaseRequested: N(u) }, { default: le(() => [ Fe(k.$slots, "default") ]), _: 3 }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested"]) ], 16, ["onMouseenter", "onMouseleave"])); } }); var s$ = /* @__PURE__ */ Mt(o$, [["__file", "content.vue"]]); const l$ = ni(Cz), xb = Symbol("elTooltip"), $i = Kt({ ...BF, ...HC, appendTo: { type: vt([String, Object]) }, content: { type: String, default: "" }, rawContent: Boolean, persistent: Boolean, visible: { type: vt(Boolean), default: null }, transition: String, teleported: { type: Boolean, default: !0 }, disabled: Boolean, ...Ts(["ariaLabel"]) }), hh = Kt({ ...UC, disabled: Boolean, trigger: { type: vt([String, Array]), default: "hover" }, triggerKeys: { type: vt(Array), default: () => [Gr.enter, Gr.space] } }), { useModelToggleProps: c$, useModelToggleEmits: u$, useModelToggle: d$ } = AB("visible"), h$ = Kt({ ...zC, ...c$, ...$i, ...hh, ...$C, showArrow: { type: Boolean, default: !0 } }), p$ = [ ...u$, "before-show", "before-hide", "show", "hide", "open", "close" ], f$ = (t, e) => Ui(t) ? t.includes(e) : t === e, Ql = (t, e, r) => (i) => { f$(N(t), e) && r(i); }, m$ = Le({ name: "ElTooltipTrigger" }), g$ = /* @__PURE__ */ Le({ ...m$, props: hh, setup(t, { expose: e }) { const r = t, i = Et("tooltip"), { controlled: n, id: a, open: o, onOpen: s, onClose: c, onToggle: l } = Ye(xb, void 0), u = we(null), d = () => { if (N(n) || r.disabled) return !0; }, h = pr(r, "trigger"), f = $a(d, Ql(h, "hover", s)), p = $a(d, Ql(h, "hover", c)), m = $a(d, Ql(h, "click", (w) => { w.button === 0 && l(w); })), y = $a(d, Ql(h, "focus", s)), g = $a(d, Ql(h, "focus", c)), v = $a(d, Ql(h, "contextmenu", (w) => { w.preventDefault(), l(w); })), x = $a(d, (w) => { const { code: S } = w; r.triggerKeys.includes(S) && (w.preventDefault(), l(w)); }); return e({ triggerRef: u }), (w, S) => (Q(), Re(N(Dz), { id: N(a), "virtual-ref": w.virtualRef, open: N(o), "virtual-triggering": w.virtualTriggering, class: xe(N(i).e("trigger")), onBlur: N(g), onClick: N(m), onContextmenu: N(v), onFocus: N(y), onMouseenter: N(f), onMouseleave: N(p), onKeydown: N(x) }, { default: le(() => [ Fe(w.$slots, "default") ]), _: 3 }, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"])); } }); var v$ = /* @__PURE__ */ Mt(g$, [["__file", "trigger.vue"]]); const y$ = Kt({ to: { type: vt([String, Object]), required: !0 }, disabled: Boolean }), b$ = /* @__PURE__ */ Le({ __name: "teleport", props: y$, setup(t) { return (e, r) => e.disabled ? Fe(e.$slots, "default", { key: 0 }) : (Q(), Re(NT, { key: 1, to: e.to }, [ Fe(e.$slots, "default") ], 8, ["to"])); } }); var x$ = /* @__PURE__ */ Mt(b$, [["__file", "teleport.vue"]]); const w$ = ni(x$), _$ = Le({ name: "ElTooltipContent", inheritAttrs: !1 }), S$ = /* @__PURE__ */ Le({ ..._$, props: $i, setup(t, { expose: e }) { const r = t, { selector: i } = LC(), n = Et("tooltip"), a = we(null); let o; const { controlled: s, id: c, open: l, trigger: u, onClose: d, onOpen: h, onShow: f, onHide: p, onBeforeShow: m, onBeforeHide: y } = Ye(xb, void 0), g = ee(() => r.transition || `${n.namespace.value}-fade-in-linear`), v = ee(() => process.env.NODE_ENV === "test" ? !0 : r.persistent); Sr(() => { o == null || o(); }); const x = ee(() => N(v) ? !0 : N(l)), w = ee(() => r.disabled ? !1 : N(l)), S = ee(() => r.appendTo || i.value), _ = ee(() => { var M; return (M = r.style) != null ? M : {}; }), b = we(!0), T = () => { p(), b.value = !0; }, E = () => { if (N(s)) return !0; }, C = $a(E, () => { r.enterable && N(u) === "hover" && h(); }), L = $a(E, () => { N(u) === "hover" && d(); }), A = () => { var M, O; (O = (M = a.value) == null ? void 0 : M.updatePopper) == null || O.call(M), m == null || m(); }, k = () => { y == null || y(); }, P = () => { f(), o = kD(ee(() => { var M; return (M = a.value) == null ? void 0 : M.popperContentRef; }), () => { N(s) || N(u) !== "hover" && d(); }); }, R = () => { r.virtualTriggering || d(); }; return ze(() => N(l), (M) => { M ? b.value = !1 : o == null || o(); }, { flush: "post" }), ze(() => r.content, () => { var M, O; (O = (M = a.value) == null ? void 0 : M.updatePopper) == null || O.call(M); }), e({ contentRef: a }), (M, O) => (Q(), Re(N(w$), { disabled: !M.teleported, to: N(S) }, { default: le(() => [ oe(Zn, { name: N(g), onAfterLeave: T, onBeforeEnter: A, onAfterEnter: P, onBeforeLeave: k }, { default: le(() => [ N(x) ? ht((Q(), Re(N(s$), Nr({ key: 0, id: N(c), ref_key: "contentRef", ref: a }, M.$attrs, { "aria-label": M.ariaLabel, "aria-hidden": b.value, "boundaries-padding": M.boundariesPadding, "fallback-placements": M.fallbackPlacements, "gpu-acceleration": M.gpuAcceleration, offset: M.offset, placement: M.placement, "popper-options": M.popperOptions, strategy: M.strategy, effect: M.effect, enterable: M.enterable, pure: M.pure, "popper-class": M.popperClass, "popper-style": [M.popperStyle, N(_)], "reference-el": M.referenceEl, "trigger-target-el": M.triggerTargetEl, visible: N(w), "z-index": M.zIndex, onMouseenter: N(C), onMouseleave: N(L), onBlur: R, onClose: N(d) }), { default: le(() => [ Fe(M.$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"])), [ [Ot, N(w)] ]) : Pe("v-if", !0) ]), _: 3 }, 8, ["name"]) ]), _: 3 }, 8, ["disabled", "to"])); } }); var M$ = /* @__PURE__ */ Mt(S$, [["__file", "content.vue"]]); const E$ = Le({ name: "ElTooltip" }), T$ = /* @__PURE__ */ Le({ ...E$, props: h$, emits: p$, setup(t, { expose: e, emit: r }) { const i = t; NF(); const n = xg(), a = we(), o = we(), s = () => { var g; const v = N(a); v && ((g = v.popperInstanceRef) == null || g.update()); }, c = we(!1), l = we(), { show: u, hide: d, hasUpdateHandler: h } = d$({ indicator: c, toggleReason: l }), { onOpen: f, onClose: p } = FF({ showAfter: pr(i, "showAfter"), hideAfter: pr(i, "hideAfter"), autoClose: pr(i, "autoClose"), open: u, close: d }), m = ee(() => Zc(i.visible) && !h.value); Dt(xb, { controlled: m, id: n, open: U1(c), trigger: pr(i, "trigger"), onOpen: (g) => { f(g); }, onClose: (g) => { p(g); }, onToggle: (g) => { N(c) ? p(g) : f(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 }), ze(() => i.disabled, (g) => { g && c.value && (c.value = !1); }); const y = (g) => { var v, x; const w = (x = (v = o.value) == null ? void 0 : v.contentRef) == null ? void 0 : x.popperContentRef, S = (g == null ? void 0 : g.relatedTarget) || document.activeElement; return w && w.contains(S); }; return RT(() => c.value && d()), e({ popperRef: a, contentRef: o, isFocusInsideContent: y, updatePopper: s, onOpen: f, onClose: p, hide: d }), (g, v) => (Q(), Re(N(l$), { ref_key: "popperRef", ref: a, role: g.role }, { default: le(() => [ oe(v$, { disabled: g.disabled, trigger: g.trigger, "trigger-keys": g.triggerKeys, "virtual-ref": g.virtualRef, "virtual-triggering": g.virtualTriggering }, { default: le(() => [ g.$slots.default ? Fe(g.$slots, "default", { key: 0 }) : Pe("v-if", !0) ]), _: 3 }, 8, ["disabled", "trigger", "trigger-keys", "virtual-ref", "virtual-triggering"]), oe(M$, { 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: le(() => [ Fe(g.$slots, "content", {}, () => [ g.rawContent ? (Q(), be("span", { key: 0, innerHTML: g.content }, null, 8, ["innerHTML"])) : (Q(), be("span", { key: 1 }, Ze(g.content), 1)) ]), g.showArrow ? (Q(), Re(N(kz), { key: 0, "arrow-offset": g.arrowOffset }, null, 8, ["arrow-offset"])) : Pe("v-if", !0) ]), _: 3 }, 8, ["aria-label", "boundaries-padding", "content", "disabled", "effect", "enterable", "fallback-placements", "hide-after", "gpu-acceleration", "offset", "persistent", "popper-class", "popper-style", "placement", "popper-options", "pure", "raw-content", "reference-el", "trigger-target-el", "show-after", "strategy", "teleported", "transition", "virtual-triggering", "z-index", "append-to"]) ]), _: 3 }, 8, ["role"])); } }); var C$ = /* @__PURE__ */ Mt(T$, [["__file", "tooltip.vue"]]); const wb = ni(C$), GC = Symbol("buttonGroupContextKey"), A$ = (t, e) => { tm({ from: "type.text", replacement: "link", version: "3.0.0", scope: "props", ref: "https://element-plus.org/en-US/component/button.html#button-attributes" }, ee(() => t.type === "text")); const r = Ye(GC, void 0), i = fb("button"), { form: n } = zl(), a = bl(ee(() => r == null ? void 0 : r.size)), o = Yh(), s = we(), c = co(), l = ee(() => t.type || (r == null ? void 0 : r.type) || ""), u = ee(() => { var f, p, m; return (m = (p = t.autoInsertSpace) != null ? p : (f = i.value) == null ? void 0 : f.autoInsertSpace) != null ? m : !1; }), d = ee(() => t.tag === "button" ? { ariaDisabled: o.value || t.loading, disabled: o.value || t.loading, autofocus: t.autofocus, type: t.nativeType } : {}), h = ee(() => { var f; const p = (f = c.default) == null ? void 0 : f.call(c); if (u.value && (p == null ? void 0 : p.length) === 1) { const m = p[0]; if ((m == null ? void 0 : m.type) === sg) { const y = m.children; return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(y.trim()); } } return !1; }); return { _disabled: o, _size: a, _type: l, _ref: s, _props: d, shouldAddSpace: h, handleClick: (f) => { if (o.value || t.loading) { f.stopPropagation(); return; } t.nativeType === "reset" && (n == null || n.resetFields()), e("click", f); } }; }, L$ = [ "default", "primary", "success", "warning", "info", "danger", "text", "" ], k$ = ["button", "submit", "reset"], vy = Kt({ size: Du, disabled: Boolean, type: { type: String, values: L$, default: "" }, icon: { type: cs }, nativeType: { type: String, values: k$, default: "button" }, loading: Boolean, loadingIcon: { type: cs, default: () => rb }, 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: vt([String, Object]), default: "button" } }), P$ = { click: (t) => t instanceof MouseEvent }; function pi(t, e) { R$(t) && (t = "100%"); var r = O$(t); return t = e === 360 ? t : Math.min(e, Math.max(0, parseFloat(t))), r && (t = parseInt(String(t * e), 10) / 100), Math.abs(t - e) < 1e-6 ? 1 : (e === 360 ? t = (t < 0 ? t % e + e : t % e) / parseFloat(String(e)) : t = t % e / parseFloat(String(e)), t); } function Bp(t) { return Math.min(1, Math.max(0, t)); } function R$(t) { return typeof t == "string" && t.indexOf(".") !== -1 && parseFloat(t) === 1; } function O$(t) { return typeof t == "string" && t.indexOf("%") !== -1; } function WC(t) { return t = parseFloat(t), (isNaN(t) || t < 0 || t > 1) && (t = 1), t; } function Fp(t) { return t <= 1 ? "".concat(Number(t) * 100, "%") : t; } function tl(t) { return t.length === 1 ? "0" + t : String(t); } function D$(t, e, r) { return { r: pi(t, 255) * 255, g: pi(e, 255) * 255, b: pi(r, 255) * 255 }; } function B2(t, e, r) { t = pi(t, 255), e = pi(e, 255), r = pi(r, 255); var i = Math.max(t, e, r), n = Math.min(t, e, r), a = 0, o = 0, s = (i + n) / 2; if (i === n) o = 0, a = 0; else { var c = i - n; switch (o = s > 0.5 ? c / (2 - i - n) : c / (i + n), i) { case t: a = (e - r) / c + (e < r ? 6 : 0); break; case e: a = (r - t) / c + 2; break; case r: a = (t - e) / c + 4; break; } a /= 6; } return { h: a, s: o, l: s }; } function Dv(t, e, r) { return r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? t + (e - t) * (6 * r) : r < 1 / 2 ? e : r < 2 / 3 ? t + (e - t) * (2 / 3 - r) * 6 : t; } function I$(t, e, r) { var i, n, a; if (t = pi(t, 360), e = pi(e, 100), r = pi(r, 100), e === 0) n = r, a = r, i = r; else { var o = r < 0.5 ? r * (1 + e) : r + e - r * e, s = 2 * r - o; i = Dv(s, o, t + 1 / 3), n = Dv(s, o, t), a = Dv(s, o, t - 1 / 3); } return { r: i * 255, g: n * 255, b: a * 255 }; } function F2(t, e, r) { t = pi(t, 255), e = pi(e, 255), r = pi(r, 255); var i = Math.max(t, e, r), n = Math.min(t, e, r), a = 0, o = i, s = i - n, c = i === 0 ? 0 : s / i; if (i === n) a = 0; else { switch (i) { case t: a = (e - r) / s + (e < r ? 6 : 0); break; case e: a = (r - t) / s + 2; break; case r: a = (t - e) / s + 4; break; } a /= 6; } return { h: a, s: c, v: o }; } function N$(t, e, r) { t = pi(t, 360) * 6, e = pi(e, 100), r = pi(r, 100); var i = Math.floor(t), n = t - i, a = r * (1 - e), o = r * (1 - n * e), s = r * (1 - (1 - n) * e), c = i % 6, l = [r, o, a, a, s, r][c], u = [s, r, r, o, a, a][c], d = [a, a, s, r, r, o][c]; return { r: l * 255, g: u * 255, b: d * 255 }; } function z2(t, e, r, i) { var n = [ tl(Math.round(t).toString(16)), tl(Math.round(e).toString(16)), tl(Math.round(r).toString(16)) ]; return i && n[0].startsWith(n[0].charAt(1)) && n[1].startsWith(n[1].charAt(1)) && n[2].startsWith(n[2].charAt(1)) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) : n.join(""); } function B$(t, e, r, i, n) { var a = [ tl(Math.round(t).toString(16)), tl(Math.round(e).toString(16)), tl(Math.round(r).toString(16)), tl(F$(i)) ]; return n && a[0].startsWith(a[0].charAt(1)) && a[1].startsWith(a[1].charAt(1)) && a[2].startsWith(a[2].charAt(1)) && a[3].startsWith(a[3].charAt(1)) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) + a[3].charAt(0) : a.join(""); } function F$(t) { return Math.round(parseFloat(t) * 255).toString(16); } function $2(t) { return tn(t) / 255; } function tn(t) { return parseInt(t, 16); } function z$(t) { return { r: t >> 16, g: (t & 65280) >> 8, b: t & 255 }; } var yy = { 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 $$(t) { var e = { r: 0, g: 0, b: 0 }, r = 1, i = null, n = null, a = null, o = !1, s = !1; return typeof t == "string" && (t = j$(t)), typeof t == "object" && (ka(t.r) && ka(t.g) && ka(t.b) ? (e = D$(t.r, t.g, t.b), o = !0, s = String(t.r).substr(-1) === "%" ? "prgb" : "rgb") : ka(t.h) && ka(t.s) && ka(t.v) ? (i = Fp(t.s), n = Fp(t.v), e = N$(t.h, i, n), o = !0, s = "hsv") : ka(t.h) && ka(t.s) && ka(t.l) && (i = Fp(t.s), a = Fp(t.l), e = I$(t.h, i, a), o = !0, s = "hsl"), Object.prototype.hasOwnProperty.call(t, "a") && (r = t.a)), r = WC(r), { ok: o, format: t.format || s, r: Math.min(255, Math.max(e.r, 0)), g: Math.min(255, Math.max(e.g, 0)), b: Math.min(255, Math.max(e.b, 0)), a: r }; } var V$ = "[-\\+]?\\d+%?", U$ = "[-\\+]?\\d*\\.\\d+%?", Ko = "(?:".concat(U$, ")|(?:").concat(V$, ")"), Iv = "[\\s|\\(]+(".concat(Ko, ")[,|\\s]+(").concat(Ko, ")[,|\\s]+(").concat(Ko, ")\\s*\\)?"), Nv = "[\\s|\\(]+(".concat(Ko, ")[,|\\s]+(").concat(Ko, ")[,|\\s]+(").concat(Ko, ")[,|\\s]+(").concat(Ko, ")\\s*\\)?"), Nn = { CSS_UNIT: new RegExp(Ko), rgb: new RegExp("rgb" + Iv), rgba: new RegExp("rgba" + Nv), hsl: new RegExp("hsl" + Iv), hsla: new RegExp("hsla" + Nv), hsv: new RegExp("hsv" + Iv), hsva: new RegExp("hsva" + Nv), 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 j$(t) { if (t = t.trim().toLowerCase(), t.length === 0) return !1; var e = !1; if (yy[t]) t = yy[t], e = !0; else if (t === "transparent") return { r: 0, g: 0, b: 0, a: 0, format: "name" }; var r = Nn.rgb.exec(t); return r ? { r: r[1], g: r[2], b: r[3] } : (r = Nn.rgba.exec(t), r ? { r: r[1], g: r[2], b: r[3], a: r[4] } : (r = Nn.hsl.exec(t), r ? { h: r[1], s: r[2], l: r[3] } : (r = Nn.hsla.exec(t), r ? { h: r[1], s: r[2], l: r[3], a: r[4] } : (r = Nn.hsv.exec(t), r ? { h: r[1], s: r[2], v: r[3] } : (r = Nn.hsva.exec(t), r ? { h: r[1], s: r[2], v: r[3], a: r[4] } : (r = Nn.hex8.exec(t), r ? { r: tn(r[1]), g: tn(r[2]), b: tn(r[3]), a: $2(r[4]), format: e ? "name" : "hex8" } : (r = Nn.hex6.exec(t), r ? { r: tn(r[1]), g: tn(r[2]), b: tn(r[3]), format: e ? "name" : "hex" } : (r = Nn.hex4.exec(t), r ? { r: tn(r[1] + r[1]), g: tn(r[2] + r[2]), b: tn(r[3] + r[3]), a: $2(r[4] + r[4]), format: e ? "name" : "hex8" } : (r = Nn.hex3.exec(t), r ? { r: tn(r[1] + r[1]), g: tn(r[2] + r[2]), b: tn(r[3] + r[3]), format: e ? "name" : "hex" } : !1))))))))); } function ka(t) { return !!Nn.CSS_UNIT.exec(String(t)); } var H$ = ( /** @class */ function() { function t(e, r) { e === void 0 && (e = ""), r === void 0 && (r = {}); var i; if (e instanceof t) return e; typeof e == "number" && (e = z$(e)), this.originalInput = e; var n = $$(e); this.originalInput = e, this.r = n.r, this.g = n.g, this.b = n.b, this.a = n.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (i = r.format) !== null && i !== void 0 ? i : n.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 = n.ok; } return t.prototype.isDark = function() { return this.getBrightness() < 128; }, t.prototype.isLight = function() { return !this.isDark(); }, t.prototype.getBrightness = function() { var e = this.toRgb(); return (e.r * 299 + e.g * 587 + e.b * 114) / 1e3; }, t.prototype.getLuminance = function() { var e = this.toRgb(), r, i, n, a = e.r / 255, o = e.g / 255, s = e.b / 255; return a <= 0.03928 ? r = a / 12.92 : r = Math.pow((a + 0.055) / 1.055, 2.4), o <= 0.03928 ? i = o / 12.92 : i = Math.pow((o + 0.055) / 1.055, 2.4), s <= 0.03928 ? n = s / 12.92 : n = Math.pow((s + 0.055) / 1.055, 2.4), 0.2126 * r + 0.7152 * i + 0.0722 * n; }, t.prototype.getAlpha = function() { return this.a; }, t.prototype.setAlpha = function(e) { return this.a = WC(e), this.roundA = Math.round(100 * this.a) / 100, this; }, t.prototype.isMonochrome = function() { var e = this.toHsl().s; return e === 0; }, t.prototype.toHsv = function() { var e = F2(this.r, this.g, this.b); return { h: e.h * 360, s: e.s, v: e.v, a: this.a }; }, t.prototype.toHsvString = function() { var e = F2(this.r, this.g, this.b), r = Math.round(e.h * 360), i = Math.round(e.s * 100), n = Math.round(e.v * 100); return this.a === 1 ? "hsv(".concat(r, ", ").concat(i, "%, ").concat(n, "%)") : "hsva(".concat(r, ", ").concat(i, "%, ").concat(n, "%, ").concat(this.roundA, ")"); }, t.prototype.toHsl = function() { var e = B2(this.r, this.g, this.b); return { h: e.h * 360, s: e.s, l: e.l, a: this.a }; }, t.prototype.toHslString = function() { var e = B2(this.r, this.g, this.b), r = Math.round(e.h * 360), i = Math.round(e.s * 100), n = Math.round(e.l * 100); return this.a === 1 ? "hsl(".concat(r, ", ").concat(i, "%, ").concat(n, "%)") : "hsla(".concat(r, ", ").concat(i, "%, ").concat(n, "%, ").concat(this.roundA, ")"); }, t.prototype.toHex = function(e) { return e === void 0 && (e = !1), z2(this.r, this.g, this.b, e); }, t.prototype.toHexString = function(e) { return e === void 0 && (e = !1), "#" + this.toHex(e); }, t.prototype.toHex8 = function(e) { return e === void 0 && (e = !1), B$(this.r, this.g, this.b, this.a, e); }, t.prototype.toHex8String = function(e) { return e === void 0 && (e = !1), "#" + this.toHex8(e); }, t.prototype.toHexShortString = function(e) { return e === void 0 && (e = !1), this.a === 1 ? this.toHexString(e) : this.toHex8String(e); }, t.prototype.toRgb = function() { return { r: Math.round(this.r), g: Math.round(this.g), b: Math.round(this.b), a: this.a }; }, t.prototype.toRgbString = function() { var e = Math.round(this.r), r = Math.round(this.g), i = Math.round(this.b); return this.a === 1 ? "rgb(".concat(e, ", ").concat(r, ", ").concat(i, ")") : "rgba(".concat(e, ", ").concat(r, ", ").concat(i, ", ").concat(this.roundA, ")"); }, t.prototype.toPercentageRgb = function() { var e = function(r) { return "".concat(Math.round(pi(r, 255) * 100), "%"); }; return { r: e(this.r), g: e(this.g), b: e(this.b), a: this.a }; }, t.prototype.toPercentageRgbString = function() { var e = function(r) { return Math.round(pi(r, 255) * 100); }; return this.a === 1 ? "rgb(".concat(e(this.r), "%, ").concat(e(this.g), "%, ").concat(e(this.b), "%)") : "rgba(".concat(e(this.r), "%, ").concat(e(this.g), "%, ").concat(e(this.b), "%, ").concat(this.roundA, ")"); }, t.prototype.toName = function() { if (this.a === 0) return "transparent"; if (this.a < 1) return !1; for (var e = "#" + z2(this.r, this.g, this.b, !1), r = 0, i = Object.entries(yy); r < i.length; r++) { var n = i[r], a = n[0], o = n[1]; if (e === o) return a; } return !1; }, t.prototype.toString = function(e) { var r = !!e; e = e ?? this.format; var i = !1, n = this.a < 1 && this.a >= 0, a = !r && n && (e.startsWith("hex") || e === "name"); return a ? e === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (i = this.toRgbString()), e === "prgb" && (i = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (i = this.toHexString()), e === "hex3" && (i = this.toHexString(!0)), e === "hex4" && (i = this.toHex8String(!0)), e === "hex8" && (i = this.toHex8String()), e === "name" && (i = this.toName()), e === "hsl" && (i = this.toHslString()), e === "hsv" && (i = this.toHsvString()), i || this.toHexString()); }, t.prototype.toNumber = function() { return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b); }, t.prototype.clone = function() { return new t(this.toString()); }, t.prototype.lighten = function(e) { e === void 0 && (e = 10); var r = this.toHsl(); return r.l += e / 100, r.l = Bp(r.l), new t(r); }, t.prototype.brighten = function(e) { e === void 0 && (e = 10); var r = this.toRgb(); return r.r = Math.max(0, Math.min(255, r.r - Math.round(255 * -(e / 100)))), r.g = Math.max(0, Math.min(255, r.g - Math.round(255 * -(e / 100)))), r.b = Math.max(0, Math.min(255, r.b - Math.round(255 * -(e / 100)))), new t(r); }, t.prototype.darken = function(e) { e === void 0 && (e = 10); var r = this.toHsl(); return r.l -= e / 100, r.l = Bp(r.l), new t(r); }, t.prototype.tint = function(e) { return e === void 0 && (e = 10), this.mix("white", e); }, t.prototype.shade = function(e) { return e === void 0 && (e = 10), this.mix("black", e); }, t.prototype.desaturate = function(e) { e === void 0 && (e = 10); var r = this.toHsl(); return r.s -= e / 100, r.s = Bp(r.s), new t(r); }, t.prototype.saturate = function(e) { e === void 0 && (e = 10); var r = this.toHsl(); return r.s += e / 100, r.s = Bp(r.s), new t(r); }, t.prototype.greyscale = function() { return this.desaturate(100); }, t.prototype.spin = function(e) { var r = this.toHsl(), i = (r.h + e) % 360; return r.h = i < 0 ? 360 + i : i, new t(r); }, t.prototype.mix = function(e, r) { r === void 0 && (r = 50); var i = this.toRgb(), n = new t(e).toRgb(), a = r / 100, o = { r: (n.r - i.r) * a + i.r, g: (n.g - i.g) * a + i.g, b: (n.b - i.b) * a + i.b, a: (n.a - i.a) * a + i.a }; return new t(o); }, t.prototype.analogous = function(e, r) { e === void 0 && (e = 6), r === void 0 && (r = 30); var i = this.toHsl(), n = 360 / r, a = [this]; for (i.h = (i.h - (n * e >> 1) + 720) % 360; --e; ) i.h = (i.h + n) % 360, a.push(new t(i)); return a; }, t.prototype.complement = function() { var e = this.toHsl(); return e.h = (e.h + 180) % 360, new t(e); }, t.prototype.monochromatic = function(e) { e === void 0 && (e = 6); for (var r = this.toHsv(), i = r.h, n = r.s, a = r.v, o = [], s = 1 / e; e--; ) o.push(new t({ h: i, s: n, v: a })), a = (a + s) % 1; return o; }, t.prototype.splitcomplement = function() { var e = this.toHsl(), r = e.h; return [ this, new t({ h: (r + 72) % 360, s: e.s, l: e.l }), new t({ h: (r + 216) % 360, s: e.s, l: e.l }) ]; }, t.prototype.onBackground = function(e) { var r = this.toRgb(), i = new t(e).toRgb(), n = r.a + i.a * (1 - r.a); return new t({ r: (r.r * r.a + i.r * i.a * (1 - r.a)) / n, g: (r.g * r.a + i.g * i.a * (1 - r.a)) / n, b: (r.b * r.a + i.b * i.a * (1 - r.a)) / n, a: n }); }, t.prototype.triad = function() { return this.polyad(3); }, t.prototype.tetrad = function() { return this.polyad(4); }, t.prototype.polyad = function(e) { for (var r = this.toHsl(), i = r.h, n = [this], a = 360 / e, o = 1; o < e; o++) n.push(new t({ h: (i + o * a) % 360, s: r.s, l: r.l })); return n; }, t.prototype.equals = function(e) { return this.toRgbString() === new t(e).toRgbString(); }, t; }() ); function To(t, e = 20) { return t.mix("#141414", e).toString(); } function G$(t) { const e = Yh(), r = Et("button"); return ee(() => { let i = {}, n = t.color; if (n) { const a = n.match(/var\((.*?)\)/); a && (n = window.getComputedStyle(window.document.documentElement).getPropertyValue(a[1])); const o = new H$(n), s = t.dark ? o.tint(20).toString() : To(o, 20); if (t.plain) i = r.cssVarBlock({ "bg-color": t.dark ? To(o, 90) : o.tint(90).toString(), "text-color": n, "border-color": t.dark ? To(o, 50) : o.tint(50).toString(), "hover-text-color": `var(${r.cssVarName("color-white")})`, "hover-bg-color": n, "hover-border-color": n, "active-bg-color": s, "active-text-color": `var(${r.cssVarName("color-white")})`, "active-border-color": s }), e.value && (i[r.cssVarBlockName("disabled-bg-color")] = t.dark ? To(o, 90) : o.tint(90).toString(), i[r.cssVarBlockName("disabled-text-color")] = t.dark ? To(o, 50) : o.tint(50).toString(), i[r.cssVarBlockName("disabled-border-color")] = t.dark ? To(o, 80) : o.tint(80).toString()); else { const c = t.dark ? To(o, 30) : o.tint(30).toString(), l = o.isDark() ? `var(${r.cssVarName("color-white")})` : `var(${r.cssVarName("color-black")})`; if (i = r.cssVarBlock({ "bg-color": n, "text-color": l, "border-color": n, "hover-bg-color": c, "hover-text-color": l, "hover-border-color": c, "active-bg-color": s, "active-border-color": s }), e.value) { const u = t.dark ? To(o, 50) : o.tint(50).toString(); i[r.cssVarBlockName("disabled-bg-color")] = u, i[r.cssVarBlockName("disabled-text-color")] = t.dark ? "rgba(255, 255, 255, 0.5)" : `var(${r.cssVarName("color-white")})`, i[r.cssVarBlockName("disabled-border-color")] = u; } } } return i; }); } const W$ = Le({ name: "ElButton" }), q$ = /* @__PURE__ */ Le({ ...W$, props: vy, emits: P$, setup(t, { expose: e, emit: r }) { const i = t, n = G$(i), a = Et("button"), { _ref: o, _size: s, _type: c, _disabled: l, _props: u, shouldAddSpace: d, handleClick: h } = A$(i, r), f = ee(() => [ a.b(), a.m(c.value), a.m(s.value), a.is("disabled", l.value), a.is("loading", i.loading), a.is("plain", i.plain), a.is("round", i.round), a.is("circle", i.circle), a.is("text", i.text), a.is("link", i.link), a.is("has-bg", i.bg) ]); return e({ ref: o, size: s, type: c, disabled: l, shouldAddSpace: d }), (p, m) => (Q(), Re(Yt(p.tag), Nr({ ref_key: "_ref", ref: o }, N(u), { class: N(f), style: N(n), onClick: N(h) }), { default: le(() => [ p.loading ? (Q(), be(pt, { key: 0 }, [ p.$slots.loading ? Fe(p.$slots, "loading", { key: 0 }) : (Q(), Re(N(Oi), { key: 1, class: xe(N(a).is("loading")) }, { default: le(() => [ (Q(), Re(Yt(p.loadingIcon))) ]), _: 1 }, 8, ["class"])) ], 64)) : p.icon || p.$slots.icon ? (Q(), Re(N(Oi), { key: 1 }, { default: le(() => [ p.icon ? (Q(), Re(Yt(p.icon), { key: 0 })) : Fe(p.$slots, "icon", { key: 1 }) ]), _: 3 })) : Pe("v-if", !0), p.$slots.default ? (Q(), be("span", { key: 2, class: xe({ [N(a).em("text", "expand")]: N(d) }) }, [ Fe(p.$slots, "default") ], 2)) : Pe("v-if", !0) ]), _: 3 }, 16, ["class", "style", "onClick"])); } }); var X$ = /* @__PURE__ */ Mt(q$, [["__file", "button.vue"]]); const Z$ = { size: vy.size, type: vy.type }, Y$ = Le({ name: "ElButtonGroup" }), K$ = /* @__PURE__ */ Le({ ...Y$, props: Z$, setup(t) { const e = t; Dt(GC, _r({ size: pr(e, "size"), type: pr(e, "type") })); const r = Et("button"); return (i, n) => (Q(), be("div", { class: xe(N(r).b("group")) }, [ Fe(i.$slots, "default") ], 2)); } }); var qC = /* @__PURE__ */ Mt(K$, [["__file", "button-group.vue"]]); const us = ni(X$, { ButtonGroup: qC }), J$ = po(qC), $o = /* @__PURE__ */ new Map(); if ($r) { let t; document.addEventListener("mousedown", (e) => t = e), document.addEventListener("mouseup", (e) => { if (t) { for (const r of $o.values()) for (const { documentHandler: i } of r) i(e, t); t = void 0; } }); } function V2(t, e) { let r = []; return Array.isArray(e.arg) ? r = e.arg : ol(e.arg) && r.push(e.arg), function(i, n) { const a = e.instance.popperRef, o = i.target, s = n == null ? void 0 : n.target, c = !e || !e.instance, l = !o || !s, u = t.contains(o) || t.contains(s), d = t === o, h = r.length && r.some((p) => p == null ? void 0 : p.contains(o)) || r.length && r.includes(s), f = a && (a.contains(o) || a.contains(s)); c || l || u || d || h || f || e.value(i, n); }; } const XC = { beforeMount(t, e) { $o.has(t) || $o.set(t, []), $o.get(t).push({ documentHandler: V2(t, e), bindingFn: e.value }); }, updated(t, e) { $o.has(t) || $o.set(t, []); const r = $o.get(t), i = r.findIndex((a) => a.bindingFn === e.oldValue), n = { documentHandler: V2(t, e), bindingFn: e.value }; i >= 0 ? r.splice(i, 1, n) : r.push(n); }, unmounted(t) { $o.delete(t); } }, Q$ = Kt({ header: { type: String, default: "" }, footer: { type: String, default: "" }, bodyStyle: { type: vt([String, Object, Array]), default: "" }, bodyClass: String, shadow: { type: String, values: ["always", "hover", "never"], default: "always" } }), e6 = Le({ name: "ElCard" }), t6 = /* @__PURE__ */ Le({ ...e6, props: Q$, setup(t) { const e = Et("card"); return (r, i) => (Q(), be("div", { class: xe([N(e).b(), N(e).is(`${r.shadow}-shadow`)]) }, [ r.$slots.header || r.header ? (Q(), be("div", { key: 0, class: xe(N(e).e("header")) }, [ Fe(r.$slots, "header", {}, () => [ et(Ze(r.header), 1) ]) ], 2)) : Pe("v-if", !0), Ee("div", { class: xe([N(e).e("body"), r.bodyClass]), style: yt(r.bodyStyle) }, [ Fe(r.$slots, "default") ], 6), r.$slots.footer || r.footer ? (Q(), be("div", { key: 1, class: xe(N(e).e("footer")) }, [ Fe(r.$slots, "footer", {}, () => [ et(Ze(r.footer), 1) ]) ], 2)) : Pe("v-if", !0) ], 2)); } }); var r6 = /* @__PURE__ */ Mt(t6, [["__file", "card.vue"]]); const i6 = ni(r6), ZC = { 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: Du, tabindex: [String, Number], validateEvent: { type: Boolean, default: !0 }, ...Ts(["ariaControls"]) }, YC = { [ui]: (t) => Ei(t) || hi(t) || Zc(t), change: (t) => Ei(t) || hi(t) || Zc(t) }, Iu = Symbol("checkboxGroupContextKey"), n6 = ({ model: t, isChecked: e }) => { const r = Ye(Iu, void 0), i = ee(() => { var n, a; const o = (n = r == null ? void 0 : r.max) == null ? void 0 : n.value, s = (a = r == null ? void 0 : r.min) == null ? void 0 : a.value; return !Yo(o) && t.value.length >= o && !e.value || !Yo(s) && t.value.length <= s && e.value; }); return { isDisabled: Yh(ee(() => (r == null ? void 0 : r.disabled.value) || i.value)), isLimitDisabled: i }; }, a6 = (t, { model: e, isLimitExceeded: r, hasOwnLabel: i, isDisabled: n, isLabeledByFormItem: a }) => { const o = Ye(Iu, void 0), { formItem: s } = zl(), { emit: c } = Ct(); function l(p) { var m, y, g, v; return [!0, t.trueValue, t.trueLabel].includes(p) ? (y = (m = t.trueValue) != null ? m : t.trueLabel) != null ? y : !0 : (v = (g = t.falseValue) != null ? g : t.falseLabel) != null ? v : !1; } function u(p, m) { c("change", l(p), m); } function d(p) { if (r.value) return; const m = p.target; c("change", l(m.checked), p); } async function h(p) { r.value || !i.value && !n.value && a.value && (p.composedPath().some((m) => m.tagName === "LABEL") || (e.value = l([!1, t.falseValue, t.falseLabel].includes(e.value)), await st(), u(e.value, p))); } const f = ee(() => (o == null ? void 0 : o.validateEvent) || t.validateEvent); return ze(() => t.modelValue, () => { f.value && (s == null || s.validate("change").catch((p) => Vr(p))); }), { handleChange: d, onClickRoot: h }; }, o6 = (t) => { const e = we(!1), { emit: r } = Ct(), i = Ye(Iu, void 0), n = ee(() => Yo(i) === !1), a = we(!1), o = ee({ get() { var s, c; return n.value ? (s = i == null ? void 0 : i.modelValue) == null ? void 0 : s.value : (c = t.modelValue) != null ? c : e.value; }, set(s) { var c, l; n.value && Ui(s) ? (a.value = ((c = i == null ? void 0 : i.max) == null ? void 0 : c.value) !== void 0 && s.length > (i == null ? void 0 : i.max.value) && s.length > o.value.length, a.value === !1 && ((l = i == null ? void 0 : i.changeEvent) == null || l.call(i, s))) : (r(ui, s), e.value = s); } }); return { model: o, isGroup: n, isLimitExceeded: a }; }, s6 = (t, e, { model: r }) => { const i = Ye(Iu, void 0), n = we(!1), a = ee(() => Am(t.value) ? t.label : t.value), o = ee(() => { const u = r.value; return Zc(u) ? u : Ui(u) ? di(a.value) ? u.map(gl).some((d) => Cm(d, a.value)) : u.map(gl).includes(a.value) : u != null ? u === t.trueValue || u === t.trueLabel : !!u; }), s = bl(ee(() => { var u; return (u = i == null ? void 0 : i.size) == null ? void 0 : u.value; }), { prop: !0 }), c = bl(ee(() => { var u; return (u = i == null ? void 0 : i.size) == null ? void 0 : u.value; })), l = ee(() => !!e.default || !Am(a.value)); return { checkboxButtonSize: s, isChecked: o, isFocused: n, checkboxSize: c, hasOwnLabel: l, actualValue: a }; }, KC = (t, e) => { const { formItem: r } = zl(), { model: i, isGroup: n, isLimitExceeded: a } = o6(t), { isFocused: o, isChecked: s, checkboxButtonSize: c, checkboxSize: l, hasOwnLabel: u, actualValue: d } = s6(t, e, { model: i }), { isDisabled: h } = n6({ model: i, isChecked: s }), { inputId: f, isLabeledByFormItem: p } = Kh(t, { formItemContext: r, disableIdGeneration: u, disableIdManagement: n }), { handleChange: m, onClickRoot: y } = a6(t, { model: i, isLimitExceeded: a, hasOwnLabel: u, isDisabled: h, isLabeledByFormItem: p }); return (() => { function g() { var v, x; Ui(i.value) && !i.value.includes(d.value) ? i.value.push(d.value) : i.value = (x = (v = t.trueValue) != null ? v : t.trueLabel) != null ? x : !0; } t.checked && g(); })(), tm({ from: "label act as value", replacement: "value", version: "3.0.0", scope: "el-checkbox", ref: "https://element-plus.org/en-US/component/checkbox.html" }, ee(() => n.value && Am(t.value))), tm({ from: "true-label", replacement: "true-value", version: "3.0.0", scope: "el-checkbox", ref: "https://element-plus.org/en-US/component/checkbox.html" }, ee(() => !!t.trueLabel)), tm({ from: "false-label", replacement: "false-value", version: "3.0.0", scope: "el-checkbox", ref: "https://element-plus.org/en-US/component/checkbox.html" }, ee(() => !!t.falseLabel)), { inputId: f, isLabeledByFormItem: p, isChecked: s, isDisabled: h, isFocused: o, checkboxButtonSize: c, checkboxSize: l, hasOwnLabel: u, model: i, actualValue: d, handleChange: m, onClickRoot: y }; }, l6 = Le({ name: "ElCheckbox" }), c6 = /* @__PURE__ */ Le({ ...l6, props: ZC, emits: YC, setup(t) { const e = t, r = co(), { inputId: i, isLabeledByFormItem: n, isChecked: a, isDisabled: o, isFocused: s, checkboxSize: c, hasOwnLabel: l, model: u, actualValue: d, handleChange: h, onClickRoot: f } = KC(e, r), p = Et("checkbox"), m = ee(() => [ p.b(), p.m(c.value), p.is("disabled", o.value), p.is("bordered", e.border), p.is("checked", a.value) ]), y = ee(() => [ p.e("input"), p.is("disabled", o.value), p.is("checked", a.value), p.is("indeterminate", e.indeterminate), p.is("focus", s.value) ]); return (g, v) => (Q(), Re(Yt(!N(l) && N(n) ? "span" : "label"), { class: xe(N(m)), "aria-controls": g.indeterminate ? g.ariaControls : null, onClick: N(f) }, { default: le(() => { var x, w, S, _; return [ Ee("span", { class: xe(N(y)) }, [ g.trueValue || g.falseValue || g.trueLabel || g.falseLabel ? ht((Q(), be("input", { key: 0, id: N(i), "onUpdate:modelValue": (b) => cn(u) ? u.value = b : null, class: xe(N(p).e("original")), type: "checkbox", indeterminate: g.indeterminate, name: g.name, tabindex: g.tabindex, disabled: N(o), "true-value": (w = (x = g.trueValue) != null ? x : g.trueLabel) != null ? w : !0, "false-value": (_ = (S = g.falseValue) != null ? S : g.falseLabel) != null ? _ : !1, onChange: N(h), onFocus: (b) => s.value = !0, onBlur: (b) => s.value = !1, onClick: Tt(() => { }, ["stop"]) }, null, 42, ["id", "onUpdate:modelValue", "indeterminate", "name", "tabindex", "disabled", "true-value", "false-value", "onChange", "onFocus", "onBlur", "onClick"])), [ [Sm, N(u)] ]) : ht((Q(), be("input", { key: 1, id: N(i), "onUpdate:modelValue": (b) => cn(u) ? u.value = b : null, class: xe(N(p).e("original")), type: "checkbox", indeterminate: g.indeterminate, disabled: N(o), value: N(d), name: g.name, tabindex: g.tabindex, onChange: N(h), onFocus: (b) => s.value = !0, onBlur: (b) => s.value = !1, onClick: Tt(() => { }, ["stop"]) }, null, 42, ["id", "onUpdate:modelValue", "indeterminate", "disabled", "value", "name", "tabindex", "onChange", "onFocus", "onBlur", "onClick"])), [ [Sm, N(u)] ]), Ee("span", { class: xe(N(p).e("inner")) }, null, 2) ], 2), N(l) ? (Q(), be("span", { key: 0, class: xe(N(p).e("label")) }, [ Fe(g.$slots, "default"), g.$slots.default ? Pe("v-if", !0) : (Q(), be(pt, { key: 0 }, [ et(Ze(g.label), 1) ], 64)) ], 2)) : Pe("v-if", !0) ]; }), _: 3 }, 8, ["class", "aria-controls", "onClick"])); } }); var u6 = /* @__PURE__ */ Mt(c6, [["__file", "checkbox.vue"]]); const d6 = Le({ name: "ElCheckboxButton" }), h6 = /* @__PURE__ */ Le({ ...d6, props: ZC, emits: YC, setup(t) { const e = t, r = co(), { isFocused: i, isChecked: n, isDisabled: a, checkboxButtonSize: o, model: s, actualValue: c, handleChange: l } = KC(e, r), u = Ye(Iu, void 0), d = Et("checkbox"), h = ee(() => { var p, m, y, g; const v = (m = (p = u == null ? void 0 : u.fill) == null ? void 0 : p.value) != null ? m : ""; return { backgroundColor: v, borderColor: v, color: (g = (y = u == null ? void 0 : u.textColor) == null ? void 0 : y.value) != null ? g : "", boxShadow: v ? `-1px 0 0 0 ${v}` : void 0 }; }), f = ee(() => [ d.b("button"), d.bm("button", o.value), d.is("disabled", a.value), d.is("checked", n.value), d.is("focus", i.value) ]); return (p, m) => { var y, g, v, x; return Q(), be("label", { class: xe(N(f)) }, [ p.trueValue || p.falseValue || p.trueLabel || p.falseLabel ? ht((Q(), be("input", { key: 0, "onUpdate:modelValue": (w) => cn(s) ? s.value = w : null, class: xe(N(d).be("button", "original")), type: "checkbox", name: p.name, tabindex: p.tabindex, disabled: N(a), "true-value": (g = (y = p.trueValue) != null ? y : p.trueLabel) != null ? g : !0, "false-value": (x = (v = p.falseValue) != null ? v : p.falseLabel) != null ? x : !1, onChange: N(l), onFocus: (w) => i.value = !0, onBlur: (w) => i.value = !1, onClick: Tt(() => { }, ["stop"]) }, null, 42, ["onUpdate:modelValue", "name", "tabindex", "disabled", "true-value", "false-value", "onChange", "onFocus", "onBlur", "onClick"])), [ [Sm, N(s)] ]) : ht((Q(), be("input", { key: 1, "onUpdate:modelValue": (w) => cn(s) ? s.value = w : null, class: xe(N(d).be("button", "original")), type: "checkbox", name: p.name, tabindex: p.tabindex, disabled: N(a), value: N(c), onChange: N(l), onFocus: (w) => i.value = !0, onBlur: (w) => i.value = !1, onClick: Tt(() => { }, ["stop"]) }, null, 42, ["onUpdate:modelValue", "name", "tabindex", "disabled", "value", "onChange", "onFocus", "onBlur", "onClick"])), [ [Sm, N(s)] ]), p.$slots.default || p.label ? (Q(), be("span", { key: 2, class: xe(N(d).be("button", "inner")), style: yt(N(n) ? N(h) : void 0) }, [ Fe(p.$slots, "default", {}, () => [ et(Ze(p.label), 1) ]) ], 6)) : Pe("v-if", !0) ], 2); }; } }); var JC = /* @__PURE__ */ Mt(h6, [["__file", "checkbox-button.vue"]]); const p6 = Kt({ modelValue: { type: vt(Array), default: () => [] }, disabled: Boolean, min: Number, max: Number, size: Du, fill: String, textColor: String, tag: { type: String, default: "div" }, validateEvent: { type: Boolean, default: !0 }, ...Ts(["ariaLabel"]) }), f6 = { [ui]: (t) => Ui(t), change: (t) => Ui(t) }, m6 = Le({ name: "ElCheckboxGroup" }), g6 = /* @__PURE__ */ Le({ ...m6, props: p6, emits: f6, setup(t, { emit: e }) { const r = t, i = Et("checkbox"), { formItem: n } = zl(), { inputId: a, isLabeledByFormItem: o } = Kh(r, { formItemContext: n }), s = async (l) => { e(ui, l), await st(), e("change", l); }, c = ee({ get() { return r.modelValue; }, set(l) { s(l); } }); return Dt(Iu, { ...sC(Zi(r), [ "size", "min", "max", "disabled", "validateEvent", "fill", "textColor" ]), modelValue: c, changeEvent: s }), ze(() => r.modelValue, () => { r.validateEvent && (n == null || n.validate("change").catch((l) => Vr(l))); }), (l, u) => { var d; return Q(), Re(Yt(l.tag), { id: N(a), class: xe(N(i).b("group")), role: "group", "aria-label": N(o) ? void 0 : l.ariaLabel || "checkbox-group", "aria-labelledby": N(o) ? (d = N(n)) == null ? void 0 : d.labelId : void 0 }, { default: le(() => [ Fe(l.$slots, "default") ]), _: 3 }, 8, ["id", "class", "aria-label", "aria-labelledby"]); }; } }); var QC = /* @__PURE__ */ Mt(g6, [["__file", "checkbox-group.vue"]]); const v6 = ni(u6, { CheckboxButton: JC, CheckboxGroup: QC }); po(JC); po(QC); const by = Kt({ type: { type: String, values: ["primary", "success", "info", "warning", "danger"], default: "primary" }, closable: Boolean, disableTransitions: Boolean, hit: Boolean, color: String, size: { type: String, values: pC }, effect: { type: String, values: ["dark", "light", "plain"], default: "light" }, round: Boolean }), y6 = { close: (t) => t instanceof MouseEvent, click: (t) => t instanceof MouseEvent }, b6 = Le({ name: "ElTag" }), x6 = /* @__PURE__ */ Le({ ...b6, props: by, emits: y6, setup(t, { emit: e }) { const r = t, i = bl(), n = Et("tag"), a = ee(() => { const { type: l, hit: u, effect: d, closable: h, round: f } = r; return [ n.b(), n.is("closable", h), n.m(l || "primary"), n.m(i.value), n.m(d), n.is("hit", u), n.is("round", f) ]; }), o = (l) => { e("close", l); }, s = (l) => { e("click", l); }, c = (l) => { l.component.subTree.component.bum = null; }; return (l, u) => l.disableTransitions ? (Q(), be("span", { key: 0, class: xe(N(a)), style: yt({ backgroundColor: l.color }), onClick: s }, [ Ee("span", { class: xe(N(n).e("content")) }, [ Fe(l.$slots, "default") ], 2), l.closable ? (Q(), Re(N(Oi), { key: 0, class: xe(N(n).e("close")), onClick: Tt(o, ["stop"]) }, { default: le(() => [ oe(N(Lm)) ]), _: 1 }, 8, ["class", "onClick"])) : Pe("v-if", !0) ], 6)) : (Q(), Re(Zn, { key: 1, name: `${N(n).namespace.value}-zoom-in-center`, appear: "", onVnodeMounted: c }, { default: le(() => [ Ee("span", { class: xe(N(a)), style: yt({ backgroundColor: l.color }), onClick: s }, [ Ee("span", { class: xe(N(n).e("content")) }, [ Fe(l.$slots, "default") ], 2), l.closable ? (Q(), Re(N(Oi), { key: 0, class: xe(N(n).e("close")), onClick: Tt(o, ["stop"]) }, { default: le(() => [ oe(N(Lm)) ]), _: 1 }, 8, ["class", "onClick"])) : Pe("v-if", !0) ], 6) ]), _: 3 }, 8, ["name"])); } }); var w6 = /* @__PURE__ */ Mt(x6, [["__file", "tag.vue"]]); const _6 = ni(w6), eA = Symbol("rowContextKey"), S6 = [ "start", "center", "end", "space-around", "space-between", "space-evenly" ], M6 = ["top", "middle", "bottom"], E6 = Kt({ tag: { type: String, default: "div" }, gutter: { type: Number, default: 0 }, justify: { type: String, values: S6, default: "start" }, align: { type: String, values: M6 } }), T6 = Le({ name: "ElRow" }), C6 = /* @__PURE__ */ Le({ ...T6, props: E6, setup(t) { const e = t, r = Et("row"), i = ee(() => e.gutter); Dt(eA, { gutter: i }); const n = ee(() => { const o = {}; return e.gutter && (o.marginRight = o.marginLeft = `-${e.gutter / 2}px`), o; }), a = ee(() => [ r.b(), r.is(`justify-${e.justify}`, e.justify !== "start"), r.is(`align-${e.align}`, !!e.align) ]); return (o, s) => (Q(), Re(Yt(o.tag), { class: xe(N(a)), style: yt(N(n)) }, { default: le(() => [ Fe(o.$slots, "default") ]), _: 3 }, 8, ["class", "style"])); } }); var A6 = /* @__PURE__ */ Mt(C6, [["__file", "row.vue"]]); const _g = ni(A6), L6 = Kt({ 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: vt([Number, Object]), default: () => Lc({}) }, sm: { type: vt([Number, Object]), default: () => Lc({}) }, md: { type: vt([Number, Object]), default: () => Lc({}) }, lg: { type: vt([Number, Object]), default: () => Lc({}) }, xl: { type: vt([Number, Object]), default: () => Lc({}) } }), k6 = Le({ name: "ElCol" }), P6 = /* @__PURE__ */ Le({ ...k6, props: L6, setup(t) { const e = t, { gutter: r } = Ye(eA, { gutter: ee(() => 0) }), i = Et("col"), n = ee(() => { const o = {}; return r.value && (o.paddingLeft = o.paddingRight = `${r.value / 2}px`), o; }), a = ee(() => { const o = []; return ["span", "offset", "pull", "push"].forEach((s) => { const c = e[s]; hi(c) && (s === "span" ? o.push(i.b(`${e[s]}`)) : c > 0 && o.push(i.b(`${s}-${e[s]}`))); }), ["xs", "sm", "md", "lg", "xl"].forEach((s) => { hi(e[s]) ? o.push(i.b(`${s}-${e[s]}`)) : di(e[s]) && Object.entries(e[s]).forEach(([c, l]) => { o.push(c !== "span" ? i.b(`${s}-${c}-${l}`) : i.b(`${s}-${l}`)); }); }), r.value && o.push(i.is("guttered")), [i.b(), o]; }); return (o, s) => (Q(), Re(Yt(o.tag), { class: xe(N(a)), style: yt(N(n)) }, { default: le(() => [ Fe(o.$slots, "default") ]), _: 3 }, 8, ["class", "style"])); } }); var R6 = /* @__PURE__ */ Mt(P6, [["__file", "col.vue"]]); const Qh = ni(R6), O6 = Le({ name: "ElCollapseTransition" }), D6 = /* @__PURE__ */ Le({ ...O6, setup(t) { const e = Et("collapse-transition"), r = (n) => { n.style.maxHeight = "", n.style.overflow = n.dataset.oldOverflow, n.style.paddingTop = n.dataset.oldPaddingTop, n.style.paddingBottom = n.dataset.oldPaddingBottom; }, i = { beforeEnter(n) { n.dataset || (n.dataset = {}), n.dataset.oldPaddingTop = n.style.paddingTop, n.dataset.oldPaddingBottom = n.style.paddingBottom, n.style.height && (n.dataset.elExistsHeight = n.style.height), n.style.maxHeight = 0, n.style.paddingTop = 0, n.style.paddingBottom = 0; }, enter(n) { requestAnimationFrame(() => { n.dataset.oldOverflow = n.style.overflow, n.dataset.elExistsHeight ? n.style.maxHeight = n.dataset.elExistsHeight : n.scrollHeight !== 0 ? n.style.maxHeight = `${n.scrollHeight}px` : n.style.maxHeight = 0, n.style.paddingTop = n.dataset.oldPaddingTop, n.style.paddingBottom = n.dataset.oldPaddingBottom, n.style.overflow = "hidden"; }); }, afterEnter(n) { n.style.maxHeight = "", n.style.overflow = n.dataset.oldOverflow; }, enterCancelled(n) { r(n); }, beforeLeave(n) { n.dataset || (n.dataset = {}), n.dataset.oldPaddingTop = n.style.paddingTop, n.dataset.oldPaddingBottom = n.style.paddingBottom, n.dataset.oldOverflow = n.style.overflow, n.style.maxHeight = `${n.scrollHeight}px`, n.style.overflow = "hidden"; }, leave(n) { n.scrollHeight !== 0 && (n.style.maxHeight = 0, n.style.paddingTop = 0, n.style.paddingBottom = 0); }, afterLeave(n) { r(n); }, leaveCancelled(n) { r(n); } }; return (n, a) => (Q(), Re(Zn, Nr({ name: N(e).b() }, OT(i)), { default: le(() => [ Fe(n.$slots, "default") ]), _: 3 }, 16, ["name"])); } }); var I6 = /* @__PURE__ */ Mt(D6, [["__file", "collapse-transition.vue"]]); const N6 = ni(I6), B6 = Kt({ color: { type: vt(Object), required: !0 }, vertical: { type: Boolean, default: !1 } }); let Bv = !1; function ph(t, e) { if (!$r) return; const r = function(a) { var o; (o = e.drag) == null || o.call(e, a); }, i = function(a) { var o; document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i), document.removeEventListener("touchmove", r), document.removeEventListener("touchend", i), document.onselectstart = null, document.ondragstart = null, Bv = !1, (o = e.end) == null || o.call(e, a); }, n = function(a) { var o; Bv || (a.preventDefault(), document.onselectstart = () => !1, document.ondragstart = () => !1, document.addEventListener("mousemove", r), document.addEventListener("mouseup", i), document.addEventListener("touchmove", r), document.addEventListener("touchend", i), Bv = !0, (o = e.start) == null || o.call(e, a)); }; t.addEventListener("mousedown", n), t.addEventListener("touchstart", n, { passive: !1 }); } const F6 = (t) => { const e = Ct(), { t: r } = qh(), i = mr(), n = mr(), a = ee(() => t.color.get("alpha")), o = ee(() => r("el.colorpicker.alphaLabel")); function s(d) { var h; d.target !== i.value && c(d), (h = i.value) == null || h.focus(); } function c(d) { if (!n.value || !i.value) return; const h = e.vnode.el.getBoundingClientRect(), { clientX: f, clientY: p } = q1(d); if (t.vertical) { let m = p - h.top; m = Math.max(i.value.offsetHeight / 2, m), m = Math.min(m, h.height - i.value.offsetHeight / 2), t.color.set("alpha", Math.round((m - i.value.offsetHeight / 2) / (h.height - i.value.offsetHeight) * 100)); } else { let m = f - h.left; m = Math.max(i.value.offsetWidth / 2, m), m = Math.min(m, h.width - i.value.offsetWidth / 2), t.color.set("alpha", Math.round((m - i.value.offsetWidth / 2) / (h.width - i.value.offsetWidth) * 100)); } } function l(d) { const { code: h, shiftKey: f } = d, p = f ? 10 : 1; switch (h) { case Gr.left: case Gr.down: d.preventDefault(), d.stopPropagation(), u(-p); break; case Gr.right: case Gr.up: d.preventDefault(), d.stopPropagation(), u(p); break; } } function u(d) { let h = a.value + d; h = h < 0 ? 0 : h > 100 ? 100 : h, t.color.set("alpha", h); } return { thumb: i, bar: n, alpha: a, alphaLabel: o, handleDrag: c, handleClick: s, handleKeydown: l }; }, z6 = (t, { bar: e, thumb: r, handleDrag: i }) => { const n = Ct(), a = Et("color-alpha-slider"), o = we(0), s = we(0), c = we(); function l() { if (!r.value || t.vertical) return 0; const v = n.vnode.el, x = t.color.get("alpha"); return v ? Math.round(x * (v.offsetWidth - r.value.offsetWidth / 2) / 100) : 0; } function u() { if (!r.value) return 0; const v = n.vnode.el; if (!t.vertical) return 0; const x = t.color.get("alpha"); return v ? Math.round(x * (v.offsetHeight - r.value.offsetHeight / 2) / 100) : 0; } function d() { if (t.color && t.color.value) { const { r: v, g: x, b: w } = t.color.toRgb(); return `linear-gradient(to right, rgba(${v}, ${x}, ${w}, 0) 0%, rgba(${v}, ${x}, ${w}, 1) 100%)`; } return ""; } function h() { o.value = l(), s.value = u(), c.value = d(); } Lt(() => { if (!e.value || !r.value) return; const v = { drag: (x) => { i(x); }, end: (x) => { i(x); } }; ph(e.value, v), ph(r.value, v), h(); }), ze(() => t.color.get("alpha"), () => h()), ze(() => t.color.value, () => h()); const f = ee(() => [a.b(), a.is("vertical", t.vertical)]), p = ee(() => a.e("bar")), m = ee(() => a.e("thumb")), y = ee(() => ({ background: c.value })), g = ee(() => ({ left: Yc(o.value), top: Yc(s.value) })); return { rootKls: f, barKls: p, barStyle: y, thumbKls: m, thumbStyle: g, update: h }; }, $6 = "ElColorAlphaSlider", V6 = Le({ name: $6 }), U6 = /* @__PURE__ */ Le({ ...V6, props: B6, setup(t, { expose: e }) { const r = t, { alpha: i, alphaLabel: n, bar: a, thumb: o, handleDrag: s, handleClick: c, handleKeydown: l } = F6(r), { rootKls: u, barKls: d, barStyle: h, thumbKls: f, thumbStyle: p, update: m } = z6(r, { bar: a, thumb: o, handleDrag: s }); return e({ update: m, bar: a, thumb: o }), (y, g) => (Q(), be("div", { class: xe(N(u)) }, [ Ee("div", { ref_key: "bar", ref: a, class: xe(N(d)), style: yt(N(h)), onClick: N(c) }, null, 14, ["onClick"]), Ee("div", { ref_key: "thumb", ref: o, class: xe(N(f)), style: yt(N(p)), "aria-label": N(n), "aria-valuenow": N(i), "aria-orientation": y.vertical ? "vertical" : "horizontal", "aria-valuemin": "0", "aria-valuemax": "100", role: "slider", tabindex: "0", onKeydown: N(l) }, null, 46, ["aria-label", "aria-valuenow", "aria-orientation", "onKeydown"]) ], 2)); } }); var j6 = /* @__PURE__ */ Mt(U6, [["__file", "alpha-slider.vue"]]); const H6 = Le({ name: "ElColorHueSlider", props: { color: { type: Object, required: !0 }, vertical: Boolean }, setup(t) { const e = Et("color-hue-slider"), r = Ct(), i = we(), n = we(), a = we(0), o = we(0), s = ee(() => t.color.get("hue")); ze(() => s.value, () => { h(); }); function c(f) { f.target !== i.value && l(f); } function l(f) { if (!n.value || !i.value) return; const p = r.vnode.el.getBoundingClientRect(), { clientX: m, clientY: y } = q1(f); let g; if (t.vertical) { let v = y - p.top; v = Math.min(v, p.height - i.value.offsetHeight / 2), v = Math.max(i.value.offsetHeight / 2, v), g = Math.round((v - i.value.offsetHeight / 2) / (p.height - i.value.offsetHeight) * 360); } else { let v = m - p.left; v = Math.min(v, p.width - i.value.offsetWidth / 2), v = Math.max(i.value.offsetWidth / 2, v), g = Math.round((v - i.value.offsetWidth / 2) / (p.width - i.value.offsetWidth) * 360); } t.color.set("hue", g); } function u() { if (!i.value) return 0; const f = r.vnode.el; if (t.vertical) return 0; const p = t.color.get("hue"); return f ? Math.round(p * (f.offsetWidth - i.value.offsetWidth / 2) / 360) : 0; } function d() { if (!i.value) return 0; const f = r.vnode.el; if (!t.vertical) return 0; const p = t.color.get("hue"); return f ? Math.round(p * (f.offsetHeight - i.value.offsetHeight / 2) / 360) : 0; } function h() { a.value = u(), o.value = d(); } return Lt(() => { if (!n.value || !i.value) return; const f = { drag: (p) => { l(p); }, end: (p) => { l(p); } }; ph(n.value, f), ph(i.value, f), h(); }), { bar: n, thumb: i, thumbLeft: a, thumbTop: o, hueValue: s, handleClick: c, update: h, ns: e }; } }); function G6(t, e, r, i, n, a) { return Q(), be("div", { class: xe([t.ns.b(), t.ns.is("vertical", t.vertical)]) }, [ Ee("div", { ref: "bar", class: xe(t.ns.e("bar")), onClick: t.handleClick }, null, 10, ["onClick"]), Ee("div", { ref: "thumb", class: xe(t.ns.e("thumb")), style: yt({ left: t.thumbLeft + "px", top: t.thumbTop + "px" }) }, null, 6) ], 2); } var W6 = /* @__PURE__ */ Mt(H6, [["render", G6], ["__file", "hue-slider.vue"]]); const q6 = Kt({ modelValue: String, id: String, showAlpha: Boolean, colorFormat: String, disabled: Boolean, size: Du, popperClass: { type: String, default: "" }, tabindex: { type: [String, Number], default: 0 }, teleported: $i.teleported, predefine: { type: vt(Array) }, validateEvent: { type: Boolean, default: !0 }, ...Ts(["ariaLabel"]) }), X6 = { [ui]: (t) => Ei(t) || ts(t), [ib]: (t) => Ei(t) || ts(t), activeChange: (t) => Ei(t) || ts(t), focus: (t) => t instanceof FocusEvent, blur: (t) => t instanceof FocusEvent }, tA = Symbol("colorPickerContextKey"), U2 = function(t, e, r) { return [ t, e * r / ((t = (2 - e) * r) < 1 ? t : 2 - t) || 0, t / 2 ]; }, Z6 = function(t) { return typeof t == "string" && t.includes(".") && Number.parseFloat(t) === 1; }, Y6 = function(t) { return typeof t == "string" && t.includes("%"); }, Fc = function(t, e) { Z6(t) && (t = "100%"); const r = Y6(t); return t = Math.min(e, Math.max(0, Number.parseFloat(`${t}`))), r && (t = Number.parseInt(`${t * e}`, 10) / 100), Math.abs(t - e) < 1e-6 ? 1 : t % e / Number.parseFloat(e); }, j2 = { 10: "A", 11: "B", 12: "C", 13: "D", 14: "E", 15: "F" }, nm = (t) => { t = Math.min(Math.round(t), 255); const e = Math.floor(t / 16), r = t % 16; return `${j2[e] || e}${j2[r] || r}`; }, H2 = function({ r: t, g: e, b: r }) { return Number.isNaN(+t) || Number.isNaN(+e) || Number.isNaN(+r) ? "" : `#${nm(t)}${nm(e)}${nm(r)}`; }, Fv = { A: 10, B: 11, C: 12, D: 13, E: 14, F: 15 }, Fs = function(t) { return t.length === 2 ? (Fv[t[0].toUpperCase()] || +t[0]) * 16 + (Fv[t[1].toUpperCase()] || +t[1]) : Fv[t[1].toUpperCase()] || +t[1]; }, K6 = function(t, e, r) { e = e / 100, r = r / 100; let i = e; const n = Math.max(r, 0.01); r *= 2, e *= r <= 1 ? r : 2 - r, i *= n <= 1 ? n : 2 - n; const a = (r + e) / 2, o = r === 0 ? 2 * i / (n + i) : 2 * e / (r + e); return { h: t, s: o * 100, v: a * 100 }; }, G2 = (t, e, r) => { t = Fc(t, 255), e = Fc(e, 255), r = Fc(r, 255); const i = Math.max(t, e, r), n = Math.min(t, e, r); let a; const o = i, s = i - n, c = i === 0 ? 0 : s / i; if (i === n) a = 0; else { switch (i) { case t: { a = (e - r) / s + (e < r ? 6 : 0); break; } case e: { a = (r - t) / s + 2; break; } case r: { a = (t - e) / s + 4; break; } } a /= 6; } return { h: a * 360, s: c * 100, v: o * 100 }; }, dd = function(t, e, r) { t = Fc(t, 360) * 6, e = Fc(e, 100), r = Fc(r, 100); const i = Math.floor(t), n = t - i, a = r * (1 - e), o = r * (1 - n * e), s = r * (1 - (1 - n) * e), c = i % 6, l = [r, o, a, a, s, r][c], u = [s, r, r, o, a, a][c], d = [a, a, s, r, r, o][c]; return { r: Math.round(l * 255), g: Math.round(u * 255), b: Math.round(d * 255) }; }; let qd = class { constructor(e = {}) { this._hue = 0, this._saturation = 100, this._value = 100, this._alpha = 100, this.enableAlpha = !1, this.format = "hex", this.value = ""; for (const r in e) vl(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 i in e) vl(e, i) && this.set(i, e[i]); return; } this[`_${e}`] = r, this.doOnChange(); } get(e) { return e === "alpha" ? Math.floor(this[`_${e}`]) : this[`_${e}`]; } toRgb() { return dd(this._hue, this._saturation, this._value); } fromString(e) { if (!e) { this._hue = 0, this._saturation = 100, this._value = 100, this.doOnChange(); return; } const r = (i, n, a) => { this._hue = Math.max(0, Math.min(360, i)), this._saturation = Math.max(0, Math.min(100, n)), this._value = Math.max(0, Math.min(100, a)), this.doOnChange(); }; if (e.includes("hsl")) { const i = e.replace(/hsla|hsl|\(|\)/gm, "").split(/\s|,/g).filter((n) => n !== "").map((n, a) => a > 2 ? Number.parseFloat(n) : Number.parseInt(n, 10)); if (i.length === 4 ? this._alpha = Number.parseFloat(i[3]) * 100 : i.length === 3 && (this._alpha = 100), i.length >= 3) { const { h: n, s: a, v: o } = K6(i[0], i[1], i[2]); r(n, a, o); } } else if (e.includes("hsv")) { const i = e.replace(/hsva|hsv|\(|\)/gm, "").split(/\s|,/g).filter((n) => n !== "").map((n, a) => a > 2 ? Number.parseFloat(n) : Number.parseInt(n, 10)); i.length === 4 ? this._alpha = Number.parseFloat(i[3]) * 100 : i.length === 3 && (this._alpha = 100), i.length >= 3 && r(i[0], i[1], i[2]); } else if (e.includes("rgb")) { const i = e.replace(/rgba|rgb|\(|\)/gm, "").split(/\s|,/g).filter((n) => n !== "").map((n, a) => a > 2 ? Number.parseFloat(n) : Number.parseInt(n, 10)); if (i.length === 4 ? this._alpha = Number.parseFloat(i[3]) * 100 : i.length === 3 && (this._alpha = 100), i.length >= 3) { const { h: n, s: a, v: o } = G2(i[0], i[1], i[2]); r(n, a, o); } } else if (e.includes("#")) { const i = e.replace("#", "").trim(); if (!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(i)) return; let n, a, o; i.length === 3 ? (n = Fs(i[0] + i[0]), a = Fs(i[1] + i[1]), o = Fs(i[2] + i[2])) : (i.length === 6 || i.length === 8) && (n = Fs(i.slice(0, 2)), a = Fs(i.slice(2, 4)), o = Fs(i.slice(4, 6))), i.length === 8 ? this._alpha = Fs(i.slice(6)) / 255 * 100 : (i.length === 3 || i.length === 6) && (this._alpha = 100); const { h: s, s: c, v: l } = G2(n, a, o); r(s, c, 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: i, _alpha: n, format: a } = this; if (this.enableAlpha) switch (a) { case "hsl": { const o = U2(e, r / 100, i / 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(i)}%, ${this.get("alpha") / 100})`; break; } case "hex": { this.value = `${H2(dd(e, r, i))}${nm(n * 255 / 100)}`; break; } default: { const { r: o, g: s, b: c } = dd(e, r, i); this.value = `rgba(${o}, ${s}, ${c}, ${this.get("alpha") / 100})`; } } else switch (a) { case "hsl": { const o = U2(e, r / 100, i / 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(i)}%)`; break; } case "rgb": { const { r: o, g: s, b: c } = dd(e, r, i); this.value = `rgb(${o}, ${s}, ${c})`; break; } default: this.value = H2(dd(e, r, i)); } } }; const J6 = Le({ props: { colors: { type: Array, required: !0 }, color: { type: Object, required: !0 }, enableAlpha: { type: Boolean, required: !0 } }, setup(t) { const e = Et("color-predefine"), { currentColor: r } = Ye(tA), i = we(a(t.colors, t.color)); ze(() => r.value, (o) => { const s = new qd(); s.fromString(o), i.value.forEach((c) => { c.selected = s.compare(c); }); }), lg(() => { i.value = a(t.colors, t.color); }); function n(o) { t.color.fromString(t.colors[o]); } function a(o, s) { return o.map((c) => { const l = new qd(); return l.enableAlpha = t.enableAlpha, l.format = "rgba", l.fromString(c), l.selected = l.value === s.value, l; }); } return { rgbaColors: i, handleSelect: n, ns: e }; } }); function Q6(t, e, r, i, n, a) { return Q(), be("div", { class: xe(t.ns.b()) }, [ Ee("div", { class: xe(t.ns.e("colors")) }, [ (Q(!0), be(pt, null, ir(t.rgbaColors, (o, s) => (Q(), be("div", { key: t.colors[s], class: xe([ t.ns.e("color-selector"), t.ns.is("alpha", o._alpha < 100), { selected: o.selected } ]), onClick: (c) => t.handleSelect(s) }, [ Ee("div", { style: yt({ backgroundColor: o.value }) }, null, 4) ], 10, ["onClick"]))), 128)) ], 2) ], 2); } var eV = /* @__PURE__ */ Mt(J6, [["render", Q6], ["__file", "predefine.vue"]]); const tV = Le({ name: "ElSlPanel", props: { color: { type: Object, required: !0 } }, setup(t) { const e = Et("color-svpanel"), r = Ct(), i = we(0), n = we(0), a = we("hsl(0, 100%, 50%)"), o = ee(() => { const l = t.color.get("hue"), u = t.color.get("value"); return { hue: l, value: u }; }); function s() { const l = t.color.get("saturation"), u = t.color.get("value"), d = r.vnode.el, { clientWidth: h, clientHeight: f } = d; n.value = l * h / 100, i.value = (100 - u) * f / 100, a.value = `hsl(${t.color.get("hue")}, 100%, 50%)`; } function c(l) { const u = r.vnode.el.getBoundingClientRect(), { clientX: d, clientY: h } = q1(l); let f = d - u.left, p = h - u.top; f = Math.max(0, f), f = Math.min(f, u.width), p = Math.max(0, p), p = Math.min(p, u.height), n.value = f, i.value = p, t.color.set({ saturation: f / u.width * 100, value: 100 - p / u.height * 100 }); } return ze(() => o.value, () => { s(); }), Lt(() => { ph(r.vnode.el, { drag: (l) => { c(l); }, end: (l) => { c(l); } }), s(); }), { cursorTop: i, cursorLeft: n, background: a, colorValue: o, handleDrag: c, update: s, ns: e }; } }); function rV(t, e, r, i, n, a) { return Q(), be("div", { class: xe(t.ns.b()), style: yt({ backgroundColor: t.background }) }, [ Ee("div", { class: xe(t.ns.e("white")) }, null, 2), Ee("div", { class: xe(t.ns.e("black")) }, null, 2), Ee("div", { class: xe(t.ns.e("cursor")), style: yt({ top: t.cursorTop + "px", left: t.cursorLeft + "px" }) }, [ Ee("div") ], 6) ], 6); } var iV = /* @__PURE__ */ Mt(tV, [["render", rV], ["__file", "sv-panel.vue"]]); const nV = Le({ name: "ElColorPicker" }), aV = /* @__PURE__ */ Le({ ...nV, props: q6, emits: X6, setup(t, { expose: e, emit: r }) { const i = t, { t: n } = qh(), a = Et("color"), { formItem: o } = zl(), s = bl(), c = Yh(), { inputId: l, isLabeledByFormItem: u } = Kh(i, { formItemContext: o }), d = we(), h = we(), f = we(), p = we(), m = we(), y = we(), { isFocused: g, handleFocus: v, handleBlur: x } = pb(m, { beforeFocus() { return c.value; }, beforeBlur(W) { var Y; return (Y = p.value) == null ? void 0 : Y.isFocusInsideContent(W); }, afterBlur() { R(!1), I(); } }); let w = !0; const S = _r(new qd({ enableAlpha: i.showAlpha, format: i.colorFormat || "", value: i.modelValue })), _ = we(!1), b = we(!1), T = we(""), E = ee(() => !i.modelValue && !b.value ? "transparent" : P(S, i.showAlpha)), C = ee(() => !i.modelValue && !b.value ? "" : S.value), L = ee(() => u.value ? void 0 : i.ariaLabel || n("el.colorpicker.defaultLabel")), A = ee(() => u.value ? o == null ? void 0 : o.labelId : void 0), k = ee(() => [ a.b("picker"), a.is("disabled", c.value), a.bm("picker", s.value), a.is("focused", g.value) ]); function P(W, Y) { if (!(W instanceof qd)) throw new TypeError("color should be instance of _color Class"); const { r: X, g: ie, b: ue } = W.toRgb(); return Y ? `rgba(${X}, ${ie}, ${ue}, ${W.get("alpha") / 100})` : `rgb(${X}, ${ie}, ${ue})`; } function R(W) { _.value = W; } const M = oC(R, 100, { leading: !0 }); function O() { c.value || R(!0); } function D() { M(!1), I(); } function I() { st(() => { i.modelValue ? S.fromString(i.modelValue) : (S.value = "", st(() => { b.value = !1; })); }); } function F() { c.value || M(!_.value); } function z() { S.fromString(T.value); } function U() { const W = S.value; r(ui, W), r("change", W), i.validateEvent && (o == null || o.validate("change").catch((Y) => Vr(Y))), M(!1), st(() => { const Y = new qd({ enableAlpha: i.showAlpha, format: i.colorFormat || "", value: i.modelValue }); S.compare(Y) || I(); }); } function Z() { M(!1), r(ui, null), r("change", null), i.modelValue !== null && i.validateEvent && (o == null || o.validate("change").catch((W) => Vr(W))), I(); } function re() { _.value && (D(), g.value && H()); } function K(W) { W.preventDefault(), W.stopPropagation(), R(!1), I(); } function V(W) { switch (W.code) { case Gr.enter: case Gr.space: W.preventDefault(), W.stopPropagation(), O(), y.value.focus(); break; case Gr.esc: K(W); break; } } function H() { m.value.focus(); } function G() { m.value.blur(); } return Lt(() => { i.modelValue && (T.value = C.value); }), ze(() => i.modelValue, (W) => { W ? W && W !== S.value && (w = !1, S.fromString(W)) : b.value = !1; }), ze(() => [i.colorFormat, i.showAlpha], () => { S.enableAlpha = i.showAlpha, S.format = i.colorFormat || S.format, S.doOnChange(), r(ui, S.value); }), ze(() => C.value, (W) => { T.value = W, w && r("activeChange", W), w = !0; }), ze(() => S.value, () => { !i.modelValue && !b.value && (b.value = !0); }), ze(() => _.value, () => { st(() => { var W, Y, X; (W = d.value) == null || W.update(), (Y = h.value) == null || Y.update(), (X = f.value) == null || X.update(); }); }), Dt(tA, { currentColor: C }), e({ color: S, show: O, hide: D, focus: H, blur: G }), (W, Y) => (Q(), Re(N(wb), { ref_key: "popper", ref: p, visible: _.value, "show-arrow": !1, "fallback-placements": ["bottom", "top", "right", "left"], offset: 0, "gpu-acceleration": !1, "popper-class": [N(a).be("picker", "panel"), N(a).b("dropdown"), W.popperClass], "stop-popper-mouse-event": !1, effect: "light", trigger: "click", teleported: W.teleported, transition: `${N(a).namespace.value}-zoom-in-top`, persistent: "", onHide: (X) => R(!1) }, { content: le(() => [ ht((Q(), be("div", { onKeydown: ti(K, ["esc"]) }, [ Ee("div", { class: xe(N(a).be("dropdown", "main-wrapper")) }, [ oe(W6, { ref_key: "hue", ref: d, class: "hue-slider", color: N(S), vertical: "" }, null, 8, ["color"]), oe(iV, { ref_key: "sv", ref: h, color: N(S) }, null, 8, ["color"]) ], 2), W.showAlpha ? (Q(), Re(j6, { key: 0, ref_key: "alpha", ref: f, color: N(S) }, null, 8, ["color"])) : Pe("v-if", !0), W.predefine ? (Q(), Re(eV, { key: 1, ref: "predefine", "enable-alpha": W.showAlpha, color: N(S), colors: W.predefine }, null, 8, ["enable-alpha", "color", "colors"])) : Pe("v-if", !0), Ee("div", { class: xe(N(a).be("dropdown", "btns")) }, [ Ee("span", { class: xe(N(a).be("dropdown", "value")) }, [ oe(N(Jh), { ref_key: "inputRef", ref: y, modelValue: T.value, "onUpdate:modelValue": (X) => T.value = X, "validate-event": !1, size: "small", onKeyup: ti(z, ["enter"]), onBlur: z }, null, 8, ["modelValue", "onUpdate:modelValue", "onKeyup"]) ], 2), oe(N(us), { class: xe(N(a).be("dropdown", "link-btn")), text: "", size: "small", onClick: Z }, { default: le(() => [ et(Ze(N(n)("el.colorpicker.clear")), 1) ]), _: 1 }, 8, ["class"]), oe(N(us), { plain: "", size: "small", class: xe(N(a).be("dropdown", "btn")), onClick: U }, { default: le(() => [ et(Ze(N(n)("el.colorpicker.confirm")), 1) ]), _: 1 }, 8, ["class"]) ], 2) ], 40, ["onKeydown"])), [ [N(XC), re] ]) ]), default: le(() => [ Ee("div", Nr({ id: N(l), ref_key: "triggerRef", ref: m }, W.$attrs, { class: N(k), role: "button", "aria-label": N(L), "aria-labelledby": N(A), "aria-description": N(n)("el.colorpicker.description", { color: W.modelValue || "" }), "aria-disabled": N(c), tabindex: N(c) ? -1 : W.tabindex, onKeydown: V, onFocus: N(v), onBlur: N(x) }), [ N(c) ? (Q(), be("div", { key: 0, class: xe(N(a).be("picker", "mask")) }, null, 2)) : Pe("v-if", !0), Ee("div", { class: xe(N(a).be("picker", "trigger")), onClick: F }, [ Ee("span", { class: xe([N(a).be("picker", "color"), N(a).is("alpha", W.showAlpha)]) }, [ Ee("span", { class: xe(N(a).be("picker", "color-inner")), style: yt({ backgroundColor: N(E) }) }, [ ht(oe(N(Oi), { class: xe([N(a).be("picker", "icon"), N(a).is("icon-arrow-down")]) }, { default: le(() => [ oe(N(gg)) ]), _: 1 }, 8, ["class"]), [ [Ot, W.modelValue || b.value] ]), ht(oe(N(Oi), { class: xe([N(a).be("picker", "empty"), N(a).is("icon-close")]) }, { default: le(() => [ oe(N(Lm)) ]), _: 1 }, 8, ["class"]), [ [Ot, !W.modelValue && !b.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 oV = /* @__PURE__ */ Mt(aV, [["__file", "color-picker.vue"]]); const sV = ni(oV), lV = Le({ name: "ElContainer" }), cV = /* @__PURE__ */ Le({ ...lV, props: { direction: { type: String } }, setup(t) { const e = t, r = co(), i = Et("container"), n = ee(() => e.direction === "vertical" ? !0 : e.direction === "horizontal" ? !1 : r && r.default ? r.default().some((a) => { const o = a.type.name; return o === "ElHeader" || o === "ElFooter"; }) : !1); return (a, o) => (Q(), be("section", { class: xe([N(i).b(), N(i).is("vertical", N(n))]) }, [ Fe(a.$slots, "default") ], 2)); } }); var uV = /* @__PURE__ */ Mt(cV, [["__file", "container.vue"]]); const dV = Le({ name: "ElAside" }), hV = /* @__PURE__ */ Le({ ...dV, props: { width: { type: String, default: null } }, setup(t) { const e = t, r = Et("aside"), i = ee(() => e.width ? r.cssVarBlock({ width: e.width }) : {}); return (n, a) => (Q(), be("aside", { class: xe(N(r).b()), style: yt(N(i)) }, [ Fe(n.$slots, "default") ], 6)); } }); var rA = /* @__PURE__ */ Mt(hV, [["__file", "aside.vue"]]); const pV = Le({ name: "ElFooter" }), fV = /* @__PURE__ */ Le({ ...pV, props: { height: { type: String, default: null } }, setup(t) { const e = t, r = Et("footer"), i = ee(() => e.height ? r.cssVarBlock({ height: e.height }) : {}); return (n, a) => (Q(), be("footer", { class: xe(N(r).b()), style: yt(N(i)) }, [ Fe(n.$slots, "default") ], 6)); } }); var iA = /* @__PURE__ */ Mt(fV, [["__file", "footer.vue"]]); const mV = Le({ name: "ElHeader" }), gV = /* @__PURE__ */ Le({ ...mV, props: { height: { type: String, default: null } }, setup(t) { const e = t, r = Et("header"), i = ee(() => e.height ? r.cssVarBlock({ height: e.height }) : {}); return (n, a) => (Q(), be("header", { class: xe(N(r).b()), style: yt(N(i)) }, [ Fe(n.$slots, "default") ], 6)); } }); var nA = /* @__PURE__ */ Mt(gV, [["__file", "header.vue"]]); const vV = Le({ name: "ElMain" }), yV = /* @__PURE__ */ Le({ ...vV, setup(t) { const e = Et("main"); return (r, i) => (Q(), be("main", { class: xe(N(e).b()) }, [ Fe(r.$slots, "default") ], 2)); } }); var aA = /* @__PURE__ */ Mt(yV, [["__file", "main.vue"]]); const oA = ni(uV, { Aside: rA, Footer: iA, Header: nA, Main: aA }); po(rA); po(iA); const sA = po(nA), _b = po(aA), bV = /* @__PURE__ */ Le({ inheritAttrs: !1 }); function xV(t, e, r, i, n, a) { return Fe(t.$slots, "default"); } var wV = /* @__PURE__ */ Mt(bV, [["render", xV], ["__file", "collection.vue"]]); const _V = /* @__PURE__ */ Le({ name: "ElCollectionItem", inheritAttrs: !1 }); function SV(t, e, r, i, n, a) { return Fe(t.$slots, "default"); } var MV = /* @__PURE__ */ Mt(_V, [["render", SV], ["__file", "collection-item.vue"]]); const EV = "data-el-collection-item", TV = (t) => { const e = `El${t}Collection`, r = `${e}Item`, i = Symbol(e), n = Symbol(r), a = { ...wV, name: e, setup() { const s = we(null), c = /* @__PURE__ */ new Map(); Dt(i, { itemMap: c, getItems: () => { const l = N(s); if (!l) return []; const u = Array.from(l.querySelectorAll(`[${EV}]`)); return [...c.values()].sort((d, h) => u.indexOf(d.ref) - u.indexOf(h.ref)); }, collectionRef: s }); } }, o = { ...MV, name: r, setup(s, { attrs: c }) { const l = we(null), u = Ye(i, void 0); Dt(n, { collectionItemRef: l }), Lt(() => { const d = N(l); d && u.itemMap.set(d, { ref: d, ...c }); }), Sr(() => { const d = N(l); u.itemMap.delete(d); }); } }; return { COLLECTION_INJECTION_KEY: i, COLLECTION_ITEM_INJECTION_KEY: n, ElCollection: a, ElCollectionItem: o }; }, zv = Kt({ trigger: hh.trigger, effect: { ...$i.effect, default: "light" }, type: { type: vt(String) }, placement: { type: vt(String), default: "bottom" }, popperOptions: { type: vt(Object), default: () => ({}) }, id: String, size: { type: String, default: "" }, splitButton: Boolean, hideOnClick: { type: Boolean, default: !0 }, loop: { type: Boolean, default: !0 }, showTimeout: { type: Number, default: 150 }, hideTimeout: { type: Number, default: 150 }, tabindex: { type: vt([Number, String]), default: 0 }, maxHeight: { type: vt([Number, String]), default: "" }, popperClass: { type: String, default: "" }, disabled: Boolean, role: { type: String, default: "menu" }, buttonProps: { type: vt(Object) }, teleported: $i.teleported }); Kt({ command: { type: [Object, String, Number], default: () => ({}) }, disabled: Boolean, divided: Boolean, textValue: String, icon: { type: cs } }); Kt({ onKeydown: { type: vt(Function) } }); TV("Dropdown"); const lA = Symbol("ElSelectGroup"), ep = Symbol("ElSelect"); function CV(t, e) { const r = Ye(ep), i = Ye(lA, { disabled: !1 }), n = ee(() => u(qo(r.props.modelValue), t.value)), a = ee(() => { var f; if (r.props.multiple) { const p = qo((f = r.props.modelValue) != null ? f : []); return !n.value && p.length >= r.props.multipleLimit && r.props.multipleLimit > 0; } else return !1; }), o = ee(() => t.label || (di(t.value) ? "" : t.value)), s = ee(() => t.value || t.label || ""), c = ee(() => t.disabled || e.groupDisabled || a.value), l = Ct(), u = (f = [], p) => { if (di(t.value)) { const m = r.props.valueKey; return f && f.some((y) => gl(ja(y, m)) === ja(p, m)); } else return f && f.includes(p); }, d = () => { !t.disabled && !i.disabled && (r.states.hoveringIndex = r.optionsArray.indexOf(l.proxy)); }, h = (f) => { const p = new RegExp(U5(f), "i"); e.visible = p.test(o.value) || t.created; }; return ze(() => o.value, () => { !t.created && !r.props.remote && r.setSelected(); }), ze(() => t.value, (f, p) => { const { remote: m, valueKey: y } = r.props; if (f !== p && (r.onOptionDestroy(p, l.proxy), r.onOptionCreate(l.proxy)), !t.created && !m) { if (y && di(f) && di(p) && f[y] === p[y]) return; r.setSelected(); } }), ze(() => i.disabled, () => { e.groupDisabled = i.disabled; }, { immediate: !0 }), { select: r, currentLabel: o, currentValue: s, itemSelected: n, isDisabled: c, hoverItem: d, updateOption: h }; } const AV = Le({ name: "ElOption", componentName: "ElOption", props: { value: { required: !0, type: [String, Number, Boolean, Object] }, label: [String, Number], created: Boolean, disabled: Boolean }, setup(t) { const e = Et("select"), r = xg(), i = ee(() => [ e.be("dropdown", "item"), e.is("disabled", N(s)), e.is("selected", N(o)), e.is("hovering", N(h)) ]), n = _r({ index: -1, groupDisabled: !1, visible: !0, hover: !1 }), { currentLabel: a, itemSelected: o, isDisabled: s, select: c, hoverItem: l, updateOption: u } = CV(t, n), { visible: d, hover: h } = Zi(n), f = Ct().proxy; c.onOptionCreate(f), Sr(() => { const m = f.value, { selected: y } = c.states, g = (c.props.multiple ? y : [y]).some((v) => v.value === f.value); st(() => { c.states.cachedOptions.get(m) === f && !g && c.states.cachedOptions.delete(m); }), c.onOptionDestroy(m, f); }); function p() { s.value || c.handleOptionSelect(f); } return { ns: e, id: r, containerKls: i, currentLabel: a, itemSelected: o, isDisabled: s, select: c, hoverItem: l, updateOption: u, visible: d, hover: h, selectOptionClick: p, states: n }; } }); function LV(t, e, r, i, n, a) { return ht((Q(), be("li", { id: t.id, class: xe(t.containerKls), role: "option", "aria-disabled": t.isDisabled || void 0, "aria-selected": t.itemSelected, onMouseenter: t.hoverItem, onClick: Tt(t.selectOptionClick, ["stop"]) }, [ Fe(t.$slots, "default", {}, () => [ Ee("span", null, Ze(t.currentLabel), 1) ]) ], 42, ["id", "aria-disabled", "aria-selected", "onMouseenter", "onClick"])), [ [Ot, t.visible] ]); } var Sb = /* @__PURE__ */ Mt(AV, [["render", LV], ["__file", "option.vue"]]); const kV = Le({ name: "ElSelectDropdown", componentName: "ElSelectDropdown", setup() { const t = Ye(ep), e = Et("select"), r = ee(() => t.props.popperClass), i = ee(() => t.props.multiple), n = ee(() => t.props.fitInputWidth), a = we(""); function o() { var s; a.value = `${(s = t.selectRef) == null ? void 0 : s.offsetWidth}px`; } return Lt(() => { o(), Ua(t.selectRef, o); }), { ns: e, minWidth: a, popperClass: r, isMultiple: i, isFitInputWidth: n }; } }); function PV(t, e, r, i, n, a) { return Q(), be("div", { class: xe([t.ns.b("dropdown"), t.ns.is("multiple", t.isMultiple), t.popperClass]), style: yt({ [t.isFitInputWidth ? "width" : "minWidth"]: t.minWidth }) }, [ t.$slots.header ? (Q(), be("div", { key: 0, class: xe(t.ns.be("dropdown", "header")) }, [ Fe(t.$slots, "header") ], 2)) : Pe("v-if", !0), Fe(t.$slots, "default"), t.$slots.footer ? (Q(), be("div", { key: 1, class: xe(t.ns.be("dropdown", "footer")) }, [ Fe(t.$slots, "footer") ], 2)) : Pe("v-if", !0) ], 6); } var RV = /* @__PURE__ */ Mt(kV, [["render", PV], ["__file", "select-dropdown.vue"]]); const OV = 11, DV = (t, e) => { const { t: r } = qh(), i = xg(), n = Et("select"), a = Et("input"), o = _r({ inputValue: "", options: /* @__PURE__ */ new Map(), cachedOptions: /* @__PURE__ */ new Map(), disabledOptions: /* @__PURE__ */ new Map(), optionValues: [], selected: [], selectionWidth: 0, calculatorWidth: 0, collapseItemWidth: 0, selectedLabel: "", hoveringIndex: -1, previousQuery: null, inputHovering: !1, menuVisibleOnFocus: !1, isBeforeHide: !1 }), s = we(null), c = we(null), l = we(null), u = we(null), d = we(null), h = we(null), f = we(null), p = we(null), m = we(null), y = we(null), g = we(null), v = we(null), { isComposing: x, handleCompositionStart: w, handleCompositionUpdate: S, handleCompositionEnd: _ } = IC({ afterComposition: (ae) => te(ae) }), { wrapperRef: b, isFocused: T } = pb(d, { beforeFocus() { return M.value; }, afterFocus() { t.automaticDropdown && !E.value && (E.value = !0, o.menuVisibleOnFocus = !0); }, beforeBlur(ae) { var Se, Be; return ((Se = l.value) == null ? void 0 : Se.isFocusInsideContent(ae)) || ((Be = u.value) == null ? void 0 : Be.isFocusInsideContent(ae)); }, afterBlur() { E.value = !1, o.menuVisibleOnFocus = !1; } }), E = we(!1), C = we(), { form: L, formItem: A } = zl(), { inputId: k } = Kh(t, { formItemContext: A }), { valueOnClear: P, isEmptyValue: R } = qF(t), M = ee(() => t.disabled || (L == null ? void 0 : L.disabled)), O = ee(() => Ui(t.modelValue) ? t.modelValue.length > 0 : !R(t.modelValue)), D = ee(() => t.clearable && !M.value && o.inputHovering && O.value), I = ee(() => t.remote && t.filterable && !t.remoteShowSuffix ? "" : t.suffixIcon), F = ee(() => n.is("reverse", I.value && E.value)), z = ee(() => (A == null ? void 0 : A.validateState) || ""), U = ee(() => hC[z.value]), Z = ee(() => t.remote ? 300 : 0), re = ee(() => t.loading ? t.loadingText || r("el.select.loading") : t.remote && !o.inputValue && o.options.size === 0 ? !1 : t.filterable && o.inputValue && o.options.size > 0 && K.value === 0 ? t.noMatchText || r("el.select.noMatch") : o.options.size === 0 ? t.noDataText || r("el.select.noData") : null), K = ee(() => V.value.filter((ae) => ae.visible).length), V = ee(() => { const ae = Array.from(o.options.values()), Se = []; return o.optionValues.forEach((Be) => { const Ge = ae.findIndex((tt) => tt.value === Be); Ge > -1 && Se.push(ae[Ge]); }), Se.length >= ae.length ? Se : ae; }), H = ee(() => Array.from(o.cachedOptions.values())), G = ee(() => { const ae = V.value.filter((Se) => !Se.created).some((Se) => Se.currentLabel === o.inputValue); return t.filterable && t.allowCreate && o.inputValue !== "" && !ae; }), W = () => { t.filterable && Di(t.filterMethod) || t.filterable && t.remote && Di(t.remoteMethod) || V.value.forEach((ae) => { var Se; (Se = ae.updateOption) == null || Se.call(ae, o.inputValue); }); }, Y = bl(), X = ee(() => ["small"].includes(Y.value) ? "small" : "default"), ie = ee({ get() { return E.value && re.value !== !1; }, set(ae) { E.value = ae; } }), ue = ee(() => { if (t.multiple && !Yo(t.modelValue)) return qo(t.modelValue).length === 0 && !o.inputValue; const ae = Ui(t.modelValue) ? t.modelValue[0] : t.modelValue; return t.filterable || Yo(ae) ? !o.inputValue : !0; }), $ = ee(() => { var ae; const Se = (ae = t.placeholder) != null ? ae : r("el.select.placeholder"); return t.multiple || !O.value ? Se : o.selectedLabel; }), J = ee(() => sy ? null : "mouseenter"); ze(() => t.modelValue, (ae, Se) => { t.multiple && t.filterable && !t.reserveKeyword && (o.inputValue = "", ne("")), q(), !Cm(ae, Se) && t.validateEvent && (A == null || A.validate("change").catch((Be) => Vr(Be))); }, { flush: "post", deep: !0 }), ze(() => E.value, (ae) => { ae ? ne(o.inputValue) : (o.inputValue = "", o.previousQuery = null, o.isBeforeHide = !0), e("visible-change", ae); }), ze(() => o.options.entries(), () => { var ae; if (!$r) return; const Se = ((ae = s.value) == null ? void 0 : ae.querySelectorAll("input")) || []; (!t.filterable && !t.defaultFirstOption && !Yo(t.modelValue) || !Array.from(Se).includes(document.activeElement)) && q(), t.defaultFirstOption && (t.filterable || t.remote) && K.value && j(); }, { flush: "post" }), ze(() => o.hoveringIndex, (ae) => { hi(ae) && ae > -1 ? C.value = V.value[ae] || {} : C.value = {}, V.value.forEach((Se) => { Se.hover = C.value === Se; }); }), lg(() => { o.isBeforeHide || W(); }); const ne = (ae) => { o.previousQuery === ae || x.value || (o.previousQuery = ae, t.filterable && Di(t.filterMethod) ? t.filterMethod(ae) : t.filterable && t.remote && Di(t.remoteMethod) && t.remoteMethod(ae), t.defaultFirstOption && (t.filterable || t.remote) && K.value ? st(j) : st(ye)); }, j = () => { const ae = V.value.filter((Ge) => Ge.visible && !Ge.disabled && !Ge.states.groupDisabled), Se = ae.find((Ge) => Ge.created), Be = ae[0]; o.hoveringIndex = qe(V.value, Se || Be); }, q = () => { if (t.multiple) o.selectedLabel = ""; else { const Se = Ui(t.modelValue) ? t.modelValue[0] : t.modelValue, Be = ge(Se); o.selectedLabel = Be.currentLabel, o.selected = [Be]; return; } const ae = []; Yo(t.modelValue) || qo(t.modelValue).forEach((Se) => { ae.push(ge(Se)); }), o.selected = ae; }, ge = (ae) => { let Se; const Be = Tv(ae).toLowerCase() === "object", Ge = Tv(ae).toLowerCase() === "null", tt = Tv(ae).toLowerCase() === "undefined"; for (let ut = o.cachedOptions.size - 1; ut >= 0; ut--) { const St = H.value[ut]; if (Be ? ja(St.value, t.valueKey) === ja(ae, t.valueKey) : St.value === ae) { Se = { value: ae, currentLabel: St.currentLabel, get isDisabled() { return St.isDisabled; } }; break; } } if (Se) return Se; const gt = Be ? ae.label : !Ge && !tt ? ae : ""; return { value: ae, currentLabel: gt }; }, ye = () => { o.hoveringIndex = V.value.findIndex((ae) => o.selected.some((Se) => xt(Se) === xt(ae))); }, _e = () => { o.selectionWidth = c.value.getBoundingClientRect().width; }, Me = () => { o.calculatorWidth = h.value.getBoundingClientRect().width; }, Ce = () => { o.collapseItemWidth = g.value.getBoundingClientRect().width; }, B = () => { var ae, Se; (Se = (ae = l.value) == null ? void 0 : ae.updatePopper) == null || Se.call(ae); }, ce = () => { var ae, Se; (Se = (ae = u.value) == null ? void 0 : ae.updatePopper) == null || Se.call(ae); }, ve = () => { o.inputValue.length > 0 && !E.value && (E.value = !0), ne(o.inputValue); }, te = (ae) => { if (o.inputValue = ae.target.value, t.remote) pe(); else return ve(); }, pe = oC(() => { ve(); }, Z.value), fe = (ae) => { Cm(t.modelValue, ae) || e(ib, ae); }, he = (ae) => N5(ae, (Se) => !o.disabledOptions.has(Se)), Te = (ae) => { if (t.multiple && ae.code !== Gr.delete && ae.target.value.length <= 0) { const Se = qo(t.modelValue).slice(), Be = he(Se); if (Be < 0) return; const Ge = Se[Be]; Se.splice(Be, 1), e(ui, Se), fe(Se), e("remove-tag", Ge); } }, He = (ae, Se) => { const Be = o.selected.indexOf(Se); if (Be > -1 && !M.value) { const Ge = qo(t.modelValue).slice(); Ge.splice(Be, 1), e(ui, Ge), fe(Ge), e("remove-tag", Se.value); } ae.stopPropagation(), _t(); }, We = (ae) => { ae.stopPropagation(); const Se = t.multiple ? [] : P.value; if (t.multiple) for (const Be of o.selected) Be.isDisabled && Se.push(Be.value); e(ui, Se), fe(Se), o.hoveringIndex = -1, E.value = !1, e("clear"), _t(); }, Ie = (ae) => { var Se; if (t.multiple) { const Be = qo((Se = t.modelValue) != null ? Se : []).slice(), Ge = qe(Be, ae.value); Ge > -1 ? Be.splice(Ge, 1) : (t.multipleLimit <= 0 || Be.length < t.multipleLimit) && Be.push(ae.value), e(ui, Be), fe(Be), ae.created && ne(""), t.filterable && !t.reserveKeyword && (o.inputValue = ""); } else e(ui, ae.value), fe(ae.value), E.value = !1; _t(), !E.value && st(() => { De(ae); }); }, qe = (ae = [], Se) => { if (!di(Se)) return ae.indexOf(Se); const Be = t.valueKey; let Ge = -1; return ae.some((tt, gt) => gl(ja(tt, Be)) === ja(Se, Be) ? (Ge = gt, !0) : !1), Ge; }, De = (ae) => { var Se, Be, Ge, tt, gt; const ut = Ui(ae) ? ae[0] : ae; let St = null; if (ut != null && ut.value) { const er = V.value.filter((vr) => vr.value === ut.value); er.length > 0 && (St = er[0].$el); } if (l.value && St) { const er = (tt = (Ge = (Be = (Se = l.value) == null ? void 0 : Se.popperRef) == null ? void 0 : Be.contentRef) == null ? void 0 : Ge.querySelector) == null ? void 0 : tt.call(Ge, `.${n.be("dropdown", "wrap")}`); er && G5(er, St); } (gt = v.value) == null || gt.handleScroll(); }, $e = (ae) => { o.options.set(ae.value, ae), o.cachedOptions.set(ae.value, ae), ae.disabled && o.disabledOptions.set(ae.value, ae); }, nt = (ae, Se) => { o.options.get(ae) === Se && o.options.delete(ae); }, lt = ee(() => { var ae, Se; return (Se = (ae = l.value) == null ? void 0 : ae.popperRef) == null ? void 0 : Se.contentRef; }), mt = () => { o.isBeforeHide = !1, st(() => De(o.selected)); }, _t = () => { var ae; (ae = d.value) == null || ae.focus(); }, wt = () => { var ae; (ae = d.value) == null || ae.blur(); }, me = (ae) => { We(ae); }, Ne = () => { E.value = !1, T.value && wt(); }, Ue = () => { o.inputValue.length > 0 ? o.inputValue = "" : E.value = !1; }, Ke = () => { M.value || (sy && (o.inputHovering = !0), o.menuVisibleOnFocus ? o.menuVisibleOnFocus = !1 : E.value = !E.value); }, ct = () => { E.value ? V.value[o.hoveringIndex] && Ie(V.value[o.hoveringIndex]) : Ke(); }, xt = (ae) => di(ae.value) ? ja(ae.value, t.valueKey) : ae.value, At = ee(() => V.value.filter((ae) => ae.visible).every((ae) => ae.disabled)), Ft = ee(() => t.multiple ? t.collapseTags ? o.selected.slice(0, t.maxCollapseTags) : o.selected : []), zt = ee(() => t.multiple ? t.collapseTags ? o.selected.slice(t.maxCollapseTags) : [] : []), se = (ae) => { if (!E.value) { E.value = !0; return; } if (!(o.options.size === 0 || o.filteredOptionsCount === 0 || x.value) && !At.value) { ae === "next" ? (o.hoveringIndex++, o.hoveringIndex === o.options.size && (o.hoveringIndex = 0)) : ae === "prev" && (o.hoveringIndex--, o.hoveringIndex < 0 && (o.hoveringIndex = o.options.size - 1)); const Se = V.value[o.hoveringIndex]; (Se.disabled === !0 || Se.states.groupDisabled === !0 || !Se.visible) && se(ae), st(() => De(C.value)); } }, ke = () => { if (!c.value) return 0; const ae = window.getComputedStyle(c.value); return Number.parseFloat(ae.gap || "6px"); }, Ae = ee(() => { const ae = ke(); return { maxWidth: `${g.value && t.maxCollapseTags === 1 ? o.selectionWidth - o.collapseItemWidth - ae : o.selectionWidth}px` }; }), Oe = ee(() => ({ maxWidth: `${o.selectionWidth}px` })), Ve = ee(() => ({ width: `${Math.max(o.calculatorWidth, OV)}px` })); return Ua(c, _e), Ua(h, Me), Ua(m, B), Ua(b, B), Ua(y, ce), Ua(g, Ce), Lt(() => { q(); }), { inputId: k, contentId: i, nsSelect: n, nsInput: a, states: o, isFocused: T, expanded: E, optionsArray: V, hoverOption: C, selectSize: Y, filteredOptionsCount: K, resetCalculatorWidth: Me, updateTooltip: B, updateTagTooltip: ce, debouncedOnInputChange: pe, onInput: te, deletePrevTag: Te, deleteTag: He, deleteSelected: We, handleOptionSelect: Ie, scrollToOption: De, hasModelValue: O, shouldShowPlaceholder: ue, currentPlaceholder: $, mouseEnterEventName: J, showClose: D, iconComponent: I, iconReverse: F, validateState: z, validateIcon: U, showNewOption: G, updateOptions: W, collapseTagSize: X, setSelected: q, selectDisabled: M, emptyText: re, handleCompositionStart: w, handleCompositionUpdate: S, handleCompositionEnd: _, onOptionCreate: $e, onOptionDestroy: nt, handleMenuEnter: mt, focus: _t, blur: wt, handleClearClick: me, handleClickOutside: Ne, handleEsc: Ue, toggleMenu: Ke, selectOption: ct, getValueKey: xt, navigateOptions: se, dropdownMenuVisible: ie, showTagList: Ft, collapseTagList: zt, tagStyle: Ae, collapseTagStyle: Oe, inputStyle: Ve, popperRef: lt, inputRef: d, tooltipRef: l, tagTooltipRef: u, calculatorRef: h, prefixRef: f, suffixRef: p, selectRef: s, wrapperRef: b, selectionRef: c, scrollbarRef: v, menuRef: m, tagMenuRef: y, collapseItemRef: g }; }; var IV = Le({ name: "ElOptions", setup(t, { slots: e }) { const r = Ye(ep); let i = []; return () => { var n, a; const o = (n = e.default) == null ? void 0 : n.call(e), s = []; function c(l) { Ui(l) && l.forEach((u) => { var d, h, f, p; const m = (d = (u == null ? void 0 : u.type) || {}) == null ? void 0 : d.name; m === "ElOptionGroup" ? c(!Ei(u.children) && !Ui(u.children) && Di((h = u.children) == null ? void 0 : h.default) ? (f = u.children) == null ? void 0 : f.default() : u.children) : m === "ElOption" ? s.push((p = u.props) == null ? void 0 : p.value) : Ui(u.children) && c(u.children); }); } return o.length && c((a = o[0]) == null ? void 0 : a.children), Cm(s, i) || (i = s, r && (r.states.optionValues = s)), o; }; } }); const NV = Kt({ name: String, id: String, modelValue: { type: [Array, String, Number, Boolean, Object], default: void 0 }, autocomplete: { type: String, default: "off" }, automaticDropdown: Boolean, size: Du, effect: { type: vt(String), default: "light" }, disabled: Boolean, clearable: Boolean, filterable: Boolean, allowCreate: Boolean, loading: Boolean, popperClass: { type: String, default: "" }, popperOptions: { type: vt(Object), default: () => ({}) }, remote: Boolean, loadingText: String, noMatchText: String, noDataText: String, remoteMethod: Function, filterMethod: Function, multiple: Boolean, multipleLimit: { type: Number, default: 0 }, placeholder: { type: String }, defaultFirstOption: Boolean, reserveKeyword: { type: Boolean, default: !0 }, valueKey: { type: String, default: "value" }, collapseTags: Boolean, collapseTagsTooltip: Boolean, maxCollapseTags: { type: Number, default: 1 }, teleported: $i.teleported, persistent: { type: Boolean, default: !0 }, clearIcon: { type: cs, default: tb }, fitInputWidth: Boolean, suffixIcon: { type: cs, default: gg }, tagType: { ...by.type, default: "info" }, tagEffect: { ...by.effect, default: "light" }, validateEvent: { type: Boolean, default: !0 }, remoteShowSuffix: Boolean, placement: { type: vt(String), values: yg, default: "bottom-start" }, fallbackPlacements: { type: vt(Array), default: ["bottom-start", "top-start", "right", "left"] }, appendTo: String, ...WF, ...Ts(["ariaLabel"]) }), W2 = "ElSelect", BV = Le({ name: W2, componentName: W2, components: { ElSelectMenu: RV, ElOption: Sb, ElOptions: IV, ElTag: _6, ElScrollbar: Sz, ElTooltip: wb, ElIcon: Oi }, directives: { ClickOutside: XC }, props: NV, emits: [ ui, ib, "remove-tag", "clear", "visible-change", "focus", "blur" ], setup(t, { emit: e }) { const r = ee(() => { const { modelValue: a, multiple: o } = t, s = o ? [] : void 0; return Ui(a) ? o ? a : s : o ? s : a; }), i = _r({ ...Zi(t), modelValue: r }), n = DV(i, e); return Dt(ep, _r({ props: i, states: n.states, optionsArray: n.optionsArray, handleOptionSelect: n.handleOptionSelect, onOptionCreate: n.onOptionCreate, onOptionDestroy: n.onOptionDestroy, selectRef: n.selectRef, setSelected: n.setSelected })), { ...n, modelValue: r }; } }); function FV(t, e, r, i, n, a) { const o = qt("el-tag"), s = qt("el-tooltip"), c = qt("el-icon"), l = qt("el-option"), u = qt("el-options"), d = qt("el-scrollbar"), h = qt("el-select-menu"), f = BT("click-outside"); return ht((Q(), be("div", { ref: "selectRef", class: xe([t.nsSelect.b(), t.nsSelect.m(t.selectSize)]), [FT(t.mouseEnterEventName)]: (p) => t.states.inputHovering = !0, onMouseleave: (p) => t.states.inputHovering = !1 }, [ oe(s, { ref: "tooltipRef", visible: t.dropdownMenuVisible, placement: t.placement, teleported: t.teleported, "popper-class": [t.nsSelect.e("popper"), t.popperClass], "popper-options": t.popperOptions, "fallback-placements": t.fallbackPlacements, effect: t.effect, pure: "", trigger: "click", transition: `${t.nsSelect.namespace.value}-zoom-in-top`, "stop-popper-mouse-event": !1, "gpu-acceleration": !1, persistent: t.persistent, "append-to": t.appendTo, onBeforeShow: t.handleMenuEnter, onHide: (p) => t.states.isBeforeHide = !1 }, { default: le(() => { var p; return [ Ee("div", { ref: "wrapperRef", class: xe([ t.nsSelect.e("wrapper"), t.nsSelect.is("focused", t.isFocused), t.nsSelect.is("hovering", t.states.inputHovering), t.nsSelect.is("filterable", t.filterable), t.nsSelect.is("disabled", t.selectDisabled) ]), onClick: Tt(t.toggleMenu, ["prevent"]) }, [ t.$slots.prefix ? (Q(), be("div", { key: 0, ref: "prefixRef", class: xe(t.nsSelect.e("prefix")) }, [ Fe(t.$slots, "prefix") ], 2)) : Pe("v-if", !0), Ee("div", { ref: "selectionRef", class: xe([ t.nsSelect.e("selection"), t.nsSelect.is("near", t.multiple && !t.$slots.prefix && !!t.states.selected.length) ]) }, [ t.multiple ? Fe(t.$slots, "tag", { key: 0 }, () => [ (Q(!0), be(pt, null, ir(t.showTagList, (m) => (Q(), be("div", { key: t.getValueKey(m), class: xe(t.nsSelect.e("selected-item")) }, [ oe(o, { closable: !t.selectDisabled && !m.isDisabled, size: t.collapseTagSize, type: t.tagType, effect: t.tagEffect, "disable-transitions": "", style: yt(t.tagStyle), onClose: (y) => t.deleteTag(y, m) }, { default: le(() => [ Ee("span", { class: xe(t.nsSelect.e("tags-text")) }, [ Fe(t.$slots, "label", { label: m.currentLabel, value: m.value }, () => [ et(Ze(m.currentLabel), 1) ]) ], 2) ]), _: 2 }, 1032, ["closable", "size", "type", "effect", "style", "onClose"]) ], 2))), 128)), t.collapseTags && t.states.selected.length > t.maxCollapseTags ? (Q(), Re(s, { key: 0, ref: "tagTooltipRef", disabled: t.dropdownMenuVisible || !t.collapseTagsTooltip, "fallback-placements": ["bottom", "top", "right", "left"], effect: t.effect, placement: "bottom", teleported: t.teleported }, { default: le(() => [ Ee("div", { ref: "collapseItemRef", class: xe(t.nsSelect.e("selected-item")) }, [ oe(o, { closable: !1, size: t.collapseTagSize, type: t.tagType, effect: t.tagEffect, "disable-transitions": "", style: yt(t.collapseTagStyle) }, { default: le(() => [ Ee("span", { class: xe(t.nsSelect.e("tags-text")) }, " + " + Ze(t.states.selected.length - t.maxCollapseTags), 3) ]), _: 1 }, 8, ["size", "type", "effect", "style"]) ], 2) ]), content: le(() => [ Ee("div", { ref: "tagMenuRef", class: xe(t.nsSelect.e("selection")) }, [ (Q(!0), be(pt, null, ir(t.collapseTagList, (m) => (Q(), be("div", { key: t.getValueKey(m), class: xe(t.nsSelect.e("selected-item")) }, [ oe(o, { class: "in-tooltip", closable: !t.selectDisabled && !m.isDisabled, size: t.collapseTagSize, type: t.tagType, effect: t.tagEffect, "disable-transitions": "", onClose: (y) => t.deleteTag(y, m) }, { default: le(() => [ Ee("span", { class: xe(t.nsSelect.e("tags-text")) }, [ Fe(t.$slots, "label", { label: m.currentLabel, value: m.value }, () => [ et(Ze(m.currentLabel), 1) ]) ], 2) ]), _: 2 }, 1032, ["closable", "size", "type", "effect", "onClose"]) ], 2))), 128)) ], 2) ]), _: 3 }, 8, ["disabled", "effect", "teleported"])) : Pe("v-if", !0) ]) : Pe("v-if", !0), t.selectDisabled ? Pe("v-if", !0) : (Q(), be("div", { key: 1, class: xe([ t.nsSelect.e("selected-item"), t.nsSelect.e("input-wrapper"), t.nsSelect.is("hidden", !t.filterable) ]) }, [ ht(Ee("input", { id: t.inputId, ref: "inputRef", "onUpdate:modelValue": (m) => t.states.inputValue = m, type: "text", name: t.name, class: xe([t.nsSelect.e("input"), t.nsSelect.is(t.selectSize)]), disabled: t.selectDisabled, autocomplete: t.autocomplete, style: yt(t.inputStyle), role: "combobox", readonly: !t.filterable, spellcheck: "false", "aria-activedescendant": ((p = t.hoverOption) == null ? void 0 : p.id) || "", "aria-controls": t.contentId, "aria-expanded": t.dropdownMenuVisible, "aria-label": t.ariaLabel, "aria-autocomplete": "none", "aria-haspopup": "listbox", onKeydown: [ ti(Tt((m) => t.navigateOptions("next"), ["stop", "prevent"]), ["down"]), ti(Tt((m) => t.navigateOptions("prev"), ["stop", "prevent"]), ["up"]), ti(Tt(t.handleEsc, ["stop", "prevent"]), ["esc"]), ti(Tt(t.selectOption, ["stop", "prevent"]), ["enter"]), ti(Tt(t.deletePrevTag, ["stop"]), ["delete"]) ], onCompositionstart: t.handleCompositionStart, onCompositionupdate: t.handleCompositionUpdate, onCompositionend: t.handleCompositionEnd, onInput: t.onInput, onClick: Tt(t.toggleMenu, ["stop"]) }, null, 46, ["id", "onUpdate:modelValue", "name", "disabled", "autocomplete", "readonly", "aria-activedescendant", "aria-controls", "aria-expanded", "aria-label", "onKeydown", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onInput", "onClick"]), [ [zT, t.states.inputValue] ]), t.filterable ? (Q(), be("span", { key: 0, ref: "calculatorRef", "aria-hidden": "true", class: xe(t.nsSelect.e("input-calculator")), textContent: Ze(t.states.inputValue) }, null, 10, ["textContent"])) : Pe("v-if", !0) ], 2)), t.shouldShowPlaceholder ? (Q(), be("div", { key: 2, class: xe([ t.nsSelect.e("selected-item"), t.nsSelect.e("placeholder"), t.nsSelect.is("transparent", !t.hasModelValue || t.expanded && !t.states.inputValue) ]) }, [ t.hasModelValue ? Fe(t.$slots, "label", { key: 0, label: t.currentPlaceholder, value: t.modelValue }, () => [ Ee("span", null, Ze(t.currentPlaceholder), 1) ]) : (Q(), be("span", { key: 1 }, Ze(t.currentPlaceholder), 1)) ], 2)) : Pe("v-if", !0) ], 2), Ee("div", { ref: "suffixRef", class: xe(t.nsSelect.e("suffix")) }, [ t.iconComponent && !t.showClose ? (Q(), Re(c, { key: 0, class: xe([t.nsSelect.e("caret"), t.nsSelect.e("icon"), t.iconReverse]) }, { default: le(() => [ (Q(), Re(Yt(t.iconComponent))) ]), _: 1 }, 8, ["class"])) : Pe("v-if", !0), t.showClose && t.clearIcon ? (Q(), Re(c, { key: 1, class: xe([ t.nsSelect.e("caret"), t.nsSelect.e("icon"), t.nsSelect.e("clear") ]), onClick: t.handleClearClick }, { default: le(() => [ (Q(), Re(Yt(t.clearIcon))) ]), _: 1 }, 8, ["class", "onClick"])) : Pe("v-if", !0), t.validateState && t.validateIcon ? (Q(), Re(c, { key: 2, class: xe([t.nsInput.e("icon"), t.nsInput.e("validateIcon")]) }, { default: le(() => [ (Q(), Re(Yt(t.validateIcon))) ]), _: 1 }, 8, ["class"])) : Pe("v-if", !0) ], 2) ], 10, ["onClick"]) ]; }), content: le(() => [ oe(h, { ref: "menuRef" }, { default: le(() => [ t.$slots.header ? (Q(), be("div", { key: 0, class: xe(t.nsSelect.be("dropdown", "header")), onClick: Tt(() => { }, ["stop"]) }, [ Fe(t.$slots, "header") ], 10, ["onClick"])) : Pe("v-if", !0), ht(oe(d, { id: t.contentId, ref: "scrollbarRef", tag: "ul", "wrap-class": t.nsSelect.be("dropdown", "wrap"), "view-class": t.nsSelect.be("dropdown", "list"), class: xe([t.nsSelect.is("empty", t.filteredOptionsCount === 0)]), role: "listbox", "aria-label": t.ariaLabel, "aria-orientation": "vertical" }, { default: le(() => [ t.showNewOption ? (Q(), Re(l, { key: 0, value: t.states.inputValue, created: !0 }, null, 8, ["value"])) : Pe("v-if", !0), oe(u, null, { default: le(() => [ Fe(t.$slots, "default") ]), _: 3 }) ]), _: 3 }, 8, ["id", "wrap-class", "view-class", "class", "aria-label"]), [ [Ot, t.states.options.size > 0 && !t.loading] ]), t.$slots.loading && t.loading ? (Q(), be("div", { key: 1, class: xe(t.nsSelect.be("dropdown", "loading")) }, [ Fe(t.$slots, "loading") ], 2)) : t.loading || t.filteredOptionsCount === 0 ? (Q(), be("div", { key: 2, class: xe(t.nsSelect.be("dropdown", "empty")) }, [ Fe(t.$slots, "empty", {}, () => [ Ee("span", null, Ze(t.emptyText), 1) ]) ], 2)) : Pe("v-if", !0), t.$slots.footer ? (Q(), be("div", { key: 3, class: xe(t.nsSelect.be("dropdown", "footer")), onClick: Tt(() => { }, ["stop"]) }, [ Fe(t.$slots, "footer") ], 10, ["onClick"])) : Pe("v-if", !0) ]), _: 3 }, 512) ]), _: 3 }, 8, ["visible", "placement", "teleported", "popper-class", "popper-options", "fallback-placements", "effect", "transition", "persistent", "append-to", "onBeforeShow", "onHide"]) ], 16, ["onMouseleave"])), [ [f, t.handleClickOutside, t.popperRef] ]); } var zV = /* @__PURE__ */ Mt(BV, [["render", FV], ["__file", "select.vue"]]); const $V = Le({ name: "ElOptionGroup", componentName: "ElOptionGroup", props: { label: String, disabled: Boolean }, setup(t) { const e = Et("select"), r = we(null), i = Ct(), n = we([]); Dt(lA, _r({ ...Zi(t) })); const a = ee(() => n.value.some((l) => l.visible === !0)), o = (l) => { var u, d; return ((u = l.type) == null ? void 0 : u.name) === "ElOption" && !!((d = l.component) != null && d.proxy); }, s = (l) => { const u = qo(l), d = []; return u.forEach((h) => { var f, p; o(h) ? d.push(h.component.proxy) : (f = h.children) != null && f.length ? d.push(...s(h.children)) : (p = h.component) != null && p.subTree && d.push(...s(h.component.subTree)); }), d; }, c = () => { n.value = s(i.subTree); }; return Lt(() => { c(); }), BD(r, c, { attributes: !0, subtree: !0, childList: !0 }), { groupRef: r, visible: a, ns: e }; } }); function VV(t, e, r, i, n, a) { return ht((Q(), be("ul", { ref: "groupRef", class: xe(t.ns.be("group", "wrap")) }, [ Ee("li", { class: xe(t.ns.be("group", "title")) }, Ze(t.label), 3), Ee("li", null, [ Ee("ul", { class: xe(t.ns.b("group")) }, [ Fe(t.$slots, "default") ], 2) ]) ], 2)), [ [Ot, t.visible] ]); } var cA = /* @__PURE__ */ Mt($V, [["render", VV], ["__file", "option-group.vue"]]); const UV = ni(zV, { Option: Sb, OptionGroup: cA }), jV = po(Sb); po(cA); const HV = Kt({ trigger: hh.trigger, placement: zv.placement, disabled: hh.disabled, visible: $i.visible, transition: $i.transition, popperOptions: zv.popperOptions, tabindex: zv.tabindex, content: $i.content, popperStyle: $i.popperStyle, popperClass: $i.popperClass, enterable: { ...$i.enterable, default: !0 }, effect: { ...$i.effect, default: "light" }, teleported: $i.teleported, title: String, width: { type: [String, Number], default: 150 }, offset: { type: Number, default: void 0 }, showAfter: { type: Number, default: 0 }, hideAfter: { type: Number, default: 200 }, autoClose: { type: Number, default: 0 }, showArrow: { type: Boolean, default: !0 }, persistent: { type: Boolean, default: !0 }, "onUpdate:visible": { type: Function } }), GV = { "update:visible": (t) => Zc(t), "before-enter": () => !0, "before-leave": () => !0, "after-enter": () => !0, "after-leave": () => !0 }, WV = "onUpdate:visible", qV = Le({ name: "ElPopover" }), XV = /* @__PURE__ */ Le({ ...qV, props: HV, emits: GV, setup(t, { expose: e, emit: r }) { const i = t, n = ee(() => i[WV]), a = Et("popover"), o = we(), s = ee(() => { var y; return (y = N(o)) == null ? void 0 : y.popperRef; }), c = ee(() => [ { width: Yc(i.width) }, i.popperStyle ]), l = ee(() => [a.b(), i.popperClass, { [a.m("plain")]: !!i.content }]), u = ee(() => i.transition === `${a.namespace.value}-fade-in-linear`), d = () => { var y; (y = o.value) == null || y.hide(); }, h = () => { r("before-enter"); }, f = () => { r("before-leave"); }, p = () => { r("after-enter"); }, m = () => { r("update:visible", !1), r("after-leave"); }; return e({ popperRef: s, hide: d }), (y, g) => (Q(), Re(N(wb), Nr({ ref_key: "tooltipRef", ref: o }, y.$attrs, { trigger: y.trigger, placement: y.placement, disabled: y.disabled, visible: y.visible, transition: y.transition, "popper-options": y.popperOptions, tabindex: y.tabindex, content: y.content, offset: y.offset, "show-after": y.showAfter, "hide-after": y.hideAfter, "auto-close": y.autoClose, "show-arrow": y.showArrow, "aria-label": y.title, effect: y.effect, enterable: y.enterable, "popper-class": N(l), "popper-style": N(c), teleported: y.teleported, persistent: y.persistent, "gpu-acceleration": N(u), "onUpdate:visible": N(n), onBeforeShow: h, onBeforeHide: f, onShow: p, onHide: m }), { content: le(() => [ y.title ? (Q(), be("div", { key: 0, class: xe(N(a).e("title")), role: "title" }, Ze(y.title), 3)) : Pe("v-if", !0), Fe(y.$slots, "default", {}, () => [ et(Ze(y.content), 1) ]) ]), default: le(() => [ y.$slots.reference ? Fe(y.$slots, "reference", { key: 0 }) : Pe("v-if", !0) ]), _: 3 }, 16, ["trigger", "placement", "disabled", "visible", "transition", "popper-options", "tabindex", "content", "offset", "show-after", "hide-after", "auto-close", "show-arrow", "aria-label", "effect", "enterable", "popper-class", "popper-style", "teleported", "persistent", "gpu-acceleration", "onUpdate:visible"])); } }); var ZV = /* @__PURE__ */ Mt(XV, [["__file", "popover.vue"]]); const q2 = (t, e) => { const r = e.arg || e.value, i = r == null ? void 0 : r.popperRef; i && (i.triggerRef = t); }; var YV = { mounted(t, e) { q2(t, e); }, updated(t, e) { q2(t, e); } }; const KV = "popover", JV = gB(YV, KV), Mb = ni(ZV, { directive: JV }), zc = "$treeNodeId", X2 = function(t, e) { !e || e[zc] || Object.defineProperty(e, zc, { value: t.id, enumerable: !1, configurable: !1, writable: !1 }); }, Eb = function(t, e) { return t ? e[t] : e[zc]; }, xy = (t, e, r) => { const i = t.value.currentNode; r(); const n = t.value.currentNode; i !== n && e("current-change", n ? n.data : null, n); }, wy = (t) => { let e = !0, r = !0, i = !0; for (let n = 0, a = t.length; n < a; n++) { const o = t[n]; (o.checked !== !0 || o.indeterminate) && (e = !1, o.disabled || (i = !1)), (o.checked !== !1 || o.indeterminate) && (r = !1); } return { all: e, none: r, allWithoutDisable: i, half: !e && !r }; }, Id = function(t) { if (t.childNodes.length === 0 || t.loading) return; const { all: e, none: r, half: i } = wy(t.childNodes); e ? (t.checked = !0, t.indeterminate = !1) : i ? (t.checked = !1, t.indeterminate = !0) : r && (t.checked = !1, t.indeterminate = !1); const n = t.parent; !n || n.level === 0 || t.store.checkStrictly || Id(n); }, zp = function(t, e) { const r = t.store.props, i = t.data || {}, n = r[e]; if (typeof n == "function") return n(i, t); if (typeof n == "string") return i[n]; if (typeof n > "u") { const a = i[e]; return a === void 0 ? "" : a; } }; let QV = 0, _y = class am { constructor(e) { this.id = QV++, this.text = null, this.checked = !1, this.indeterminate = !1, this.data = null, this.expanded = !1, this.parent = null, this.visible = !0, this.isCurrent = !1, this.canFocus = !1; for (const r in e) vl(e, r) && (this[r] = e[r]); this.level = 0, this.loaded = !1, this.childNodes = [], this.loading = !1, this.parent && (this.level = this.parent.level + 1); } initialize() { const e = this.store; if (!e) throw new Error("[Node]store is required!"); e.registerNode(this); const r = e.props; if (r && typeof r.isLeaf < "u") { const a = zp(this, "isLeaf"); typeof a == "boolean" && (this.isLeafByUser = a); } if (e.lazy !== !0 && this.data ? (this.setData(this.data), e.defaultExpandAll && (this.expanded = !0, this.canFocus = !0)) : this.level > 0 && e.lazy && e.defaultExpandAll && !this.isLeafByUser && this.expand(), Array.isArray(this.data) || X2(this, this.data), !this.data) return; const i = e.defaultExpandedKeys, n = e.key; n && i && i.includes(this.key) && this.expand(null, e.autoExpandParent), n && e.currentNodeKey !== void 0 && this.key === e.currentNodeKey && (e.currentNode = this, e.currentNode.isCurrent = !0), e.lazy && e._initDefaultCheckedNode(this), this.updateLeafState(), this.parent && (this.level === 1 || this.parent.expanded === !0) && (this.canFocus = !0); } setData(e) { Array.isArray(e) || X2(this, e), this.data = e, this.childNodes = []; let r; this.level === 0 && Array.isArray(this.data) ? r = this.data : r = zp(this, "children") || []; for (let i = 0, n = r.length; i < n; i++) this.insertChild({ data: r[i] }); } get label() { return zp(this, "label"); } get key() { const e = this.store.key; return this.data ? this.data[e] : null; } get disabled() { return zp(this, "disabled"); } get nextSibling() { const e = this.parent; if (e) { const r = e.childNodes.indexOf(this); if (r > -1) return e.childNodes[r + 1]; } return null; } get previousSibling() { const e = this.parent; if (e) { const r = e.childNodes.indexOf(this); if (r > -1) return r > 0 ? e.childNodes[r - 1] : null; } return null; } contains(e, r = !0) { return (this.childNodes || []).some((i) => i === e || r && i.contains(e)); } remove() { const e = this.parent; e && e.removeChild(this); } insertChild(e, r, i) { if (!e) throw new Error("InsertChild error: child is required."); if (!(e instanceof am)) { if (!i) { const n = this.getChildren(!0); n.includes(e.data) || (typeof r > "u" || r < 0 ? n.push(e.data) : n.splice(r, 0, e.data)); } Object.assign(e, { parent: this, store: this.store }), e = _r(new am(e)), e instanceof am && 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 i; r && (i = this.childNodes.indexOf(r)), this.insertChild(e, i); } insertAfter(e, r) { let i; r && (i = this.childNodes.indexOf(r), i !== -1 && (i += 1)), this.insertChild(e, i); } removeChild(e) { const r = this.getChildren() || [], i = r.indexOf(e.data); i > -1 && r.splice(i, 1); const n = this.childNodes.indexOf(e); n > -1 && (this.store && this.store.deregisterNode(e), e.parent = null, this.childNodes.splice(n, 1)), this.updateLeafState(); } removeChildByData(e) { let r = null; for (let i = 0; i < this.childNodes.length; i++) if (this.childNodes[i].data === e) { r = this.childNodes[i]; break; } r && this.removeChild(r); } expand(e, r) { const i = () => { if (r) { let n = this.parent; for (; n.level > 0; ) n.expanded = !0, n = n.parent; } this.expanded = !0, e && e(), this.childNodes.forEach((n) => { n.canFocus = !0; }); }; this.shouldLoadData() ? this.loadData((n) => { Array.isArray(n) && (this.checked ? this.setChecked(!0, !0) : this.store.checkStrictly || Id(this), i()); }) : i(); } doCreateChildren(e, r = {}) { e.forEach((i) => { this.insertChild(Object.assign({ data: i }, r), void 0, !0); }); } collapse() { this.expanded = !1, this.childNodes.forEach((e) => { e.canFocus = !1; }); } shouldLoadData() { return this.store.lazy === !0 && this.store.load && !this.loaded; } updateLeafState() { if (this.store.lazy === !0 && this.loaded !== !0 && typeof this.isLeafByUser < "u") { this.isLeaf = this.isLeafByUser; return; } const e = this.childNodes; if (!this.store.lazy || this.store.lazy === !0 && this.loaded === !0) { this.isLeaf = !e || e.length === 0; return; } this.isLeaf = !1; } setChecked(e, r, i, n) { if (this.indeterminate = e === "half", this.checked = e === !0, this.store.checkStrictly) return; if (!(this.shouldLoadData() && !this.store.checkDescendants)) { const { all: o, allWithoutDisable: s } = wy(this.childNodes); !this.isLeaf && !o && s && (this.checked = !1, e = !1); const c = () => { if (r) { const l = this.childNodes; for (let h = 0, f = l.length; h < f; h++) { const p = l[h]; n = n || e !== !1; const m = p.disabled ? p.checked : n; p.setChecked(m, r, !0, n); } const { half: u, all: d } = wy(l); d || (this.checked = d, this.indeterminate = u); } }; if (this.shouldLoadData()) { this.loadData(() => { c(), Id(this); }, { checked: e !== !1 }); return; } else c(); } const a = this.parent; !a || a.level === 0 || i || Id(a); } getChildren(e = !1) { if (this.level === 0) return this.data; const r = this.data; if (!r) return null; const i = this.store.props; let n = "children"; return i && (n = i.children || "children"), r[n] === void 0 && (r[n] = null), e && !r[n] && (r[n] = []), r[n]; } updateChildren() { const e = this.getChildren() || [], r = this.childNodes.map((a) => a.data), i = {}, n = []; e.forEach((a, o) => { const s = a[zc]; s && r.findIndex((c) => c[zc] === s) >= 0 ? i[s] = { index: o, data: a } : n.push({ index: o, data: a }); }), this.store.lazy || r.forEach((a) => { i[a[zc]] || this.removeChildByData(a); }), n.forEach(({ index: a, data: o }) => { this.insertChild({ data: o }, a); }), this.updateLeafState(); } loadData(e, r = {}) { if (this.store.lazy === !0 && this.store.load && !this.loaded && (!this.loading || Object.keys(r).length)) { this.loading = !0; const i = (a) => { this.childNodes = [], this.doCreateChildren(a, r), this.loaded = !0, this.loading = !1, this.updateLeafState(), e && e.call(this, a); }, n = () => { this.loading = !1; }; this.store.load(this, i, n); } else e && e.call(this); } eachNode(e) { const r = [this]; for (; r.length; ) { const i = r.shift(); r.unshift(...i.childNodes), e(i); } } reInitChecked() { this.store.checkStrictly || Id(this); } }, e8 = class { constructor(e) { this.currentNode = null, this.currentNodeKey = null; for (const r in e) vl(e, r) && (this[r] = e[r]); this.nodesMap = {}; } initialize() { if (this.root = new _y({ 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, i = this.lazy, n = function(a) { const o = a.root ? a.root.childNodes : a.childNodes; if (o.forEach((s) => { s.visible = r.call(s, e, s.data, s), n(s); }), !a.visible && o.length) { let s = !0; s = !o.some((c) => c.visible), a.root ? a.root.visible = s === !1 : a.visible = s === !1; } e && a.visible && !a.isLeaf && (!i || a.loaded) && a.expand(); }; n(this); } setData(e) { e !== this.root.data ? (this.nodesMap = {}, this.root.setData(e), this._initDefaultCheckedNodes()) : this.root.updateChildren(); } getNode(e) { if (e instanceof _y) return e; const r = di(e) ? Eb(this.key, e) : e; return this.nodesMap[r] || null; } insertBefore(e, r) { const i = this.getNode(r); i.parent.insertBefore({ data: e }, i); } insertAfter(e, r) { const i = this.getNode(r); i.parent.insertAfter({ data: e }, i); } remove(e) { const r = this.getNode(e); r && r.parent && (r === this.currentNode && (this.currentNode = null), r.parent.removeChild(r)); } append(e, r) { const i = Am(r) ? this.root : this.getNode(r); i && i.insertChild({ data: e }); } _initDefaultCheckedNodes() { const e = this.defaultCheckedKeys || [], r = this.nodesMap; e.forEach((i) => { const n = r[i]; n && n.setChecked(!0, !this.checkStrictly); }); } _initDefaultCheckedNode(e) { (this.defaultCheckedKeys || []).includes(e.key) && e.setChecked(!0, !this.checkStrictly); } setDefaultCheckedKey(e) { e !== this.defaultCheckedKeys && (this.defaultCheckedKeys = e, this._initDefaultCheckedNodes()); } registerNode(e) { const r = this.key; !e || !e.data || (r ? e.key !== void 0 && (this.nodesMap[e.key] = e) : this.nodesMap[e.id] = e); } deregisterNode(e) { !this.key || !e || !e.data || (e.childNodes.forEach((r) => { this.deregisterNode(r); }), delete this.nodesMap[e.key]); } getCheckedNodes(e = !1, r = !1) { const i = [], n = function(a) { (a.root ? a.root.childNodes : a.childNodes).forEach((o) => { (o.checked || r && o.indeterminate) && (!e || e && o.isLeaf) && i.push(o.data), n(o); }); }; return n(this), i; } getCheckedKeys(e = !1) { return this.getCheckedNodes(e).map((r) => (r || {})[this.key]); } getHalfCheckedNodes() { const e = [], r = function(i) { (i.root ? i.root.childNodes : i.childNodes).forEach((n) => { n.indeterminate && e.push(n.data), r(n); }); }; return r(this), e; } getHalfCheckedKeys() { return this.getHalfCheckedNodes().map((e) => (e || {})[this.key]); } _getAllNodes() { const e = [], r = this.nodesMap; for (const i in r) vl(r, i) && e.push(r[i]); return e; } updateChildren(e, r) { const i = this.nodesMap[e]; if (!i) return; const n = i.childNodes; for (let a = n.length - 1; a >= 0; a--) { const o = n[a]; this.remove(o.data); } for (let a = 0, o = r.length; a < o; a++) { const s = r[a]; this.append(s, i.data); } } _setCheckedKeys(e, r = !1, i) { const n = this._getAllNodes().sort((c, l) => c.level - l.level), a = /* @__PURE__ */ Object.create(null), o = Object.keys(i); n.forEach((c) => c.setChecked(!1, !1)); const s = (c) => { c.childNodes.forEach((l) => { var u; a[l.data[e]] = !0, (u = l.childNodes) != null && u.length && s(l); }); }; for (let c = 0, l = n.length; c < l; c++) { const u = n[c], d = u.data[e].toString(); if (!o.includes(d)) { u.checked && !a[d] && u.setChecked(!1, !1); continue; } if (u.childNodes.length && s(u), u.isLeaf || this.checkStrictly) { u.setChecked(!0, !1); continue; } if (u.setChecked(!0, !0), r) { u.setChecked(!1, !1); const h = function(f) { f.childNodes.forEach((p) => { p.isLeaf || p.setChecked(!1, !1), h(p); }); }; h(u); } } } setCheckedNodes(e, r = !1) { const i = this.key, n = {}; e.forEach((a) => { n[(a || {})[i]] = !0; }), this._setCheckedKeys(i, r, n); } setCheckedKeys(e, r = !1) { this.defaultCheckedKeys = e; const i = this.key, n = {}; e.forEach((a) => { n[a] = !0; }), this._setCheckedKeys(i, r, n); } setDefaultExpandedKeys(e) { e = e || [], this.defaultExpandedKeys = e, e.forEach((r) => { const i = this.getNode(r); i && i.expand(null, this.autoExpandParent); }); } setChecked(e, r, i) { const n = this.getNode(e); n && n.setChecked(!!r, i); } getCurrentNode() { return this.currentNode; } setCurrentNode(e) { const r = this.currentNode; r && (r.isCurrent = !1), this.currentNode = e, this.currentNode.isCurrent = !0; } setUserCurrentNode(e, r = !0) { const i = e[this.key], n = this.nodesMap[i]; this.setCurrentNode(n), r && this.currentNode.level > 1 && this.currentNode.parent.expand(null, !0); } setCurrentNodeKey(e, r = !0) { if (e == null) { this.currentNode && (this.currentNode.isCurrent = !1), this.currentNode = null; return; } const i = this.getNode(e); i && (this.setCurrentNode(i), r && this.currentNode.level > 1 && this.currentNode.parent.expand(null, !0)); } }; const t8 = Le({ name: "ElTreeNodeContent", props: { node: { type: Object, required: !0 }, renderContent: Function }, setup(t) { const e = Et("tree"), r = Ye("NodeInstance"), i = Ye("RootTree"); return () => { const n = t.node, { data: a, store: o } = n; return t.renderContent ? t.renderContent(an, { _self: r, node: n, data: a, store: o }) : Fe(i.ctx.slots, "default", { node: n, data: a }, () => [ an("span", { class: e.be("node", "label") }, [n.label]) ]); }; } }); var r8 = /* @__PURE__ */ Mt(t8, [["__file", "tree-node-content.vue"]]); function uA(t) { const e = Ye("TreeNodeMap", null), r = { treeNodeExpand: (i) => { t.node !== i && t.node.collapse(); }, children: [] }; return e && e.children.push(r), Dt("TreeNodeMap", r), { broadcastExpanded: (i) => { if (t.accordion) for (const n of r.children) n.treeNodeExpand(i); } }; } const dA = Symbol("dragEvents"); function i8({ props: t, ctx: e, el$: r, dropIndicator$: i, store: n }) { const a = Et("tree"), o = we({ showDropIndicator: !1, draggingNode: null, dropNode: null, allowDrop: !0, dropType: null }); return Dt(dA, { treeNodeDragStart: ({ event: s, treeNode: c }) => { if (typeof t.allowDrag == "function" && !t.allowDrag(c.node)) return s.preventDefault(), !1; s.dataTransfer.effectAllowed = "move"; try { s.dataTransfer.setData("text/plain", ""); } catch { } o.value.draggingNode = c, e.emit("node-drag-start", c.node, s); }, treeNodeDragOver: ({ event: s, treeNode: c }) => { const l = c, u = o.value.dropNode; u && u.node.id !== l.node.id && sl(u.$el, a.is("drop-inner")); const d = o.value.draggingNode; if (!d || !l) return; let h = !0, f = !0, p = !0, m = !0; typeof t.allowDrop == "function" && (h = t.allowDrop(d.node, l.node, "prev"), m = f = t.allowDrop(d.node, l.node, "inner"), p = t.allowDrop(d.node, l.node, "next")), s.dataTransfer.dropEffect = f || h || p ? "move" : "none", (h || f || p) && (u == null ? void 0 : u.node.id) !== l.node.id && (u && e.emit("node-drag-leave", d.node, u.node, s), e.emit("node-drag-enter", d.node, l.node, s)), h || f || p ? o.value.dropNode = l : o.value.dropNode = null, l.node.nextSibling === d.node && (p = !1), l.node.previousSibling === d.node && (h = !1), l.node.contains(d.node, !1) && (f = !1), (d.node === l.node || d.node.contains(l.node)) && (h = !1, f = !1, p = !1); const y = l.$el.querySelector(`.${a.be("node", "content")}`).getBoundingClientRect(), g = r.value.getBoundingClientRect(); let v; const x = h ? f ? 0.25 : p ? 0.45 : 1 : -1, w = p ? f ? 0.75 : h ? 0.55 : 0 : 1; let S = -9999; const _ = s.clientY - y.top; _ < y.height * x ? v = "before" : _ > y.height * w ? v = "after" : f ? v = "inner" : v = "none"; const b = l.$el.querySelector(`.${a.be("node", "expand-icon")}`).getBoundingClientRect(), T = i.value; v === "before" ? S = b.top - g.top : v === "after" && (S = b.bottom - g.top), T.style.top = `${S}px`, T.style.left = `${b.right - g.left}px`, v === "inner" ? py(l.$el, a.is("drop-inner")) : sl(l.$el, a.is("drop-inner")), o.value.showDropIndicator = v === "before" || v === "after", o.value.allowDrop = o.value.showDropIndicator || m, o.value.dropType = v, e.emit("node-drag-over", d.node, l.node, s); }, treeNodeDragEnd: (s) => { const { draggingNode: c, dropType: l, dropNode: u } = o.value; if (s.preventDefault(), s.dataTransfer && (s.dataTransfer.dropEffect = "move"), c && u) { const d = { data: c.node.data }; l !== "none" && c.node.remove(), l === "before" ? u.node.parent.insertBefore(d, u.node) : l === "after" ? u.node.parent.insertAfter(d, u.node) : l === "inner" && u.node.insertChild(d), l !== "none" && (n.value.registerNode(d), n.value.key && c.node.eachNode((h) => { var f; (f = n.value.nodesMap[h.data[n.value.key]]) == null || f.setChecked(h.checked, !n.value.checkStrictly); })), sl(u.$el, a.is("drop-inner")), e.emit("node-drag-end", c.node, u.node, l, s), l !== "none" && e.emit("node-drop", c.node, u.node, l, s); } c && !u && e.emit("node-drag-end", c.node, null, l, s), o.value.showDropIndicator = !1, o.value.draggingNode = null, o.value.dropNode = null, o.value.allowDrop = !0; } }), { dragState: o }; } const n8 = Le({ name: "ElTreeNode", components: { ElCollapseTransition: N6, ElCheckbox: v6, NodeContent: r8, ElIcon: Oi, Loading: rb }, props: { node: { type: _y, default: () => ({}) }, props: { type: Object, default: () => ({}) }, accordion: Boolean, renderContent: Function, renderAfterExpand: Boolean, showCheckbox: { type: Boolean, default: !1 } }, emits: ["node-expand"], setup(t, e) { const r = Et("tree"), { broadcastExpanded: i } = uA(t), n = Ye("RootTree"), a = we(!1), o = we(!1), s = we(null), c = we(null), l = we(null), u = Ye(dA), d = Ct(); Dt("NodeInstance", d), n || Vr("Tree", "Can not find node's tree."), t.node.expanded && (a.value = !0, o.value = !0); const h = n.props.props.children || "children"; ze(() => { const w = t.node.data[h]; return w && [...w]; }, () => { t.node.updateChildren(); }), ze(() => t.node.indeterminate, (w) => { m(t.node.checked, w); }), ze(() => t.node.checked, (w) => { m(w, t.node.indeterminate); }), ze(() => t.node.childNodes.length, () => t.node.reInitChecked()), ze(() => t.node.expanded, (w) => { st(() => a.value = w), w && (o.value = !0); }); const f = (w) => Eb(n.props.nodeKey, w.data), p = (w) => { const S = t.props.class; if (!S) return {}; let _; if (Di(S)) { const { data: b } = w; _ = S(b, w); } else _ = S; return Ei(_) ? { [_]: !0 } : _; }, m = (w, S) => { (s.value !== w || c.value !== S) && n.ctx.emit("check-change", t.node.data, w, S), s.value = w, c.value = S; }, y = (w) => { xy(n.store, n.ctx.emit, () => n.store.value.setCurrentNode(t.node)), n.currentNode.value = t.node, n.props.expandOnClickNode && v(), n.props.checkOnClickNode && !t.node.disabled && x(null, { target: { checked: !t.node.checked } }), n.ctx.emit("node-click", t.node.data, t.node, d, w); }, g = (w) => { n.instance.vnode.props.onNodeContextmenu && (w.stopPropagation(), w.preventDefault()), n.ctx.emit("node-contextmenu", w, t.node.data, t.node, d); }, v = () => { t.node.isLeaf || (a.value ? (n.ctx.emit("node-collapse", t.node.data, t.node, d), t.node.collapse()) : t.node.expand(() => { e.emit("node-expand", t.node.data, t.node, d); })); }, x = (w, S) => { t.node.setChecked(S.target.checked, !n.props.checkStrictly), st(() => { const _ = n.store.value; n.ctx.emit("check", t.node.data, { checkedNodes: _.getCheckedNodes(), checkedKeys: _.getCheckedKeys(), halfCheckedNodes: _.getHalfCheckedNodes(), halfCheckedKeys: _.getHalfCheckedKeys() }); }); }; return { ns: r, node$: l, tree: n, expanded: a, childNodeRendered: o, oldChecked: s, oldIndeterminate: c, getNodeKey: f, getNodeClass: p, handleSelectChange: m, handleClick: y, handleContextMenu: g, handleExpandIconClick: v, handleCheckChange: x, handleChildNodeExpand: (w, S, _) => { i(S), n.ctx.emit("node-expand", w, S, _); }, handleDragStart: (w) => { n.props.draggable && u.treeNodeDragStart({ event: w, treeNode: t }); }, handleDragOver: (w) => { w.preventDefault(), n.props.draggable && u.treeNodeDragOver({ event: w, treeNode: { $el: l.value, node: t.node } }); }, handleDrop: (w) => { w.preventDefault(); }, handleDragEnd: (w) => { n.props.draggable && u.treeNodeDragEnd(w); }, CaretRight: Z5 }; } }); function a8(t, e, r, i, n, a) { const o = qt("el-icon"), s = qt("el-checkbox"), c = qt("loading"), l = qt("node-content"), u = qt("el-tree-node"), d = qt("el-collapse-transition"); return ht((Q(), be("div", { ref: "node$", class: xe([ t.ns.b("node"), t.ns.is("expanded", t.expanded), t.ns.is("current", t.node.isCurrent), t.ns.is("hidden", !t.node.visible), t.ns.is("focusable", !t.node.disabled), t.ns.is("checked", !t.node.disabled && t.node.checked), t.getNodeClass(t.node) ]), role: "treeitem", tabindex: "-1", "aria-expanded": t.expanded, "aria-disabled": t.node.disabled, "aria-checked": t.node.checked, draggable: t.tree.props.draggable, "data-key": t.getNodeKey(t.node), onClick: Tt(t.handleClick, ["stop"]), onContextmenu: t.handleContextMenu, onDragstart: Tt(t.handleDragStart, ["stop"]), onDragover: Tt(t.handleDragOver, ["stop"]), onDragend: Tt(t.handleDragEnd, ["stop"]), onDrop: Tt(t.handleDrop, ["stop"]) }, [ Ee("div", { class: xe(t.ns.be("node", "content")), style: yt({ paddingLeft: (t.node.level - 1) * t.tree.props.indent + "px" }) }, [ t.tree.props.icon || t.CaretRight ? (Q(), Re(o, { key: 0, class: xe([ t.ns.be("node", "expand-icon"), t.ns.is("leaf", t.node.isLeaf), { expanded: !t.node.isLeaf && t.expanded } ]), onClick: Tt(t.handleExpandIconClick, ["stop"]) }, { default: le(() => [ (Q(), Re(Yt(t.tree.props.icon || t.CaretRight))) ]), _: 1 }, 8, ["class", "onClick"])) : Pe("v-if", !0), t.showCheckbox ? (Q(), Re(s, { key: 1, "model-value": t.node.checked, indeterminate: t.node.indeterminate, disabled: !!t.node.disabled, onClick: Tt(() => { }, ["stop"]), onChange: t.handleCheckChange }, null, 8, ["model-value", "indeterminate", "disabled", "onClick", "onChange"])) : Pe("v-if", !0), t.node.loading ? (Q(), Re(o, { key: 2, class: xe([t.ns.be("node", "loading-icon"), t.ns.is("loading")]) }, { default: le(() => [ oe(c) ]), _: 1 }, 8, ["class"])) : Pe("v-if", !0), oe(l, { node: t.node, "render-content": t.renderContent }, null, 8, ["node", "render-content"]) ], 6), oe(d, null, { default: le(() => [ !t.renderAfterExpand || t.childNodeRendered ? ht((Q(), be("div", { key: 0, class: xe(t.ns.be("node", "children")), role: "group", "aria-expanded": t.expanded }, [ (Q(!0), be(pt, null, ir(t.node.childNodes, (h) => (Q(), Re(u, { key: t.getNodeKey(h), "render-content": t.renderContent, "render-after-expand": t.renderAfterExpand, "show-checkbox": t.showCheckbox, node: h, accordion: t.accordion, props: t.props, onNodeExpand: t.handleChildNodeExpand }, null, 8, ["render-content", "render-after-expand", "show-checkbox", "node", "accordion", "props", "onNodeExpand"]))), 128)) ], 10, ["aria-expanded"])), [ [Ot, t.expanded] ]) : Pe("v-if", !0) ]), _: 1 }) ], 42, ["aria-expanded", "aria-disabled", "aria-checked", "draggable", "data-key", "onClick", "onContextmenu", "onDragstart", "onDragover", "onDragend", "onDrop"])), [ [Ot, t.node.visible] ]); } var o8 = /* @__PURE__ */ Mt(n8, [["render", a8], ["__file", "tree-node.vue"]]); function s8({ el$: t }, e) { const r = Et("tree"), i = mr([]), n = mr([]); Lt(() => { a(); }), jh(() => { i.value = Array.from(t.value.querySelectorAll("[role=treeitem]")), n.value = Array.from(t.value.querySelectorAll("input[type=checkbox]")); }), ze(n, (o) => { o.forEach((s) => { s.setAttribute("tabindex", "-1"); }); }), xn(t, "keydown", (o) => { const s = o.target; if (!s.className.includes(r.b("node"))) return; const c = o.code; i.value = Array.from(t.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)); const l = i.value.indexOf(s); let u; if ([Gr.up, Gr.down].includes(c)) { if (o.preventDefault(), c === Gr.up) { u = l === -1 ? 0 : l !== 0 ? l - 1 : i.value.length - 1; const h = u; for (; !e.value.getNode(i.value[u].dataset.key).canFocus; ) { if (u--, u === h) { u = -1; break; } u < 0 && (u = i.value.length - 1); } } else { u = l === -1 ? 0 : l < i.value.length - 1 ? l + 1 : 0; const h = u; for (; !e.value.getNode(i.value[u].dataset.key).canFocus; ) { if (u++, u === h) { u = -1; break; } u >= i.value.length && (u = 0); } } u !== -1 && i.value[u].focus(); } [Gr.left, Gr.right].includes(c) && (o.preventDefault(), s.click()); const d = s.querySelector('[type="checkbox"]'); [Gr.enter, Gr.space].includes(c) && d && (o.preventDefault(), d.click()); }); const a = () => { var o; i.value = Array.from(t.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)), n.value = Array.from(t.value.querySelectorAll("input[type=checkbox]")); const s = t.value.querySelectorAll(`.${r.is("checked")}[role=treeitem]`); if (s.length) { s[0].setAttribute("tabindex", "0"); return; } (o = i.value[0]) == null || o.setAttribute("tabindex", "0"); }; } const l8 = Le({ name: "ElTree", components: { ElTreeNode: o8 }, props: { data: { type: Array, default: () => [] }, emptyText: { type: String }, renderAfterExpand: { type: Boolean, default: !0 }, nodeKey: String, checkStrictly: Boolean, defaultExpandAll: Boolean, expandOnClickNode: { type: Boolean, default: !0 }, checkOnClickNode: Boolean, checkDescendants: { type: Boolean, default: !1 }, autoExpandParent: { type: Boolean, default: !0 }, defaultCheckedKeys: Array, defaultExpandedKeys: Array, currentNodeKey: [String, Number], renderContent: Function, showCheckbox: { type: Boolean, default: !1 }, draggable: { type: Boolean, default: !1 }, allowDrag: Function, allowDrop: Function, props: { type: Object, default: () => ({ children: "children", label: "label", disabled: "disabled" }) }, lazy: { type: Boolean, default: !1 }, highlightCurrent: Boolean, load: Function, filterNodeMethod: Function, accordion: Boolean, indent: { type: Number, default: 18 }, icon: { type: cs } }, emits: [ "check-change", "current-change", "node-click", "node-contextmenu", "node-collapse", "node-expand", "check", "node-drag-start", "node-drag-end", "node-drop", "node-drag-leave", "node-drag-enter", "node-drag-over" ], setup(t, e) { const { t: r } = qh(), i = Et("tree"), n = Ye(ep, null), a = we(new e8({ key: t.nodeKey, data: t.data, lazy: t.lazy, props: t.props, load: t.load, currentNodeKey: t.currentNodeKey, checkStrictly: t.checkStrictly, checkDescendants: t.checkDescendants, defaultCheckedKeys: t.defaultCheckedKeys, defaultExpandedKeys: t.defaultExpandedKeys, autoExpandParent: t.autoExpandParent, defaultExpandAll: t.defaultExpandAll, filterNodeMethod: t.filterNodeMethod })); a.value.initialize(); const o = we(a.value.root), s = we(null), c = we(null), l = we(null), { broadcastExpanded: u } = uA(t), { dragState: d } = i8({ props: t, ctx: e, el$: c, dropIndicator$: l, store: a }); s8({ el$: c }, a); const h = ee(() => { const { childNodes: D } = o.value, I = n ? n.hasFilteredOptions !== 0 : !1; return (!D || D.length === 0 || D.every(({ visible: F }) => !F)) && !I; }); ze(() => t.currentNodeKey, (D) => { a.value.setCurrentNodeKey(D); }), ze(() => t.defaultCheckedKeys, (D) => { a.value.setDefaultCheckedKey(D); }), ze(() => t.defaultExpandedKeys, (D) => { a.value.setDefaultExpandedKeys(D); }), ze(() => t.data, (D) => { a.value.setData(D); }, { deep: !0 }), ze(() => t.checkStrictly, (D) => { a.value.checkStrictly = D; }); const f = (D) => { if (!t.filterNodeMethod) throw new Error("[Tree] filterNodeMethod is required when filter"); a.value.filter(D); }, p = (D) => Eb(t.nodeKey, D.data), m = (D) => { if (!t.nodeKey) throw new Error("[Tree] nodeKey is required in getNodePath"); const I = a.value.getNode(D); if (!I) return []; const F = [I.data]; let z = I.parent; for (; z && z !== o.value; ) F.push(z.data), z = z.parent; return F.reverse(); }, y = (D, I) => a.value.getCheckedNodes(D, I), g = (D) => a.value.getCheckedKeys(D), v = () => { const D = a.value.getCurrentNode(); return D ? D.data : null; }, x = () => { if (!t.nodeKey) throw new Error("[Tree] nodeKey is required in getCurrentKey"); const D = v(); return D ? D[t.nodeKey] : null; }, w = (D, I) => { if (!t.nodeKey) throw new Error("[Tree] nodeKey is required in setCheckedNodes"); a.value.setCheckedNodes(D, I); }, S = (D, I) => { if (!t.nodeKey) throw new Error("[Tree] nodeKey is required in setCheckedKeys"); a.value.setCheckedKeys(D, I); }, _ = (D, I, F) => { a.value.setChecked(D, I, F); }, b = () => a.value.getHalfCheckedNodes(), T = () => a.value.getHalfCheckedKeys(), E = (D, I = !0) => { if (!t.nodeKey) throw new Error("[Tree] nodeKey is required in setCurrentNode"); xy(a, e.emit, () => { u(D), a.value.setUserCurrentNode(D, I); }); }, C = (D, I = !0) => { if (!t.nodeKey) throw new Error("[Tree] nodeKey is required in setCurrentKey"); xy(a, e.emit, () => { u(), a.value.setCurrentNodeKey(D, I); }); }, L = (D) => a.value.getNode(D), A = (D) => { a.value.remove(D); }, k = (D, I) => { a.value.append(D, I); }, P = (D, I) => { a.value.insertBefore(D, I); }, R = (D, I) => { a.value.insertAfter(D, I); }, M = (D, I, F) => { u(I), e.emit("node-expand", D, I, F); }, O = (D, I) => { if (!t.nodeKey) throw new Error("[Tree] nodeKey is required in updateKeyChild"); a.value.updateChildren(D, I); }; return Dt("RootTree", { ctx: e, props: t, store: a, root: o, currentNode: s, instance: Ct() }), Dt(dh, void 0), { ns: i, store: a, root: o, currentNode: s, dragState: d, el$: c, dropIndicator$: l, isEmpty: h, filter: f, getNodeKey: p, getNodePath: m, getCheckedNodes: y, getCheckedKeys: g, getCurrentNode: v, getCurrentKey: x, setCheckedNodes: w, setCheckedKeys: S, setChecked: _, getHalfCheckedNodes: b, getHalfCheckedKeys: T, setCurrentNode: E, setCurrentKey: C, t: r, getNode: L, remove: A, append: k, insertBefore: P, insertAfter: R, handleNodeExpand: M, updateKeyChildren: O }; } }); function c8(t, e, r, i, n, a) { const o = qt("el-tree-node"); return Q(), be("div", { ref: "el$", class: xe([ t.ns.b(), t.ns.is("dragging", !!t.dragState.draggingNode), t.ns.is("drop-not-allow", !t.dragState.allowDrop), t.ns.is("drop-inner", t.dragState.dropType === "inner"), { [t.ns.m("highlight-current")]: t.highlightCurrent } ]), role: "tree" }, [ (Q(!0), be(pt, null, ir(t.root.childNodes, (s) => (Q(), Re(o, { key: t.getNodeKey(s), node: s, props: t.props, accordion: t.accordion, "render-after-expand": t.renderAfterExpand, "show-checkbox": t.showCheckbox, "render-content": t.renderContent, onNodeExpand: t.handleNodeExpand }, null, 8, ["node", "props", "accordion", "render-after-expand", "show-checkbox", "render-content", "onNodeExpand"]))), 128)), t.isEmpty ? (Q(), be("div", { key: 0, class: xe(t.ns.e("empty-block")) }, [ Fe(t.$slots, "empty", {}, () => { var s; return [ Ee("span", { class: xe(t.ns.e("empty-text")) }, Ze((s = t.emptyText) != null ? s : t.t("el.tree.emptyText")), 3) ]; }) ], 2)) : Pe("v-if", !0), ht(Ee("div", { ref: "dropIndicator$", class: xe(t.ns.e("drop-indicator")) }, null, 2), [ [Ot, t.dragState.showDropIndicator] ]) ], 2); } var u8 = /* @__PURE__ */ Mt(l8, [["render", c8], ["__file", "tree.vue"]]); const d8 = ni(u8); function h8(t) { let e; const r = we(!1), i = _r({ ...t, originalPosition: "", originalOverflow: "", visible: !1 }); function n(h) { i.text = h; } function a() { const h = i.parent, f = d.ns; if (!h.vLoadingAddClassList) { let p = h.getAttribute("loading-number"); p = Number.parseInt(p) - 1, p ? h.setAttribute("loading-number", p.toString()) : (sl(h, f.bm("parent", "relative")), h.removeAttribute("loading-number")), sl(h, f.bm("parent", "hidden")); } o(), u.unmount(); } function o() { var h, f; (f = (h = d.$el) == null ? void 0 : h.parentNode) == null || f.removeChild(d.$el); } function s() { var h; t.beforeClose && !t.beforeClose() || (r.value = !0, clearTimeout(e), e = setTimeout(c, 400), i.visible = !1, (h = t.closed) == null || h.call(t)); } function c() { if (!r.value) return; const h = i.parent; r.value = !1, h.vLoadingAddClassList = void 0, a(); } const l = Le({ name: "ElLoading", setup(h, { expose: f }) { const { ns: p, zIndex: m } = ZF("loading"); return f({ ns: p, zIndex: m }), () => { const y = i.spinner || i.svg, g = an("svg", { class: "circular", viewBox: i.svgViewBox ? i.svgViewBox : "0 0 50 50", ...y ? { innerHTML: y } : {} }, [ an("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none" }) ]), v = i.text ? an("p", { class: p.b("text") }, [i.text]) : void 0; return an(Zn, { name: p.b("fade"), onAfterLeave: c }, { default: le(() => [ ht(oe("div", { style: { backgroundColor: i.background || "" }, class: [ p.b("mask"), i.customClass, i.fullscreen ? "is-fullscreen" : "" ] }, [ an("div", { class: p.b("spinner") }, [g, v]) ]), [[Ot, i.visible]]) ]) }); }; } }), u = $T(l), d = u.mount(document.createElement("div")); return { ...Zi(i), setText: n, removeElLoadingChild: o, close: s, handleAfterLeave: c, vm: d, get $el() { return d.$el; } }; } let $p; const p8 = function(t = {}) { if (!$r) return; const e = f8(t); if (e.fullscreen && $p) return $p; const r = h8({ ...e, closed: () => { var n; (n = e.closed) == null || n.call(e), e.fullscreen && ($p = void 0); } }); m8(e, e.parent, r), Z2(e, e.parent, r), e.parent.vLoadingAddClassList = () => Z2(e, e.parent, r); let i = e.parent.getAttribute("loading-number"); return i ? i = `${Number.parseInt(i) + 1}` : i = "1", e.parent.setAttribute("loading-number", i), e.parent.appendChild(r.$el), st(() => r.visible.value = e.visible), e.fullscreen && ($p = r), r; }, f8 = (t) => { var e, r, i, n; let a; return Ei(t.target) ? a = (e = document.querySelector(t.target)) != null ? e : document.body : a = t.target || document.body, { parent: a === document.body || t.body ? document.body : a, background: t.background || "", svg: t.svg || "", svgViewBox: t.svgViewBox || "", spinner: t.spinner || !1, text: t.text || "", fullscreen: a === document.body && ((r = t.fullscreen) != null ? r : !0), lock: (i = t.lock) != null ? i : !1, customClass: t.customClass || "", visible: (n = t.visible) != null ? n : !0, beforeClose: t.beforeClose, closed: t.closed, target: a }; }, m8 = async (t, e, r) => { const { nextZIndex: i } = r.vm.zIndex || r.vm._.exposed.zIndex, n = {}; if (t.fullscreen) r.originalPosition.value = cd(document.body, "position"), r.originalOverflow.value = cd(document.body, "overflow"), n.zIndex = i(); else if (t.parent === document.body) { r.originalPosition.value = cd(document.body, "position"), await st(); for (const a of ["top", "left"]) { const o = a === "top" ? "scrollTop" : "scrollLeft"; n[a] = `${t.target.getBoundingClientRect()[a] + document.body[o] + document.documentElement[o] - Number.parseInt(cd(document.body, `margin-${a}`), 10)}px`; } for (const a of ["height", "width"]) n[a] = `${t.target.getBoundingClientRect()[a]}px`; } else r.originalPosition.value = cd(e, "position"); for (const [a, o] of Object.entries(n)) r.$el.style[a] = o; }, Z2 = (t, e, r) => { const i = r.vm.ns || r.vm._.exposed.ns; ["absolute", "fixed", "sticky"].includes(r.originalPosition.value) ? sl(e, i.bm("parent", "relative")) : py(e, i.bm("parent", "relative")), t.fullscreen && t.lock ? py(e, i.bm("parent", "hidden")) : sl(e, i.bm("parent", "hidden")); }, om = Symbol("ElLoading"), Y2 = (t, e) => { var r, i, n, a; const o = e.instance, s = (h) => di(e.value) ? e.value[h] : void 0, c = (h) => { const f = Ei(h) && (o == null ? void 0 : o[h]) || h; return f && we(f); }, l = (h) => c(s(h) || t.getAttribute(`element-loading-${YD(h)}`)), u = (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: u, target: (i = s("target")) != null ? i : u ? void 0 : t, body: (n = s("body")) != null ? n : e.modifiers.body, lock: (a = s("lock")) != null ? a : e.modifiers.lock }; t[om] = { options: d, instance: p8(d) }; }, g8 = (t, e) => { for (const r of Object.keys(e)) cn(e[r]) && (e[r].value = t[r]); }, hA = { mounted(t, e) { e.value && Y2(t, e); }, updated(t, e) { const r = t[om]; e.oldValue !== e.value && (e.value && !e.oldValue ? Y2(t, e) : e.value && e.oldValue ? di(e.value) && g8(e.value, r.options) : r == null || r.instance.close()); }, unmounted(t) { var e; (e = t[om]) == null || e.instance.close(), t[om] = null; } }, Cs = (t, e) => { const r = t.__vccOpts || t; for (const [i, n] of e) r[i] = n; return r; }, v8 = { 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: !1, evidencePrefixes: ["", "DOI:", "PMID:"], evidencePrefix: "", evidence: [], authenticated: !1, newEvidence: "", comment: "", prevSubs: [], showSubmissions: !0, 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(t) { t && (this.evidence.push(this.evidencePrefix + t), this.newEvidence = ""); }, formatTime: function(t) { const e = { year: "numeric", month: "long", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }; return new Date(t).toLocaleDateString(void 0, e); }, updatePrevSubmissions: function() { var t; this.$annotator && this.authenticated && this.annotationEntry.resourceId && this.annotationEntry.featureId && ((t = this.$annotator) == null || t.itemAnnotations( this.userApiKey, this.annotationEntry.resourceId, this.annotationEntry.featureId ).then((e) => { this.prevSubs = e; }).catch((e) => { console.log(e); })); }, submit: function() { var t; 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((i) => { if (i.includes("DOI:")) { const n = i.replace("DOI:", "https://doi.org/"); e.push(new URL(n)); } else if (i.includes("PMID:")) { const n = i.replace( "PMID:", "https://pubmed.ncbi.nlm.nih.gov/" ); e.push(new URL(n)); } else e.push(i); }); const r = { resource: this.annotationEntry.resourceId, item: Object.assign( { id: this.annotationEntry.featureId }, Object.fromEntries( Object.entries(this.annotationEntry).filter( ([i]) => ["label", "models"].includes(i) ) ) ), 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), (t = this.$annotator) == null || t.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(t) { this.evidence.splice(t, 1); }, resetSubmission: function() { this.editing = !1, this.evidence = [], this.newFeature = "", this.comment = ""; } }, watch: { annotationEntry: { handler: function(t, e) { t !== e && (this.resetSubmission(), this.updatePrevSubmissions()); }, immediate: !1, deep: !1 } }, mounted: function() { var t; (t = this.$annotator) == null || t.authenticate(this.userApiKey).then((e) => { e.name && e.email && e.canUpdate ? (this.creator = e, e.orcid || (this.creator.orcid = "0000-0000-0000-0000"), this.authenticated = !0, this.updatePrevSubmissions()) : this.errorMessage = ""; }); } }, $l = (t) => (Hh("data-v-9930ef40"), t = t(), Gh(), t), y8 = { class: "block" }, b8 = /* @__PURE__ */ $l(() => /* @__PURE__ */ Ee("div", { class: "title" }, "Feature Annotations", -1)), x8 = /* @__PURE__ */ $l(() => /* @__PURE__ */ Ee("strong", { class: "sub-title" }, "Previous submissions:", -1)), w8 = /* @__PURE__ */ $l(() => /* @__PURE__ */ Ee("strong", null, "Evidence: ", -1)), _8 = ["href"], S8 = /* @__PURE__ */ $l(() => /* @__PURE__ */ Ee("strong", null, "Comment: ", -1)), M8 = /* @__PURE__ */ $l(() => /* @__PURE__ */ Ee("strong", { class: "sub-title" }, "Suggest changes:", -1)), E8 = /* @__PURE__ */ $l(() => /* @__PURE__ */ Ee("strong", null, "Evidence:", -1)), T8 = /* @__PURE__ */ $l(() => /* @__PURE__ */ Ee("strong", null, "Comment:", -1)), C8 = { class: "sub-title" }; function A8(t, e, r, i, n, a) { const o = _g, s = uC, c = Oi, l = gg, u = iB, d = tB, h = aB, f = Qh, p = Lm, m = jV, y = UV, g = Jh, v = us, x = _b; return Q(), Re(x, { class: "main" }, { default: le(() => [ Ee("div", y8, [ oe(o, { class: "info-field" }, { default: le(() => [ b8 ]), _: 1 }), r.annotationEntry ? (Q(), be(pt, { key: 0 }, [ (Q(!0), be(pt, null, ir(t.displayPair, (w, S) => ht((Q(), Re(o, { class: "dialog-text", key: w }, { default: le(() => [ Ee("strong", null, Ze(S) + ": ", 1), et(" " + Ze(r.annotationEntry[w]), 1) ]), _: 2 }, 1024)), [ [Ot, r.annotationEntry[w]] ])), 128)), t.prevSubs.length > 0 ? (Q(), be(pt, { key: 0 }, [ ht(Ee("div", { class: "hide", onClick: e[0] || (e[0] = (w) => t.showSubmissions = !1) }, [ et(" Hide previous submissions "), oe(c, null, { default: le(() => [ oe(s) ]), _: 1 }) ], 512), [ [Ot, t.showSubmissions] ]), ht(Ee("div", { class: "hide", onClick: e[1] || (e[1] = (w) => t.showSubmissions = !0) }, [ et(" Show previous " + Ze(t.prevSubs.length) + " submission(s) ", 1), oe(c, null, { default: le(() => [ oe(l) ]), _: 1 }) ], 512), [ [Ot, !t.showSubmissions] ]), t.showSubmissions ? (Q(), be(pt, { key: 0 }, [ oe(o, { class: "dialog-spacer" }), oe(o, { class: "dialog-text" }, { default: le(() => [ x8 ]), _: 1 }), (Q(!0), be(pt, null, ir(t.prevSubs, (w, S) => (Q(), be("div", { class: "entry", key: S }, [ oe(o, { class: "dialog-text" }, { default: le(() => [ Ee("strong", null, Ze(a.formatTime(w.created)), 1), et(" " + Ze(w.creator.name), 1) ]), _: 2 }, 1024), oe(o, { class: "dialog-text" }, { default: le(() => [ w8, (Q(!0), be(pt, null, ir(w.body.evidence, (_) => (Q(), Re(o, { key: _, class: "dialog-text" }, { default: le(() => [ Ee("a", { href: _, target: "_blank" }, Ze(_), 9, _8) ]), _: 2 }, 1024))), 128)) ]), _: 2 }, 1024), oe(o, { class: "dialog-text" }, { default: le(() => [ S8, et(" " + Ze(w.body.comment), 1) ]), _: 2 }, 1024) ]))), 128)) ], 64)) : Pe("", !0) ], 64)) : Pe("", !0), t.authenticated ? (Q(), be(pt, { key: 1 }, [ a.isEditable ? (Q(), be(pt, { key: 0 }, [ oe(o, { class: "dialog-spacer" }), t.editing ? (Q(), be(pt, { key: 1 }, [ oe(o, { class: "dialog-text" }, { default: le(() => [ M8 ]), _: 1 }), a.isDeleted ? Pe("", !0) : (Q(), be(pt, { key: 0 }, [ oe(o, { class: "dialog-text" }, { default: le(() => [ E8 ]), _: 1 }), (Q(!0), be(pt, null, ir(t.evidence, (w, S) => (Q(), Re(o, { key: w }, { default: le(() => [ oe(f, { span: 20 }, { default: le(() => [ et(Ze(t.evidence[S]), 1) ]), _: 2 }, 1024), oe(f, { span: 4 }, { default: le(() => [ oe(c, { class: "standard-icon" }, { default: le(() => [ oe(p, { onClick: (_) => a.removeEvidence(S) }, null, 8, ["onClick"]) ]), _: 2 }, 1024) ]), _: 2 }, 1024) ]), _: 2 }, 1024))), 128)), oe(o, null, { default: le(() => [ oe(g, { size: "small", placeholder: "Enter", modelValue: t.newEvidence, "onUpdate:modelValue": e[4] || (e[4] = (w) => t.newEvidence = w), onChange: e[5] || (e[5] = (w) => a.evidenceEntered(w)) }, { prepend: le(() => [ oe(y, { teleported: !1, modelValue: t.evidencePrefix, "onUpdate:modelValue": e[3] || (e[3] = (w) => t.evidencePrefix = w), placeholder: "No Prefix", class: "select-box", "popper-class": "flatmap_dropdown" }, { default: le(() => [ (Q(!0), be(pt, null, ir(t.evidencePrefixes, (w) => (Q(), Re(m, { key: w, label: w, value: w }, { default: le(() => [ oe(o, null, { default: le(() => [ oe(f, { span: 12 }, { default: le(() => [ et(Ze(w), 1) ]), _: 2 }, 1024) ]), _: 2 }, 1024) ]), _: 2 }, 1032, ["label", "value"]))), 128)) ]), _: 1 }, 8, ["modelValue"]) ]), _: 1 }, 8, ["modelValue"]) ]), _: 1 }) ], 64)), oe(o, null, { default: le(() => [ T8 ]), _: 1 }), oe(o, { class: "dialog-text" }, { default: le(() => [ oe(g, { type: "textarea", autosize: { minRows: 2, maxRows: 4 }, placeholder: "Enter", modelValue: t.comment, "onUpdate:modelValue": e[6] || (e[6] = (w) => t.comment = w) }, null, 8, ["modelValue"]) ]), _: 1 }), oe(o, { class: "dialog-text" }, { default: le(() => [ oe(v, { class: "button", type: "primary", plain: "", onClick: a.submit }, { default: le(() => [ et(" Submit ") ]), _: 1 }, 8, ["onClick"]) ]), _: 1 }) ], 64)) : (Q(), Re(o, { key: 0 }, { default: le(() => [ oe(c, { class: "standard-icon" }, { default: le(() => [ oe(u, { onClick: e[2] || (e[2] = (w) => t.editing = !0) }) ]), _: 1 }), a.isDeleted ? (Q(), Re(c, { key: 0, class: "standard-icon" }, { default: le(() => [ oe(d, { onClick: a.submit }, null, 8, ["onClick"]) ]), _: 1 })) : a.isPositionUpdated ? (Q(), Re(c, { key: 1, class: "standard-icon" }, { default: le(() => [ oe(h, { onClick: a.submit }, null, 8, ["onClick"]) ]), _: 1 })) : Pe("", !0) ]), _: 1 })), t.errorMessage ? (Q(), Re(o, { key: 2, class: "dialog-text" }, { default: le(() => [ Ee("strong", C8, Ze(t.errorMessage), 1) ]), _: 1 })) : Pe("", !0) ], 64)) : Pe("", !0) ], 64)) : Pe("", !0) ], 64)) : Pe("", !0) ]) ]), _: 1 }); } const L8 = /* @__PURE__ */ Cs(v8, [["render", A8], ["__scopeId", "data-v-9930ef40"]]), k8 = { name: "CreateTooltipContent", components: { Button: us, Col: Qh, Container: oA, Header: sA, Input: Jh, Main: _b }, props: { createData: { type: Object } }, watch: { "createData.shape": { handler: function(t, e) { this.group = t, e !== void 0 && this.$emit("cancel-create"); }, immediate: !0 } }, computed: { confirmText: function() { return this.createData.editingIndex > -1 ? "Edit" : "Confirm"; } }, data: function() { return { group: "default", region: "", showPoint: !1 }; }, methods: { confirm: function() { this.$emit( "confirm-create", { region: "__annotation/" + this.region, group: this.group, shape: this.createData.shape, editingIndex: this.createData.editingIndex } ), this.group = this.createData.shape; }, cancel: function() { this.$emit("cancel-create"); } } }, P8 = (t) => (Hh("data-v-d61c5879"), t = t(), Gh(), t), R8 = /* @__PURE__ */ P8(() => /* @__PURE__ */ Ee("span", { class: "create-text" }, " Primitives will be created in the __annotation region ", -1)); function O8(t, e, r, i, n, a) { const o = sA, s = Qh, c = _g, l = Jh, u = us, d = _b, h = oA; return Q(), Re(h, { class: "create-container" }, { default: le(() => [ oe(o, { height: "30px", class: "header" }, { default: le(() => [ Ee("div", null, "Create " + Ze(r.createData.shape), 1) ]), _: 1 }), oe(d, { class: "slides-block" }, { default: le(() => [ R8, ht(oe(c, { class: "row" }, { default: le(() => [ oe(s, { offset: 0, span: 8 }, { default: le(() => [ et(" Position: ") ]), _: 1 }), oe(s, { offset: 0, span: 16 }, { default: le(() => [ (Q(!0), be(pt, null, ir(r.createData.points, ({ value: f, i: p }) => (Q(), Re(c, { key: p, class: "value" }, { default: le(() => [ et(Ze(p), 1) ]), _: 2 }, 1024))), 128)) ]), _: 1 }) ]), _: 1 }, 512), [ [Ot, t.showPoint] ]), oe(c, { class: "row" }, { default: le(() => [ oe(s, { offset: 0, span: 8 }, { default: le(() => [ et(" Region: ") ]), _: 1 }), oe(s, { offset: 0, span: 16 }, { default: le(() => [ oe(l, { modelValue: t.region, "onUpdate:modelValue": e[0] || (e[0] = (f) => t.region = f), placeholder: "__annotation", size: "small" }, null, 8, ["modelValue"]) ]), _: 1 }) ]), _: 1 }), oe(c, { class: "row" }, { default: le(() => [ oe(s, { offset: 0, span: 8 }, { default: le(() => [ et(" Group: ") ]), _: 1 }), oe(s, { offset: 0, span: 16 }, { default: le(() => [ oe(l, { modelValue: t.group, "onUpdate:modelValue": e[1] || (e[1] = (f) => t.group = f), placeholder: r.createData.shape, size: "small" }, null, 8, ["modelValue", "placeholder"]) ]), _: 1 }) ]), _: 1 }), oe(c, null, { default: le(() => [ oe(s, { offset: 0, span: 12 }, { default: le(() => [ oe(u, { type: "primary", plain: "", onClick: a.confirm }, { default: le(() => [ et(Ze(a.confirmText), 1) ]), _: 1 }, 8, ["onClick"]) ]), _: 1 }), oe(s, { offset: 0, span: 12 }, { default: le(() => [ oe(u, { type: "primary", plain: "", onClick: a.cancel }, { default: le(() => [ et(" Cancel ") ]), _: 1 }, 8, ["onClick"]) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }); } const D8 = /* @__PURE__ */ Cs(k8, [["render", O8], ["__scopeId", "data-v-d61c5879"]]); function Zr(t) { "@babel/helpers - typeof"; return Zr = 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; }, Zr(t); } function Tb(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function I8(t, e) { for (var r = 0; r < e.length; r++) { var i = e[r]; i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(t, i.key, i); } } function Cb(t, e, r) { return e && I8(t.prototype, e), Object.defineProperty(t, "prototype", { writable: !1 }), t; } function pA(t, e, r) { return e in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t; } function Fn(t, e) { return N8(t) || B8(t, e) || fA(t, e) || F8(); } function N8(t) { if (Array.isArray(t)) return t; } function B8(t, e) { var r = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"]; if (r != null) { var i = [], n = !0, a = !1, o, s; try { for (r = r.call(t); !(n = (o = r.next()).done) && (i.push(o.value), !(e && i.length === e)); n = !0) ; } catch (c) { a = !0, s = c; } finally { try { !n && r.return != null && r.return(); } finally { if (a) throw s; } } return i; } } function fA(t, e) { if (t) { if (typeof t == "string") return K2(t, e); var r = Object.prototype.toString.call(t).slice(8, -1); if (r === "Object" && t.constructor && (r = t.constructor.name), r === "Map" || r === "Set") return Array.from(t); if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return K2(t, e); } } function K2(t, e) { (e == null || e > t.length) && (e = t.length); for (var r = 0, i = new Array(e); r < e; r++) i[r] = t[r]; return i; } function F8() { 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 mA(t, e) { var r = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"]; if (!r) { if (Array.isArray(t) || (r = fA(t)) || e) { r && (t = r); var i = 0, n = function() { }; return { s: n, n: function() { return i >= t.length ? { done: !0 } : { done: !1, value: t[i++] }; }, e: function(c) { throw c; }, f: n }; } 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 a = !0, o = !1, s; return { s: function() { r = r.call(t); }, n: function() { var c = r.next(); return a = c.done, c; }, e: function(c) { o = !0, s = c; }, f: function() { try { !a && r.return != null && r.return(); } finally { if (o) throw s; } } }; } var Hr = typeof window > "u" ? null : window, J2 = Hr ? Hr.navigator : null; Hr && Hr.document; var z8 = Zr(""), gA = Zr({}), $8 = Zr(function() { }), V8 = typeof HTMLElement > "u" ? "undefined" : Zr(HTMLElement), tp = function(t) { return t && t.instanceString && xr(t.instanceString) ? t.instanceString() : null; }, dt = function(t) { return t != null && Zr(t) == z8; }, xr = function(t) { return t != null && Zr(t) === $8; }, ar = function(t) { return !on(t) && (Array.isArray ? Array.isArray(t) : t != null && t instanceof Array); }, Gt = function(t) { return t != null && Zr(t) === gA && !ar(t) && t.constructor === Object; }, U8 = function(t) { return t != null && Zr(t) === gA; }, Xe = function(t) { return t != null && Zr(t) === Zr(1) && !isNaN(t); }, j8 = function(t) { return Xe(t) && Math.floor(t) === t; }, Rm = function(t) { if (V8 !== "undefined") return t != null && t instanceof HTMLElement; }, on = function(t) { return rp(t) || vA(t); }, rp = function(t) { return tp(t) === "collection" && t._private.single; }, vA = function(t) { return tp(t) === "collection" && !t._private.single; }, Ab = function(t) { return tp(t) === "core"; }, yA = function(t) { return tp(t) === "stylesheet"; }, H8 = function(t) { return tp(t) === "event"; }, ds = function(t) { return t == null ? !0 : !!(t === "" || t.match(/^\s+$/)); }, G8 = function(t) { return typeof HTMLElement > "u" ? !1 : t instanceof HTMLElement; }, W8 = function(t) { return Gt(t) && Xe(t.x1) && Xe(t.x2) && Xe(t.y1) && Xe(t.y2); }, q8 = function(t) { return U8(t) && xr(t.then); }, X8 = function() { return J2 && J2.userAgent.match(/msie|trident|edge/i); }, fh = function(t, e) { e || (e = function() { if (arguments.length === 1) return arguments[0]; if (arguments.length === 0) return "undefined"; for (var i = [], n = 0; n < arguments.length; n++) i.push(arguments[n]); return i.join("$"); }); var r = function i() { var n = this, a = arguments, o, s = e.apply(n, a), c = i.cache; return (o = c[s]) || (o = c[s] = t.apply(n, a)), o; }; return r.cache = {}, r; }, Lb = fh(function(t) { return t.replace(/([A-Z])/g, function(e) { return "-" + e.toLowerCase(); }); }), Sg = fh(function(t) { return t.replace(/(-\w)/g, function(e) { return e[1].toUpperCase(); }); }), bA = fh(function(t, e) { return t + e[0].toUpperCase() + e.substring(1); }, function(t, e) { return t + "$" + e; }), Q2 = function(t) { return ds(t) ? t : t.charAt(0).toUpperCase() + t.substring(1); }, qr = "(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))", Z8 = "rgb[a]?\\((" + qr + "[%]?)\\s*,\\s*(" + qr + "[%]?)\\s*,\\s*(" + qr + "[%]?)(?:\\s*,\\s*(" + qr + "))?\\)", Y8 = "rgb[a]?\\((?:" + qr + "[%]?)\\s*,\\s*(?:" + qr + "[%]?)\\s*,\\s*(?:" + qr + "[%]?)(?:\\s*,\\s*(?:" + qr + "))?\\)", K8 = "hsl[a]?\\((" + qr + ")\\s*,\\s*(" + qr + "[%])\\s*,\\s*(" + qr + "[%])(?:\\s*,\\s*(" + qr + "))?\\)", J8 = "hsl[a]?\\((?:" + qr + ")\\s*,\\s*(?:" + qr + "[%])\\s*,\\s*(?:" + qr + "[%])(?:\\s*,\\s*(?:" + qr + "))?\\)", Q8 = "\\#[0-9a-fA-F]{3}", eU = "\\#[0-9a-fA-F]{6}", xA = function(t, e) { return t < e ? -1 : t > e ? 1 : 0; }, tU = function(t, e) { return -1 * xA(t, e); }, bt = Object.assign != null ? Object.assign.bind(Object) : function(t) { for (var e = arguments, r = 1; r < e.length; r++) { var i = e[r]; if (i != null) for (var n = Object.keys(i), a = 0; a < n.length; a++) { var o = n[a]; t[o] = i[o]; } } return t; }, rU = function(t) { if (!(!(t.length === 4 || t.length === 7) || t[0] !== "#")) { var e = t.length === 4, r, i, n, a = 16; return e ? (r = parseInt(t[1] + t[1], a), i = parseInt(t[2] + t[2], a), n = parseInt(t[3] + t[3], a)) : (r = parseInt(t[1] + t[2], a), i = parseInt(t[3] + t[4], a), n = parseInt(t[5] + t[6], a)), [r, i, n]; } }, iU = function(t) { var e, r, i, n, a, o, s, c; function l(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 u = new RegExp("^" + K8 + "$").exec(t); if (u) { if (r = parseInt(u[1]), r < 0 ? r = (360 - -1 * r % 360) % 360 : r > 360 && (r = r % 360), r /= 360, i = parseFloat(u[2]), i < 0 || i > 100 || (i = i / 100, n = parseFloat(u[3]), n < 0 || n > 100) || (n = n / 100, a = u[4], a !== void 0 && (a = parseFloat(a), a < 0 || a > 1))) return; if (i === 0) o = s = c = Math.round(n * 255); else { var d = n < 0.5 ? n * (1 + i) : n + i - n * i, h = 2 * n - d; o = Math.round(255 * l(h, d, r + 1 / 3)), s = Math.round(255 * l(h, d, r)), c = Math.round(255 * l(h, d, r - 1 / 3)); } e = [o, s, c, a]; } return e; }, nU = function(t) { var e, r = new RegExp("^" + Z8 + "$").exec(t); if (r) { e = []; for (var i = [], n = 1; n <= 3; n++) { var a = r[n]; if (a[a.length - 1] === "%" && (i[n] = !0), a = parseFloat(a), i[n] && (a = a / 100 * 255), a < 0 || a > 255) return; e.push(Math.floor(a)); } var o = i[1] || i[2] || i[3], s = i[1] && i[2] && i[3]; if (o && !s) return; var c = r[4]; if (c !== void 0) { if (c = parseFloat(c), c < 0 || c > 1) return; e.push(c); } } return e; }, aU = function(t) { return sU[t.toLowerCase()]; }, oU = function(t) { return (ar(t) ? t : null) || aU(t) || rU(t) || nU(t) || iU(t); }, sU = { // 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] }, wA = function(t) { for (var e = t.map, r = t.keys, i = r.length, n = 0; n < i; n++) { var a = r[n]; if (Gt(a)) throw Error("Tried to set map with object key"); n < r.length - 1 ? (e[a] == null && (e[a] = {}), e = e[a]) : e[a] = t.value; } }, _A = function(t) { for (var e = t.map, r = t.keys, i = r.length, n = 0; n < i; n++) { var a = r[n]; if (Gt(a)) throw Error("Tried to get map with object key"); if (e = e[a], e == null) return e; } return e; }; function lU(t) { var e = typeof t; return t != null && (e == "object" || e == "function"); } var xl = lU, Nd = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function cU(t, e) { return e = { exports: {} }, t(e, e.exports), e.exports; } var uU = typeof Nd == "object" && Nd && Nd.Object === Object && Nd, dU = uU, hU = typeof self == "object" && self && self.Object === Object && self, pU = dU || hU || Function("return this")(), Mg = pU, fU = function() { return Mg.Date.now(); }, $v = fU, mU = /\s/; function gU(t) { for (var e = t.length; e-- && mU.test(t.charAt(e)); ) ; return e; } var vU = gU, yU = /^\s+/; function bU(t) { return t && t.slice(0, vU(t) + 1).replace(yU, ""); } var xU = bU, wU = Mg.Symbol, ru = wU, SA = Object.prototype, _U = SA.hasOwnProperty, SU = SA.toString, hd = ru ? ru.toStringTag : void 0; function MU(t) { var e = _U.call(t, hd), r = t[hd]; try { t[hd] = void 0; var i = !0; } catch { } var n = SU.call(t); return i && (e ? t[hd] = r : delete t[hd]), n; } var EU = MU, TU = Object.prototype, CU = TU.toString; function AU(t) { return CU.call(t); } var LU = AU, kU = "[object Null]", PU = "[object Undefined]", e_ = ru ? ru.toStringTag : void 0; function RU(t) { return t == null ? t === void 0 ? PU : kU : e_ && e_ in Object(t) ? EU(t) : LU(t); } var MA = RU; function OU(t) { return t != null && typeof t == "object"; } var DU = OU, IU = "[object Symbol]"; function NU(t) { return typeof t == "symbol" || DU(t) && MA(t) == IU; } var ip = NU, t_ = NaN, BU = /^[-+]0x[0-9a-f]+$/i, FU = /^0b[01]+$/i, zU = /^0o[0-7]+$/i, $U = parseInt; function VU(t) { if (typeof t == "number") return t; if (ip(t)) return t_; if (xl(t)) { var e = typeof t.valueOf == "function" ? t.valueOf() : t; t = xl(e) ? e + "" : e; } if (typeof t != "string") return t === 0 ? t : +t; t = xU(t); var r = FU.test(t); return r || zU.test(t) ? $U(t.slice(2), r ? 2 : 8) : BU.test(t) ? t_ : +t; } var r_ = VU, UU = "Expected a function", jU = Math.max, HU = Math.min; function GU(t, e, r) { var i, n, a, o, s, c, l = 0, u = !1, d = !1, h = !0; if (typeof t != "function") throw new TypeError(UU); e = r_(e) || 0, xl(r) && (u = !!r.leading, d = "maxWait" in r, a = d ? jU(r_(r.maxWait) || 0, e) : a, h = "trailing" in r ? !!r.trailing : h); function f(_) { var b = i, T = n; return i = n = void 0, l = _, o = t.apply(T, b), o; } function p(_) { return l = _, s = setTimeout(g, e), u ? f(_) : o; } function m(_) { var b = _ - c, T = _ - l, E = e - b; return d ? HU(E, a - T) : E; } function y(_) { var b = _ - c, T = _ - l; return c === void 0 || b >= e || b < 0 || d && T >= a; } function g() { var _ = $v(); if (y(_)) return v(_); s = setTimeout(g, m(_)); } function v(_) { return s = void 0, h && i ? f(_) : (i = n = void 0, o); } function x() { s !== void 0 && clearTimeout(s), l = 0, i = c = n = s = void 0; } function w() { return s === void 0 ? o : v($v()); } function S() { var _ = $v(), b = y(_); if (i = arguments, n = this, c = _, b) { if (s === void 0) return p(c); if (d) return clearTimeout(s), s = setTimeout(g, e), f(c); } return s === void 0 && (s = setTimeout(g, e)), o; } return S.cancel = x, S.flush = w, S; } var Eg = GU, Vv = Hr ? Hr.performance : null, EA = Vv && Vv.now ? function() { return Vv.now(); } : function() { return Date.now(); }, WU = function() { if (Hr) { if (Hr.requestAnimationFrame) return function(t) { Hr.requestAnimationFrame(t); }; if (Hr.mozRequestAnimationFrame) return function(t) { Hr.mozRequestAnimationFrame(t); }; if (Hr.webkitRequestAnimationFrame) return function(t) { Hr.webkitRequestAnimationFrame(t); }; if (Hr.msRequestAnimationFrame) return function(t) { Hr.msRequestAnimationFrame(t); }; } return function(t) { t && setTimeout(function() { t(EA()); }, 1e3 / 60); }; }(), Om = function(t) { return WU(t); }, ro = EA, Rc = 9261, TA = 65599, Bd = 5381, CA = function(t) { for (var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Rc, r = e, i; i = t.next(), !i.done; ) r = r * TA + i.value | 0; return r; }, mh = function(t) { var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Rc; return e * TA + t | 0; }, gh = function(t) { var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Bd; return (e << 5) + e + t | 0; }, qU = function(t, e) { return t * 2097152 + e; }, Co = function(t) { return t[0] * 2097152 + t[1]; }, Vp = function(t, e) { return [mh(t[0], e[0]), gh(t[1], e[1])]; }, XU = function(t, e) { var r = { value: 0, done: !1 }, i = 0, n = t.length, a = { next: function() { return i < n ? r.value = t[i++] : r.done = !0, r; } }; return CA(a, e); }, wl = function(t, e) { var r = { value: 0, done: !1 }, i = 0, n = t.length, a = { next: function() { return i < n ? r.value = t.charCodeAt(i++) : r.done = !0, r; } }; return CA(a, e); }, AA = function() { return ZU(arguments); }, ZU = function(t) { for (var e, r = 0; r < t.length; r++) { var i = t[r]; r === 0 ? e = wl(i) : e = wl(i, e); } return e; }, YU = !0, KU = console.warn != null, JU = console.trace != null, kb = Number.MAX_SAFE_INTEGER || 9007199254740991, LA = function() { return !0; }, Dm = function() { return !1; }, i_ = function() { return 0; }, Pb = function() { }, Tr = function(t) { throw new Error(t); }, QU = function(t) { return YU; }, Zt = function(t) { QU() && (KU ? console.warn(t) : (console.log(t), JU && console.trace())); }, ej = function(t) { return bt({}, t); }, la = function(t) { return t == null ? t : ar(t) ? t.slice() : Gt(t) ? ej(t) : t; }, tj = function(t) { return t.slice(); }, kA = function(t, e) { for ( // loop :) e = t = ""; // b - result , a - numeric letiable t++ < 36; // e += t * 51 & 52 ? ( // return a random number or 4 (t ^ 15 ? ( // generate a random number from 0 to 15 8 ^ Math.random() * (t ^ 20 ? 16 : 4) ) : 4).toString(16) ) : "-" ) ; return e; }, rj = {}, PA = function() { return rj; }, yi = function(t) { var e = Object.keys(t); return function(r) { for (var i = {}, n = 0; n < e.length; n++) { var a = e[n], o = r == null ? void 0 : r[a]; i[a] = o === void 0 ? t[a] : o; } return i; }; }, hs = function(t, e, r) { for (var i = t.length - 1; i >= 0; i--) t[i] === e && t.splice(i, 1); }, Rb = function(t) { t.splice(0, t.length); }, ij = function(t, e) { for (var r = 0; r < e.length; r++) { var i = e[r]; t.push(i); } }, $n = function(t, e, r) { return r && (e = bA(r, e)), t[e]; }, Xo = function(t, e, r, i) { r && (e = bA(r, e)), t[e] = i; }, nj = /* @__PURE__ */ function() { function t() { Tb(this, t), this._obj = {}; } return Cb(t, [{ key: "set", value: function(e, r) { return this._obj[e] = r, this; } }, { key: "delete", value: function(e) { return this._obj[e] = void 0, this; } }, { key: "clear", value: function() { this._obj = {}; } }, { key: "has", value: function(e) { return this._obj[e] !== void 0; } }, { key: "get", value: function(e) { return this._obj[e]; } }]), t; }(), ca = typeof Map < "u" ? Map : nj, aj = "undefined", oj = /* @__PURE__ */ function() { function t(e) { if (Tb(this, t), this._obj = /* @__PURE__ */ Object.create(null), this.size = 0, e != null) { var r; e.instanceString != null && e.instanceString() === this.instanceString() ? r = e.toArray() : r = e; for (var i = 0; i < r.length; i++) this.add(r[i]); } } return Cb(t, [{ key: "instanceString", value: function() { return "set"; } }, { key: "add", value: function(e) { var r = this._obj; r[e] !== 1 && (r[e] = 1, this.size++); } }, { key: "delete", value: function(e) { var r = this._obj; r[e] === 1 && (r[e] = 0, this.size--); } }, { key: "clear", value: function() { this._obj = /* @__PURE__ */ Object.create(null); } }, { key: "has", value: function(e) { return this._obj[e] === 1; } }, { key: "toArray", value: function() { var e = this; return Object.keys(this._obj).filter(function(r) { return e.has(r); }); } }, { key: "forEach", value: function(e, r) { return this.toArray().forEach(e, r); } }]), t; }(), Nu = (typeof Set > "u" ? "undefined" : Zr(Set)) !== aj ? Set : oj, Tg = function(t, e) { var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0; if (t === void 0 || e === void 0 || !Ab(t)) { Tr("An element must have a core reference and parameters set"); return; } var i = e.group; if (i == null && (e.data && e.data.source != null && e.data.target != null ? i = "edges" : i = "nodes"), i !== "nodes" && i !== "edges") { Tr("An element must be of type `nodes` or `edges`; you specified `" + i + "`"); return; } this.length = 1, this[0] = this; var n = this._private = { cy: t, single: !0, // indicates this is an element data: e.data || {}, // data object position: e.position || { x: 0, y: 0 }, // (x, y) position pair autoWidth: void 0, // width and height of nodes calculated by the renderer when set to special 'auto' value autoHeight: void 0, autoPadding: void 0, compoundBoundsClean: !1, // whether the compound dimensions need to be recalculated the next time dimensions are read listeners: [], // array of bound listeners group: i, // string; 'nodes' or 'edges' style: {}, // properties as set by the style rstyle: {}, // properties for style sent from the renderer to the core styleCxts: [], // applied style contexts from the styler styleKeys: {}, // per-group keys of style property values removed: !0, // whether it's inside the vis; true if removed (set true here since we call restore) selected: !!e.selected, // whether it's selected selectable: e.selectable === void 0 ? !0 : !!e.selectable, // whether it's selectable locked: !!e.locked, // whether the element is locked (cannot be moved) grabbed: !1, // whether the element is grabbed by the mouse; renderer sets this privately grabbable: e.grabbable === void 0 ? !0 : !!e.grabbable, // whether the element can be grabbed pannable: e.pannable === void 0 ? i === "edges" : !!e.pannable, // whether the element has passthrough panning enabled active: !1, // whether the element is active from user interaction classes: new Nu(), // map ( className => true ) animation: { // object for currently-running animations current: [], queue: [] }, rscratch: {}, // object in which the renderer can store information scratch: e.scratch || {}, // scratch objects edges: [], // array of connected edges children: [], // array of children parent: e.parent && e.parent.isNode() ? e.parent : null, // parent ref traversalCache: {}, // cache of output of traversal functions backgrounding: !1, // whether background images are loading bbCache: null, // cache of the current bounding box bbCacheShift: { x: 0, y: 0 }, // shift applied to cached bb to be applied on next get bodyBounds: null, // bounds cache of element body, w/o overlay overlayBounds: null, // bounds cache of element body, including overlay labelBounds: { // bounds cache of labels all: null, source: null, target: null, main: null }, arrowBounds: { // bounds cache of edge arrows source: null, target: null, "mid-source": null, "mid-target": null } }; if (n.position.x == null && (n.position.x = 0), n.position.y == null && (n.position.y = 0), e.renderedPosition) { var a = e.renderedPosition, o = t.pan(), s = t.zoom(); n.position = { x: (a.x - o.x) / s, y: (a.y - o.y) / s }; } var c = []; ar(e.classes) ? c = e.classes : dt(e.classes) && (c = e.classes.split(/\s+/)); for (var l = 0, u = c.length; l < u; l++) { var d = c[l]; !d || d === "" || n.classes.add(d); } this.createEmitter(); var h = e.style || e.css; h && (Zt("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."), this.style(h)), (r === void 0 || r) && this.restore(); }, n_ = function(t) { return t = { bfs: t.bfs || !t.dfs, dfs: t.dfs || !t.bfs }, function(e, r, i) { var n; Gt(e) && !on(e) && (n = e, e = n.roots || n.root, r = n.visit, i = n.directed), i = arguments.length === 2 && !xr(r) ? r : i, r = xr(r) ? r : function() { }; for (var a = this._private.cy, o = e = dt(e) ? this.filter(e) : e, s = [], c = [], l = {}, u = {}, d = {}, h = 0, f, p = this.byGroup(), m = p.nodes, y = p.edges, g = 0; g < o.length; g++) { var v = o[g], x = v.id(); v.isNode() && (s.unshift(v), t.bfs && (d[x] = !0, c.push(v)), u[x] = 0); } for (var w = function() { var C = t.bfs ? s.shift() : s.pop(), L = C.id(); if (t.dfs) { if (d[L]) return "continue"; d[L] = !0, c.push(C); } var A = u[L], k = l[L], P = k != null ? k.source() : null, R = k != null ? k.target() : null, M = k == null ? void 0 : C.same(P) ? R[0] : P[0], O = void 0; if (O = r(C, k, M, h++, A), O === !0) return f = C, "break"; if (O === !1) return "break"; for (var D = C.connectedEdges().filter(function(Z) { return (!i || Z.source().same(C)) && y.has(Z); }), I = 0; I < D.length; I++) { var F = D[I], z = F.connectedNodes().filter(function(Z) { return !Z.same(C) && m.has(Z); }), U = z.id(); z.length !== 0 && !d[U] && (z = z[0], s.push(z), t.bfs && (d[U] = !0, c.push(z)), l[U] = F, u[U] = u[L] + 1); } }; s.length !== 0; ) { var S = w(); if (S !== "continue" && S === "break") break; } for (var _ = a.collection(), b = 0; b < c.length; b++) { var T = c[b], E = l[T.id()]; E != null && _.push(E), _.push(T); } return { path: a.collection(_), found: a.collection(f) }; }; }, vh = { breadthFirstSearch: n_({ bfs: !0 }), depthFirstSearch: n_({ dfs: !0 }) }; vh.bfs = vh.breadthFirstSearch; vh.dfs = vh.depthFirstSearch; var sj = cU(function(t, e) { (function() { var r, i, n, a, o, s, c, l, u, d, h, f, p, m, y; n = Math.floor, d = Math.min, i = function(g, v) { return g < v ? -1 : g > v ? 1 : 0; }, u = function(g, v, x, w, S) { var _; if (x == null && (x = 0), S == null && (S = i), x < 0) throw new Error("lo must be non-negative"); for (w == null && (w = g.length); x < w; ) _ = n((x + w) / 2), S(v, g[_]) < 0 ? w = _ : x = _ + 1; return [].splice.apply(g, [x, x - x].concat(v)), v; }, s = function(g, v, x) { return x == null && (x = i), g.push(v), m(g, 0, g.length - 1, x); }, o = function(g, v) { var x, w; return v == null && (v = i), x = g.pop(), g.length ? (w = g[0], g[0] = x, y(g, 0, v)) : w = x, w; }, l = function(g, v, x) { var w; return x == null && (x = i), w = g[0], g[0] = v, y(g, 0, x), w; }, c = function(g, v, x) { var w; return x == null && (x = i), g.length && x(g[0], v) < 0 && (w = [g[0], v], v = w[0], g[0] = w[1], y(g, 0, x)), v; }, a = function(g, v) { var x, w, S, _, b, T; for (v == null && (v = i), _ = (function() { T = []; for (var E = 0, C = n(g.length / 2); 0 <= C ? E < C : E > C; 0 <= C ? E++ : E--) T.push(E); return T; }).apply(this).reverse(), b = [], w = 0, S = _.length; w < S; w++) x = _[w], b.push(y(g, x, v)); return b; }, p = function(g, v, x) { var w; if (x == null && (x = i), w = g.indexOf(v), w !== -1) return m(g, 0, w, x), y(g, w, x); }, h = function(g, v, x) { var w, S, _, b, T; if (x == null && (x = i), S = g.slice(0, v), !S.length) return S; for (a(S, x), T = g.slice(v), _ = 0, b = T.length; _ < b; _++) w = T[_], c(S, w, x); return S.sort(x).reverse(); }, f = function(g, v, x) { var w, S, _, b, T, E, C, L, A; if (x == null && (x = i), v * 10 <= g.length) { if (_ = g.slice(0, v).sort(x), !_.length) return _; for (S = _[_.length - 1], C = g.slice(v), b = 0, E = C.length; b < E; b++) w = C[b], x(w, S) < 0 && (u(_, w, 0, null, x), _.pop(), S = _[_.length - 1]); return _; } for (a(g, x), A = [], T = 0, L = d(v, g.length); 0 <= L ? T < L : T > L; 0 <= L ? ++T : --T) A.push(o(g, x)); return A; }, m = function(g, v, x, w) { var S, _, b; for (w == null && (w = i), S = g[x]; x > v; ) { if (b = x - 1 >> 1, _ = g[b], w(S, _) < 0) { g[x] = _, x = b; continue; } break; } return g[x] = S; }, y = function(g, v, x) { var w, S, _, b, T; for (x == null && (x = i), S = g.length, T = v, _ = g[v], w = 2 * v + 1; w < S; ) b = w + 1, b < S && !(x(g[w], g[b]) < 0) && (w = b), g[v] = g[w], v = w, w = 2 * v + 1; return g[v] = _, m(g, T, v, x); }, r = function() { g.push = s, g.pop = o, g.replace = l, g.pushpop = c, g.heapify = a, g.updateItem = p, g.nlargest = h, g.nsmallest = f; function g(v) { this.cmp = v ?? i, this.nodes = []; } return g.prototype.push = function(v) { return s(this.nodes, v, this.cmp); }, g.prototype.pop = function() { return o(this.nodes, this.cmp); }, g.prototype.peek = function() { return this.nodes[0]; }, g.prototype.contains = function(v) { return this.nodes.indexOf(v) !== -1; }, g.prototype.replace = function(v) { return l(this.nodes, v, this.cmp); }, g.prototype.pushpop = function(v) { return c(this.nodes, v, this.cmp); }, g.prototype.heapify = function() { return a(this.nodes, this.cmp); }, g.prototype.updateItem = function(v) { return p(this.nodes, v, 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 v; return v = new g(), v.nodes = this.nodes.slice(0), v; }, 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, v) { return t.exports = v(); }(this, function() { return r; }); }).call(Nd); }), np = sj, lj = yi({ root: null, weight: function(t) { return 1; }, directed: !1 }), cj = { dijkstra: function(t) { if (!Gt(t)) { var e = arguments; t = { root: e[0], weight: e[1], directed: e[2] }; } var r = lj(t), i = r.root, n = r.weight, a = r.directed, o = this, s = n, c = dt(i) ? this.filter(i)[0] : i[0], l = {}, u = {}, d = {}, h = this.byGroup(), f = h.nodes, p = h.edges; p.unmergeBy(function(P) { return P.isLoop(); }); for (var m = function(P) { return l[P.id()]; }, y = function(P, R) { l[P.id()] = R, g.updateItem(P); }, g = new np(function(P, R) { return m(P) - m(R); }), v = 0; v < f.length; v++) { var x = f[v]; l[x.id()] = x.same(c) ? 0 : 1 / 0, g.push(x); } for (var w = function(P, R) { for (var M = (a ? P.edgesTo(R) : P.edgesWith(R)).intersect(p), O = 1 / 0, D, I = 0; I < M.length; I++) { var F = M[I], z = s(F); (z < O || !D) && (O = z, D = F); } return { edge: D, dist: O }; }; g.size() > 0; ) { var S = g.pop(), _ = m(S), b = S.id(); if (d[b] = _, _ !== 1 / 0) for (var T = S.neighborhood().intersect(f), E = 0; E < T.length; E++) { var C = T[E], L = C.id(), A = w(S, C), k = _ + A.dist; k < m(C) && (y(C, k), u[L] = { node: S, edge: A.edge }); } } return { distanceTo: function(P) { var R = dt(P) ? f.filter(P)[0] : P[0]; return d[R.id()]; }, pathTo: function(P) { var R = dt(P) ? f.filter(P)[0] : P[0], M = [], O = R, D = O.id(); if (R.length > 0) for (M.unshift(R); u[D]; ) { var I = u[D]; M.unshift(I.edge), M.unshift(I.node), O = I.node, D = O.id(); } return o.spawn(M); } }; } }, uj = { // kruskal's algorithm (finds min spanning tree, assuming undirected graph) // implemented from pseudocode from wikipedia kruskal: function(t) { t = t || function(v) { return 1; }; for (var e = this.byGroup(), r = e.nodes, i = e.edges, n = r.length, a = new Array(n), o = r, s = function(v) { for (var x = 0; x < a.length; x++) { var w = a[x]; if (w.has(v)) return x; } }, c = 0; c < n; c++) a[c] = this.spawn(r[c]); for (var l = i.sort(function(v, x) { return t(v) - t(x); }), u = 0; u < l.length; u++) { var d = l[u], h = d.source()[0], f = d.target()[0], p = s(h), m = s(f), y = a[p], g = a[m]; p !== m && (o.merge(d), y.merge(g), a.splice(m, 1)); } return o; } }, dj = yi({ root: null, goal: null, weight: function(t) { return 1; }, heuristic: function(t) { return 0; }, directed: !1 }), hj = { // Implemented from pseudocode from wikipedia aStar: function(t) { var e = this.cy(), r = dj(t), i = r.root, n = r.goal, a = r.heuristic, o = r.directed, s = r.weight; i = e.collection(i)[0], n = e.collection(n)[0]; var c = i.id(), l = n.id(), u = {}, d = {}, h = {}, f = new np(function(I, F) { return d[I.id()] - d[F.id()]; }), p = new Nu(), m = {}, y = {}, g = function(I, F) { f.push(I), p.add(F); }, v, x, w = function() { v = f.pop(), x = v.id(), p.delete(x); }, S = function(I) { return p.has(I); }; g(i, c), u[c] = 0, d[c] = a(i); for (var _ = 0; f.size() > 0; ) { if (w(), _++, x === l) { for (var b = [], T = n, E = l, C = y[E]; b.unshift(T), C != null && b.unshift(C), T = m[E], T != null; ) E = T.id(), C = y[E]; return { found: !0, distance: u[x], path: this.spawn(b), steps: _ }; } h[x] = !0; for (var L = v._private.edges, A = 0; A < L.length; A++) { var k = L[A]; if (this.hasElementWithId(k.id()) && !(o && k.data("source") !== x)) { var P = k.source(), R = k.target(), M = P.id() !== x ? P : R, O = M.id(); if (this.hasElementWithId(O) && !h[O]) { var D = u[x] + s(k); if (!S(O)) { u[O] = D, d[O] = D + a(M), g(M, O), m[O] = v, y[O] = k; continue; } D < u[O] && (u[O] = D, d[O] = D + a(M), m[O] = v, y[O] = k); } } } } return { found: !1, distance: void 0, path: void 0, steps: _ }; } }, pj = yi({ weight: function(t) { return 1; }, directed: !1 }), fj = { // Implemented from pseudocode from wikipedia floydWarshall: function(t) { for (var e = this.cy(), r = pj(t), i = r.weight, n = r.directed, a = i, o = this.byGroup(), s = o.nodes, c = o.edges, l = s.length, u = l * l, d = function(z) { return s.indexOf(z); }, h = function(z) { return s[z]; }, f = new Array(u), p = 0; p < u; p++) { var m = p % l, y = (p - m) / l; y === m ? f[p] = 0 : f[p] = 1 / 0; } for (var g = new Array(u), v = new Array(u), x = 0; x < c.length; x++) { var w = c[x], S = w.source()[0], _ = w.target()[0]; if (S !== _) { var b = d(S), T = d(_), E = b * l + T, C = a(w); if (f[E] > C && (f[E] = C, g[E] = T, v[E] = w), !n) { var L = T * l + b; !n && f[L] > C && (f[L] = C, g[L] = b, v[L] = w); } } } for (var A = 0; A < l; A++) for (var k = 0; k < l; k++) for (var P = k * l + A, R = 0; R < l; R++) { var M = k * l + R, O = A * l + R; f[P] + f[O] < f[M] && (f[M] = f[P] + f[O], g[M] = g[P]); } var D = function(z) { return (dt(z) ? e.filter(z) : z)[0]; }, I = function(z) { return d(D(z)); }, F = { distance: function(z, U) { var Z = I(z), re = I(U); return f[Z * l + re]; }, path: function(z, U) { var Z = I(z), re = I(U), K = h(Z); if (Z === re) return K.collection(); if (g[Z * l + re] == null) return e.collection(); var V = e.collection(), H = Z, G; for (V.merge(K); Z !== re; ) H = Z, Z = g[Z * l + re], G = v[H * l + Z], V.merge(G), V.merge(h(Z)); return V; } }; return F; } // floydWarshall }, mj = yi({ weight: function(t) { return 1; }, directed: !1, root: null }), gj = { // Implemented from pseudocode from wikipedia bellmanFord: function(t) { var e = this, r = mj(t), i = r.weight, n = r.directed, a = r.root, o = i, s = this, c = this.cy(), l = this.byGroup(), u = l.edges, d = l.nodes, h = d.length, f = new ca(), p = !1, m = []; a = c.collection(a)[0], u.unmergeBy(function(ne) { return ne.isLoop(); }); for (var y = u.length, g = function(ne) { var j = f.get(ne.id()); return j || (j = {}, f.set(ne.id(), j)), j; }, v = function(ne) { return (dt(ne) ? c.$(ne) : ne)[0]; }, x = function(ne) { return g(v(ne)).dist; }, w = function(ne) { for (var j = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : a, q = v(ne), ge = [], ye = q; ; ) { if (ye == null) return e.spawn(); var _e = g(ye), Me = _e.edge, Ce = _e.pred; if (ge.unshift(ye[0]), ye.same(j) && ge.length > 0) break; Me != null && ge.unshift(Me), ye = Ce; } return s.spawn(ge); }, S = 0; S < h; S++) { var _ = d[S], b = g(_); _.same(a) ? b.dist = 0 : b.dist = 1 / 0, b.pred = null, b.edge = null; } for (var T = !1, E = function(ne, j, q, ge, ye, _e) { var Me = ge.dist + _e; Me < ye.dist && !q.same(ge.edge) && (ye.dist = Me, ye.pred = ne, ye.edge = q, T = !0); }, C = 1; C < h; C++) { T = !1; for (var L = 0; L < y; L++) { var A = u[L], k = A.source(), P = A.target(), R = o(A), M = g(k), O = g(P); E(k, P, A, M, O, R), n || E(P, k, A, O, M, R); } if (!T) break; } if (T) for (var D = [], I = 0; I < y; I++) { var F = u[I], z = F.source(), U = F.target(), Z = o(F), re = g(z).dist, K = g(U).dist; if (re + Z < K || !n && K + Z < re) if (p || (Zt("Graph contains a negative weight cycle for Bellman-Ford"), p = !0), t.findNegativeWeightCycles !== !1) { var V = []; re + Z < K && V.push(z), !n && K + Z < re && V.push(U); for (var H = V.length, G = 0; G < H; G++) { var W = V[G], Y = [W]; Y.push(g(W).edge); for (var X = g(W).pred; Y.indexOf(X) === -1; ) Y.push(X), Y.push(g(X).edge), X = g(X).pred; Y = Y.slice(Y.indexOf(X)); for (var ie = Y[0].id(), ue = 0, $ = 2; $ < Y.length; $ += 2) Y[$].id() < ie && (ie = Y[$].id(), ue = $); Y = Y.slice(ue).concat(Y.slice(0, ue)), Y.push(Y[0]); var J = Y.map(function(ne) { return ne.id(); }).join(","); D.indexOf(J) === -1 && (m.push(s.spawn(Y)), D.push(J)); } } else break; } return { distanceTo: x, pathTo: w, hasNegativeWeightCycle: p, negativeWeightCycles: m }; } // bellmanFord }, vj = Math.sqrt(2), yj = function(t, e, r) { r.length === 0 && Tr("Karger-Stein must be run on a connected (sub)graph"); for (var i = r[t], n = i[1], a = i[2], o = e[n], s = e[a], c = r, l = c.length - 1; l >= 0; l--) { var u = c[l], d = u[1], h = u[2]; (e[d] === o && e[h] === s || e[d] === s && e[h] === o) && c.splice(l, 1); } for (var f = 0; f < c.length; f++) { var p = c[f]; p[1] === s ? (c[f] = p.slice(), c[f][1] = o) : p[2] === s && (c[f] = p.slice(), c[f][2] = o); } for (var m = 0; m < e.length; m++) e[m] === s && (e[m] = o); return c; }, Uv = function(t, e, r, i) { for (; r > i; ) { var n = Math.floor(Math.random() * e.length); e = yj(n, t, e), r--; } return e; }, bj = { // Computes the minimum cut of an undirected graph // Returns the correct answer with high probability kargerStein: function() { var t = this, e = this.byGroup(), r = e.nodes, i = e.edges; i.unmergeBy(function(O) { return O.isLoop(); }); var n = r.length, a = i.length, o = Math.ceil(Math.pow(Math.log(n) / Math.LN2, 2)), s = Math.floor(n / vj); if (n < 2) { Tr("At least 2 nodes are required for Karger-Stein algorithm"); return; } for (var c = [], l = 0; l < a; l++) { var u = i[l]; c.push([l, r.indexOf(u.source()), r.indexOf(u.target())]); } for (var d = 1 / 0, h = [], f = new Array(n), p = new Array(n), m = new Array(n), y = function(O, D) { for (var I = 0; I < n; I++) D[I] = O[I]; }, g = 0; g <= o; g++) { for (var v = 0; v < n; v++) p[v] = v; var x = Uv(p, c.slice(), n, s), w = x.slice(); y(p, m); var S = Uv(p, x, s, 2), _ = Uv(m, w, s, 2); S.length <= _.length && S.length < d ? (d = S.length, h = S, y(p, f)) : _.length <= S.length && _.length < d && (d = _.length, h = _, y(m, f)); } for (var b = this.spawn(h.map(function(O) { return i[O[0]]; })), T = this.spawn(), E = this.spawn(), C = f[0], L = 0; L < f.length; L++) { var A = f[L], k = r[L]; A === C ? T.merge(k) : E.merge(k); } var P = function(O) { var D = t.spawn(); return O.forEach(function(I) { D.merge(I), I.connectedEdges().forEach(function(F) { t.contains(F) && !b.contains(F) && D.merge(F); }); }), D; }, R = [P(T), P(E)], M = { cut: b, components: R, // n.b. partitions are included to be compatible with the old api spec // (could be removed in a future major version) partition1: T, partition2: E }; return M; } }, xj = function(t) { return { x: t.x, y: t.y }; }, Cg = function(t, e, r) { return { x: t.x * e + r.x, y: t.y * e + r.y }; }, RA = function(t, e, r) { return { x: (t.x - r.x) / e, y: (t.y - r.y) / e }; }, Oc = function(t) { return { x: t[0], y: t[1] }; }, wj = function(t) { for (var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : t.length, i = 1 / 0, n = e; n < r; n++) { var a = t[n]; isFinite(a) && (i = Math.min(a, i)); } return i; }, _j = function(t) { for (var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : t.length, i = -1 / 0, n = e; n < r; n++) { var a = t[n]; isFinite(a) && (i = Math.max(a, i)); } return i; }, Sj = function(t) { for (var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : t.length, i = 0, n = 0, a = e; a < r; a++) { var o = t[a]; isFinite(o) && (i += o, n++); } return i / n; }, Mj = function(t) { var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : t.length, i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !0, n = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : !0; i ? t = t.slice(e, r) : (r < t.length && t.splice(r, t.length - r), e > 0 && t.splice(0, e)); for (var o = 0, s = t.length - 1; s >= 0; s--) { var c = t[s]; a ? isFinite(c) || (t[s] = -1 / 0, o++) : t.splice(s, 1); } n && t.sort(function(d, h) { return d - h; }); var l = t.length, u = Math.floor(l / 2); return l % 2 !== 0 ? t[u + 1 + o] : (t[u - 1 + o] + t[u + o]) / 2; }, Ej = function(t) { return Math.PI * t / 180; }, Up = function(t, e) { return Math.atan2(e, t) - Math.PI / 2; }, Ob = Math.log2 || function(t) { return Math.log(t) / Math.log(2); }, OA = function(t) { return t > 0 ? 1 : t < 0 ? -1 : 0; }, _l = function(t, e) { return Math.sqrt(qs(t, e)); }, qs = function(t, e) { var r = e.x - t.x, i = e.y - t.y; return r * r + i * i; }, Tj = function(t) { for (var e = t.length, r = 0, i = 0; i < e; i++) r += t[i]; for (var n = 0; n < e; n++) t[n] = t[n] / r; return t; }, ei = function(t, e, r, i) { return (1 - i) * (1 - i) * t + 2 * (1 - i) * i * e + i * i * r; }, $c = function(t, e, r, i) { return { x: ei(t.x, e.x, r.x, i), y: ei(t.y, e.y, r.y, i) }; }, Cj = function(t, e, r, i) { var n = { x: e.x - t.x, y: e.y - t.y }, a = _l(t, e), o = { x: n.x / a, y: n.y / a }; return r = r ?? 0, i = i ?? r * a, { x: t.x + o.x * i, y: t.y + o.y * i }; }, yh = function(t, e, r) { return Math.max(t, Math.min(r, e)); }, Yi = function(t) { if (t == null) return { x1: 1 / 0, y1: 1 / 0, x2: -1 / 0, y2: -1 / 0, w: 0, h: 0 }; if (t.x1 != null && t.y1 != null) { if (t.x2 != null && t.y2 != null && t.x2 >= t.x1 && t.y2 >= t.y1) return { x1: t.x1, y1: t.y1, x2: t.x2, y2: t.y2, w: t.x2 - t.x1, h: t.y2 - t.y1 }; if (t.w != null && t.h != null && t.w >= 0 && t.h >= 0) return { x1: t.x1, y1: t.y1, x2: t.x1 + t.w, y2: t.y1 + t.h, w: t.w, h: t.h }; } }, Aj = function(t) { return { x1: t.x1, x2: t.x2, w: t.w, y1: t.y1, y2: t.y2, h: t.h }; }, Lj = function(t) { t.x1 = 1 / 0, t.y1 = 1 / 0, t.x2 = -1 / 0, t.y2 = -1 / 0, t.w = 0, t.h = 0; }, kj = function(t, e, r) { return { x1: t.x1 + e, x2: t.x2 + e, y1: t.y1 + r, y2: t.y2 + r, w: t.w, h: t.h }; }, DA = function(t, e) { t.x1 = Math.min(t.x1, e.x1), t.x2 = Math.max(t.x2, e.x2), t.w = t.x2 - t.x1, t.y1 = Math.min(t.y1, e.y1), t.y2 = Math.max(t.y2, e.y2), t.h = t.y2 - t.y1; }, Pj = function(t, e, r) { t.x1 = Math.min(t.x1, e), t.x2 = Math.max(t.x2, e), t.w = t.x2 - t.x1, t.y1 = Math.min(t.y1, r), t.y2 = Math.max(t.y2, r), t.h = t.y2 - t.y1; }, sm = function(t) { var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0; return t.x1 -= e, t.x2 += e, t.y1 -= e, t.y2 += e, t.w = t.x2 - t.x1, t.h = t.y2 - t.y1, t; }, lm = function(t) { var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [0], r, i, n, a; if (e.length === 1) r = i = n = a = e[0]; else if (e.length === 2) r = n = e[0], a = i = e[1]; else if (e.length === 4) { var o = Fn(e, 4); r = o[0], i = o[1], n = o[2], a = o[3]; } return t.x1 -= a, t.x2 += i, t.y1 -= r, t.y2 += n, t.w = t.x2 - t.x1, t.h = t.y2 - t.y1, t; }, a_ = function(t, e) { t.x1 = e.x1, t.y1 = e.y1, t.x2 = e.x2, t.y2 = e.y2, t.w = t.x2 - t.x1, t.h = t.y2 - t.y1; }, Db = function(t, e) { return !(t.x1 > e.x2 || e.x1 > t.x2 || t.x2 < e.x1 || e.x2 < t.x1 || t.y2 < e.y1 || e.y2 < t.y1 || t.y1 > e.y2 || e.y1 > t.y2); }, iu = function(t, e, r) { return t.x1 <= e && e <= t.x2 && t.y1 <= r && r <= t.y2; }, Rj = function(t, e) { return iu(t, e.x, e.y); }, IA = function(t, e) { return iu(t, e.x1, e.y1) && iu(t, e.x2, e.y2); }, NA = function(t, e, r, i, n, a, o) { var s = arguments.length > 7 && arguments[7] !== void 0 ? arguments[7] : "auto", c = s === "auto" ? Sl(n, a) : s, l = n / 2, u = a / 2; c = Math.min(c, l, u); var d = c !== l, h = c !== u, f; if (d) { var p = r - l + c - o, m = i - u - o, y = r + l - c + o, g = m; if (f = Jo(t, e, r, i, p, m, y, g, !1), f.length > 0) return f; } if (h) { var v = r + l + o, x = i - u + c - o, w = v, S = i + u - c + o; if (f = Jo(t, e, r, i, v, x, w, S, !1), f.length > 0) return f; } if (d) { var _ = r - l + c - o, b = i + u + o, T = r + l - c + o, E = b; if (f = Jo(t, e, r, i, _, b, T, E, !1), f.length > 0) return f; } if (h) { var C = r - l - o, L = i - u + c - o, A = C, k = i + u - c + o; if (f = Jo(t, e, r, i, C, L, A, k, !1), f.length > 0) return f; } var P; { var R = r - l + c, M = i - u + c; if (P = Fd(t, e, r, i, R, M, c + o), P.length > 0 && P[0] <= R && P[1] <= M) return [P[0], P[1]]; } { var O = r + l - c, D = i - u + c; if (P = Fd(t, e, r, i, O, D, c + o), P.length > 0 && P[0] >= O && P[1] <= D) return [P[0], P[1]]; } { var I = r + l - c, F = i + u - c; if (P = Fd(t, e, r, i, I, F, c + o), P.length > 0 && P[0] >= I && P[1] >= F) return [P[0], P[1]]; } { var z = r - l + c, U = i + u - c; if (P = Fd(t, e, r, i, z, U, c + o), P.length > 0 && P[0] <= z && P[1] >= U) return [P[0], P[1]]; } return []; }, Oj = function(t, e, r, i, n, a, o) { var s = o, c = Math.min(r, n), l = Math.max(r, n), u = Math.min(i, a), d = Math.max(i, a); return c - s <= t && t <= l + s && u - s <= e && e <= d + s; }, Dj = function(t, e, r, i, n, a, o, s, c) { var l = { x1: Math.min(r, o, n) - c, x2: Math.max(r, o, n) + c, y1: Math.min(i, s, a) - c, y2: Math.max(i, s, a) + c }; return !(t < l.x1 || t > l.x2 || e < l.y1 || e > l.y2); }, Ij = function(t, e, r, i) { r -= i; var n = e * e - 4 * t * r; if (n < 0) return []; var a = Math.sqrt(n), o = 2 * t, s = (-e + a) / o, c = (-e - a) / o; return [s, c]; }, Nj = function(t, e, r, i, n) { var a = 1e-5; t === 0 && (t = a), e /= t, r /= t, i /= t; var o, s, c, l, u, d, h, f; if (s = (3 * r - e * e) / 9, c = -(27 * i) + e * (9 * r - 2 * (e * e)), c /= 54, o = s * s * s + c * c, n[1] = 0, h = e / 3, o > 0) { u = c + Math.sqrt(o), u = u < 0 ? -Math.pow(-u, 1 / 3) : Math.pow(u, 1 / 3), d = c - Math.sqrt(o), d = d < 0 ? -Math.pow(-d, 1 / 3) : Math.pow(d, 1 / 3), n[0] = -h + u + d, h += (u + d) / 2, n[4] = n[2] = -h, h = Math.sqrt(3) * (-d + u) / 2, n[3] = h, n[5] = -h; return; } if (n[5] = n[3] = 0, o === 0) { f = c < 0 ? -Math.pow(-c, 1 / 3) : Math.pow(c, 1 / 3), n[0] = -h + 2 * f, n[4] = n[2] = -(f + h); return; } s = -s, l = s * s * s, l = Math.acos(c / Math.sqrt(l)), f = 2 * Math.sqrt(s), n[0] = -h + f * Math.cos(l / 3), n[2] = -h + f * Math.cos((l + 2 * Math.PI) / 3), n[4] = -h + f * Math.cos((l + 4 * Math.PI) / 3); }, Bj = function(t, e, r, i, n, a, o, s) { var c = 1 * r * r - 4 * r * n + 2 * r * o + 4 * n * n - 4 * n * o + o * o + i * i - 4 * i * a + 2 * i * s + 4 * a * a - 4 * a * s + s * s, l = 1 * 9 * r * n - 3 * r * r - 3 * r * o - 6 * n * n + 3 * n * o + 9 * i * a - 3 * i * i - 3 * i * s - 6 * a * a + 3 * a * s, u = 1 * 3 * r * r - 6 * r * n + r * o - r * t + 2 * n * n + 2 * n * t - o * t + 3 * i * i - 6 * i * a + i * s - i * e + 2 * a * a + 2 * a * e - s * e, d = 1 * r * n - r * r + r * t - n * t + i * a - i * i + i * e - a * e, h = []; Nj(c, l, u, d, h); for (var f = 1e-7, p = [], m = 0; m < 6; m += 2) Math.abs(h[m + 1]) < f && h[m] >= 0 && h[m] <= 1 && p.push(h[m]); p.push(1), p.push(0); for (var y = -1, g, v, x, w = 0; w < p.length; w++) g = Math.pow(1 - p[w], 2) * r + 2 * (1 - p[w]) * p[w] * n + p[w] * p[w] * o, v = Math.pow(1 - p[w], 2) * i + 2 * (1 - p[w]) * p[w] * a + p[w] * p[w] * s, x = Math.pow(g - t, 2) + Math.pow(v - e, 2), y >= 0 ? x < y && (y = x) : y = x; return y; }, Fj = function(t, e, r, i, n, a) { var o = [t - r, e - i], s = [n - r, a - i], c = s[0] * s[0] + s[1] * s[1], l = o[0] * o[0] + o[1] * o[1], u = o[0] * s[0] + o[1] * s[1], d = u * u / c; return u < 0 ? l : d > c ? (t - n) * (t - n) + (e - a) * (e - a) : l - d; }, Vi = function(t, e, r) { for (var i, n, a, o, s, c = 0, l = 0; l < r.length / 2; l++) if (i = r[l * 2], n = r[l * 2 + 1], l + 1 < r.length / 2 ? (a = r[(l + 1) * 2], o = r[(l + 1) * 2 + 1]) : (a = r[(l + 1 - r.length / 2) * 2], o = r[(l + 1 - r.length / 2) * 2 + 1]), !(i == t && a == t)) if (i >= t && t >= a || i <= t && t <= a) s = (t - i) / (a - i) * (o - n) + n, s > e && c++; else continue; return c % 2 !== 0; }, io = function(t, e, r, i, n, a, o, s, c) { var l = new Array(r.length), u; s[0] != null ? (u = Math.atan(s[1] / s[0]), s[0] < 0 ? u = u + Math.PI / 2 : u = -u - Math.PI / 2) : u = s; for (var d = Math.cos(-u), h = Math.sin(-u), f = 0; f < l.length / 2; f++) l[f * 2] = a / 2 * (r[f * 2] * d - r[f * 2 + 1] * h), l[f * 2 + 1] = o / 2 * (r[f * 2 + 1] * d + r[f * 2] * h), l[f * 2] += i, l[f * 2 + 1] += n; var p; if (c > 0) { var m = Nm(l, -c); p = Im(m); } else p = l; return Vi(t, e, p); }, zj = function(t, e, r, i, n, a, o, s) { for (var c = new Array(r.length * 2), l = 0; l < s.length; l++) { var u = s[l]; c[l * 4 + 0] = u.startX, c[l * 4 + 1] = u.startY, c[l * 4 + 2] = u.stopX, c[l * 4 + 3] = u.stopY; var d = Math.pow(u.cx - t, 2) + Math.pow(u.cy - e, 2); if (d <= Math.pow(u.radius, 2)) return !0; } return Vi(t, e, c); }, Im = function(t) { for (var e = new Array(t.length / 2), r, i, n, a, o, s, c, l, u = 0; u < t.length / 4; u++) { r = t[u * 4], i = t[u * 4 + 1], n = t[u * 4 + 2], a = t[u * 4 + 3], u < t.length / 4 - 1 ? (o = t[(u + 1) * 4], s = t[(u + 1) * 4 + 1], c = t[(u + 1) * 4 + 2], l = t[(u + 1) * 4 + 3]) : (o = t[0], s = t[1], c = t[2], l = t[3]); var d = Jo(r, i, n, a, o, s, c, l, !0); e[u * 2] = d[0], e[u * 2 + 1] = d[1]; } return e; }, Nm = function(t, e) { for (var r = new Array(t.length * 2), i, n, a, o, s = 0; s < t.length / 2; s++) { i = t[s * 2], n = t[s * 2 + 1], s < t.length / 2 - 1 ? (a = t[(s + 1) * 2], o = t[(s + 1) * 2 + 1]) : (a = t[0], o = t[1]); var c = o - n, l = -(a - i), u = Math.sqrt(c * c + l * l), d = c / u, h = l / u; r[s * 4] = i + d * e, r[s * 4 + 1] = n + h * e, r[s * 4 + 2] = a + d * e, r[s * 4 + 3] = o + h * e; } return r; }, $j = function(t, e, r, i, n, a) { var o = r - t, s = i - e; o /= n, s /= a; var c = Math.sqrt(o * o + s * s), l = c - 1; if (l < 0) return []; var u = l / c; return [(r - t) * u + t, (i - e) * u + e]; }, rl = function(t, e, r, i, n, a, o) { return t -= n, e -= a, t /= r / 2 + o, e /= i / 2 + o, t * t + e * e <= 1; }, Fd = function(t, e, r, i, n, a, o) { var s = [r - t, i - e], c = [t - n, e - a], l = s[0] * s[0] + s[1] * s[1], u = 2 * (c[0] * s[0] + c[1] * s[1]), d = c[0] * c[0] + c[1] * c[1] - o * o, h = u * u - 4 * l * d; if (h < 0) return []; var f = (-u + Math.sqrt(h)) / (2 * l), p = (-u - Math.sqrt(h)) / (2 * l), m = Math.min(f, p), y = Math.max(f, p), g = []; if (m >= 0 && m <= 1 && g.push(m), y >= 0 && y <= 1 && g.push(y), g.length === 0) return []; var v = g[0] * s[0] + t, x = g[0] * s[1] + e; if (g.length > 1) { if (g[0] == g[1]) return [v, x]; var w = g[1] * s[0] + t, S = g[1] * s[1] + e; return [v, x, w, S]; } else return [v, x]; }, jv = function(t, e, r) { return e <= t && t <= r || r <= t && t <= e ? t : t <= e && e <= r || r <= e && e <= t ? e : r; }, Jo = function(t, e, r, i, n, a, o, s, c) { var l = t - n, u = r - t, d = o - n, h = e - a, f = i - e, p = s - a, m = d * h - p * l, y = u * h - f * l, g = p * u - d * f; if (g !== 0) { var v = m / g, x = y / g, w = 1e-3, S = 0 - w, _ = 1 + w; return S <= v && v <= _ && S <= x && x <= _ ? [t + v * u, e + v * f] : c ? [t + v * u, e + v * f] : []; } else return m === 0 || y === 0 ? jv(t, r, o) === o ? [o, s] : jv(t, r, n) === n ? [n, a] : jv(n, o, r) === r ? [r, i] : [] : []; }, bh = function(t, e, r, i, n, a, o, s) { var c = [], l, u = new Array(r.length), d = !0; a == null && (d = !1); var h; if (d) { for (var f = 0; f < u.length / 2; f++) u[f * 2] = r[f * 2] * a + i, u[f * 2 + 1] = r[f * 2 + 1] * o + n; if (s > 0) { var p = Nm(u, -s); h = Im(p); } else h = u; } else h = r; for (var m, y, g, v, x = 0; x < h.length / 2; x++) m = h[x * 2], y = h[x * 2 + 1], x < h.length / 2 - 1 ? (g = h[(x + 1) * 2], v = h[(x + 1) * 2 + 1]) : (g = h[0], v = h[1]), l = Jo(t, e, i, n, m, y, g, v), l.length !== 0 && c.push(l[0], l[1]); return c; }, Vj = function(t, e, r, i, n, a, o, s, c) { var l = [], u, d = new Array(r.length * 2); c.forEach(function(g, v) { v === 0 ? (d[d.length - 2] = g.startX, d[d.length - 1] = g.startY) : (d[v * 4 - 2] = g.startX, d[v * 4 - 1] = g.startY), d[v * 4] = g.stopX, d[v * 4 + 1] = g.stopY, u = Fd(t, e, i, n, g.cx, g.cy, g.radius), u.length !== 0 && l.push(u[0], u[1]); }); for (var h = 0; h < d.length / 4; h++) u = Jo(t, e, i, n, d[h * 4], d[h * 4 + 1], d[h * 4 + 2], d[h * 4 + 3], !1), u.length !== 0 && l.push(u[0], u[1]); if (l.length > 2) { for (var f = [l[0], l[1]], p = Math.pow(f[0] - t, 2) + Math.pow(f[1] - e, 2), m = 1; m < l.length / 2; m++) { var y = Math.pow(l[m * 2] - t, 2) + Math.pow(l[m * 2 + 1] - e, 2); y <= p && (f[0] = l[m * 2], f[1] = l[m * 2 + 1], p = y); } return f; } return l; }, jp = function(t, e, r) { var i = [t[0] - e[0], t[1] - e[1]], n = Math.sqrt(i[0] * i[0] + i[1] * i[1]), a = (n - r) / n; return a < 0 && (a = 1e-5), [e[0] + a * i[0], e[1] + a * i[1]]; }, Ri = function(t, e) { var r = Sy(t, e); return r = BA(r), r; }, BA = function(t) { for (var e, r, i = t.length / 2, n = 1 / 0, a = 1 / 0, o = -1 / 0, s = -1 / 0, c = 0; c < i; c++) e = t[2 * c], r = t[2 * c + 1], n = Math.min(n, e), o = Math.max(o, e), a = Math.min(a, r), s = Math.max(s, r); for (var l = 2 / (o - n), u = 2 / (s - a), d = 0; d < i; d++) e = t[2 * d] = t[2 * d] * l, r = t[2 * d + 1] = t[2 * d + 1] * u, n = Math.min(n, e), o = Math.max(o, e), a = Math.min(a, r), s = Math.max(s, r); if (a < -1) for (var h = 0; h < i; h++) r = t[2 * h + 1] = t[2 * h + 1] + (-1 - a); return t; }, Sy = function(t, e) { var r = 1 / t * 2 * Math.PI, i = t % 2 === 0 ? Math.PI / 2 + r / 2 : Math.PI / 2; i += e; for (var n = new Array(t * 2), a, o = 0; o < t; o++) a = o * r + i, n[2 * o] = Math.cos(a), n[2 * o + 1] = Math.sin(-a); return n; }, Sl = function(t, e) { return Math.min(t / 4, e / 4, 8); }, FA = function(t, e) { return Math.min(t / 10, e / 10, 8); }, Ib = function() { return 8; }, Uj = function(t, e, r) { return [t - 2 * e + r, 2 * (e - t), t]; }, My = function(t, e) { return { heightOffset: Math.min(15, 0.05 * e), widthOffset: Math.min(100, 0.25 * t), ctrlPtOffsetPct: 0.05 }; }, jj = yi({ dampingFactor: 0.8, precision: 1e-6, iterations: 200, weight: function(t) { return 1; } }), Hj = { pageRank: function(t) { for (var e = jj(t), r = e.dampingFactor, i = e.precision, n = e.iterations, a = e.weight, o = this._private.cy, s = this.byGroup(), c = s.nodes, l = s.edges, u = c.length, d = u * u, h = l.length, f = new Array(d), p = new Array(u), m = (1 - r) / u, y = 0; y < u; y++) { for (var g = 0; g < u; g++) { var v = y * u + g; f[v] = 0; } p[y] = 0; } for (var x = 0; x < h; x++) { var w = l[x], S = w.data("source"), _ = w.data("target"); if (S !== _) { var b = c.indexOfId(S), T = c.indexOfId(_), E = a(w), C = T * u + b; f[C] += E, p[b] += E; } } for (var L = 1 / u + m, A = 0; A < u; A++) if (p[A] === 0) for (var k = 0; k < u; k++) { var P = k * u + A; f[P] = L; } else for (var R = 0; R < u; R++) { var M = R * u + A; f[M] = f[M] / p[A] + m; } for (var O = new Array(u), D = new Array(u), I, F = 0; F < u; F++) O[F] = 1; for (var z = 0; z < n; z++) { for (var U = 0; U < u; U++) D[U] = 0; for (var Z = 0; Z < u; Z++) for (var re = 0; re < u; re++) { var K = Z * u + re; D[Z] += f[K] * O[re]; } Tj(D), I = O, O = D, D = I; for (var V = 0, H = 0; H < u; H++) { var G = I[H] - O[H]; V += G * G; } if (V < i) break; } var W = { rank: function(Y) { return Y = o.collection(Y)[0], O[c.indexOf(Y)]; } }; return W; } // pageRank }, o_ = yi({ root: null, weight: function(t) { return 1; }, directed: !1, alpha: 0 }), Vc = { degreeCentralityNormalized: function(t) { t = o_(t); var e = this.cy(), r = this.nodes(), i = r.length; if (t.directed) { for (var n = {}, a = {}, o = 0, s = 0, c = 0; c < i; c++) { var l = r[c], u = l.id(); t.root = l; var d = this.degreeCentrality(t); o < d.indegree && (o = d.indegree), s < d.outdegree && (s = d.outdegree), n[u] = d.indegree, a[u] = d.outdegree; } return { indegree: function(g) { return o == 0 ? 0 : (dt(g) && (g = e.filter(g)), n[g.id()] / o); }, outdegree: function(g) { return s === 0 ? 0 : (dt(g) && (g = e.filter(g)), a[g.id()] / s); } }; } else { for (var h = {}, f = 0, p = 0; p < i; p++) { var m = r[p]; t.root = m; var y = this.degreeCentrality(t); f < y.degree && (f = y.degree), h[m.id()] = y.degree; } return { degree: function(g) { return f === 0 ? 0 : (dt(g) && (g = e.filter(g)), h[g.id()] / f); } }; } }, // 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(t) { t = o_(t); var e = this.cy(), r = this, i = t, n = i.root, a = i.weight, o = i.directed, s = i.alpha; if (n = e.collection(n)[0], o) { for (var c = n.connectedEdges(), l = c.filter(function(S) { return S.target().same(n) && r.has(S); }), u = c.filter(function(S) { return S.source().same(n) && r.has(S); }), d = l.length, h = u.length, f = 0, p = 0, m = 0; m < l.length; m++) f += a(l[m]); for (var y = 0; y < u.length; y++) p += a(u[y]); return { indegree: Math.pow(d, 1 - s) * Math.pow(f, s), outdegree: Math.pow(h, 1 - s) * Math.pow(p, s) }; } else { for (var g = n.connectedEdges().intersection(r), v = g.length, x = 0, w = 0; w < g.length; w++) x += a(g[w]); return { degree: Math.pow(v, 1 - s) * Math.pow(x, s) }; } } // degreeCentrality }; Vc.dc = Vc.degreeCentrality; Vc.dcn = Vc.degreeCentralityNormalised = Vc.degreeCentralityNormalized; var s_ = yi({ harmonic: !0, weight: function() { return 1; }, directed: !1, root: null }), Uc = { closenessCentralityNormalized: function(t) { for (var e = s_(t), r = e.harmonic, i = e.weight, n = e.directed, a = this.cy(), o = {}, s = 0, c = this.nodes(), l = this.floydWarshall({ weight: i, directed: n }), u = 0; u < c.length; u++) { for (var d = 0, h = c[u], f = 0; f < c.length; f++) if (u !== f) { var p = l.distance(h, c[f]); r ? d += 1 / p : d += p; } r || (d = 1 / d), s < d && (s = d), o[h.id()] = d; } return { closeness: function(m) { return s == 0 ? 0 : (dt(m) ? m = a.filter(m)[0].id() : m = m.id(), o[m] / s); } }; }, // Implemented from pseudocode from wikipedia closenessCentrality: function(t) { var e = s_(t), r = e.root, i = e.weight, n = e.directed, a = e.harmonic; r = this.filter(r)[0]; for (var o = this.dijkstra({ root: r, weight: i, directed: n }), s = 0, c = this.nodes(), l = 0; l < c.length; l++) { var u = c[l]; if (!u.same(r)) { var d = o.distanceTo(u); a ? s += 1 / d : s += d; } } return a ? s : 1 / s; } // closenessCentrality }; Uc.cc = Uc.closenessCentrality; Uc.ccn = Uc.closenessCentralityNormalised = Uc.closenessCentralityNormalized; var Gj = yi({ weight: null, directed: !1 }), Ey = { // Implemented from the algorithm in the paper "On Variants of Shortest-Path Betweenness Centrality and their Generic Computation" by Ulrik Brandes betweennessCentrality: function(t) { for (var e = Gj(t), r = e.directed, i = e.weight, n = i != null, a = this.cy(), o = this.nodes(), s = {}, c = {}, l = 0, u = { set: function(g, v) { c[g] = v, v > l && (l = v); }, get: function(g) { return c[g]; } }, d = 0; d < o.length; d++) { var h = o[d], f = h.id(); r ? s[f] = h.outgoers().nodes() : s[f] = h.openNeighborhood().nodes(), u.set(f, 0); } for (var p = function(g) { for (var v = o[g].id(), x = [], w = {}, S = {}, _ = {}, b = new np(function(Z, re) { return _[Z] - _[re]; }), T = 0; T < o.length; T++) { var E = o[T].id(); w[E] = [], S[E] = 0, _[E] = 1 / 0; } for (S[v] = 1, _[v] = 0, b.push(v); !b.empty(); ) { var C = b.pop(); if (x.push(C), n) for (var L = 0; L < s[C].length; L++) { var A = s[C][L], k = a.getElementById(C), P = void 0; k.edgesTo(A).length > 0 ? P = k.edgesTo(A)[0] : P = A.edgesTo(k)[0]; var R = i(P); A = A.id(), _[A] > _[C] + R && (_[A] = _[C] + R, b.nodes.indexOf(A) < 0 ? b.push(A) : b.updateItem(A), S[A] = 0, w[A] = []), _[A] == _[C] + R && (S[A] = S[A] + S[C], w[A].push(C)); } else for (var M = 0; M < s[C].length; M++) { var O = s[C][M].id(); _[O] == 1 / 0 && (b.push(O), _[O] = _[C] + 1), _[O] == _[C] + 1 && (S[O] = S[O] + S[C], w[O].push(C)); } } for (var D = {}, I = 0; I < o.length; I++) D[o[I].id()] = 0; for (; x.length > 0; ) { for (var F = x.pop(), z = 0; z < w[F].length; z++) { var U = w[F][z]; D[U] = D[U] + S[U] / S[F] * (1 + D[F]); } F != o[g].id() && u.set(F, u.get(F) + D[F]); } }, m = 0; m < o.length; m++) p(m); var y = { betweenness: function(g) { var v = a.collection(g).id(); return u.get(v); }, betweennessNormalized: function(g) { if (l == 0) return 0; var v = a.collection(g).id(); return u.get(v) / l; } }; return y.betweennessNormalised = y.betweennessNormalized, y; } // betweennessCentrality }; Ey.bc = Ey.betweennessCentrality; var Wj = yi({ expandFactor: 2, // affects time of computation and cluster granularity to some extent: M * M inflateFactor: 2, // affects cluster granularity (the greater the value, the more clusters): M(i,j) / E(j) multFactor: 1, // optional self loops for each node. Use a neutral value to improve cluster computations. maxIterations: 20, // maximum number of iterations of the MCL algorithm in a single run attributes: [ // attributes/features used to group nodes, ie. similarity values between nodes function(t) { return 1; } ] }), qj = function(t) { return Wj(t); }, Xj = function(t, e) { for (var r = 0, i = 0; i < e.length; i++) r += e[i](t); return r; }, Zj = function(t, e, r) { for (var i = 0; i < e; i++) t[i * e + i] = r; }, zA = function(t, e) { for (var r, i = 0; i < e; i++) { r = 0; for (var n = 0; n < e; n++) r += t[n * e + i]; for (var a = 0; a < e; a++) t[a * e + i] = t[a * e + i] / r; } }, Yj = function(t, e, r) { for (var i = new Array(r * r), n = 0; n < r; n++) { for (var a = 0; a < r; a++) i[n * r + a] = 0; for (var o = 0; o < r; o++) for (var s = 0; s < r; s++) i[n * r + s] += t[n * r + o] * e[o * r + s]; } return i; }, Kj = function(t, e, r) { for (var i = t.slice(0), n = 1; n < r; n++) t = Yj(t, i, e); return t; }, Jj = function(t, e, r) { for (var i = new Array(e * e), n = 0; n < e * e; n++) i[n] = Math.pow(t[n], r); return zA(i, e), i; }, Qj = function(t, e, r, i) { for (var n = 0; n < r; n++) { var a = Math.round(t[n] * Math.pow(10, i)) / Math.pow(10, i), o = Math.round(e[n] * Math.pow(10, i)) / Math.pow(10, i); if (a !== o) return !1; } return !0; }, eH = function(t, e, r, i) { for (var n = [], a = 0; a < e; a++) { for (var o = [], s = 0; s < e; s++) Math.round(t[a * e + s] * 1e3) / 1e3 > 0 && o.push(r[s]); o.length !== 0 && n.push(i.collection(o)); } return n; }, tH = function(t, e) { for (var r = 0; r < t.length; r++) if (!e[r] || t[r].id() !== e[r].id()) return !1; return !0; }, rH = function(t) { for (var e = 0; e < t.length; e++) for (var r = 0; r < t.length; r++) e != r && tH(t[e], t[r]) && t.splice(r, 1); return t; }, l_ = function(t) { for (var e = this.nodes(), r = this.edges(), i = this.cy(), n = qj(t), a = {}, o = 0; o < e.length; o++) a[e[o].id()] = o; for (var s = e.length, c = s * s, l = new Array(c), u, d = 0; d < c; d++) l[d] = 0; for (var h = 0; h < r.length; h++) { var f = r[h], p = a[f.source().id()], m = a[f.target().id()], y = Xj(f, n.attributes); l[p * s + m] += y, l[m * s + p] += y; } Zj(l, s, n.multFactor), zA(l, s); for (var g = !0, v = 0; g && v < n.maxIterations; ) g = !1, u = Kj(l, s, n.expandFactor), l = Jj(u, s, n.inflateFactor), Qj(l, u, c, 4) || (g = !0), v++; var x = eH(l, s, e, i); return x = rH(x), x; }, iH = { markovClustering: l_, mcl: l_ }, nH = function(t) { return t; }, $A = function(t, e) { return Math.abs(e - t); }, c_ = function(t, e, r) { return t + $A(e, r); }, u_ = function(t, e, r) { return t + Math.pow(r - e, 2); }, aH = function(t) { return Math.sqrt(t); }, oH = function(t, e, r) { return Math.max(t, $A(e, r)); }, pd = function(t, e, r, i, n) { for (var a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : nH, o = i, s, c, l = 0; l < t; l++) s = e(l), c = r(l), o = n(o, s, c); return a(o); }, nu = { euclidean: function(t, e, r) { return t >= 2 ? pd(t, e, r, 0, u_, aH) : pd(t, e, r, 0, c_); }, squaredEuclidean: function(t, e, r) { return pd(t, e, r, 0, u_); }, manhattan: function(t, e, r) { return pd(t, e, r, 0, c_); }, max: function(t, e, r) { return pd(t, e, r, -1 / 0, oH); } }; nu["squared-euclidean"] = nu.squaredEuclidean; nu.squaredeuclidean = nu.squaredEuclidean; function Ag(t, e, r, i, n, a) { var o; return xr(t) ? o = t : o = nu[t] || nu.euclidean, e === 0 && xr(t) ? o(n, a) : o(e, r, i, n, a); } var sH = yi({ k: 2, m: 2, sensitivityThreshold: 1e-4, distance: "euclidean", maxIterations: 10, attributes: [], testMode: !1, testCentroids: null }), Nb = function(t) { return sH(t); }, Bm = function(t, e, r, i, n) { var a = n !== "kMedoids", o = a ? function(u) { return r[u]; } : function(u) { return i[u](r); }, s = function(u) { return i[u](e); }, c = r, l = e; return Ag(t, i.length, o, s, c, l); }, Hv = function(t, e, r) { for (var i = r.length, n = new Array(i), a = new Array(i), o = new Array(e), s = null, c = 0; c < i; c++) n[c] = t.min(r[c]).value, a[c] = t.max(r[c]).value; for (var l = 0; l < e; l++) { s = []; for (var u = 0; u < i; u++) s[u] = Math.random() * (a[u] - n[u]) + n[u]; o[l] = s; } return o; }, VA = function(t, e, r, i, n) { for (var a = 1 / 0, o = 0, s = 0; s < e.length; s++) { var c = Bm(r, t, e[s], i, n); c < a && (a = c, o = s); } return o; }, UA = function(t, e, r) { for (var i = [], n = null, a = 0; a < e.length; a++) n = e[a], r[n.id()] === t && i.push(n); return i; }, lH = function(t, e, r) { return Math.abs(e - t) <= r; }, cH = function(t, e, r) { for (var i = 0; i < t.length; i++) for (var n = 0; n < t[i].length; n++) { var a = Math.abs(t[i][n] - e[i][n]); if (a > r) return !1; } return !0; }, uH = function(t, e, r) { for (var i = 0; i < r; i++) if (t === e[i]) return !0; return !1; }, d_ = function(t, e) { var r = new Array(e); if (t.length < 50) for (var i = 0; i < e; i++) { for (var n = t[Math.floor(Math.random() * t.length)]; uH(n, r, i); ) n = t[Math.floor(Math.random() * t.length)]; r[i] = n; } else for (var a = 0; a < e; a++) r[a] = t[Math.floor(Math.random() * t.length)]; return r; }, h_ = function(t, e, r) { for (var i = 0, n = 0; n < e.length; n++) i += Bm("manhattan", e[n], t, r, "kMedoids"); return i; }, dH = function(t) { var e = this.cy(), r = this.nodes(), i = null, n = Nb(t), a = new Array(n.k), o = {}, s; n.testMode ? typeof n.testCentroids == "number" ? (n.testCentroids, s = Hv(r, n.k, n.attributes)) : Zr(n.testCentroids) === "object" ? s = n.testCentroids : s = Hv(r, n.k, n.attributes) : s = Hv(r, n.k, n.attributes); for (var c = !0, l = 0; c && l < n.maxIterations; ) { for (var u = 0; u < r.length; u++) i = r[u], o[i.id()] = VA(i, s, n.distance, n.attributes, "kMeans"); c = !1; for (var d = 0; d < n.k; d++) { var h = UA(d, r, o); if (h.length !== 0) { for (var f = n.attributes.length, p = s[d], m = new Array(f), y = new Array(f), g = 0; g < f; g++) { y[g] = 0; for (var v = 0; v < h.length; v++) i = h[v], y[g] += n.attributes[g](i); m[g] = y[g] / h.length, lH(m[g], p[g], n.sensitivityThreshold) || (c = !0); } s[d] = m, a[d] = e.collection(h); } } l++; } return a; }, hH = function(t) { var e = this.cy(), r = this.nodes(), i = null, n = Nb(t), a = new Array(n.k), o, s = {}, c, l = new Array(n.k); n.testMode ? typeof n.testCentroids == "number" || (Zr(n.testCentroids) === "object" ? o = n.testCentroids : o = d_(r, n.k)) : o = d_(r, n.k); for (var u = !0, d = 0; u && d < n.maxIterations; ) { for (var h = 0; h < r.length; h++) i = r[h], s[i.id()] = VA(i, o, n.distance, n.attributes, "kMedoids"); u = !1; for (var f = 0; f < o.length; f++) { var p = UA(f, r, s); if (p.length !== 0) { l[f] = h_(o[f], p, n.attributes); for (var m = 0; m < p.length; m++) c = h_(p[m], p, n.attributes), c < l[f] && (l[f] = c, o[f] = p[m], u = !0); a[f] = e.collection(p); } } d++; } return a; }, pH = function(t, e, r, i, n) { for (var a, o, s = 0; s < e.length; s++) for (var c = 0; c < t.length; c++) i[s][c] = Math.pow(r[s][c], n.m); for (var l = 0; l < t.length; l++) for (var u = 0; u < n.attributes.length; u++) { a = 0, o = 0; for (var d = 0; d < e.length; d++) a += i[d][l] * n.attributes[u](e[d]), o += i[d][l]; t[l][u] = a / o; } }, fH = function(t, e, r, i, n) { for (var a = 0; a < t.length; a++) e[a] = t[a].slice(); for (var o, s, c, l = 2 / (n.m - 1), u = 0; u < r.length; u++) for (var d = 0; d < i.length; d++) { o = 0; for (var h = 0; h < r.length; h++) s = Bm(n.distance, i[d], r[u], n.attributes, "cmeans"), c = Bm(n.distance, i[d], r[h], n.attributes, "cmeans"), o += Math.pow(s / c, l); t[d][u] = 1 / o; } }, mH = function(t, e, r, i) { for (var n = new Array(r.k), a = 0; a < n.length; a++) n[a] = []; for (var o, s, c = 0; c < e.length; c++) { o = -1 / 0, s = -1; for (var l = 0; l < e[0].length; l++) e[c][l] > o && (o = e[c][l], s = l); n[s].push(t[c]); } for (var u = 0; u < n.length; u++) n[u] = i.collection(n[u]); return n; }, p_ = function(t) { var e = this.cy(), r = this.nodes(), i = Nb(t), n, a, o, s, c; s = new Array(r.length); for (var l = 0; l < r.length; l++) s[l] = new Array(i.k); o = new Array(r.length); for (var u = 0; u < r.length; u++) o[u] = new Array(i.k); for (var d = 0; d < r.length; d++) { for (var h = 0, f = 0; f < i.k; f++) o[d][f] = Math.random(), h += o[d][f]; for (var p = 0; p < i.k; p++) o[d][p] = o[d][p] / h; } a = new Array(i.k); for (var m = 0; m < i.k; m++) a[m] = new Array(i.attributes.length); c = new Array(r.length); for (var y = 0; y < r.length; y++) c[y] = new Array(i.k); for (var g = !0, v = 0; g && v < i.maxIterations; ) g = !1, pH(a, r, o, c, i), fH(o, s, a, r, i), cH(o, s, i.sensitivityThreshold) || (g = !0), v++; return n = mH(r, o, i, e), { clusters: n, degreeOfMembership: o }; }, gH = { kMeans: dH, kMedoids: hH, fuzzyCMeans: p_, fcm: p_ }, vH = yi({ distance: "euclidean", // distance metric to compare nodes linkage: "min", // linkage criterion : how to determine the distance between clusters of nodes mode: "threshold", // mode:'threshold' => clusters must be threshold distance apart threshold: 1 / 0, // the distance threshold // mode:'dendrogram' => the nodes are organised as leaves in a tree (siblings are close), merging makes clusters addDendrogram: !1, // whether to add the dendrogram to the graph for viz dendrogramDepth: 0, // depth at which dendrogram branches are merged into the returned clusters attributes: [] // array of attr functions }), yH = { single: "min", complete: "max" }, bH = function(t) { var e = vH(t), r = yH[e.linkage]; return r != null && (e.linkage = r), e; }, f_ = function(t, e, r, i, n) { for (var a = 0, o = 1 / 0, s, c = n.attributes, l = function(b, T) { return Ag(n.distance, c.length, function(E) { return c[E](b); }, function(E) { return c[E](T); }, b, T); }, u = 0; u < t.length; u++) { var d = t[u].key, h = r[d][i[d]]; h < o && (a = d, o = h); } if (n.mode === "threshold" && o >= n.threshold || n.mode === "dendrogram" && t.length === 1) return !1; var f = e[a], p = e[i[a]], m; n.mode === "dendrogram" ? m = { left: f, right: p, key: f.key } : m = { value: f.value.concat(p.value), key: f.key }, t[f.index] = m, t.splice(p.index, 1), e[f.key] = m; for (var y = 0; y < t.length; y++) { var g = t[y]; f.key === g.key ? s = 1 / 0 : n.linkage === "min" ? (s = r[f.key][g.key], r[f.key][g.key] > r[p.key][g.key] && (s = r[p.key][g.key])) : n.linkage === "max" ? (s = r[f.key][g.key], r[f.key][g.key] < r[p.key][g.key] && (s = r[p.key][g.key])) : n.linkage === "mean" ? s = (r[f.key][g.key] * f.size + r[p.key][g.key] * p.size) / (f.size + p.size) : n.mode === "dendrogram" ? s = l(g.value, f.value) : s = l(g.value[0], f.value[0]), r[f.key][g.key] = r[g.key][f.key] = s; } for (var v = 0; v < t.length; v++) { var x = t[v].key; if (i[x] === f.key || i[x] === p.key) { for (var w = x, S = 0; S < t.length; S++) { var _ = t[S].key; r[x][_] < r[x][w] && (w = _); } i[x] = w; } t[v].index = v; } return f.key = p.key = f.index = p.index = null, !0; }, Hp = function t(e, r, i) { e && (e.value ? r.push(e.value) : (e.left && t(e.left, r), e.right && t(e.right, r))); }, xH = function t(e, r) { if (!e) return ""; if (e.left && e.right) { var i = t(e.left, r), n = t(e.right, r), a = r.add({ group: "nodes", data: { id: i + "," + n } }); return r.add({ group: "edges", data: { source: i, target: a.id() } }), r.add({ group: "edges", data: { source: n, target: a.id() } }), a.id(); } else if (e.value) return e.value.id(); }, wH = function t(e, r, i) { if (!e) return []; var n = [], a = [], o = []; return r === 0 ? (e.left && Hp(e.left, n), e.right && Hp(e.right, a), o = n.concat(a), [i.collection(o)]) : r === 1 ? e.value ? [i.collection(e.value)] : (e.left && Hp(e.left, n), e.right && Hp(e.right, a), [i.collection(n), i.collection(a)]) : e.value ? [i.collection(e.value)] : (e.left && (n = t(e.left, r - 1, i)), e.right && (a = t(e.right, r - 1, i)), n.concat(a)); }, m_ = function(t) { for (var e = this.cy(), r = this.nodes(), i = bH(t), n = i.attributes, a = function(g, v) { return Ag(i.distance, n.length, function(x) { return n[x](g); }, function(x) { return n[x](v); }, g, v); }, o = [], s = [], c = [], l = [], u = 0; u < r.length; u++) { var d = { value: i.mode === "dendrogram" ? r[u] : [r[u]], key: u, index: u }; o[u] = d, l[u] = d, s[u] = [], c[u] = 0; } for (var h = 0; h < o.length; h++) for (var f = 0; f <= h; f++) { var p = void 0; i.mode === "dendrogram" ? p = h === f ? 1 / 0 : a(o[h].value, o[f].value) : p = h === f ? 1 / 0 : a(o[h].value[0], o[f].value[0]), s[h][f] = p, s[f][h] = p, p < s[h][c[h]] && (c[h] = f); } for (var m = f_(o, l, s, c, i); m; ) m = f_(o, l, s, c, i); var y; return i.mode === "dendrogram" ? (y = wH(o[0], i.dendrogramDepth, e), i.addDendrogram && xH(o[0], e)) : (y = new Array(o.length), o.forEach(function(g, v) { g.key = g.index = null, y[v] = e.collection(g.value); })), y; }, _H = { hierarchicalClustering: m_, hca: m_ }, SH = yi({ 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') ] }), MH = function(t) { var e = t.damping, r = t.preference; 0.5 <= e && e < 1 || Tr("Damping must range on [0.5, 1). Got: ".concat(e)); var i = ["median", "mean", "min", "max"]; return i.some(function(n) { return n === r; }) || Xe(r) || Tr("Preference must be one of [".concat(i.map(function(n) { return "'".concat(n, "'"); }).join(", "), "] or a number. Got: ").concat(r)), SH(t); }, EH = function(t, e, r, i) { var n = function(a, o) { return i[o](a); }; return -Ag(t, i.length, function(a) { return n(e, a); }, function(a) { return n(r, a); }, e, r); }, TH = function(t, e) { var r = null; return e === "median" ? r = Mj(t) : e === "mean" ? r = Sj(t) : e === "min" ? r = wj(t) : e === "max" ? r = _j(t) : r = e, r; }, CH = function(t, e, r) { for (var i = [], n = 0; n < t; n++) e[n * t + n] + r[n * t + n] > 0 && i.push(n); return i; }, g_ = function(t, e, r) { for (var i = [], n = 0; n < t; n++) { for (var a = -1, o = -1 / 0, s = 0; s < r.length; s++) { var c = r[s]; e[n * t + c] > o && (a = c, o = e[n * t + c]); } a > 0 && i.push(a); } for (var l = 0; l < r.length; l++) i[r[l]] = r[l]; return i; }, AH = function(t, e, r) { for (var i = g_(t, e, r), n = 0; n < r.length; n++) { for (var a = [], o = 0; o < i.length; o++) i[o] === r[n] && a.push(o); for (var s = -1, c = -1 / 0, l = 0; l < a.length; l++) { for (var u = 0, d = 0; d < a.length; d++) u += e[a[d] * t + a[l]]; u > c && (s = l, c = u); } r[n] = a[s]; } return i = g_(t, e, r), i; }, v_ = function(t) { for (var e = this.cy(), r = this.nodes(), i = MH(t), n = {}, a = 0; a < r.length; a++) n[r[a].id()] = a; var o, s, c, l, u, d; o = r.length, s = o * o, c = new Array(s); for (var h = 0; h < s; h++) c[h] = -1 / 0; for (var f = 0; f < o; f++) for (var p = 0; p < o; p++) f !== p && (c[f * o + p] = EH(i.distance, r[f], r[p], i.attributes)); l = TH(c, i.preference); for (var m = 0; m < o; m++) c[m * o + m] = l; u = new Array(s); for (var y = 0; y < s; y++) u[y] = 0; d = new Array(s); for (var g = 0; g < s; g++) d[g] = 0; for (var v = new Array(o), x = new Array(o), w = new Array(o), S = 0; S < o; S++) v[S] = 0, x[S] = 0, w[S] = 0; for (var _ = new Array(o * i.minIterations), b = 0; b < _.length; b++) _[b] = 0; var T; for (T = 0; T < i.maxIterations; T++) { for (var E = 0; E < o; E++) { for (var C = -1 / 0, L = -1 / 0, A = -1, k = 0, P = 0; P < o; P++) v[P] = u[E * o + P], k = d[E * o + P] + c[E * o + P], k >= C ? (L = C, C = k, A = P) : k > L && (L = k); for (var R = 0; R < o; R++) u[E * o + R] = (1 - i.damping) * (c[E * o + R] - C) + i.damping * v[R]; u[E * o + A] = (1 - i.damping) * (c[E * o + A] - L) + i.damping * v[A]; } for (var M = 0; M < o; M++) { for (var O = 0, D = 0; D < o; D++) v[D] = d[D * o + M], x[D] = Math.max(0, u[D * o + M]), O += x[D]; O -= x[M], x[M] = u[M * o + M], O += x[M]; for (var I = 0; I < o; I++) d[I * o + M] = (1 - i.damping) * Math.min(0, O - x[I]) + i.damping * v[I]; d[M * o + M] = (1 - i.damping) * (O - x[M]) + i.damping * v[M]; } for (var F = 0, z = 0; z < o; z++) { var U = d[z * o + z] + u[z * o + z] > 0 ? 1 : 0; _[T % i.minIterations * o + z] = U, F += U; } if (F > 0 && (T >= i.minIterations - 1 || T == i.maxIterations - 1)) { for (var Z = 0, re = 0; re < o; re++) { w[re] = 0; for (var K = 0; K < i.minIterations; K++) w[re] += _[K * o + re]; (w[re] === 0 || w[re] === i.minIterations) && Z++; } if (Z === o) break; } } for (var V = CH(o, u, d), H = AH(o, c, V), G = {}, W = 0; W < V.length; W++) G[V[W]] = []; for (var Y = 0; Y < r.length; Y++) { var X = n[r[Y].id()], ie = H[X]; ie != null && G[ie].push(r[Y]); } for (var ue = new Array(V.length), $ = 0; $ < V.length; $++) ue[$] = e.collection(G[V[$]]); return ue; }, LH = { affinityPropagation: v_, ap: v_ }, kH = yi({ root: void 0, directed: !1 }), PH = { hierholzer: function(t) { if (!Gt(t)) { var e = arguments; t = { root: e[0], directed: e[1] }; } var r = kH(t), i = r.root, n = r.directed, a = this, o = !1, s, c, l; i && (l = dt(i) ? this.filter(i)[0].id() : i[0].id()); var u = {}, d = {}; n ? a.forEach(function(g) { var v = g.id(); if (g.isNode()) { var x = g.indegree(!0), w = g.outdegree(!0), S = x - w, _ = w - x; S == 1 ? s ? o = !0 : s = v : _ == 1 ? c ? o = !0 : c = v : (_ > 1 || S > 1) && (o = !0), u[v] = [], g.outgoers().forEach(function(b) { b.isEdge() && u[v].push(b.id()); }); } else d[v] = [void 0, g.target().id()]; }) : a.forEach(function(g) { var v = g.id(); if (g.isNode()) { var x = g.degree(!0); x % 2 && (s ? c ? o = !0 : c = v : s = v), u[v] = [], g.connectedEdges().forEach(function(w) { return u[v].push(w.id()); }); } else d[v] = [g.source().id(), g.target().id()]; }); var h = { found: !1, trail: void 0 }; if (o) return h; if (c && s) if (n) { if (l && c != l) return h; l = c; } else { if (l && c != l && s != l) return h; l || (l = c); } else l || (l = a[0].id()); var f = function(g) { for (var v = g, x = [g], w, S, _; u[v].length; ) w = u[v].shift(), S = d[w][0], _ = d[w][1], v != _ ? (u[_] = u[_].filter(function(b) { return b != w; }), v = _) : !n && v != S && (u[S] = u[S].filter(function(b) { return b != w; }), v = S), x.unshift(w), x.unshift(v); return x; }, p = [], m = []; for (m = f(l); m.length != 1; ) u[m[0]].length == 0 ? (p.unshift(a.getElementById(m.shift())), p.unshift(a.getElementById(m.shift()))) : m = f(m.shift()).concat(m); p.unshift(a.getElementById(m.shift())); for (var y in u) if (u[y].length) return h; return h.found = !0, h.trail = this.spawn(p, !0), h; } }, Gp = function() { var t = this, e = {}, r = 0, i = 0, n = [], a = [], o = {}, s = function(u, d) { for (var h = a.length - 1, f = [], p = t.spawn(); a[h].x != u || a[h].y != d; ) f.push(a.pop().edge), h--; f.push(a.pop().edge), f.forEach(function(m) { var y = m.connectedNodes().intersection(t); p.merge(m), y.forEach(function(g) { var v = g.id(), x = g.connectedEdges().intersection(t); p.merge(g), e[v].cutVertex ? p.merge(x.filter(function(w) { return w.isLoop(); })) : p.merge(x); }); }), n.push(p); }, c = function u(d, h, f) { d === f && (i += 1), e[h] = { id: r, low: r++, cutVertex: !1 }; var p = t.getElementById(h).connectedEdges().intersection(t); if (p.size() === 0) n.push(t.spawn(t.getElementById(h))); else { var m, y, g, v; p.forEach(function(x) { m = x.source().id(), y = x.target().id(), g = m === h ? y : m, g !== f && (v = x.id(), o[v] || (o[v] = !0, a.push({ x: h, y: g, edge: x })), g in e ? e[h].low = Math.min(e[h].low, e[g].id) : (u(d, g, h), e[h].low = Math.min(e[h].low, e[g].low), e[h].id <= e[g].low && (e[h].cutVertex = !0, s(h, g)))); }); } }; t.forEach(function(u) { if (u.isNode()) { var d = u.id(); d in e || (i = 0, c(d, d), e[d].cutVertex = i > 1); } }); var l = Object.keys(e).filter(function(u) { return e[u].cutVertex; }).map(function(u) { return t.getElementById(u); }); return { cut: t.spawn(l), components: n }; }, RH = { hopcroftTarjanBiconnected: Gp, htbc: Gp, htb: Gp, hopcroftTarjanBiconnectedComponents: Gp }, Wp = function() { var t = this, e = {}, r = 0, i = [], n = [], a = t.spawn(t), o = function s(c) { n.push(c), e[c] = { index: r, low: r++, explored: !1 }; var l = t.getElementById(c).connectedEdges().intersection(t); if (l.forEach(function(p) { var m = p.target().id(); m !== c && (m in e || s(m), e[m].explored || (e[c].low = Math.min(e[c].low, e[m].low))); }), e[c].index === e[c].low) { for (var u = t.spawn(); ; ) { var d = n.pop(); if (u.merge(t.getElementById(d)), e[d].low = e[c].index, e[d].explored = !0, d === c) break; } var h = u.edgesWith(u), f = u.merge(h); i.push(f), a = a.difference(f); } }; return t.forEach(function(s) { if (s.isNode()) { var c = s.id(); c in e || o(c); } }), { cut: a, components: i }; }, OH = { tarjanStronglyConnected: Wp, tsc: Wp, tscc: Wp, tarjanStronglyConnectedComponents: Wp }, jA = {}; [vh, cj, uj, hj, fj, gj, bj, Hj, Vc, Uc, Ey, iH, gH, _H, LH, PH, RH, OH].forEach(function(t) { bt(jA, t); }); /*! Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) Licensed under The MIT License (http://opensource.org/licenses/MIT) */ var HA = 0, GA = 1, WA = 2, no = function t(e) { if (!(this instanceof t)) return new t(e); this.id = "Thenable/1.0.7", this.state = HA, 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)); }; no.prototype = { /* promise resolving methods */ fulfill: function(t) { return y_(this, GA, "fulfillValue", t); }, reject: function(t) { return y_(this, WA, "rejectReason", t); }, /* "The then Method" [Promises/A+ 1.1, 1.2, 2.2] */ then: function(t, e) { var r = this, i = new no(); return r.onFulfilled.push(x_(t, i, "fulfill")), r.onRejected.push(x_(e, i, "reject")), qA(r), i.proxy; } }; var y_ = function(t, e, r, i) { return t.state === HA && (t.state = e, t[r] = i, qA(t)), t; }, qA = function(t) { t.state === GA ? b_(t, "onFulfilled", t.fulfillValue) : t.state === WA && b_(t, "onRejected", t.rejectReason); }, b_ = function(t, e, r) { if (t[e].length !== 0) { var i = t[e]; t[e] = []; var n = function() { for (var a = 0; a < i.length; a++) i[a](r); }; typeof setImmediate == "function" ? setImmediate(n) : setTimeout(n, 0); } }, x_ = function(t, e, r) { return function(i) { if (typeof t != "function") e[r].call(e, i); else { var n; try { n = t(i); } catch (a) { e.reject(a); return; } DH(e, n); } }; }, DH = function t(e, r) { if (e === r || e.proxy === r) { e.reject(new TypeError("cannot resolve promise with itself")); return; } var i; if (Zr(r) === "object" && r !== null || typeof r == "function") try { i = r.then; } catch (a) { e.reject(a); return; } if (typeof i == "function") { var n = !1; try { i.call( r, /* resolvePromise */ /* [Promises/A+ 2.3.3.3.1] */ function(a) { n || (n = !0, a === r ? e.reject(new TypeError("circular thenable chain")) : t(e, a)); }, /* rejectPromise */ /* [Promises/A+ 2.3.3.3.2] */ function(a) { n || (n = !0, e.reject(a)); } ); } catch (a) { n || e.reject(a); } return; } e.fulfill(r); }; no.all = function(t) { return new no(function(e, r) { for (var i = new Array(t.length), n = 0, a = function(s, c) { i[s] = c, n++, n === t.length && e(i); }, o = 0; o < t.length; o++) (function(s) { var c = t[s], l = c != null && c.then != null; if (l) c.then(function(d) { a(s, d); }, function(d) { r(d); }); else { var u = c; a(s, u); } })(o); }); }; no.resolve = function(t) { return new no(function(e, r) { e(t); }); }; no.reject = function(t) { return new no(function(e, r) { r(t); }); }; var Bu = typeof Promise < "u" ? Promise : no, Ty = function(t, e, r) { var i = Ab(t), n = !i, a = this._private = bt({ duration: 1e3 }, e, r); if (a.target = t, a.style = a.style || a.css, a.started = !1, a.playing = !1, a.hooked = !1, a.applying = !1, a.progress = 0, a.completes = [], a.frames = [], a.complete && xr(a.complete) && a.completes.push(a.complete), n) { var o = t.position(); a.startPosition = a.startPosition || { x: o.x, y: o.y }, a.startStyle = a.startStyle || t.cy().style().getAnimationStartStyle(t, a.style); } if (i) { var s = t.pan(); a.startPan = { x: s.x, y: s.y }, a.startZoom = t.zoom(); } this.length = 1, this[0] = this; }, Ml = Ty.prototype; bt(Ml, { instanceString: function() { return "animation"; }, hook: function() { var t = this._private; if (!t.hooked) { var e, r = t.target._private.animation; t.queue ? e = r.queue : e = r.current, e.push(this), on(t.target) && t.target.cy().addToAnimationPool(t.target), t.hooked = !0; } return this; }, play: function() { var t = this._private; return t.progress === 1 && (t.progress = 0), t.playing = !0, t.started = !1, t.stopped = !1, this.hook(), this; }, playing: function() { return this._private.playing; }, apply: function() { var t = this._private; return t.applying = !0, t.started = !1, t.stopped = !1, this.hook(), this; }, applying: function() { return this._private.applying; }, pause: function() { var t = this._private; return t.playing = !1, t.started = !1, this; }, stop: function() { var t = this._private; return t.playing = !1, t.started = !1, t.stopped = !0, this; }, rewind: function() { return this.progress(0); }, fastforward: function() { return this.progress(1); }, time: function(t) { var e = this._private; return t === void 0 ? e.progress * e.duration : this.progress(t / e.duration); }, progress: function(t) { var e = this._private, r = e.playing; return t === void 0 ? e.progress : (r && this.pause(), e.progress = t, e.started = !1, r && this.play(), this); }, completed: function() { return this._private.progress === 1; }, reverse: function() { var t = this._private, e = t.playing; e && this.pause(), t.progress = 1 - t.progress, t.started = !1; var r = function(s, c) { var l = t[s]; l != null && (t[s] = t[c], t[c] = l); }; if (r("zoom", "startZoom"), r("pan", "startPan"), r("position", "startPosition"), t.style) for (var i = 0; i < t.style.length; i++) { var n = t.style[i], a = n.name, o = t.startStyle[a]; t.startStyle[a] = n, t.style[i] = o; } return e && this.play(), this; }, promise: function(t) { var e = this._private, r; switch (t) { case "frame": r = e.frames; break; default: case "complete": case "completed": r = e.completes; } return new Bu(function(i, n) { r.push(function() { i(); }); }); } }); Ml.complete = Ml.completed; Ml.run = Ml.play; Ml.running = Ml.playing; var IH = { animated: function() { return function() { var t = this, e = t.length !== void 0, r = e ? t : [t], i = this._private.cy || this; if (!i.styleEnabled()) return !1; var n = r[0]; if (n) return n._private.animation.current.length > 0; }; }, // animated clearQueue: function() { return function() { var t = this, e = t.length !== void 0, r = e ? t : [t], i = this._private.cy || this; if (!i.styleEnabled()) return this; for (var n = 0; n < r.length; n++) { var a = r[n]; a._private.animation.queue = []; } return this; }; }, // clearQueue delay: function() { return function(t, e) { var r = this._private.cy || this; return r.styleEnabled() ? this.animate({ delay: t, duration: t, complete: e }) : this; }; }, // delay delayAnimation: function() { return function(t, e) { var r = this._private.cy || this; return r.styleEnabled() ? this.animation({ delay: t, duration: t, complete: e }) : this; }; }, // delay animation: function() { return function(t, e) { var r = this, i = r.length !== void 0, n = i ? r : [r], a = this._private.cy || this, o = !i, s = !o; if (!a.styleEnabled()) return this; var c = a.style(); t = bt({}, t, e); var l = Object.keys(t).length === 0; if (l) return new Ty(n[0], t); switch (t.duration === void 0 && (t.duration = 400), t.duration) { case "slow": t.duration = 600; break; case "fast": t.duration = 200; break; } if (s && (t.style = c.getPropsList(t.style || t.css), t.css = void 0), s && t.renderedPosition != null) { var u = t.renderedPosition, d = a.pan(), h = a.zoom(); t.position = RA(u, h, d); } if (o && t.panBy != null) { var f = t.panBy, p = a.pan(); t.pan = { x: p.x + f.x, y: p.y + f.y }; } var m = t.center || t.centre; if (o && m != null) { var y = a.getCenterPan(m.eles, t.zoom); y != null && (t.pan = y); } if (o && t.fit != null) { var g = t.fit, v = a.getFitViewport(g.eles || g.boundingBox, g.padding); v != null && (t.pan = v.pan, t.zoom = v.zoom); } if (o && Gt(t.zoom)) { var x = a.getZoomedViewport(t.zoom); x != null ? (x.zoomed && (t.zoom = x.zoom), x.panned && (t.pan = x.pan)) : t.zoom = null; } return new Ty(n[0], t); }; }, // animate animate: function() { return function(t, e) { var r = this, i = r.length !== void 0, n = i ? r : [r], a = this._private.cy || this; if (!a.styleEnabled()) return this; e && (t = bt({}, t, e)); for (var o = 0; o < n.length; o++) { var s = n[o], c = s.animated() && (t.queue === void 0 || t.queue), l = s.animation(t, c ? { queue: !0 } : void 0); l.play(); } return this; }; }, // animate stop: function() { return function(t, e) { var r = this, i = r.length !== void 0, n = i ? r : [r], a = this._private.cy || this; if (!a.styleEnabled()) return this; for (var o = 0; o < n.length; o++) { for (var s = n[o], c = s._private, l = c.animation.current, u = 0; u < l.length; u++) { var d = l[u], h = d._private; e && (h.duration = 0); } t && (c.animation.queue = []), e || (c.animation.current = []); } return a.notify("draw"), this; }; } // stop }, NH = Array.isArray, Lg = NH, BH = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, FH = /^\w*$/; function zH(t, e) { if (Lg(t)) return !1; var r = typeof t; return r == "number" || r == "symbol" || r == "boolean" || t == null || ip(t) ? !0 : FH.test(t) || !BH.test(t) || e != null && t in Object(e); } var $H = zH, VH = "[object AsyncFunction]", UH = "[object Function]", jH = "[object GeneratorFunction]", HH = "[object Proxy]"; function GH(t) { if (!xl(t)) return !1; var e = MA(t); return e == UH || e == jH || e == VH || e == HH; } var WH = GH, qH = Mg["__core-js_shared__"], Gv = qH, w_ = function() { var t = /[^.]+$/.exec(Gv && Gv.keys && Gv.keys.IE_PROTO || ""); return t ? "Symbol(src)_1." + t : ""; }(); function XH(t) { return !!w_ && w_ in t; } var ZH = XH, YH = Function.prototype, KH = YH.toString; function JH(t) { if (t != null) { try { return KH.call(t); } catch { } try { return t + ""; } catch { } } return ""; } var QH = JH, eG = /[\\^$.*+?()[\]{}|]/g, tG = /^\[object .+?Constructor\]$/, rG = Function.prototype, iG = Object.prototype, nG = rG.toString, aG = iG.hasOwnProperty, oG = RegExp( "^" + nG.call(aG).replace(eG, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); function sG(t) { if (!xl(t) || ZH(t)) return !1; var e = WH(t) ? oG : tG; return e.test(QH(t)); } var lG = sG; function cG(t, e) { return t == null ? void 0 : t[e]; } var uG = cG; function dG(t, e) { var r = uG(t, e); return lG(r) ? r : void 0; } var Bb = dG, hG = Bb(Object, "create"), xh = hG; function pG() { this.__data__ = xh ? xh(null) : {}, this.size = 0; } var fG = pG; function mG(t) { var e = this.has(t) && delete this.__data__[t]; return this.size -= e ? 1 : 0, e; } var gG = mG, vG = "__lodash_hash_undefined__", yG = Object.prototype, bG = yG.hasOwnProperty; function xG(t) { var e = this.__data__; if (xh) { var r = e[t]; return r === vG ? void 0 : r; } return bG.call(e, t) ? e[t] : void 0; } var wG = xG, _G = Object.prototype, SG = _G.hasOwnProperty; function MG(t) { var e = this.__data__; return xh ? e[t] !== void 0 : SG.call(e, t); } var EG = MG, TG = "__lodash_hash_undefined__"; function CG(t, e) { var r = this.__data__; return this.size += this.has(t) ? 0 : 1, r[t] = xh && e === void 0 ? TG : e, this; } var AG = CG; function Fu(t) { var e = -1, r = t == null ? 0 : t.length; for (this.clear(); ++e < r; ) { var i = t[e]; this.set(i[0], i[1]); } } Fu.prototype.clear = fG; Fu.prototype.delete = gG; Fu.prototype.get = wG; Fu.prototype.has = EG; Fu.prototype.set = AG; var __ = Fu; function LG() { this.__data__ = [], this.size = 0; } var kG = LG; function PG(t, e) { return t === e || t !== t && e !== e; } var XA = PG; function RG(t, e) { for (var r = t.length; r--; ) if (XA(t[r][0], e)) return r; return -1; } var kg = RG, OG = Array.prototype, DG = OG.splice; function IG(t) { var e = this.__data__, r = kg(e, t); if (r < 0) return !1; var i = e.length - 1; return r == i ? e.pop() : DG.call(e, r, 1), --this.size, !0; } var NG = IG; function BG(t) { var e = this.__data__, r = kg(e, t); return r < 0 ? void 0 : e[r][1]; } var FG = BG; function zG(t) { return kg(this.__data__, t) > -1; } var $G = zG; function VG(t, e) { var r = this.__data__, i = kg(r, t); return i < 0 ? (++this.size, r.push([t, e])) : r[i][1] = e, this; } var UG = VG; function zu(t) { var e = -1, r = t == null ? 0 : t.length; for (this.clear(); ++e < r; ) { var i = t[e]; this.set(i[0], i[1]); } } zu.prototype.clear = kG; zu.prototype.delete = NG; zu.prototype.get = FG; zu.prototype.has = $G; zu.prototype.set = UG; var jG = zu, HG = Bb(Mg, "Map"), GG = HG; function WG() { this.size = 0, this.__data__ = { hash: new __(), map: new (GG || jG)(), string: new __() }; } var qG = WG; function XG(t) { var e = typeof t; return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null; } var ZG = XG; function YG(t, e) { var r = t.__data__; return ZG(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map; } var Pg = YG; function KG(t) { var e = Pg(this, t).delete(t); return this.size -= e ? 1 : 0, e; } var JG = KG; function QG(t) { return Pg(this, t).get(t); } var e9 = QG; function t9(t) { return Pg(this, t).has(t); } var r9 = t9; function i9(t, e) { var r = Pg(this, t), i = r.size; return r.set(t, e), this.size += r.size == i ? 0 : 1, this; } var n9 = i9; function $u(t) { var e = -1, r = t == null ? 0 : t.length; for (this.clear(); ++e < r; ) { var i = t[e]; this.set(i[0], i[1]); } } $u.prototype.clear = qG; $u.prototype.delete = JG; $u.prototype.get = e9; $u.prototype.has = r9; $u.prototype.set = n9; var ZA = $u, a9 = "Expected a function"; function Fb(t, e) { if (typeof t != "function" || e != null && typeof e != "function") throw new TypeError(a9); var r = function() { var i = arguments, n = e ? e.apply(this, i) : i[0], a = r.cache; if (a.has(n)) return a.get(n); var o = t.apply(this, i); return r.cache = a.set(n, o) || a, o; }; return r.cache = new (Fb.Cache || ZA)(), r; } Fb.Cache = ZA; var o9 = Fb, s9 = 500; function l9(t) { var e = o9(t, function(i) { return r.size === s9 && r.clear(), i; }), r = e.cache; return e; } var c9 = l9, u9 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, d9 = /\\(\\)?/g, h9 = c9(function(t) { var e = []; return t.charCodeAt(0) === 46 && e.push(""), t.replace(u9, function(r, i, n, a) { e.push(n ? a.replace(d9, "$1") : i || r); }), e; }), YA = h9; function p9(t, e) { for (var r = -1, i = t == null ? 0 : t.length, n = Array(i); ++r < i; ) n[r] = e(t[r], r, t); return n; } var KA = p9, f9 = 1 / 0, S_ = ru ? ru.prototype : void 0, M_ = S_ ? S_.toString : void 0; function JA(t) { if (typeof t == "string") return t; if (Lg(t)) return KA(t, JA) + ""; if (ip(t)) return M_ ? M_.call(t) : ""; var e = t + ""; return e == "0" && 1 / t == -f9 ? "-0" : e; } var m9 = JA; function g9(t) { return t == null ? "" : m9(t); } var QA = g9; function v9(t, e) { return Lg(t) ? t : $H(t, e) ? [t] : YA(QA(t)); } var e3 = v9, y9 = 1 / 0; function b9(t) { if (typeof t == "string" || ip(t)) return t; var e = t + ""; return e == "0" && 1 / t == -y9 ? "-0" : e; } var zb = b9; function x9(t, e) { e = e3(e, t); for (var r = 0, i = e.length; t != null && r < i; ) t = t[zb(e[r++])]; return r && r == i ? t : void 0; } var w9 = x9; function _9(t, e, r) { var i = t == null ? void 0 : w9(t, e); return i === void 0 ? r : i; } var S9 = _9, M9 = function() { try { var t = Bb(Object, "defineProperty"); return t({}, "", {}), t; } catch { } }(), E_ = M9; function E9(t, e, r) { e == "__proto__" && E_ ? E_(t, e, { configurable: !0, enumerable: !0, value: r, writable: !0 }) : t[e] = r; } var T9 = E9, C9 = Object.prototype, A9 = C9.hasOwnProperty; function L9(t, e, r) { var i = t[e]; (!(A9.call(t, e) && XA(i, r)) || r === void 0 && !(e in t)) && T9(t, e, r); } var k9 = L9, P9 = 9007199254740991, R9 = /^(?:0|[1-9]\d*)$/; function O9(t, e) { var r = typeof t; return e = e ?? P9, !!e && (r == "number" || r != "symbol" && R9.test(t)) && t > -1 && t % 1 == 0 && t < e; } var D9 = O9; function I9(t, e, r, i) { if (!xl(t)) return t; e = e3(e, t); for (var n = -1, a = e.length, o = a - 1, s = t; s != null && ++n < a; ) { var c = zb(e[n]), l = r; if (c === "__proto__" || c === "constructor" || c === "prototype") return t; if (n != o) { var u = s[c]; l = i ? i(u, c, s) : void 0, l === void 0 && (l = xl(u) ? u : D9(e[n + 1]) ? [] : {}); } k9(s, c, l), s = s[c]; } return t; } var N9 = I9; function B9(t, e, r) { return t == null ? t : N9(t, e, r); } var F9 = B9; function z9(t, e) { var r = -1, i = t.length; for (e || (e = Array(i)); ++r < i; ) e[r] = t[r]; return e; } var $9 = z9; function V9(t) { return Lg(t) ? KA(t, zb) : ip(t) ? [t] : $9(YA(QA(t))); } var U9 = V9, j9 = { // access data field data: function(t) { var e = { field: "data", bindingEvent: "data", allowBinding: !1, allowSetting: !1, allowGetting: !1, settingEvent: "data", settingTriggersEvent: !1, triggerFnName: "trigger", immutableKeys: {}, // key => true if immutable updateStyle: !1, beforeGet: function(r) { }, beforeSet: function(r, i) { }, onSet: function(r) { }, canSet: function(r) { return !0; } }; return t = bt({}, e, t), function(r, i) { var n = t, a = this, o = a.length !== void 0, s = o ? a : [a], c = o ? a[0] : a; if (dt(r)) { var l = r.indexOf(".") !== -1, u = l && U9(r); if (n.allowGetting && i === void 0) { var d; return c && (n.beforeGet(c), u && c._private[n.field][r] === void 0 ? d = S9(c._private[n.field], u) : d = c._private[n.field][r]), d; } else if (n.allowSetting && i !== void 0) { var h = !n.immutableKeys[r]; if (h) { var f = pA({}, r, i); n.beforeSet(a, f); for (var p = 0, m = s.length; p < m; p++) { var y = s[p]; n.canSet(y) && (u && c._private[n.field][r] === void 0 ? F9(y._private[n.field], u, i) : y._private[n.field][r] = i); } n.updateStyle && a.updateStyle(), n.onSet(a), n.settingTriggersEvent && a[n.triggerFnName](n.settingEvent); } } } else if (n.allowSetting && Gt(r)) { var g = r, v, x, w = Object.keys(g); n.beforeSet(a, g); for (var S = 0; S < w.length; S++) { v = w[S], x = g[v]; var _ = !n.immutableKeys[v]; if (_) for (var b = 0; b < s.length; b++) { var T = s[b]; n.canSet(T) && (T._private[n.field][v] = x); } } n.updateStyle && a.updateStyle(), n.onSet(a), n.settingTriggersEvent && a[n.triggerFnName](n.settingEvent); } else if (n.allowBinding && xr(r)) { var E = r; a.on(n.bindingEvent, E); } else if (n.allowGetting && r === void 0) { var C; return c && (n.beforeGet(c), C = c._private[n.field]), C; } return a; }; }, // data // remove data field removeData: function(t) { var e = { field: "data", event: "data", triggerFnName: "trigger", triggerEvent: !1, immutableKeys: {} // key => true if immutable }; return t = bt({}, e, t), function(r) { var i = t, n = this, a = n.length !== void 0, o = a ? n : [n]; if (dt(r)) { for (var s = r.split(/\s+/), c = s.length, l = 0; l < c; l++) { var u = s[l]; if (!ds(u)) { var d = !i.immutableKeys[u]; if (d) for (var h = 0, f = o.length; h < f; h++) o[h]._private[i.field][u] = void 0; } } i.triggerEvent && n[i.triggerFnName](i.event); } else if (r === void 0) { for (var p = 0, m = o.length; p < m; p++) for (var y = o[p]._private[i.field], g = Object.keys(y), v = 0; v < g.length; v++) { var x = g[v], w = !i.immutableKeys[x]; w && (y[x] = void 0); } i.triggerEvent && n[i.triggerFnName](i.event); } return n; }; } // removeData }, H9 = { eventAliasesOn: function(t) { var e = t; e.addListener = e.listen = e.bind = e.on, e.unlisten = e.unbind = e.off = e.removeListener, e.trigger = e.emit, e.pon = e.promiseOn = function(r, i) { var n = this, a = Array.prototype.slice.call(arguments, 0); return new Bu(function(o, s) { var c = function(d) { n.off.apply(n, u), o(d); }, l = a.concat([c]), u = l.concat([]); n.on.apply(n, l); }); }; } }, Xt = {}; [IH, j9, H9].forEach(function(t) { bt(Xt, t); }); var G9 = { animate: Xt.animate(), animation: Xt.animation(), animated: Xt.animated(), clearQueue: Xt.clearQueue(), delay: Xt.delay(), delayAnimation: Xt.delayAnimation(), stop: Xt.stop() }, cm = { classes: function(t) { var e = this; if (t === void 0) { var r = []; return e[0]._private.classes.forEach(function(f) { return r.push(f); }), r; } else ar(t) || (t = (t || "").match(/\S+/g) || []); for (var i = [], n = new Nu(t), a = 0; a < e.length; a++) { for (var o = e[a], s = o._private, c = s.classes, l = !1, u = 0; u < t.length; u++) { var d = t[u], h = c.has(d); if (!h) { l = !0; break; } } l || (l = c.size !== t.length), l && (s.classes = n, i.push(o)); } return i.length > 0 && this.spawn(i).updateStyle().emit("class"), e; }, addClass: function(t) { return this.toggleClass(t, !0); }, hasClass: function(t) { var e = this[0]; return e != null && e._private.classes.has(t); }, toggleClass: function(t, e) { ar(t) || (t = t.match(/\S+/g) || []); for (var r = this, i = e === void 0, n = [], a = 0, o = r.length; a < o; a++) for (var s = r[a], c = s._private.classes, l = !1, u = 0; u < t.length; u++) { var d = t[u], h = c.has(d), f = !1; e || i && !h ? (c.add(d), f = !0) : (!e || i && h) && (c.delete(d), f = !0), !l && f && (n.push(s), l = !0); } return n.length > 0 && this.spawn(n).updateStyle().emit("class"), r; }, removeClass: function(t) { return this.toggleClass(t, !1); }, flashClass: function(t, e) { var r = this; if (e == null) e = 250; else if (e === 0) return r; return r.addClass(t), setTimeout(function() { r.removeClass(t); }, e), r; } }; cm.className = cm.classNames = cm.classes; var Ut = { 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: qr, // 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+" }; Ut.variable = "(?:[\\w-.]|(?:\\\\" + Ut.metaChar + "))+"; Ut.className = "(?:[\\w-]|(?:\\\\" + Ut.metaChar + "))+"; Ut.value = Ut.string + "|" + Ut.number; Ut.id = Ut.variable; (function() { var t, e, r; for (t = Ut.comparatorOp.split("|"), r = 0; r < t.length; r++) e = t[r], Ut.comparatorOp += "|@" + e; for (t = Ut.comparatorOp.split("|"), r = 0; r < t.length; r++) e = t[r], !(e.indexOf("!") >= 0) && e !== "=" && (Ut.comparatorOp += "|\\!" + e); })(); var rr = function() { return { checks: [] }; }, rt = { /** 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 }, Cy = [{ selector: ":selected", matches: function(t) { return t.selected(); } }, { selector: ":unselected", matches: function(t) { return !t.selected(); } }, { selector: ":selectable", matches: function(t) { return t.selectable(); } }, { selector: ":unselectable", matches: function(t) { return !t.selectable(); } }, { selector: ":locked", matches: function(t) { return t.locked(); } }, { selector: ":unlocked", matches: function(t) { return !t.locked(); } }, { selector: ":visible", matches: function(t) { return t.visible(); } }, { selector: ":hidden", matches: function(t) { return !t.visible(); } }, { selector: ":transparent", matches: function(t) { return t.transparent(); } }, { selector: ":grabbed", matches: function(t) { return t.grabbed(); } }, { selector: ":free", matches: function(t) { return !t.grabbed(); } }, { selector: ":removed", matches: function(t) { return t.removed(); } }, { selector: ":inside", matches: function(t) { return !t.removed(); } }, { selector: ":grabbable", matches: function(t) { return t.grabbable(); } }, { selector: ":ungrabbable", matches: function(t) { return !t.grabbable(); } }, { selector: ":animated", matches: function(t) { return t.animated(); } }, { selector: ":unanimated", matches: function(t) { return !t.animated(); } }, { selector: ":parent", matches: function(t) { return t.isParent(); } }, { selector: ":childless", matches: function(t) { return t.isChildless(); } }, { selector: ":child", matches: function(t) { return t.isChild(); } }, { selector: ":orphan", matches: function(t) { return t.isOrphan(); } }, { selector: ":nonorphan", matches: function(t) { return t.isChild(); } }, { selector: ":compound", matches: function(t) { return t.isNode() ? t.isParent() : t.source().isParent() || t.target().isParent(); } }, { selector: ":loop", matches: function(t) { return t.isLoop(); } }, { selector: ":simple", matches: function(t) { return t.isSimple(); } }, { selector: ":active", matches: function(t) { return t.active(); } }, { selector: ":inactive", matches: function(t) { return !t.active(); } }, { selector: ":backgrounding", matches: function(t) { return t.backgrounding(); } }, { selector: ":nonbackgrounding", matches: function(t) { return !t.backgrounding(); } }].sort(function(t, e) { return tU(t.selector, e.selector); }), W9 = function() { for (var t = {}, e, r = 0; r < Cy.length; r++) e = Cy[r], t[e.selector] = e.matches; return t; }(), q9 = function(t, e) { return W9[t](e); }, X9 = "(" + Cy.map(function(t) { return t.selector; }).join("|") + ")", ec = function(t) { return t.replace(new RegExp("\\\\(" + Ut.metaChar + ")", "g"), function(e, r) { return r; }); }, Ao = function(t, e, r) { t[t.length - 1] = r; }, Ay = [{ name: "group", // just used for identifying when debugging query: !0, regex: "(" + Ut.group + ")", populate: function(t, e, r) { var i = Fn(r, 1), n = i[0]; e.checks.push({ type: rt.GROUP, value: n === "*" ? n : n + "s" }); } }, { name: "state", query: !0, regex: X9, populate: function(t, e, r) { var i = Fn(r, 1), n = i[0]; e.checks.push({ type: rt.STATE, value: n }); } }, { name: "id", query: !0, regex: "\\#(" + Ut.id + ")", populate: function(t, e, r) { var i = Fn(r, 1), n = i[0]; e.checks.push({ type: rt.ID, value: ec(n) }); } }, { name: "className", query: !0, regex: "\\.(" + Ut.className + ")", populate: function(t, e, r) { var i = Fn(r, 1), n = i[0]; e.checks.push({ type: rt.CLASS, value: ec(n) }); } }, { name: "dataExists", query: !0, regex: "\\[\\s*(" + Ut.variable + ")\\s*\\]", populate: function(t, e, r) { var i = Fn(r, 1), n = i[0]; e.checks.push({ type: rt.DATA_EXIST, field: ec(n) }); } }, { name: "dataCompare", query: !0, regex: "\\[\\s*(" + Ut.variable + ")\\s*(" + Ut.comparatorOp + ")\\s*(" + Ut.value + ")\\s*\\]", populate: function(t, e, r) { var i = Fn(r, 3), n = i[0], a = i[1], o = i[2], s = new RegExp("^" + Ut.string + "$").exec(o) != null; s ? o = o.substring(1, o.length - 1) : o = parseFloat(o), e.checks.push({ type: rt.DATA_COMPARE, field: ec(n), operator: a, value: o }); } }, { name: "dataBool", query: !0, regex: "\\[\\s*(" + Ut.boolOp + ")\\s*(" + Ut.variable + ")\\s*\\]", populate: function(t, e, r) { var i = Fn(r, 2), n = i[0], a = i[1]; e.checks.push({ type: rt.DATA_BOOL, field: ec(a), operator: n }); } }, { name: "metaCompare", query: !0, regex: "\\[\\[\\s*(" + Ut.meta + ")\\s*(" + Ut.comparatorOp + ")\\s*(" + Ut.number + ")\\s*\\]\\]", populate: function(t, e, r) { var i = Fn(r, 3), n = i[0], a = i[1], o = i[2]; e.checks.push({ type: rt.META_COMPARE, field: ec(n), operator: a, value: parseFloat(o) }); } }, { name: "nextQuery", separator: !0, regex: Ut.separator, populate: function(t, e) { var r = t.currentSubject, i = t.edgeCount, n = t.compoundCount, a = t[t.length - 1]; r != null && (a.subject = r, t.currentSubject = null), a.edgeCount = i, a.compoundCount = n, t.edgeCount = 0, t.compoundCount = 0; var o = t[t.length++] = rr(); return o; } }, { name: "directedEdge", separator: !0, regex: Ut.directedEdge, populate: function(t, e) { if (t.currentSubject == null) { var r = rr(), i = e, n = rr(); return r.checks.push({ type: rt.DIRECTED_EDGE, source: i, target: n }), Ao(t, e, r), t.edgeCount++, n; } else { var a = rr(), o = e, s = rr(); return a.checks.push({ type: rt.NODE_SOURCE, source: o, target: s }), Ao(t, e, a), t.edgeCount++, s; } } }, { name: "undirectedEdge", separator: !0, regex: Ut.undirectedEdge, populate: function(t, e) { if (t.currentSubject == null) { var r = rr(), i = e, n = rr(); return r.checks.push({ type: rt.UNDIRECTED_EDGE, nodes: [i, n] }), Ao(t, e, r), t.edgeCount++, n; } else { var a = rr(), o = e, s = rr(); return a.checks.push({ type: rt.NODE_NEIGHBOR, node: o, neighbor: s }), Ao(t, e, a), s; } } }, { name: "child", separator: !0, regex: Ut.child, populate: function(t, e) { if (t.currentSubject == null) { var r = rr(), i = rr(), n = t[t.length - 1]; return r.checks.push({ type: rt.CHILD, parent: n, child: i }), Ao(t, e, r), t.compoundCount++, i; } else if (t.currentSubject === e) { var a = rr(), o = t[t.length - 1], s = rr(), c = rr(), l = rr(), u = rr(); return a.checks.push({ type: rt.COMPOUND_SPLIT, left: o, right: s, subject: c }), c.checks = e.checks, e.checks = [{ type: rt.TRUE }], u.checks.push({ type: rt.TRUE }), s.checks.push({ type: rt.PARENT, // type is swapped on right side queries parent: u, child: l // empty for now }), Ao(t, o, a), t.currentSubject = c, t.compoundCount++, l; } else { var d = rr(), h = rr(), f = [{ type: rt.PARENT, parent: d, child: h }]; return d.checks = e.checks, e.checks = f, t.compoundCount++, h; } } }, { name: "descendant", separator: !0, regex: Ut.descendant, populate: function(t, e) { if (t.currentSubject == null) { var r = rr(), i = rr(), n = t[t.length - 1]; return r.checks.push({ type: rt.DESCENDANT, ancestor: n, descendant: i }), Ao(t, e, r), t.compoundCount++, i; } else if (t.currentSubject === e) { var a = rr(), o = t[t.length - 1], s = rr(), c = rr(), l = rr(), u = rr(); return a.checks.push({ type: rt.COMPOUND_SPLIT, left: o, right: s, subject: c }), c.checks = e.checks, e.checks = [{ type: rt.TRUE }], u.checks.push({ type: rt.TRUE }), s.checks.push({ type: rt.ANCESTOR, // type is swapped on right side queries ancestor: u, descendant: l // empty for now }), Ao(t, o, a), t.currentSubject = c, t.compoundCount++, l; } else { var d = rr(), h = rr(), f = [{ type: rt.ANCESTOR, ancestor: d, descendant: h }]; return d.checks = e.checks, e.checks = f, t.compoundCount++, h; } } }, { name: "subject", modifier: !0, regex: Ut.subject, populate: function(t, e) { if (t.currentSubject != null && t.currentSubject !== e) return Zt("Redefinition of subject in selector `" + t.toString() + "`"), !1; t.currentSubject = e; var r = t[t.length - 1], i = r.checks[0], n = i == null ? null : i.type; n === rt.DIRECTED_EDGE ? i.type = rt.NODE_TARGET : n === rt.UNDIRECTED_EDGE && (i.type = rt.NODE_NEIGHBOR, i.node = i.nodes[1], i.neighbor = i.nodes[0], i.nodes = null); } }]; Ay.forEach(function(t) { return t.regexObj = new RegExp("^" + t.regex); }); var Z9 = function(t) { for (var e, r, i, n = 0; n < Ay.length; n++) { var a = Ay[n], o = a.name, s = t.match(a.regexObj); if (s != null) { r = s, e = a, i = o; var c = s[0]; t = t.substring(c.length); break; } } return { expr: e, match: r, name: i, remaining: t }; }, Y9 = function(t) { var e = t.match(/^\s+/); if (e) { var r = e[0]; t = t.substring(r.length); } return t; }, K9 = function(t) { var e = this, r = e.inputText = t, i = e[0] = rr(); for (e.length = 1, r = Y9(r); ; ) { var n = Z9(r); if (n.expr == null) return Zt("The selector `" + t + "`is invalid"), !1; var a = n.match.slice(1), o = n.expr.populate(e, i, a); if (o === !1) return !1; if (o != null && (i = o), r = n.remaining, r.match(/^\s*$/)) break; } var s = e[e.length - 1]; e.currentSubject != null && (s.subject = e.currentSubject), s.edgeCount = e.edgeCount, s.compoundCount = e.compoundCount; for (var c = 0; c < e.length; c++) { var l = e[c]; if (l.compoundCount > 0 && l.edgeCount > 0) return Zt("The selector `" + t + "` is invalid because it uses both a compound selector and an edge selector"), !1; if (l.edgeCount > 1) return Zt("The selector `" + t + "` is invalid because it uses multiple edge selectors"), !1; l.edgeCount === 1 && Zt("The selector `" + t + "` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes."); } return !0; }, J9 = function() { if (this.toStringCache != null) return this.toStringCache; for (var t = function(c) { return c ?? ""; }, e = function(c) { return dt(c) ? '"' + c + '"' : t(c); }, r = function(c) { return " " + c + " "; }, i = function(c, l) { var u = c.type, d = c.value; switch (u) { case rt.GROUP: { var h = t(d); return h.substring(0, h.length - 1); } case rt.DATA_COMPARE: { var f = c.field, p = c.operator; return "[" + f + r(t(p)) + e(d) + "]"; } case rt.DATA_BOOL: { var m = c.operator, y = c.field; return "[" + t(m) + y + "]"; } case rt.DATA_EXIST: { var g = c.field; return "[" + g + "]"; } case rt.META_COMPARE: { var v = c.operator, x = c.field; return "[[" + x + r(t(v)) + e(d) + "]]"; } case rt.STATE: return d; case rt.ID: return "#" + d; case rt.CLASS: return "." + d; case rt.PARENT: case rt.CHILD: return n(c.parent, l) + r(">") + n(c.child, l); case rt.ANCESTOR: case rt.DESCENDANT: return n(c.ancestor, l) + " " + n(c.descendant, l); case rt.COMPOUND_SPLIT: { var w = n(c.left, l), S = n(c.subject, l), _ = n(c.right, l); return w + (w.length > 0 ? " " : "") + S + _; } case rt.TRUE: return ""; } }, n = function(c, l) { return c.checks.reduce(function(u, d, h) { return u + (l === c && h === 0 ? "$" : "") + i(d, l); }, ""); }, a = "", o = 0; o < this.length; o++) { var s = this[o]; a += n(s, s.subject), this.length > 1 && o < this.length - 1 && (a += ", "); } return this.toStringCache = a, a; }, Q9 = { parse: K9, toString: J9 }, t3 = function(t, e, r) { var i, n = dt(t), a = Xe(t), o = dt(r), s, c, l = !1, u = !1, d = !1; switch (e.indexOf("!") >= 0 && (e = e.replace("!", ""), u = !0), e.indexOf("@") >= 0 && (e = e.replace("@", ""), l = !0), (n || o || l) && (s = !n && !a ? "" : "" + t, c = "" + r), l && (t = s = s.toLowerCase(), r = c = c.toLowerCase()), e) { case "*=": i = s.indexOf(c) >= 0; break; case "$=": i = s.indexOf(c, s.length - c.length) >= 0; break; case "^=": i = s.indexOf(c) === 0; break; case "=": i = t === r; break; case ">": d = !0, i = t > r; break; case ">=": d = !0, i = t >= r; break; case "<": d = !0, i = t < r; break; case "<=": d = !0, i = t <= r; break; default: i = !1; break; } return u && (t != null || !d) && (i = !i), i; }, eW = function(t, e) { switch (e) { case "?": return !!t; case "!": return !t; case "^": return t === void 0; } }, tW = function(t) { return t !== void 0; }, $b = function(t, e) { return t.data(e); }, rW = function(t, e) { return t[e](); }, Ar = [], fr = function(t, e) { return t.checks.every(function(r) { return Ar[r.type](r, e); }); }; Ar[rt.GROUP] = function(t, e) { var r = t.value; return r === "*" || r === e.group(); }; Ar[rt.STATE] = function(t, e) { var r = t.value; return q9(r, e); }; Ar[rt.ID] = function(t, e) { var r = t.value; return e.id() === r; }; Ar[rt.CLASS] = function(t, e) { var r = t.value; return e.hasClass(r); }; Ar[rt.META_COMPARE] = function(t, e) { var r = t.field, i = t.operator, n = t.value; return t3(rW(e, r), i, n); }; Ar[rt.DATA_COMPARE] = function(t, e) { var r = t.field, i = t.operator, n = t.value; return t3($b(e, r), i, n); }; Ar[rt.DATA_BOOL] = function(t, e) { var r = t.field, i = t.operator; return eW($b(e, r), i); }; Ar[rt.DATA_EXIST] = function(t, e) { var r = t.field; return t.operator, tW($b(e, r)); }; Ar[rt.UNDIRECTED_EDGE] = function(t, e) { var r = t.nodes[0], i = t.nodes[1], n = e.source(), a = e.target(); return fr(r, n) && fr(i, a) || fr(i, n) && fr(r, a); }; Ar[rt.NODE_NEIGHBOR] = function(t, e) { return fr(t.node, e) && e.neighborhood().some(function(r) { return r.isNode() && fr(t.neighbor, r); }); }; Ar[rt.DIRECTED_EDGE] = function(t, e) { return fr(t.source, e.source()) && fr(t.target, e.target()); }; Ar[rt.NODE_SOURCE] = function(t, e) { return fr(t.source, e) && e.outgoers().some(function(r) { return r.isNode() && fr(t.target, r); }); }; Ar[rt.NODE_TARGET] = function(t, e) { return fr(t.target, e) && e.incomers().some(function(r) { return r.isNode() && fr(t.source, r); }); }; Ar[rt.CHILD] = function(t, e) { return fr(t.child, e) && fr(t.parent, e.parent()); }; Ar[rt.PARENT] = function(t, e) { return fr(t.parent, e) && e.children().some(function(r) { return fr(t.child, r); }); }; Ar[rt.DESCENDANT] = function(t, e) { return fr(t.descendant, e) && e.ancestors().some(function(r) { return fr(t.ancestor, r); }); }; Ar[rt.ANCESTOR] = function(t, e) { return fr(t.ancestor, e) && e.descendants().some(function(r) { return fr(t.descendant, r); }); }; Ar[rt.COMPOUND_SPLIT] = function(t, e) { return fr(t.subject, e) && fr(t.left, e) && fr(t.right, e); }; Ar[rt.TRUE] = function() { return !0; }; Ar[rt.COLLECTION] = function(t, e) { var r = t.value; return r.has(e); }; Ar[rt.FILTER] = function(t, e) { var r = t.value; return r(e); }; var iW = function(t) { var e = this; if (e.length === 1 && e[0].checks.length === 1 && e[0].checks[0].type === rt.ID) return t.getElementById(e[0].checks[0].value).collection(); var r = function(i) { for (var n = 0; n < e.length; n++) { var a = e[n]; if (fr(a, i)) return !0; } return !1; }; return e.text() == null && (r = function() { return !0; }), t.filter(r); }, nW = function(t) { for (var e = this, r = 0; r < e.length; r++) { var i = e[r]; if (fr(i, t)) return !0; } return !1; }, aW = { matches: nW, filter: iW }, ps = function(t) { this.inputText = t, this.currentSubject = null, this.compoundCount = 0, this.edgeCount = 0, this.length = 0, t == null || dt(t) && t.match(/^\s*$/) || (on(t) ? this.addQuery({ checks: [{ type: rt.COLLECTION, value: t.collection() }] }) : xr(t) ? this.addQuery({ checks: [{ type: rt.FILTER, value: t }] }) : dt(t) ? this.parse(t) || (this.invalid = !0) : Tr("A selector must be created from a string; found ")); }, fs = ps.prototype; [Q9, aW].forEach(function(t) { return bt(fs, t); }); fs.text = function() { return this.inputText; }; fs.size = function() { return this.length; }; fs.eq = function(t) { return this[t]; }; fs.sameText = function(t) { return !this.invalid && !t.invalid && this.text() === t.text(); }; fs.addQuery = function(t) { this[this.length++] = t; }; fs.selector = fs.toString; var rs = { allAre: function(t) { var e = new ps(t); return this.every(function(r) { return e.matches(r); }); }, is: function(t) { var e = new ps(t); return this.some(function(r) { return e.matches(r); }); }, some: function(t, e) { for (var r = 0; r < this.length; r++) { var i = e ? t.apply(e, [this[r], r, this]) : t(this[r], r, this); if (i) return !0; } return !1; }, every: function(t, e) { for (var r = 0; r < this.length; r++) { var i = e ? t.apply(e, [this[r], r, this]) : t(this[r], r, this); if (!i) return !1; } return !0; }, same: function(t) { if (this === t) return !0; t = this.cy().collection(t); var e = this.length, r = t.length; return e !== r ? !1 : e === 1 ? this[0] === t[0] : this.every(function(i) { return t.hasElementWithId(i.id()); }); }, anySame: function(t) { return t = this.cy().collection(t), this.some(function(e) { return t.hasElementWithId(e.id()); }); }, allAreNeighbors: function(t) { t = this.cy().collection(t); var e = this.neighborhood(); return t.every(function(r) { return e.hasElementWithId(r.id()); }); }, contains: function(t) { t = this.cy().collection(t); var e = this; return t.every(function(r) { return e.hasElementWithId(r.id()); }); } }; rs.allAreNeighbours = rs.allAreNeighbors; rs.has = rs.contains; rs.equal = rs.equals = rs.same; var wn = function(t, e) { return function(r, i, n, a) { var o = r, s = this, c; if (o == null ? c = "" : on(o) && o.length === 1 && (c = o.id()), s.length === 1 && c) { var l = s[0]._private, u = l.traversalCache = l.traversalCache || {}, d = u[e] = u[e] || [], h = wl(c), f = d[h]; return f || (d[h] = t.call(s, r, i, n, a)); } else return t.call(s, r, i, n, a); }; }, au = { parent: function(t) { var e = []; if (this.length === 1) { var r = this[0]._private.parent; if (r) return r; } for (var i = 0; i < this.length; i++) { var n = this[i], a = n._private.parent; a && e.push(a); } return this.spawn(e, !0).filter(t); }, parents: function(t) { for (var e = [], r = this.parent(); r.nonempty(); ) { for (var i = 0; i < r.length; i++) { var n = r[i]; e.push(n); } r = r.parent(); } return this.spawn(e, !0).filter(t); }, commonAncestors: function(t) { for (var e, r = 0; r < this.length; r++) { var i = this[r], n = i.parents(); e = e || n, e = e.intersect(n); } return e.filter(t); }, orphans: function(t) { return this.stdFilter(function(e) { return e.isOrphan(); }).filter(t); }, nonorphans: function(t) { return this.stdFilter(function(e) { return e.isChild(); }).filter(t); }, children: wn(function(t) { for (var e = [], r = 0; r < this.length; r++) for (var i = this[r], n = i._private.children, a = 0; a < n.length; a++) e.push(n[a]); return this.spawn(e, !0).filter(t); }, "children"), siblings: function(t) { return this.parent().children().not(this).filter(t); }, isParent: function() { var t = this[0]; if (t) return t.isNode() && t._private.children.length !== 0; }, isChildless: function() { var t = this[0]; if (t) return t.isNode() && t._private.children.length === 0; }, isChild: function() { var t = this[0]; if (t) return t.isNode() && t._private.parent != null; }, isOrphan: function() { var t = this[0]; if (t) return t.isNode() && t._private.parent == null; }, descendants: function(t) { var e = []; function r(i) { for (var n = 0; n < i.length; n++) { var a = i[n]; e.push(a), a.children().nonempty() && r(a.children()); } } return r(this.children()), this.spawn(e, !0).filter(t); } }; function Vb(t, e, r, i) { for (var n = [], a = new Nu(), o = t.cy(), s = o.hasCompoundNodes(), c = 0; c < t.length; c++) { var l = t[c]; r ? n.push(l) : s && i(n, a, l); } for (; n.length > 0; ) { var u = n.shift(); e(u), a.add(u.id()), s && i(n, a, u); } return t; } function r3(t, e, r) { if (r.isParent()) for (var i = r._private.children, n = 0; n < i.length; n++) { var a = i[n]; e.has(a.id()) || t.push(a); } } au.forEachDown = function(t) { var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0; return Vb(this, t, e, r3); }; function i3(t, e, r) { if (r.isChild()) { var i = r._private.parent; e.has(i.id()) || t.push(i); } } au.forEachUp = function(t) { var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0; return Vb(this, t, e, i3); }; function oW(t, e, r) { i3(t, e, r), r3(t, e, r); } au.forEachUpAndDown = function(t) { var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0; return Vb(this, t, e, oW); }; au.ancestors = au.parents; var wh, n3; wh = n3 = { data: Xt.data({ field: "data", bindingEvent: "data", allowBinding: !0, allowSetting: !0, settingEvent: "data", settingTriggersEvent: !0, triggerFnName: "trigger", allowGetting: !0, immutableKeys: { id: !0, source: !0, target: !0, parent: !0 }, updateStyle: !0 }), removeData: Xt.removeData({ field: "data", event: "data", triggerFnName: "trigger", triggerEvent: !0, immutableKeys: { id: !0, source: !0, target: !0, parent: !0 }, updateStyle: !0 }), scratch: Xt.data({ field: "scratch", bindingEvent: "scratch", allowBinding: !0, allowSetting: !0, settingEvent: "scratch", settingTriggersEvent: !0, triggerFnName: "trigger", allowGetting: !0, updateStyle: !0 }), removeScratch: Xt.removeData({ field: "scratch", event: "scratch", triggerFnName: "trigger", triggerEvent: !0, updateStyle: !0 }), rscratch: Xt.data({ field: "rscratch", allowBinding: !1, allowSetting: !0, settingTriggersEvent: !1, allowGetting: !0 }), removeRscratch: Xt.removeData({ field: "rscratch", triggerEvent: !1 }), id: function() { var t = this[0]; if (t) return t._private.data.id; } }; wh.attr = wh.data; wh.removeAttr = wh.removeData; var sW = n3, Rg = {}; function Wv(t) { return function(e) { var r = this; if (e === void 0 && (e = !0), r.length !== 0) if (r.isNode() && !r.removed()) { for (var i = 0, n = r[0], a = n._private.edges, o = 0; o < a.length; o++) { var s = a[o]; !e && s.isLoop() || (i += t(n, s)); } return i; } else return; }; } bt(Rg, { degree: Wv(function(t, e) { return e.source().same(e.target()) ? 2 : 1; }), indegree: Wv(function(t, e) { return e.target().same(t) ? 1 : 0; }), outdegree: Wv(function(t, e) { return e.source().same(t) ? 1 : 0; }) }); function tc(t, e) { return function(r) { for (var i, n = this.nodes(), a = 0; a < n.length; a++) { var o = n[a], s = o[t](r); s !== void 0 && (i === void 0 || e(s, i)) && (i = s); } return i; }; } bt(Rg, { minDegree: tc("degree", function(t, e) { return t < e; }), maxDegree: tc("degree", function(t, e) { return t > e; }), minIndegree: tc("indegree", function(t, e) { return t < e; }), maxIndegree: tc("indegree", function(t, e) { return t > e; }), minOutdegree: tc("outdegree", function(t, e) { return t < e; }), maxOutdegree: tc("outdegree", function(t, e) { return t > e; }) }); bt(Rg, { totalDegree: function(t) { for (var e = 0, r = this.nodes(), i = 0; i < r.length; i++) e += r[i].degree(t); return e; } }); var jn, a3, o3 = function(t, e, r) { for (var i = 0; i < t.length; i++) { var n = t[i]; if (!n.locked()) { var a = n._private.position, o = { x: e.x != null ? e.x - a.x : 0, y: e.y != null ? e.y - a.y : 0 }; n.isParent() && !(o.x === 0 && o.y === 0) && n.children().shift(o, r), n.dirtyBoundingBoxCache(); } } }, T_ = { field: "position", bindingEvent: "position", allowBinding: !0, allowSetting: !0, settingEvent: "position", settingTriggersEvent: !0, triggerFnName: "emitAndNotify", allowGetting: !0, validKeys: ["x", "y"], beforeGet: function(t) { t.updateCompoundBounds(); }, beforeSet: function(t, e) { o3(t, e, !1); }, onSet: function(t) { t.dirtyCompoundBoundsCache(); }, canSet: function(t) { return !t.locked(); } }; jn = a3 = { position: Xt.data(T_), // position but no notification to renderer silentPosition: Xt.data(bt({}, T_, { allowBinding: !1, allowSetting: !0, settingTriggersEvent: !1, allowGetting: !1, beforeSet: function(t, e) { o3(t, e, !0); }, onSet: function(t) { t.dirtyCompoundBoundsCache(); } })), positions: function(t, e) { if (Gt(t)) e ? this.silentPosition(t) : this.position(t); else if (xr(t)) { var r = t, i = this.cy(); i.startBatch(); for (var n = 0; n < this.length; n++) { var a = this[n], o = void 0; (o = r(a, n)) && (e ? a.silentPosition(o) : a.position(o)); } i.endBatch(); } return this; }, silentPositions: function(t) { return this.positions(t, !0); }, shift: function(t, e, r) { var i; if (Gt(t) ? (i = { x: Xe(t.x) ? t.x : 0, y: Xe(t.y) ? t.y : 0 }, r = e) : dt(t) && Xe(e) && (i = { x: 0, y: 0 }, i[t] = e), i != null) { var n = this.cy(); n.startBatch(); for (var a = 0; a < this.length; a++) { var o = this[a]; if (!(n.hasCompoundNodes() && o.isChild() && o.ancestors().anySame(this))) { var s = o.position(), c = { x: s.x + i.x, y: s.y + i.y }; r ? o.silentPosition(c) : o.position(c); } } n.endBatch(); } return this; }, silentShift: function(t, e) { return Gt(t) ? this.shift(t, !0) : dt(t) && Xe(e) && this.shift(t, e, !0), this; }, // get/set the rendered (i.e. on screen) positon of the element renderedPosition: function(t, e) { var r = this[0], i = this.cy(), n = i.zoom(), a = i.pan(), o = Gt(t) ? t : void 0, s = o !== void 0 || e !== void 0 && dt(t); if (r && r.isNode()) if (s) for (var c = 0; c < this.length; c++) { var l = this[c]; e !== void 0 ? l.position(t, (e - a[t]) / n) : o !== void 0 && l.position(RA(o, n, a)); } else { var u = r.position(); return o = Cg(u, n, a), t === void 0 ? o : o[t]; } else if (!s) return; return this; }, // get/set the position relative to the parent relativePosition: function(t, e) { var r = this[0], i = this.cy(), n = Gt(t) ? t : void 0, a = n !== void 0 || e !== void 0 && dt(t), o = i.hasCompoundNodes(); if (r && r.isNode()) if (a) for (var s = 0; s < this.length; s++) { var c = this[s], l = o ? c.parent() : null, u = l && l.length > 0, d = u; u && (l = l[0]); var h = d ? l.position() : { x: 0, y: 0 }; e !== void 0 ? c.position(t, e + h[t]) : n !== void 0 && c.position({ x: n.x + h.x, y: n.y + h.y }); } else { var f = r.position(), p = o ? r.parent() : null, m = p && p.length > 0, y = m; m && (p = p[0]); var g = y ? p.position() : { x: 0, y: 0 }; return n = { x: f.x - g.x, y: f.y - g.y }, t === void 0 ? n : n[t]; } else if (!a) return; return this; } }; jn.modelPosition = jn.point = jn.position; jn.modelPositions = jn.points = jn.positions; jn.renderedPoint = jn.renderedPosition; jn.relativePoint = jn.relativePosition; var lW = a3, jc, As; jc = As = {}; As.renderedBoundingBox = function(t) { var e = this.boundingBox(t), r = this.cy(), i = r.zoom(), n = r.pan(), a = e.x1 * i + n.x, o = e.x2 * i + n.x, s = e.y1 * i + n.y, c = e.y2 * i + n.y; return { x1: a, x2: o, y1: s, y2: c, w: o - a, h: c - s }; }; As.dirtyCompoundBoundsCache = function() { var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, e = this.cy(); return !e.styleEnabled() || !e.hasCompoundNodes() ? this : (this.forEachUp(function(r) { if (r.isParent()) { var i = r._private; i.compoundBoundsClean = !1, i.bbCache = null, t || r.emitAndNotify("bounds"); } }), this); }; As.updateCompoundBounds = function() { var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, e = this.cy(); if (!e.styleEnabled() || !e.hasCompoundNodes()) return this; if (!t && e.batching()) return this; function r(o) { if (!o.isParent()) return; var s = o._private, c = o.children(), l = o.pstyle("compound-sizing-wrt-labels").value === "include", u = { 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 = c.boundingBox({ includeLabels: l, includeOverlays: !1, // updating the compound bounds happens outside of the regular // cache cycle (i.e. before fired events) useCache: !1 }), h = s.position; (d.w === 0 || d.h === 0) && (d = { w: o.pstyle("width").pfValue, h: o.pstyle("height").pfValue }, d.x1 = h.x - d.w / 2, d.x2 = h.x + d.w / 2, d.y1 = h.y - d.h / 2, d.y2 = h.y + d.h / 2); function f(E, C, L) { var A = 0, k = 0, P = C + L; return E > 0 && P > 0 && (A = C / P * E, k = L / P * E), { biasDiff: A, biasComplementDiff: k }; } function p(E, C, L, A) { if (L.units === "%") switch (A) { case "width": return E > 0 ? L.pfValue * E : 0; case "height": return C > 0 ? L.pfValue * C : 0; case "average": return E > 0 && C > 0 ? L.pfValue * (E + C) / 2 : 0; case "min": return E > 0 && C > 0 ? E > C ? L.pfValue * C : L.pfValue * E : 0; case "max": return E > 0 && C > 0 ? E > C ? L.pfValue * E : L.pfValue * C : 0; default: return 0; } else return L.units === "px" ? L.pfValue : 0; } var m = u.width.left.value; u.width.left.units === "px" && u.width.val > 0 && (m = m * 100 / u.width.val); var y = u.width.right.value; u.width.right.units === "px" && u.width.val > 0 && (y = y * 100 / u.width.val); var g = u.height.top.value; u.height.top.units === "px" && u.height.val > 0 && (g = g * 100 / u.height.val); var v = u.height.bottom.value; u.height.bottom.units === "px" && u.height.val > 0 && (v = v * 100 / u.height.val); var x = f(u.width.val - d.w, m, y), w = x.biasDiff, S = x.biasComplementDiff, _ = f(u.height.val - d.h, g, v), b = _.biasDiff, T = _.biasComplementDiff; s.autoPadding = p(d.w, d.h, o.pstyle("padding"), o.pstyle("padding-relative-to").value), s.autoWidth = Math.max(d.w, u.width.val), h.x = (-w + d.x1 + d.x2 + S) / 2, s.autoHeight = Math.max(d.h, u.height.val), h.y = (-b + d.y1 + d.y2 + T) / 2; } for (var i = 0; i < this.length; i++) { var n = this[i], a = n._private; (!a.compoundBoundsClean || t) && (r(n), e.batching() || (a.compoundBoundsClean = !0)); } return this; }; var yn = function(t) { return t === 1 / 0 || t === -1 / 0 ? 0 : t; }, zn = function(t, e, r, i, n) { i - e === 0 || n - r === 0 || e == null || r == null || i == null || n == null || (t.x1 = e < t.x1 ? e : t.x1, t.x2 = i > t.x2 ? i : t.x2, t.y1 = r < t.y1 ? r : t.y1, t.y2 = n > t.y2 ? n : t.y2, t.w = t.x2 - t.x1, t.h = t.y2 - t.y1); }, Xs = function(t, e) { return e == null ? t : zn(t, e.x1, e.y1, e.x2, e.y2); }, fd = function(t, e, r) { return $n(t, e, r); }, qp = function(t, e, r) { if (!e.cy().headless()) { var i = e._private, n = i.rstyle, a = n.arrowWidth / 2, o = e.pstyle(r + "-arrow-shape").value, s, c; if (o !== "none") { r === "source" ? (s = n.srcX, c = n.srcY) : r === "target" ? (s = n.tgtX, c = n.tgtY) : (s = n.midX, c = n.midY); var l = i.arrowBounds = i.arrowBounds || {}, u = l[r] = l[r] || {}; u.x1 = s - a, u.y1 = c - a, u.x2 = s + a, u.y2 = c + a, u.w = u.x2 - u.x1, u.h = u.y2 - u.y1, sm(u, 1), zn(t, u.x1, u.y1, u.x2, u.y2); } } }, qv = function(t, e, r) { if (!e.cy().headless()) { var i; r ? i = r + "-" : i = ""; var n = e._private, a = n.rstyle, o = e.pstyle(i + "label").strValue; if (o) { var s = e.pstyle("text-halign"), c = e.pstyle("text-valign"), l = fd(a, "labelWidth", r), u = fd(a, "labelHeight", r), d = fd(a, "labelX", r), h = fd(a, "labelY", r), f = e.pstyle(i + "text-margin-x").pfValue, p = e.pstyle(i + "text-margin-y").pfValue, m = e.isEdge(), y = e.pstyle(i + "text-rotation"), g = e.pstyle("text-outline-width").pfValue, v = e.pstyle("text-border-width").pfValue, x = v / 2, w = e.pstyle("text-background-padding").pfValue, S = 2, _ = u, b = l, T = b / 2, E = _ / 2, C, L, A, k; if (m) C = d - T, L = d + T, A = h - E, k = h + E; else { switch (s.value) { case "left": C = d - b, L = d; break; case "center": C = d - T, L = d + T; break; case "right": C = d, L = d + b; break; } switch (c.value) { case "top": A = h - _, k = h; break; case "center": A = h - E, k = h + E; break; case "bottom": A = h, k = h + _; break; } } C += f - Math.max(g, x) - w - S, L += f + Math.max(g, x) + w + S, A += p - Math.max(g, x) - w - S, k += p + Math.max(g, x) + w + S; var P = r || "main", R = n.labelBounds, M = R[P] = R[P] || {}; M.x1 = C, M.y1 = A, M.x2 = L, M.y2 = k, M.w = L - C, M.h = k - A; var O = m && y.strValue === "autorotate", D = y.pfValue != null && y.pfValue !== 0; if (O || D) { var I = O ? fd(n.rstyle, "labelAngle", r) : y.pfValue, F = Math.cos(I), z = Math.sin(I), U = (C + L) / 2, Z = (A + k) / 2; if (!m) { switch (s.value) { case "left": U = L; break; case "right": U = C; break; } switch (c.value) { case "top": Z = k; break; case "bottom": Z = A; break; } } var re = function(X, ie) { return X = X - U, ie = ie - Z, { x: X * F - ie * z + U, y: X * z + ie * F + Z }; }, K = re(C, A), V = re(C, k), H = re(L, A), G = re(L, k); C = Math.min(K.x, V.x, H.x, G.x), L = Math.max(K.x, V.x, H.x, G.x), A = Math.min(K.y, V.y, H.y, G.y), k = Math.max(K.y, V.y, H.y, G.y); } var W = P + "Rot", Y = R[W] = R[W] || {}; Y.x1 = C, Y.y1 = A, Y.x2 = L, Y.y2 = k, Y.w = L - C, Y.h = k - A, zn(t, C, A, L, k), zn(n.labelBounds.all, C, A, L, k); } return t; } }, cW = function(t, e) { if (!e.cy().headless()) { var r = e.pstyle("outline-opacity").value, i = e.pstyle("outline-width").value; if (r > 0 && i > 0) { var n = e.pstyle("outline-offset").value, a = e.pstyle("shape").value, o = i + n, s = (t.w + o * 2) / t.w, c = (t.h + o * 2) / t.h, l = 0, u = 0; ["diamond", "pentagon", "round-triangle"].includes(a) ? (s = (t.w + o * 2.4) / t.w, u = -o / 3.6) : ["concave-hexagon", "rhomboid", "right-rhomboid"].includes(a) ? s = (t.w + o * 2.4) / t.w : a === "star" ? (s = (t.w + o * 2.8) / t.w, c = (t.h + o * 2.6) / t.h, u = -o / 3.8) : a === "triangle" ? (s = (t.w + o * 2.8) / t.w, c = (t.h + o * 2.4) / t.h, u = -o / 1.4) : a === "vee" && (s = (t.w + o * 4.4) / t.w, c = (t.h + o * 3.8) / t.h, u = -o * 0.5); var d = t.h * c - t.h, h = t.w * s - t.w; if (lm(t, [Math.ceil(d / 2), Math.ceil(h / 2)]), l != 0 || u !== 0) { var f = kj(t, l, u); DA(t, f); } } } }, uW = function(t, e) { var r = t._private.cy, i = r.styleEnabled(), n = r.headless(), a = Yi(), o = t._private, s = t.isNode(), c = t.isEdge(), l, u, d, h, f, p, m = o.rstyle, y = s && i ? t.pstyle("bounds-expansion").pfValue : [0], g = function($) { return $.pstyle("display").value !== "none"; }, v = !i || g(t) && (!c || g(t.source()) && g(t.target())); if (v) { var x = 0, w = 0; i && e.includeOverlays && (x = t.pstyle("overlay-opacity").value, x !== 0 && (w = t.pstyle("overlay-padding").value)); var S = 0, _ = 0; i && e.includeUnderlays && (S = t.pstyle("underlay-opacity").value, S !== 0 && (_ = t.pstyle("underlay-padding").value)); var b = Math.max(w, _), T = 0, E = 0; if (i && (T = t.pstyle("width").pfValue, E = T / 2), s && e.includeNodes) { var C = t.position(); f = C.x, p = C.y; var L = t.outerWidth(), A = L / 2, k = t.outerHeight(), P = k / 2; l = f - A, u = f + A, d = p - P, h = p + P, zn(a, l, d, u, h), i && e.includeOutlines && cW(a, t); } else if (c && e.includeEdges) if (i && !n) { var R = t.pstyle("curve-style").strValue; if (l = Math.min(m.srcX, m.midX, m.tgtX), u = Math.max(m.srcX, m.midX, m.tgtX), d = Math.min(m.srcY, m.midY, m.tgtY), h = Math.max(m.srcY, m.midY, m.tgtY), l -= E, u += E, d -= E, h += E, zn(a, l, d, u, h), R === "haystack") { var M = m.haystackPts; if (M && M.length === 2) { if (l = M[0].x, d = M[0].y, u = M[1].x, h = M[1].y, l > u) { var O = l; l = u, u = O; } if (d > h) { var D = d; d = h, h = D; } zn(a, l - E, d - E, u + E, h + E); } } else if (R === "bezier" || R === "unbundled-bezier" || R.endsWith("segments") || R.endsWith("taxi")) { var I; switch (R) { case "bezier": case "unbundled-bezier": I = m.bezierPts; break; case "segments": case "taxi": case "round-segments": case "round-taxi": I = m.linePts; break; } if (I != null) for (var F = 0; F < I.length; F++) { var z = I[F]; l = z.x - E, u = z.x + E, d = z.y - E, h = z.y + E, zn(a, l, d, u, h); } } } else { var U = t.source(), Z = U.position(), re = t.target(), K = re.position(); if (l = Z.x, u = K.x, d = Z.y, h = K.y, l > u) { var V = l; l = u, u = V; } if (d > h) { var H = d; d = h, h = H; } l -= E, u += E, d -= E, h += E, zn(a, l, d, u, h); } if (i && e.includeEdges && c && (qp(a, t, "mid-source"), qp(a, t, "mid-target"), qp(a, t, "source"), qp(a, t, "target")), i) { var G = t.pstyle("ghost").value === "yes"; if (G) { var W = t.pstyle("ghost-offset-x").pfValue, Y = t.pstyle("ghost-offset-y").pfValue; zn(a, a.x1 + W, a.y1 + Y, a.x2 + W, a.y2 + Y); } } var X = o.bodyBounds = o.bodyBounds || {}; a_(X, a), lm(X, y), sm(X, 1), i && (l = a.x1, u = a.x2, d = a.y1, h = a.y2, zn(a, l - b, d - b, u + b, h + b)); var ie = o.overlayBounds = o.overlayBounds || {}; a_(ie, a), lm(ie, y), sm(ie, 1); var ue = o.labelBounds = o.labelBounds || {}; ue.all != null ? Lj(ue.all) : ue.all = Yi(), i && e.includeLabels && (e.includeMainLabels && qv(a, t, null), c && (e.includeSourceLabels && qv(a, t, "source"), e.includeTargetLabels && qv(a, t, "target"))); } return a.x1 = yn(a.x1), a.y1 = yn(a.y1), a.x2 = yn(a.x2), a.y2 = yn(a.y2), a.w = yn(a.x2 - a.x1), a.h = yn(a.y2 - a.y1), a.w > 0 && a.h > 0 && v && (lm(a, y), sm(a, 1)), a; }, s3 = function(t) { var e = 0, r = function(n) { return (n ? 1 : 0) << e++; }, i = 0; return i += r(t.incudeNodes), i += r(t.includeEdges), i += r(t.includeLabels), i += r(t.includeMainLabels), i += r(t.includeSourceLabels), i += r(t.includeTargetLabels), i += r(t.includeOverlays), i += r(t.includeOutlines), i; }, l3 = function(t) { if (t.isEdge()) { var e = t.source().position(), r = t.target().position(), i = function(n) { return Math.round(n); }; return XU([i(e.x), i(e.y), i(r.x), i(r.y)]); } else return 0; }, C_ = function(t, e) { var r = t._private, i, n = t.isEdge(), a = e == null ? A_ : s3(e), o = a === A_, s = l3(t), c = r.bbCachePosKey === s, l = e.useCache && c, u = function(f) { return f._private.bbCache == null || f._private.styleDirty; }, d = !l || u(t) || n && u(t.source()) || u(t.target()); if (d ? (c || t.recalculateRenderedStyle(l), i = uW(t, _h), r.bbCache = i, r.bbCachePosKey = s) : i = r.bbCache, !o) { var h = t.isNode(); i = Yi(), (e.includeNodes && h || e.includeEdges && !h) && (e.includeOverlays ? Xs(i, r.overlayBounds) : Xs(i, r.bodyBounds)), e.includeLabels && (e.includeMainLabels && (!n || e.includeSourceLabels && e.includeTargetLabels) ? Xs(i, r.labelBounds.all) : (e.includeMainLabels && Xs(i, r.labelBounds.mainRot), e.includeSourceLabels && Xs(i, r.labelBounds.sourceRot), e.includeTargetLabels && Xs(i, r.labelBounds.targetRot))), i.w = i.x2 - i.x1, i.h = i.y2 - i.y1; } return i; }, _h = { includeNodes: !0, includeEdges: !0, includeLabels: !0, includeMainLabels: !0, includeSourceLabels: !0, includeTargetLabels: !0, includeOverlays: !0, includeUnderlays: !0, includeOutlines: !0, useCache: !0 }, A_ = s3(_h), L_ = yi(_h); As.boundingBox = function(t) { var e; if (this.length === 1 && this[0]._private.bbCache != null && !this[0]._private.styleDirty && (t === void 0 || t.useCache === void 0 || t.useCache === !0)) t === void 0 ? t = _h : t = L_(t), e = C_(this[0], t); else { e = Yi(), t = t || _h; var r = L_(t), i = this, n = i.cy(), a = n.styleEnabled(); if (a) for (var o = 0; o < i.length; o++) { var s = i[o], c = s._private, l = l3(s), u = c.bbCachePosKey === l, d = r.useCache && u && !c.styleDirty; s.recalculateRenderedStyle(d); } this.updateCompoundBounds(!t.useCache); for (var h = 0; h < i.length; h++) { var f = i[h]; Xs(e, C_(f, r)); } } return e.x1 = yn(e.x1), e.y1 = yn(e.y1), e.x2 = yn(e.x2), e.y2 = yn(e.y2), e.w = yn(e.x2 - e.x1), e.h = yn(e.y2 - e.y1), e; }; As.dirtyBoundingBoxCache = function() { for (var t = 0; t < this.length; t++) { var e = this[t]._private; e.bbCache = null, e.bbCachePosKey = null, e.bodyBounds = null, e.overlayBounds = null, e.labelBounds.all = null, e.labelBounds.source = null, e.labelBounds.target = null, e.labelBounds.main = null, e.labelBounds.sourceRot = null, e.labelBounds.targetRot = null, e.labelBounds.mainRot = null, e.arrowBounds.source = null, e.arrowBounds.target = null, e.arrowBounds["mid-source"] = null, e.arrowBounds["mid-target"] = null; } return this.emitAndNotify("bounds"), this; }; As.boundingBoxAt = function(t) { var e = this.nodes(), r = this.cy(), i = r.hasCompoundNodes(), n = r.collection(); if (i && (n = e.filter(function(l) { return l.isParent(); }), e = e.not(n)), Gt(t)) { var a = t; t = function() { return a; }; } var o = function(l, u) { return l._private.bbAtOldPos = t(l, u); }, s = function(l) { return l._private.bbAtOldPos; }; r.startBatch(), e.forEach(o).silentPositions(t), i && (n.dirtyCompoundBoundsCache(), n.dirtyBoundingBoxCache(), n.updateCompoundBounds(!0)); var c = Aj(this.boundingBox({ useCache: !1 })); return e.silentPositions(s), i && (n.dirtyCompoundBoundsCache(), n.dirtyBoundingBoxCache(), n.updateCompoundBounds(!0)), r.endBatch(), c; }; jc.boundingbox = jc.bb = jc.boundingBox; jc.renderedBoundingbox = jc.renderedBoundingBox; var dW = As, zd, ap; zd = ap = {}; var c3 = function(t) { t.uppercaseName = Q2(t.name), t.autoName = "auto" + t.uppercaseName, t.labelName = "label" + t.uppercaseName, t.outerName = "outer" + t.uppercaseName, t.uppercaseOuterName = Q2(t.outerName), zd[t.name] = function() { var e = this[0], r = e._private, i = r.cy, n = i._private.styleEnabled; if (e) if (n) { if (e.isParent()) return e.updateCompoundBounds(), r[t.autoName] || 0; var a = e.pstyle(t.name); switch (a.strValue) { case "label": return e.recalculateRenderedStyle(), r.rstyle[t.labelName] || 0; default: return a.pfValue; } } else return 1; }, zd["outer" + t.uppercaseName] = function() { var e = this[0], r = e._private, i = r.cy, n = i._private.styleEnabled; if (e) if (n) { var a = e[t.name](), o = e.pstyle("border-width").pfValue, s = 2 * e.padding(); return a + o + s; } else return 1; }, zd["rendered" + t.uppercaseName] = function() { var e = this[0]; if (e) { var r = e[t.name](); return r * this.cy().zoom(); } }, zd["rendered" + t.uppercaseOuterName] = function() { var e = this[0]; if (e) { var r = e[t.outerName](); return r * this.cy().zoom(); } }; }; c3({ name: "width" }); c3({ name: "height" }); ap.padding = function() { var t = this[0], e = t._private; return t.isParent() ? (t.updateCompoundBounds(), e.autoPadding !== void 0 ? e.autoPadding : t.pstyle("padding").pfValue) : t.pstyle("padding").pfValue; }; ap.paddedHeight = function() { var t = this[0]; return t.height() + 2 * t.padding(); }; ap.paddedWidth = function() { var t = this[0]; return t.width() + 2 * t.padding(); }; var hW = ap, pW = function(t, e) { if (t.isEdge()) return e(t); }, fW = function(t, e) { if (t.isEdge()) { var r = t.cy(); return Cg(e(t), r.zoom(), r.pan()); } }, mW = function(t, e) { if (t.isEdge()) { var r = t.cy(), i = r.pan(), n = r.zoom(); return e(t).map(function(a) { return Cg(a, n, i); }); } }, gW = function(t) { return t.renderer().getControlPoints(t); }, vW = function(t) { return t.renderer().getSegmentPoints(t); }, yW = function(t) { return t.renderer().getSourceEndpoint(t); }, bW = function(t) { return t.renderer().getTargetEndpoint(t); }, xW = function(t) { return t.renderer().getEdgeMidpoint(t); }, k_ = { controlPoints: { get: gW, mult: !0 }, segmentPoints: { get: vW, mult: !0 }, sourceEndpoint: { get: yW }, targetEndpoint: { get: bW }, midpoint: { get: xW } }, wW = function(t) { return "rendered" + t[0].toUpperCase() + t.substr(1); }, _W = Object.keys(k_).reduce(function(t, e) { var r = k_[e], i = wW(e); return t[e] = function() { return pW(this, r.get); }, r.mult ? t[i] = function() { return mW(this, r.get); } : t[i] = function() { return fW(this, r.get); }, t; }, {}), SW = bt({}, lW, dW, hW, _W); /*! Event object based on jQuery events, MIT license https://jquery.org/license/ https://tldrlegal.com/license/mit-license https://github.com/jquery/jquery/blob/master/src/event.js */ var u3 = function(t, e) { this.recycle(t, e); }; function md() { return !1; } function Xp() { return !0; } u3.prototype = { instanceString: function() { return "event"; }, recycle: function(t, e) { if (this.isImmediatePropagationStopped = this.isPropagationStopped = this.isDefaultPrevented = md, t != null && t.preventDefault ? (this.type = t.type, this.isDefaultPrevented = t.defaultPrevented ? Xp : md) : t != null && t.type ? e = t : this.type = t, e != null && (this.originalEvent = e.originalEvent, this.type = e.type != null ? e.type : this.type, this.cy = e.cy, this.target = e.target, this.position = e.position, this.renderedPosition = e.renderedPosition, this.namespace = e.namespace, this.layout = e.layout), this.cy != null && this.position != null && this.renderedPosition == null) { var r = this.position, i = this.cy.zoom(), n = this.cy.pan(); this.renderedPosition = { x: r.x * i + n.x, y: r.y * i + n.y }; } this.timeStamp = t && t.timeStamp || Date.now(); }, preventDefault: function() { this.isDefaultPrevented = Xp; var t = this.originalEvent; t && t.preventDefault && t.preventDefault(); }, stopPropagation: function() { this.isPropagationStopped = Xp; var t = this.originalEvent; t && t.stopPropagation && t.stopPropagation(); }, stopImmediatePropagation: function() { this.isImmediatePropagationStopped = Xp, this.stopPropagation(); }, isDefaultPrevented: md, isPropagationStopped: md, isImmediatePropagationStopped: md }; var d3 = /^([^.]+)(\.(?:[^.]+))?$/, MW = ".*", h3 = { qualifierCompare: function(t, e) { return t === e; }, eventMatches: function() { return !0; }, addEventFields: function() { }, callbackContext: function(t) { return t; }, beforeEmit: function() { }, afterEmit: function() { }, bubble: function() { return !1; }, parent: function() { return null; }, context: null }, P_ = Object.keys(h3), EW = {}; function Og() { for (var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : EW, e = arguments.length > 1 ? arguments[1] : void 0, r = 0; r < P_.length; r++) { var i = P_[r]; this[i] = t[i] || h3[i]; } this.context = e || this.context, this.listeners = [], this.emitting = 0; } var ms = Og.prototype, p3 = function(t, e, r, i, n, a, o) { xr(i) && (n = i, i = null), o && (a == null ? a = o : a = bt({}, a, o)); for (var s = ar(r) ? r : r.split(/\s+/), c = 0; c < s.length; c++) { var l = s[c]; if (!ds(l)) { var u = l.match(d3); if (u) { var d = u[1], h = u[2] ? u[2] : null, f = e(t, l, d, h, i, n, a); if (f === !1) break; } } } }, R_ = function(t, e) { return t.addEventFields(t.context, e), new u3(e.type, e); }, TW = function(t, e, r) { if (H8(r)) { e(t, r); return; } else if (Gt(r)) { e(t, R_(t, r)); return; } for (var i = ar(r) ? r : r.split(/\s+/), n = 0; n < i.length; n++) { var a = i[n]; if (!ds(a)) { var o = a.match(d3); if (o) { var s = o[1], c = o[2] ? o[2] : null, l = R_(t, { type: s, namespace: c, target: t.context }); e(t, l); } } } }; ms.on = ms.addListener = function(t, e, r, i, n) { return p3(this, function(a, o, s, c, l, u, d) { xr(u) && a.listeners.push({ event: o, // full event string callback: u, // callback to run type: s, // the event type (e.g. 'click') namespace: c, // the event namespace (e.g. ".foo") qualifier: l, // a restriction on whether to match this emitter conf: d // additional configuration }); }, t, e, r, i, n), this; }; ms.one = function(t, e, r, i) { return this.on(t, e, r, i, { one: !0 }); }; ms.removeListener = ms.off = function(t, e, r, i) { var n = this; this.emitting !== 0 && (this.listeners = tj(this.listeners)); for (var a = this.listeners, o = function(c) { var l = a[c]; p3(n, function(u, d, h, f, p, m) { if ((l.type === h || t === "*") && (!f && l.namespace !== ".*" || l.namespace === f) && (!p || u.qualifierCompare(l.qualifier, p)) && (!m || l.callback === m)) return a.splice(c, 1), !1; }, t, e, r, i); }, s = a.length - 1; s >= 0; s--) o(s); return this; }; ms.removeAllListeners = function() { return this.removeListener("*"); }; ms.emit = ms.trigger = function(t, e, r) { var i = this.listeners, n = i.length; return this.emitting++, ar(e) || (e = [e]), TW(this, function(a, o) { r != null && (i = [{ event: o.event, type: o.type, namespace: o.namespace, callback: r }], n = i.length); for (var s = function(l) { var u = i[l]; if (u.type === o.type && (!u.namespace || u.namespace === o.namespace || u.namespace === MW) && a.eventMatches(a.context, u, o)) { var d = [o]; e != null && ij(d, e), a.beforeEmit(a.context, u, o), u.conf && u.conf.one && (a.listeners = a.listeners.filter(function(p) { return p !== u; })); var h = a.callbackContext(a.context, u, o), f = u.callback.apply(h, d); a.afterEmit(a.context, u, o), f === !1 && (o.stopPropagation(), o.preventDefault()); } }, c = 0; c < n; c++) s(c); a.bubble(a.context) && !o.isPropagationStopped() && a.parent(a.context).emit(o, e); }, t), this.emitting--, this; }; var CW = { qualifierCompare: function(t, e) { return t == null || e == null ? t == null && e == null : t.sameText(e); }, eventMatches: function(t, e, r) { var i = e.qualifier; return i != null ? t !== r.target && rp(r.target) && i.matches(r.target) : !0; }, addEventFields: function(t, e) { e.cy = t.cy(), e.target = t; }, callbackContext: function(t, e, r) { return e.qualifier != null ? r.target : t; }, beforeEmit: function(t, e) { e.conf && e.conf.once && e.conf.onceCollection.removeListener(e.event, e.qualifier, e.callback); }, bubble: function() { return !0; }, parent: function(t) { return t.isChild() ? t.parent() : t.cy(); } }, Zp = function(t) { return dt(t) ? new ps(t) : t; }, f3 = { createEmitter: function() { for (var t = 0; t < this.length; t++) { var e = this[t], r = e._private; r.emitter || (r.emitter = new Og(CW, e)); } return this; }, emitter: function() { return this._private.emitter; }, on: function(t, e, r) { for (var i = Zp(e), n = 0; n < this.length; n++) { var a = this[n]; a.emitter().on(t, i, r); } return this; }, removeListener: function(t, e, r) { for (var i = Zp(e), n = 0; n < this.length; n++) { var a = this[n]; a.emitter().removeListener(t, i, r); } return this; }, removeAllListeners: function() { for (var t = 0; t < this.length; t++) { var e = this[t]; e.emitter().removeAllListeners(); } return this; }, one: function(t, e, r) { for (var i = Zp(e), n = 0; n < this.length; n++) { var a = this[n]; a.emitter().one(t, i, r); } return this; }, once: function(t, e, r) { for (var i = Zp(e), n = 0; n < this.length; n++) { var a = this[n]; a.emitter().on(t, i, r, { once: !0, onceCollection: this }); } }, emit: function(t, e) { for (var r = 0; r < this.length; r++) { var i = this[r]; i.emitter().emit(t, e); } return this; }, emitAndNotify: function(t, e) { if (this.length !== 0) return this.cy().notify(t, this), this.emit(t, e), this; } }; Xt.eventAliasesOn(f3); var m3 = { nodes: function(t) { return this.filter(function(e) { return e.isNode(); }).filter(t); }, edges: function(t) { return this.filter(function(e) { return e.isEdge(); }).filter(t); }, // internal helper to get nodes and edges as separate collections with single iteration over elements byGroup: function() { for (var t = this.spawn(), e = this.spawn(), r = 0; r < this.length; r++) { var i = this[r]; i.isNode() ? t.push(i) : e.push(i); } return { nodes: t, edges: e }; }, filter: function(t, e) { if (t === void 0) return this; if (dt(t) || on(t)) return new ps(t).filter(this); if (xr(t)) { for (var r = this.spawn(), i = this, n = 0; n < i.length; n++) { var a = i[n], o = e ? t.apply(e, [a, n, i]) : t(a, n, i); o && r.push(a); } return r; } return this.spawn(); }, not: function(t) { if (t) { dt(t) && (t = this.filter(t)); for (var e = this.spawn(), r = 0; r < this.length; r++) { var i = this[r], n = t.has(i); n || e.push(i); } return e; } else return this; }, absoluteComplement: function() { var t = this.cy(); return t.mutableElements().not(this); }, intersect: function(t) { if (dt(t)) { var e = t; return this.filter(e); } for (var r = this.spawn(), i = this, n = t, a = this.length < t.length, o = a ? i : n, s = a ? n : i, c = 0; c < o.length; c++) { var l = o[c]; s.has(l) && r.push(l); } return r; }, xor: function(t) { var e = this._private.cy; dt(t) && (t = e.$(t)); var r = this.spawn(), i = this, n = t, a = function(o, s) { for (var c = 0; c < o.length; c++) { var l = o[c], u = l._private.data.id, d = s.hasElementWithId(u); d || r.push(l); } }; return a(i, n), a(n, i), r; }, diff: function(t) { var e = this._private.cy; dt(t) && (t = e.$(t)); var r = this.spawn(), i = this.spawn(), n = this.spawn(), a = this, o = t, s = function(c, l, u) { for (var d = 0; d < c.length; d++) { var h = c[d], f = h._private.data.id, p = l.hasElementWithId(f); p ? n.merge(h) : u.push(h); } }; return s(a, o, r), s(o, a, i), { left: r, right: i, both: n }; }, add: function(t) { var e = this._private.cy; if (!t) return this; if (dt(t)) { var r = t; t = e.mutableElements().filter(r); } for (var i = this.spawnSelf(), n = 0; n < t.length; n++) { var a = t[n], o = !this.has(a); o && i.push(a); } return i; }, // in place merge on calling collection merge: function(t) { var e = this._private, r = e.cy; if (!t) return this; if (t && dt(t)) { var i = t; t = r.mutableElements().filter(i); } for (var n = e.map, a = 0; a < t.length; a++) { var o = t[a], s = o._private.data.id, c = !n.has(s); if (c) { var l = this.length++; this[l] = o, n.set(s, { ele: o, index: l }); } } return this; }, unmergeAt: function(t) { var e = this[t], r = e.id(), i = this._private, n = i.map; this[t] = void 0, n.delete(r); var a = t === this.length - 1; if (this.length > 1 && !a) { var o = this.length - 1, s = this[o], c = s._private.data.id; this[o] = void 0, this[t] = s, n.set(c, { ele: s, index: t }); } return this.length--, this; }, // remove single ele in place in calling collection unmergeOne: function(t) { t = t[0]; var e = this._private, r = t._private.data.id, i = e.map, n = i.get(r); if (!n) return this; var a = n.index; return this.unmergeAt(a), this; }, // remove eles in place on calling collection unmerge: function(t) { var e = this._private.cy; if (!t) return this; if (t && dt(t)) { var r = t; t = e.mutableElements().filter(r); } for (var i = 0; i < t.length; i++) this.unmergeOne(t[i]); return this; }, unmergeBy: function(t) { for (var e = this.length - 1; e >= 0; e--) { var r = this[e]; t(r) && this.unmergeAt(e); } return this; }, map: function(t, e) { for (var r = [], i = this, n = 0; n < i.length; n++) { var a = i[n], o = e ? t.apply(e, [a, n, i]) : t(a, n, i); r.push(o); } return r; }, reduce: function(t, e) { for (var r = e, i = this, n = 0; n < i.length; n++) r = t(r, i[n], n, i); return r; }, max: function(t, e) { for (var r = -1 / 0, i, n = this, a = 0; a < n.length; a++) { var o = n[a], s = e ? t.apply(e, [o, a, n]) : t(o, a, n); s > r && (r = s, i = o); } return { value: r, ele: i }; }, min: function(t, e) { for (var r = 1 / 0, i, n = this, a = 0; a < n.length; a++) { var o = n[a], s = e ? t.apply(e, [o, a, n]) : t(o, a, n); s < r && (r = s, i = o); } return { value: r, ele: i }; } }, Ht = m3; Ht.u = Ht["|"] = Ht["+"] = Ht.union = Ht.or = Ht.add; Ht["\\"] = Ht["!"] = Ht["-"] = Ht.difference = Ht.relativeComplement = Ht.subtract = Ht.not; Ht.n = Ht["&"] = Ht["."] = Ht.and = Ht.intersection = Ht.intersect; Ht["^"] = Ht["(+)"] = Ht["(-)"] = Ht.symmetricDifference = Ht.symdiff = Ht.xor; Ht.fnFilter = Ht.filterFn = Ht.stdFilter = Ht.filter; Ht.complement = Ht.abscomp = Ht.absoluteComplement; var AW = { 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 t = this[0]; if (t) return t._private.group; } }, g3 = function(t, e) { var r = t.cy(), i = r.hasCompoundNodes(); function n(l) { var u = l.pstyle("z-compound-depth"); return u.value === "auto" ? i ? l.zDepth() : 0 : u.value === "bottom" ? -1 : u.value === "top" ? kb : 0; } var a = n(t) - n(e); if (a !== 0) return a; function o(l) { var u = l.pstyle("z-index-compare"); return u.value === "auto" && l.isNode() ? 1 : 0; } var s = o(t) - o(e); if (s !== 0) return s; var c = t.pstyle("z-index").value - e.pstyle("z-index").value; return c !== 0 ? c : t.poolIndex() - e.poolIndex(); }, Fm = { forEach: function(t, e) { if (xr(t)) for (var r = this.length, i = 0; i < r; i++) { var n = this[i], a = e ? t.apply(e, [n, i, this]) : t(n, i, this); if (a === !1) break; } return this; }, toArray: function() { for (var t = [], e = 0; e < this.length; e++) t.push(this[e]); return t; }, slice: function(t, e) { var r = [], i = this.length; e == null && (e = i), t == null && (t = 0), t < 0 && (t = i + t), e < 0 && (e = i + e); for (var n = t; n >= 0 && n < e && n < i; n++) r.push(this[n]); return this.spawn(r); }, size: function() { return this.length; }, eq: function(t) { return this[t] || 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(t) { if (!xr(t)) return this; var e = this.toArray().sort(t); return this.spawn(e); }, sortByZIndex: function() { return this.sort(g3); }, zDepth: function() { var t = this[0]; if (t) { var e = t._private, r = e.group; if (r === "nodes") { var i = e.data.parent ? t.parents().size() : 0; return t.isParent() ? i : kb - 1; } else { var n = e.source, a = e.target, o = n.zDepth(), s = a.zDepth(); return Math.max(o, s, 0); } } } }; Fm.each = Fm.forEach; var LW = function() { var t = "undefined", e = (typeof Symbol > "u" ? "undefined" : Zr(Symbol)) != t && Zr(Symbol.iterator) != t; e && (Fm[Symbol.iterator] = function() { var r = this, i = { value: void 0, done: !1 }, n = 0, a = this.length; return pA({ next: function() { return n < a ? i.value = r[n++] : (i.value = void 0, i.done = !0), i; } }, Symbol.iterator, function() { return this; }); }); }; LW(); var kW = yi({ nodeDimensionsIncludeLabels: !1 }), um = { // Calculates and returns node dimensions { x, y } based on options given layoutDimensions: function(t) { t = kW(t); var e; if (!this.takesUpSpace()) e = { w: 0, h: 0 }; else if (t.nodeDimensionsIncludeLabels) { var r = this.boundingBox(); e = { w: r.w, h: r.h }; } else e = { w: this.outerWidth(), h: this.outerHeight() }; return (e.w === 0 || e.h === 0) && (e.w = e.h = 1), e; }, // using standard layout options, apply position function (w/ or w/o animation) layoutPositions: function(t, e, r) { var i = this.nodes().filter(function(w) { return !w.isParent(); }), n = this.cy(), a = e.eles, o = function(w) { return w.id(); }, s = fh(r, o); t.emit({ type: "layoutstart", layout: t }), t.animations = []; var c = function(w, S, _) { var b = { x: S.x1 + S.w / 2, y: S.y1 + S.h / 2 }, T = { // scale from center of bounding box (not necessarily 0,0) x: (_.x - b.x) * w, y: (_.y - b.y) * w }; return { x: b.x + T.x, y: b.y + T.y }; }, l = e.spacingFactor && e.spacingFactor !== 1, u = function() { if (!l) return null; for (var w = Yi(), S = 0; S < i.length; S++) { var _ = i[S], b = s(_, S); Pj(w, b.x, b.y); } return w; }, d = u(), h = fh(function(w, S) { var _ = s(w, S); if (l) { var b = Math.abs(e.spacingFactor); _ = c(b, d, _); } return e.transform != null && (_ = e.transform(w, _)), _; }, o); if (e.animate) { for (var f = 0; f < i.length; f++) { var p = i[f], m = h(p, f), y = e.animateFilter == null || e.animateFilter(p, f); if (y) { var g = p.animation({ position: m, duration: e.animationDuration, easing: e.animationEasing }); t.animations.push(g); } else p.position(m); } if (e.fit) { var v = n.animation({ fit: { boundingBox: a.boundingBoxAt(h), padding: e.padding }, duration: e.animationDuration, easing: e.animationEasing }); t.animations.push(v); } else if (e.zoom !== void 0 && e.pan !== void 0) { var x = n.animation({ zoom: e.zoom, pan: e.pan, duration: e.animationDuration, easing: e.animationEasing }); t.animations.push(x); } t.animations.forEach(function(w) { return w.play(); }), t.one("layoutready", e.ready), t.emit({ type: "layoutready", layout: t }), Bu.all(t.animations.map(function(w) { return w.promise(); })).then(function() { t.one("layoutstop", e.stop), t.emit({ type: "layoutstop", layout: t }); }); } else i.positions(h), e.fit && n.fit(e.eles, e.padding), e.zoom != null && n.zoom(e.zoom), e.pan && n.pan(e.pan), t.one("layoutready", e.ready), t.emit({ type: "layoutready", layout: t }), t.one("layoutstop", e.stop), t.emit({ type: "layoutstop", layout: t }); return this; }, layout: function(t) { var e = this.cy(); return e.makeLayout(bt({}, t, { eles: this })); } }; um.createLayout = um.makeLayout = um.layout; function v3(t, e, r) { var i = r._private, n = i.styleCache = i.styleCache || [], a; return (a = n[t]) != null || (a = n[t] = e(r)), a; } function Dg(t, e) { return t = wl(t), function(r) { return v3(t, e, r); }; } function Ig(t, e) { t = wl(t); var r = function(i) { return e.call(i); }; return function() { var i = this[0]; if (i) return v3(t, r, i); }; } var fi = { recalculateRenderedStyle: function(t) { var e = this.cy(), r = e.renderer(), i = e.styleEnabled(); return r && i && r.recalculateRenderedStyle(this, t), this; }, dirtyStyleCache: function() { var t = this.cy(), e = function(i) { return i._private.styleCache = null; }; if (t.hasCompoundNodes()) { var r; r = this.spawnSelf().merge(this.descendants()).merge(this.parents()), r.merge(r.connectedEdges()), r.forEach(e); } else this.forEach(function(i) { e(i), i.connectedEdges().forEach(e); }); return this; }, // fully updates (recalculates) the style for the elements updateStyle: function(t) { var e = this._private.cy; if (!e.styleEnabled()) return this; if (e.batching()) { var r = e._private.batchStyleEles; return r.merge(this), this; } var i = e.hasCompoundNodes(), n = this; t = !!(t || t === void 0), i && (n = this.spawnSelf().merge(this.descendants()).merge(this.parents())); var a = n; return t ? a.emitAndNotify("style") : a.emit("style"), n.forEach(function(o) { return o._private.styleDirty = !0; }), this; }, // private: clears dirty flag and recalculates style cleanStyle: function() { var t = this.cy(); if (t.styleEnabled()) for (var e = 0; e < this.length; e++) { var r = this[e]; r._private.styleDirty && (r._private.styleDirty = !1, t.style().apply(r)); } }, // get the internal parsed style object for the specified property parsedStyle: function(t) { var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, r = this[0], i = r.cy(); if (i.styleEnabled() && r) { this.cleanStyle(); var n = r._private.style[t]; return n ?? (e ? i.style().getDefaultProperty(t) : null); } }, numericStyle: function(t) { var e = this[0]; if (e.cy().styleEnabled() && e) { var r = e.pstyle(t); return r.pfValue !== void 0 ? r.pfValue : r.value; } }, numericStyleUnits: function(t) { var e = this[0]; if (e.cy().styleEnabled() && e) return e.pstyle(t).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(t) { var e = this.cy(); if (!e.styleEnabled()) return this; var r = this[0]; if (r) return e.style().getRenderedStyle(r, t); }, // read the calculated css style of the element or override the style (via a bypass) style: function(t, e) { var r = this.cy(); if (!r.styleEnabled()) return this; var i = !1, n = r.style(); if (Gt(t)) { var a = t; n.applyBypass(this, a, i), this.emitAndNotify("style"); } else if (dt(t)) if (e === void 0) { var o = this[0]; return o ? n.getStylePropertyValue(o, t) : void 0; } else n.applyBypass(this, t, e, i), this.emitAndNotify("style"); else if (t === void 0) { var s = this[0]; return s ? n.getRawStyle(s) : void 0; } return this; }, removeStyle: function(t) { var e = this.cy(); if (!e.styleEnabled()) return this; var r = !1, i = e.style(), n = this; if (t === void 0) for (var a = 0; a < n.length; a++) { var o = n[a]; i.removeAllBypasses(o, r); } else { t = t.split(/\s+/); for (var s = 0; s < n.length; s++) { var c = n[s]; i.removeBypasses(c, t, r); } } return this.emitAndNotify("style"), this; }, show: function() { return this.css("display", "element"), this; }, hide: function() { return this.css("display", "none"), this; }, effectiveOpacity: function() { var t = this.cy(); if (!t.styleEnabled()) return 1; var e = t.hasCompoundNodes(), r = this[0]; if (r) { var i = r._private, n = r.pstyle("opacity").value; if (!e) return n; var a = i.data.parent ? r.parents() : null; if (a) for (var o = 0; o < a.length; o++) { var s = a[o], c = s.pstyle("opacity").value; n = c * n; } return n; } }, transparent: function() { var t = this.cy(); if (!t.styleEnabled()) return !1; var e = this[0], r = e.cy().hasCompoundNodes(); if (e) return r ? e.effectiveOpacity() === 0 : e.pstyle("opacity").value === 0; }, backgrounding: function() { var t = this.cy(); if (!t.styleEnabled()) return !1; var e = this[0]; return !!e._private.backgrounding; } }; function Xv(t, e) { var r = t._private, i = r.data.parent ? t.parents() : null; if (i) for (var n = 0; n < i.length; n++) { var a = i[n]; if (!e(a)) return !1; } return !0; } function Ub(t) { var e = t.ok, r = t.edgeOkViaNode || t.ok, i = t.parentOk || t.ok; return function() { var n = this.cy(); if (!n.styleEnabled()) return !0; var a = this[0], o = n.hasCompoundNodes(); if (a) { var s = a._private; if (!e(a)) return !1; if (a.isNode()) return !o || Xv(a, i); var c = s.source, l = s.target; return r(c) && (!o || Xv(c, r)) && (c === l || r(l) && (!o || Xv(l, r))); } }; } var Vu = Dg("eleTakesUpSpace", function(t) { return t.pstyle("display").value === "element" && t.width() !== 0 && (t.isNode() ? t.height() !== 0 : !0); }); fi.takesUpSpace = Ig("takesUpSpace", Ub({ ok: Vu })); var PW = Dg("eleInteractive", function(t) { return t.pstyle("events").value === "yes" && t.pstyle("visibility").value === "visible" && Vu(t); }), RW = Dg("parentInteractive", function(t) { return t.pstyle("visibility").value === "visible" && Vu(t); }); fi.interactive = Ig("interactive", Ub({ ok: PW, parentOk: RW, edgeOkViaNode: Vu })); fi.noninteractive = function() { var t = this[0]; if (t) return !t.interactive(); }; var OW = Dg("eleVisible", function(t) { return t.pstyle("visibility").value === "visible" && t.pstyle("opacity").pfValue !== 0 && Vu(t); }), DW = Vu; fi.visible = Ig("visible", Ub({ ok: OW, edgeOkViaNode: DW })); fi.hidden = function() { var t = this[0]; if (t) return !t.visible(); }; fi.isBundledBezier = Ig("isBundledBezier", function() { return this.cy().styleEnabled() ? !this.removed() && this.pstyle("curve-style").value === "bezier" && this.takesUpSpace() : !1; }); fi.bypass = fi.css = fi.style; fi.renderedCss = fi.renderedStyle; fi.removeBypass = fi.removeCss = fi.removeStyle; fi.pstyle = fi.parsedStyle; var is = {}; function O_(t) { return function() { var e = arguments, r = []; if (e.length === 2) { var i = e[0], n = e[1]; this.on(t.event, i, n); } else if (e.length === 1 && xr(e[0])) { var a = e[0]; this.on(t.event, a); } else if (e.length === 0 || e.length === 1 && ar(e[0])) { for (var o = e.length === 1 ? e[0] : null, s = 0; s < this.length; s++) { var c = this[s], l = !t.ableField || c._private[t.ableField], u = c._private[t.field] != t.value; if (t.overrideAble) { var d = t.overrideAble(c); if (d !== void 0 && (l = d, !d)) return this; } l && (c._private[t.field] = t.value, u && r.push(c)); } var h = this.spawn(r); h.updateStyle(), h.emit(t.event), o && h.emit(o); } return this; }; } function Uu(t) { is[t.field] = function() { var e = this[0]; if (e) { if (t.overrideField) { var r = t.overrideField(e); if (r !== void 0) return r; } return e._private[t.field]; } }, is[t.on] = O_({ event: t.on, field: t.field, ableField: t.ableField, overrideAble: t.overrideAble, value: !0 }), is[t.off] = O_({ event: t.off, field: t.field, ableField: t.ableField, overrideAble: t.overrideAble, value: !1 }); } Uu({ field: "locked", overrideField: function(t) { return t.cy().autolock() ? !0 : void 0; }, on: "lock", off: "unlock" }); Uu({ field: "grabbable", overrideField: function(t) { return t.cy().autoungrabify() || t.pannable() ? !1 : void 0; }, on: "grabify", off: "ungrabify" }); Uu({ field: "selected", ableField: "selectable", overrideAble: function(t) { return t.cy().autounselectify() ? !1 : void 0; }, on: "select", off: "unselect" }); Uu({ field: "selectable", overrideField: function(t) { return t.cy().autounselectify() ? !1 : void 0; }, on: "selectify", off: "unselectify" }); is.deselect = is.unselect; is.grabbed = function() { var t = this[0]; if (t) return t._private.grabbed; }; Uu({ field: "active", on: "activate", off: "unactivate" }); Uu({ field: "pannable", on: "panify", off: "unpanify" }); is.inactive = function() { var t = this[0]; if (t) return !t._private.active; }; var Ci = {}, D_ = function(t) { return function(e) { for (var r = this, i = [], n = 0; n < r.length; n++) { var a = r[n]; if (a.isNode()) { for (var o = !1, s = a.connectedEdges(), c = 0; c < s.length; c++) { var l = s[c], u = l.source(), d = l.target(); if (t.noIncomingEdges && d === a && u !== a || t.noOutgoingEdges && u === a && d !== a) { o = !0; break; } } o || i.push(a); } } return this.spawn(i, !0).filter(e); }; }, I_ = function(t) { return function(e) { for (var r = this, i = [], n = 0; n < r.length; n++) { var a = r[n]; if (a.isNode()) for (var o = a.connectedEdges(), s = 0; s < o.length; s++) { var c = o[s], l = c.source(), u = c.target(); t.outgoing && l === a ? (i.push(c), i.push(u)) : t.incoming && u === a && (i.push(c), i.push(l)); } } return this.spawn(i, !0).filter(e); }; }, N_ = function(t) { return function(e) { for (var r = this, i = [], n = {}; ; ) { var a = t.outgoing ? r.outgoers() : r.incomers(); if (a.length === 0) break; for (var o = !1, s = 0; s < a.length; s++) { var c = a[s], l = c.id(); n[l] || (n[l] = !0, i.push(c), o = !0); } if (!o) break; r = a; } return this.spawn(i, !0).filter(e); }; }; Ci.clearTraversalCache = function() { for (var t = 0; t < this.length; t++) this[t]._private.traversalCache = null; }; bt(Ci, { // get the root nodes in the DAG roots: D_({ noIncomingEdges: !0 }), // get the leaf nodes in the DAG leaves: D_({ noOutgoingEdges: !0 }), // normally called children in graph theory // these nodes =edges=> outgoing nodes outgoers: wn(I_({ outgoing: !0 }), "outgoers"), // aka DAG descendants successors: N_({ outgoing: !0 }), // normally called parents in graph theory // these nodes <=edges= incoming nodes incomers: wn(I_({ incoming: !0 }), "incomers"), // aka DAG ancestors predecessors: N_({ incoming: !0 }) }); bt(Ci, { neighborhood: wn(function(t) { for (var e = [], r = this.nodes(), i = 0; i < r.length; i++) for (var n = r[i], a = n.connectedEdges(), o = 0; o < a.length; o++) { var s = a[o], c = s.source(), l = s.target(), u = n === c ? l : c; u.length > 0 && e.push(u[0]), e.push(s[0]); } return this.spawn(e, !0).filter(t); }, "neighborhood"), closedNeighborhood: function(t) { return this.neighborhood().add(this).filter(t); }, openNeighborhood: function(t) { return this.neighborhood(t); } }); Ci.neighbourhood = Ci.neighborhood; Ci.closedNeighbourhood = Ci.closedNeighborhood; Ci.openNeighbourhood = Ci.openNeighborhood; bt(Ci, { source: wn(function(t) { var e = this[0], r; return e && (r = e._private.source || e.cy().collection()), r && t ? r.filter(t) : r; }, "source"), target: wn(function(t) { var e = this[0], r; return e && (r = e._private.target || e.cy().collection()), r && t ? r.filter(t) : r; }, "target"), sources: B_({ attr: "source" }), targets: B_({ attr: "target" }) }); function B_(t) { return function(e) { for (var r = [], i = 0; i < this.length; i++) { var n = this[i], a = n._private[t.attr]; a && r.push(a); } return this.spawn(r, !0).filter(e); }; } bt(Ci, { edgesWith: wn(F_(), "edgesWith"), edgesTo: wn(F_({ thisIsSrc: !0 }), "edgesTo") }); function F_(t) { return function(e) { var r = [], i = this._private.cy, n = t || {}; dt(e) && (e = i.$(e)); for (var a = 0; a < e.length; a++) for (var o = e[a]._private.edges, s = 0; s < o.length; s++) { var c = o[s], l = c._private.data, u = this.hasElementWithId(l.source) && e.hasElementWithId(l.target), d = e.hasElementWithId(l.source) && this.hasElementWithId(l.target), h = u || d; h && ((n.thisIsSrc || n.thisIsTgt) && (n.thisIsSrc && !u || n.thisIsTgt && !d) || r.push(c)); } return this.spawn(r, !0); }; } bt(Ci, { connectedEdges: wn(function(t) { for (var e = [], r = this, i = 0; i < r.length; i++) { var n = r[i]; if (n.isNode()) for (var a = n._private.edges, o = 0; o < a.length; o++) { var s = a[o]; e.push(s); } } return this.spawn(e, !0).filter(t); }, "connectedEdges"), connectedNodes: wn(function(t) { for (var e = [], r = this, i = 0; i < r.length; i++) { var n = r[i]; n.isEdge() && (e.push(n.source()[0]), e.push(n.target()[0])); } return this.spawn(e, !0).filter(t); }, "connectedNodes"), parallelEdges: wn(z_(), "parallelEdges"), codirectedEdges: wn(z_({ codirected: !0 }), "codirectedEdges") }); function z_(t) { var e = { codirected: !1 }; return t = bt({}, e, t), function(r) { for (var i = [], n = this.edges(), a = t, o = 0; o < n.length; o++) for (var s = n[o], c = s._private, l = c.source, u = l._private.data.id, d = c.data.target, h = l._private.edges, f = 0; f < h.length; f++) { var p = h[f], m = p._private.data, y = m.target, g = m.source, v = y === d && g === u, x = u === y && d === g; (a.codirected && v || !a.codirected && (v || x)) && i.push(p); } return this.spawn(i, !0).filter(r); }; } bt(Ci, { components: function(t) { var e = this, r = e.cy(), i = r.collection(), n = t == null ? e.nodes() : t.nodes(), a = []; t != null && n.empty() && (n = t.sources()); var o = function(c, l) { i.merge(c), n.unmerge(c), l.merge(c); }; if (n.empty()) return e.spawn(); var s = function() { var c = r.collection(); a.push(c); var l = n[0]; o(l, c), e.bfs({ directed: !1, roots: l, visit: function(u) { return o(u, c); } }), c.forEach(function(u) { u.connectedEdges().forEach(function(d) { e.has(d) && c.has(d.source()) && c.has(d.target()) && c.merge(d); }); }); }; do s(); while (n.length > 0); return a; }, component: function() { var t = this[0]; return t.cy().mutableElements().components(t)[0]; } }); Ci.componentsOf = Ci.components; var mi = function(t, e) { var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1; if (t === void 0) { Tr("A collection must have a reference to the core"); return; } var n = new ca(), a = !1; if (!e) e = []; else if (e.length > 0 && Gt(e[0]) && !rp(e[0])) { a = !0; for (var o = [], s = new Nu(), c = 0, l = e.length; c < l; c++) { var u = e[c]; u.data == null && (u.data = {}); var d = u.data; if (d.id == null) d.id = kA(); else if (t.hasElementWithId(d.id) || s.has(d.id)) continue; var h = new Tg(t, u, !1); o.push(h), s.add(d.id); } e = o; } this.length = 0; for (var f = 0, p = e.length; f < p; f++) { var m = e[f][0]; if (m != null) { var y = m._private.data.id; (!r || !n.has(y)) && (r && n.set(y, { index: this.length, ele: m }), this[this.length] = m, this.length++); } } this._private = { eles: this, cy: t, get map() { return this.lazyMap == null && this.rebuildMap(), this.lazyMap; }, set map(g) { this.lazyMap = g; }, rebuildMap: function() { for (var g = this.lazyMap = new ca(), v = this.eles, x = 0; x < v.length; x++) { var w = v[x]; g.set(w.id(), { index: x, ele: w }); } } }, r && (this._private.map = n), a && !i && this.restore(); }, cr = Tg.prototype = mi.prototype = Object.create(Array.prototype); cr.instanceString = function() { return "collection"; }; cr.spawn = function(t, e) { return new mi(this.cy(), t, e); }; cr.spawnSelf = function() { return this.spawn(this); }; cr.cy = function() { return this._private.cy; }; cr.renderer = function() { return this._private.cy.renderer(); }; cr.element = function() { return this[0]; }; cr.collection = function() { return vA(this) ? this : new mi(this._private.cy, [this]); }; cr.unique = function() { return new mi(this._private.cy, this, !0); }; cr.hasElementWithId = function(t) { return t = "" + t, this._private.map.has(t); }; cr.getElementById = function(t) { t = "" + t; var e = this._private.cy, r = this._private.map.get(t); return r ? r.ele : new mi(e); }; cr.$id = cr.getElementById; cr.poolIndex = function() { var t = this._private.cy, e = t._private.elements, r = this[0]._private.data.id; return e._private.map.get(r).index; }; cr.indexOf = function(t) { var e = t[0]._private.data.id; return this._private.map.get(e).index; }; cr.indexOfId = function(t) { return t = "" + t, this._private.map.get(t).index; }; cr.json = function(t) { var e = this.element(), r = this.cy(); if (e == null && t) return this; if (e != null) { var i = e._private; if (Gt(t)) { if (r.startBatch(), t.data) { e.data(t.data); var n = i.data; if (e.isEdge()) { var a = !1, o = {}, s = t.data.source, c = t.data.target; s != null && s != n.source && (o.source = "" + s, a = !0), c != null && c != n.target && (o.target = "" + c, a = !0), a && (e = e.move(o)); } else { var l = "parent" in t.data, u = t.data.parent; l && (u != null || n.parent != null) && u != n.parent && (u === void 0 && (u = null), u != null && (u = "" + u), e = e.move({ parent: u })); } } t.position && e.position(t.position); var d = function(p, m, y) { var g = t[p]; g != null && g !== i[p] && (g ? e[m]() : e[y]()); }; return d("removed", "remove", "restore"), d("selected", "select", "unselect"), d("selectable", "selectify", "unselectify"), d("locked", "lock", "unlock"), d("grabbable", "grabify", "ungrabify"), d("pannable", "panify", "unpanify"), t.classes != null && e.classes(t.classes), r.endBatch(), this; } else if (t === void 0) { var h = { data: la(i.data), position: la(i.position), group: i.group, removed: i.removed, selected: i.selected, selectable: i.selectable, locked: i.locked, grabbable: i.grabbable, pannable: i.pannable, classes: null }; h.classes = ""; var f = 0; return i.classes.forEach(function(p) { return h.classes += f++ === 0 ? p : " " + p; }), h; } } }; cr.jsons = function() { for (var t = [], e = 0; e < this.length; e++) { var r = this[e], i = r.json(); t.push(i); } return t; }; cr.clone = function() { for (var t = this.cy(), e = [], r = 0; r < this.length; r++) { var i = this[r], n = i.json(), a = new Tg(t, n, !1); e.push(a); } return new mi(t, e); }; cr.copy = cr.clone; cr.restore = function() { for (var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, r = this, i = r.cy(), n = i._private, a = [], o = [], s, c = 0, l = r.length; c < l; c++) { var u = r[c]; e && !u.removed() || (u.isNode() ? a.push(u) : o.push(u)); } s = a.concat(o); var d, h = function() { s.splice(d, 1), d--; }; for (d = 0; d < s.length; d++) { var f = s[d], p = f._private, m = p.data; if (f.clearTraversalCache(), !(!e && !p.removed)) { if (m.id === void 0) m.id = kA(); else if (Xe(m.id)) m.id = "" + m.id; else if (ds(m.id) || !dt(m.id)) { Tr("Can not create element with invalid string ID `" + m.id + "`"), h(); continue; } else if (i.hasElementWithId(m.id)) { Tr("Can not create second element with ID `" + m.id + "`"), h(); continue; } } var y = m.id; if (f.isNode()) { var g = p.position; g.x == null && (g.x = 0), g.y == null && (g.y = 0); } if (f.isEdge()) { for (var v = f, x = ["source", "target"], w = x.length, S = !1, _ = 0; _ < w; _++) { var b = x[_], T = m[b]; Xe(T) && (T = m[b] = "" + m[b]), T == null || T === "" ? (Tr("Can not create edge `" + y + "` with unspecified " + b), S = !0) : i.hasElementWithId(T) || (Tr("Can not create edge `" + y + "` with nonexistant " + b + " `" + T + "`"), S = !0); } if (S) { h(); continue; } var E = i.getElementById(m.source), C = i.getElementById(m.target); E.same(C) ? E._private.edges.push(v) : (E._private.edges.push(v), C._private.edges.push(v)), v._private.source = E, v._private.target = C; } p.map = new ca(), p.map.set(y, { ele: f, index: 0 }), p.removed = !1, e && i.addToPool(f); } for (var L = 0; L < a.length; L++) { var A = a[L], k = A._private.data; Xe(k.parent) && (k.parent = "" + k.parent); var P = k.parent, R = P != null; if (R || A._private.parent) { var M = A._private.parent ? i.collection().merge(A._private.parent) : i.getElementById(P); if (M.empty()) k.parent = void 0; else if (M[0].removed()) Zt("Node added with missing parent, reference to parent removed"), k.parent = void 0, A._private.parent = null; else { for (var O = !1, D = M; !D.empty(); ) { if (A.same(D)) { O = !0, k.parent = void 0; break; } D = D.parent(); } O || (M[0]._private.children.push(A), A._private.parent = M[0], n.hasCompoundNodes = !0); } } } if (s.length > 0) { for (var I = s.length === r.length ? r : new mi(i, s), F = 0; F < I.length; F++) { var z = I[F]; z.isNode() || (z.parallelEdges().clearTraversalCache(), z.source().clearTraversalCache(), z.target().clearTraversalCache()); } var U; n.hasCompoundNodes ? U = i.collection().merge(I).merge(I.connectedNodes()).merge(I.parent()) : U = I, U.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t), t ? I.emitAndNotify("add") : e && I.emit("add"); } return r; }; cr.removed = function() { var t = this[0]; return t && t._private.removed; }; cr.inside = function() { var t = this[0]; return t && !t._private.removed; }; cr.remove = function() { var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, r = this, i = [], n = {}, a = r._private.cy; function o(P) { for (var R = P._private.edges, M = 0; M < R.length; M++) c(R[M]); } function s(P) { for (var R = P._private.children, M = 0; M < R.length; M++) c(R[M]); } function c(P) { var R = n[P.id()]; e && P.removed() || R || (n[P.id()] = !0, P.isNode() ? (i.push(P), o(P), s(P)) : i.unshift(P)); } for (var l = 0, u = r.length; l < u; l++) { var d = r[l]; c(d); } function h(P, R) { var M = P._private.edges; hs(M, R), P.clearTraversalCache(); } function f(P) { P.clearTraversalCache(); } var p = []; p.ids = {}; function m(P, R) { R = R[0], P = P[0]; var M = P._private.children, O = P.id(); hs(M, R), R._private.parent = null, p.ids[O] || (p.ids[O] = !0, p.push(P)); } r.dirtyCompoundBoundsCache(), e && a.removeFromPool(i); for (var y = 0; y < i.length; y++) { var g = i[y]; if (g.isEdge()) { var v = g.source()[0], x = g.target()[0]; h(v, g), h(x, g); for (var w = g.parallelEdges(), S = 0; S < w.length; S++) { var _ = w[S]; f(_), _.isBundledBezier() && _.dirtyBoundingBoxCache(); } } else { var b = g.parent(); b.length !== 0 && m(b, g); } e && (g._private.removed = !0); } var T = a._private.elements; a._private.hasCompoundNodes = !1; for (var E = 0; E < T.length; E++) { var C = T[E]; if (C.isParent()) { a._private.hasCompoundNodes = !0; break; } } var L = new mi(this.cy(), i); L.size() > 0 && (t ? L.emitAndNotify("remove") : e && L.emit("remove")); for (var A = 0; A < p.length; A++) { var k = p[A]; (!e || !k.removed()) && k.updateStyle(); } return L; }; cr.move = function(t) { var e = this._private.cy, r = this, i = !1, n = !1, a = function(f) { return f == null ? f : "" + f; }; if (t.source !== void 0 || t.target !== void 0) { var o = a(t.source), s = a(t.target), c = o != null && e.hasElementWithId(o), l = s != null && e.hasElementWithId(s); (c || l) && (e.batch(function() { r.remove(i, n), r.emitAndNotify("moveout"); for (var f = 0; f < r.length; f++) { var p = r[f], m = p._private.data; p.isEdge() && (c && (m.source = o), l && (m.target = s)); } r.restore(i, n); }), r.emitAndNotify("move")); } else if (t.parent !== void 0) { var u = a(t.parent), d = u === null || e.hasElementWithId(u); if (d) { var h = u === null ? void 0 : u; e.batch(function() { var f = r.remove(i, n); f.emitAndNotify("moveout"); for (var p = 0; p < r.length; p++) { var m = r[p], y = m._private.data; m.isNode() && (y.parent = h); } f.restore(i, n); }), r.emitAndNotify("move"); } } return this; }; [jA, G9, cm, rs, au, sW, Rg, SW, f3, m3, AW, Fm, um, fi, is, Ci].forEach(function(t) { bt(cr, t); }); var IW = { add: function(t) { var e, r = this; if (on(t)) { var i = t; if (i._private.cy === r) e = i.restore(); else { for (var n = [], a = 0; a < i.length; a++) { var o = i[a]; n.push(o.json()); } e = new mi(r, n); } } else if (ar(t)) { var s = t; e = new mi(r, s); } else if (Gt(t) && (ar(t.nodes) || ar(t.edges))) { for (var c = t, l = [], u = ["nodes", "edges"], d = 0, h = u.length; d < h; d++) { var f = u[d], p = c[f]; if (ar(p)) for (var m = 0, y = p.length; m < y; m++) { var g = bt({ group: f }, p[m]); l.push(g); } } e = new mi(r, l); } else { var v = t; e = new Tg(r, v).collection(); } return e; }, remove: function(t) { if (!on(t) && dt(t)) { var e = t; t = this.$(e); } return t.remove(); } }; /*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */ function NW(t, e, r, i) { var n = 4, a = 1e-3, o = 1e-7, s = 10, c = 11, l = 1 / (c - 1), u = typeof Float32Array < "u"; if (arguments.length !== 4) return !1; for (var d = 0; d < 4; ++d) if (typeof arguments[d] != "number" || isNaN(arguments[d]) || !isFinite(arguments[d])) return !1; t = Math.min(t, 1), r = Math.min(r, 1), t = Math.max(t, 0), r = Math.max(r, 0); var h = u ? new Float32Array(c) : new Array(c); function f(C, L) { return 1 - 3 * L + 3 * C; } function p(C, L) { return 3 * L - 6 * C; } function m(C) { return 3 * C; } function y(C, L, A) { return ((f(L, A) * C + p(L, A)) * C + m(L)) * C; } function g(C, L, A) { return 3 * f(L, A) * C * C + 2 * p(L, A) * C + m(L); } function v(C, L) { for (var A = 0; A < n; ++A) { var k = g(L, t, r); if (k === 0) return L; var P = y(L, t, r) - C; L -= P / k; } return L; } function x() { for (var C = 0; C < c; ++C) h[C] = y(C * l, t, r); } function w(C, L, A) { var k, P, R = 0; do P = L + (A - L) / 2, k = y(P, t, r) - C, k > 0 ? A = P : L = P; while (Math.abs(k) > o && ++R < s); return P; } function S(C) { for (var L = 0, A = 1, k = c - 1; A !== k && h[A] <= C; ++A) L += l; --A; var P = (C - h[A]) / (h[A + 1] - h[A]), R = L + P * l, M = g(R, t, r); return M >= a ? v(C, R) : M === 0 ? R : w(C, L, L + l); } var _ = !1; function b() { _ = !0, (t !== e || r !== i) && x(); } var T = function(C) { return _ || b(), t === e && r === i ? C : C === 0 ? 0 : C === 1 ? 1 : y(S(C), e, i); }; T.getControlPoints = function() { return [{ x: t, y: e }, { x: r, y: i }]; }; var E = "generateBezier(" + [t, e, r, i] + ")"; return T.toString = function() { return E; }, T; } /*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */ var BW = /* @__PURE__ */ function() { function t(i) { return -i.tension * i.x - i.friction * i.v; } function e(i, n, a) { var o = { x: i.x + a.dx * n, v: i.v + a.dv * n, tension: i.tension, friction: i.friction }; return { dx: o.v, dv: t(o) }; } function r(i, n) { var a = { dx: i.v, dv: t(i) }, o = e(i, n * 0.5, a), s = e(i, n * 0.5, o), c = e(i, n, s), l = 1 / 6 * (a.dx + 2 * (o.dx + s.dx) + c.dx), u = 1 / 6 * (a.dv + 2 * (o.dv + s.dv) + c.dv); return i.x = i.x + l * n, i.v = i.v + u * n, i; } return function i(n, a, o) { var s = { x: -1, v: 0, tension: null, friction: null }, c = [0], l = 0, u = 1 / 1e4, d = 16 / 1e3, h, f, p; for (n = parseFloat(n) || 500, a = parseFloat(a) || 20, o = o || null, s.tension = n, s.friction = a, h = o !== null, h ? (l = i(n, a), f = l / o * d) : f = d; p = r(p || s, f), c.push(1 + p.x), l += 16, Math.abs(p.x) > u && Math.abs(p.v) > u; ) ; return h ? function(m) { return c[m * (c.length - 1) | 0]; } : l; }; }(), or = function(t, e, r, i) { var n = NW(t, e, r, i); return function(a, o, s) { return a + (o - a) * n(s); }; }, dm = { linear: function(t, e, r) { return t + (e - t) * r; }, // default easings ease: or(0.25, 0.1, 0.25, 1), "ease-in": or(0.42, 0, 1, 1), "ease-out": or(0, 0, 0.58, 1), "ease-in-out": or(0.42, 0, 0.58, 1), // sine "ease-in-sine": or(0.47, 0, 0.745, 0.715), "ease-out-sine": or(0.39, 0.575, 0.565, 1), "ease-in-out-sine": or(0.445, 0.05, 0.55, 0.95), // quad "ease-in-quad": or(0.55, 0.085, 0.68, 0.53), "ease-out-quad": or(0.25, 0.46, 0.45, 0.94), "ease-in-out-quad": or(0.455, 0.03, 0.515, 0.955), // cubic "ease-in-cubic": or(0.55, 0.055, 0.675, 0.19), "ease-out-cubic": or(0.215, 0.61, 0.355, 1), "ease-in-out-cubic": or(0.645, 0.045, 0.355, 1), // quart "ease-in-quart": or(0.895, 0.03, 0.685, 0.22), "ease-out-quart": or(0.165, 0.84, 0.44, 1), "ease-in-out-quart": or(0.77, 0, 0.175, 1), // quint "ease-in-quint": or(0.755, 0.05, 0.855, 0.06), "ease-out-quint": or(0.23, 1, 0.32, 1), "ease-in-out-quint": or(0.86, 0, 0.07, 1), // expo "ease-in-expo": or(0.95, 0.05, 0.795, 0.035), "ease-out-expo": or(0.19, 1, 0.22, 1), "ease-in-out-expo": or(1, 0, 0, 1), // circ "ease-in-circ": or(0.6, 0.04, 0.98, 0.335), "ease-out-circ": or(0.075, 0.82, 0.165, 1), "ease-in-out-circ": or(0.785, 0.135, 0.15, 0.86), // user param easings... spring: function(t, e, r) { if (r === 0) return dm.linear; var i = BW(t, e, r); return function(n, a, o) { return n + (a - n) * i(o); }; }, "cubic-bezier": or }; function $_(t, e, r, i, n) { if (i === 1 || e === r) return r; var a = n(e, r, i); return t == null || ((t.roundValue || t.color) && (a = Math.round(a)), t.min !== void 0 && (a = Math.max(a, t.min)), t.max !== void 0 && (a = Math.min(a, t.max))), a; } function V_(t, e) { return t.pfValue != null || t.value != null ? t.pfValue != null && (e == null || e.type.units !== "%") ? t.pfValue : t.value : t; } function rc(t, e, r, i, n) { var a = n != null ? n.type : null; r < 0 ? r = 0 : r > 1 && (r = 1); var o = V_(t, n), s = V_(e, n); if (Xe(o) && Xe(s)) return $_(a, o, s, r, i); if (ar(o) && ar(s)) { for (var c = [], l = 0; l < s.length; l++) { var u = o[l], d = s[l]; if (u != null && d != null) { var h = $_(a, u, d, r, i); c.push(h); } else c.push(d); } return c; } } function FW(t, e, r, i) { var n = !i, a = t._private, o = e._private, s = o.easing, c = o.startTime, l = i ? t : t.cy(), u = l.style(); if (!o.easingImpl) if (s == null) o.easingImpl = dm.linear; else { var d; if (dt(s)) { var h = u.parse("transition-timing-function", s); d = h.value; } else d = s; var f, p; dt(d) ? (f = d, p = []) : (f = d[1], p = d.slice(2).map(function(I) { return +I; })), p.length > 0 ? (f === "spring" && p.push(o.duration), o.easingImpl = dm[f].apply(null, p)) : o.easingImpl = dm[f]; } var m = o.easingImpl, y; if (o.duration === 0 ? y = 1 : y = (r - c) / o.duration, o.applying && (y = o.progress), y < 0 ? y = 0 : y > 1 && (y = 1), o.delay == null) { var g = o.startPosition, v = o.position; if (v && n && !t.locked()) { var x = {}; gd(g.x, v.x) && (x.x = rc(g.x, v.x, y, m)), gd(g.y, v.y) && (x.y = rc(g.y, v.y, y, m)), t.position(x); } var w = o.startPan, S = o.pan, _ = a.pan, b = S != null && i; b && (gd(w.x, S.x) && (_.x = rc(w.x, S.x, y, m)), gd(w.y, S.y) && (_.y = rc(w.y, S.y, y, m)), t.emit("pan")); var T = o.startZoom, E = o.zoom, C = E != null && i; C && (gd(T, E) && (a.zoom = yh(a.minZoom, rc(T, E, y, m), a.maxZoom)), t.emit("zoom")), (b || C) && t.emit("viewport"); var L = o.style; if (L && L.length > 0 && n) { for (var A = 0; A < L.length; A++) { var k = L[A], P = k.name, R = k, M = o.startStyle[P], O = u.properties[M.name], D = rc(M, R, y, m, O); u.overrideBypass(t, P, D); } t.emit("style"); } } return o.progress = y, y; } function gd(t, e) { return t == null || e == null ? !1 : Xe(t) && Xe(e) ? !0 : !!(t && e); } function zW(t, e, r, i) { var n = e._private; n.started = !0, n.startTime = r - n.progress * n.duration; } function U_(t, e) { var r = e._private.aniEles, i = []; function n(u, d) { var h = u._private, f = h.animation.current, p = h.animation.queue, m = !1; if (f.length === 0) { var y = p.shift(); y && f.push(y); } for (var g = function(S) { for (var _ = S.length - 1; _ >= 0; _--) { var b = S[_]; b(); } S.splice(0, S.length); }, v = f.length - 1; v >= 0; v--) { var x = f[v], w = x._private; if (w.stopped) { f.splice(v, 1), w.hooked = !1, w.playing = !1, w.started = !1, g(w.frames); continue; } !w.playing && !w.applying || (w.playing && w.applying && (w.applying = !1), w.started || zW(u, x, t), FW(u, x, t, d), w.applying && (w.applying = !1), g(w.frames), w.step != null && w.step(t), x.completed() && (f.splice(v, 1), w.hooked = !1, w.playing = !1, w.started = !1, g(w.completes)), m = !0); } return !d && f.length === 0 && p.length === 0 && i.push(u), m; } for (var a = !1, o = 0; o < r.length; o++) { var s = r[o], c = n(s); a = a || c; } var l = n(e, !0); (a || l) && (r.length > 0 ? e.notify("draw", r) : e.notify("draw")), r.unmerge(i), e.emit("step"); } var $W = { // pull in animation functions animate: Xt.animate(), animation: Xt.animation(), animated: Xt.animated(), clearQueue: Xt.clearQueue(), delay: Xt.delay(), delayAnimation: Xt.delayAnimation(), stop: Xt.stop(), addToAnimationPool: function(t) { var e = this; e.styleEnabled() && e._private.aniEles.merge(t); }, stopAnimationLoop: function() { this._private.animationsRunning = !1; }, startAnimationLoop: function() { var t = this; if (t._private.animationsRunning = !0, !t.styleEnabled()) return; function e() { t._private.animationsRunning && Om(function(i) { U_(i, t), e(); }); } var r = t.renderer(); r && r.beforeRender ? r.beforeRender(function(i, n) { U_(n, t); }, r.beforeRenderPriorities.animations) : e(); } }, VW = { qualifierCompare: function(t, e) { return t == null || e == null ? t == null && e == null : t.sameText(e); }, eventMatches: function(t, e, r) { var i = e.qualifier; return i != null ? t !== r.target && rp(r.target) && i.matches(r.target) : !0; }, addEventFields: function(t, e) { e.cy = t, e.target = t; }, callbackContext: function(t, e, r) { return e.qualifier != null ? r.target : t; } }, Yp = function(t) { return dt(t) ? new ps(t) : t; }, y3 = { createEmitter: function() { var t = this._private; return t.emitter || (t.emitter = new Og(VW, this)), this; }, emitter: function() { return this._private.emitter; }, on: function(t, e, r) { return this.emitter().on(t, Yp(e), r), this; }, removeListener: function(t, e, r) { return this.emitter().removeListener(t, Yp(e), r), this; }, removeAllListeners: function() { return this.emitter().removeAllListeners(), this; }, one: function(t, e, r) { return this.emitter().one(t, Yp(e), r), this; }, once: function(t, e, r) { return this.emitter().one(t, Yp(e), r), this; }, emit: function(t, e) { return this.emitter().emit(t, e), this; }, emitAndNotify: function(t, e) { return this.emit(t), this.notify(t, e), this; } }; Xt.eventAliasesOn(y3); var Ly = { png: function(t) { var e = this._private.renderer; return t = t || {}, e.png(t); }, jpg: function(t) { var e = this._private.renderer; return t = t || {}, t.bg = t.bg || "#fff", e.jpg(t); } }; Ly.jpeg = Ly.jpg; var hm = { layout: function(t) { var e = this; if (t == null) { Tr("Layout options must be specified to make a layout"); return; } if (t.name == null) { Tr("A `name` must be specified to make a layout"); return; } var r = t.name, i = e.extension("layout", r); if (i == null) { Tr("No such layout `" + r + "` found. Did you forget to import it and `cytoscape.use()` it?"); return; } var n; dt(t.eles) ? n = e.$(t.eles) : n = t.eles != null ? t.eles : e.$(); var a = new i(bt({}, t, { cy: e, eles: n })); return a; } }; hm.createLayout = hm.makeLayout = hm.layout; var UW = { notify: function(t, e) { var r = this._private; if (this.batching()) { r.batchNotifications = r.batchNotifications || {}; var i = r.batchNotifications[t] = r.batchNotifications[t] || this.collection(); e != null && i.merge(e); return; } if (r.notificationsEnabled) { var n = this.renderer(); this.destroyed() || !n || n.notify(t, e); } }, notifications: function(t) { var e = this._private; return t === void 0 ? e.notificationsEnabled : (e.notificationsEnabled = !!t, this); }, noNotifications: function(t) { this.notifications(!1), t(), this.notifications(!0); }, batching: function() { return this._private.batchCount > 0; }, startBatch: function() { var t = this._private; return t.batchCount == null && (t.batchCount = 0), t.batchCount === 0 && (t.batchStyleEles = this.collection(), t.batchNotifications = {}), t.batchCount++, this; }, endBatch: function() { var t = this._private; if (t.batchCount === 0) return this; if (t.batchCount--, t.batchCount === 0) { t.batchStyleEles.updateStyle(); var e = this.renderer(); Object.keys(t.batchNotifications).forEach(function(r) { var i = t.batchNotifications[r]; i.empty() ? e.notify(r) : e.notify(r, i); }); } return this; }, batch: function(t) { return this.startBatch(), t(), this.endBatch(), this; }, // for backwards compatibility batchData: function(t) { var e = this; return this.batch(function() { for (var r = Object.keys(t), i = 0; i < r.length; i++) { var n = r[i], a = t[n], o = e.getElementById(n); o.data(a); } }); } }, jW = yi({ hideEdgesOnViewport: !1, textureOnViewport: !1, motionBlur: !1, motionBlurOpacity: 0.05, pixelRatio: void 0, desktopTapThreshold: 4, touchTapThreshold: 8, wheelSensitivity: 1, debug: !1, showFps: !1 }), ky = { renderTo: function(t, e, r, i) { var n = this._private.renderer; return n.renderTo(t, e, r, i), 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(t) { var e = this, r = e.extension("renderer", t.name); if (r == null) { Tr("Can not initialise: No such renderer `".concat(t.name, "` found. Did you forget to import it and `cytoscape.use()` it?")); return; } t.wheelSensitivity !== void 0 && Zt("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 i = jW(t); i.cy = e, e._private.renderer = new r(i), this.notify("init"); }, destroyRenderer: function() { var t = this; t.notify("destroy"); var e = t.container(); if (e) for (e._cyreg = null; e.childNodes.length > 0; ) e.removeChild(e.childNodes[0]); t._private.renderer = null, t.mutableElements().forEach(function(r) { var i = r._private; i.rscratch = {}, i.rstyle = {}, i.animation.current = [], i.animation.queue = []; }); }, onRender: function(t) { return this.on("render", t); }, offRender: function(t) { return this.off("render", t); } }; ky.invalidateDimensions = ky.resize; var pm = { // 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(t, e) { return dt(t) ? this.$(t) : on(t) ? t.collection() : ar(t) ? (e || (e = {}), new mi(this, t, e.unique, e.removed)) : new mi(this); }, nodes: function(t) { var e = this.$(function(r) { return r.isNode(); }); return t ? e.filter(t) : e; }, edges: function(t) { var e = this.$(function(r) { return r.isEdge(); }); return t ? e.filter(t) : e; }, // search the graph like jQuery $: function(t) { var e = this._private.elements; return t ? e.filter(t) : e.spawnSelf(); }, mutableElements: function() { return this._private.elements; } }; pm.elements = pm.filter = pm.$; var ki = {}, Xd = "t", HW = "f"; ki.apply = function(t) { for (var e = this, r = e._private, i = r.cy, n = i.collection(), a = 0; a < t.length; a++) { var o = t[a], s = e.getContextMeta(o); if (!s.empty) { var c = e.getContextStyle(s), l = e.applyContextStyle(s, c, o); o._private.appliedInitStyle ? e.updateTransitions(o, l.diffProps) : o._private.appliedInitStyle = !0; var u = e.updateStyleHints(o); u && n.push(o); } } return n; }; ki.getPropertiesDiff = function(t, e) { var r = this, i = r._private.propDiffs = r._private.propDiffs || {}, n = t + "-" + e, a = i[n]; if (a) return a; for (var o = [], s = {}, c = 0; c < r.length; c++) { var l = r[c], u = t[c] === Xd, d = e[c] === Xd, h = u !== d, f = l.mappedProperties.length > 0; if (h || d && f) { var p = void 0; h && f || h ? p = l.properties : f && (p = l.mappedProperties); for (var m = 0; m < p.length; m++) { for (var y = p[m], g = y.name, v = !1, x = c + 1; x < r.length; x++) { var w = r[x], S = e[x] === Xd; if (S && (v = w.properties[y.name] != null, v)) break; } !s[g] && !v && (s[g] = !0, o.push(g)); } } } return i[n] = o, o; }; ki.getContextMeta = function(t) { for (var e = this, r = "", i, n = t._private.styleCxtKey || "", a = 0; a < e.length; a++) { var o = e[a], s = o.selector && o.selector.matches(t); s ? r += Xd : r += HW; } return i = e.getPropertiesDiff(n, r), t._private.styleCxtKey = r, { key: r, diffPropNames: i, empty: i.length === 0 }; }; ki.getContextStyle = function(t) { var e = t.key, r = this, i = this._private.contextStyles = this._private.contextStyles || {}; if (i[e]) return i[e]; for (var n = { _private: { key: e } }, a = 0; a < r.length; a++) { var o = r[a], s = e[a] === Xd; if (s) for (var c = 0; c < o.properties.length; c++) { var l = o.properties[c]; n[l.name] = l; } } return i[e] = n, n; }; ki.applyContextStyle = function(t, e, r) { for (var i = this, n = t.diffPropNames, a = {}, o = i.types, s = 0; s < n.length; s++) { var c = n[s], l = e[c], u = r.pstyle(c); if (!l) if (u) u.bypass ? l = { name: c, deleteBypassed: !0 } : l = { name: c, delete: !0 }; else continue; if (u !== l) { if (l.mapped === o.fn && u != null && u.mapping != null && u.mapping.value === l.value) { var d = u.mapping, h = d.fnValue = l.value(r); if (h === d.prevFnValue) continue; } var f = a[c] = { prev: u }; i.applyParsedProperty(r, l), f.next = r.pstyle(c), f.next && f.next.bypass && (f.next = f.next.bypassed); } } return { diffProps: a }; }; ki.updateStyleHints = function(t) { var e = t._private, r = this, i = r.propertyGroupNames, n = r.propertyGroupKeys, a = function(Y, X, ie) { return r.getPropertiesHash(Y, X, ie); }, o = e.styleKey; if (t.removed()) return !1; var s = e.group === "nodes", c = t._private.style; i = Object.keys(c); for (var l = 0; l < n.length; l++) { var u = n[l]; e.styleKeys[u] = [Rc, Bd]; } for (var d = function(Y, X) { return e.styleKeys[X][0] = mh(Y, e.styleKeys[X][0]); }, h = function(Y, X) { return e.styleKeys[X][1] = gh(Y, e.styleKeys[X][1]); }, f = function(Y, X) { d(Y, X), h(Y, X); }, p = function(Y, X) { for (var ie = 0; ie < Y.length; ie++) { var ue = Y.charCodeAt(ie); d(ue, X), h(ue, X); } }, m = 2e9, y = function(Y) { return -128 < Y && Y < 128 && Math.floor(Y) !== Y ? m - (Y * 1024 | 0) : Y; }, g = 0; g < i.length; g++) { var v = i[g], x = c[v]; if (x != null) { var w = this.properties[v], S = w.type, _ = w.groupKey, b = void 0; w.hashOverride != null ? b = w.hashOverride(t, x) : x.pfValue != null && (b = x.pfValue); var T = w.enums == null ? x.value : null, E = b != null, C = T != null, L = E || C, A = x.units; if (S.number && L && !S.multiple) { var k = E ? b : T; f(y(k), _), !E && A != null && p(A, _); } else p(x.strValue, _); } } for (var P = [Rc, Bd], R = 0; R < n.length; R++) { var M = n[R], O = e.styleKeys[M]; P[0] = mh(O[0], P[0]), P[1] = gh(O[1], P[1]); } e.styleKey = qU(P[0], P[1]); var D = e.styleKeys; e.labelDimsKey = Co(D.labelDimensions); var I = a(t, ["label"], D.labelDimensions); if (e.labelKey = Co(I), e.labelStyleKey = Co(Vp(D.commonLabel, I)), !s) { var F = a(t, ["source-label"], D.labelDimensions); e.sourceLabelKey = Co(F), e.sourceLabelStyleKey = Co(Vp(D.commonLabel, F)); var z = a(t, ["target-label"], D.labelDimensions); e.targetLabelKey = Co(z), e.targetLabelStyleKey = Co(Vp(D.commonLabel, z)); } if (s) { var U = e.styleKeys, Z = U.nodeBody, re = U.nodeBorder, K = U.nodeOutline, V = U.backgroundImage, H = U.compound, G = U.pie, W = [Z, re, K, V, H, G].filter(function(Y) { return Y != null; }).reduce(Vp, [Rc, Bd]); e.nodeKey = Co(W), e.hasPie = G != null && G[0] !== Rc && G[1] !== Bd; } return o !== e.styleKey; }; ki.clearStyleHints = function(t) { var e = t._private; e.styleCxtKey = "", e.styleKeys = {}, e.styleKey = null, e.labelKey = null, e.labelStyleKey = null, e.sourceLabelKey = null, e.sourceLabelStyleKey = null, e.targetLabelKey = null, e.targetLabelStyleKey = null, e.nodeKey = null, e.hasPie = null; }; ki.applyParsedProperty = function(t, e) { var r = this, i = e, n = t._private.style, a, o = r.types, s = r.properties[i.name].type, c = i.bypass, l = n[i.name], u = l && l.bypass, d = t._private, h = "mapping", f = function(U) { return U == null ? null : U.pfValue != null ? U.pfValue : U.value; }, p = function() { var U = f(l), Z = f(i); r.checkTriggers(t, i.name, U, Z); }; if (e.name === "curve-style" && t.isEdge() && // loops must be bundled beziers (e.value !== "bezier" && t.isLoop() || // edges connected to compound nodes can not be haystacks e.value === "haystack" && (t.source().isParent() || t.target().isParent())) && (i = e = this.parse(e.name, "bezier", c)), i.delete) return n[i.name] = void 0, p(), !0; if (i.deleteBypassed) return l ? l.bypass ? (l.bypassed = void 0, p(), !0) : !1 : (p(), !0); if (i.deleteBypass) return l ? l.bypass ? (n[i.name] = l.bypassed, p(), !0) : !1 : (p(), !0); var m = function() { Zt("Do not assign mappings to elements without corresponding data (i.e. ele `" + t.id() + "` has no mapping for property `" + i.name + "` with data field `" + i.field + "`); try a `[" + i.field + "]` selector to limit scope to elements with `" + i.field + "` defined"); }; switch (i.mapped) { case o.mapData: { for (var y = i.field.split("."), g = d.data, v = 0; v < y.length && g; v++) { var x = y[v]; g = g[x]; } if (g == null) return m(), !1; var w; if (Xe(g)) { var S = i.fieldMax - i.fieldMin; S === 0 ? w = 0 : w = (g - i.fieldMin) / S; } else return Zt("Do not use continuous mappers without specifying numeric data (i.e. `" + i.field + ": " + g + "` for `" + t.id() + "` is non-numeric)"), !1; if (w < 0 ? w = 0 : w > 1 && (w = 1), s.color) { var _ = i.valueMin[0], b = i.valueMax[0], T = i.valueMin[1], E = i.valueMax[1], C = i.valueMin[2], L = i.valueMax[2], A = i.valueMin[3] == null ? 1 : i.valueMin[3], k = i.valueMax[3] == null ? 1 : i.valueMax[3], P = [Math.round(_ + (b - _) * w), Math.round(T + (E - T) * w), Math.round(C + (L - C) * w), Math.round(A + (k - A) * w)]; a = { // colours are simple, so just create the flat property instead of expensive string parsing bypass: i.bypass, // we're a bypass if the mapping property is a bypass name: i.name, value: P, strValue: "rgb(" + P[0] + ", " + P[1] + ", " + P[2] + ")" }; } else if (s.number) { var R = i.valueMin + (i.valueMax - i.valueMin) * w; a = this.parse(i.name, R, i.bypass, h); } else return !1; if (!a) return m(), !1; a.mapping = i, i = a; break; } case o.data: { for (var M = i.field.split("."), O = d.data, D = 0; D < M.length && O; D++) { var I = M[D]; O = O[I]; } if (O != null && (a = this.parse(i.name, O, i.bypass, h)), !a) return m(), !1; a.mapping = i, i = a; break; } case o.fn: { var F = i.value, z = i.fnValue != null ? i.fnValue : F(t); if (i.prevFnValue = z, z == null) return Zt("Custom function mappers may not return null (i.e. `" + i.name + "` for ele `" + t.id() + "` is null)"), !1; if (a = this.parse(i.name, z, i.bypass, h), !a) return Zt("Custom function mappers may not return invalid values for the property type (i.e. `" + i.name + "` for ele `" + t.id() + "` is invalid)"), !1; a.mapping = la(i), i = a; break; } case void 0: break; default: return !1; } return c ? (u ? i.bypassed = l.bypassed : i.bypassed = l, n[i.name] = i) : u ? l.bypassed = i : n[i.name] = i, p(), !0; }; ki.cleanElements = function(t, e) { for (var r = 0; r < t.length; r++) { var i = t[r]; if (this.clearStyleHints(i), i.dirtyCompoundBoundsCache(), i.dirtyBoundingBoxCache(), !e) i._private.style = {}; else for (var n = i._private.style, a = Object.keys(n), o = 0; o < a.length; o++) { var s = a[o], c = n[s]; c != null && (c.bypass ? c.bypassed = null : n[s] = null); } } }; ki.update = function() { var t = this._private.cy, e = t.mutableElements(); e.updateStyle(); }; ki.updateTransitions = function(t, e) { var r = this, i = t._private, n = t.pstyle("transition-property").value, a = t.pstyle("transition-duration").pfValue, o = t.pstyle("transition-delay").pfValue; if (n.length > 0 && a > 0) { for (var s = {}, c = !1, l = 0; l < n.length; l++) { var u = n[l], d = t.pstyle(u), h = e[u]; if (h) { var f = h.prev, p = f, m = h.next != null ? h.next : d, y = !1, g = void 0, v = 1e-6; p && (Xe(p.pfValue) && Xe(m.pfValue) ? (y = m.pfValue - p.pfValue, g = p.pfValue + v * y) : Xe(p.value) && Xe(m.value) ? (y = m.value - p.value, g = p.value + v * y) : ar(p.value) && ar(m.value) && (y = p.value[0] !== m.value[0] || p.value[1] !== m.value[1] || p.value[2] !== m.value[2], g = p.strValue), y && (s[u] = m.strValue, this.applyBypass(t, u, g), c = !0)); } } if (!c) return; i.transitioning = !0, new Bu(function(x) { o > 0 ? t.delayAnimation(o).play().promise().then(x) : x(); }).then(function() { return t.animation({ style: s, duration: a, easing: t.pstyle("transition-timing-function").value, queue: !1 }).play().promise(); }).then(function() { r.removeBypasses(t, n), t.emitAndNotify("style"), i.transitioning = !1; }); } else i.transitioning && (this.removeBypasses(t, n), t.emitAndNotify("style"), i.transitioning = !1); }; ki.checkTrigger = function(t, e, r, i, n, a) { var o = this.properties[e], s = n(o); s != null && s(r, i) && a(o); }; ki.checkZOrderTrigger = function(t, e, r, i) { var n = this; this.checkTrigger(t, e, r, i, function(a) { return a.triggersZOrder; }, function() { n._private.cy.notify("zorder", t); }); }; ki.checkBoundsTrigger = function(t, e, r, i) { this.checkTrigger(t, e, r, i, function(n) { return n.triggersBounds; }, function(n) { t.dirtyCompoundBoundsCache(), t.dirtyBoundingBoxCache(), // only for beziers -- so performance of other edges isn't affected n.triggersBoundsOfParallelBeziers && e === "curve-style" && (r === "bezier" || i === "bezier") && t.parallelEdges().forEach(function(a) { a.isBundledBezier() && a.dirtyBoundingBoxCache(); }), n.triggersBoundsOfConnectedEdges && e === "display" && (r === "none" || i === "none") && t.connectedEdges().forEach(function(a) { a.dirtyBoundingBoxCache(); }); }); }; ki.checkTriggers = function(t, e, r, i) { t.dirtyStyleCache(), this.checkZOrderTrigger(t, e, r, i), this.checkBoundsTrigger(t, e, r, i); }; var op = {}; op.applyBypass = function(t, e, r, i) { var n = this, a = [], o = !0; if (e === "*" || e === "**") { if (r !== void 0) for (var s = 0; s < n.properties.length; s++) { var c = n.properties[s], l = c.name, u = this.parse(l, r, !0); u && a.push(u); } } else if (dt(e)) { var d = this.parse(e, r, !0); d && a.push(d); } else if (Gt(e)) { var h = e; i = r; for (var f = Object.keys(h), p = 0; p < f.length; p++) { var m = f[p], y = h[m]; if (y === void 0 && (y = h[Sg(m)]), y !== void 0) { var g = this.parse(m, y, !0); g && a.push(g); } } } else return !1; if (a.length === 0) return !1; for (var v = !1, x = 0; x < t.length; x++) { for (var w = t[x], S = {}, _ = void 0, b = 0; b < a.length; b++) { var T = a[b]; if (i) { var E = w.pstyle(T.name); _ = S[T.name] = { prev: E }; } v = this.applyParsedProperty(w, la(T)) || v, i && (_.next = w.pstyle(T.name)); } v && this.updateStyleHints(w), i && this.updateTransitions(w, S, o); } return v; }; op.overrideBypass = function(t, e, r) { e = Lb(e); for (var i = 0; i < t.length; i++) { var n = t[i], a = n._private.style[e], o = this.properties[e].type, s = o.color, c = o.mutiple, l = a ? a.pfValue != null ? a.pfValue : a.value : null; !a || !a.bypass ? this.applyBypass(n, e, r) : (a.value = r, a.pfValue != null && (a.pfValue = r), s ? a.strValue = "rgb(" + r.join(",") + ")" : c ? a.strValue = r.join(" ") : a.strValue = "" + r, this.updateStyleHints(n)), this.checkTriggers(n, e, l, r); } }; op.removeAllBypasses = function(t, e) { return this.removeBypasses(t, this.propertyNames, e); }; op.removeBypasses = function(t, e, r) { for (var i = !0, n = 0; n < t.length; n++) { for (var a = t[n], o = {}, s = 0; s < e.length; s++) { var c = e[s], l = this.properties[c], u = a.pstyle(l.name); if (!(!u || !u.bypass)) { var d = "", h = this.parse(c, d, !0), f = o[l.name] = { prev: u }; this.applyParsedProperty(a, h), f.next = a.pstyle(l.name); } } this.updateStyleHints(a), r && this.updateTransitions(a, o, i); } }; var jb = {}; jb.getEmSizeInPixels = function() { var t = this.containerCss("font-size"); return t != null ? parseFloat(t) : 1; }; jb.containerCss = function(t) { var e = this._private.cy, r = e.container(), i = e.window(); if (i && r && i.getComputedStyle) return i.getComputedStyle(r).getPropertyValue(t); }; var ya = {}; ya.getRenderedStyle = function(t, e) { return e ? this.getStylePropertyValue(t, e, !0) : this.getRawStyle(t, !0); }; ya.getRawStyle = function(t, e) { var r = this; if (t = t[0], t) { for (var i = {}, n = 0; n < r.properties.length; n++) { var a = r.properties[n], o = r.getStylePropertyValue(t, a.name, e); o != null && (i[a.name] = o, i[Sg(a.name)] = o); } return i; } }; ya.getIndexedStyle = function(t, e, r, i) { var n = t.pstyle(e)[r][i]; return n ?? t.cy().style().getDefaultProperty(e)[r][0]; }; ya.getStylePropertyValue = function(t, e, r) { var i = this; if (t = t[0], t) { var n = i.properties[e]; n.alias && (n = n.pointsTo); var a = n.type, o = t.pstyle(n.name); if (o) { var s = o.value, c = o.units, l = o.strValue; if (r && a.number && s != null && Xe(s)) { var u = t.cy().zoom(), d = function(m) { return m * u; }, h = function(m, y) { return d(m) + y; }, f = ar(s), p = f ? c.every(function(m) { return m != null; }) : c != null; return p ? f ? s.map(function(m, y) { return h(m, c[y]); }).join(" ") : h(s, c) : f ? s.map(function(m) { return dt(m) ? m : "" + d(m); }).join(" ") : "" + d(s); } else if (l != null) return l; } return null; } }; ya.getAnimationStartStyle = function(t, e) { for (var r = {}, i = 0; i < e.length; i++) { var n = e[i], a = n.name, o = t.pstyle(a); o !== void 0 && (Gt(o) ? o = this.parse(a, o.strValue) : o = this.parse(a, o)), o && (r[a] = o); } return r; }; ya.getPropsList = function(t) { var e = this, r = [], i = t, n = e.properties; if (i) for (var a = Object.keys(i), o = 0; o < a.length; o++) { var s = a[o], c = i[s], l = n[s] || n[Lb(s)], u = this.parse(l.name, c); u && r.push(u); } return r; }; ya.getNonDefaultPropertiesHash = function(t, e, r) { var i = r.slice(), n, a, o, s, c, l; for (c = 0; c < e.length; c++) if (n = e[c], a = t.pstyle(n, !1), a != null) if (a.pfValue != null) i[0] = mh(s, i[0]), i[1] = gh(s, i[1]); else for (o = a.strValue, l = 0; l < o.length; l++) s = o.charCodeAt(l), i[0] = mh(s, i[0]), i[1] = gh(s, i[1]); return i; }; ya.getPropertiesHash = ya.getNonDefaultPropertiesHash; var Ng = {}; Ng.appendFromJson = function(t) { for (var e = this, r = 0; r < t.length; r++) { var i = t[r], n = i.selector, a = i.style || i.css, o = Object.keys(a); e.selector(n); for (var s = 0; s < o.length; s++) { var c = o[s], l = a[c]; e.css(c, l); } } return e; }; Ng.fromJson = function(t) { var e = this; return e.resetToDefault(), e.appendFromJson(t), e; }; Ng.json = function() { for (var t = [], e = this.defaultLength; e < this.length; e++) { for (var r = this[e], i = r.selector, n = r.properties, a = {}, o = 0; o < n.length; o++) { var s = n[o]; a[s.name] = s.strValue; } t.push({ selector: i ? i.toString() : "core", style: a }); } return t; }; var Hb = {}; Hb.appendFromString = function(t) { var e = this, r = this, i = "" + t, n, a, o; i = i.replace(/[/][*](\s|.)+?[*][/]/g, ""); function s() { i.length > n.length ? i = i.substr(n.length) : i = ""; } function c() { a.length > o.length ? a = a.substr(o.length) : a = ""; } for (; ; ) { var l = i.match(/^\s*$/); if (l) break; var u = i.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/); if (!u) { Zt("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: " + i); break; } n = u[0]; var d = u[1]; if (d !== "core") { var h = new ps(d); if (h.invalid) { Zt("Skipping parsing of block: Invalid selector found in string stylesheet: " + d), s(); continue; } } var f = u[2], p = !1; a = f; for (var m = []; ; ) { var y = a.match(/^\s*$/); if (y) break; var g = a.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/); if (!g) { Zt("Skipping parsing of block: Invalid formatting of style property and value definitions found in:" + f), p = !0; break; } o = g[0]; var v = g[1], x = g[2], w = e.properties[v]; if (!w) { Zt("Skipping property: Invalid property name in: " + o), c(); continue; } var S = r.parse(v, x); if (!S) { Zt("Skipping property: Invalid property definition in: " + o), c(); continue; } m.push({ name: v, val: x }), c(); } if (p) { s(); break; } r.selector(d); for (var _ = 0; _ < m.length; _++) { var b = m[_]; r.css(b.name, b.val); } s(); } return r; }; Hb.fromString = function(t) { var e = this; return e.resetToDefault(), e.appendFromString(t), e; }; var si = {}; (function() { var t = qr, e = Y8, r = J8, i = Q8, n = eU, a = function(G) { return "^" + G + "\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"; }, o = function(G) { var W = t + "|\\w+|" + e + "|" + r + "|" + i + "|" + n; return "^" + G + "\\s*\\(([\\w\\.]+)\\s*\\,\\s*(" + t + ")\\s*\\,\\s*(" + t + ")\\s*,\\s*(" + W + ")\\s*\\,\\s*(" + W + ")\\)$"; }, s = [`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`, "^(none)$", "^(.+)$"]; si.types = { time: { number: !0, min: 0, units: "s|ms", implicitUnits: "ms" }, percent: { number: !0, min: 0, max: 100, units: "%", implicitUnits: "%" }, percentages: { number: !0, min: 0, max: 100, units: "%", implicitUnits: "%", multiple: !0 }, zeroOneNumber: { number: !0, min: 0, max: 1, unitless: !0 }, zeroOneNumbers: { number: !0, min: 0, max: 1, unitless: !0, multiple: !0 }, nOneOneNumber: { number: !0, min: -1, max: 1, unitless: !0 }, nonNegativeInt: { number: !0, min: 0, integer: !0, unitless: !0 }, nonNegativeNumber: { number: !0, min: 0, unitless: !0 }, position: { enums: ["parent", "origin"] }, nodeSize: { number: !0, min: 0, enums: ["label"] }, number: { number: !0, unitless: !0 }, numbers: { number: !0, unitless: !0, multiple: !0 }, positiveNumber: { number: !0, unitless: !0, min: 0, strictMin: !0 }, size: { number: !0, min: 0 }, bidirectionalSize: { number: !0 }, // allows negative bidirectionalSizeMaybePercent: { number: !0, allowPercent: !0 }, // allows negative bidirectionalSizes: { number: !0, multiple: !0 }, // allows negative sizeMaybePercent: { number: !0, min: 0, allowPercent: !0 }, axisDirection: { enums: ["horizontal", "leftward", "rightward", "vertical", "upward", "downward", "auto"] }, paddingRelativeTo: { enums: ["width", "height", "average", "min", "max"] }, bgWH: { number: !0, min: 0, allowPercent: !0, enums: ["auto"], multiple: !0 }, bgPos: { number: !0, allowPercent: !0, multiple: !0 }, bgRelativeTo: { enums: ["inner", "include-padding"], multiple: !0 }, bgRepeat: { enums: ["repeat", "repeat-x", "repeat-y", "no-repeat"], multiple: !0 }, bgFit: { enums: ["none", "contain", "cover"], multiple: !0 }, bgCrossOrigin: { enums: ["anonymous", "use-credentials", "null"], multiple: !0 }, bgClip: { enums: ["none", "node"], multiple: !0 }, bgContainment: { enums: ["inside", "over"], multiple: !0 }, color: { color: !0 }, colors: { color: !0, multiple: !0 }, fill: { enums: ["solid", "linear-gradient", "radial-gradient"] }, bool: { enums: ["yes", "no"] }, bools: { enums: ["yes", "no"], multiple: !0 }, lineStyle: { enums: ["solid", "dotted", "dashed"] }, lineCap: { enums: ["butt", "round", "square"] }, linePosition: { enums: ["center", "inside", "outside"] }, lineJoin: { enums: ["round", "bevel", "miter"] }, borderStyle: { enums: ["solid", "dotted", "dashed", "double"] }, curveStyle: { enums: ["bezier", "unbundled-bezier", "haystack", "segments", "straight", "straight-triangle", "taxi", "round-segments", "round-taxi"] }, radiusType: { enums: ["arc-radius", "influence-radius"], multiple: !0 }, fontFamily: { regex: '^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$' }, fontStyle: { enums: ["italic", "normal", "oblique"] }, fontWeight: { enums: ["normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "800", "900", 100, 200, 300, 400, 500, 600, 700, 800, 900] }, textDecoration: { enums: ["none", "underline", "overline", "line-through"] }, textTransform: { enums: ["none", "uppercase", "lowercase"] }, textWrap: { enums: ["none", "wrap", "ellipsis"] }, textOverflowWrap: { enums: ["whitespace", "anywhere"] }, textBackgroundShape: { enums: ["rectangle", "roundrectangle", "round-rectangle"] }, nodeShape: { enums: ["rectangle", "roundrectangle", "round-rectangle", "cutrectangle", "cut-rectangle", "bottomroundrectangle", "bottom-round-rectangle", "barrel", "ellipse", "triangle", "round-triangle", "square", "pentagon", "round-pentagon", "hexagon", "round-hexagon", "concavehexagon", "concave-hexagon", "heptagon", "round-heptagon", "octagon", "round-octagon", "tag", "round-tag", "star", "diamond", "round-diamond", "vee", "rhomboid", "right-rhomboid", "polygon"] }, overlayShape: { enums: ["roundrectangle", "round-rectangle", "ellipse"] }, cornerRadius: { number: !0, min: 0, units: "px|em", implicitUnits: "px", enums: ["auto"] }, compoundIncludeLabels: { enums: ["include", "exclude"] }, arrowShape: { enums: ["tee", "triangle", "triangle-tee", "circle-triangle", "triangle-cross", "triangle-backcurve", "vee", "square", "circle", "diamond", "chevron", "none"] }, arrowFill: { enums: ["filled", "hollow"] }, arrowWidth: { number: !0, units: "%|px|em", implicitUnits: "px", enums: ["match-line"] }, display: { enums: ["element", "none"] }, visibility: { enums: ["hidden", "visible"] }, zCompoundDepth: { enums: ["bottom", "orphan", "auto", "top"] }, zIndexCompare: { enums: ["auto", "manual"] }, valign: { enums: ["top", "center", "bottom"] }, halign: { enums: ["left", "center", "right"] }, justification: { enums: ["left", "center", "right", "auto"] }, text: { string: !0 }, data: { mapping: !0, regex: a("data") }, layoutData: { mapping: !0, regex: a("layoutData") }, scratch: { mapping: !0, regex: a("scratch") }, mapData: { mapping: !0, regex: o("mapData") }, mapLayoutData: { mapping: !0, regex: o("mapLayoutData") }, mapScratch: { mapping: !0, regex: o("mapScratch") }, fn: { mapping: !0, fn: !0 }, url: { regexes: s, singleRegexMatchValue: !0 }, urls: { regexes: s, singleRegexMatchValue: !0, multiple: !0 }, propList: { propList: !0 }, angle: { number: !0, units: "deg|rad", implicitUnits: "rad" }, textRotation: { number: !0, units: "deg|rad", implicitUnits: "rad", enums: ["none", "autorotate"] }, polygonPointList: { number: !0, multiple: !0, evenMultiple: !0, min: -1, max: 1, unitless: !0 }, edgeDistances: { enums: ["intersection", "node-position", "endpoints"] }, edgeEndpoint: { number: !0, multiple: !0, units: "%|px|em|deg|rad", implicitUnits: "px", enums: ["inside-to-node", "outside-to-node", "outside-to-node-or-label", "outside-to-line", "outside-to-line-or-label"], singleEnum: !0, validate: function(G, W) { switch (G.length) { case 2: return W[0] !== "deg" && W[0] !== "rad" && W[1] !== "deg" && W[1] !== "rad"; case 1: return dt(G[0]) || W[0] === "deg" || W[0] === "rad"; default: return !1; } } }, easing: { regexes: ["^(spring)\\s*\\(\\s*(" + t + ")\\s*,\\s*(" + t + ")\\s*\\)$", "^(cubic-bezier)\\s*\\(\\s*(" + t + ")\\s*,\\s*(" + t + ")\\s*,\\s*(" + t + ")\\s*,\\s*(" + t + ")\\s*\\)$"], enums: ["linear", "ease", "ease-in", "ease-out", "ease-in-out", "ease-in-sine", "ease-out-sine", "ease-in-out-sine", "ease-in-quad", "ease-out-quad", "ease-in-out-quad", "ease-in-cubic", "ease-out-cubic", "ease-in-out-cubic", "ease-in-quart", "ease-out-quart", "ease-in-out-quart", "ease-in-quint", "ease-out-quint", "ease-in-out-quint", "ease-in-expo", "ease-out-expo", "ease-in-out-expo", "ease-in-circ", "ease-out-circ", "ease-in-out-circ"] }, gradientDirection: { enums: [ "to-bottom", "to-top", "to-left", "to-right", "to-bottom-right", "to-bottom-left", "to-top-right", "to-top-left", "to-right-bottom", "to-left-bottom", "to-right-top", "to-left-top" // different order ] }, boundsExpansion: { number: !0, multiple: !0, min: 0, validate: function(G) { var W = G.length; return W === 1 || W === 2 || W === 4; } } }; var c = { zeroNonZero: function(G, W) { return (G == null || W == null) && G !== W || G == 0 && W != 0 ? !0 : G != 0 && W == 0; }, any: function(G, W) { return G != W; }, emptyNonEmpty: function(G, W) { var Y = ds(G), X = ds(W); return Y && !X || !Y && X; } }, l = si.types, u = [{ name: "label", type: l.text, triggersBounds: c.any, triggersZOrder: c.emptyNonEmpty }, { name: "text-rotation", type: l.textRotation, triggersBounds: c.any }, { name: "text-margin-x", type: l.bidirectionalSize, triggersBounds: c.any }, { name: "text-margin-y", type: l.bidirectionalSize, triggersBounds: c.any }], d = [{ name: "source-label", type: l.text, triggersBounds: c.any }, { name: "source-text-rotation", type: l.textRotation, triggersBounds: c.any }, { name: "source-text-margin-x", type: l.bidirectionalSize, triggersBounds: c.any }, { name: "source-text-margin-y", type: l.bidirectionalSize, triggersBounds: c.any }, { name: "source-text-offset", type: l.size, triggersBounds: c.any }], h = [{ name: "target-label", type: l.text, triggersBounds: c.any }, { name: "target-text-rotation", type: l.textRotation, triggersBounds: c.any }, { name: "target-text-margin-x", type: l.bidirectionalSize, triggersBounds: c.any }, { name: "target-text-margin-y", type: l.bidirectionalSize, triggersBounds: c.any }, { name: "target-text-offset", type: l.size, triggersBounds: c.any }], f = [{ name: "font-family", type: l.fontFamily, triggersBounds: c.any }, { name: "font-style", type: l.fontStyle, triggersBounds: c.any }, { name: "font-weight", type: l.fontWeight, triggersBounds: c.any }, { name: "font-size", type: l.size, triggersBounds: c.any }, { name: "text-transform", type: l.textTransform, triggersBounds: c.any }, { name: "text-wrap", type: l.textWrap, triggersBounds: c.any }, { name: "text-overflow-wrap", type: l.textOverflowWrap, triggersBounds: c.any }, { name: "text-max-width", type: l.size, triggersBounds: c.any }, { name: "text-outline-width", type: l.size, triggersBounds: c.any }, { name: "line-height", type: l.positiveNumber, triggersBounds: c.any }], p = [{ name: "text-valign", type: l.valign, triggersBounds: c.any }, { name: "text-halign", type: l.halign, triggersBounds: c.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: c.any }, { name: "text-border-opacity", type: l.zeroOneNumber }, { name: "text-border-color", type: l.color }, { name: "text-border-width", type: l.size, triggersBounds: c.any }, { name: "text-border-style", type: l.borderStyle, triggersBounds: c.any }, { name: "text-background-shape", type: l.textBackgroundShape, triggersBounds: c.any }, { name: "text-justification", type: l.justification }], m = [{ name: "events", type: l.bool, triggersZOrder: c.any }, { name: "text-events", type: l.bool, triggersZOrder: c.any }], y = [{ name: "display", type: l.display, triggersZOrder: c.any, triggersBounds: c.any, triggersBoundsOfConnectedEdges: !0 }, { name: "visibility", type: l.visibility, triggersZOrder: c.any }, { name: "opacity", type: l.zeroOneNumber, triggersZOrder: c.zeroNonZero }, { name: "text-opacity", type: l.zeroOneNumber }, { name: "min-zoomed-font-size", type: l.size }, { name: "z-compound-depth", type: l.zCompoundDepth, triggersZOrder: c.any }, { name: "z-index-compare", type: l.zIndexCompare, triggersZOrder: c.any }, { name: "z-index", type: l.number, triggersZOrder: c.any }], g = [{ name: "overlay-padding", type: l.size, triggersBounds: c.any }, { name: "overlay-color", type: l.color }, { name: "overlay-opacity", type: l.zeroOneNumber, triggersBounds: c.zeroNonZero }, { name: "overlay-shape", type: l.overlayShape, triggersBounds: c.any }, { name: "overlay-corner-radius", type: l.cornerRadius }], v = [{ name: "underlay-padding", type: l.size, triggersBounds: c.any }, { name: "underlay-color", type: l.color }, { name: "underlay-opacity", type: l.zeroOneNumber, triggersBounds: c.zeroNonZero }, { name: "underlay-shape", type: l.overlayShape, triggersBounds: c.any }, { name: "underlay-corner-radius", type: l.cornerRadius }], x = [{ 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, W) { return W.value === "label" ? -G.poolIndex() : W.pfValue; }, S = [{ name: "height", type: l.nodeSize, triggersBounds: c.any, hashOverride: w }, { name: "width", type: l.nodeSize, triggersBounds: c.any, hashOverride: w }, { name: "shape", type: l.nodeShape, triggersBounds: c.any }, { name: "shape-polygon-points", type: l.polygonPointList, triggersBounds: c.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: c.any }, { name: "padding-relative-to", type: l.paddingRelativeTo, triggersBounds: c.any }, { name: "bounds-expansion", type: l.boundsExpansion, triggersBounds: c.any }], _ = [{ name: "border-color", type: l.color }, { name: "border-opacity", type: l.zeroOneNumber }, { name: "border-width", type: l.size, triggersBounds: c.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 }], b = [{ name: "outline-color", type: l.color }, { name: "outline-opacity", type: l.zeroOneNumber }, { name: "outline-width", type: l.size, triggersBounds: c.any }, { name: "outline-style", type: l.borderStyle }, { name: "outline-offset", type: l.size, triggersBounds: c.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 }], E = [{ name: "position", type: l.position, triggersBounds: c.any }, { name: "compound-sizing-wrt-labels", type: l.compoundIncludeLabels, triggersBounds: c.any }, { name: "min-width", type: l.size, triggersBounds: c.any }, { name: "min-width-bias-left", type: l.sizeMaybePercent, triggersBounds: c.any }, { name: "min-width-bias-right", type: l.sizeMaybePercent, triggersBounds: c.any }, { name: "min-height", type: l.size, triggersBounds: c.any }, { name: "min-height-bias-top", type: l.sizeMaybePercent, triggersBounds: c.any }, { name: "min-height-bias-bottom", type: l.sizeMaybePercent, triggersBounds: c.any }], C = [{ 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: c.any, triggersBoundsOfParallelBeziers: !0 }, { name: "haystack-radius", type: l.zeroOneNumber, triggersBounds: c.any }, { name: "source-endpoint", type: l.edgeEndpoint, triggersBounds: c.any }, { name: "target-endpoint", type: l.edgeEndpoint, triggersBounds: c.any }, { name: "control-point-step-size", type: l.size, triggersBounds: c.any }, { name: "control-point-distances", type: l.bidirectionalSizes, triggersBounds: c.any }, { name: "control-point-weights", type: l.numbers, triggersBounds: c.any }, { name: "segment-distances", type: l.bidirectionalSizes, triggersBounds: c.any }, { name: "segment-weights", type: l.numbers, triggersBounds: c.any }, { name: "segment-radii", type: l.numbers, triggersBounds: c.any }, { name: "radius-type", type: l.radiusType, triggersBounds: c.any }, { name: "taxi-turn", type: l.bidirectionalSizeMaybePercent, triggersBounds: c.any }, { name: "taxi-turn-min-distance", type: l.size, triggersBounds: c.any }, { name: "taxi-direction", type: l.axisDirection, triggersBounds: c.any }, { name: "taxi-radius", type: l.number, triggersBounds: c.any }, { name: "edge-distances", type: l.edgeDistances, triggersBounds: c.any }, { name: "arrow-scale", type: l.positiveNumber, triggersBounds: c.any }, { name: "loop-direction", type: l.angle, triggersBounds: c.any }, { name: "loop-sweep", type: l.angle, triggersBounds: c.any }, { name: "source-distance-from-node", type: l.size, triggersBounds: c.any }, { name: "target-distance-from-node", type: l.size, triggersBounds: c.any }], L = [{ name: "ghost", type: l.bool, triggersBounds: c.any }, { name: "ghost-offset-x", type: l.bidirectionalSize, triggersBounds: c.any }, { name: "ghost-offset-y", type: l.bidirectionalSize, triggersBounds: c.any }, { name: "ghost-opacity", type: l.zeroOneNumber }], A = [{ 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 }], k = []; si.pieBackgroundN = 16, k.push({ name: "pie-size", type: l.sizeMaybePercent }); for (var P = 1; P <= si.pieBackgroundN; P++) k.push({ name: "pie-" + P + "-background-color", type: l.color }), k.push({ name: "pie-" + P + "-background-size", type: l.percent }), k.push({ name: "pie-" + P + "-background-opacity", type: l.zeroOneNumber }); var R = [], M = si.arrowPrefixes = ["source", "mid-source", "target", "mid-target"]; [{ name: "arrow-shape", type: l.arrowShape, triggersBounds: c.any }, { name: "arrow-color", type: l.color }, { name: "arrow-fill", type: l.arrowFill }, { name: "arrow-width", type: l.arrowWidth }].forEach(function(G) { M.forEach(function(W) { var Y = W + "-" + G.name, X = G.type, ie = G.triggersBounds; R.push({ name: Y, type: X, triggersBounds: ie }); }); }, {}); var O = si.properties = [].concat(m, x, y, g, v, L, p, f, u, d, h, S, _, b, T, k, E, C, R, A), D = si.propertyGroups = { // common to all eles behavior: m, transition: x, visibility: y, overlay: g, underlay: v, ghost: L, // labels commonLabel: p, labelDimensions: f, mainLabel: u, sourceLabel: d, targetLabel: h, // node props nodeBody: S, nodeBorder: _, nodeOutline: b, backgroundImage: T, pie: k, compound: E, // edge props edgeLine: C, edgeArrow: R, core: A }, I = si.propertyGroupNames = {}, F = si.propertyGroupKeys = Object.keys(D); F.forEach(function(G) { I[G] = D[G].map(function(W) { return W.name; }), D[G].forEach(function(W) { return W.groupKey = G; }); }); var z = si.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" }]; si.propertyNames = O.map(function(G) { return G.name; }); for (var U = 0; U < O.length; U++) { var Z = O[U]; O[Z.name] = Z; } for (var re = 0; re < z.length; re++) { var K = z[re], V = O[K.pointsTo], H = { name: K.name, alias: !0, pointsTo: V }; O.push(H), O[K.name] = H; } })(); si.getDefaultProperty = function(t) { return this.getDefaultProperties()[t]; }; si.getDefaultProperties = function() { var t = this._private; if (t.defaultProperties != null) return t.defaultProperties; for (var e = bt({ // 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(c, l) { for (var u = 1; u <= si.pieBackgroundN; u++) { var d = l.name.replace("{{i}}", u), h = l.value; c[d] = h; } return c; }, {}), { // 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(c, l) { return si.arrowPrefixes.forEach(function(u) { var d = u + "-" + l.name, h = l.value; c[d] = h; }), c; }, {})), r = {}, i = 0; i < this.properties.length; i++) { var n = this.properties[i]; if (!n.pointsTo) { var a = n.name, o = e[a], s = this.parse(a, o); r[a] = s; } } return t.defaultProperties = r, t.defaultProperties; }; si.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 Bg = {}; Bg.parse = function(t, e, r, i) { var n = this; if (xr(e)) return n.parseImplWarn(t, e, r, i); var a = i === "mapping" || i === !0 || i === !1 || i == null ? "dontcare" : i, o = r ? "t" : "f", s = "" + e, c = AA(t, s, o, a), l = n.propCache = n.propCache || [], u; return (u = l[c]) || (u = l[c] = n.parseImplWarn(t, e, r, i)), (r || i === "mapping") && (u = la(u), u && (u.value = la(u.value))), u; }; Bg.parseImplWarn = function(t, e, r, i) { var n = this.parseImpl(t, e, r, i); return !n && e != null && Zt("The style property `".concat(t, ": ").concat(e, "` is invalid")), n && (n.name === "width" || n.name === "height") && e === "label" && Zt("The style value of `label` is deprecated for `" + n.name + "`"), n; }; Bg.parseImpl = function(t, e, r, i) { var n = this; t = Lb(t); var a = n.properties[t], o = e, s = n.types; if (!a || e === void 0) return null; a.alias && (a = a.pointsTo, t = a.name); var c = dt(e); c && (e = e.trim()); var l = a.type; if (!l) return null; if (r && (e === "" || e === null)) return { name: t, value: e, bypass: !0, deleteBypass: !0 }; if (xr(e)) return { name: t, value: e, strValue: "fn", mapped: s.fn, bypass: r }; var u, d; if (!(!c || i || e.length < 7 || e[1] !== "a")) { if (e.length >= 7 && e[0] === "d" && (u = new RegExp(s.data.regex).exec(e))) { if (r) return !1; var h = s.data; return { name: t, value: u, strValue: "" + e, mapped: h, field: u[1], bypass: r }; } else if (e.length >= 10 && e[0] === "m" && (d = new RegExp(s.mapData.regex).exec(e))) { if (r || l.multiple) return !1; var f = s.mapData; if (!(l.color || l.number)) return !1; var p = this.parse(t, d[4]); if (!p || p.mapped) return !1; var m = this.parse(t, d[5]); if (!m || m.mapped) return !1; if (p.pfValue === m.pfValue || p.strValue === m.strValue) return Zt("`" + t + ": " + e + "` is not a valid mapper because the output range is zero; converting to `" + t + ": " + p.strValue + "`"), this.parse(t, p.strValue); if (l.color) { var y = p.value, g = m.value, v = y[0] === g[0] && y[1] === g[1] && y[2] === g[2] && // optional alpha (y[3] === g[3] || (y[3] == null || y[3] === 1) && (g[3] == null || g[3] === 1)); if (v) return !1; } return { name: t, value: d, strValue: "" + e, mapped: f, field: d[1], fieldMin: parseFloat(d[2]), // min & max are numeric fieldMax: parseFloat(d[3]), valueMin: p.value, valueMax: m.value, bypass: r }; } } if (l.multiple && i !== "multiple") { var x; if (c ? x = e.split(/\s+/) : ar(e) ? x = e : x = [e], l.evenMultiple && x.length % 2 !== 0) return null; for (var w = [], S = [], _ = [], b = "", T = !1, E = 0; E < x.length; E++) { var C = n.parse(t, x[E], r, "multiple"); T = T || dt(C.value), w.push(C.value), _.push(C.pfValue != null ? C.pfValue : C.value), S.push(C.units), b += (E > 0 ? " " : "") + C.strValue; } return l.validate && !l.validate(w, S) ? null : l.singleEnum && T ? w.length === 1 && dt(w[0]) ? { name: t, value: w[0], strValue: w[0], bypass: r } : null : { name: t, value: w, pfValue: _, strValue: b, bypass: r, units: S }; } var L = function() { for (var G = 0; G < l.enums.length; G++) { var W = l.enums[G]; if (W === e) return { name: t, value: e, strValue: "" + e, bypass: r }; } return null; }; if (l.number) { var A, k = "px"; if (l.units && (A = l.units), l.implicitUnits && (k = l.implicitUnits), !l.unitless) if (c) { var P = "px|em" + (l.allowPercent ? "|\\%" : ""); A && (P = A); var R = e.match("^(" + qr + ")(" + P + ")?$"); R && (e = R[1], A = R[2] || k); } else (!A || l.implicitUnits) && (A = k); if (e = parseFloat(e), isNaN(e) && l.enums === void 0) return null; if (isNaN(e) && l.enums !== void 0) return e = o, L(); if (l.integer && !j8(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 M = { name: t, value: e, strValue: "" + e + (A || ""), units: A, bypass: r }; return l.unitless || A !== "px" && A !== "em" ? M.pfValue = e : M.pfValue = A === "px" || !A ? e : this.getEmSizeInPixels() * e, (A === "ms" || A === "s") && (M.pfValue = A === "ms" ? e : 1e3 * e), (A === "deg" || A === "rad") && (M.pfValue = A === "rad" ? e : Ej(e)), A === "%" && (M.pfValue = e / 100), M; } else if (l.propList) { var O = [], D = "" + e; if (D !== "none") { for (var I = D.split(/\s*,\s*|\s+/), F = 0; F < I.length; F++) { var z = I[F].trim(); n.properties[z] ? O.push(z) : Zt("`" + z + "` is not a valid property name"); } if (O.length === 0) return null; } return { name: t, value: O, strValue: O.length === 0 ? "none" : O.join(" "), bypass: r }; } else if (l.color) { var U = oU(e); return U ? { name: t, value: U, pfValue: U, strValue: "rgb(" + U[0] + "," + U[1] + "," + U[2] + ")", // n.b. no spaces b/c of multiple support bypass: r } : null; } else if (l.regex || l.regexes) { if (l.enums) { var Z = L(); if (Z) return Z; } for (var re = l.regexes ? l.regexes : [l.regex], K = 0; K < re.length; K++) { var V = new RegExp(re[K]), H = V.exec(e); if (H) return { name: t, value: l.singleRegexMatchValue ? H[1] : H, strValue: "" + e, bypass: r }; } return null; } else return l.string ? { name: t, value: "" + e, strValue: "" + e, bypass: r } : l.enums ? L() : null; }; var Ti = function t(e) { if (!(this instanceof t)) return new t(e); if (!Ab(e)) { Tr("A style must have a core reference"); return; } this._private = { cy: e, coreStyle: {} }, this.length = 0, this.resetToDefault(); }, Ai = Ti.prototype; Ai.instanceString = function() { return "style"; }; Ai.clear = function() { for (var t = this._private, e = t.cy, r = e.elements(), i = 0; i < this.length; i++) this[i] = void 0; return this.length = 0, t.contextStyles = {}, t.propDiffs = {}, this.cleanElements(r, !0), r.forEach(function(n) { var a = n[0]._private; a.styleDirty = !0, a.appliedInitStyle = !1; }), this; }; Ai.resetToDefault = function() { return this.clear(), this.addDefaultStylesheet(), this; }; Ai.core = function(t) { return this._private.coreStyle[t] || this.getDefaultProperty(t); }; Ai.selector = function(t) { var e = t === "core" ? null : new ps(t), r = this.length++; return this[r] = { selector: e, properties: [], mappedProperties: [], index: r }, this; }; Ai.css = function() { var t = this, e = arguments; if (e.length === 1) for (var r = e[0], i = 0; i < t.properties.length; i++) { var n = t.properties[i], a = r[n.name]; a === void 0 && (a = r[Sg(n.name)]), a !== void 0 && this.cssRule(n.name, a); } else e.length === 2 && this.cssRule(e[0], e[1]); return this; }; Ai.style = Ai.css; Ai.cssRule = function(t, e) { var r = this.parse(t, e); if (r) { var i = this.length - 1; this[i].properties.push(r), this[i].properties[r.name] = r, r.name.match(/pie-(\d+)-background-size/) && r.value && (this._private.hasPie = !0), r.mapped && this[i].mappedProperties.push(r); var n = !this[i].selector; n && (this._private.coreStyle[r.name] = r); } return this; }; Ai.append = function(t) { return yA(t) ? t.appendToStyle(this) : ar(t) ? this.appendFromJson(t) : dt(t) && this.appendFromString(t), this; }; Ti.fromJson = function(t, e) { var r = new Ti(t); return r.fromJson(e), r; }; Ti.fromString = function(t, e) { return new Ti(t).fromString(e); }; [ki, op, jb, ya, Ng, Hb, si, Bg].forEach(function(t) { bt(Ai, t); }); Ti.types = Ai.types; Ti.properties = Ai.properties; Ti.propertyGroups = Ai.propertyGroups; Ti.propertyGroupNames = Ai.propertyGroupNames; Ti.propertyGroupKeys = Ai.propertyGroupKeys; var GW = { style: function(t) { if (t) { var e = this.setStyle(t); e.update(); } return this._private.style; }, setStyle: function(t) { var e = this._private; return yA(t) ? e.style = t.generateStyle(this) : ar(t) ? e.style = Ti.fromJson(this, t) : dt(t) ? e.style = Ti.fromString(this, t) : e.style = Ti(this), e.style; }, // e.g. cy.data() changed => recalc ele mappers updateStyle: function() { this.mutableElements().updateStyle(); } }, WW = "single", El = { autolock: function(t) { if (t !== void 0) this._private.autolock = !!t; else return this._private.autolock; return this; }, autoungrabify: function(t) { if (t !== void 0) this._private.autoungrabify = !!t; else return this._private.autoungrabify; return this; }, autounselectify: function(t) { if (t !== void 0) this._private.autounselectify = !!t; else return this._private.autounselectify; return this; }, selectionType: function(t) { var e = this._private; if (e.selectionType == null && (e.selectionType = WW), t !== void 0) (t === "additive" || t === "single") && (e.selectionType = t); else return e.selectionType; return this; }, panningEnabled: function(t) { if (t !== void 0) this._private.panningEnabled = !!t; else return this._private.panningEnabled; return this; }, userPanningEnabled: function(t) { if (t !== void 0) this._private.userPanningEnabled = !!t; else return this._private.userPanningEnabled; return this; }, zoomingEnabled: function(t) { if (t !== void 0) this._private.zoomingEnabled = !!t; else return this._private.zoomingEnabled; return this; }, userZoomingEnabled: function(t) { if (t !== void 0) this._private.userZoomingEnabled = !!t; else return this._private.userZoomingEnabled; return this; }, boxSelectionEnabled: function(t) { if (t !== void 0) this._private.boxSelectionEnabled = !!t; else return this._private.boxSelectionEnabled; return this; }, pan: function() { var t = arguments, e = this._private.pan, r, i, n, a, o; switch (t.length) { case 0: return e; case 1: if (dt(t[0])) return r = t[0], e[r]; if (Gt(t[0])) { if (!this._private.panningEnabled) return this; n = t[0], a = n.x, o = n.y, Xe(a) && (e.x = a), Xe(o) && (e.y = o), this.emit("pan viewport"); } break; case 2: if (!this._private.panningEnabled) return this; r = t[0], i = t[1], (r === "x" || r === "y") && Xe(i) && (e[r] = i), this.emit("pan viewport"); break; } return this.notify("viewport"), this; }, panBy: function(t, e) { var r = arguments, i = this._private.pan, n, a, o, s, c; if (!this._private.panningEnabled) return this; switch (r.length) { case 1: Gt(t) && (o = r[0], s = o.x, c = o.y, Xe(s) && (i.x += s), Xe(c) && (i.y += c), this.emit("pan viewport")); break; case 2: n = t, a = e, (n === "x" || n === "y") && Xe(a) && (i[n] += a), this.emit("pan viewport"); break; } return this.notify("viewport"), this; }, fit: function(t, e) { var r = this.getFitViewport(t, e); if (r) { var i = this._private; i.zoom = r.zoom, i.pan = r.pan, this.emit("pan zoom viewport"), this.notify("viewport"); } return this; }, getFitViewport: function(t, e) { if (Xe(t) && e === void 0 && (e = t, t = void 0), !(!this._private.panningEnabled || !this._private.zoomingEnabled)) { var r; if (dt(t)) { var i = t; t = this.$(i); } else if (W8(t)) { var n = t; r = { x1: n.x1, y1: n.y1, x2: n.x2, y2: n.y2 }, r.w = r.x2 - r.x1, r.h = r.y2 - r.y1; } else on(t) || (t = this.mutableElements()); if (!(on(t) && t.empty())) { r = r || t.boundingBox(); var a = this.width(), o = this.height(), s; if (e = Xe(e) ? e : 0, !isNaN(a) && !isNaN(o) && a > 0 && o > 0 && !isNaN(r.w) && !isNaN(r.h) && r.w > 0 && r.h > 0) { s = Math.min((a - 2 * e) / r.w, (o - 2 * e) / r.h), s = s > this._private.maxZoom ? this._private.maxZoom : s, s = s < this._private.minZoom ? this._private.minZoom : s; var c = { // now pan to middle x: (a - s * (r.x1 + r.x2)) / 2, y: (o - s * (r.y1 + r.y2)) / 2 }; return { zoom: s, pan: c }; } } } }, zoomRange: function(t, e) { var r = this._private; if (e == null) { var i = t; t = i.min, e = i.max; } return Xe(t) && Xe(e) && t <= e ? (r.minZoom = t, r.maxZoom = e) : Xe(t) && e === void 0 && t <= r.maxZoom ? r.minZoom = t : Xe(e) && t === void 0 && e >= r.minZoom && (r.maxZoom = e), this; }, minZoom: function(t) { return t === void 0 ? this._private.minZoom : this.zoomRange({ min: t }); }, maxZoom: function(t) { return t === void 0 ? this._private.maxZoom : this.zoomRange({ max: t }); }, getZoomedViewport: function(t) { var e = this._private, r = e.pan, i = e.zoom, n, a, o = !1; if (e.zoomingEnabled || (o = !0), Xe(t) ? a = t : Gt(t) && (a = t.level, t.position != null ? n = Cg(t.position, i, r) : t.renderedPosition != null && (n = t.renderedPosition), n != null && !e.panningEnabled && (o = !0)), a = a > e.maxZoom ? e.maxZoom : a, a = a < e.minZoom ? e.minZoom : a, o || !Xe(a) || a === i || n != null && (!Xe(n.x) || !Xe(n.y))) return null; if (n != null) { var s = r, c = i, l = a, u = { x: -l / c * (n.x - s.x) + n.x, y: -l / c * (n.y - s.y) + n.y }; return { zoomed: !0, panned: !0, zoom: l, pan: u }; } else return { zoomed: !0, panned: !1, zoom: a, pan: r }; }, zoom: function(t) { if (t === void 0) return this._private.zoom; var e = this.getZoomedViewport(t), r = this._private; return e == null || !e.zoomed ? this : (r.zoom = e.zoom, e.panned && (r.pan.x = e.pan.x, r.pan.y = e.pan.y), this.emit("zoom" + (e.panned ? " pan" : "") + " viewport"), this.notify("viewport"), this); }, viewport: function(t) { var e = this._private, r = !0, i = !0, n = [], a = !1, o = !1; if (!t) return this; if (Xe(t.zoom) || (r = !1), Gt(t.pan) || (i = !1), !r && !i) return this; if (r) { var s = t.zoom; s < e.minZoom || s > e.maxZoom || !e.zoomingEnabled ? a = !0 : (e.zoom = s, n.push("zoom")); } if (i && (!a || !t.cancelOnFailedZoom) && e.panningEnabled) { var c = t.pan; Xe(c.x) && (e.pan.x = c.x, o = !1), Xe(c.y) && (e.pan.y = c.y, o = !1), o || n.push("pan"); } return n.length > 0 && (n.push("viewport"), this.emit(n.join(" ")), this.notify("viewport")), this; }, center: function(t) { var e = this.getCenterPan(t); return e && (this._private.pan = e, this.emit("pan viewport"), this.notify("viewport")), this; }, getCenterPan: function(t, e) { if (this._private.panningEnabled) { if (dt(t)) { var r = t; t = this.mutableElements().filter(r); } else on(t) || (t = this.mutableElements()); if (t.length !== 0) { var i = t.boundingBox(), n = this.width(), a = this.height(); e = e === void 0 ? this._private.zoom : e; var o = { // middle x: (n - e * (i.x1 + i.x2)) / 2, y: (a - e * (i.y1 + i.y2)) / 2 }; return o; } } }, 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 t = this._private, e = t.container, r = this; return t.sizeCache = t.sizeCache || (e ? function() { var i = r.window().getComputedStyle(e), n = function(a) { return parseFloat(i.getPropertyValue(a)); }; return { width: e.clientWidth - n("padding-left") - n("padding-right"), height: e.clientHeight - n("padding-top") - n("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 t = this._private.pan, e = this._private.zoom, r = this.renderedExtent(), i = { x1: (r.x1 - t.x) / e, x2: (r.x2 - t.x) / e, y1: (r.y1 - t.y) / e, y2: (r.y2 - t.y) / e }; return i.w = i.x2 - i.x1, i.h = i.y2 - i.y1, i; }, renderedExtent: function() { var t = this.width(), e = this.height(); return { x1: 0, y1: 0, x2: t, y2: e, w: t, h: e }; }, multiClickDebounceTime: function(t) { if (t) this._private.multiClickDebounceTime = t; else return this._private.multiClickDebounceTime; return this; } }; El.centre = El.center; El.autolockNodes = El.autolock; El.autoungrabifyNodes = El.autoungrabify; var Sh = { data: Xt.data({ field: "data", bindingEvent: "data", allowBinding: !0, allowSetting: !0, settingEvent: "data", settingTriggersEvent: !0, triggerFnName: "trigger", allowGetting: !0, updateStyle: !0 }), removeData: Xt.removeData({ field: "data", event: "data", triggerFnName: "trigger", triggerEvent: !0, updateStyle: !0 }), scratch: Xt.data({ field: "scratch", bindingEvent: "scratch", allowBinding: !0, allowSetting: !0, settingEvent: "scratch", settingTriggersEvent: !0, triggerFnName: "trigger", allowGetting: !0, updateStyle: !0 }), removeScratch: Xt.removeData({ field: "scratch", event: "scratch", triggerFnName: "trigger", triggerEvent: !0, updateStyle: !0 }) }; Sh.attr = Sh.data; Sh.removeAttr = Sh.removeData; var zm = function(t) { var e = this; t = bt({}, t); var r = t.container; r && !Rm(r) && Rm(r[0]) && (r = r[0]); var i = r ? r._cyreg : null; i = i || {}, i && i.cy && (i.cy.destroy(), i = {}); var n = i.readies = i.readies || []; r && (r._cyreg = i), i.cy = e; var a = Hr !== void 0 && r !== void 0 && !t.headless, o = t; o.layout = bt({ name: a ? "grid" : "null" }, o.layout), o.renderer = bt({ name: a ? "canvas" : "null" }, o.renderer); var s = function(h, f, p) { return f !== void 0 ? f : p !== void 0 ? p : h; }, c = this._private = { container: r, // html dom ele container ready: !1, // whether ready has been triggered options: o, // cached options elements: new mi(this), // elements in the graph listeners: [], // list of listeners aniEles: new mi(this), // elements being animated data: o.data || {}, // data for the core scratch: {}, // scratch object for core layout: null, renderer: null, destroyed: !1, // whether destroy was called notificationsEnabled: !0, // whether notifications are sent to the renderer minZoom: 1e-50, maxZoom: 1e50, zoomingEnabled: s(!0, o.zoomingEnabled), userZoomingEnabled: s(!0, o.userZoomingEnabled), panningEnabled: s(!0, o.panningEnabled), userPanningEnabled: s(!0, o.userPanningEnabled), boxSelectionEnabled: s(!0, o.boxSelectionEnabled), autolock: s(!1, o.autolock, o.autolockNodes), autoungrabify: s(!1, o.autoungrabify, o.autoungrabifyNodes), autounselectify: s(!1, o.autounselectify), styleEnabled: o.styleEnabled === void 0 ? a : o.styleEnabled, zoom: Xe(o.zoom) ? o.zoom : 1, pan: { x: Gt(o.pan) && Xe(o.pan.x) ? o.pan.x : 0, y: Gt(o.pan) && Xe(o.pan.y) ? o.pan.y : 0 }, animation: { // object for currently-running animations current: [], queue: [] }, hasCompoundNodes: !1, multiClickDebounceTime: s(250, o.multiClickDebounceTime) }; this.createEmitter(), this.selectionType(o.selectionType), this.zoomRange({ min: o.minZoom, max: o.maxZoom }); var l = function(h, f) { var p = h.some(q8); if (p) return Bu.all(h).then(f); f(h); }; c.styleEnabled && e.setStyle([]); var u = bt({}, o, o.renderer); e.initRenderer(u); var d = function(h, f, p) { e.notifications(!1); var m = e.mutableElements(); m.length > 0 && m.remove(), h != null && (Gt(h) || ar(h)) && e.add(h), e.one("layoutready", function(g) { e.notifications(!0), e.emit(g), e.one("load", f), e.emitAndNotify("load"); }).one("layoutstop", function() { e.one("done", p), e.emit("done"); }); var y = bt({}, e._private.options.layout); y.eles = e.elements(), e.layout(y).run(); }; l([o.style, o.elements], function(h) { var f = h[0], p = h[1]; c.styleEnabled && e.style().append(f), d(p, function() { e.startAnimationLoop(), c.ready = !0, xr(o.ready) && e.on("ready", o.ready); for (var m = 0; m < n.length; m++) { var y = n[m]; e.on("ready", y); } i && (i.readies = []), e.emit("ready"); }, o.done); }); }, $m = zm.prototype; bt($m, { instanceString: function() { return "core"; }, isReady: function() { return this._private.ready; }, destroyed: function() { return this._private.destroyed; }, ready: function(t) { return this.isReady() ? this.emitter().emit("ready", [], t) : this.on("ready", t), this; }, destroy: function() { var t = this; if (!t.destroyed()) return t.stopAnimationLoop(), t.destroyRenderer(), this.emit("destroy"), t._private.destroyed = !0, t; }, hasElementWithId: function(t) { return this._private.elements.hasElementWithId(t); }, getElementById: function(t) { return this._private.elements.getElementById(t); }, hasCompoundNodes: function() { return this._private.hasCompoundNodes; }, headless: function() { return this._private.renderer.isHeadless(); }, styleEnabled: function() { return this._private.styleEnabled; }, addToPool: function(t) { return this._private.elements.merge(t), this; }, removeFromPool: function(t) { return this._private.elements.unmerge(t), this; }, container: function() { return this._private.container || null; }, window: function() { var t = this._private.container; if (t == null) return Hr; var e = this._private.container.ownerDocument; return e === void 0 || e == null ? Hr : e.defaultView || Hr; }, mount: function(t) { if (t != null) { var e = this, r = e._private, i = r.options; return !Rm(t) && Rm(t[0]) && (t = t[0]), e.stopAnimationLoop(), e.destroyRenderer(), r.container = t, r.styleEnabled = !0, e.invalidateSize(), e.initRenderer(bt({}, i, i.renderer, { // allow custom renderer name to be re-used, otherwise use canvas name: i.renderer.name === "null" ? "canvas" : i.renderer.name })), e.startAnimationLoop(), e.style(i.style), e.emit("mount"), e; } }, unmount: function() { var t = this; return t.stopAnimationLoop(), t.destroyRenderer(), t.initRenderer({ name: "null" }), t.emit("unmount"), t; }, options: function() { return la(this._private.options); }, json: function(t) { var e = this, r = e._private, i = e.mutableElements(), n = function(v) { return e.getElementById(v.id()); }; if (Gt(t)) { if (e.startBatch(), t.elements) { var a = {}, o = function(v, x) { for (var w = [], S = [], _ = 0; _ < v.length; _++) { var b = v[_]; if (!b.data.id) { Zt("cy.json() cannot handle elements without an ID attribute"); continue; } var T = "" + b.data.id, E = e.getElementById(T); a[T] = !0, E.length !== 0 ? S.push({ ele: E, json: b }) : (x && (b.group = x), w.push(b)); } e.add(w); for (var C = 0; C < S.length; C++) { var L = S[C], A = L.ele, k = L.json; A.json(k); } }; if (ar(t.elements)) o(t.elements); else for (var s = ["nodes", "edges"], c = 0; c < s.length; c++) { var l = s[c], u = t.elements[l]; ar(u) && o(u, l); } var d = e.collection(); i.filter(function(v) { return !a[v.id()]; }).forEach(function(v) { v.isParent() ? d.merge(v) : v.remove(); }), d.forEach(function(v) { return v.children().move({ parent: null }); }), d.forEach(function(v) { return n(v).remove(); }); } t.style && e.style(t.style), t.zoom != null && t.zoom !== r.zoom && e.zoom(t.zoom), t.pan && (t.pan.x !== r.pan.x || t.pan.y !== r.pan.y) && e.pan(t.pan), t.data && e.data(t.data); for (var h = ["minZoom", "maxZoom", "zoomingEnabled", "userZoomingEnabled", "panningEnabled", "userPanningEnabled", "boxSelectionEnabled", "autolock", "autoungrabify", "autounselectify", "multiClickDebounceTime"], f = 0; f < h.length; f++) { var p = h[f]; t[p] != null && e[p](t[p]); } return e.endBatch(), this; } else { var m = !!t, y = {}; m ? y.elements = this.elements().map(function(v) { return v.json(); }) : (y.elements = {}, i.forEach(function(v) { var x = v.group(); y.elements[x] || (y.elements[x] = []), y.elements[x].push(v.json()); })), this._private.styleEnabled && (y.style = e.style().json()), y.data = la(e.data()); var g = r.options; return y.zoomingEnabled = r.zoomingEnabled, y.userZoomingEnabled = r.userZoomingEnabled, y.zoom = r.zoom, y.minZoom = r.minZoom, y.maxZoom = r.maxZoom, y.panningEnabled = r.panningEnabled, y.userPanningEnabled = r.userPanningEnabled, y.pan = la(r.pan), y.boxSelectionEnabled = r.boxSelectionEnabled, y.renderer = la(g.renderer), y.hideEdgesOnViewport = g.hideEdgesOnViewport, y.textureOnViewport = g.textureOnViewport, y.wheelSensitivity = g.wheelSensitivity, y.motionBlur = g.motionBlur, y.multiClickDebounceTime = g.multiClickDebounceTime, y; } } }); $m.$id = $m.getElementById; [IW, $W, y3, Ly, hm, UW, ky, pm, GW, El, Sh].forEach(function(t) { bt($m, t); }); var qW = { fit: !0, // whether to fit the viewport to the graph directed: !1, // whether the tree is directed downwards (or edges can point in any direction if false) padding: 30, // padding on fit circle: !1, // put depths in concentric circles if true, put depths top down if false grid: !1, // whether to create an even grid into which the DAG is placed (circle:false only) spacingFactor: 1.75, // positive spacing factor, larger => more space between nodes (N.B. n/a if causes overlap) boundingBox: void 0, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } avoidOverlap: !0, // prevents node overlap, may overflow boundingBox if not enough space nodeDimensionsIncludeLabels: !1, // Excludes the label when calculating node bounding boxes for the layout algorithm roots: void 0, // the roots of the trees depthSort: void 0, // a sorting function to order nodes at equal depth. e.g. function(a, b){ return a.data('weight') - b.data('weight') } animate: !1, // whether to transition the node positions animationDuration: 500, // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled, animateFilter: function(t, e) { return !0; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop transform: function(t, e) { return e; } // transform a given node position. Useful for changing flow direction in discrete layouts }, XW = { maximal: !1, // whether to shift nodes down their natural BFS depths in order to avoid upwards edges (DAGS only); setting acyclic to true sets maximal to true also acyclic: !1 // whether the tree is acyclic and thus a node could be shifted (due to the maximal option) multiple times without causing an infinite loop; setting to true sets maximal to true also; if you are uncertain whether a tree is acyclic, set to false to avoid potential infinite loops }, ic = function(t) { return t.scratch("breadthfirst"); }, j_ = function(t, e) { return t.scratch("breadthfirst", e); }; function b3(t) { this.options = bt({}, qW, XW, t); } b3.prototype.run = function() { var t = this.options, e = t, r = t.cy, i = e.eles, n = i.nodes().filter(function($) { return !$.isParent(); }), a = i, o = e.directed, s = e.acyclic || e.maximal || e.maximalAdjustments > 0, c = Yi(e.boundingBox ? e.boundingBox : { x1: 0, y1: 0, w: r.width(), h: r.height() }), l; if (on(e.roots)) l = e.roots; else if (ar(e.roots)) { for (var u = [], d = 0; d < e.roots.length; d++) { var h = e.roots[d], f = r.getElementById(h); u.push(f); } l = r.collection(u); } else if (dt(e.roots)) l = r.$(e.roots); else if (o) l = n.roots(); else { var p = i.components(); l = r.collection(); for (var m = function($) { var J = p[$], ne = J.maxDegree(!1), j = J.filter(function(q) { return q.degree(!1) === ne; }); l = l.add(j); }, y = 0; y < p.length; y++) m(y); } var g = [], v = {}, x = function($, J) { g[J] == null && (g[J] = []); var ne = g[J].length; g[J].push($), j_($, { index: ne, depth: J }); }, w = function($, J) { var ne = ic($), j = ne.depth, q = ne.index; g[j][q] = null, x($, J); }; a.bfs({ roots: l, directed: e.directed, visit: function($, J, ne, j, q) { var ge = $[0], ye = ge.id(); x(ge, q), v[ye] = !0; } }); for (var S = [], _ = 0; _ < n.length; _++) { var b = n[_]; v[b.id()] || S.push(b); } var T = function($) { for (var J = g[$], ne = 0; ne < J.length; ne++) { var j = J[ne]; if (j == null) { J.splice(ne, 1), ne--; continue; } j_(j, { depth: $, index: ne }); } }, E = function() { for (var $ = 0; $ < g.length; $++) T($); }, C = function($, J) { for (var ne = ic($), j = $.incomers().filter(function(B) { return B.isNode() && i.has(B); }), q = -1, ge = $.id(), ye = 0; ye < j.length; ye++) { var _e = j[ye], Me = ic(_e); q = Math.max(q, Me.depth); } if (ne.depth <= q) { if (!e.acyclic && J[ge]) return null; var Ce = q + 1; return w($, Ce), J[ge] = Ce, !0; } return !1; }; if (o && s) { var L = [], A = {}, k = function($) { return L.push($); }, P = function() { return L.shift(); }; for (n.forEach(function($) { return L.push($); }); L.length > 0; ) { var R = P(), M = C(R, A); if (M) R.outgoers().filter(function($) { return $.isNode() && i.has($); }).forEach(k); else if (M === null) { Zt("Detected double maximal shift for node `" + R.id() + "`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs."); break; } } } E(); var O = 0; if (e.avoidOverlap) for (var D = 0; D < n.length; D++) { var I = n[D], F = I.layoutDimensions(e), z = F.w, U = F.h; O = Math.max(O, z, U); } var Z = {}, re = function($) { if (Z[$.id()]) return Z[$.id()]; for (var J = ic($).depth, ne = $.neighborhood(), j = 0, q = 0, ge = 0; ge < ne.length; ge++) { var ye = ne[ge]; if (!(ye.isEdge() || ye.isParent() || !n.has(ye))) { var _e = ic(ye); if (_e != null) { var Me = _e.index, Ce = _e.depth; if (!(Me == null || Ce == null)) { var B = g[Ce].length; Ce < J && (j += Me / B, q++); } } } } return q = Math.max(1, q), j = j / q, q === 0 && (j = 0), Z[$.id()] = j, j; }, K = function($, J) { var ne = re($), j = re(J), q = ne - j; return q === 0 ? xA($.id(), J.id()) : q; }; e.depthSort !== void 0 && (K = e.depthSort); for (var V = 0; V < g.length; V++) g[V].sort(K), T(V); for (var H = [], G = 0; G < S.length; G++) H.push(S[G]); g.unshift(H), E(); for (var W = 0, Y = 0; Y < g.length; Y++) W = Math.max(g[Y].length, W); var X = { x: c.x1 + c.w / 2, y: c.x1 + c.h / 2 }, ie = g.reduce(function($, J) { return Math.max($, J.length); }, 0), ue = function($) { var J = ic($), ne = J.depth, j = J.index, q = g[ne].length, ge = Math.max(c.w / ((e.grid ? ie : q) + 1), O), ye = Math.max(c.h / (g.length + 1), O), _e = Math.min(c.w / 2 / g.length, c.h / 2 / g.length); if (_e = Math.max(_e, O), e.circle) { var Me = _e * ne + _e - (g.length > 0 && g[0].length <= 3 ? _e / 2 : 0), Ce = 2 * Math.PI / g[ne].length * j; return ne === 0 && g[0].length === 1 && (Me = 1), { x: X.x + Me * Math.cos(Ce), y: X.y + Me * Math.sin(Ce) }; } else { var B = { x: X.x + (j + 1 - (q + 1) / 2) * ge, y: (ne + 1) * ye }; return B; } }; return i.nodes().layoutPositions(this, e, ue), this; }; var ZW = { fit: !0, // whether to fit the viewport to the graph padding: 30, // the padding on fit boundingBox: void 0, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } avoidOverlap: !0, // prevents node overlap, may overflow boundingBox and radius if not enough space nodeDimensionsIncludeLabels: !1, // Excludes the label when calculating node bounding boxes for the layout algorithm spacingFactor: void 0, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up radius: void 0, // the radius of the circle startAngle: 3 / 2 * Math.PI, // where nodes start in radians sweep: void 0, // how many radians should be between the first and last node (defaults to full circle) clockwise: !0, // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) sort: void 0, // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') } animate: !1, // whether to transition the node positions animationDuration: 500, // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled animateFilter: function(t, e) { return !0; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop transform: function(t, e) { return e; } // transform a given node position. Useful for changing flow direction in discrete layouts }; function x3(t) { this.options = bt({}, ZW, t); } x3.prototype.run = function() { var t = this.options, e = t, r = t.cy, i = e.eles, n = e.counterclockwise !== void 0 ? !e.counterclockwise : e.clockwise, a = i.nodes().not(":parent"); e.sort && (a = a.sort(e.sort)); for (var o = Yi(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 }, c = e.sweep === void 0 ? 2 * Math.PI - 2 * Math.PI / a.length : e.sweep, l = c / Math.max(1, a.length - 1), u, d = 0, h = 0; h < a.length; h++) { var f = a[h], p = f.layoutDimensions(e), m = p.w, y = p.h; d = Math.max(d, m, y); } if (Xe(e.radius) ? u = e.radius : a.length <= 1 ? u = 0 : u = Math.min(o.h, o.w) / 2 - d, a.length > 1 && e.avoidOverlap) { d *= 1.75; var g = Math.cos(l) - Math.cos(0), v = Math.sin(l) - Math.sin(0), x = Math.sqrt(d * d / (g * g + v * v)); u = Math.max(x, u); } var w = function(S, _) { var b = e.startAngle + _ * l * (n ? 1 : -1), T = u * Math.cos(b), E = u * Math.sin(b), C = { x: s.x + T, y: s.y + E }; return C; }; return i.nodes().layoutPositions(this, e, w), this; }; var YW = { fit: !0, // whether to fit the viewport to the graph padding: 30, // the padding on fit startAngle: 3 / 2 * Math.PI, // where nodes start in radians sweep: void 0, // how many radians should be between the first and last node (defaults to full circle) clockwise: !0, // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) equidistant: !1, // whether levels have an equal radial distance betwen them, may cause bounding box overflow minNodeSpacing: 10, // min spacing between outside of nodes (used for radius adjustment) boundingBox: void 0, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } avoidOverlap: !0, // prevents node overlap, may overflow boundingBox if not enough space nodeDimensionsIncludeLabels: !1, // Excludes the label when calculating node bounding boxes for the layout algorithm height: void 0, // height of layout area (overrides container height) width: void 0, // width of layout area (overrides container width) spacingFactor: void 0, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up concentric: function(t) { return t.degree(); }, levelWidth: function(t) { return t.maxDegree() / 4; }, animate: !1, // whether to transition the node positions animationDuration: 500, // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled animateFilter: function(t, e) { return !0; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop transform: function(t, e) { return e; } // transform a given node position. Useful for changing flow direction in discrete layouts }; function w3(t) { this.options = bt({}, YW, t); } w3.prototype.run = function() { for (var t = this.options, e = t, r = e.counterclockwise !== void 0 ? !e.counterclockwise : e.clockwise, i = t.cy, n = e.eles, a = n.nodes().not(":parent"), o = Yi(e.boundingBox ? e.boundingBox : { x1: 0, y1: 0, w: i.width(), h: i.height() }), s = { x: o.x1 + o.w / 2, y: o.y1 + o.h / 2 }, c = [], l = 0, u = 0; u < a.length; u++) { var d = a[u], h = void 0; h = e.concentric(d), c.push({ value: h, node: d }), d._private.scratch.concentric = h; } a.updateStyle(); for (var f = 0; f < a.length; f++) { var p = a[f], m = p.layoutDimensions(e); l = Math.max(l, m.w, m.h); } c.sort(function($, J) { return J.value - $.value; }); for (var y = e.levelWidth(a), g = [[]], v = g[0], x = 0; x < c.length; x++) { var w = c[x]; if (v.length > 0) { var S = Math.abs(v[0].value - w.value); S >= y && (v = [], g.push(v)); } v.push(w); } var _ = l + e.minNodeSpacing; if (!e.avoidOverlap) { var b = g.length > 0 && g[0].length > 1, T = Math.min(o.w, o.h) / 2 - _, E = T / (g.length + b ? 1 : 0); _ = Math.min(_, E); } for (var C = 0, L = 0; L < g.length; L++) { var A = g[L], k = e.sweep === void 0 ? 2 * Math.PI - 2 * Math.PI / A.length : e.sweep, P = A.dTheta = k / Math.max(1, A.length - 1); if (A.length > 1 && e.avoidOverlap) { var R = Math.cos(P) - Math.cos(0), M = Math.sin(P) - Math.sin(0), O = Math.sqrt(_ * _ / (R * R + M * M)); C = Math.max(O, C); } A.r = C, C += _; } if (e.equidistant) { for (var D = 0, I = 0, F = 0; F < g.length; F++) { var z = g[F], U = z.r - I; D = Math.max(D, U); } I = 0; for (var Z = 0; Z < g.length; Z++) { var re = g[Z]; Z === 0 && (I = re.r), re.r = I, I += D; } } for (var K = {}, V = 0; V < g.length; V++) for (var H = g[V], G = H.dTheta, W = H.r, Y = 0; Y < H.length; Y++) { var X = H[Y], ie = e.startAngle + (r ? 1 : -1) * G * Y, ue = { x: s.x + W * Math.cos(ie), y: s.y + W * Math.sin(ie) }; K[X.node.id()] = ue; } return n.nodes().layoutPositions(this, e, function($) { var J = $.id(); return K[J]; }), this; }; var Zv, KW = { // Called on `layoutready` ready: function() { }, // Called on `layoutstop` stop: function() { }, // Whether to animate while running the layout // true : Animate continuously as the layout is running // false : Just show the end result // 'end' : Animate with the end result, from the initial positions to the end positions animate: !0, // Easing of the animation for animate:'end' animationEasing: void 0, // The duration of the animation for animate:'end' animationDuration: void 0, // A function that determines whether the node should be animated // All nodes animated by default on animate enabled // Non-animated nodes are positioned immediately when the layout starts animateFilter: function(t, e) { return !0; }, // The layout animates only after this many milliseconds for animate:true // (prevents flashing on fast runs) animationThreshold: 250, // Number of iterations between consecutive screen positions update refresh: 20, // Whether to fit the network view after when done fit: !0, // Padding on fit padding: 30, // Constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } boundingBox: void 0, // Excludes the label when calculating node bounding boxes for the layout algorithm nodeDimensionsIncludeLabels: !1, // Randomize the initial positions of the nodes (true) or use existing positions (false) randomize: !1, // Extra spacing between components in non-compound graphs componentSpacing: 40, // Node repulsion (non overlapping) multiplier nodeRepulsion: function(t) { return 2048; }, // Node repulsion (overlapping) multiplier nodeOverlap: 4, // Ideal edge (non nested) length idealEdgeLength: function(t) { return 32; }, // Divisor to compute edge forces edgeElasticity: function(t) { 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 Fg(t) { this.options = bt({}, KW, t), this.options.layout = this; var e = this.options.eles.nodes(), r = this.options.eles.edges(), i = r.filter(function(n) { var a = n.source().data("id"), o = n.target().data("id"), s = e.some(function(l) { return l.data("id") === a; }), c = e.some(function(l) { return l.data("id") === o; }); return !s || !c; }); this.options.eles = this.options.eles.not(i); } Fg.prototype.run = function() { var t = this.options, e = t.cy, r = this; r.stopped = !1, (t.animate === !0 || t.animate === !1) && r.emit({ type: "layoutstart", layout: r }), t.debug === !0 ? Zv = !0 : Zv = !1; var i = JW(e, r, t); Zv && t7(i), t.randomize && r7(i); var n = ro(), a = function() { i7(i, e, t), t.fit === !0 && e.fit(t.padding); }, o = function(d) { return !(r.stopped || d >= t.numIter || (n7(i, t), i.temperature = i.temperature * t.coolingFactor, i.temperature < t.minTemp)); }, s = function() { if (t.animate === !0 || t.animate === !1) a(), r.one("layoutstop", t.stop), r.emit({ type: "layoutstop", layout: r }); else { var d = t.eles.nodes(), h = _3(i, t, d); d.layoutPositions(r, t, h); } }, c = 0, l = !0; if (t.animate === !0) { var u = function d() { for (var h = 0; l && h < t.refresh; ) l = o(c), c++, h++; if (!l) G_(i, t), s(); else { var f = ro(); f - n >= t.animationThreshold && a(), Om(d); } }; u(); } else { for (; l; ) l = o(c), c++; G_(i, t), s(); } return this; }; Fg.prototype.stop = function() { return this.stopped = !0, this.thread && this.thread.stop(), this.emit("layoutstop"), this; }; Fg.prototype.destroy = function() { return this.thread && this.thread.stop(), this; }; var JW = function(t, e, r) { for (var i = r.eles.edges(), n = r.eles.nodes(), a = Yi(r.boundingBox ? r.boundingBox : { x1: 0, y1: 0, w: t.width(), h: t.height() }), o = { isCompound: t.hasCompoundNodes(), layoutNodes: [], idToIndex: {}, nodeSize: n.size(), graphSet: [], indexToGraph: [], layoutEdges: [], edgeSize: i.size(), temperature: r.initialTemp, clientWidth: a.w, clientHeight: a.h, boundingBox: a }, s = r.eles.components(), c = {}, l = 0; l < s.length; l++) for (var u = s[l], d = 0; d < u.length; d++) { var h = u[d]; c[h.id()] = l; } for (var l = 0; l < o.nodeSize; l++) { var f = n[l], p = f.layoutDimensions(r), m = {}; m.isLocked = f.locked(), m.id = f.data("id"), m.parentId = f.data("parent"), m.cmptId = c[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 = xr(r.nodeRepulsion) ? r.nodeRepulsion(f) : r.nodeRepulsion, o.layoutNodes.push(m), o.idToIndex[m.id] = l; } for (var y = [], g = 0, v = -1, x = [], l = 0; l < o.nodeSize; l++) { var f = o.layoutNodes[l], w = f.parentId; w != null ? o.layoutNodes[o.idToIndex[w]].children.push(f.id) : (y[++v] = f.id, x.push(f.id)); } for (o.graphSet.push(x); g <= v; ) { var S = y[g++], _ = o.idToIndex[S], h = o.layoutNodes[_], b = h.children; if (b.length > 0) { o.graphSet.push(b); for (var l = 0; l < b.length; l++) y[++v] = b[l]; } } for (var l = 0; l < o.graphSet.length; l++) for (var T = o.graphSet[l], d = 0; d < T.length; d++) { var E = o.idToIndex[T[d]]; o.indexToGraph[E] = l; } for (var l = 0; l < o.edgeSize; l++) { var C = i[l], L = {}; L.id = C.data("id"), L.sourceId = C.data("source"), L.targetId = C.data("target"); var A = xr(r.idealEdgeLength) ? r.idealEdgeLength(C) : r.idealEdgeLength, k = xr(r.edgeElasticity) ? r.edgeElasticity(C) : r.edgeElasticity, P = o.idToIndex[L.sourceId], R = o.idToIndex[L.targetId], M = o.indexToGraph[P], O = o.indexToGraph[R]; if (M != O) { for (var D = QW(L.sourceId, L.targetId, o), I = o.graphSet[D], F = 0, m = o.layoutNodes[P]; I.indexOf(m.id) === -1; ) m = o.layoutNodes[o.idToIndex[m.parentId]], F++; for (m = o.layoutNodes[R]; I.indexOf(m.id) === -1; ) m = o.layoutNodes[o.idToIndex[m.parentId]], F++; A *= F * r.nestingFactor; } L.idealLength = A, L.elasticity = k, o.layoutEdges.push(L); } return o; }, QW = function(t, e, r) { var i = e7(t, e, 0, r); return 2 > i.count ? 0 : i.graph; }, e7 = function t(e, r, i, n) { var a = n.graphSet[i]; if (-1 < a.indexOf(e) && -1 < a.indexOf(r)) return { count: 2, graph: i }; for (var o = 0, s = 0; s < a.length; s++) { var c = a[s], l = n.idToIndex[c], u = n.layoutNodes[l].children; if (u.length !== 0) { var d = n.indexToGraph[n.idToIndex[u[0]]], h = t(e, r, d, n); if (h.count !== 0) if (h.count === 1) { if (o++, o === 2) break; } else return h; } } return { count: o, graph: i }; }, t7, r7 = function(t, e) { for (var r = t.clientWidth, i = t.clientHeight, n = 0; n < t.nodeSize; n++) { var a = t.layoutNodes[n]; a.children.length === 0 && !a.isLocked && (a.positionX = Math.random() * r, a.positionY = Math.random() * i); } }, _3 = function(t, e, r) { var i = t.boundingBox, n = { x1: 1 / 0, x2: -1 / 0, y1: 1 / 0, y2: -1 / 0 }; return e.boundingBox && (r.forEach(function(a) { var o = t.layoutNodes[t.idToIndex[a.data("id")]]; n.x1 = Math.min(n.x1, o.positionX), n.x2 = Math.max(n.x2, o.positionX), n.y1 = Math.min(n.y1, o.positionY), n.y2 = Math.max(n.y2, o.positionY); }), n.w = n.x2 - n.x1, n.h = n.y2 - n.y1), function(a, o) { var s = t.layoutNodes[t.idToIndex[a.data("id")]]; if (e.boundingBox) { var c = (s.positionX - n.x1) / n.w, l = (s.positionY - n.y1) / n.h; return { x: i.x1 + c * i.w, y: i.y1 + l * i.h }; } else return { x: s.positionX, y: s.positionY }; }; }, i7 = function(t, e, r) { var i = r.layout, n = r.eles.nodes(), a = _3(t, r, n); n.positions(a), t.ready !== !0 && (t.ready = !0, i.one("layoutready", r.ready), i.emit({ type: "layoutready", layout: this })); }, n7 = function(t, e, r) { a7(t, e), l7(t), c7(t, e), u7(t), d7(t); }, a7 = function(t, e) { for (var r = 0; r < t.graphSet.length; r++) for (var i = t.graphSet[r], n = i.length, a = 0; a < n; a++) for (var o = t.layoutNodes[t.idToIndex[i[a]]], s = a + 1; s < n; s++) { var c = t.layoutNodes[t.idToIndex[i[s]]]; o7(o, c, t, e); } }, H_ = function(t) { return -t + 2 * t * Math.random(); }, o7 = function(t, e, r, i) { var n = t.cmptId, a = e.cmptId; if (!(n !== a && !r.isCompound)) { var o = e.positionX - t.positionX, s = e.positionY - t.positionY, c = 1; o === 0 && s === 0 && (o = H_(c), s = H_(c)); var l = s7(t, e, o, s); if (l > 0) var y = i.nodeOverlap * l, m = Math.sqrt(o * o + s * s), g = y * o / m, v = y * s / m; else var u = Vm(t, o, s), d = Vm(e, -1 * o, -1 * s), h = d.x - u.x, f = d.y - u.y, p = h * h + f * f, m = Math.sqrt(p), y = (t.nodeRepulsion + e.nodeRepulsion) / p, g = y * h / m, v = y * f / m; t.isLocked || (t.offsetX -= g, t.offsetY -= v), e.isLocked || (e.offsetX += g, e.offsetY += v); } }, s7 = function(t, e, r, i) { if (r > 0) var n = t.maxX - e.minX; else var n = e.maxX - t.minX; if (i > 0) var a = t.maxY - e.minY; else var a = e.maxY - t.minY; return n >= 0 && a >= 0 ? Math.sqrt(n * n + a * a) : 0; }, Vm = function(t, e, r) { var i = t.positionX, n = t.positionY, a = t.height || 1, o = t.width || 1, s = r / e, c = a / o, l = {}; return e === 0 && 0 < r || e === 0 && 0 > r ? (l.x = i, l.y = n + a / 2, l) : 0 < e && -1 * c <= s && s <= c ? (l.x = i + o / 2, l.y = n + o * r / 2 / e, l) : 0 > e && -1 * c <= s && s <= c ? (l.x = i - o / 2, l.y = n - o * r / 2 / e, l) : 0 < r && (s <= -1 * c || s >= c) ? (l.x = i + a * e / 2 / r, l.y = n + a / 2, l) : (0 > r && (s <= -1 * c || s >= c) && (l.x = i - a * e / 2 / r, l.y = n - a / 2), l); }, l7 = function(t, e) { for (var r = 0; r < t.edgeSize; r++) { var i = t.layoutEdges[r], n = t.idToIndex[i.sourceId], a = t.layoutNodes[n], o = t.idToIndex[i.targetId], s = t.layoutNodes[o], c = s.positionX - a.positionX, l = s.positionY - a.positionY; if (!(c === 0 && l === 0)) { var u = Vm(a, c, l), d = Vm(s, -1 * c, -1 * l), h = d.x - u.x, f = d.y - u.y, p = Math.sqrt(h * h + f * f), m = Math.pow(i.idealLength - p, 2) / i.elasticity; if (p !== 0) var y = m * h / p, g = m * f / p; else var y = 0, g = 0; a.isLocked || (a.offsetX += y, a.offsetY += g), s.isLocked || (s.offsetX -= y, s.offsetY -= g); } } }, c7 = function(t, e) { if (e.gravity !== 0) for (var r = 1, i = 0; i < t.graphSet.length; i++) { var n = t.graphSet[i], a = n.length; if (i === 0) var c = t.clientHeight / 2, l = t.clientWidth / 2; else var o = t.layoutNodes[t.idToIndex[n[0]]], s = t.layoutNodes[t.idToIndex[o.parentId]], c = s.positionX, l = s.positionY; for (var u = 0; u < a; u++) { var d = t.layoutNodes[t.idToIndex[n[u]]]; if (!d.isLocked) { var h = c - d.positionX, f = l - d.positionY, p = Math.sqrt(h * h + f * f); if (p > r) { var m = e.gravity * h / p, y = e.gravity * f / p; d.offsetX += m, d.offsetY += y; } } } } }, u7 = function(t, e) { var r = [], i = 0, n = -1; for (r.push.apply(r, t.graphSet[0]), n += t.graphSet[0].length; i <= n; ) { var a = r[i++], o = t.idToIndex[a], s = t.layoutNodes[o], c = s.children; if (0 < c.length && !s.isLocked) { for (var l = s.offsetX, u = s.offsetY, d = 0; d < c.length; d++) { var h = t.layoutNodes[t.idToIndex[c[d]]]; h.offsetX += l, h.offsetY += u, r[++n] = c[d]; } s.offsetX = 0, s.offsetY = 0; } } }, d7 = function(t, e) { for (var r = 0; r < t.nodeSize; r++) { var i = t.layoutNodes[r]; 0 < i.children.length && (i.maxX = void 0, i.minX = void 0, i.maxY = void 0, i.minY = void 0); } for (var r = 0; r < t.nodeSize; r++) { var i = t.layoutNodes[r]; if (!(0 < i.children.length || i.isLocked)) { var n = h7(i.offsetX, i.offsetY, t.temperature); i.positionX += n.x, i.positionY += n.y, i.offsetX = 0, i.offsetY = 0, i.minX = i.positionX - i.width, i.maxX = i.positionX + i.width, i.minY = i.positionY - i.height, i.maxY = i.positionY + i.height, p7(i, t); } } for (var r = 0; r < t.nodeSize; r++) { var i = t.layoutNodes[r]; 0 < i.children.length && !i.isLocked && (i.positionX = (i.maxX + i.minX) / 2, i.positionY = (i.maxY + i.minY) / 2, i.width = i.maxX - i.minX, i.height = i.maxY - i.minY); } }, h7 = function(t, e, r) { var i = Math.sqrt(t * t + e * e); if (i > r) var n = { x: r * t / i, y: r * e / i }; else var n = { x: t, y: e }; return n; }, p7 = function t(e, r) { var i = e.parentId; if (i != null) { var n = r.layoutNodes[r.idToIndex[i]], a = !1; if ((n.maxX == null || e.maxX + n.padRight > n.maxX) && (n.maxX = e.maxX + n.padRight, a = !0), (n.minX == null || e.minX - n.padLeft < n.minX) && (n.minX = e.minX - n.padLeft, a = !0), (n.maxY == null || e.maxY + n.padBottom > n.maxY) && (n.maxY = e.maxY + n.padBottom, a = !0), (n.minY == null || e.minY - n.padTop < n.minY) && (n.minY = e.minY - n.padTop, a = !0), a) return t(n, r); } }, G_ = function(t, e) { for (var r = t.layoutNodes, i = [], n = 0; n < r.length; n++) { var a = r[n], o = a.cmptId, s = i[o] = i[o] || []; s.push(a); } for (var c = 0, n = 0; n < i.length; n++) { var l = i[n]; if (l) { l.x1 = 1 / 0, l.x2 = -1 / 0, l.y1 = 1 / 0, l.y2 = -1 / 0; for (var u = 0; u < l.length; u++) { var d = l[u]; l.x1 = Math.min(l.x1, d.positionX - d.width / 2), l.x2 = Math.max(l.x2, d.positionX + d.width / 2), l.y1 = Math.min(l.y1, d.positionY - d.height / 2), l.y2 = Math.max(l.y2, d.positionY + d.height / 2); } l.w = l.x2 - l.x1, l.h = l.y2 - l.y1, c += l.w * l.h; } } i.sort(function(g, v) { return v.w * v.h - g.w * g.h; }); for (var h = 0, f = 0, p = 0, m = 0, y = Math.sqrt(c) * t.clientWidth / t.clientHeight, n = 0; n < i.length; n++) { var l = i[n]; if (l) { for (var u = 0; u < l.length; u++) { var d = l[u]; d.isLocked || (d.positionX += h - l.x1, d.positionY += f - l.y1); } h += l.w + e.componentSpacing, p += l.w + e.componentSpacing, m = Math.max(m, l.h), p > y && (f += m + e.componentSpacing, h = 0, p = 0, m = 0); } } }, f7 = { fit: !0, // whether to fit the viewport to the graph padding: 30, // padding used on fit boundingBox: void 0, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } avoidOverlap: !0, // prevents node overlap, may overflow boundingBox if not enough space avoidOverlapPadding: 10, // extra spacing around nodes when avoidOverlap: true nodeDimensionsIncludeLabels: !1, // Excludes the label when calculating node bounding boxes for the layout algorithm spacingFactor: void 0, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up condense: !1, // uses all available space on false, uses minimal space on true rows: void 0, // force num of rows in the grid cols: void 0, // force num of columns in the grid position: function(t) { }, // returns { row, col } for element sort: void 0, // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') } animate: !1, // whether to transition the node positions animationDuration: 500, // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled animateFilter: function(t, e) { return !0; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop transform: function(t, e) { return e; } // transform a given node position. Useful for changing flow direction in discrete layouts }; function S3(t) { this.options = bt({}, f7, t); } S3.prototype.run = function() { var t = this.options, e = t, r = t.cy, i = e.eles, n = i.nodes().not(":parent"); e.sort && (n = n.sort(e.sort)); var a = Yi(e.boundingBox ? e.boundingBox : { x1: 0, y1: 0, w: r.width(), h: r.height() }); if (a.h === 0 || a.w === 0) i.nodes().layoutPositions(this, e, function(Z) { return { x: a.x1, y: a.y1 }; }); else { var o = n.size(), s = Math.sqrt(o * a.h / a.w), c = Math.round(s), l = Math.round(a.w / a.h * s), u = function(Z) { if (Z == null) return Math.min(c, l); var re = Math.min(c, l); re == c ? c = Z : l = Z; }, d = function(Z) { if (Z == null) return Math.max(c, l); var re = Math.max(c, l); re == c ? c = Z : l = Z; }, h = e.rows, f = e.cols != null ? e.cols : e.columns; if (h != null && f != null) c = h, l = f; else if (h != null && f == null) c = h, l = Math.ceil(o / c); else if (h == null && f != null) l = f, c = Math.ceil(o / l); else if (l * c > o) { var p = u(), m = d(); (p - 1) * m >= o ? u(p - 1) : (m - 1) * p >= o && d(m - 1); } else for (; l * c < o; ) { var y = u(), g = d(); (g + 1) * y >= o ? d(g + 1) : u(y + 1); } var v = a.w / l, x = a.h / c; if (e.condense && (v = 0, x = 0), e.avoidOverlap) for (var w = 0; w < n.length; w++) { var S = n[w], _ = S._private.position; (_.x == null || _.y == null) && (_.x = 0, _.y = 0); var b = S.layoutDimensions(e), T = e.avoidOverlapPadding, E = b.w + T, C = b.h + T; v = Math.max(v, E), x = Math.max(x, C); } for (var L = {}, A = function(Z, re) { return !!L["c-" + Z + "-" + re]; }, k = function(Z, re) { L["c-" + Z + "-" + re] = !0; }, P = 0, R = 0, M = function() { R++, R >= l && (R = 0, P++); }, O = {}, D = 0; D < n.length; D++) { var I = n[D], F = e.position(I); if (F && (F.row !== void 0 || F.col !== void 0)) { var z = { row: F.row, col: F.col }; if (z.col === void 0) for (z.col = 0; A(z.row, z.col); ) z.col++; else if (z.row === void 0) for (z.row = 0; A(z.row, z.col); ) z.row++; O[I.id()] = z, k(z.row, z.col); } } var U = function(Z, re) { var K, V; if (Z.locked() || Z.isParent()) return !1; var H = O[Z.id()]; if (H) K = H.col * v + v / 2 + a.x1, V = H.row * x + x / 2 + a.y1; else { for (; A(P, R); ) M(); K = R * v + v / 2 + a.x1, V = P * x + x / 2 + a.y1, k(P, R), M(); } return { x: K, y: V }; }; n.layoutPositions(this, e, U); } return this; }; var m7 = { ready: function() { }, // on layoutready stop: function() { } // on layoutstop }; function Gb(t) { this.options = bt({}, m7, t); } Gb.prototype.run = function() { var t = this.options, e = t.eles, r = this; return t.cy, r.emit("layoutstart"), e.nodes().positions(function() { return { x: 0, y: 0 }; }), r.one("layoutready", t.ready), r.emit("layoutready"), r.one("layoutstop", t.stop), r.emit("layoutstop"), this; }; Gb.prototype.stop = function() { return this; }; var g7 = { positions: void 0, // map of (node id) => (position obj); or function(node){ return somPos; } zoom: void 0, // the zoom level to set (prob want fit = false if set) pan: void 0, // the pan level to set (prob want fit = false if set) fit: !0, // whether to fit to viewport padding: 30, // padding on fit spacingFactor: void 0, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up animate: !1, // whether to transition the node positions animationDuration: 500, // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled animateFilter: function(t, e) { return !0; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop transform: function(t, e) { return e; } // transform a given node position. Useful for changing flow direction in discrete layouts }; function M3(t) { this.options = bt({}, g7, t); } M3.prototype.run = function() { var t = this.options, e = t.eles, r = e.nodes(), i = xr(t.positions); function n(a) { if (t.positions == null) return xj(a.position()); if (i) return t.positions(a); var o = t.positions[a._private.data.id]; return o ?? null; } return r.layoutPositions(this, t, function(a, o) { var s = n(a); return a.locked() || s == null ? !1 : s; }), this; }; var v7 = { fit: !0, // whether to fit to viewport padding: 30, // fit padding boundingBox: void 0, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } animate: !1, // whether to transition the node positions animationDuration: 500, // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled animateFilter: function(t, e) { return !0; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop transform: function(t, e) { return e; } // transform a given node position. Useful for changing flow direction in discrete layouts }; function E3(t) { this.options = bt({}, v7, t); } E3.prototype.run = function() { var t = this.options, e = t.cy, r = t.eles, i = Yi(t.boundingBox ? t.boundingBox : { x1: 0, y1: 0, w: e.width(), h: e.height() }), n = function(a, o) { return { x: i.x1 + Math.round(Math.random() * i.w), y: i.y1 + Math.round(Math.random() * i.h) }; }; return r.nodes().layoutPositions(this, t, n), this; }; var y7 = [{ name: "breadthfirst", impl: b3 }, { name: "circle", impl: x3 }, { name: "concentric", impl: w3 }, { name: "cose", impl: Fg }, { name: "grid", impl: S3 }, { name: "null", impl: Gb }, { name: "preset", impl: M3 }, { name: "random", impl: E3 }]; function T3(t) { this.options = t, this.notifications = 0; } var W_ = function() { }, q_ = function() { throw new Error("A headless instance can not render images"); }; T3.prototype = { recalculateRenderedStyle: W_, notify: function() { this.notifications++; }, init: W_, isHeadless: function() { return !0; }, png: q_, jpg: q_ }; var Wb = {}; Wb.arrowShapeWidth = 0.3; Wb.registerArrowShapes = function() { var t = this.arrowShapes = {}, e = this, r = function(c, l, u, d, h, f, p) { var m = h.x - u / 2 - p, y = h.x + u / 2 + p, g = h.y - u / 2 - p, v = h.y + u / 2 + p, x = m <= c && c <= y && g <= l && l <= v; return x; }, i = function(c, l, u, d, h) { var f = c * Math.cos(d) - l * Math.sin(d), p = c * Math.sin(d) + l * Math.cos(d), m = f * u, y = p * u, g = m + h.x, v = y + h.y; return { x: g, y: v }; }, n = function(c, l, u, d) { for (var h = [], f = 0; f < c.length; f += 2) { var p = c[f], m = c[f + 1]; h.push(i(p, m, l, u, d)); } return h; }, a = function(c) { for (var l = [], u = 0; u < c.length; u++) { var d = c[u]; l.push(d.x, d.y); } return l; }, o = function(c) { return c.pstyle("width").pfValue * c.pstyle("arrow-scale").pfValue * 2; }, s = function(c, l) { dt(l) && (l = t[l]), t[c] = bt({ name: c, points: [-0.15, -0.3, 0.15, -0.3, 0.15, 0.3, -0.15, 0.3], collide: function(u, d, h, f, p, m) { var y = a(n(this.points, h + 2 * m, f, p)), g = Vi(u, d, y); return g; }, roughCollide: r, draw: function(u, d, h, f) { var p = n(this.points, d, h, f); e.arrowShapeImpl("polygon")(u, p); }, spacing: function(u) { return 0; }, gap: o }, l); }; s("none", { collide: Dm, roughCollide: Dm, draw: Pb, spacing: i_, gap: i_ }), s("triangle", { points: [-0.15, -0.3, 0, 0, 0.15, -0.3] }), s("arrow", "triangle"), s("triangle-backcurve", { points: t.triangle.points, controlPoint: [0, -0.15], roughCollide: r, draw: function(c, l, u, d, h) { var f = n(this.points, l, u, d), p = this.controlPoint, m = i(p[0], p[1], l, u, d); e.arrowShapeImpl(this.name)(c, f, m); }, gap: function(c) { return o(c) * 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(c, l, u, d, h, f, p) { var m = a(n(this.points, u + 2 * p, d, h)), y = a(n(this.pointsTee, u + 2 * p, d, h)), g = Vi(c, l, m) || Vi(c, l, y); return g; }, draw: function(c, l, u, d, h) { var f = n(this.points, l, u, d), p = n(this.pointsTee, l, u, d); e.arrowShapeImpl(this.name)(c, 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(c, l, u, d, h, f, p) { var m = h, y = Math.pow(m.x - c, 2) + Math.pow(m.y - l, 2) <= Math.pow((u + 2 * p) * this.radius, 2), g = a(n(this.points, u + 2 * p, d, h)); return Vi(c, l, g) || y; }, draw: function(c, l, u, d, h) { var f = n(this.pointsTr, l, u, d); e.arrowShapeImpl(this.name)(c, f, d.x, d.y, this.radius * l); }, spacing: function(c) { return e.getArrowWidth(c.pstyle("width").pfValue, c.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(c, l) { var u = this.baseCrossLinePts.slice(), d = l / c, h = 3, f = 5; return u[h] = u[h] - d, u[f] = u[f] - d, u; }, collide: function(c, l, u, d, h, f, p) { var m = a(n(this.points, u + 2 * p, d, h)), y = a(n(this.crossLinePts(u, f), u + 2 * p, d, h)), g = Vi(c, l, m) || Vi(c, l, y); return g; }, draw: function(c, l, u, d, h) { var f = n(this.points, l, u, d), p = n(this.crossLinePts(l, h), l, u, d); e.arrowShapeImpl(this.name)(c, f, p); } }), s("vee", { points: [-0.15, -0.3, 0, 0, 0.15, -0.3, 0, -0.15], gap: function(c) { return o(c) * 0.525; } }), s("circle", { radius: 0.15, collide: function(c, l, u, d, h, f, p) { var m = h, y = Math.pow(m.x - c, 2) + Math.pow(m.y - l, 2) <= Math.pow((u + 2 * p) * this.radius, 2); return y; }, draw: function(c, l, u, d, h) { e.arrowShapeImpl(this.name)(c, d.x, d.y, this.radius * l); }, spacing: function(c) { return e.getArrowWidth(c.pstyle("width").pfValue, c.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(c) { return 1; }, gap: function(c) { 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(c) { return c.pstyle("width").pfValue * c.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(c) { return 0.95 * c.pstyle("width").pfValue * c.pstyle("arrow-scale").value; } }); }; var Vl = {}; Vl.projectIntoViewport = function(t, e) { var r = this.cy, i = this.findContainerClientCoords(), n = i[0], a = i[1], o = i[4], s = r.pan(), c = r.zoom(), l = ((t - n) / o - s.x) / c, u = ((e - a) / o - s.y) / c; return [l, u]; }; Vl.findContainerClientCoords = function() { if (this.containerBB) return this.containerBB; var t = this.container, e = t.getBoundingClientRect(), r = this.cy.window().getComputedStyle(t), i = function(y) { return parseFloat(r.getPropertyValue(y)); }, n = { left: i("padding-left"), right: i("padding-right"), top: i("padding-top"), bottom: i("padding-bottom") }, a = { left: i("border-left-width"), right: i("border-right-width"), top: i("border-top-width"), bottom: i("border-bottom-width") }, o = t.clientWidth, s = t.clientHeight, c = n.left + n.right, l = n.top + n.bottom, u = a.left + a.right, d = e.width / (o + u), h = o - c, f = s - l, p = e.left + n.left + a.left, m = e.top + n.top + a.top; return this.containerBB = [p, m, h, f, d]; }; Vl.invalidateContainerClientCoordsCache = function() { this.containerBB = null; }; Vl.findNearestElement = function(t, e, r, i) { return this.findNearestElements(t, e, r, i)[0]; }; Vl.findNearestElements = function(t, e, r, i) { var n = this, a = this, o = a.getCachedZSortedEles(), s = [], c = a.cy.zoom(), l = a.cy.hasCompoundNodes(), u = (i ? 24 : 8) / c, d = (i ? 8 : 2) / c, h = (i ? 8 : 2) / c, f = 1 / 0, p, m; r && (o = o.interactive); function y(b, T) { if (b.isNode()) { if (m) return; m = b, s.push(b); } if (b.isEdge() && (T == null || T < f)) if (p) { if (p.pstyle("z-compound-depth").value === b.pstyle("z-compound-depth").value && p.pstyle("z-compound-depth").value === b.pstyle("z-compound-depth").value) { for (var E = 0; E < s.length; E++) if (s[E].isEdge()) { s[E] = b, p = b, f = T ?? f; break; } } } else s.push(b), p = b, f = T ?? f; } function g(b) { var T = b.outerWidth() + 2 * d, E = b.outerHeight() + 2 * d, C = T / 2, L = E / 2, A = b.position(), k = b.pstyle("corner-radius").value === "auto" ? "auto" : b.pstyle("corner-radius").pfValue, P = b._private.rscratch; if (A.x - C <= t && t <= A.x + C && A.y - L <= e && e <= A.y + L) { var R = a.nodeShapes[n.getNodeShape(b)]; if (R.checkPoint(t, e, 0, T, E, A.x, A.y, k, P)) return y(b, 0), !0; } } function v(b) { var T = b._private, E = T.rscratch, C = b.pstyle("width").pfValue, L = b.pstyle("arrow-scale").value, A = C / 2 + u, k = A * A, P = A * 2, R = T.source, M = T.target, O; if (E.edgeType === "segments" || E.edgeType === "straight" || E.edgeType === "haystack") { for (var D = E.allpts, I = 0; I + 3 < D.length; I += 2) if (Oj(t, e, D[I], D[I + 1], D[I + 2], D[I + 3], P) && k > (O = Fj(t, e, D[I], D[I + 1], D[I + 2], D[I + 3]))) return y(b, O), !0; } else if (E.edgeType === "bezier" || E.edgeType === "multibezier" || E.edgeType === "self" || E.edgeType === "compound") { for (var D = E.allpts, I = 0; I + 5 < E.allpts.length; I += 4) if (Dj(t, e, D[I], D[I + 1], D[I + 2], D[I + 3], D[I + 4], D[I + 5], P) && k > (O = Bj(t, e, D[I], D[I + 1], D[I + 2], D[I + 3], D[I + 4], D[I + 5]))) return y(b, O), !0; } for (var R = R || T.source, M = M || T.target, F = n.getArrowWidth(C, L), z = [{ name: "source", x: E.arrowStartX, y: E.arrowStartY, angle: E.srcArrowAngle }, { name: "target", x: E.arrowEndX, y: E.arrowEndY, angle: E.tgtArrowAngle }, { name: "mid-source", x: E.midX, y: E.midY, angle: E.midsrcArrowAngle }, { name: "mid-target", x: E.midX, y: E.midY, angle: E.midtgtArrowAngle }], I = 0; I < z.length; I++) { var U = z[I], Z = a.arrowShapes[b.pstyle(U.name + "-arrow-shape").value], re = b.pstyle("width").pfValue; if (Z.roughCollide(t, e, F, U.angle, { x: U.x, y: U.y }, re, u) && Z.collide(t, e, F, U.angle, { x: U.x, y: U.y }, re, u)) return y(b), !0; } l && s.length > 0 && (g(R), g(M)); } function x(b, T, E) { return $n(b, T, E); } function w(b, T) { var E = b._private, C = h, L; T ? L = T + "-" : L = "", b.boundingBox(); var A = E.labelBounds[T || "main"], k = b.pstyle(L + "label").value, P = b.pstyle("text-events").strValue === "yes"; if (!(!P || !k)) { var R = x(E.rscratch, "labelX", T), M = x(E.rscratch, "labelY", T), O = x(E.rscratch, "labelAngle", T), D = b.pstyle(L + "text-margin-x").pfValue, I = b.pstyle(L + "text-margin-y").pfValue, F = A.x1 - C - D, z = A.x2 + C - D, U = A.y1 - C - I, Z = A.y2 + C - I; if (O) { var re = Math.cos(O), K = Math.sin(O), V = function(ie, ue) { return ie = ie - R, ue = ue - M, { x: ie * re - ue * K + R, y: ie * K + ue * re + M }; }, H = V(F, U), G = V(F, Z), W = V(z, U), Y = V(z, Z), X = [ // with the margin added after the rotation is applied H.x + D, H.y + I, W.x + D, W.y + I, Y.x + D, Y.y + I, G.x + D, G.y + I ]; if (Vi(t, e, X)) return y(b), !0; } else if (iu(A, t, e)) return y(b), !0; } } for (var S = o.length - 1; S >= 0; S--) { var _ = o[S]; _.isNode() ? g(_) || w(_) : v(_) || w(_) || w(_, "source") || w(_, "target"); } return s; }; Vl.getAllInBox = function(t, e, r, i) { var n = this.getCachedZSortedEles().interactive, a = [], o = Math.min(t, r), s = Math.max(t, r), c = Math.min(e, i), l = Math.max(e, i); t = o, r = s, e = c, i = l; for (var u = Yi({ x1: t, y1: e, x2: r, y2: i }), d = 0; d < n.length; d++) { var h = n[d]; if (h.isNode()) { var f = h, p = f.boundingBox({ includeNodes: !0, includeEdges: !1, includeLabels: !1 }); Db(u, p) && !IA(p, u) && a.push(f); } else { var m = h, y = m._private, g = y.rscratch; if (g.startX != null && g.startY != null && !iu(u, g.startX, g.startY) || g.endX != null && g.endY != null && !iu(u, 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 v = y.rstyle.bezierPts || y.rstyle.linePts || y.rstyle.haystackPts, x = !0, w = 0; w < v.length; w++) if (!Rj(u, v[w])) { x = !1; break; } x && a.push(m); } else (g.edgeType === "haystack" || g.edgeType === "straight") && a.push(m); } } return a; }; var Um = {}; Um.calculateArrowAngles = function(t) { var e = t._private.rscratch, r = e.edgeType === "haystack", i = e.edgeType === "bezier", n = e.edgeType === "multibezier", a = e.edgeType === "segments", o = e.edgeType === "compound", s = e.edgeType === "self", c, l, u, d, h, f, g, v; if (r ? (u = e.haystackPts[0], d = e.haystackPts[1], h = e.haystackPts[2], f = e.haystackPts[3]) : (u = e.arrowStartX, d = e.arrowStartY, h = e.arrowEndX, f = e.arrowEndY), g = e.midX, v = e.midY, a) c = u - e.segpts[0], l = d - e.segpts[1]; else if (n || o || s || i) { var p = e.allpts, m = ei(p[0], p[2], p[4], 0.1), y = ei(p[1], p[3], p[5], 0.1); c = u - m, l = d - y; } else c = u - g, l = d - v; e.srcArrowAngle = Up(c, l); var g = e.midX, v = e.midY; if (r && (g = (u + h) / 2, v = (d + f) / 2), c = h - u, l = f - d, a) { var p = e.allpts; if (p.length / 2 % 2 === 0) { var x = p.length / 2, w = x - 2; c = p[x] - p[w], l = p[x + 1] - p[w + 1]; } else if (e.isRound) c = e.midVector[1], l = -e.midVector[0]; else { var x = p.length / 2 - 1, w = x - 2; c = p[x] - p[w], l = p[x + 1] - p[w + 1]; } } else if (n || o || s) { var p = e.allpts, S = e.ctrlpts, _, b, T, E; if (S.length / 2 % 2 === 0) { var C = p.length / 2 - 1, L = C + 2, A = L + 2; _ = ei(p[C], p[L], p[A], 0), b = ei(p[C + 1], p[L + 1], p[A + 1], 0), T = ei(p[C], p[L], p[A], 1e-4), E = ei(p[C + 1], p[L + 1], p[A + 1], 1e-4); } else { var L = p.length / 2 - 1, C = L - 2, A = L + 2; _ = ei(p[C], p[L], p[A], 0.4999), b = ei(p[C + 1], p[L + 1], p[A + 1], 0.4999), T = ei(p[C], p[L], p[A], 0.5), E = ei(p[C + 1], p[L + 1], p[A + 1], 0.5); } c = T - _, l = E - b; } if (e.midtgtArrowAngle = Up(c, l), e.midDispX = c, e.midDispY = l, c *= -1, l *= -1, a) { var p = e.allpts; if (p.length / 2 % 2 !== 0 && !e.isRound) { var x = p.length / 2 - 1, k = x + 2; c = -(p[k] - p[x]), l = -(p[k + 1] - p[x + 1]); } } if (e.midsrcArrowAngle = Up(c, l), a) c = h - e.segpts[e.segpts.length - 2], l = f - e.segpts[e.segpts.length - 1]; else if (n || o || s || i) { var p = e.allpts, P = p.length, m = ei(p[P - 6], p[P - 4], p[P - 2], 0.9), y = ei(p[P - 5], p[P - 3], p[P - 1], 0.9); c = h - m, l = f - y; } else c = h - g, l = f - v; e.tgtArrowAngle = Up(c, l); }; Um.getArrowWidth = Um.getArrowHeight = function(t, e) { var r = this.arrowWidthCache = this.arrowWidthCache || {}, i = r[t + ", " + e]; return i || (i = Math.max(Math.pow(t * 13.37, 0.9), 29) * e, r[t + ", " + e] = i, i); }; var Py, Ry, ra = {}, gn = {}, X_, Z_, Qs, fm, Pa, zs, Zs, ta, nc, Kp, C3, A3, Oy, Dy, Y_, K_ = function(t, e, r) { r.x = e.x - t.x, r.y = e.y - t.y, r.len = Math.sqrt(r.x * r.x + r.y * r.y), r.nx = r.x / r.len, r.ny = r.y / r.len, r.ang = Math.atan2(r.ny, r.nx); }, b7 = function(t, e) { e.x = t.x * -1, e.y = t.y * -1, e.nx = t.nx * -1, e.ny = t.ny * -1, e.ang = t.ang > 0 ? -(Math.PI - t.ang) : Math.PI + t.ang; }, x7 = function(t, e, r, i, n) { if (t !== Y_ ? K_(e, t, ra) : b7(gn, ra), K_(e, r, gn), X_ = ra.nx * gn.ny - ra.ny * gn.nx, Z_ = ra.nx * gn.nx - ra.ny * -gn.ny, Pa = Math.asin(Math.max(-1, Math.min(1, X_))), Math.abs(Pa) < 1e-6) { Py = e.x, Ry = e.y, Zs = nc = 0; return; } Qs = 1, fm = !1, Z_ < 0 ? Pa < 0 ? Pa = Math.PI + Pa : (Pa = Math.PI - Pa, Qs = -1, fm = !0) : Pa > 0 && (Qs = -1, fm = !0), e.radius !== void 0 ? nc = e.radius : nc = i, zs = Pa / 2, Kp = Math.min(ra.len / 2, gn.len / 2), n ? (ta = Math.abs(Math.cos(zs) * nc / Math.sin(zs)), ta > Kp ? (ta = Kp, Zs = Math.abs(ta * Math.sin(zs) / Math.cos(zs))) : Zs = nc) : (ta = Math.min(Kp, nc), Zs = Math.abs(ta * Math.sin(zs) / Math.cos(zs))), Oy = e.x + gn.nx * ta, Dy = e.y + gn.ny * ta, Py = Oy - gn.ny * Zs * Qs, Ry = Dy + gn.nx * Zs * Qs, C3 = e.x + ra.nx * ta, A3 = e.y + ra.ny * ta, Y_ = e; }; function L3(t, e) { e.radius === 0 ? t.lineTo(e.cx, e.cy) : t.arc(e.cx, e.cy, e.radius, e.startAngle, e.endAngle, e.counterClockwise); } function qb(t, e, r, i) { var n = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0; return i === 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 } : (x7(t, e, r, i, n), { cx: Py, cy: Ry, radius: Zs, startX: C3, startY: A3, stopX: Oy, stopY: Dy, startAngle: ra.ang + Math.PI / 2 * Qs, endAngle: gn.ang - Math.PI / 2 * Qs, counterClockwise: fm }); } var Pi = {}; Pi.findMidptPtsEtc = function(t, e) { var r = e.posPts, i = e.intersectionPts, n = e.vectorNormInverse, a, o = t.pstyle("source-endpoint"), s = t.pstyle("target-endpoint"), c = o.units != null && s.units != null, l = function(w, S, _, b) { var T = b - S, E = _ - w, C = Math.sqrt(E * E + T * T); return { x: -T / C, y: E / C }; }, u = t.pstyle("edge-distances").value; switch (u) { case "node-position": a = r; break; case "intersection": a = i; break; case "endpoints": { if (c) { var d = this.manualEndptToPx(t.source()[0], o), h = Fn(d, 2), f = h[0], p = h[1], m = this.manualEndptToPx(t.target()[0], s), y = Fn(m, 2), g = y[0], v = y[1], x = { x1: f, y1: p, x2: g, y2: v }; n = l(f, p, g, v), a = x; } else Zt("Edge ".concat(t.id(), " has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")), a = i; break; } } return { midptPts: a, vectorNormInverse: n }; }; Pi.findHaystackPoints = function(t) { for (var e = 0; e < t.length; e++) { var r = t[e], i = r._private, n = i.rscratch; if (!n.haystack) { var a = Math.random() * 2 * Math.PI; n.source = { x: Math.cos(a), y: Math.sin(a) }, a = Math.random() * 2 * Math.PI, n.target = { x: Math.cos(a), y: Math.sin(a) }; } var o = i.source, s = i.target, c = o.position(), l = s.position(), u = o.width(), d = s.width(), h = o.height(), f = s.height(), p = r.pstyle("haystack-radius").value, m = p / 2; n.haystackPts = n.allpts = [n.source.x * u * m + c.x, n.source.y * h * m + c.y, n.target.x * d * m + l.x, n.target.y * f * m + l.y], n.midX = (n.allpts[0] + n.allpts[2]) / 2, n.midY = (n.allpts[1] + n.allpts[3]) / 2, n.edgeType = "haystack", n.haystack = !0, this.storeEdgeProjections(r), this.calculateArrowAngles(r), this.recalculateEdgeLabelProjections(r), this.calculateLabelAngles(r); } }; Pi.findSegmentsPoints = function(t, e) { var r = t._private.rscratch, i = t.pstyle("segment-weights"), n = t.pstyle("segment-distances"), a = t.pstyle("segment-radii"), o = t.pstyle("radius-type"), s = Math.min(i.pfValue.length, n.pfValue.length), c = a.pfValue[a.pfValue.length - 1], l = o.pfValue[o.pfValue.length - 1]; r.edgeType = "segments", r.segpts = [], r.radii = [], r.isArcRadius = []; for (var u = 0; u < s; u++) { var d = i.pfValue[u], h = n.pfValue[u], f = 1 - d, p = d, m = this.findMidptPtsEtc(t, e), y = m.midptPts, g = m.vectorNormInverse, v = { x: y.x1 * f + y.x2 * p, y: y.y1 * f + y.y2 * p }; r.segpts.push(v.x + g.x * h, v.y + g.y * h), r.radii.push(a.pfValue[u] !== void 0 ? a.pfValue[u] : c), r.isArcRadius.push((o.pfValue[u] !== void 0 ? o.pfValue[u] : l) === "arc-radius"); } }; Pi.findLoopPoints = function(t, e, r, i) { var n = t._private.rscratch, a = e.dirCounts, o = e.srcPos, s = t.pstyle("control-point-distances"), c = s ? s.pfValue[0] : void 0, l = t.pstyle("loop-direction").pfValue, u = t.pstyle("loop-sweep").pfValue, d = t.pstyle("control-point-step-size").pfValue; n.edgeType = "self"; var h = r, f = d; i && (h = 0, f = c); var p = l - Math.PI / 2, m = p - u / 2, y = p + u / 2, g = l + "_" + u; h = a[g] === void 0 ? a[g] = 0 : ++a[g], n.ctrlpts = [o.x + Math.cos(m) * 1.4 * f * (h / 3 + 1), o.y + Math.sin(m) * 1.4 * f * (h / 3 + 1), o.x + Math.cos(y) * 1.4 * f * (h / 3 + 1), o.y + Math.sin(y) * 1.4 * f * (h / 3 + 1)]; }; Pi.findCompoundLoopPoints = function(t, e, r, i) { var n = t._private.rscratch; n.edgeType = "compound"; var a = e.srcPos, o = e.tgtPos, s = e.srcW, c = e.srcH, l = e.tgtW, u = e.tgtH, d = t.pstyle("control-point-step-size").pfValue, h = t.pstyle("control-point-distances"), f = h ? h.pfValue[0] : void 0, p = r, m = d; i && (p = 0, m = f); var y = 50, g = { x: a.x - s / 2, y: a.y - c / 2 }, v = { x: o.x - l / 2, y: o.y - u / 2 }, x = { x: Math.min(g.x, v.x), y: Math.min(g.y, v.y) }, w = 0.5, S = Math.max(w, Math.log(s * 0.01)), _ = Math.max(w, Math.log(l * 0.01)); n.ctrlpts = [x.x, x.y - (1 + Math.pow(y, 1.12) / 100) * m * (p / 3 + 1) * S, x.x - (1 + Math.pow(y, 1.12) / 100) * m * (p / 3 + 1) * _, x.y]; }; Pi.findStraightEdgePoints = function(t) { t._private.rscratch.edgeType = "straight"; }; Pi.findBezierPoints = function(t, e, r, i, n) { var a = t._private.rscratch, o = t.pstyle("control-point-step-size").pfValue, s = t.pstyle("control-point-distances"), c = t.pstyle("control-point-weights"), l = s && c ? Math.min(s.value.length, c.value.length) : 1, u = s ? s.pfValue[0] : void 0, d = c.value[0], h = i; a.edgeType = h ? "multibezier" : "bezier", a.ctrlpts = []; for (var f = 0; f < l; f++) { var p = (0.5 - e.eles.length / 2 + r) * o * (n ? -1 : 1), m = void 0, y = OA(p); h && (u = s ? s.pfValue[f] : o, d = c.value[f]), i ? m = u : m = u !== void 0 ? y * u : void 0; var g = m !== void 0 ? m : p, v = 1 - d, x = d, w = this.findMidptPtsEtc(t, e), S = w.midptPts, _ = w.vectorNormInverse, b = { x: S.x1 * v + S.x2 * x, y: S.y1 * v + S.y2 * x }; a.ctrlpts.push(b.x + _.x * g, b.y + _.y * g); } }; Pi.findTaxiPoints = function(t, e) { var r = t._private.rscratch; r.edgeType = "segments"; var i = "vertical", n = "horizontal", a = "leftward", o = "rightward", s = "downward", c = "upward", l = "auto", u = e.posPts, d = e.srcW, h = e.srcH, f = e.tgtW, p = e.tgtH, m = t.pstyle("edge-distances").value, y = m !== "node-position", g = t.pstyle("taxi-direction").value, v = g, x = t.pstyle("taxi-turn"), w = x.units === "%", S = x.pfValue, _ = S < 0, b = t.pstyle("taxi-turn-min-distance").pfValue, T = y ? (d + f) / 2 : 0, E = y ? (h + p) / 2 : 0, C = u.x2 - u.x1, L = u.y2 - u.y1, A = function(He, We) { return He > 0 ? Math.max(He - We, 0) : Math.min(He + We, 0); }, k = A(C, T), P = A(L, E), R = !1; v === l ? g = Math.abs(k) > Math.abs(P) ? n : i : v === c || v === s ? (g = i, R = !0) : (v === a || v === o) && (g = n, R = !0); var M = g === i, O = M ? P : k, D = M ? L : C, I = OA(D), F = !1; !(R && (w || _)) && (v === s && D < 0 || v === c && D > 0 || v === a && D > 0 || v === o && D < 0) && (I *= -1, O = I * Math.abs(O), F = !0); var z; if (w) { var U = S < 0 ? 1 + S : S; z = U * O; } else { var Z = S < 0 ? O : 0; z = Z + S * I; } var re = function(He) { return Math.abs(He) < b || Math.abs(He) >= Math.abs(O); }, K = re(z), V = re(Math.abs(O) - Math.abs(z)), H = K || V; if (H && !F) if (M) { var G = Math.abs(D) <= h / 2, W = Math.abs(C) <= f / 2; if (G) { var Y = (u.x1 + u.x2) / 2, X = u.y1, ie = u.y2; r.segpts = [Y, X, Y, ie]; } else if (W) { var ue = (u.y1 + u.y2) / 2, $ = u.x1, J = u.x2; r.segpts = [$, ue, J, ue]; } else r.segpts = [u.x1, u.y2]; } else { var ne = Math.abs(D) <= d / 2, j = Math.abs(L) <= p / 2; if (ne) { var q = (u.y1 + u.y2) / 2, ge = u.x1, ye = u.x2; r.segpts = [ge, q, ye, q]; } else if (j) { var _e = (u.x1 + u.x2) / 2, Me = u.y1, Ce = u.y2; r.segpts = [_e, Me, _e, Ce]; } else r.segpts = [u.x2, u.y1]; } else if (M) { var B = u.y1 + z + (y ? h / 2 * I : 0), ce = u.x1, ve = u.x2; r.segpts = [ce, B, ve, B]; } else { var te = u.x1 + z + (y ? d / 2 * I : 0), pe = u.y1, fe = u.y2; r.segpts = [te, pe, te, fe]; } if (r.isRound) { var he = t.pstyle("taxi-radius").value, Te = t.pstyle("radius-type").value[0] === "arc-radius"; r.radii = new Array(r.segpts.length / 2).fill(he), r.isArcRadius = new Array(r.segpts.length / 2).fill(Te); } }; Pi.tryToCorrectInvalidPoints = function(t, e) { var r = t._private.rscratch; if (r.edgeType === "bezier") { var i = e.srcPos, n = e.tgtPos, a = e.srcW, o = e.srcH, s = e.tgtW, c = e.tgtH, l = e.srcShape, u = e.tgtShape, d = e.srcCornerRadius, h = e.tgtCornerRadius, f = e.srcRs, p = e.tgtRs, m = !Xe(r.startX) || !Xe(r.startY), y = !Xe(r.arrowStartX) || !Xe(r.arrowStartY), g = !Xe(r.endX) || !Xe(r.endY), v = !Xe(r.arrowEndX) || !Xe(r.arrowEndY), x = 3, w = this.getArrowWidth(t.pstyle("width").pfValue, t.pstyle("arrow-scale").value) * this.arrowShapeWidth, S = x * w, _ = _l({ x: r.ctrlpts[0], y: r.ctrlpts[1] }, { x: r.startX, y: r.startY }), b = _ < S, T = _l({ x: r.ctrlpts[0], y: r.ctrlpts[1] }, { x: r.endX, y: r.endY }), E = T < S, C = !1; if (m || y || b) { C = !0; var L = { // delta x: r.ctrlpts[0] - i.x, y: r.ctrlpts[1] - i.y }, A = Math.sqrt(L.x * L.x + L.y * L.y), k = { // normalised delta x: L.x / A, y: L.y / A }, P = Math.max(a, o), R = { // *2 radius guarantees outside shape x: r.ctrlpts[0] + k.x * 2 * P, y: r.ctrlpts[1] + k.y * 2 * P }, M = l.intersectLine(i.x, i.y, a, o, R.x, R.y, 0, d, f); b ? (r.ctrlpts[0] = r.ctrlpts[0] + k.x * (S - _), r.ctrlpts[1] = r.ctrlpts[1] + k.y * (S - _)) : (r.ctrlpts[0] = M[0] + k.x * S, r.ctrlpts[1] = M[1] + k.y * S); } if (g || v || E) { C = !0; var O = { // delta x: r.ctrlpts[0] - n.x, y: r.ctrlpts[1] - n.y }, D = Math.sqrt(O.x * O.x + O.y * O.y), I = { // normalised delta x: O.x / D, y: O.y / D }, F = Math.max(a, o), z = { // *2 radius guarantees outside shape x: r.ctrlpts[0] + I.x * 2 * F, y: r.ctrlpts[1] + I.y * 2 * F }, U = u.intersectLine(n.x, n.y, s, c, z.x, z.y, 0, h, p); E ? (r.ctrlpts[0] = r.ctrlpts[0] + I.x * (S - T), r.ctrlpts[1] = r.ctrlpts[1] + I.y * (S - T)) : (r.ctrlpts[0] = U[0] + I.x * S, r.ctrlpts[1] = U[1] + I.y * S); } C && this.findEndpoints(t); } }; Pi.storeAllpts = function(t) { var e = t._private.rscratch; if (e.edgeType === "multibezier" || e.edgeType === "bezier" || e.edgeType === "self" || e.edgeType === "compound") { e.allpts = [], e.allpts.push(e.startX, e.startY); for (var r = 0; r + 1 < e.ctrlpts.length; r += 2) e.allpts.push(e.ctrlpts[r], e.ctrlpts[r + 1]), r + 3 < e.ctrlpts.length && e.allpts.push((e.ctrlpts[r] + e.ctrlpts[r + 2]) / 2, (e.ctrlpts[r + 1] + e.ctrlpts[r + 3]) / 2); e.allpts.push(e.endX, e.endY); var i, n; e.ctrlpts.length / 2 % 2 === 0 ? (i = e.allpts.length / 2 - 1, e.midX = e.allpts[i], e.midY = e.allpts[i + 1]) : (i = e.allpts.length / 2 - 3, n = 0.5, e.midX = ei(e.allpts[i], e.allpts[i + 2], e.allpts[i + 4], n), e.midY = ei(e.allpts[i + 1], e.allpts[i + 3], e.allpts[i + 5], n)); } 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 a = 2; a + 3 < e.allpts.length; a += 2) { var o = e.radii[a / 2 - 1], s = e.isArcRadius[a / 2 - 1]; e.roundCorners.push(qb({ x: e.allpts[a - 2], y: e.allpts[a - 1] }, { x: e.allpts[a], y: e.allpts[a + 1], radius: o }, { x: e.allpts[a + 2], y: e.allpts[a + 3] }, o, s)); } } if (e.segpts.length % 4 === 0) { var c = e.segpts.length / 2, l = c - 2; e.midX = (e.segpts[l] + e.segpts[c]) / 2, e.midY = (e.segpts[l + 1] + e.segpts[c + 1]) / 2; } else { var u = e.segpts.length / 2 - 1; if (!e.isRound) e.midX = e.segpts[u], e.midY = e.segpts[u + 1]; else { var d = { x: e.segpts[u], y: e.segpts[u + 1] }, h = e.roundCorners[u / 2], f = [d.x - h.cx, d.y - h.cy], p = h.radius / Math.sqrt(Math.pow(f[0], 2) + Math.pow(f[1], 2)); f = f.map(function(m) { return m * p; }), e.midX = h.cx + f[0], e.midY = h.cy + f[1], e.midVector = f; } } } }; Pi.checkForInvalidEdgeWarning = function(t) { var e = t[0]._private.rscratch; e.nodesOverlap || Xe(e.startX) && Xe(e.startY) && Xe(e.endX) && Xe(e.endY) ? e.loggedErr = !1 : e.loggedErr || (e.loggedErr = !0, Zt("Edge `" + t.id() + "` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap.")); }; Pi.findEdgeControlPoints = function(t) { var e = this; if (!(!t || t.length === 0)) { for (var r = this, i = r.cy, n = i.hasCompoundNodes(), a = { map: new ca(), get: function(_) { var b = this.map.get(_[0]); return b != null ? b.get(_[1]) : null; }, set: function(_, b) { var T = this.map.get(_[0]); T == null && (T = new ca(), this.map.set(_[0], T)), T.set(_[1], b); } }, o = [], s = [], c = 0; c < t.length; c++) { var l = t[c], u = l._private, d = l.pstyle("curve-style").value; if (!(l.removed() || !l.takesUpSpace())) { if (d === "haystack") { s.push(l); continue; } var h = d === "unbundled-bezier" || d.endsWith("segments") || d === "straight" || d === "straight-triangle" || d.endsWith("taxi"), f = d === "unbundled-bezier" || d === "bezier", p = u.source, m = u.target, y = p.poolIndex(), g = m.poolIndex(), v = [y, g].sort(), x = a.get(v); x == null && (x = { eles: [] }, a.set(v, x), o.push(v)), x.eles.push(l), h && (x.hasUnbundled = !0), f && (x.hasBezier = !0); } } for (var w = function(_) { var b = o[_], T = a.get(b), E = void 0; if (!T.hasUnbundled) { var C = T.eles[0].parallelEdges().filter(function(ve) { return ve.isBundledBezier(); }); Rb(T.eles), C.forEach(function(ve) { return T.eles.push(ve); }), T.eles.sort(function(ve, te) { return ve.poolIndex() - te.poolIndex(); }); } var L = T.eles[0], A = L.source(), k = L.target(); if (A.poolIndex() > k.poolIndex()) { var P = A; A = k, k = P; } var R = T.srcPos = A.position(), M = T.tgtPos = k.position(), O = T.srcW = A.outerWidth(), D = T.srcH = A.outerHeight(), I = T.tgtW = k.outerWidth(), F = T.tgtH = k.outerHeight(), z = T.srcShape = r.nodeShapes[e.getNodeShape(A)], U = T.tgtShape = r.nodeShapes[e.getNodeShape(k)], Z = T.srcCornerRadius = A.pstyle("corner-radius").value === "auto" ? "auto" : A.pstyle("corner-radius").pfValue, re = T.tgtCornerRadius = k.pstyle("corner-radius").value === "auto" ? "auto" : k.pstyle("corner-radius").pfValue, K = T.tgtRs = k._private.rscratch, V = T.srcRs = A._private.rscratch; T.dirCounts = { north: 0, west: 0, south: 0, east: 0, northwest: 0, southwest: 0, northeast: 0, southeast: 0 }; for (var H = 0; H < T.eles.length; H++) { var G = T.eles[H], W = G[0]._private.rscratch, Y = G.pstyle("curve-style").value, X = Y === "unbundled-bezier" || Y.endsWith("segments") || Y.endsWith("taxi"), ie = !A.same(G.source()); if (!T.calculatedIntersection && A !== k && (T.hasBezier || T.hasUnbundled)) { T.calculatedIntersection = !0; var ue = z.intersectLine(R.x, R.y, O, D, M.x, M.y, 0, Z, V), $ = T.srcIntn = ue, J = U.intersectLine(M.x, M.y, I, F, R.x, R.y, 0, re, K), ne = T.tgtIntn = J, j = T.intersectionPts = { x1: ue[0], x2: J[0], y1: ue[1], y2: J[1] }, q = T.posPts = { x1: R.x, x2: M.x, y1: R.y, y2: M.y }, ge = J[1] - ue[1], ye = J[0] - ue[0], _e = Math.sqrt(ye * ye + ge * ge), Me = T.vector = { x: ye, y: ge }, Ce = T.vectorNorm = { x: Me.x / _e, y: Me.y / _e }, B = { x: -Ce.y, y: Ce.x }; T.nodesOverlap = !Xe(_e) || U.checkPoint(ue[0], ue[1], 0, I, F, M.x, M.y, re, K) || z.checkPoint(J[0], J[1], 0, O, D, R.x, R.y, Z, V), T.vectorNormInverse = B, E = { nodesOverlap: T.nodesOverlap, dirCounts: T.dirCounts, calculatedIntersection: !0, hasBezier: T.hasBezier, hasUnbundled: T.hasUnbundled, eles: T.eles, srcPos: M, tgtPos: R, srcW: I, srcH: F, tgtW: O, tgtH: D, srcIntn: ne, tgtIntn: $, srcShape: U, tgtShape: z, posPts: { x1: q.x2, y1: q.y2, x2: q.x1, y2: q.y1 }, intersectionPts: { x1: j.x2, y1: j.y2, x2: j.x1, y2: j.y1 }, vector: { x: -Me.x, y: -Me.y }, vectorNorm: { x: -Ce.x, y: -Ce.y }, vectorNormInverse: { x: -B.x, y: -B.y } }; } var ce = ie ? E : T; W.nodesOverlap = ce.nodesOverlap, W.srcIntn = ce.srcIntn, W.tgtIntn = ce.tgtIntn, W.isRound = Y.startsWith("round"), n && (A.isParent() || A.isChild() || k.isParent() || k.isChild()) && (A.parents().anySame(k) || k.parents().anySame(A) || A.same(k) && A.isParent()) ? e.findCompoundLoopPoints(G, ce, H, X) : A === k ? e.findLoopPoints(G, ce, H, X) : Y.endsWith("segments") ? e.findSegmentsPoints(G, ce) : Y.endsWith("taxi") ? e.findTaxiPoints(G, ce) : Y === "straight" || !X && T.eles.length % 2 === 1 && H === Math.floor(T.eles.length / 2) ? e.findStraightEdgePoints(G) : e.findBezierPoints(G, ce, H, X, ie), e.findEndpoints(G), e.tryToCorrectInvalidPoints(G, ce), e.checkForInvalidEdgeWarning(G), e.storeAllpts(G), e.storeEdgeProjections(G), e.calculateArrowAngles(G), e.recalculateEdgeLabelProjections(G), e.calculateLabelAngles(G); } }, S = 0; S < o.length; S++) w(S); this.findHaystackPoints(s); } }; function k3(t) { var e = []; if (t != null) { for (var r = 0; r < t.length; r += 2) { var i = t[r], n = t[r + 1]; e.push({ x: i, y: n }); } return e; } } Pi.getSegmentPoints = function(t) { var e = t[0]._private.rscratch, r = e.edgeType; if (r === "segments") return this.recalculateRenderedStyle(t), k3(e.segpts); }; Pi.getControlPoints = function(t) { var e = t[0]._private.rscratch, r = e.edgeType; if (r === "bezier" || r === "multibezier" || r === "self" || r === "compound") return this.recalculateRenderedStyle(t), k3(e.ctrlpts); }; Pi.getEdgeMidpoint = function(t) { var e = t[0]._private.rscratch; return this.recalculateRenderedStyle(t), { x: e.midX, y: e.midY }; }; var sp = {}; sp.manualEndptToPx = function(t, e) { var r = this, i = t.position(), n = t.outerWidth(), a = t.outerHeight(), o = t._private.rscratch; if (e.value.length === 2) { var s = [e.pfValue[0], e.pfValue[1]]; return e.units[0] === "%" && (s[0] = s[0] * n), e.units[1] === "%" && (s[1] = s[1] * a), s[0] += i.x, s[1] += i.y, s; } else { var c = e.pfValue[0]; c = -Math.PI / 2 + c; var l = 2 * Math.max(n, a), u = [i.x + Math.cos(c) * l, i.y + Math.sin(c) * l]; return r.nodeShapes[this.getNodeShape(t)].intersectLine(i.x, i.y, n, a, u[0], u[1], 0, t.pstyle("corner-radius").value === "auto" ? "auto" : t.pstyle("corner-radius").pfValue, o); } }; sp.findEndpoints = function(t) { var e = this, r, i = t.source()[0], n = t.target()[0], a = i.position(), o = n.position(), s = t.pstyle("target-arrow-shape").value, c = t.pstyle("source-arrow-shape").value, l = t.pstyle("target-distance-from-node").pfValue, u = t.pstyle("source-distance-from-node").pfValue, d = i._private.rscratch, h = n._private.rscratch, f = t.pstyle("curve-style").value, p = t._private.rscratch, m = p.edgeType, y = f === "taxi", g = m === "self" || m === "compound", v = m === "bezier" || m === "multibezier" || g, x = m !== "bezier", w = m === "straight" || m === "segments", S = m === "segments", _ = v || x || w, b = g || y, T = t.pstyle("source-endpoint"), E = b ? "outside-to-node" : T.value, C = i.pstyle("corner-radius").value === "auto" ? "auto" : i.pstyle("corner-radius").pfValue, L = t.pstyle("target-endpoint"), A = b ? "outside-to-node" : L.value, k = n.pstyle("corner-radius").value === "auto" ? "auto" : n.pstyle("corner-radius").pfValue; p.srcManEndpt = T, p.tgtManEndpt = L; var P, R, M, O; if (v) { var D = [p.ctrlpts[0], p.ctrlpts[1]], I = x ? [p.ctrlpts[p.ctrlpts.length - 2], p.ctrlpts[p.ctrlpts.length - 1]] : D; P = I, R = D; } else if (w) { var F = S ? p.segpts.slice(0, 2) : [o.x, o.y], z = S ? p.segpts.slice(p.segpts.length - 2) : [a.x, a.y]; P = z, R = F; } if (A === "inside-to-node") r = [o.x, o.y]; else if (L.units) r = this.manualEndptToPx(n, L); else if (A === "outside-to-line") r = p.tgtIntn; else if (A === "outside-to-node" || A === "outside-to-node-or-label" ? M = P : (A === "outside-to-line" || A === "outside-to-line-or-label") && (M = [a.x, a.y]), r = e.nodeShapes[this.getNodeShape(n)].intersectLine(o.x, o.y, n.outerWidth(), n.outerHeight(), M[0], M[1], 0, k, h), A === "outside-to-node-or-label" || A === "outside-to-line-or-label") { var U = n._private.rscratch, Z = U.labelWidth, re = U.labelHeight, K = U.labelX, V = U.labelY, H = Z / 2, G = re / 2, W = n.pstyle("text-valign").value; W === "top" ? V -= G : W === "bottom" && (V += G); var Y = n.pstyle("text-halign").value; Y === "left" ? K -= H : Y === "right" && (K += H); var X = bh(M[0], M[1], [K - H, V - G, K + H, V - G, K + H, V + G, K - H, V + G], o.x, o.y); if (X.length > 0) { var ie = a, ue = qs(ie, Oc(r)), $ = qs(ie, Oc(X)), J = ue; if ($ < ue && (r = X, J = $), X.length > 2) { var ne = qs(ie, { x: X[2], y: X[3] }); ne < J && (r = [X[2], X[3]]); } } } var j = jp(r, P, e.arrowShapes[s].spacing(t) + l), q = jp(r, P, e.arrowShapes[s].gap(t) + l); if (p.endX = q[0], p.endY = q[1], p.arrowEndX = j[0], p.arrowEndY = j[1], E === "inside-to-node") r = [a.x, a.y]; else if (T.units) r = this.manualEndptToPx(i, T); else if (E === "outside-to-line") r = p.srcIntn; else if (E === "outside-to-node" || E === "outside-to-node-or-label" ? O = R : (E === "outside-to-line" || E === "outside-to-line-or-label") && (O = [o.x, o.y]), r = e.nodeShapes[this.getNodeShape(i)].intersectLine(a.x, a.y, i.outerWidth(), i.outerHeight(), O[0], O[1], 0, C, d), E === "outside-to-node-or-label" || E === "outside-to-line-or-label") { var ge = i._private.rscratch, ye = ge.labelWidth, _e = ge.labelHeight, Me = ge.labelX, Ce = ge.labelY, B = ye / 2, ce = _e / 2, ve = i.pstyle("text-valign").value; ve === "top" ? Ce -= ce : ve === "bottom" && (Ce += ce); var te = i.pstyle("text-halign").value; te === "left" ? Me -= B : te === "right" && (Me += B); var pe = bh(O[0], O[1], [Me - B, Ce - ce, Me + B, Ce - ce, Me + B, Ce + ce, Me - B, Ce + ce], a.x, a.y); if (pe.length > 0) { var fe = o, he = qs(fe, Oc(r)), Te = qs(fe, Oc(pe)), He = he; if (Te < he && (r = [pe[0], pe[1]], He = Te), pe.length > 2) { var We = qs(fe, { x: pe[2], y: pe[3] }); We < He && (r = [pe[2], pe[3]]); } } } var Ie = jp(r, R, e.arrowShapes[c].spacing(t) + u), qe = jp(r, R, e.arrowShapes[c].gap(t) + u); p.startX = qe[0], p.startY = qe[1], p.arrowStartX = Ie[0], p.arrowStartY = Ie[1], _ && (!Xe(p.startX) || !Xe(p.startY) || !Xe(p.endX) || !Xe(p.endY) ? p.badLine = !0 : p.badLine = !1); }; sp.getSourceEndpoint = function(t) { var e = t[0]._private.rscratch; switch (this.recalculateRenderedStyle(t), e.edgeType) { case "haystack": return { x: e.haystackPts[0], y: e.haystackPts[1] }; default: return { x: e.arrowStartX, y: e.arrowStartY }; } }; sp.getTargetEndpoint = function(t) { var e = t[0]._private.rscratch; switch (this.recalculateRenderedStyle(t), e.edgeType) { case "haystack": return { x: e.haystackPts[2], y: e.haystackPts[3] }; default: return { x: e.arrowEndX, y: e.arrowEndY }; } }; var Xb = {}; function w7(t, e, r) { for (var i = function(c, l, u, d) { return ei(c, l, u, d); }, n = e._private, a = n.rstyle.bezierPts, o = 0; o < t.bezierProjPcts.length; o++) { var s = t.bezierProjPcts[o]; a.push({ x: i(r[0], r[2], r[4], s), y: i(r[1], r[3], r[5], s) }); } } Xb.storeEdgeProjections = function(t) { var e = t._private, r = e.rscratch, i = r.edgeType; if (e.rstyle.bezierPts = null, e.rstyle.linePts = null, e.rstyle.haystackPts = null, i === "multibezier" || i === "bezier" || i === "self" || i === "compound") { e.rstyle.bezierPts = []; for (var n = 0; n + 5 < r.allpts.length; n += 4) w7(this, t, r.allpts.slice(n, n + 6)); } else if (i === "segments") for (var a = e.rstyle.linePts = [], n = 0; n + 1 < r.allpts.length; n += 2) a.push({ x: r.allpts[n], y: r.allpts[n + 1] }); else if (i === "haystack") { var o = r.haystackPts; e.rstyle.haystackPts = [{ x: o[0], y: o[1] }, { x: o[2], y: o[3] }]; } e.rstyle.arrowWidth = this.getArrowWidth(t.pstyle("width").pfValue, t.pstyle("arrow-scale").value) * this.arrowShapeWidth; }; Xb.recalculateEdgeProjections = function(t) { this.findEdgeControlPoints(t); }; var Ea = {}; Ea.recalculateNodeLabelProjection = function(t) { var e = t.pstyle("label").strValue; if (!ds(e)) { var r, i, n = t._private, a = t.width(), o = t.height(), s = t.padding(), c = t.position(), l = t.pstyle("text-halign").strValue, u = t.pstyle("text-valign").strValue, d = n.rscratch, h = n.rstyle; switch (l) { case "left": r = c.x - a / 2 - s; break; case "right": r = c.x + a / 2 + s; break; default: r = c.x; } switch (u) { case "top": i = c.y - o / 2 - s; break; case "bottom": i = c.y + o / 2 + s; break; default: i = c.y; } d.labelX = r, d.labelY = i, h.labelX = r, h.labelY = i, this.calculateLabelAngles(t), this.applyLabelDimensions(t); } }; var P3 = function(t, e) { var r = Math.atan(e / t); return t === 0 && r < 0 && (r = r * -1), r; }, R3 = function(t, e) { var r = e.x - t.x, i = e.y - t.y; return P3(r, i); }, _7 = function(t, e, r, i) { var n = yh(0, i - 1e-3, 1), a = yh(0, i + 1e-3, 1), o = $c(t, e, r, n), s = $c(t, e, r, a); return R3(o, s); }; Ea.recalculateEdgeLabelProjections = function(t) { var e, r = t._private, i = r.rscratch, n = this, a = { mid: t.pstyle("label").strValue, source: t.pstyle("source-label").strValue, target: t.pstyle("target-label").strValue }; if (a.mid || a.source || a.target) { e = { x: i.midX, y: i.midY }; var o = function(u, d, h) { Xo(r.rscratch, u, d, h), Xo(r.rstyle, u, d, h); }; o("labelX", null, e.x), o("labelY", null, e.y); var s = P3(i.midDispX, i.midDispY); o("labelAutoAngle", null, s); var c = function u() { if (u.cache) return u.cache; for (var d = [], h = 0; h + 5 < i.allpts.length; h += 4) { var f = { x: i.allpts[h], y: i.allpts[h + 1] }, p = { x: i.allpts[h + 2], y: i.allpts[h + 3] }, m = { x: i.allpts[h + 4], y: i.allpts[h + 5] }; d.push({ p0: f, p1: p, p2: m, startDist: 0, length: 0, segments: [] }); } var y = r.rstyle.bezierPts, g = n.bezierProjPcts.length; function v(b, T, E, C, L) { var A = _l(T, E), k = b.segments[b.segments.length - 1], P = { p0: T, p1: E, t0: C, t1: L, startDist: k ? k.startDist + k.length : 0, length: A }; b.segments.push(P), b.length += A; } for (var x = 0; x < d.length; x++) { var w = d[x], S = d[x - 1]; S && (w.startDist = S.startDist + S.length), v(w, w.p0, y[x * g], 0, n.bezierProjPcts[0]); for (var _ = 0; _ < g - 1; _++) v(w, y[x * g + _], y[x * g + _ + 1], n.bezierProjPcts[_], n.bezierProjPcts[_ + 1]); v(w, y[x * g + g - 1], w.p2, n.bezierProjPcts[g - 1], 1); } return u.cache = d; }, l = function(u) { var d, h = u === "source"; if (a[u]) { var f = t.pstyle(u + "-text-offset").pfValue; switch (i.edgeType) { case "self": case "compound": case "bezier": case "multibezier": { for (var p = c(), m, y = 0, g = 0, v = 0; v < p.length; v++) { for (var x = p[h ? v : p.length - 1 - v], w = 0; w < x.segments.length; w++) { var S = x.segments[h ? w : x.segments.length - 1 - w], _ = v === p.length - 1 && w === x.segments.length - 1; if (y = g, g += S.length, g >= f || _) { m = { cp: x, segment: S }; break; } } if (m) break; } var b = m.cp, T = m.segment, E = (f - y) / T.length, C = T.t1 - T.t0, L = h ? T.t0 + C * E : T.t1 - C * E; L = yh(0, L, 1), e = $c(b.p0, b.p1, b.p2, L), d = _7(b.p0, b.p1, b.p2, L); break; } case "straight": case "segments": case "haystack": { for (var A = 0, k, P, R, M, O = i.allpts.length, D = 0; D + 3 < O && (h ? (R = { x: i.allpts[D], y: i.allpts[D + 1] }, M = { x: i.allpts[D + 2], y: i.allpts[D + 3] }) : (R = { x: i.allpts[O - 2 - D], y: i.allpts[O - 1 - D] }, M = { x: i.allpts[O - 4 - D], y: i.allpts[O - 3 - D] }), k = _l(R, M), P = A, A += k, !(A >= f)); D += 2) ; var I = f - P, F = I / k; F = yh(0, F, 1), e = Cj(R, M, F), d = R3(R, M); break; } } o("labelX", u, e.x), o("labelY", u, e.y), o("labelAutoAngle", u, d); } }; l("source"), l("target"), this.applyLabelDimensions(t); } }; Ea.applyLabelDimensions = function(t) { this.applyPrefixedLabelDimensions(t), t.isEdge() && (this.applyPrefixedLabelDimensions(t, "source"), this.applyPrefixedLabelDimensions(t, "target")); }; Ea.applyPrefixedLabelDimensions = function(t, e) { var r = t._private, i = this.getLabelText(t, e), n = this.calculateLabelDimensions(t, i), a = t.pstyle("line-height").pfValue, o = t.pstyle("text-wrap").strValue, s = $n(r.rscratch, "labelWrapCachedLines", e) || [], c = o !== "wrap" ? 1 : Math.max(s.length, 1), l = n.height / c, u = l * a, d = n.width, h = n.height + (c - 1) * (a - 1) * l; Xo(r.rstyle, "labelWidth", e, d), Xo(r.rscratch, "labelWidth", e, d), Xo(r.rstyle, "labelHeight", e, h), Xo(r.rscratch, "labelHeight", e, h), Xo(r.rscratch, "labelLineHeight", e, u); }; Ea.getLabelText = function(t, e) { var r = t._private, i = e ? e + "-" : "", n = t.pstyle(i + "label").strValue, a = t.pstyle("text-transform").value, o = function(U, Z) { return Z ? (Xo(r.rscratch, U, e, Z), Z) : $n(r.rscratch, U, e); }; if (!n) return ""; a == "none" || (a == "uppercase" ? n = n.toUpperCase() : a == "lowercase" && (n = n.toLowerCase())); var s = t.pstyle("text-wrap").value; if (s === "wrap") { var c = o("labelKey"); if (c != null && o("labelWrapKey") === c) return o("labelWrapCachedText"); for (var l = "​", u = n.split(` `), d = t.pstyle("text-max-width").pfValue, h = t.pstyle("text-overflow-wrap").value, f = h === "anywhere", p = [], m = /[\s\u200b]+|$/g, y = 0; y < u.length; y++) { var g = u[y], v = this.calculateLabelDimensions(t, g), x = v.width; if (f) { var w = g.split("").join(l); g = w; } if (x > d) { var S = g.matchAll(m), _ = "", b = 0, T = mA(S), E; try { for (T.s(); !(E = T.n()).done; ) { var C = E.value, L = C[0], A = g.substring(b, C.index); b = C.index + L.length; var k = _.length === 0 ? A : _ + A + L, P = this.calculateLabelDimensions(t, k), R = P.width; R <= d ? _ += A + L : (_ && p.push(_), _ = A + L); } } catch (U) { T.e(U); } finally { T.f(); } _.match(/^[\s\u200b]+$/) || p.push(_); } else p.push(g); } o("labelWrapCachedLines", p), n = o("labelWrapCachedText", p.join(` `)), o("labelWrapKey", c); } else if (s === "ellipsis") { var M = t.pstyle("text-max-width").pfValue, O = "", D = "…", I = !1; if (this.calculateLabelDimensions(t, n).width < M) return n; for (var F = 0; F < n.length; F++) { var z = this.calculateLabelDimensions(t, O + n[F] + D).width; if (z > M) break; O += n[F], F === n.length - 1 && (I = !0); } return I || (O += D), O; } return n; }; Ea.getLabelJustification = function(t) { var e = t.pstyle("text-justification").strValue, r = t.pstyle("text-halign").strValue; if (e === "auto") if (t.isNode()) switch (r) { case "left": return "right"; case "right": return "left"; default: return "center"; } else return "center"; else return e; }; Ea.calculateLabelDimensions = function(t, e) { var r = this, i = r.cy.window(), n = i.document, a = wl(e, t._private.labelDimsKey), o = r.labelDimCache || (r.labelDimCache = []), s = o[a]; if (s != null) return s; var c = 0, l = t.pstyle("font-style").strValue, u = t.pstyle("font-size").pfValue, d = t.pstyle("font-family").strValue, h = t.pstyle("font-weight").strValue, f = this.labelCalcCanvas, p = this.labelCalcCanvasContext; if (!f) { f = this.labelCalcCanvas = n.createElement("canvas"), p = this.labelCalcCanvasContext = f.getContext("2d"); var m = f.style; m.position = "absolute", m.left = "-9999px", m.top = "-9999px", m.zIndex = "-1", m.visibility = "hidden", m.pointerEvents = "none"; } p.font = "".concat(l, " ").concat(h, " ").concat(u, "px ").concat(d); for (var y = 0, g = 0, v = e.split(` `), x = 0; x < v.length; x++) { var w = v[x], S = p.measureText(w), _ = Math.ceil(S.width), b = u; y = Math.max(_, y), g += b; } return y += c, g += c, o[a] = { width: y, height: g }; }; Ea.calculateLabelAngle = function(t, e) { var r = t._private, i = r.rscratch, n = t.isEdge(), a = e ? e + "-" : "", o = t.pstyle(a + "text-rotation"), s = o.strValue; return s === "none" ? 0 : n && s === "autorotate" ? i.labelAutoAngle : s === "autorotate" ? 0 : o.pfValue; }; Ea.calculateLabelAngles = function(t) { var e = this, r = t.isEdge(), i = t._private, n = i.rscratch; n.labelAngle = e.calculateLabelAngle(t), r && (n.sourceLabelAngle = e.calculateLabelAngle(t, "source"), n.targetLabelAngle = e.calculateLabelAngle(t, "target")); }; var O3 = {}, J_ = 28, Q_ = !1; O3.getNodeShape = function(t) { var e = this, r = t.pstyle("shape").value; if (r === "cutrectangle" && (t.width() < J_ || t.height() < J_)) return Q_ || (Zt("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"), Q_ = !0), "rectangle"; if (t.isParent()) return r === "rectangle" || r === "roundrectangle" || r === "round-rectangle" || r === "cutrectangle" || r === "cut-rectangle" || r === "barrel" ? r : "rectangle"; if (r === "polygon") { var i = t.pstyle("shape-polygon-points").value; return e.nodeShapes.makePolygon(i).name; } return r; }; var zg = {}; zg.registerCalculationListeners = function() { var t = this.cy, e = t.collection(), r = this, i = function(a) { var o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0; if (e.merge(a), o) for (var s = 0; s < a.length; s++) { var c = a[s], l = c._private, u = l.rstyle; u.clean = !1, u.cleanConnected = !1; } }; r.binder(t).on("bounds.* dirty.*", function(a) { var o = a.target; i(o); }).on("style.* background.*", function(a) { var o = a.target; i(o, !1); }); var n = function(a) { if (a) { var o = r.onUpdateEleCalcsFns; e.cleanStyle(); for (var s = 0; s < e.length; s++) { var c = e[s], l = c._private.rstyle; c.isNode() && !l.cleanConnected && (i(c.connectedEdges()), l.cleanConnected = !0); } if (o) for (var u = 0; u < o.length; u++) { var d = o[u]; d(a, e); } r.recalculateRenderedStyle(e), e = t.collection(); } }; r.flushRenderedStyleQueue = function() { n(!0); }, r.beforeRender(n, r.beforeRenderPriorities.eleCalcs); }; zg.onUpdateEleCalcs = function(t) { var e = this.onUpdateEleCalcsFns = this.onUpdateEleCalcsFns || []; e.push(t); }; zg.recalculateRenderedStyle = function(t, e) { var r = function(x) { return x._private.rstyle.cleanConnected; }, i = [], n = []; if (!this.destroyed) { e === void 0 && (e = !0); for (var a = 0; a < t.length; a++) { var o = t[a], s = o._private, c = s.rstyle; o.isEdge() && (!r(o.source()) || !r(o.target())) && (c.clean = !1), !(e && c.clean || o.removed()) && o.pstyle("display").value !== "none" && (s.group === "nodes" ? n.push(o) : i.push(o), c.clean = !0); } for (var l = 0; l < n.length; l++) { var u = n[l], d = u._private, h = d.rstyle, f = u.position(); this.recalculateNodeLabelProjection(u), h.nodeX = f.x, h.nodeY = f.y, h.nodeW = u.pstyle("width").pfValue, h.nodeH = u.pstyle("height").pfValue; } this.recalculateEdgeProjections(i); for (var p = 0; p < i.length; p++) { var m = i[p], y = m._private, g = y.rstyle, v = y.rscratch; g.srcX = v.arrowStartX, g.srcY = v.arrowStartY, g.tgtX = v.arrowEndX, g.tgtY = v.arrowEndY, g.midX = v.midX, g.midY = v.midY, g.labelAngle = v.labelAngle, g.sourceLabelAngle = v.sourceLabelAngle, g.targetLabelAngle = v.targetLabelAngle; } } }; var $g = {}; $g.updateCachedGrabbedEles = function() { var t = this.cachedZSortedEles; if (t) { t.drag = [], t.nondrag = []; for (var e = [], r = 0; r < t.length; r++) { var i = t[r], n = i._private.rscratch; i.grabbed() && !i.isParent() ? e.push(i) : n.inDragLayer ? t.drag.push(i) : t.nondrag.push(i); } for (var r = 0; r < e.length; r++) { var i = e[r]; t.drag.push(i); } } }; $g.invalidateCachedZSortedEles = function() { this.cachedZSortedEles = null; }; $g.getCachedZSortedEles = function(t) { if (t || !this.cachedZSortedEles) { var e = this.cy.mutableElements().toArray(); e.sort(g3), e.interactive = e.filter(function(r) { return r.interactive(); }), this.cachedZSortedEles = e, this.updateCachedGrabbedEles(); } else e = this.cachedZSortedEles; return e; }; var D3 = {}; [Vl, Um, Pi, sp, Xb, Ea, O3, zg, $g].forEach(function(t) { bt(D3, t); }); var I3 = {}; I3.getCachedImage = function(t, e, r) { var i = this, n = i.imageCache = i.imageCache || {}, a = n[t]; if (a) return a.image.complete || a.image.addEventListener("load", r), a.image; a = n[t] = n[t] || {}; var o = a.image = new Image(); o.addEventListener("load", r), o.addEventListener("error", function() { o.error = !0; }); var s = "data:", c = t.substring(0, s.length).toLowerCase() === s; return c || (e = e === "null" ? null : e, o.crossOrigin = e), o.src = t, o; }; var ju = {}; ju.registerBinding = function(t, e, r, i) { var n = Array.prototype.slice.apply(arguments, [1]), a = this.binder(t); return a.on.apply(a, n); }; ju.binder = function(t) { var e = this, r = e.cy.window(), i = t === r || t === r.document || t === r.document.body || G8(t); if (e.supportsPassiveEvents == null) { var n = !1; try { var a = Object.defineProperty({}, "passive", { get: function() { return n = !0, !0; } }); r.addEventListener("test", null, a); } catch { } e.supportsPassiveEvents = n; } var o = function(s, c, l) { var u = Array.prototype.slice.call(arguments); return i && e.supportsPassiveEvents && (u[2] = { capture: l ?? !1, passive: !1, once: !1 }), e.bindings.push({ target: t, args: u }), (t.addEventListener || t.on).apply(t, u), this; }; return { on: o, addEventListener: o, addListener: o, bind: o }; }; ju.nodeIsDraggable = function(t) { return t && t.isNode() && !t.locked() && t.grabbable(); }; ju.nodeIsGrabbable = function(t) { return this.nodeIsDraggable(t) && t.interactive(); }; ju.load = function() { var t = this, e = t.cy.window(), r = function(B) { return B.selected(); }, i = function(B, ce, ve, te) { B == null && (B = t.cy); for (var pe = 0; pe < ce.length; pe++) { var fe = ce[pe]; B.emit({ originalEvent: ve, type: fe, position: te }); } }, n = function(B) { return B.shiftKey || B.metaKey || B.ctrlKey; }, a = function(B, ce) { var ve = !0; if (t.cy.hasCompoundNodes() && B && B.pannable()) for (var te = 0; ce && te < ce.length; te++) { var B = ce[te]; if (B.isNode() && B.isParent() && !B.pannable()) { ve = !1; break; } } else ve = !0; return ve; }, o = function(B) { B[0]._private.grabbed = !0; }, s = function(B) { B[0]._private.grabbed = !1; }, c = function(B) { B[0]._private.rscratch.inDragLayer = !0; }, l = function(B) { B[0]._private.rscratch.inDragLayer = !1; }, u = function(B) { B[0]._private.rscratch.isGrabTarget = !0; }, d = function(B) { B[0]._private.rscratch.isGrabTarget = !1; }, h = function(B, ce) { var ve = ce.addToList, te = ve.has(B); !te && B.grabbable() && !B.locked() && (ve.merge(B), o(B)); }, f = function(B, ce) { if (B.cy().hasCompoundNodes() && !(ce.inDragLayer == null && ce.addToList == null)) { var ve = B.descendants(); ce.inDragLayer && (ve.forEach(c), ve.connectedEdges().forEach(c)), ce.addToList && h(ve, ce); } }, p = function(B, ce) { ce = ce || {}; var ve = B.cy().hasCompoundNodes(); ce.inDragLayer && (B.forEach(c), B.neighborhood().stdFilter(function(te) { return !ve || te.isEdge(); }).forEach(c)), ce.addToList && B.forEach(function(te) { h(te, ce); }), f(B, ce), g(B, { inDragLayer: ce.inDragLayer }), t.updateCachedGrabbedEles(); }, m = p, y = function(B) { B && (t.getCachedZSortedEles().forEach(function(ce) { s(ce), l(ce), d(ce); }), t.updateCachedGrabbedEles()); }, g = function(B, ce) { if (!(ce.inDragLayer == null && ce.addToList == null) && B.cy().hasCompoundNodes()) { var ve = B.ancestors().orphans(); if (!ve.same(B)) { var te = ve.descendants().spawnSelf().merge(ve).unmerge(B).unmerge(B.descendants()), pe = te.connectedEdges(); ce.inDragLayer && (pe.forEach(c), te.forEach(c)), ce.addToList && te.forEach(function(fe) { h(fe, ce); }); } } }, v = function() { document.activeElement != null && document.activeElement.blur != null && document.activeElement.blur(); }, x = typeof MutationObserver < "u", w = typeof ResizeObserver < "u"; x ? (t.removeObserver = new MutationObserver(function(B) { for (var ce = 0; ce < B.length; ce++) { var ve = B[ce], te = ve.removedNodes; if (te) for (var pe = 0; pe < te.length; pe++) { var fe = te[pe]; if (fe === t.container) { t.destroy(); break; } } } }), t.container.parentNode && t.removeObserver.observe(t.container.parentNode, { childList: !0 })) : t.registerBinding(t.container, "DOMNodeRemoved", function(B) { t.destroy(); }); var S = Eg(function() { t.cy.resize(); }, 100); x && (t.styleObserver = new MutationObserver(S), t.styleObserver.observe(t.container, { attributes: !0 })), t.registerBinding(e, "resize", S), w && (t.resizeObserver = new ResizeObserver(S), t.resizeObserver.observe(t.container)); var _ = function(B, ce) { for (; B != null; ) ce(B), B = B.parentNode; }, b = function() { t.invalidateContainerClientCoordsCache(); }; _(t.container, function(B) { t.registerBinding(B, "transitionend", b), t.registerBinding(B, "animationend", b), t.registerBinding(B, "scroll", b); }), t.registerBinding(t.container, "contextmenu", function(B) { B.preventDefault(); }); var T = function() { return t.selection[4] !== 0; }, E = function(B) { for (var ce = t.findContainerClientCoords(), ve = ce[0], te = ce[1], pe = ce[2], fe = ce[3], he = B.touches ? B.touches : [B], Te = !1, He = 0; He < he.length; He++) { var We = he[He]; if (ve <= We.clientX && We.clientX <= ve + pe && te <= We.clientY && We.clientY <= te + fe) { Te = !0; break; } } if (!Te) return !1; for (var Ie = t.container, qe = B.target, De = qe.parentNode, $e = !1; De; ) { if (De === Ie) { $e = !0; break; } De = De.parentNode; } return !!$e; }; t.registerBinding(t.container, "mousedown", function(B) { if (E(B) && !(t.hoverData.which === 1 && B.which !== 1)) { B.preventDefault(), v(), t.hoverData.capture = !0, t.hoverData.which = B.which; var ce = t.cy, ve = [B.clientX, B.clientY], te = t.projectIntoViewport(ve[0], ve[1]), pe = t.selection, fe = t.findNearestElements(te[0], te[1], !0, !1), he = fe[0], Te = t.dragData.possibleDragElements; t.hoverData.mdownPos = te, t.hoverData.mdownGPos = ve; var He = function() { t.hoverData.tapholdCancelled = !1, clearTimeout(t.hoverData.tapholdTimeout), t.hoverData.tapholdTimeout = setTimeout(function() { if (!t.hoverData.tapholdCancelled) { var $e = t.hoverData.down; $e ? $e.emit({ originalEvent: B, type: "taphold", position: { x: te[0], y: te[1] } }) : ce.emit({ originalEvent: B, type: "taphold", position: { x: te[0], y: te[1] } }); } }, t.tapholdDuration); }; if (B.which == 3) { t.hoverData.cxtStarted = !0; var We = { originalEvent: B, type: "cxttapstart", position: { x: te[0], y: te[1] } }; he ? (he.activate(), he.emit(We), t.hoverData.down = he) : ce.emit(We), t.hoverData.downTime = (/* @__PURE__ */ new Date()).getTime(), t.hoverData.cxtDragged = !1; } else if (B.which == 1) { he && he.activate(); { if (he != null && t.nodeIsGrabbable(he)) { var Ie = function($e) { return { originalEvent: B, type: $e, position: { x: te[0], y: te[1] } }; }, qe = function($e) { $e.emit(Ie("grab")); }; if (u(he), !he.selected()) Te = t.dragData.possibleDragElements = ce.collection(), m(he, { addToList: Te }), he.emit(Ie("grabon")).emit(Ie("grab")); else { Te = t.dragData.possibleDragElements = ce.collection(); var De = ce.$(function($e) { return $e.isNode() && $e.selected() && t.nodeIsGrabbable($e); }); p(De, { addToList: Te }), he.emit(Ie("grabon")), De.forEach(qe); } t.redrawHint("eles", !0), t.redrawHint("drag", !0); } t.hoverData.down = he, t.hoverData.downs = fe, t.hoverData.downTime = (/* @__PURE__ */ new Date()).getTime(); } i(he, ["mousedown", "tapstart", "vmousedown"], B, { x: te[0], y: te[1] }), he == null ? (pe[4] = 1, t.data.bgActivePosistion = { x: te[0], y: te[1] }, t.redrawHint("select", !0), t.redraw()) : he.pannable() && (pe[4] = 1), He(); } pe[0] = pe[2] = te[0], pe[1] = pe[3] = te[1]; } }, !1), t.registerBinding(e, "mousemove", function(B) { var ce = t.hoverData.capture; if (!(!ce && !E(B))) { var ve = !1, te = t.cy, pe = te.zoom(), fe = [B.clientX, B.clientY], he = t.projectIntoViewport(fe[0], fe[1]), Te = t.hoverData.mdownPos, He = t.hoverData.mdownGPos, We = t.selection, Ie = null; !t.hoverData.draggingEles && !t.hoverData.dragging && !t.hoverData.selecting && (Ie = t.findNearestElement(he[0], he[1], !0, !1)); var qe = t.hoverData.last, De = t.hoverData.down, $e = [he[0] - We[2], he[1] - We[3]], nt = t.dragData.possibleDragElements, lt; if (He) { var mt = fe[0] - He[0], _t = mt * mt, wt = fe[1] - He[1], me = wt * wt, Ne = _t + me; t.hoverData.isOverThresholdDrag = lt = Ne >= t.desktopTapThreshold2; } var Ue = n(B); lt && (t.hoverData.tapholdCancelled = !0); var Ke = function() { var Oe = t.hoverData.dragDelta = t.hoverData.dragDelta || []; Oe.length === 0 ? (Oe.push($e[0]), Oe.push($e[1])) : (Oe[0] += $e[0], Oe[1] += $e[1]); }; ve = !0, i(Ie, ["mousemove", "vmousemove", "tapdrag"], B, { x: he[0], y: he[1] }); var ct = function() { t.data.bgActivePosistion = void 0, t.hoverData.selecting || te.emit({ originalEvent: B, type: "boxstart", position: { x: he[0], y: he[1] } }), We[4] = 1, t.hoverData.selecting = !0, t.redrawHint("select", !0), t.redraw(); }; if (t.hoverData.which === 3) { if (lt) { var xt = { originalEvent: B, type: "cxtdrag", position: { x: he[0], y: he[1] } }; De ? De.emit(xt) : te.emit(xt), t.hoverData.cxtDragged = !0, (!t.hoverData.cxtOver || Ie !== t.hoverData.cxtOver) && (t.hoverData.cxtOver && t.hoverData.cxtOver.emit({ originalEvent: B, type: "cxtdragout", position: { x: he[0], y: he[1] } }), t.hoverData.cxtOver = Ie, Ie && Ie.emit({ originalEvent: B, type: "cxtdragover", position: { x: he[0], y: he[1] } })); } } else if (t.hoverData.dragging) { if (ve = !0, te.panningEnabled() && te.userPanningEnabled()) { var At; if (t.hoverData.justStartedPan) { var Ft = t.hoverData.mdownPos; At = { x: (he[0] - Ft[0]) * pe, y: (he[1] - Ft[1]) * pe }, t.hoverData.justStartedPan = !1; } else At = { x: $e[0] * pe, y: $e[1] * pe }; te.panBy(At), te.emit("dragpan"), t.hoverData.dragged = !0; } he = t.projectIntoViewport(B.clientX, B.clientY); } else if (We[4] == 1 && (De == null || De.pannable())) { if (lt) { if (!t.hoverData.dragging && te.boxSelectionEnabled() && (Ue || !te.panningEnabled() || !te.userPanningEnabled())) ct(); else if (!t.hoverData.selecting && te.panningEnabled() && te.userPanningEnabled()) { var zt = a(De, t.hoverData.downs); zt && (t.hoverData.dragging = !0, t.hoverData.justStartedPan = !0, We[4] = 0, t.data.bgActivePosistion = Oc(Te), t.redrawHint("select", !0), t.redraw()); } De && De.pannable() && De.active() && De.unactivate(); } } else { if (De && De.pannable() && De.active() && De.unactivate(), (!De || !De.grabbed()) && Ie != qe && (qe && i(qe, ["mouseout", "tapdragout"], B, { x: he[0], y: he[1] }), Ie && i(Ie, ["mouseover", "tapdragover"], B, { x: he[0], y: he[1] }), t.hoverData.last = Ie), De) if (lt) { if (te.boxSelectionEnabled() && Ue) De && De.grabbed() && (y(nt), De.emit("freeon"), nt.emit("free"), t.dragData.didDrag && (De.emit("dragfreeon"), nt.emit("dragfree"))), ct(); else if (De && De.grabbed() && t.nodeIsDraggable(De)) { var se = !t.dragData.didDrag; se && t.redrawHint("eles", !0), t.dragData.didDrag = !0, t.hoverData.draggingEles || p(nt, { inDragLayer: !0 }); var ke = { x: 0, y: 0 }; if (Xe($e[0]) && Xe($e[1]) && (ke.x += $e[0], ke.y += $e[1], se)) { var Ae = t.hoverData.dragDelta; Ae && Xe(Ae[0]) && Xe(Ae[1]) && (ke.x += Ae[0], ke.y += Ae[1]); } t.hoverData.draggingEles = !0, nt.silentShift(ke).emit("position drag"), t.redrawHint("drag", !0), t.redraw(); } } else Ke(); ve = !0; } if (We[2] = he[0], We[3] = he[1], ve) return B.stopPropagation && B.stopPropagation(), B.preventDefault && B.preventDefault(), !1; } }, !1); var C, L, A; t.registerBinding(e, "mouseup", function(B) { if (!(t.hoverData.which === 1 && B.which !== 1 && t.hoverData.capture)) { var ce = t.hoverData.capture; if (ce) { t.hoverData.capture = !1; var ve = t.cy, te = t.projectIntoViewport(B.clientX, B.clientY), pe = t.selection, fe = t.findNearestElement(te[0], te[1], !0, !1), he = t.dragData.possibleDragElements, Te = t.hoverData.down, He = n(B); if (t.data.bgActivePosistion && (t.redrawHint("select", !0), t.redraw()), t.hoverData.tapholdCancelled = !0, t.data.bgActivePosistion = void 0, Te && Te.unactivate(), t.hoverData.which === 3) { var We = { originalEvent: B, type: "cxttapend", position: { x: te[0], y: te[1] } }; if (Te ? Te.emit(We) : ve.emit(We), !t.hoverData.cxtDragged) { var Ie = { originalEvent: B, type: "cxttap", position: { x: te[0], y: te[1] } }; Te ? Te.emit(Ie) : ve.emit(Ie); } t.hoverData.cxtDragged = !1, t.hoverData.which = null; } else if (t.hoverData.which === 1) { if (i(fe, ["mouseup", "tapend", "vmouseup"], B, { x: te[0], y: te[1] }), !t.dragData.didDrag && // didn't move a node around !t.hoverData.dragged && // didn't pan !t.hoverData.selecting && // not box selection !t.hoverData.isOverThresholdDrag && (i(Te, ["click", "tap", "vclick"], B, { x: te[0], y: te[1] }), L = !1, B.timeStamp - A <= ve.multiClickDebounceTime() ? (C && clearTimeout(C), L = !0, A = null, i(Te, ["dblclick", "dbltap", "vdblclick"], B, { x: te[0], y: te[1] })) : (C = setTimeout(function() { L || i(Te, ["oneclick", "onetap", "voneclick"], B, { x: te[0], y: te[1] }); }, ve.multiClickDebounceTime()), A = B.timeStamp)), Te == null && !t.dragData.didDrag && !t.hoverData.selecting && !t.hoverData.dragged && !n(B) && (ve.$(r).unselect(["tapunselect"]), he.length > 0 && t.redrawHint("eles", !0), t.dragData.possibleDragElements = he = ve.collection()), fe == Te && !t.dragData.didDrag && !t.hoverData.selecting && fe != null && fe._private.selectable && (t.hoverData.dragging || (ve.selectionType() === "additive" || He ? fe.selected() ? fe.unselect(["tapunselect"]) : fe.select(["tapselect"]) : He || (ve.$(r).unmerge(fe).unselect(["tapunselect"]), fe.select(["tapselect"]))), t.redrawHint("eles", !0)), t.hoverData.selecting) { var qe = ve.collection(t.getAllInBox(pe[0], pe[1], pe[2], pe[3])); t.redrawHint("select", !0), qe.length > 0 && t.redrawHint("eles", !0), ve.emit({ type: "boxend", originalEvent: B, position: { x: te[0], y: te[1] } }); var De = function(nt) { return nt.selectable() && !nt.selected(); }; ve.selectionType() === "additive" || He || ve.$(r).unmerge(qe).unselect(), qe.emit("box").stdFilter(De).select().emit("boxselect"), t.redraw(); } if (t.hoverData.dragging && (t.hoverData.dragging = !1, t.redrawHint("select", !0), t.redrawHint("eles", !0), t.redraw()), !pe[4]) { t.redrawHint("drag", !0), t.redrawHint("eles", !0); var $e = Te && Te.grabbed(); y(he), $e && (Te.emit("freeon"), he.emit("free"), t.dragData.didDrag && (Te.emit("dragfreeon"), he.emit("dragfree"))); } } pe[4] = 0, t.hoverData.down = null, t.hoverData.cxtStarted = !1, t.hoverData.draggingEles = !1, t.hoverData.selecting = !1, t.hoverData.isOverThresholdDrag = !1, t.dragData.didDrag = !1, t.hoverData.dragged = !1, t.hoverData.dragDelta = [], t.hoverData.mdownPos = null, t.hoverData.mdownGPos = null, t.hoverData.which = null; } } }, !1); var k = function(B) { if (!t.scrollingPage) { var ce = t.cy, ve = ce.zoom(), te = ce.pan(), pe = t.projectIntoViewport(B.clientX, B.clientY), fe = [pe[0] * ve + te.x, pe[1] * ve + te.y]; if (t.hoverData.draggingEles || t.hoverData.dragging || t.hoverData.cxtStarted || T()) { B.preventDefault(); return; } if (ce.panningEnabled() && ce.userPanningEnabled() && ce.zoomingEnabled() && ce.userZoomingEnabled()) { B.preventDefault(), t.data.wheelZooming = !0, clearTimeout(t.data.wheelTimeout), t.data.wheelTimeout = setTimeout(function() { t.data.wheelZooming = !1, t.redrawHint("eles", !0), t.redraw(); }, 150); var he; B.deltaY != null ? he = B.deltaY / -250 : B.wheelDeltaY != null ? he = B.wheelDeltaY / 1e3 : he = B.wheelDelta / 1e3, he = he * t.wheelSensitivity; var Te = B.deltaMode === 1; Te && (he *= 33); var He = ce.zoom() * Math.pow(10, he); B.type === "gesturechange" && (He = t.gestureStartZoom * B.scale), ce.zoom({ level: He, renderedPosition: { x: fe[0], y: fe[1] } }), ce.emit(B.type === "gesturechange" ? "pinchzoom" : "scrollzoom"); } } }; t.registerBinding(t.container, "wheel", k, !0), t.registerBinding(e, "scroll", function(B) { t.scrollingPage = !0, clearTimeout(t.scrollingPageTimeout), t.scrollingPageTimeout = setTimeout(function() { t.scrollingPage = !1; }, 250); }, !0), t.registerBinding(t.container, "gesturestart", function(B) { t.gestureStartZoom = t.cy.zoom(), t.hasTouchStarted || B.preventDefault(); }, !0), t.registerBinding(t.container, "gesturechange", function(B) { t.hasTouchStarted || k(B); }, !0), t.registerBinding(t.container, "mouseout", function(B) { var ce = t.projectIntoViewport(B.clientX, B.clientY); t.cy.emit({ originalEvent: B, type: "mouseout", position: { x: ce[0], y: ce[1] } }); }, !1), t.registerBinding(t.container, "mouseover", function(B) { var ce = t.projectIntoViewport(B.clientX, B.clientY); t.cy.emit({ originalEvent: B, type: "mouseover", position: { x: ce[0], y: ce[1] } }); }, !1); var P, R, M, O, D, I, F, z, U, Z, re, K, V, H = function(B, ce, ve, te) { return Math.sqrt((ve - B) * (ve - B) + (te - ce) * (te - ce)); }, G = function(B, ce, ve, te) { return (ve - B) * (ve - B) + (te - ce) * (te - ce); }, W; t.registerBinding(t.container, "touchstart", W = function(B) { if (t.hasTouchStarted = !0, !!E(B)) { v(), t.touchData.capture = !0, t.data.bgActivePosistion = void 0; var ce = t.cy, ve = t.touchData.now, te = t.touchData.earlier; if (B.touches[0]) { var pe = t.projectIntoViewport(B.touches[0].clientX, B.touches[0].clientY); ve[0] = pe[0], ve[1] = pe[1]; } if (B.touches[1]) { var pe = t.projectIntoViewport(B.touches[1].clientX, B.touches[1].clientY); ve[2] = pe[0], ve[3] = pe[1]; } if (B.touches[2]) { var pe = t.projectIntoViewport(B.touches[2].clientX, B.touches[2].clientY); ve[4] = pe[0], ve[5] = pe[1]; } if (B.touches[1]) { t.touchData.singleTouchMoved = !0, y(t.dragData.touchDragEles); var fe = t.findContainerClientCoords(); U = fe[0], Z = fe[1], re = fe[2], K = fe[3], P = B.touches[0].clientX - U, R = B.touches[0].clientY - Z, M = B.touches[1].clientX - U, O = B.touches[1].clientY - Z, V = 0 <= P && P <= re && 0 <= M && M <= re && 0 <= R && R <= K && 0 <= O && O <= K; var he = ce.pan(), Te = ce.zoom(); D = H(P, R, M, O), I = G(P, R, M, O), F = [(P + M) / 2, (R + O) / 2], z = [(F[0] - he.x) / Te, (F[1] - he.y) / Te]; var He = 200, We = He * He; if (I < We && !B.touches[2]) { var Ie = t.findNearestElement(ve[0], ve[1], !0, !0), qe = t.findNearestElement(ve[2], ve[3], !0, !0); Ie && Ie.isNode() ? (Ie.activate().emit({ originalEvent: B, type: "cxttapstart", position: { x: ve[0], y: ve[1] } }), t.touchData.start = Ie) : qe && qe.isNode() ? (qe.activate().emit({ originalEvent: B, type: "cxttapstart", position: { x: ve[0], y: ve[1] } }), t.touchData.start = qe) : ce.emit({ originalEvent: B, type: "cxttapstart", position: { x: ve[0], y: ve[1] } }), t.touchData.start && (t.touchData.start._private.grabbed = !1), t.touchData.cxt = !0, t.touchData.cxtDragged = !1, t.data.bgActivePosistion = void 0, t.redraw(); return; } } if (B.touches[2]) ce.boxSelectionEnabled() && B.preventDefault(); else if (!B.touches[1] && B.touches[0]) { var De = t.findNearestElements(ve[0], ve[1], !0, !0), $e = De[0]; if ($e != null && ($e.activate(), t.touchData.start = $e, t.touchData.starts = De, t.nodeIsGrabbable($e))) { var nt = t.dragData.touchDragEles = ce.collection(), lt = null; t.redrawHint("eles", !0), t.redrawHint("drag", !0), $e.selected() ? (lt = ce.$(function(Ne) { return Ne.selected() && t.nodeIsGrabbable(Ne); }), p(lt, { addToList: nt })) : m($e, { addToList: nt }), u($e); var mt = function(Ne) { return { originalEvent: B, type: Ne, position: { x: ve[0], y: ve[1] } }; }; $e.emit(mt("grabon")), lt ? lt.forEach(function(Ne) { Ne.emit(mt("grab")); }) : $e.emit(mt("grab")); } i($e, ["touchstart", "tapstart", "vmousedown"], B, { x: ve[0], y: ve[1] }), $e == null && (t.data.bgActivePosistion = { x: pe[0], y: pe[1] }, t.redrawHint("select", !0), t.redraw()), t.touchData.singleTouchMoved = !1, t.touchData.singleTouchStartTime = +/* @__PURE__ */ new Date(), clearTimeout(t.touchData.tapholdTimeout), t.touchData.tapholdTimeout = setTimeout(function() { t.touchData.singleTouchMoved === !1 && !t.pinching && !t.touchData.selecting && i(t.touchData.start, ["taphold"], B, { x: ve[0], y: ve[1] }); }, t.tapholdDuration); } if (B.touches.length >= 1) { for (var _t = t.touchData.startPosition = [null, null, null, null, null, null], wt = 0; wt < ve.length; wt++) _t[wt] = te[wt] = ve[wt]; var me = B.touches[0]; t.touchData.startGPosition = [me.clientX, me.clientY]; } } }, !1); var Y; t.registerBinding(e, "touchmove", Y = function(B) { var ce = t.touchData.capture; if (!(!ce && !E(B))) { var ve = t.selection, te = t.cy, pe = t.touchData.now, fe = t.touchData.earlier, he = te.zoom(); if (B.touches[0]) { var Te = t.projectIntoViewport(B.touches[0].clientX, B.touches[0].clientY); pe[0] = Te[0], pe[1] = Te[1]; } if (B.touches[1]) { var Te = t.projectIntoViewport(B.touches[1].clientX, B.touches[1].clientY); pe[2] = Te[0], pe[3] = Te[1]; } if (B.touches[2]) { var Te = t.projectIntoViewport(B.touches[2].clientX, B.touches[2].clientY); pe[4] = Te[0], pe[5] = Te[1]; } var He = t.touchData.startGPosition, We; if (ce && B.touches[0] && He) { for (var Ie = [], qe = 0; qe < pe.length; qe++) Ie[qe] = pe[qe] - fe[qe]; var De = B.touches[0].clientX - He[0], $e = De * De, nt = B.touches[0].clientY - He[1], lt = nt * nt, mt = $e + lt; We = mt >= t.touchTapThreshold2; } if (ce && t.touchData.cxt) { B.preventDefault(); var _t = B.touches[0].clientX - U, wt = B.touches[0].clientY - Z, me = B.touches[1].clientX - U, Ne = B.touches[1].clientY - Z, Ue = G(_t, wt, me, Ne), Ke = Ue / I, ct = 150, xt = ct * ct, At = 1.5, Ft = At * At; if (Ke >= Ft || Ue >= xt) { t.touchData.cxt = !1, t.data.bgActivePosistion = void 0, t.redrawHint("select", !0); var zt = { originalEvent: B, type: "cxttapend", position: { x: pe[0], y: pe[1] } }; t.touchData.start ? (t.touchData.start.unactivate().emit(zt), t.touchData.start = null) : te.emit(zt); } } if (ce && t.touchData.cxt) { var zt = { originalEvent: B, type: "cxtdrag", position: { x: pe[0], y: pe[1] } }; t.data.bgActivePosistion = void 0, t.redrawHint("select", !0), t.touchData.start ? t.touchData.start.emit(zt) : te.emit(zt), t.touchData.start && (t.touchData.start._private.grabbed = !1), t.touchData.cxtDragged = !0; var se = t.findNearestElement(pe[0], pe[1], !0, !0); (!t.touchData.cxtOver || se !== t.touchData.cxtOver) && (t.touchData.cxtOver && t.touchData.cxtOver.emit({ originalEvent: B, type: "cxtdragout", position: { x: pe[0], y: pe[1] } }), t.touchData.cxtOver = se, se && se.emit({ originalEvent: B, type: "cxtdragover", position: { x: pe[0], y: pe[1] } })); } else if (ce && B.touches[2] && te.boxSelectionEnabled()) B.preventDefault(), t.data.bgActivePosistion = void 0, this.lastThreeTouch = +/* @__PURE__ */ new Date(), t.touchData.selecting || te.emit({ originalEvent: B, type: "boxstart", position: { x: pe[0], y: pe[1] } }), t.touchData.selecting = !0, t.touchData.didSelect = !0, ve[4] = 1, !ve || ve.length === 0 || ve[0] === void 0 ? (ve[0] = (pe[0] + pe[2] + pe[4]) / 3, ve[1] = (pe[1] + pe[3] + pe[5]) / 3, ve[2] = (pe[0] + pe[2] + pe[4]) / 3 + 1, ve[3] = (pe[1] + pe[3] + pe[5]) / 3 + 1) : (ve[2] = (pe[0] + pe[2] + pe[4]) / 3, ve[3] = (pe[1] + pe[3] + pe[5]) / 3), t.redrawHint("select", !0), t.redraw(); else if (ce && B.touches[1] && !t.touchData.didSelect && te.zoomingEnabled() && te.panningEnabled() && te.userZoomingEnabled() && te.userPanningEnabled()) { B.preventDefault(), t.data.bgActivePosistion = void 0, t.redrawHint("select", !0); var ke = t.dragData.touchDragEles; if (ke) { t.redrawHint("drag", !0); for (var Ae = 0; Ae < ke.length; Ae++) { var Oe = ke[Ae]._private; Oe.grabbed = !1, Oe.rscratch.inDragLayer = !1; } } var Ve = t.touchData.start, _t = B.touches[0].clientX - U, wt = B.touches[0].clientY - Z, me = B.touches[1].clientX - U, Ne = B.touches[1].clientY - Z, ae = H(_t, wt, me, Ne), Se = ae / D; if (V) { var Be = _t - P, Ge = wt - R, tt = me - M, gt = Ne - O, ut = (Be + tt) / 2, St = (Ge + gt) / 2, er = te.zoom(), vr = er * Se, fn = te.pan(), tr = z[0] * er + fn.x, ea = z[1] * er + fn.y, Jr = { x: -vr / er * (tr - fn.x - ut) + tr, y: -vr / er * (ea - fn.y - St) + ea }; if (Ve && Ve.active()) { var ke = t.dragData.touchDragEles; y(ke), t.redrawHint("drag", !0), t.redrawHint("eles", !0), Ve.unactivate().emit("freeon"), ke.emit("free"), t.dragData.didDrag && (Ve.emit("dragfreeon"), ke.emit("dragfree")); } te.viewport({ zoom: vr, pan: Jr, cancelOnFailedZoom: !0 }), te.emit("pinchzoom"), D = ae, P = _t, R = wt, M = me, O = Ne, t.pinching = !0; } if (B.touches[0]) { var Te = t.projectIntoViewport(B.touches[0].clientX, B.touches[0].clientY); pe[0] = Te[0], pe[1] = Te[1]; } if (B.touches[1]) { var Te = t.projectIntoViewport(B.touches[1].clientX, B.touches[1].clientY); pe[2] = Te[0], pe[3] = Te[1]; } if (B.touches[2]) { var Te = t.projectIntoViewport(B.touches[2].clientX, B.touches[2].clientY); pe[4] = Te[0], pe[5] = Te[1]; } } else if (B.touches[0] && !t.touchData.didSelect) { var Ji = t.touchData.start, Mo = t.touchData.last, se; if (!t.hoverData.draggingEles && !t.swipePanning && (se = t.findNearestElement(pe[0], pe[1], !0, !0)), ce && Ji != null && B.preventDefault(), ce && Ji != null && t.nodeIsDraggable(Ji)) if (We) { var ke = t.dragData.touchDragEles, Eo = !t.dragData.didDrag; Eo && p(ke, { inDragLayer: !0 }), t.dragData.didDrag = !0; var sd = { x: 0, y: 0 }; if (Xe(Ie[0]) && Xe(Ie[1]) && (sd.x += Ie[0], sd.y += Ie[1], Eo)) { t.redrawHint("eles", !0); var Ln = t.touchData.dragDelta; Ln && Xe(Ln[0]) && Xe(Ln[1]) && (sd.x += Ln[0], sd.y += Ln[1]); } t.hoverData.draggingEles = !0, ke.silentShift(sd).emit("position drag"), t.redrawHint("drag", !0), t.touchData.startPosition[0] == fe[0] && t.touchData.startPosition[1] == fe[1] && t.redrawHint("eles", !0), t.redraw(); } else { var Ln = t.touchData.dragDelta = t.touchData.dragDelta || []; Ln.length === 0 ? (Ln.push(Ie[0]), Ln.push(Ie[1])) : (Ln[0] += Ie[0], Ln[1] += Ie[1]); } if (i(Ji || se, ["touchmove", "tapdrag", "vmousemove"], B, { x: pe[0], y: pe[1] }), (!Ji || !Ji.grabbed()) && se != Mo && (Mo && Mo.emit({ originalEvent: B, type: "tapdragout", position: { x: pe[0], y: pe[1] } }), se && se.emit({ originalEvent: B, type: "tapdragover", position: { x: pe[0], y: pe[1] } })), t.touchData.last = se, ce) for (var Ae = 0; Ae < pe.length; Ae++) pe[Ae] && t.touchData.startPosition[Ae] && We && (t.touchData.singleTouchMoved = !0); if (ce && (Ji == null || Ji.pannable()) && te.panningEnabled() && te.userPanningEnabled()) { var yD = a(Ji, t.touchData.starts); yD && (B.preventDefault(), t.data.bgActivePosistion || (t.data.bgActivePosistion = Oc(t.touchData.startPosition)), t.swipePanning ? (te.panBy({ x: Ie[0] * he, y: Ie[1] * he }), te.emit("dragpan")) : We && (t.swipePanning = !0, te.panBy({ x: De * he, y: nt * he }), te.emit("dragpan"), Ji && (Ji.unactivate(), t.redrawHint("select", !0), t.touchData.start = null))); var Te = t.projectIntoViewport(B.touches[0].clientX, B.touches[0].clientY); pe[0] = Te[0], pe[1] = Te[1]; } } for (var qe = 0; qe < pe.length; qe++) fe[qe] = pe[qe]; ce && B.touches.length > 0 && !t.hoverData.draggingEles && !t.swipePanning && t.data.bgActivePosistion != null && (t.data.bgActivePosistion = void 0, t.redrawHint("select", !0), t.redraw()); } }, !1); var X; t.registerBinding(e, "touchcancel", X = function(B) { var ce = t.touchData.start; t.touchData.capture = !1, ce && ce.unactivate(); }); var ie, ue, $, J; if (t.registerBinding(e, "touchend", ie = function(B) { var ce = t.touchData.start, ve = t.touchData.capture; if (ve) B.touches.length === 0 && (t.touchData.capture = !1), B.preventDefault(); else return; var te = t.selection; t.swipePanning = !1, t.hoverData.draggingEles = !1; var pe = t.cy, fe = pe.zoom(), he = t.touchData.now, Te = t.touchData.earlier; if (B.touches[0]) { var He = t.projectIntoViewport(B.touches[0].clientX, B.touches[0].clientY); he[0] = He[0], he[1] = He[1]; } if (B.touches[1]) { var He = t.projectIntoViewport(B.touches[1].clientX, B.touches[1].clientY); he[2] = He[0], he[3] = He[1]; } if (B.touches[2]) { var He = t.projectIntoViewport(B.touches[2].clientX, B.touches[2].clientY); he[4] = He[0], he[5] = He[1]; } ce && ce.unactivate(); var We; if (t.touchData.cxt) { if (We = { originalEvent: B, type: "cxttapend", position: { x: he[0], y: he[1] } }, ce ? ce.emit(We) : pe.emit(We), !t.touchData.cxtDragged) { var Ie = { originalEvent: B, type: "cxttap", position: { x: he[0], y: he[1] } }; ce ? ce.emit(Ie) : pe.emit(Ie); } t.touchData.start && (t.touchData.start._private.grabbed = !1), t.touchData.cxt = !1, t.touchData.start = null, t.redraw(); return; } if (!B.touches[2] && pe.boxSelectionEnabled() && t.touchData.selecting) { t.touchData.selecting = !1; var qe = pe.collection(t.getAllInBox(te[0], te[1], te[2], te[3])); te[0] = void 0, te[1] = void 0, te[2] = void 0, te[3] = void 0, te[4] = 0, t.redrawHint("select", !0), pe.emit({ type: "boxend", originalEvent: B, position: { x: he[0], y: he[1] } }); var De = function(ct) { return ct.selectable() && !ct.selected(); }; qe.emit("box").stdFilter(De).select().emit("boxselect"), qe.nonempty() && t.redrawHint("eles", !0), t.redraw(); } if (ce != null && ce.unactivate(), B.touches[2]) t.data.bgActivePosistion = void 0, t.redrawHint("select", !0); else if (!B.touches[1] && !B.touches[0] && !B.touches[0]) { t.data.bgActivePosistion = void 0, t.redrawHint("select", !0); var $e = t.dragData.touchDragEles; if (ce != null) { var nt = ce._private.grabbed; y($e), t.redrawHint("drag", !0), t.redrawHint("eles", !0), nt && (ce.emit("freeon"), $e.emit("free"), t.dragData.didDrag && (ce.emit("dragfreeon"), $e.emit("dragfree"))), i(ce, ["touchend", "tapend", "vmouseup", "tapdragout"], B, { x: he[0], y: he[1] }), ce.unactivate(), t.touchData.start = null; } else { var lt = t.findNearestElement(he[0], he[1], !0, !0); i(lt, ["touchend", "tapend", "vmouseup", "tapdragout"], B, { x: he[0], y: he[1] }); } var mt = t.touchData.startPosition[0] - he[0], _t = mt * mt, wt = t.touchData.startPosition[1] - he[1], me = wt * wt, Ne = _t + me, Ue = Ne * fe * fe; t.touchData.singleTouchMoved || (ce || pe.$(":selected").unselect(["tapunselect"]), i(ce, ["tap", "vclick"], B, { x: he[0], y: he[1] }), ue = !1, B.timeStamp - J <= pe.multiClickDebounceTime() ? ($ && clearTimeout($), ue = !0, J = null, i(ce, ["dbltap", "vdblclick"], B, { x: he[0], y: he[1] })) : ($ = setTimeout(function() { ue || i(ce, ["onetap", "voneclick"], B, { x: he[0], y: he[1] }); }, pe.multiClickDebounceTime()), J = B.timeStamp)), ce != null && !t.dragData.didDrag && ce._private.selectable && Ue < t.touchTapThreshold2 && !t.pinching && (pe.selectionType() === "single" ? (pe.$(r).unmerge(ce).unselect(["tapunselect"]), ce.select(["tapselect"])) : ce.selected() ? ce.unselect(["tapunselect"]) : ce.select(["tapselect"]), t.redrawHint("eles", !0)), t.touchData.singleTouchMoved = !0; } for (var Ke = 0; Ke < he.length; Ke++) Te[Ke] = he[Ke]; t.dragData.didDrag = !1, B.touches.length === 0 && (t.touchData.dragDelta = [], t.touchData.startPosition = [null, null, null, null, null, null], t.touchData.startGPosition = null, t.touchData.didSelect = !1), B.touches.length < 2 && (B.touches.length === 1 && (t.touchData.startGPosition = [B.touches[0].clientX, B.touches[0].clientY]), t.pinching = !1, t.redrawHint("eles", !0), t.redraw()); }, !1), typeof TouchEvent > "u") { var ne = [], j = function(B) { return { clientX: B.clientX, clientY: B.clientY, force: 1, identifier: B.pointerId, pageX: B.pageX, pageY: B.pageY, radiusX: B.width / 2, radiusY: B.height / 2, screenX: B.screenX, screenY: B.screenY, target: B.target }; }, q = function(B) { return { event: B, touch: j(B) }; }, ge = function(B) { ne.push(q(B)); }, ye = function(B) { for (var ce = 0; ce < ne.length; ce++) { var ve = ne[ce]; if (ve.event.pointerId === B.pointerId) { ne.splice(ce, 1); return; } } }, _e = function(B) { var ce = ne.filter(function(ve) { return ve.event.pointerId === B.pointerId; })[0]; ce.event = B, ce.touch = j(B); }, Me = function(B) { B.touches = ne.map(function(ce) { return ce.touch; }); }, Ce = function(B) { return B.pointerType === "mouse" || B.pointerType === 4; }; t.registerBinding(t.container, "pointerdown", function(B) { Ce(B) || (B.preventDefault(), ge(B), Me(B), W(B)); }), t.registerBinding(t.container, "pointerup", function(B) { Ce(B) || (ye(B), Me(B), ie(B)); }), t.registerBinding(t.container, "pointercancel", function(B) { Ce(B) || (ye(B), Me(B), X(B)); }), t.registerBinding(t.container, "pointermove", function(B) { Ce(B) || (B.preventDefault(), _e(B), Me(B), Y(B)); }); } }; var fo = {}; fo.generatePolygon = function(t, e) { return this.nodeShapes[t] = { renderer: this, name: t, points: e, draw: function(r, i, n, a, o, s) { this.renderer.nodeShapeImpl("polygon", r, i, n, a, o, this.points); }, intersectLine: function(r, i, n, a, o, s, c, l) { return bh(o, s, this.points, r, i, n / 2, a / 2, c); }, checkPoint: function(r, i, n, a, o, s, c, l) { return io(r, i, this.points, s, c, a, o, [0, -1], n); } }; }; fo.generateEllipse = function() { return this.nodeShapes.ellipse = { renderer: this, name: "ellipse", draw: function(t, e, r, i, n, a) { this.renderer.nodeShapeImpl(this.name, t, e, r, i, n); }, intersectLine: function(t, e, r, i, n, a, o, s) { return $j(n, a, t, e, r / 2 + o, i / 2 + o); }, checkPoint: function(t, e, r, i, n, a, o, s) { return rl(t, e, i, n, a, o, r); } }; }; fo.generateRoundPolygon = function(t, e) { return this.nodeShapes[t] = { renderer: this, name: t, points: e, getOrCreateCorners: function(r, i, n, a, o, s, c) { if (s[c] !== void 0 && s[c + "-cx"] === r && s[c + "-cy"] === i) return s[c]; s[c] = new Array(e.length / 2), s[c + "-cx"] = r, s[c + "-cy"] = i; var l = n / 2, u = a / 2; o = o === "auto" ? FA(n, a) : o; for (var d = new Array(e.length / 2), h = 0; h < e.length / 2; h++) d[h] = { x: r + l * e[h * 2], y: i + u * e[h * 2 + 1] }; var f, p, m, y, g = d.length; for (p = d[g - 1], f = 0; f < g; f++) m = d[f % g], y = d[(f + 1) % g], s[c][f] = qb(p, m, y, o), p = m, m = y; return s[c]; }, draw: function(r, i, n, a, o, s, c) { this.renderer.nodeShapeImpl("round-polygon", r, i, n, a, o, this.points, this.getOrCreateCorners(i, n, a, o, s, c, "drawCorners")); }, intersectLine: function(r, i, n, a, o, s, c, l, u) { return Vj(o, s, this.points, r, i, n, a, c, this.getOrCreateCorners(r, i, n, a, l, u, "corners")); }, checkPoint: function(r, i, n, a, o, s, c, l, u) { return zj(r, i, this.points, s, c, a, o, this.getOrCreateCorners(s, c, a, o, l, u, "corners")); } }; }; fo.generateRoundRectangle = function() { return this.nodeShapes["round-rectangle"] = this.nodeShapes.roundrectangle = { renderer: this, name: "round-rectangle", points: Ri(4, 0), draw: function(t, e, r, i, n, a) { this.renderer.nodeShapeImpl(this.name, t, e, r, i, n, this.points, a); }, intersectLine: function(t, e, r, i, n, a, o, s) { return NA(n, a, t, e, r, i, o, s); }, checkPoint: function(t, e, r, i, n, a, o, s) { var c = i / 2, l = n / 2; s = s === "auto" ? Sl(i, n) : s, s = Math.min(c, l, s); var u = s * 2; return !!(io(t, e, this.points, a, o, i, n - u, [0, -1], r) || io(t, e, this.points, a, o, i - u, n, [0, -1], r) || rl(t, e, u, u, a - c + s, o - l + s, r) || rl(t, e, u, u, a + c - s, o - l + s, r) || rl(t, e, u, u, a + c - s, o + l - s, r) || rl(t, e, u, u, a - c + s, o + l - s, r)); } }; }; fo.generateCutRectangle = function() { return this.nodeShapes["cut-rectangle"] = this.nodeShapes.cutrectangle = { renderer: this, name: "cut-rectangle", cornerLength: Ib(), points: Ri(4, 0), draw: function(t, e, r, i, n, a) { this.renderer.nodeShapeImpl(this.name, t, e, r, i, n, null, a); }, generateCutTrianglePts: function(t, e, r, i, n) { var a = n === "auto" ? this.cornerLength : n, o = e / 2, s = t / 2, c = r - s, l = r + s, u = i - o, d = i + o; return { topLeft: [c, u + a, c + a, u, c + a, u + a], topRight: [l - a, u, l, u + a, l - a, u + a], bottomRight: [l, d - a, l - a, d, l - a, d - a], bottomLeft: [c + a, d, c, d - a, c + a, d - a] }; }, intersectLine: function(t, e, r, i, n, a, o, s) { var c = this.generateCutTrianglePts(r + 2 * o, i + 2 * o, t, e, s), l = [].concat.apply([], [c.topLeft.splice(0, 4), c.topRight.splice(0, 4), c.bottomRight.splice(0, 4), c.bottomLeft.splice(0, 4)]); return bh(n, a, l, t, e); }, checkPoint: function(t, e, r, i, n, a, o, s) { var c = s === "auto" ? this.cornerLength : s; if (io(t, e, this.points, a, o, i, n - 2 * c, [0, -1], r) || io(t, e, this.points, a, o, i - 2 * c, n, [0, -1], r)) return !0; var l = this.generateCutTrianglePts(i, n, a, o); return Vi(t, e, l.topLeft) || Vi(t, e, l.topRight) || Vi(t, e, l.bottomRight) || Vi(t, e, l.bottomLeft); } }; }; fo.generateBarrel = function() { return this.nodeShapes.barrel = { renderer: this, name: "barrel", points: Ri(4, 0), draw: function(t, e, r, i, n, a) { this.renderer.nodeShapeImpl(this.name, t, e, r, i, n); }, intersectLine: function(t, e, r, i, n, a, o, s) { var c = 0.15, l = 0.5, u = 0.85, d = this.generateBarrelBezierPts(r + 2 * o, i + 2 * o, t, e), h = function(p) { var m = $c({ x: p[0], y: p[1] }, { x: p[2], y: p[3] }, { x: p[4], y: p[5] }, c), y = $c({ x: p[0], y: p[1] }, { x: p[2], y: p[3] }, { x: p[4], y: p[5] }, l), g = $c({ x: p[0], y: p[1] }, { x: p[2], y: p[3] }, { x: p[4], y: p[5] }, u); return [p[0], p[1], m.x, m.y, y.x, y.y, g.x, g.y, p[4], p[5]]; }, f = [].concat(h(d.topLeft), h(d.topRight), h(d.bottomRight), h(d.bottomLeft)); return bh(n, a, f, t, e); }, generateBarrelBezierPts: function(t, e, r, i) { var n = e / 2, a = t / 2, o = r - a, s = r + a, c = i - n, l = i + n, u = My(t, e), d = u.heightOffset, h = u.widthOffset, f = u.ctrlPtOffsetPct * t, p = { topLeft: [o, c + d, o + f, c, o + h, c], topRight: [s - h, c, s - f, c, s, c + d], bottomRight: [s, l - d, s - f, l, s - h, l], bottomLeft: [o + h, l, o + f, l, o, l - d] }; return p.topLeft.isTop = !0, p.topRight.isTop = !0, p.bottomLeft.isBottom = !0, p.bottomRight.isBottom = !0, p; }, checkPoint: function(t, e, r, i, n, a, o, s) { var c = My(i, n), l = c.heightOffset, u = c.widthOffset; if (io(t, e, this.points, a, o, i, n - 2 * l, [0, -1], r) || io(t, e, this.points, a, o, i - 2 * u, n, [0, -1], r)) return !0; for (var d = this.generateBarrelBezierPts(i, n, a, o), h = function(_, b, T) { var E = T[4], C = T[2], L = T[0], A = T[5], k = T[1], P = Math.min(E, L), R = Math.max(E, L), M = Math.min(A, k), O = Math.max(A, k); if (P <= _ && _ <= R && M <= b && b <= O) { var D = Uj(E, C, L), I = Ij(D[0], D[1], D[2], _), F = I.filter(function(z) { return 0 <= z && z <= 1; }); if (F.length > 0) return F[0]; } return null; }, f = Object.keys(d), p = 0; p < f.length; p++) { var m = f[p], y = d[m], g = h(t, e, y); if (g != null) { var v = y[5], x = y[3], w = y[1], S = ei(v, x, w, g); if (y.isTop && S <= e || y.isBottom && e <= S) return !0; } } return !1; } }; }; fo.generateBottomRoundrectangle = function() { return this.nodeShapes["bottom-round-rectangle"] = this.nodeShapes.bottomroundrectangle = { renderer: this, name: "bottom-round-rectangle", points: Ri(4, 0), draw: function(t, e, r, i, n, a) { this.renderer.nodeShapeImpl(this.name, t, e, r, i, n, this.points, a); }, intersectLine: function(t, e, r, i, n, a, o, s) { var c = t - (r / 2 + o), l = e - (i / 2 + o), u = l, d = t + (r / 2 + o), h = Jo(n, a, t, e, c, l, d, u, !1); return h.length > 0 ? h : NA(n, a, t, e, r, i, o, s); }, checkPoint: function(t, e, r, i, n, a, o, s) { s = s === "auto" ? Sl(i, n) : s; var c = 2 * s; if (io(t, e, this.points, a, o, i, n - c, [0, -1], r) || io(t, e, this.points, a, o, i - c, n, [0, -1], r)) return !0; var l = i / 2 + 2 * r, u = n / 2 + 2 * r, d = [a - l, o - u, a - l, o, a + l, o, a + l, o - u]; return !!(Vi(t, e, d) || rl(t, e, c, c, a + i / 2 - s, o + n / 2 - s, r) || rl(t, e, c, c, a - i / 2 + s, o + n / 2 - s, r)); } }; }; fo.registerNodeShapes = function() { var t = this.nodeShapes = {}, e = this; this.generateEllipse(), this.generatePolygon("triangle", Ri(3, 0)), this.generateRoundPolygon("round-triangle", Ri(3, 0)), this.generatePolygon("rectangle", Ri(4, 0)), t.square = t.rectangle, this.generateRoundRectangle(), this.generateCutRectangle(), this.generateBarrel(), this.generateBottomRoundrectangle(); { var r = [0, 1, 1, 0, 0, -1, -1, 0]; this.generatePolygon("diamond", r), this.generateRoundPolygon("round-diamond", r); } this.generatePolygon("pentagon", Ri(5, 0)), this.generateRoundPolygon("round-pentagon", Ri(5, 0)), this.generatePolygon("hexagon", Ri(6, 0)), this.generateRoundPolygon("round-hexagon", Ri(6, 0)), this.generatePolygon("heptagon", Ri(7, 0)), this.generateRoundPolygon("round-heptagon", Ri(7, 0)), this.generatePolygon("octagon", Ri(8, 0)), this.generateRoundPolygon("round-octagon", Ri(8, 0)); var i = new Array(20); { var n = Sy(5, 0), a = Sy(5, Math.PI / 5), o = 0.5 * (3 - Math.sqrt(5)); o *= 1.57; for (var s = 0; s < a.length / 2; s++) a[s * 2] *= o, a[s * 2 + 1] *= o; for (var s = 0; s < 20 / 4; s++) i[s * 4] = n[s * 2], i[s * 4 + 1] = n[s * 2 + 1], i[s * 4 + 2] = a[s * 2], i[s * 4 + 3] = a[s * 2 + 1]; } i = BA(i), this.generatePolygon("star", i), 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 c = [-1, -1, 0.25, -1, 1, 0, 0.25, 1, -1, 1]; this.generatePolygon("tag", c), this.generateRoundPolygon("round-tag", c); } t.makePolygon = function(l) { var u = l.join("$"), d = "polygon-" + u, h; return (h = this[d]) ? h : e.generatePolygon(d, l); }; }; var lp = {}; lp.timeToRender = function() { return this.redrawTotalTime / this.redrawCount; }; lp.redraw = function(t) { t = t || PA(); var e = this; e.averageRedrawTime === void 0 && (e.averageRedrawTime = 0), e.lastRedrawTime === void 0 && (e.lastRedrawTime = 0), e.lastDrawTime === void 0 && (e.lastDrawTime = 0), e.requestedFrame = !0, e.renderOptions = t; }; lp.beforeRender = function(t, e) { if (!this.destroyed) { e == null && Tr("Priority is not optional for beforeRender"); var r = this.beforeRenderCallbacks; r.push({ fn: t, priority: e }), r.sort(function(i, n) { return n.priority - i.priority; }); } }; var eS = function(t, e, r) { for (var i = t.beforeRenderCallbacks, n = 0; n < i.length; n++) i[n].fn(e, r); }; lp.startRenderLoop = function() { var t = this, e = t.cy; if (!t.renderLoopStarted) { t.renderLoopStarted = !0; var r = function i(n) { if (!t.destroyed) { if (!e.batching()) if (t.requestedFrame && !t.skipFrame) { eS(t, !0, n); var a = ro(); t.render(t.renderOptions); var o = t.lastDrawTime = ro(); t.averageRedrawTime === void 0 && (t.averageRedrawTime = o - a), t.redrawCount === void 0 && (t.redrawCount = 0), t.redrawCount++, t.redrawTotalTime === void 0 && (t.redrawTotalTime = 0); var s = o - a; t.redrawTotalTime += s, t.lastRedrawTime = s, t.averageRedrawTime = t.averageRedrawTime / 2 + s / 2, t.requestedFrame = !1; } else eS(t, !1, n); t.skipFrame = !1, Om(i); } }; Om(r); } }; var S7 = function(t) { this.init(t); }, N3 = S7, Hu = N3.prototype; Hu.clientFunctions = ["redrawHint", "render", "renderTo", "matchCanvasSize", "nodeShapeImpl", "arrowShapeImpl"]; Hu.init = function(t) { var e = this; e.options = t, e.cy = t.cy; var r = e.container = t.cy.container(), i = e.cy.window(); if (i) { var n = i.document, a = n.head, o = "__________cytoscape_stylesheet", s = "__________cytoscape_container", c = n.getElementById(o) != null; if (r.className.indexOf(s) < 0 && (r.className = (r.className || "") + " " + s), !c) { var l = n.createElement("style"); l.id = o, l.textContent = "." + s + " { position: relative; }", a.insertBefore(l, a.children[0]); } var u = i.getComputedStyle(r), d = u.getPropertyValue("position"); d === "static" && Zt("A Cytoscape container has style position:static and so can not use UI extensions properly"); } e.selection = [void 0, void 0, void 0, void 0, 0], e.bezierProjPcts = [0.05, 0.225, 0.4, 0.5, 0.6, 0.775, 0.95], e.hoverData = { down: null, last: null, downTime: null, triggerMode: null, dragging: !1, initialPan: [null, null], capture: !1 }, e.dragData = { possibleDragElements: [] }, e.touchData = { start: null, capture: !1, // These 3 fields related to tap, taphold events startPosition: [null, null, null, null, null, null], singleTouchStartTime: null, singleTouchMoved: !0, now: [null, null, null, null, null, null], earlier: [null, null, null, null, null, null] }, e.redraws = 0, e.showFps = t.showFps, e.debug = t.debug, e.hideEdgesOnViewport = t.hideEdgesOnViewport, e.textureOnViewport = t.textureOnViewport, e.wheelSensitivity = t.wheelSensitivity, e.motionBlurEnabled = t.motionBlur, e.forcedPixelRatio = Xe(t.pixelRatio) ? t.pixelRatio : null, e.motionBlur = t.motionBlur, e.motionBlurOpacity = t.motionBlurOpacity, e.motionBlurTransparency = 1 - e.motionBlurOpacity, e.motionBlurPxRatio = 1, e.mbPxRBlurry = 1, e.minMbLowQualFrames = 4, e.fullQualityMb = !1, e.clearedForMotionBlur = [], e.desktopTapThreshold = t.desktopTapThreshold, e.desktopTapThreshold2 = t.desktopTapThreshold * t.desktopTapThreshold, e.touchTapThreshold = t.touchTapThreshold, e.touchTapThreshold2 = t.touchTapThreshold * t.touchTapThreshold, e.tapholdDuration = 500, e.bindings = [], e.beforeRenderCallbacks = [], e.beforeRenderPriorities = { // higher priority execs before lower one animations: 400, eleCalcs: 300, eleTxrDeq: 200, lyrTxrDeq: 150, lyrTxrSkip: 100 }, e.registerNodeShapes(), e.registerArrowShapes(), e.registerCalculationListeners(); }; Hu.notify = function(t, e) { var r = this, i = r.cy; if (!this.destroyed) { if (t === "init") { r.load(); return; } if (t === "destroy") { r.destroy(); return; } (t === "add" || t === "remove" || t === "move" && i.hasCompoundNodes() || t === "load" || t === "zorder" || t === "mount") && r.invalidateCachedZSortedEles(), t === "viewport" && r.redrawHint("select", !0), (t === "load" || t === "resize" || t === "mount") && (r.invalidateContainerClientCoordsCache(), r.matchCanvasSize(r.container)), r.redrawHint("eles", !0), r.redrawHint("drag", !0), this.startRenderLoop(), this.redraw(); } }; Hu.destroy = function() { var t = this; t.destroyed = !0, t.cy.stopAnimationLoop(); for (var e = 0; e < t.bindings.length; e++) { var r = t.bindings[e], i = r, n = i.target; (n.off || n.removeEventListener).apply(n, i.args); } if (t.bindings = [], t.beforeRenderCallbacks = [], t.onUpdateEleCalcsFns = [], t.removeObserver && t.removeObserver.disconnect(), t.styleObserver && t.styleObserver.disconnect(), t.resizeObserver && t.resizeObserver.disconnect(), t.labelCalcDiv) try { document.body.removeChild(t.labelCalcDiv); } catch { } }; Hu.isHeadless = function() { return !1; }; [Wb, D3, I3, ju, fo, lp].forEach(function(t) { bt(Hu, t); }); var Yv = 1e3 / 60, B3 = { setupDequeueing: function(t) { return function() { var e = this, r = this.renderer; if (!e.dequeueingSetup) { e.dequeueingSetup = !0; var i = Eg(function() { r.redrawHint("eles", !0), r.redrawHint("drag", !0), r.redraw(); }, t.deqRedrawThreshold), n = function(o, s) { var c = ro(), l = r.averageRedrawTime, u = r.lastRedrawTime, d = [], h = r.cy.extent(), f = r.getPixelRatio(); for (o || r.flushRenderedStyleQueue(); ; ) { var p = ro(), m = p - c, y = p - s; if (u < Yv) { var g = Yv - (o ? l : 0); if (y >= t.deqFastCost * g) break; } else if (o) { if (m >= t.deqCost * u || m >= t.deqAvgCost * l) break; } else if (y >= t.deqNoDrawCost * Yv) break; var v = t.deq(e, f, h); if (v.length > 0) for (var x = 0; x < v.length; x++) d.push(v[x]); else break; } d.length > 0 && (t.onDeqd(e, d), !o && t.shouldRedraw(e, d, f, h) && i()); }, a = t.priority || Pb; r.beforeRender(n, a(e)); } }; } }, M7 = /* @__PURE__ */ function() { function t(e) { var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Dm; Tb(this, t), this.idsByKey = new ca(), this.keyForId = new ca(), this.cachesByLvl = new ca(), this.lvls = [], this.getKey = e, this.doesEleInvalidateKey = r; } return Cb(t, [{ key: "getIdsFor", value: function(e) { e == null && Tr("Can not get id list for null key"); var r = this.idsByKey, i = this.idsByKey.get(e); return i || (i = new Nu(), r.set(e, i)), i; } }, { key: "addIdForKey", value: function(e, r) { e != null && this.getIdsFor(e).add(r); } }, { key: "deleteIdForKey", value: function(e, r) { e != null && this.getIdsFor(e).delete(r); } }, { key: "getNumberOfIdsForKey", value: function(e) { return e == null ? 0 : this.getIdsFor(e).size; } }, { key: "updateKeyMappingFor", value: function(e) { var r = e.id(), i = this.keyForId.get(r), n = this.getKey(e); this.deleteIdForKey(i, r), this.addIdForKey(n, r), this.keyForId.set(r, n); } }, { key: "deleteKeyMappingFor", value: function(e) { var r = e.id(), i = this.keyForId.get(r); this.deleteIdForKey(i, r), this.keyForId.delete(r); } }, { key: "keyHasChangedFor", value: function(e) { var r = e.id(), i = this.keyForId.get(r), n = this.getKey(e); return i !== n; } }, { key: "isInvalid", value: function(e) { return this.keyHasChangedFor(e) || this.doesEleInvalidateKey(e); } }, { key: "getCachesAt", value: function(e) { var r = this.cachesByLvl, i = this.lvls, n = r.get(e); return n || (n = new ca(), r.set(e, n), i.push(e)), n; } }, { key: "getCache", value: function(e, r) { return this.getCachesAt(r).get(e); } }, { key: "get", value: function(e, r) { var i = this.getKey(e), n = this.getCache(i, r); return n != null && this.updateKeyMappingFor(e), n; } }, { key: "getForCachedKey", value: function(e, r) { var i = this.keyForId.get(e.id()), n = this.getCache(i, r); return n; } }, { key: "hasCache", value: function(e, r) { return this.getCachesAt(r).has(e); } }, { key: "has", value: function(e, r) { var i = this.getKey(e); return this.hasCache(i, r); } }, { key: "setCache", value: function(e, r, i) { i.key = e, this.getCachesAt(r).set(e, i); } }, { key: "set", value: function(e, r, i) { var n = this.getKey(e); this.setCache(n, r, i), this.updateKeyMappingFor(e); } }, { key: "deleteCache", value: function(e, r) { this.getCachesAt(r).delete(e); } }, { key: "delete", value: function(e, r) { var i = this.getKey(e); this.deleteCache(i, r); } }, { key: "invalidateKey", value: function(e) { var r = this; this.lvls.forEach(function(i) { return r.deleteCache(e, i); }); } // 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(e) { var r = e.id(), i = this.keyForId.get(r); this.deleteKeyMappingFor(e); var n = this.doesEleInvalidateKey(e); return n && this.invalidateKey(i), n || this.getNumberOfIdsForKey(i) === 0; } }]), t; }(), tS = 25, Jp = 50, mm = -4, Iy = 3, E7 = 7.99, T7 = 8, C7 = 1024, A7 = 1024, L7 = 1024, k7 = 0.2, P7 = 0.8, R7 = 10, O7 = 0.15, D7 = 0.1, I7 = 0.9, N7 = 0.9, B7 = 100, F7 = 1, Dc = { dequeue: "dequeue", downscale: "downscale", highQuality: "highQuality" }, z7 = yi({ getKey: null, doesEleInvalidateKey: Dm, drawElement: null, getBoundingBox: null, getRotationPoint: null, getRotationOffset: null, isVisible: LA, allowEdgeTxrCaching: !0, allowParentTxrCaching: !0 }), $d = function(t, e) { var r = this; r.renderer = t, r.onDequeues = []; var i = z7(e); bt(r, i), r.lookup = new M7(i.getKey, i.doesEleInvalidateKey), r.setupDequeueing(); }, Yr = $d.prototype; Yr.reasons = Dc; Yr.getTextureQueue = function(t) { var e = this; return e.eleImgCaches = e.eleImgCaches || {}, e.eleImgCaches[t] = e.eleImgCaches[t] || []; }; Yr.getRetiredTextureQueue = function(t) { var e = this, r = e.eleImgCaches.retired = e.eleImgCaches.retired || {}, i = r[t] = r[t] || []; return i; }; Yr.getElementQueue = function() { var t = this, e = t.eleCacheQueue = t.eleCacheQueue || new np(function(r, i) { return i.reqs - r.reqs; }); return e; }; Yr.getElementKeyToQueue = function() { var t = this, e = t.eleKeyToCacheQueue = t.eleKeyToCacheQueue || {}; return e; }; Yr.getElement = function(t, e, r, i, n) { var a = this, o = this.renderer, s = o.cy.zoom(), c = this.lookup; if (!e || e.w === 0 || e.h === 0 || isNaN(e.w) || isNaN(e.h) || !t.visible() || t.removed() || !a.allowEdgeTxrCaching && t.isEdge() || !a.allowParentTxrCaching && t.isParent()) return null; if (i == null && (i = Math.ceil(Ob(s * r))), i < mm) i = mm; else if (s >= E7 || i > Iy) return null; var l = Math.pow(2, i), u = e.h * l, d = e.w * l, h = o.eleTextBiggerThanMin(t, l); if (!this.isVisible(t, h)) return null; var f = c.get(t, i); if (f && f.invalidated && (f.invalidated = !1, f.texture.invalidatedWidth -= f.width), f) return f; var p; if (u <= tS ? p = tS : u <= Jp ? p = Jp : p = Math.ceil(u / Jp) * Jp, u > L7 || d > A7) return null; var m = a.getTextureQueue(p), y = m[m.length - 2], g = function() { return a.recycleTexture(p, d) || a.addTexture(p, d); }; y || (y = m[m.length - 1]), y || (y = g()), y.width - y.usedWidth < d && (y = g()); for (var v = function(R) { return R && R.scaledLabelShown === h; }, x = n && n === Dc.dequeue, w = n && n === Dc.highQuality, S = n && n === Dc.downscale, _, b = i + 1; b <= Iy; b++) { var T = c.get(t, b); if (T) { _ = T; break; } } var E = _ && _.level === i + 1 ? _ : null, C = function() { y.context.drawImage(E.texture.canvas, E.x, 0, E.width, E.height, y.usedWidth, 0, d, u); }; if (y.context.setTransform(1, 0, 0, 1, 0, 0), y.context.clearRect(y.usedWidth, 0, d, p), v(E)) C(); else if (v(_)) if (w) { for (var L = _.level; L > i; L--) E = a.getElement(t, e, r, L, Dc.downscale); C(); } else return a.queueElement(t, _.level - 1), _; else { var A; if (!x && !w && !S) for (var k = i - 1; k >= mm; k--) { var P = c.get(t, k); if (P) { A = P; break; } } if (v(A)) return a.queueElement(t, i), A; y.context.translate(y.usedWidth, 0), y.context.scale(l, l), this.drawElement(y.context, t, e, h, !1), y.context.scale(1 / l, 1 / l), y.context.translate(-y.usedWidth, 0); } return f = { x: y.usedWidth, texture: y, level: i, scale: l, width: d, height: u, scaledLabelShown: h }, y.usedWidth += Math.ceil(d + T7), y.eleCaches.push(f), c.set(t, i, f), a.checkTextureFullness(y), f; }; Yr.invalidateElements = function(t) { for (var e = 0; e < t.length; e++) this.invalidateElement(t[e]); }; Yr.invalidateElement = function(t) { var e = this, r = e.lookup, i = [], n = r.isInvalid(t); if (n) { for (var a = mm; a <= Iy; a++) { var o = r.getForCachedKey(t, a); o && i.push(o); } var s = r.invalidate(t); if (s) for (var c = 0; c < i.length; c++) { var l = i[c], u = l.texture; u.invalidatedWidth += l.width, l.invalidated = !0, e.checkTextureUtility(u); } e.removeFromQueue(t); } }; Yr.checkTextureUtility = function(t) { t.invalidatedWidth >= k7 * t.width && this.retireTexture(t); }; Yr.checkTextureFullness = function(t) { var e = this, r = e.getTextureQueue(t.height); t.usedWidth / t.width > P7 && t.fullnessChecks >= R7 ? hs(r, t) : t.fullnessChecks++; }; Yr.retireTexture = function(t) { var e = this, r = t.height, i = e.getTextureQueue(r), n = this.lookup; hs(i, t), t.retired = !0; for (var a = t.eleCaches, o = 0; o < a.length; o++) { var s = a[o]; n.deleteCache(s.key, s.level); } Rb(a); var c = e.getRetiredTextureQueue(r); c.push(t); }; Yr.addTexture = function(t, e) { var r = this, i = r.getTextureQueue(t), n = {}; return i.push(n), n.eleCaches = [], n.height = t, n.width = Math.max(C7, e), n.usedWidth = 0, n.invalidatedWidth = 0, n.fullnessChecks = 0, n.canvas = r.renderer.makeOffscreenCanvas(n.width, n.height), n.context = n.canvas.getContext("2d"), n; }; Yr.recycleTexture = function(t, e) { for (var r = this, i = r.getTextureQueue(t), n = r.getRetiredTextureQueue(t), a = 0; a < n.length; a++) { var o = n[a]; if (o.width >= e) return o.retired = !1, o.usedWidth = 0, o.invalidatedWidth = 0, o.fullnessChecks = 0, Rb(o.eleCaches), o.context.setTransform(1, 0, 0, 1, 0, 0), o.context.clearRect(0, 0, o.width, o.height), hs(n, o), i.push(o), o; } }; Yr.queueElement = function(t, e) { var r = this, i = r.getElementQueue(), n = r.getElementKeyToQueue(), a = this.getKey(t), o = n[a]; if (o) o.level = Math.max(o.level, e), o.eles.merge(t), o.reqs++, i.updateItem(o); else { var s = { eles: t.spawn().merge(t), level: e, reqs: 1, key: a }; i.push(s), n[a] = s; } }; Yr.dequeue = function(t) { for (var e = this, r = e.getElementQueue(), i = e.getElementKeyToQueue(), n = [], a = e.lookup, o = 0; o < F7 && r.size() > 0; o++) { var s = r.pop(), c = s.key, l = s.eles[0], u = a.hasCache(l, s.level); if (i[c] = null, !u) { n.push(s); var d = e.getBoundingBox(l); e.getElement(l, d, t, s.level, Dc.dequeue); } } return n; }; Yr.removeFromQueue = function(t) { var e = this, r = e.getElementQueue(), i = e.getElementKeyToQueue(), n = this.getKey(t), a = i[n]; a != null && (a.eles.length === 1 ? (a.reqs = kb, r.updateItem(a), r.pop(), i[n] = null) : a.eles.unmerge(t)); }; Yr.onDequeue = function(t) { this.onDequeues.push(t); }; Yr.offDequeue = function(t) { hs(this.onDequeues, t); }; Yr.setupDequeueing = B3.setupDequeueing({ deqRedrawThreshold: B7, deqCost: O7, deqAvgCost: D7, deqNoDrawCost: I7, deqFastCost: N7, deq: function(t, e, r) { return t.dequeue(e, r); }, onDeqd: function(t, e) { for (var r = 0; r < t.onDequeues.length; r++) { var i = t.onDequeues[r]; i(e); } }, shouldRedraw: function(t, e, r, i) { for (var n = 0; n < e.length; n++) for (var a = e[n].eles, o = 0; o < a.length; o++) { var s = a[o].boundingBox(); if (Db(s, i)) return !0; } return !1; }, priority: function(t) { return t.renderer.beforeRenderPriorities.eleTxrDeq; } }); var $7 = 1, Zd = -4, jm = 2, V7 = 3.99, U7 = 50, j7 = 50, H7 = 0.15, G7 = 0.1, W7 = 0.9, q7 = 0.9, X7 = 1, rS = 250, Z7 = 4e3 * 4e3, Y7 = !0, F3 = function(t) { var e = this, r = e.renderer = t, i = r.cy; e.layersByLevel = {}, e.firstGet = !0, e.lastInvalidationTime = ro() - 2 * rS, e.skipping = !1, e.eleTxrDeqs = i.collection(), e.scheduleElementRefinement = Eg(function() { e.refineElementTextures(e.eleTxrDeqs), e.eleTxrDeqs.unmerge(e.eleTxrDeqs); }, j7), r.beforeRender(function(a, o) { o - e.lastInvalidationTime <= rS ? e.skipping = !0 : e.skipping = !1; }, r.beforeRenderPriorities.lyrTxrSkip); var n = function(a, o) { return o.reqs - a.reqs; }; e.layersQueue = new np(n), e.setupDequeueing(); }, bi = F3.prototype, iS = 0, K7 = Math.pow(2, 53) - 1; bi.makeLayer = function(t, e) { var r = Math.pow(2, e), i = Math.ceil(t.w * r), n = Math.ceil(t.h * r), a = this.renderer.makeOffscreenCanvas(i, n), o = { id: iS = ++iS % K7, bb: t, level: e, width: i, height: n, canvas: a, context: a.getContext("2d"), eles: [], elesQueue: [], reqs: 0 }, s = o.context, c = -o.bb.x1, l = -o.bb.y1; return s.scale(r, r), s.translate(c, l), o; }; bi.getLayers = function(t, e, r) { var i = this, n = i.renderer, a = n.cy, o = a.zoom(), s = i.firstGet; if (i.firstGet = !1, r == null) { if (r = Math.ceil(Ob(o * e)), r < Zd) r = Zd; else if (o >= V7 || r > jm) return null; } i.validateLayersElesOrdering(r, t); var c = i.layersByLevel, l = Math.pow(2, r), u = c[r] = c[r] || [], d, h = i.levelIsComplete(r, t), f, p = function() { var E = function(k) { if (i.validateLayersElesOrdering(k, t), i.levelIsComplete(k, t)) return f = c[k], !0; }, C = function(k) { if (!f) for (var P = r + k; Zd <= P && P <= jm && !E(P); P += k) ; }; C(1), C(-1); for (var L = u.length - 1; L >= 0; L--) { var A = u[L]; A.invalid && hs(u, A); } }; if (!h) p(); else return u; var m = function() { if (!d) { d = Yi(); for (var E = 0; E < t.length; E++) DA(d, t[E].boundingBox()); } return d; }, y = function(E) { E = E || {}; var C = E.after; m(); var L = d.w * l * (d.h * l); if (L > Z7) return null; var A = i.makeLayer(d, r); if (C != null) { var k = u.indexOf(C) + 1; u.splice(k, 0, A); } else (E.insert === void 0 || E.insert) && u.unshift(A); return A; }; if (i.skipping && !s) return null; for (var g = null, v = t.length / $7, x = !s, w = 0; w < t.length; w++) { var S = t[w], _ = S._private.rscratch, b = _.imgLayerCaches = _.imgLayerCaches || {}, T = b[r]; if (T) { g = T; continue; } if ((!g || g.eles.length >= v || !IA(g.bb, S.boundingBox())) && (g = y({ insert: !0, after: g }), !g)) return null; f || x ? i.queueLayer(g, S) : i.drawEleInLayer(g, S, r, e), g.eles.push(S), b[r] = g; } return f || (x ? null : u); }; bi.getEleLevelForLayerLevel = function(t, e) { return t; }; bi.drawEleInLayer = function(t, e, r, i) { var n = this, a = this.renderer, o = t.context, s = e.boundingBox(); s.w === 0 || s.h === 0 || !e.visible() || (r = n.getEleLevelForLayerLevel(r, i), a.setImgSmoothing(o, !1), a.drawCachedElement(o, e, null, null, r, Y7), a.setImgSmoothing(o, !0)); }; bi.levelIsComplete = function(t, e) { var r = this, i = r.layersByLevel[t]; if (!i || i.length === 0) return !1; for (var n = 0, a = 0; a < i.length; a++) { var o = i[a]; if (o.reqs > 0 || o.invalid) return !1; n += o.eles.length; } return n === e.length; }; bi.validateLayersElesOrdering = function(t, e) { var r = this.layersByLevel[t]; if (r) for (var i = 0; i < r.length; i++) { for (var n = r[i], a = -1, o = 0; o < e.length; o++) if (n.eles[0] === e[o]) { a = o; break; } if (a < 0) { this.invalidateLayer(n); continue; } for (var s = a, o = 0; o < n.eles.length; o++) if (n.eles[o] !== e[s + o]) { this.invalidateLayer(n); break; } } }; bi.updateElementsInLayers = function(t, e) { for (var r = this, i = rp(t[0]), n = 0; n < t.length; n++) for (var a = i ? null : t[n], o = i ? t[n] : t[n].ele, s = o._private.rscratch, c = s.imgLayerCaches = s.imgLayerCaches || {}, l = Zd; l <= jm; l++) { var u = c[l]; u && (a && r.getEleLevelForLayerLevel(u.level) !== a.level || e(u, o, a)); } }; bi.haveLayers = function() { for (var t = this, e = !1, r = Zd; r <= jm; r++) { var i = t.layersByLevel[r]; if (i && i.length > 0) { e = !0; break; } } return e; }; bi.invalidateElements = function(t) { var e = this; t.length !== 0 && (e.lastInvalidationTime = ro(), !(t.length === 0 || !e.haveLayers()) && e.updateElementsInLayers(t, function(r, i, n) { e.invalidateLayer(r); })); }; bi.invalidateLayer = function(t) { if (this.lastInvalidationTime = ro(), !t.invalid) { var e = t.level, r = t.eles, i = this.layersByLevel[e]; hs(i, t), t.elesQueue = [], t.invalid = !0, t.replacement && (t.replacement.invalid = !0); for (var n = 0; n < r.length; n++) { var a = r[n]._private.rscratch.imgLayerCaches; a && (a[e] = null); } } }; bi.refineElementTextures = function(t) { var e = this; e.updateElementsInLayers(t, function(r, i, n) { var a = r.replacement; if (a || (a = r.replacement = e.makeLayer(r.bb, r.level), a.replaces = r, a.eles = r.eles), !a.reqs) for (var o = 0; o < a.eles.length; o++) e.queueLayer(a, a.eles[o]); }); }; bi.enqueueElementRefinement = function(t) { this.eleTxrDeqs.merge(t), this.scheduleElementRefinement(); }; bi.queueLayer = function(t, e) { var r = this, i = r.layersQueue, n = t.elesQueue, a = n.hasId = n.hasId || {}; if (!t.replacement) { if (e) { if (a[e.id()]) return; n.push(e), a[e.id()] = !0; } t.reqs ? (t.reqs++, i.updateItem(t)) : (t.reqs = 1, i.push(t)); } }; bi.dequeue = function(t) { for (var e = this, r = e.layersQueue, i = [], n = 0; n < X7 && r.size() !== 0; ) { var a = r.peek(); if (a.replacement) { r.pop(); continue; } if (a.replaces && a !== a.replaces.replacement) { r.pop(); continue; } if (a.invalid) { r.pop(); continue; } var o = a.elesQueue.shift(); o && (e.drawEleInLayer(a, o, a.level, t), n++), i.length === 0 && i.push(!0), a.elesQueue.length === 0 && (r.pop(), a.reqs = 0, a.replaces && e.applyLayerReplacement(a), e.requestRedraw()); } return i; }; bi.applyLayerReplacement = function(t) { var e = this, r = e.layersByLevel[t.level], i = t.replaces, n = r.indexOf(i); if (!(n < 0 || i.invalid)) { r[n] = t; for (var a = 0; a < t.eles.length; a++) { var o = t.eles[a]._private, s = o.imgLayerCaches = o.imgLayerCaches || {}; s && (s[t.level] = t); } e.requestRedraw(); } }; bi.requestRedraw = Eg(function() { var t = this.renderer; t.redrawHint("eles", !0), t.redrawHint("drag", !0), t.redraw(); }, 100); bi.setupDequeueing = B3.setupDequeueing({ deqRedrawThreshold: U7, deqCost: H7, deqAvgCost: G7, deqNoDrawCost: W7, deqFastCost: q7, deq: function(t, e) { return t.dequeue(e); }, onDeqd: Pb, shouldRedraw: LA, priority: function(t) { return t.renderer.beforeRenderPriorities.lyrTxrDeq; } }); var z3 = {}, nS; function J7(t, e) { for (var r = 0; r < e.length; r++) { var i = e[r]; t.lineTo(i.x, i.y); } } function Q7(t, e, r) { for (var i, n = 0; n < e.length; n++) { var a = e[n]; n === 0 && (i = a), t.lineTo(a.x, a.y); } t.quadraticCurveTo(r.x, r.y, i.x, i.y); } function aS(t, e, r) { t.beginPath && t.beginPath(); for (var i = e, n = 0; n < i.length; n++) { var a = i[n]; t.lineTo(a.x, a.y); } var o = r, s = r[0]; t.moveTo(s.x, s.y); for (var n = 1; n < o.length; n++) { var a = o[n]; t.lineTo(a.x, a.y); } t.closePath && t.closePath(); } function eq(t, e, r, i, n) { t.beginPath && t.beginPath(), t.arc(r, i, n, 0, Math.PI * 2, !1); var a = e, o = a[0]; t.moveTo(o.x, o.y); for (var s = 0; s < a.length; s++) { var c = a[s]; t.lineTo(c.x, c.y); } t.closePath && t.closePath(); } function tq(t, e, r, i) { t.arc(e, r, i, 0, Math.PI * 2, !1); } z3.arrowShapeImpl = function(t) { return (nS || (nS = { polygon: J7, "triangle-backcurve": Q7, "triangle-tee": aS, "circle-triangle": eq, "triangle-cross": aS, circle: tq }))[t]; }; var Ta = {}; Ta.drawElement = function(t, e, r, i, n, a) { var o = this; e.isNode() ? o.drawNode(t, e, r, i, n, a) : o.drawEdge(t, e, r, i, n, a); }; Ta.drawElementOverlay = function(t, e) { var r = this; e.isNode() ? r.drawNodeOverlay(t, e) : r.drawEdgeOverlay(t, e); }; Ta.drawElementUnderlay = function(t, e) { var r = this; e.isNode() ? r.drawNodeUnderlay(t, e) : r.drawEdgeUnderlay(t, e); }; Ta.drawCachedElementPortion = function(t, e, r, i, n, a, o, s) { var c = this, l = r.getBoundingBox(e); if (!(l.w === 0 || l.h === 0)) { var u = r.getElement(e, l, i, n, a); if (u != null) { var d = s(c, e); if (d === 0) return; var h = o(c, e), f = l.x1, p = l.y1, m = l.w, y = l.h, g, v, x, w, S; if (h !== 0) { var _ = r.getRotationPoint(e); x = _.x, w = _.y, t.translate(x, w), t.rotate(h), S = c.getImgSmoothing(t), S || c.setImgSmoothing(t, !0); var b = r.getRotationOffset(e); g = b.x, v = b.y; } else g = f, v = p; var T; d !== 1 && (T = t.globalAlpha, t.globalAlpha = T * d), t.drawImage(u.texture.canvas, u.x, 0, u.width, u.height, g, v, m, y), d !== 1 && (t.globalAlpha = T), h !== 0 && (t.rotate(-h), t.translate(-x, -w), S || c.setImgSmoothing(t, !1)); } else r.drawElement(t, e); } }; var rq = function() { return 0; }, iq = function(t, e) { return t.getTextAngle(e, null); }, nq = function(t, e) { return t.getTextAngle(e, "source"); }, aq = function(t, e) { return t.getTextAngle(e, "target"); }, oq = function(t, e) { return e.effectiveOpacity(); }, Kv = function(t, e) { return e.pstyle("text-opacity").pfValue * e.effectiveOpacity(); }; Ta.drawCachedElement = function(t, e, r, i, n, a) { var o = this, s = o.data, c = s.eleTxrCache, l = s.lblTxrCache, u = s.slbTxrCache, d = s.tlbTxrCache, h = e.boundingBox(), f = a === !0 ? c.reasons.highQuality : null; if (!(h.w === 0 || h.h === 0 || !e.visible()) && (!i || Db(h, i))) { var p = e.isEdge(), m = e.element()._private.rscratch.badLine; o.drawElementUnderlay(t, e), o.drawCachedElementPortion(t, e, c, r, n, f, rq, oq), (!p || !m) && o.drawCachedElementPortion(t, e, l, r, n, f, iq, Kv), p && !m && (o.drawCachedElementPortion(t, e, u, r, n, f, nq, Kv), o.drawCachedElementPortion(t, e, d, r, n, f, aq, Kv)), o.drawElementOverlay(t, e); } }; Ta.drawElements = function(t, e) { for (var r = this, i = 0; i < e.length; i++) { var n = e[i]; r.drawElement(t, n); } }; Ta.drawCachedElements = function(t, e, r, i) { for (var n = this, a = 0; a < e.length; a++) { var o = e[a]; n.drawCachedElement(t, o, r, i); } }; Ta.drawCachedNodes = function(t, e, r, i) { for (var n = this, a = 0; a < e.length; a++) { var o = e[a]; o.isNode() && n.drawCachedElement(t, o, r, i); } }; Ta.drawLayeredElements = function(t, e, r, i) { var n = this, a = n.data.lyrTxrCache.getLayers(e, r); if (a) for (var o = 0; o < a.length; o++) { var s = a[o], c = s.bb; c.w === 0 || c.h === 0 || t.drawImage(s.canvas, c.x1, c.y1, c.w, c.h); } else n.drawCachedElements(t, e, r, i); }; var mo = {}; mo.drawEdge = function(t, e, r) { var i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !0, n = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : !0, o = this, s = e._private.rscratch; if (!(a && !e.visible()) && !(s.badLine || s.allpts == null || isNaN(s.allpts[0]))) { var c; r && (c = r, t.translate(-c.x1, -c.y1)); var l = a ? e.pstyle("opacity").value : 1, u = a ? e.pstyle("line-opacity").value : 1, d = e.pstyle("curve-style").value, h = e.pstyle("line-style").value, f = e.pstyle("width").pfValue, p = e.pstyle("line-cap").value, m = e.pstyle("line-outline-width").value, y = e.pstyle("line-outline-color").value, g = l * u, v = l * u, x = function() { var P = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : g; d === "straight-triangle" ? (o.eleStrokeStyle(t, e, P), o.drawEdgeTrianglePath(e, t, s.allpts)) : (t.lineWidth = f, t.lineCap = p, o.eleStrokeStyle(t, e, P), o.drawEdgePath(e, t, s.allpts, h), t.lineCap = "butt"); }, w = function() { var P = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : g; if (t.lineWidth = f + m, t.lineCap = p, m > 0) o.colorStrokeStyle(t, y[0], y[1], y[2], P); else { t.lineCap = "butt"; return; } d === "straight-triangle" ? o.drawEdgeTrianglePath(e, t, s.allpts) : (o.drawEdgePath(e, t, s.allpts, h), t.lineCap = "butt"); }, S = function() { n && o.drawEdgeOverlay(t, e); }, _ = function() { n && o.drawEdgeUnderlay(t, e); }, b = function() { var P = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : v; o.drawArrowheads(t, e, P); }, T = function() { o.drawElementText(t, e, null, i); }; t.lineJoin = "round"; var E = e.pstyle("ghost").value === "yes"; if (E) { var C = e.pstyle("ghost-offset-x").pfValue, L = e.pstyle("ghost-offset-y").pfValue, A = e.pstyle("ghost-opacity").value, k = g * A; t.translate(C, L), x(k), b(k), t.translate(-C, -L); } else w(); _(), x(), b(), S(), T(), r && t.translate(c.x1, c.y1); } }; var $3 = function(t) { if (!["overlay", "underlay"].includes(t)) throw new Error("Invalid state"); return function(e, r) { if (r.visible()) { var i = r.pstyle("".concat(t, "-opacity")).value; if (i !== 0) { var n = this, a = n.usePaths(), o = r._private.rscratch, s = r.pstyle("".concat(t, "-padding")).pfValue, c = 2 * s, l = r.pstyle("".concat(t, "-color")).value; e.lineWidth = c, o.edgeType === "self" && !a ? e.lineCap = "butt" : e.lineCap = "round", n.colorStrokeStyle(e, l[0], l[1], l[2], i), n.drawEdgePath(r, e, o.allpts, "solid"); } } }; }; mo.drawEdgeOverlay = $3("overlay"); mo.drawEdgeUnderlay = $3("underlay"); mo.drawEdgePath = function(t, e, r, i) { var n = t._private.rscratch, a = e, o, s = !1, c = this.usePaths(), l = t.pstyle("line-dash-pattern").pfValue, u = t.pstyle("line-dash-offset").pfValue; if (c) { var d = r.join("$"), h = n.pathCacheKey && n.pathCacheKey === d; h ? (o = e = n.pathCache, s = !0) : (o = e = new Path2D(), n.pathCacheKey = d, n.pathCache = o); } if (a.setLineDash) switch (i) { case "dotted": a.setLineDash([1, 1]); break; case "dashed": a.setLineDash(l), a.lineDashOffset = u; break; case "solid": a.setLineDash([]); break; } if (!s && !n.badLine) switch (e.beginPath && e.beginPath(), e.moveTo(r[0], r[1]), n.edgeType) { case "bezier": case "self": case "compound": case "multibezier": for (var f = 2; f + 3 < r.length; f += 4) e.quadraticCurveTo(r[f], r[f + 1], r[f + 2], r[f + 3]); break; case "straight": case "haystack": for (var p = 2; p + 1 < r.length; p += 2) e.lineTo(r[p], r[p + 1]); break; case "segments": if (n.isRound) { var m = mA(n.roundCorners), y; try { for (m.s(); !(y = m.n()).done; ) { var g = y.value; L3(e, g); } } catch (x) { m.e(x); } finally { m.f(); } e.lineTo(r[r.length - 2], r[r.length - 1]); } else for (var v = 2; v + 1 < r.length; v += 2) e.lineTo(r[v], r[v + 1]); break; } e = a, c ? e.stroke(o) : e.stroke(), e.setLineDash && e.setLineDash([]); }; mo.drawEdgeTrianglePath = function(t, e, r) { e.fillStyle = e.strokeStyle; for (var i = t.pstyle("width").pfValue, n = 0; n + 1 < r.length; n += 2) { var a = [r[n + 2] - r[n], r[n + 3] - r[n + 1]], o = Math.sqrt(a[0] * a[0] + a[1] * a[1]), s = [a[1] / o, -a[0] / o], c = [s[0] * i / 2, s[1] * i / 2]; e.beginPath(), e.moveTo(r[n] - c[0], r[n + 1] - c[1]), e.lineTo(r[n] + c[0], r[n + 1] + c[1]), e.lineTo(r[n + 2], r[n + 3]), e.closePath(), e.fill(); } }; mo.drawArrowheads = function(t, e, r) { var i = e._private.rscratch, n = i.edgeType === "haystack"; n || this.drawArrowhead(t, e, "source", i.arrowStartX, i.arrowStartY, i.srcArrowAngle, r), this.drawArrowhead(t, e, "mid-target", i.midX, i.midY, i.midtgtArrowAngle, r), this.drawArrowhead(t, e, "mid-source", i.midX, i.midY, i.midsrcArrowAngle, r), n || this.drawArrowhead(t, e, "target", i.arrowEndX, i.arrowEndY, i.tgtArrowAngle, r); }; mo.drawArrowhead = function(t, e, r, i, n, a, o) { if (!(isNaN(i) || i == null || isNaN(n) || n == null || isNaN(a) || a == null)) { var s = this, c = e.pstyle(r + "-arrow-shape").value; if (c !== "none") { var l = e.pstyle(r + "-arrow-fill").value === "hollow" ? "both" : "filled", u = e.pstyle(r + "-arrow-fill").value, d = e.pstyle("width").pfValue, h = e.pstyle(r + "-arrow-width"), f = h.value === "match-line" ? d : h.pfValue; h.units === "%" && (f *= d); var p = e.pstyle("opacity").value; o === void 0 && (o = p); var m = t.globalCompositeOperation; (o !== 1 || u === "hollow") && (t.globalCompositeOperation = "destination-out", s.colorFillStyle(t, 255, 255, 255, 1), s.colorStrokeStyle(t, 255, 255, 255, 1), s.drawArrowShape(e, t, l, d, c, f, i, n, a), t.globalCompositeOperation = m); var y = e.pstyle(r + "-arrow-color").value; s.colorFillStyle(t, y[0], y[1], y[2], o), s.colorStrokeStyle(t, y[0], y[1], y[2], o), s.drawArrowShape(e, t, u, d, c, f, i, n, a); } } }; mo.drawArrowShape = function(t, e, r, i, n, a, o, s, c) { var l = this, u = this.usePaths() && n !== "triangle-cross", d = !1, h, f = e, p = { x: o, y: s }, m = t.pstyle("arrow-scale").value, y = this.getArrowWidth(i, m), g = l.arrowShapes[n]; if (u) { var v = l.arrowPathCache = l.arrowPathCache || [], x = wl(n), w = v[x]; w != null ? (h = e = w, d = !0) : (h = e = new Path2D(), v[x] = h); } d || (e.beginPath && e.beginPath(), u ? g.draw(e, 1, 0, { x: 0, y: 0 }, 1) : g.draw(e, y, c, p, i), e.closePath && e.closePath()), e = f, u && (e.translate(o, s), e.rotate(c), e.scale(y, y)), (r === "filled" || r === "both") && (u ? e.fill(h) : e.fill()), (r === "hollow" || r === "both") && (e.lineWidth = a / (u ? y : 1), e.lineJoin = "miter", u ? e.stroke(h) : e.stroke()), u && (e.scale(1 / y, 1 / y), e.rotate(-c), e.translate(-o, -s)); }; var Zb = {}; Zb.safeDrawImage = function(t, e, r, i, n, a, o, s, c, l) { if (!(n <= 0 || a <= 0 || c <= 0 || l <= 0)) try { t.drawImage(e, r, i, n, a, o, s, c, l); } catch (u) { Zt(u); } }; Zb.drawInscribedImage = function(t, e, r, i, n) { var a = this, o = r.position(), s = o.x, c = o.y, l = r.cy().style(), u = l.getIndexedStyle.bind(l), d = u(r, "background-fit", "value", i), h = u(r, "background-repeat", "value", i), f = r.width(), p = r.height(), m = r.padding() * 2, y = f + (u(r, "background-width-relative-to", "value", i) === "inner" ? 0 : m), g = p + (u(r, "background-height-relative-to", "value", i) === "inner" ? 0 : m), v = r._private.rscratch, x = u(r, "background-clip", "value", i), w = x === "node", S = u(r, "background-image-opacity", "value", i) * n, _ = u(r, "background-image-smoothing", "value", i), b = r.pstyle("corner-radius").value; b !== "auto" && (b = r.pstyle("corner-radius").pfValue); var T = e.width || e.cachedW, E = e.height || e.cachedH; (T == null || E == null) && (document.body.appendChild(e), T = e.cachedW = e.width || e.offsetWidth, E = e.cachedH = e.height || e.offsetHeight, document.body.removeChild(e)); var C = T, L = E; if (u(r, "background-width", "value", i) !== "auto" && (u(r, "background-width", "units", i) === "%" ? C = u(r, "background-width", "pfValue", i) * y : C = u(r, "background-width", "pfValue", i)), u(r, "background-height", "value", i) !== "auto" && (u(r, "background-height", "units", i) === "%" ? L = u(r, "background-height", "pfValue", i) * g : L = u(r, "background-height", "pfValue", i)), !(C === 0 || L === 0)) { if (d === "contain") { var A = Math.min(y / C, g / L); C *= A, L *= A; } else if (d === "cover") { var A = Math.max(y / C, g / L); C *= A, L *= A; } var k = s - y / 2, P = u(r, "background-position-x", "units", i), R = u(r, "background-position-x", "pfValue", i); P === "%" ? k += (y - C) * R : k += R; var M = u(r, "background-offset-x", "units", i), O = u(r, "background-offset-x", "pfValue", i); M === "%" ? k += (y - C) * O : k += O; var D = c - g / 2, I = u(r, "background-position-y", "units", i), F = u(r, "background-position-y", "pfValue", i); I === "%" ? D += (g - L) * F : D += F; var z = u(r, "background-offset-y", "units", i), U = u(r, "background-offset-y", "pfValue", i); z === "%" ? D += (g - L) * U : D += U, v.pathCache && (k -= s, D -= c, s = 0, c = 0); var Z = t.globalAlpha; t.globalAlpha = S; var re = a.getImgSmoothing(t), K = !1; if (_ === "no" && re ? (a.setImgSmoothing(t, !1), K = !0) : _ === "yes" && !re && (a.setImgSmoothing(t, !0), K = !0), h === "no-repeat") w && (t.save(), v.pathCache ? t.clip(v.pathCache) : (a.nodeShapes[a.getNodeShape(r)].draw(t, s, c, y, g, b, v), t.clip())), a.safeDrawImage(t, e, 0, 0, T, E, k, D, C, L), w && t.restore(); else { var V = t.createPattern(e, h); t.fillStyle = V, a.nodeShapes[a.getNodeShape(r)].draw(t, s, c, y, g, b, v), t.translate(k, D), t.fill(), t.translate(-k, -D); } t.globalAlpha = Z, K && a.setImgSmoothing(t, re); } }; var Ul = {}; Ul.eleTextBiggerThanMin = function(t, e) { if (!e) { var r = t.cy().zoom(), i = this.getPixelRatio(), n = Math.ceil(Ob(r * i)); e = Math.pow(2, n); } var a = t.pstyle("font-size").pfValue * e, o = t.pstyle("min-zoomed-font-size").pfValue; return !(a < o); }; Ul.drawElementText = function(t, e, r, i, n) { var a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : !0, o = this; if (i == null) { if (a && !o.eleTextBiggerThanMin(e)) return; } else if (i === !1) return; if (e.isNode()) { var s = e.pstyle("label"); if (!s || !s.value) return; var c = o.getLabelJustification(e); t.textAlign = c, t.textBaseline = "bottom"; } else { var l = e.element()._private.rscratch.badLine, u = e.pstyle("label"), d = e.pstyle("source-label"), h = e.pstyle("target-label"); if (l || (!u || !u.value) && (!d || !d.value) && (!h || !h.value)) return; t.textAlign = "center", t.textBaseline = "bottom"; } var f = !r, p; r && (p = r, t.translate(-p.x1, -p.y1)), n == null ? (o.drawText(t, e, null, f, a), e.isEdge() && (o.drawText(t, e, "source", f, a), o.drawText(t, e, "target", f, a))) : o.drawText(t, e, n, f, a), r && t.translate(p.x1, p.y1); }; Ul.getFontCache = function(t) { var e; this.fontCaches = this.fontCaches || []; for (var r = 0; r < this.fontCaches.length; r++) if (e = this.fontCaches[r], e.context === t) return e; return e = { context: t }, this.fontCaches.push(e), e; }; Ul.setupTextStyle = function(t, e) { var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0, i = e.pstyle("font-style").strValue, n = e.pstyle("font-size").pfValue + "px", a = e.pstyle("font-family").strValue, o = e.pstyle("font-weight").strValue, s = r ? e.effectiveOpacity() * e.pstyle("text-opacity").value : 1, c = e.pstyle("text-outline-opacity").value * s, l = e.pstyle("color").value, u = e.pstyle("text-outline-color").value; t.font = i + " " + o + " " + n + " " + a, t.lineJoin = "round", this.colorFillStyle(t, l[0], l[1], l[2], s), this.colorStrokeStyle(t, u[0], u[1], u[2], c); }; function Jv(t, e, r, i, n) { var a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : 5, o = arguments.length > 6 ? arguments[6] : void 0; t.beginPath(), t.moveTo(e + a, r), t.lineTo(e + i - a, r), t.quadraticCurveTo(e + i, r, e + i, r + a), t.lineTo(e + i, r + n - a), t.quadraticCurveTo(e + i, r + n, e + i - a, r + n), t.lineTo(e + a, r + n), t.quadraticCurveTo(e, r + n, e, r + n - a), t.lineTo(e, r + a), t.quadraticCurveTo(e, r, e + a, r), t.closePath(), o ? t.stroke() : t.fill(); } Ul.getTextAngle = function(t, e) { var r, i = t._private, n = i.rscratch, a = e ? e + "-" : "", o = t.pstyle(a + "text-rotation"), s = $n(n, "labelAngle", e); return o.strValue === "autorotate" ? r = t.isEdge() ? s : 0 : o.strValue === "none" ? r = 0 : r = o.pfValue, r; }; Ul.drawText = function(t, e, r) { var i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !0, n = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, a = e._private, o = a.rscratch, s = n ? e.effectiveOpacity() : 1; if (!(n && (s === 0 || e.pstyle("text-opacity").value === 0))) { r === "main" && (r = null); var c = $n(o, "labelX", r), l = $n(o, "labelY", r), u, d, h = this.getLabelText(e, r); if (h != null && h !== "" && !isNaN(c) && !isNaN(l)) { this.setupTextStyle(t, e, n); var f = r ? r + "-" : "", p = $n(o, "labelWidth", r), m = $n(o, "labelHeight", r), y = e.pstyle(f + "text-margin-x").pfValue, g = e.pstyle(f + "text-margin-y").pfValue, v = e.isEdge(), x = e.pstyle("text-halign").value, w = e.pstyle("text-valign").value; v && (x = "center", w = "center"), c += y, l += g; var S; switch (i ? S = this.getTextAngle(e, r) : S = 0, S !== 0 && (u = c, d = l, t.translate(u, d), t.rotate(S), c = 0, l = 0), w) { case "top": break; case "center": l += m / 2; break; case "bottom": l += m; break; } var _ = e.pstyle("text-background-opacity").value, b = e.pstyle("text-border-opacity").value, T = e.pstyle("text-border-width").pfValue, E = e.pstyle("text-background-padding").pfValue, C = e.pstyle("text-background-shape").strValue, L = C.indexOf("round") === 0, A = 2; if (_ > 0 || T > 0 && b > 0) { var k = c - E; switch (x) { case "left": k -= p; break; case "center": k -= p / 2; break; } var P = l - m - E, R = p + 2 * E, M = m + 2 * E; if (_ > 0) { var O = t.fillStyle, D = e.pstyle("text-background-color").value; t.fillStyle = "rgba(" + D[0] + "," + D[1] + "," + D[2] + "," + _ * s + ")", L ? Jv(t, k, P, R, M, A) : t.fillRect(k, P, R, M), t.fillStyle = O; } if (T > 0 && b > 0) { var I = t.strokeStyle, F = t.lineWidth, z = e.pstyle("text-border-color").value, U = e.pstyle("text-border-style").value; if (t.strokeStyle = "rgba(" + z[0] + "," + z[1] + "," + z[2] + "," + b * s + ")", t.lineWidth = T, t.setLineDash) switch (U) { case "dotted": t.setLineDash([1, 1]); break; case "dashed": t.setLineDash([4, 2]); break; case "double": t.lineWidth = T / 4, t.setLineDash([]); break; case "solid": t.setLineDash([]); break; } if (L ? Jv(t, k, P, R, M, A, "stroke") : t.strokeRect(k, P, R, M), U === "double") { var Z = T / 2; L ? Jv(t, k + Z, P + Z, R - Z * 2, M - Z * 2, A, "stroke") : t.strokeRect(k + Z, P + Z, R - Z * 2, M - Z * 2); } t.setLineDash && t.setLineDash([]), t.lineWidth = F, t.strokeStyle = I; } } var re = 2 * e.pstyle("text-outline-width").pfValue; if (re > 0 && (t.lineWidth = re), e.pstyle("text-wrap").value === "wrap") { var K = $n(o, "labelWrapCachedLines", r), V = $n(o, "labelLineHeight", r), H = p / 2, G = this.getLabelJustification(e); switch (G === "auto" || (x === "left" ? G === "left" ? c += -p : G === "center" && (c += -H) : x === "center" ? G === "left" ? c += -H : G === "right" && (c += H) : x === "right" && (G === "center" ? c += H : G === "right" && (c += p))), w) { case "top": l -= (K.length - 1) * V; break; case "center": case "bottom": l -= (K.length - 1) * V; break; } for (var W = 0; W < K.length; W++) re > 0 && t.strokeText(K[W], c, l), t.fillText(K[W], c, l), l += V; } else re > 0 && t.strokeText(h, c, l), t.fillText(h, c, l); S !== 0 && (t.rotate(-S), t.translate(-u, -d)); } } }; var Gu = {}; Gu.drawNode = function(t, e, r) { var i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !0, n = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : !0, o = this, s, c, l = e._private, u = l.rscratch, d = e.position(); if (!(!Xe(d.x) || !Xe(d.y)) && !(a && !e.visible())) { var h = a ? e.effectiveOpacity() : 1, f = o.usePaths(), p, m = !1, y = e.padding(); s = e.width() + 2 * y, c = e.height() + 2 * y; var g; r && (g = r, t.translate(-g.x1, -g.y1)); for (var v = e.pstyle("background-image"), x = v.value, w = new Array(x.length), S = new Array(x.length), _ = 0, b = 0; b < x.length; b++) { var T = x[b], E = w[b] = T != null && T !== "none"; if (E) { var C = e.cy().style().getIndexedStyle(e, "background-image-crossorigin", "value", b); _++, S[b] = o.getCachedImage(T, C, function() { l.backgroundTimestamp = Date.now(), e.emitAndNotify("background"); }); } } var L = e.pstyle("background-blacken").value, A = e.pstyle("border-width").pfValue, k = e.pstyle("background-opacity").value * h, P = e.pstyle("border-color").value, R = e.pstyle("border-style").value, M = e.pstyle("border-join").value, O = e.pstyle("border-cap").value, D = e.pstyle("border-position").value, I = e.pstyle("border-dash-pattern").pfValue, F = e.pstyle("border-dash-offset").pfValue, z = e.pstyle("border-opacity").value * h, U = e.pstyle("outline-width").pfValue, Z = e.pstyle("outline-color").value, re = e.pstyle("outline-style").value, K = e.pstyle("outline-opacity").value * h, V = e.pstyle("outline-offset").value, H = e.pstyle("corner-radius").value; H !== "auto" && (H = e.pstyle("corner-radius").pfValue); var G = function() { var fe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : k; o.eleFillStyle(t, e, fe); }, W = function() { var fe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : z; o.colorStrokeStyle(t, P[0], P[1], P[2], fe); }, Y = function() { var fe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : K; o.colorStrokeStyle(t, Z[0], Z[1], Z[2], fe); }, X = function(fe, he, Te, He) { var We = o.nodePathCache = o.nodePathCache || [], Ie = AA(Te === "polygon" ? Te + "," + He.join(",") : Te, "" + he, "" + fe, "" + H), qe = We[Ie], De, $e = !1; return qe != null ? (De = qe, $e = !0, u.pathCache = De) : (De = new Path2D(), We[Ie] = u.pathCache = De), { path: De, cacheHit: $e }; }, ie = e.pstyle("shape").strValue, ue = e.pstyle("shape-polygon-points").pfValue; if (f) { t.translate(d.x, d.y); var $ = X(s, c, ie, ue); p = $.path, m = $.cacheHit; } var J = function() { if (!m) { var fe = d; f && (fe = { x: 0, y: 0 }), o.nodeShapes[o.getNodeShape(e)].draw(p || t, fe.x, fe.y, s, c, H, u); } f ? t.fill(p) : t.fill(); }, ne = function() { for (var fe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : h, he = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, Te = l.backgrounding, He = 0, We = 0; We < S.length; We++) { var Ie = e.cy().style().getIndexedStyle(e, "background-image-containment", "value", We); if (he && Ie === "over" || !he && Ie === "inside") { He++; continue; } w[We] && S[We].complete && !S[We].error && (He++, o.drawInscribedImage(t, S[We], e, We, fe)); } l.backgrounding = He !== _, Te !== l.backgrounding && e.updateStyle(!1); }, j = function() { var fe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, he = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : h; o.hasPie(e) && (o.drawPie(t, e, he), fe && (f || o.nodeShapes[o.getNodeShape(e)].draw(t, d.x, d.y, s, c, H, u))); }, q = function() { var fe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : h, he = (L > 0 ? L : -L) * fe, Te = L > 0 ? 0 : 255; L !== 0 && (o.colorFillStyle(t, Te, Te, Te, he), f ? t.fill(p) : t.fill()); }, ge = function() { if (A > 0) { if (t.lineWidth = A, t.lineCap = O, t.lineJoin = M, t.setLineDash) switch (R) { case "dotted": t.setLineDash([1, 1]); break; case "dashed": t.setLineDash(I), t.lineDashOffset = F; break; case "solid": case "double": t.setLineDash([]); break; } if (D !== "center") { if (t.save(), t.lineWidth *= 2, D === "inside") f ? t.clip(p) : t.clip(); else { var fe = new Path2D(); fe.rect(-s / 2 - A, -c / 2 - A, s + 2 * A, c + 2 * A), fe.addPath(p), t.clip(fe, "evenodd"); } f ? t.stroke(p) : t.stroke(), t.restore(); } else f ? t.stroke(p) : t.stroke(); if (R === "double") { t.lineWidth = A / 3; var he = t.globalCompositeOperation; t.globalCompositeOperation = "destination-out", f ? t.stroke(p) : t.stroke(), t.globalCompositeOperation = he; } t.setLineDash && t.setLineDash([]); } }, ye = function() { if (U > 0) { if (t.lineWidth = U, t.lineCap = "butt", t.setLineDash) switch (re) { case "dotted": t.setLineDash([1, 1]); break; case "dashed": t.setLineDash([4, 2]); break; case "solid": case "double": t.setLineDash([]); break; } var fe = d; f && (fe = { x: 0, y: 0 }); var he = o.getNodeShape(e), Te = A; D === "inside" && (Te = 0), D === "outside" && (Te *= 2); var He = (s + Te + (U + V)) / s, We = (c + Te + (U + V)) / c, Ie = s * He, qe = c * We, De = o.nodeShapes[he].points, $e; if (f) { var nt = X(Ie, qe, he, De); $e = nt.path; } if (he === "ellipse") o.drawEllipsePath($e || t, fe.x, fe.y, Ie, qe); else if (["round-diamond", "round-heptagon", "round-hexagon", "round-octagon", "round-pentagon", "round-polygon", "round-triangle", "round-tag"].includes(he)) { var lt = 0, mt = 0, _t = 0; he === "round-diamond" ? lt = (Te + V + U) * 1.4 : he === "round-heptagon" ? (lt = (Te + V + U) * 1.075, _t = -(Te / 2 + V + U) / 35) : he === "round-hexagon" ? lt = (Te + V + U) * 1.12 : he === "round-pentagon" ? (lt = (Te + V + U) * 1.13, _t = -(Te / 2 + V + U) / 15) : he === "round-tag" ? (lt = (Te + V + U) * 1.12, mt = (Te / 2 + U + V) * 0.07) : he === "round-triangle" && (lt = (Te + V + U) * (Math.PI / 2), _t = -(Te + V / 2 + U) / Math.PI), lt !== 0 && (He = (s + lt) / s, Ie = s * He, ["round-hexagon", "round-tag"].includes(he) || (We = (c + lt) / c, qe = c * We)), H = H === "auto" ? FA(Ie, qe) : H; for (var wt = Ie / 2, me = qe / 2, Ne = H + (Te + U + V) / 2, Ue = new Array(De.length / 2), Ke = new Array(De.length / 2), ct = 0; ct < De.length / 2; ct++) Ue[ct] = { x: fe.x + mt + wt * De[ct * 2], y: fe.y + _t + me * De[ct * 2 + 1] }; var xt, At, Ft, zt, se = Ue.length; for (At = Ue[se - 1], xt = 0; xt < se; xt++) Ft = Ue[xt % se], zt = Ue[(xt + 1) % se], Ke[xt] = qb(At, Ft, zt, Ne), At = Ft, Ft = zt; o.drawRoundPolygonPath($e || t, fe.x + mt, fe.y + _t, s * He, c * We, De, Ke); } else if (["roundrectangle", "round-rectangle"].includes(he)) H = H === "auto" ? Sl(Ie, qe) : H, o.drawRoundRectanglePath($e || t, fe.x, fe.y, Ie, qe, H + (Te + U + V) / 2); else if (["cutrectangle", "cut-rectangle"].includes(he)) H = H === "auto" ? Ib() : H, o.drawCutRectanglePath($e || t, fe.x, fe.y, Ie, qe, null, H + (Te + U + V) / 4); else if (["bottomroundrectangle", "bottom-round-rectangle"].includes(he)) H = H === "auto" ? Sl(Ie, qe) : H, o.drawBottomRoundRectanglePath($e || t, fe.x, fe.y, Ie, qe, H + (Te + U + V) / 2); else if (he === "barrel") o.drawBarrelPath($e || t, fe.x, fe.y, Ie, qe); else if (he.startsWith("polygon") || ["rhomboid", "right-rhomboid", "round-tag", "tag", "vee"].includes(he)) { var ke = (Te + U + V) / s; De = Im(Nm(De, ke)), o.drawPolygonPath($e || t, fe.x, fe.y, s, c, De); } else { var Ae = (Te + U + V) / s; De = Im(Nm(De, -Ae)), o.drawPolygonPath($e || t, fe.x, fe.y, s, c, De); } if (f ? t.stroke($e) : t.stroke(), re === "double") { t.lineWidth = Te / 3; var Oe = t.globalCompositeOperation; t.globalCompositeOperation = "destination-out", f ? t.stroke($e) : t.stroke(), t.globalCompositeOperation = Oe; } t.setLineDash && t.setLineDash([]); } }, _e = function() { n && o.drawNodeOverlay(t, e, d, s, c); }, Me = function() { n && o.drawNodeUnderlay(t, e, d, s, c); }, Ce = function() { o.drawElementText(t, e, null, i); }, B = e.pstyle("ghost").value === "yes"; if (B) { var ce = e.pstyle("ghost-offset-x").pfValue, ve = e.pstyle("ghost-offset-y").pfValue, te = e.pstyle("ghost-opacity").value, pe = te * h; t.translate(ce, ve), Y(), ye(), G(te * k), J(), ne(pe, !0), W(te * z), ge(), j(L !== 0 || A !== 0), ne(pe, !1), q(pe), t.translate(-ce, -ve); } f && t.translate(-d.x, -d.y), Me(), f && t.translate(d.x, d.y), Y(), ye(), G(), J(), ne(h, !0), W(), ge(), j(L !== 0 || A !== 0), ne(h, !1), q(), f && t.translate(-d.x, -d.y), Ce(), _e(), r && t.translate(g.x1, g.y1); } }; var V3 = function(t) { if (!["overlay", "underlay"].includes(t)) throw new Error("Invalid state"); return function(e, r, i, n, a) { var o = this; if (r.visible()) { var s = r.pstyle("".concat(t, "-padding")).pfValue, c = r.pstyle("".concat(t, "-opacity")).value, l = r.pstyle("".concat(t, "-color")).value, u = r.pstyle("".concat(t, "-shape")).value, d = r.pstyle("".concat(t, "-corner-radius")).value; if (c > 0) { if (i = i || r.position(), n == null || a == null) { var h = r.padding(); n = r.width() + 2 * h, a = r.height() + 2 * h; } o.colorFillStyle(e, l[0], l[1], l[2], c), o.nodeShapes[u].draw(e, i.x, i.y, n + s * 2, a + s * 2, d), e.fill(); } } }; }; Gu.drawNodeOverlay = V3("overlay"); Gu.drawNodeUnderlay = V3("underlay"); Gu.hasPie = function(t) { return t = t[0], t._private.hasPie; }; Gu.drawPie = function(t, e, r, i) { e = e[0], i = i || e.position(); var n = e.cy().style(), a = e.pstyle("pie-size"), o = i.x, s = i.y, c = e.width(), l = e.height(), u = Math.min(c, l) / 2, d = 0, h = this.usePaths(); h && (o = 0, s = 0), a.units === "%" ? u = u * a.pfValue : a.pfValue !== void 0 && (u = a.pfValue / 2); for (var f = 1; f <= n.pieBackgroundN; f++) { var p = e.pstyle("pie-" + f + "-background-size").value, m = e.pstyle("pie-" + f + "-background-color").value, y = e.pstyle("pie-" + f + "-background-opacity").value * r, g = p / 100; g + d > 1 && (g = 1 - d); var v = 1.5 * Math.PI + 2 * Math.PI * d, x = 2 * Math.PI * g, w = v + x; p === 0 || d >= 1 || d + g > 1 || (t.beginPath(), t.moveTo(o, s), t.arc(o, s, u, v, w), t.closePath(), this.colorFillStyle(t, m[0], m[1], m[2], y), t.fill(), d += g); } }; var hn = {}, sq = 100; hn.getPixelRatio = function() { var t = this.data.contexts[0]; if (this.forcedPixelRatio != null) return this.forcedPixelRatio; var e = this.cy.window(), r = t.backingStorePixelRatio || t.webkitBackingStorePixelRatio || t.mozBackingStorePixelRatio || t.msBackingStorePixelRatio || t.oBackingStorePixelRatio || t.backingStorePixelRatio || 1; return (e.devicePixelRatio || 1) / r; }; hn.paintCache = function(t) { for (var e = this.paintCaches = this.paintCaches || [], r = !0, i, n = 0; n < e.length; n++) if (i = e[n], i.context === t) { r = !1; break; } return r && (i = { context: t }, e.push(i)), i; }; hn.createGradientStyleFor = function(t, e, r, i, n) { var a, o = this.usePaths(), s = r.pstyle(e + "-gradient-stop-colors").value, c = r.pstyle(e + "-gradient-stop-positions").pfValue; if (i === "radial-gradient") if (r.isEdge()) { var l = r.sourceEndpoint(), u = r.targetEndpoint(), d = r.midpoint(), h = _l(l, d), f = _l(u, d); a = t.createRadialGradient(d.x, d.y, 0, d.x, d.y, Math.max(h, f)); } else { var p = o ? { x: 0, y: 0 } : r.position(), m = r.paddedWidth(), y = r.paddedHeight(); a = t.createRadialGradient(p.x, p.y, 0, p.x, p.y, Math.max(m, y)); } else if (r.isEdge()) { var g = r.sourceEndpoint(), v = r.targetEndpoint(); a = t.createLinearGradient(g.x, g.y, v.x, v.y); } else { var x = o ? { x: 0, y: 0 } : r.position(), w = r.paddedWidth(), S = r.paddedHeight(), _ = w / 2, b = S / 2, T = r.pstyle("background-gradient-direction").value; switch (T) { case "to-bottom": a = t.createLinearGradient(x.x, x.y - b, x.x, x.y + b); break; case "to-top": a = t.createLinearGradient(x.x, x.y + b, x.x, x.y - b); break; case "to-left": a = t.createLinearGradient(x.x + _, x.y, x.x - _, x.y); break; case "to-right": a = t.createLinearGradient(x.x - _, x.y, x.x + _, x.y); break; case "to-bottom-right": case "to-right-bottom": a = t.createLinearGradient(x.x - _, x.y - b, x.x + _, x.y + b); break; case "to-top-right": case "to-right-top": a = t.createLinearGradient(x.x - _, x.y + b, x.x + _, x.y - b); break; case "to-bottom-left": case "to-left-bottom": a = t.createLinearGradient(x.x + _, x.y - b, x.x - _, x.y + b); break; case "to-top-left": case "to-left-top": a = t.createLinearGradient(x.x + _, x.y + b, x.x - _, x.y - b); break; } } if (!a) return null; for (var E = c.length === s.length, C = s.length, L = 0; L < C; L++) a.addColorStop(E ? c[L] : L / (C - 1), "rgba(" + s[L][0] + "," + s[L][1] + "," + s[L][2] + "," + n + ")"); return a; }; hn.gradientFillStyle = function(t, e, r, i) { var n = this.createGradientStyleFor(t, "background", e, r, i); if (!n) return null; t.fillStyle = n; }; hn.colorFillStyle = function(t, e, r, i, n) { t.fillStyle = "rgba(" + e + "," + r + "," + i + "," + n + ")"; }; hn.eleFillStyle = function(t, e, r) { var i = e.pstyle("background-fill").value; if (i === "linear-gradient" || i === "radial-gradient") this.gradientFillStyle(t, e, i, r); else { var n = e.pstyle("background-color").value; this.colorFillStyle(t, n[0], n[1], n[2], r); } }; hn.gradientStrokeStyle = function(t, e, r, i) { var n = this.createGradientStyleFor(t, "line", e, r, i); if (!n) return null; t.strokeStyle = n; }; hn.colorStrokeStyle = function(t, e, r, i, n) { t.strokeStyle = "rgba(" + e + "," + r + "," + i + "," + n + ")"; }; hn.eleStrokeStyle = function(t, e, r) { var i = e.pstyle("line-fill").value; if (i === "linear-gradient" || i === "radial-gradient") this.gradientStrokeStyle(t, e, i, r); else { var n = e.pstyle("line-color").value; this.colorStrokeStyle(t, n[0], n[1], n[2], r); } }; hn.matchCanvasSize = function(t) { var e = this, r = e.data, i = e.findContainerClientCoords(), n = i[2], a = i[3], o = e.getPixelRatio(), s = e.motionBlurPxRatio; (t === e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE] || t === e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG]) && (o = s); var c = n * o, l = a * o, u; if (!(c === e.canvasWidth && l === e.canvasHeight)) { e.fontCaches = null; var d = r.canvasContainer; d.style.width = n + "px", d.style.height = a + "px"; for (var h = 0; h < e.CANVAS_LAYERS; h++) u = r.canvases[h], u.width = c, u.height = l, u.style.width = n + "px", u.style.height = a + "px"; for (var h = 0; h < e.BUFFER_COUNT; h++) u = r.bufferCanvases[h], u.width = c, u.height = l, u.style.width = n + "px", u.style.height = a + "px"; e.textureMult = 1, o <= 1 && (u = r.bufferCanvases[e.TEXTURE_BUFFER], e.textureMult = 2, u.width = c * e.textureMult, u.height = l * e.textureMult), e.canvasWidth = c, e.canvasHeight = l; } }; hn.renderTo = function(t, e, r, i) { this.render({ forcedContext: t, forcedZoom: e, forcedPan: r, drawAllLayers: !0, forcedPxRatio: i }); }; hn.render = function(t) { t = t || PA(); var e = t.forcedContext, r = t.drawAllLayers, i = t.drawOnlyNodeLayer, n = t.forcedZoom, a = t.forcedPan, o = this, s = t.forcedPxRatio === void 0 ? this.getPixelRatio() : t.forcedPxRatio, c = o.cy, l = o.data, u = l.canvasNeedsRedraw, d = o.textureOnViewport && !e && (o.pinching || o.hoverData.dragging || o.swipePanning || o.data.wheelZooming), h = t.motionBlur !== void 0 ? t.motionBlur : o.motionBlur, f = o.motionBlurPxRatio, p = c.hasCompoundNodes(), m = o.hoverData.draggingEles, y = !!(o.hoverData.selecting || o.touchData.selecting); h = h && !e && o.motionBlurEnabled && !y; var g = h; e || (o.prevPxRatio !== s && (o.invalidateContainerClientCoordsCache(), o.matchCanvasSize(o.container), o.redrawHint("eles", !0), o.redrawHint("drag", !0)), o.prevPxRatio = s), !e && o.motionBlurTimeout && clearTimeout(o.motionBlurTimeout), h && (o.mbFrames == null && (o.mbFrames = 0), o.mbFrames++, o.mbFrames < 3 && (g = !1), o.mbFrames > o.minMbLowQualFrames && (o.motionBlurPxRatio = o.mbPxRBlurry)), o.clearingMotionBlur && (o.motionBlurPxRatio = 1), o.textureDrawLastFrame && !d && (u[o.NODE] = !0, u[o.SELECT_BOX] = !0); var v = c.style(), x = c.zoom(), w = n !== void 0 ? n : x, S = c.pan(), _ = { x: S.x, y: S.y }, b = { zoom: x, pan: { x: S.x, y: S.y } }, T = o.prevViewport, E = T === void 0 || b.zoom !== T.zoom || b.pan.x !== T.pan.x || b.pan.y !== T.pan.y; !E && !(m && !p) && (o.motionBlurPxRatio = 1), a && (_ = a), w *= s, _.x *= s, _.y *= s; var C = o.getCachedZSortedEles(); function L($, J, ne, j, q) { var ge = $.globalCompositeOperation; $.globalCompositeOperation = "destination-out", o.colorFillStyle($, 255, 255, 255, o.motionBlurTransparency), $.fillRect(J, ne, j, q), $.globalCompositeOperation = ge; } function A($, J) { var ne, j, q, ge; !o.clearingMotionBlur && ($ === l.bufferContexts[o.MOTIONBLUR_BUFFER_NODE] || $ === l.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]) ? (ne = { x: S.x * f, y: S.y * f }, j = x * f, q = o.canvasWidth * f, ge = o.canvasHeight * f) : (ne = _, j = w, q = o.canvasWidth, ge = o.canvasHeight), $.setTransform(1, 0, 0, 1, 0, 0), J === "motionBlur" ? L($, 0, 0, q, ge) : !e && (J === void 0 || J) && $.clearRect(0, 0, q, ge), r || ($.translate(ne.x, ne.y), $.scale(j, j)), a && $.translate(a.x, a.y), n && $.scale(n, n); } if (d || (o.textureDrawLastFrame = !1), d) { if (o.textureDrawLastFrame = !0, !o.textureCache) { o.textureCache = {}, o.textureCache.bb = c.mutableElements().boundingBox(), o.textureCache.texture = o.data.bufferCanvases[o.TEXTURE_BUFFER]; var k = o.data.bufferContexts[o.TEXTURE_BUFFER]; k.setTransform(1, 0, 0, 1, 0, 0), k.clearRect(0, 0, o.canvasWidth * o.textureMult, o.canvasHeight * o.textureMult), o.render({ forcedContext: k, drawOnlyNodeLayer: !0, forcedPxRatio: s * o.textureMult }); var b = o.textureCache.viewport = { zoom: c.zoom(), pan: c.pan(), width: o.canvasWidth, height: o.canvasHeight }; b.mpan = { x: (0 - b.pan.x) / b.zoom, y: (0 - b.pan.y) / b.zoom }; } u[o.DRAG] = !1, u[o.NODE] = !1; var P = l.contexts[o.NODE], R = o.textureCache.texture, b = o.textureCache.viewport; P.setTransform(1, 0, 0, 1, 0, 0), h ? L(P, 0, 0, b.width, b.height) : P.clearRect(0, 0, b.width, b.height); var M = v.core("outside-texture-bg-color").value, O = v.core("outside-texture-bg-opacity").value; o.colorFillStyle(P, M[0], M[1], M[2], O), P.fillRect(0, 0, b.width, b.height); var x = c.zoom(); A(P, !1), P.clearRect(b.mpan.x, b.mpan.y, b.width / b.zoom / s, b.height / b.zoom / s), P.drawImage(R, b.mpan.x, b.mpan.y, b.width / b.zoom / s, b.height / b.zoom / s); } else o.textureOnViewport && !e && (o.textureCache = null); var D = c.extent(), I = o.pinching || o.hoverData.dragging || o.swipePanning || o.data.wheelZooming || o.hoverData.draggingEles || o.cy.animated(), F = o.hideEdgesOnViewport && I, z = []; if (z[o.NODE] = !u[o.NODE] && h && !o.clearedForMotionBlur[o.NODE] || o.clearingMotionBlur, z[o.NODE] && (o.clearedForMotionBlur[o.NODE] = !0), z[o.DRAG] = !u[o.DRAG] && h && !o.clearedForMotionBlur[o.DRAG] || o.clearingMotionBlur, z[o.DRAG] && (o.clearedForMotionBlur[o.DRAG] = !0), u[o.NODE] || r || i || z[o.NODE]) { var U = h && !z[o.NODE] && f !== 1, P = e || (U ? o.data.bufferContexts[o.MOTIONBLUR_BUFFER_NODE] : l.contexts[o.NODE]), Z = h && !U ? "motionBlur" : void 0; A(P, Z), F ? o.drawCachedNodes(P, C.nondrag, s, D) : o.drawLayeredElements(P, C.nondrag, s, D), o.debug && o.drawDebugPoints(P, C.nondrag), !r && !h && (u[o.NODE] = !1); } if (!i && (u[o.DRAG] || r || z[o.DRAG])) { var U = h && !z[o.DRAG] && f !== 1, P = e || (U ? o.data.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG] : l.contexts[o.DRAG]); A(P, h && !U ? "motionBlur" : void 0), F ? o.drawCachedNodes(P, C.drag, s, D) : o.drawCachedElements(P, C.drag, s, D), o.debug && o.drawDebugPoints(P, C.drag), !r && !h && (u[o.DRAG] = !1); } if (o.showFps || !i && u[o.SELECT_BOX] && !r) { var P = e || l.contexts[o.SELECT_BOX]; if (A(P), o.selection[4] == 1 && (o.hoverData.selecting || o.touchData.selecting)) { var x = o.cy.zoom(), re = v.core("selection-box-border-width").value / x; P.lineWidth = re, P.fillStyle = "rgba(" + v.core("selection-box-color").value[0] + "," + v.core("selection-box-color").value[1] + "," + v.core("selection-box-color").value[2] + "," + v.core("selection-box-opacity").value + ")", P.fillRect(o.selection[0], o.selection[1], o.selection[2] - o.selection[0], o.selection[3] - o.selection[1]), re > 0 && (P.strokeStyle = "rgba(" + v.core("selection-box-border-color").value[0] + "," + v.core("selection-box-border-color").value[1] + "," + v.core("selection-box-border-color").value[2] + "," + v.core("selection-box-opacity").value + ")", P.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 x = o.cy.zoom(), K = l.bgActivePosistion; P.fillStyle = "rgba(" + v.core("active-bg-color").value[0] + "," + v.core("active-bg-color").value[1] + "," + v.core("active-bg-color").value[2] + "," + v.core("active-bg-opacity").value + ")", P.beginPath(), P.arc(K.x, K.y, v.core("active-bg-size").pfValue / x, 0, 2 * Math.PI), P.fill(); } var V = o.lastRedrawTime; if (o.showFps && V) { V = Math.round(V); var H = Math.round(1e3 / V); P.setTransform(1, 0, 0, 1, 0, 0), P.fillStyle = "rgba(255, 0, 0, 0.75)", P.strokeStyle = "rgba(255, 0, 0, 0.75)", P.lineWidth = 1, P.fillText("1 frame = " + V + " ms = " + H + " fps", 0, 20); var G = 60; P.strokeRect(0, 30, 250, 20), P.fillRect(0, 30, 250 * Math.min(H / G, 1), 20); } r || (u[o.SELECT_BOX] = !1); } if (h && f !== 1) { var W = l.contexts[o.NODE], Y = o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_NODE], X = l.contexts[o.DRAG], ie = o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_DRAG], ue = function($, J, ne) { $.setTransform(1, 0, 0, 1, 0, 0), ne || !g ? $.clearRect(0, 0, o.canvasWidth, o.canvasHeight) : L($, 0, 0, o.canvasWidth, o.canvasHeight); var j = f; $.drawImage( J, // img 0, 0, // sx, sy o.canvasWidth * j, o.canvasHeight * j, // sw, sh 0, 0, // x, y o.canvasWidth, o.canvasHeight // w, h ); }; (u[o.NODE] || z[o.NODE]) && (ue(W, Y, z[o.NODE]), u[o.NODE] = !1), (u[o.DRAG] || z[o.DRAG]) && (ue(X, ie, z[o.DRAG]), u[o.DRAG] = !1); } o.prevViewport = b, o.clearingMotionBlur && (o.clearingMotionBlur = !1, o.motionBlurCleared = !0, o.motionBlur = !0), h && (o.motionBlurTimeout = setTimeout(function() { o.motionBlurTimeout = null, o.clearedForMotionBlur[o.NODE] = !1, o.clearedForMotionBlur[o.DRAG] = !1, o.motionBlur = !1, o.clearingMotionBlur = !d, o.mbFrames = 0, u[o.NODE] = !0, u[o.DRAG] = !0, o.redraw(); }, sq)), e || c.emit("render"); }; var Ls = {}; Ls.drawPolygonPath = function(t, e, r, i, n, a) { var o = i / 2, s = n / 2; t.beginPath && t.beginPath(), t.moveTo(e + o * a[0], r + s * a[1]); for (var c = 1; c < a.length / 2; c++) t.lineTo(e + o * a[c * 2], r + s * a[c * 2 + 1]); t.closePath(); }; Ls.drawRoundPolygonPath = function(t, e, r, i, n, a, o) { o.forEach(function(s) { return L3(t, s); }), t.closePath(); }; Ls.drawRoundRectanglePath = function(t, e, r, i, n, a) { var o = i / 2, s = n / 2, c = a === "auto" ? Sl(i, n) : Math.min(a, s, o); t.beginPath && t.beginPath(), t.moveTo(e, r - s), t.arcTo(e + o, r - s, e + o, r, c), t.arcTo(e + o, r + s, e, r + s, c), t.arcTo(e - o, r + s, e - o, r, c), t.arcTo(e - o, r - s, e, r - s, c), t.lineTo(e, r - s), t.closePath(); }; Ls.drawBottomRoundRectanglePath = function(t, e, r, i, n, a) { var o = i / 2, s = n / 2, c = a === "auto" ? Sl(i, n) : a; t.beginPath && t.beginPath(), t.moveTo(e, r - s), t.lineTo(e + o, r - s), t.lineTo(e + o, r), t.arcTo(e + o, r + s, e, r + s, c), t.arcTo(e - o, r + s, e - o, r, c), t.lineTo(e - o, r - s), t.lineTo(e, r - s), t.closePath(); }; Ls.drawCutRectanglePath = function(t, e, r, i, n, a, o) { var s = i / 2, c = n / 2, l = o === "auto" ? Ib() : o; t.beginPath && t.beginPath(), t.moveTo(e - s + l, r - c), t.lineTo(e + s - l, r - c), t.lineTo(e + s, r - c + l), t.lineTo(e + s, r + c - l), t.lineTo(e + s - l, r + c), t.lineTo(e - s + l, r + c), t.lineTo(e - s, r + c - l), t.lineTo(e - s, r - c + l), t.closePath(); }; Ls.drawBarrelPath = function(t, e, r, i, n) { var a = i / 2, o = n / 2, s = e - a, c = e + a, l = r - o, u = r + o, d = My(i, n), h = d.widthOffset, f = d.heightOffset, p = d.ctrlPtOffsetPct * h; t.beginPath && t.beginPath(), t.moveTo(s, l + f), t.lineTo(s, u - f), t.quadraticCurveTo(s + p, u, s + h, u), t.lineTo(c - h, u), t.quadraticCurveTo(c - p, u, c, u - f), t.lineTo(c, l + f), t.quadraticCurveTo(c - p, l, c - h, l), t.lineTo(s + h, l), t.quadraticCurveTo(s + p, l, s, l + f), t.closePath(); }; var oS = Math.sin(0), sS = Math.cos(0), Ny = {}, By = {}, U3 = Math.PI / 40; for (var ac = 0 * Math.PI; ac < 2 * Math.PI; ac += U3) Ny[ac] = Math.sin(ac), By[ac] = Math.cos(ac); Ls.drawEllipsePath = function(t, e, r, i, n) { if (t.beginPath && t.beginPath(), t.ellipse) t.ellipse(e, r, i / 2, n / 2, 0, 0, 2 * Math.PI); else for (var a, o, s = i / 2, c = n / 2, l = 0 * Math.PI; l < 2 * Math.PI; l += U3) a = e - s * Ny[l] * oS + s * By[l] * sS, o = r + c * By[l] * oS + c * Ny[l] * sS, l === 0 ? t.moveTo(a, o) : t.lineTo(a, o); t.closePath(); }; var cp = {}; cp.createBuffer = function(t, e) { var r = document.createElement("canvas"); return r.width = t, r.height = e, [r, r.getContext("2d")]; }; cp.bufferCanvasImage = function(t) { var e = this.cy, r = e.mutableElements(), i = r.boundingBox(), n = this.findContainerClientCoords(), a = t.full ? Math.ceil(i.w) : n[2], o = t.full ? Math.ceil(i.h) : n[3], s = Xe(t.maxWidth) || Xe(t.maxHeight), c = this.getPixelRatio(), l = 1; if (t.scale !== void 0) a *= t.scale, o *= t.scale, l = t.scale; else if (s) { var u = 1 / 0, d = 1 / 0; Xe(t.maxWidth) && (u = l * t.maxWidth / a), Xe(t.maxHeight) && (d = l * t.maxHeight / o), l = Math.min(u, d), a *= l, o *= l; } s || (a *= c, o *= c, l *= c); var h = document.createElement("canvas"); h.width = a, h.height = o, h.style.width = a + "px", h.style.height = o + "px"; var f = h.getContext("2d"); if (a > 0 && o > 0) { f.clearRect(0, 0, a, o), f.globalCompositeOperation = "source-over"; var p = this.getCachedZSortedEles(); if (t.full) f.translate(-i.x1 * l, -i.y1 * l), f.scale(l, l), this.drawElements(f, p), f.scale(1 / l, 1 / l), f.translate(i.x1 * l, i.y1 * l); else { var m = e.pan(), y = { x: m.x * l, y: m.y * l }; l *= e.zoom(), f.translate(y.x, y.y), f.scale(l, l), this.drawElements(f, p), f.scale(1 / l, 1 / l), f.translate(-y.x, -y.y); } t.bg && (f.globalCompositeOperation = "destination-over", f.fillStyle = t.bg, f.rect(0, 0, a, o), f.fill()); } return h; }; function lq(t, e) { for (var r = atob(t), i = new ArrayBuffer(r.length), n = new Uint8Array(i), a = 0; a < r.length; a++) n[a] = r.charCodeAt(a); return new Blob([i], { type: e }); } function lS(t) { var e = t.indexOf(","); return t.substr(e + 1); } function j3(t, e, r) { var i = function() { return e.toDataURL(r, t.quality); }; switch (t.output) { case "blob-promise": return new Bu(function(n, a) { try { e.toBlob(function(o) { o != null ? n(o) : a(new Error("`canvas.toBlob()` sent a null value in its callback")); }, r, t.quality); } catch (o) { a(o); } }); case "blob": return lq(lS(i()), r); case "base64": return lS(i()); case "base64uri": default: return i(); } } cp.png = function(t) { return j3(t, this.bufferCanvasImage(t), "image/png"); }; cp.jpg = function(t) { return j3(t, this.bufferCanvasImage(t), "image/jpeg"); }; var H3 = {}; H3.nodeShapeImpl = function(t, e, r, i, n, a, o, s) { switch (t) { case "ellipse": return this.drawEllipsePath(e, r, i, n, a); case "polygon": return this.drawPolygonPath(e, r, i, n, a, o); case "round-polygon": return this.drawRoundPolygonPath(e, r, i, n, a, o, s); case "roundrectangle": case "round-rectangle": return this.drawRoundRectanglePath(e, r, i, n, a, s); case "cutrectangle": case "cut-rectangle": return this.drawCutRectanglePath(e, r, i, n, a, o, s); case "bottomroundrectangle": case "bottom-round-rectangle": return this.drawBottomRoundRectanglePath(e, r, i, n, a, s); case "barrel": return this.drawBarrelPath(e, r, i, n, a); } }; var cq = G3, jt = G3.prototype; jt.CANVAS_LAYERS = 3; jt.SELECT_BOX = 0; jt.DRAG = 1; jt.NODE = 2; jt.BUFFER_COUNT = 3; jt.TEXTURE_BUFFER = 0; jt.MOTIONBLUR_BUFFER_NODE = 1; jt.MOTIONBLUR_BUFFER_DRAG = 2; function G3(t) { var e = this, r = e.cy.window(), i = r.document; e.data = { canvases: new Array(jt.CANVAS_LAYERS), contexts: new Array(jt.CANVAS_LAYERS), canvasNeedsRedraw: new Array(jt.CANVAS_LAYERS), bufferCanvases: new Array(jt.BUFFER_COUNT), bufferContexts: new Array(jt.CANVAS_LAYERS) }; var n = "-webkit-tap-highlight-color", a = "rgba(0,0,0,0)"; e.data.canvasContainer = i.createElement("div"); var o = e.data.canvasContainer.style; e.data.canvasContainer.style[n] = a, o.position = "relative", o.zIndex = "0", o.overflow = "hidden"; var s = t.cy.container(); s.appendChild(e.data.canvasContainer), s.style[n] = a; var c = { "-webkit-user-select": "none", "-moz-user-select": "-moz-none", "user-select": "none", "-webkit-tap-highlight-color": "rgba(0,0,0,0)", "outline-style": "none" }; X8() && (c["-ms-touch-action"] = "none", c["touch-action"] = "none"); for (var l = 0; l < jt.CANVAS_LAYERS; l++) { var u = e.data.canvases[l] = i.createElement("canvas"); e.data.contexts[l] = u.getContext("2d"), Object.keys(c).forEach(function(G) { u.style[G] = c[G]; }), u.style.position = "absolute", u.setAttribute("data-id", "layer" + l), u.style.zIndex = String(jt.CANVAS_LAYERS - l), e.data.canvasContainer.appendChild(u), e.data.canvasNeedsRedraw[l] = !1; } e.data.topCanvas = e.data.canvases[0], e.data.canvases[jt.NODE].setAttribute("data-id", "layer" + jt.NODE + "-node"), e.data.canvases[jt.SELECT_BOX].setAttribute("data-id", "layer" + jt.SELECT_BOX + "-selectbox"), e.data.canvases[jt.DRAG].setAttribute("data-id", "layer" + jt.DRAG + "-drag"); for (var l = 0; l < jt.BUFFER_COUNT; l++) e.data.bufferCanvases[l] = i.createElement("canvas"), e.data.bufferContexts[l] = e.data.bufferCanvases[l].getContext("2d"), e.data.bufferCanvases[l].style.position = "absolute", e.data.bufferCanvases[l].setAttribute("data-id", "buffer" + l), e.data.bufferCanvases[l].style.zIndex = String(-l - 1), e.data.bufferCanvases[l].style.visibility = "hidden"; e.pathsEnabled = !0; var d = Yi(), h = function(G) { return { x: (G.x1 + G.x2) / 2, y: (G.y1 + G.y2) / 2 }; }, f = function(G) { return { x: -G.w / 2, y: -G.h / 2 }; }, p = function(G) { var W = G[0]._private, Y = W.oldBackgroundTimestamp === W.backgroundTimestamp; return !Y; }, m = function(G) { return G[0]._private.nodeKey; }, y = function(G) { return G[0]._private.labelStyleKey; }, g = function(G) { return G[0]._private.sourceLabelStyleKey; }, v = function(G) { return G[0]._private.targetLabelStyleKey; }, x = function(G, W, Y, X, ie) { return e.drawElement(G, W, Y, !1, !1, ie); }, w = function(G, W, Y, X, ie) { return e.drawElementText(G, W, Y, X, "main", ie); }, S = function(G, W, Y, X, ie) { return e.drawElementText(G, W, Y, X, "source", ie); }, _ = function(G, W, Y, X, ie) { return e.drawElementText(G, W, Y, X, "target", ie); }, b = function(G) { return G.boundingBox(), G[0]._private.bodyBounds; }, T = function(G) { return G.boundingBox(), G[0]._private.labelBounds.main || d; }, E = function(G) { return G.boundingBox(), G[0]._private.labelBounds.source || d; }, C = function(G) { return G.boundingBox(), G[0]._private.labelBounds.target || d; }, L = function(G, W) { return W; }, A = function(G) { return h(b(G)); }, k = function(G, W, Y) { var X = G ? G + "-" : ""; return { x: W.x + Y.pstyle(X + "text-margin-x").pfValue, y: W.y + Y.pstyle(X + "text-margin-y").pfValue }; }, P = function(G, W, Y) { var X = G[0]._private.rscratch; return { x: X[W], y: X[Y] }; }, R = function(G) { return k("", P(G, "labelX", "labelY"), G); }, M = function(G) { return k("source", P(G, "sourceLabelX", "sourceLabelY"), G); }, O = function(G) { return k("target", P(G, "targetLabelX", "targetLabelY"), G); }, D = function(G) { return f(b(G)); }, I = function(G) { return f(E(G)); }, F = function(G) { return f(C(G)); }, z = function(G) { var W = T(G), Y = f(T(G)); if (G.isNode()) { switch (G.pstyle("text-halign").value) { case "left": Y.x = -W.w; break; case "right": Y.x = 0; break; } switch (G.pstyle("text-valign").value) { case "top": Y.y = -W.h; break; case "bottom": Y.y = 0; break; } } return Y; }, U = e.data.eleTxrCache = new $d(e, { getKey: m, doesEleInvalidateKey: p, drawElement: x, getBoundingBox: b, getRotationPoint: A, getRotationOffset: D, allowEdgeTxrCaching: !1, allowParentTxrCaching: !1 }), Z = e.data.lblTxrCache = new $d(e, { getKey: y, drawElement: w, getBoundingBox: T, getRotationPoint: R, getRotationOffset: z, isVisible: L }), re = e.data.slbTxrCache = new $d(e, { getKey: g, drawElement: S, getBoundingBox: E, getRotationPoint: M, getRotationOffset: I, isVisible: L }), K = e.data.tlbTxrCache = new $d(e, { getKey: v, drawElement: _, getBoundingBox: C, getRotationPoint: O, getRotationOffset: F, isVisible: L }), V = e.data.lyrTxrCache = new F3(e); e.onUpdateEleCalcs(function(G, W) { U.invalidateElements(W), Z.invalidateElements(W), re.invalidateElements(W), K.invalidateElements(W), V.invalidateElements(W); for (var Y = 0; Y < W.length; Y++) { var X = W[Y]._private; X.oldBackgroundTimestamp = X.backgroundTimestamp; } }); var H = function(G) { for (var W = 0; W < G.length; W++) V.enqueueElementRefinement(G[W].ele); }; U.onDequeue(H), Z.onDequeue(H), re.onDequeue(H), K.onDequeue(H); } jt.redrawHint = function(t, e) { var r = this; switch (t) { case "eles": r.data.canvasNeedsRedraw[jt.NODE] = e; break; case "drag": r.data.canvasNeedsRedraw[jt.DRAG] = e; break; case "select": r.data.canvasNeedsRedraw[jt.SELECT_BOX] = e; break; } }; var uq = typeof Path2D < "u"; jt.path2dEnabled = function(t) { if (t === void 0) return this.pathsEnabled; this.pathsEnabled = !!t; }; jt.usePaths = function() { return uq && this.pathsEnabled; }; jt.setImgSmoothing = function(t, e) { t.imageSmoothingEnabled != null ? t.imageSmoothingEnabled = e : (t.webkitImageSmoothingEnabled = e, t.mozImageSmoothingEnabled = e, t.msImageSmoothingEnabled = e); }; jt.getImgSmoothing = function(t) { return t.imageSmoothingEnabled != null ? t.imageSmoothingEnabled : t.webkitImageSmoothingEnabled || t.mozImageSmoothingEnabled || t.msImageSmoothingEnabled; }; jt.makeOffscreenCanvas = function(t, e) { var r; if ((typeof OffscreenCanvas > "u" ? "undefined" : Zr(OffscreenCanvas)) !== "undefined") r = new OffscreenCanvas(t, e); else { var i = this.cy.window(), n = i.document; r = n.createElement("canvas"), r.width = t, r.height = e; } return r; }; [z3, Ta, mo, Zb, Ul, Gu, hn, Ls, cp, H3].forEach(function(t) { bt(jt, t); }); var dq = [{ name: "null", impl: T3 }, { name: "base", impl: N3 }, { name: "canvas", impl: cq }], hq = [{ type: "layout", extensions: y7 }, { type: "renderer", extensions: dq }], W3 = {}, q3 = {}; function X3(t, e, r) { var i = r, n = function(b) { Zt("Can not register `" + e + "` for `" + t + "` since `" + b + "` already exists in the prototype and can not be overridden"); }; if (t === "core") { if (zm.prototype[e]) return n(e); zm.prototype[e] = r; } else if (t === "collection") { if (mi.prototype[e]) return n(e); mi.prototype[e] = r; } else if (t === "layout") { for (var a = function(b) { this.options = b, r.call(this, b), Gt(this._private) || (this._private = {}), this._private.cy = b.cy, this._private.listeners = [], this.createEmitter(); }, o = a.prototype = Object.create(r.prototype), s = [], c = 0; c < s.length; c++) { var l = s[c]; 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 u = r.prototype.stop; o.stop = function() { var b = this.options; if (b && b.animate) { var T = this.animations; if (T) for (var E = 0; E < T.length; E++) T[E].stop(); } return u ? u.call(this) : this.emit("layoutstop"), this; }, o.destroy || (o.destroy = function() { return this; }), o.cy = function() { return this._private.cy; }; var d = function(b) { return b._private.cy; }, h = { addEventFields: function(b, T) { T.layout = b, T.cy = d(b), T.target = b; }, bubble: function() { return !0; }, parent: function(b) { return d(b); } }; bt(o, { createEmitter: function() { return this._private.emitter = new Og(h, this), this; }, emitter: function() { return this._private.emitter; }, on: function(b, T) { return this.emitter().on(b, T), this; }, one: function(b, T) { return this.emitter().one(b, T), this; }, once: function(b, T) { return this.emitter().one(b, T), this; }, removeListener: function(b, T) { return this.emitter().removeListener(b, T), this; }, removeAllListeners: function() { return this.emitter().removeAllListeners(), this; }, emit: function(b, T) { return this.emitter().emit(b, T), this; } }), Xt.eventAliasesOn(o), i = a; } else if (t === "renderer" && e !== "null" && e !== "base") { var f = Z3("renderer", "base"), p = f.prototype, m = r, y = r.prototype, g = function() { f.apply(this, arguments), m.apply(this, arguments); }, v = g.prototype; for (var x in p) { var w = p[x], S = y[x] != null; if (S) return n(x); v[x] = w; } for (var _ in y) v[_] = y[_]; p.clientFunctions.forEach(function(b) { v[b] = v[b] || function() { Tr("Renderer does not implement `renderer." + b + "()` on its prototype"); }; }), i = g; } else if (t === "__proto__" || t === "constructor" || t === "prototype") return Tr(t + " is an illegal type to be registered, possibly lead to prototype pollutions"); return wA({ map: W3, keys: [t, e], value: i }); } function Z3(t, e) { return _A({ map: W3, keys: [t, e] }); } function pq(t, e, r, i, n) { return wA({ map: q3, keys: [t, e, r, i], value: n }); } function fq(t, e, r, i) { return _A({ map: q3, keys: [t, e, r, i] }); } var mq = function() { if (arguments.length === 2) return Z3.apply(null, arguments); if (arguments.length === 3) return X3.apply(null, arguments); if (arguments.length === 4) return fq.apply(null, arguments); if (arguments.length === 5) return pq.apply(null, arguments); Tr("Invalid extension access syntax"); }; zm.prototype.extension = mq; hq.forEach(function(t) { t.extensions.forEach(function(e) { X3(t.type, e.name, e.impl); }); }); var gq = function t() { if (!(this instanceof t)) return new t(); this.length = 0; }, Tl = gq.prototype; Tl.instanceString = function() { return "stylesheet"; }; Tl.selector = function(t) { var e = this.length++; return this[e] = { selector: t, properties: [] }, this; }; Tl.css = function(t, e) { var r = this.length - 1; if (dt(t)) this[r].properties.push({ name: t, value: e }); else if (Gt(t)) for (var i = t, n = Object.keys(i), a = 0; a < n.length; a++) { var o = n[a], s = i[o]; if (s != null) { var c = Ti.properties[o] || Ti.properties[Sg(o)]; if (c != null) { var l = c.name, u = s; this[r].properties.push({ name: l, value: u }); } } } return this; }; Tl.style = Tl.css; Tl.generateStyle = function(t) { var e = new Ti(t); return this.appendToStyle(e); }; Tl.appendToStyle = function(t) { for (var e = 0; e < this.length; e++) { var r = this[e], i = r.selector, n = r.properties; t.selector(i); for (var a = 0; a < n.length; a++) { var o = n[a]; t.css(o.name, o.value); } } return t; }; const vq = function(t) { return t ? t.charAt(0).toUpperCase() + t.slice(1) : ""; }, yq = { name: "ConnectionDialog", props: { connectionEntry: { type: Object, default: {} }, inDrawing: { type: Boolean, default: !1 }, connectionExist: { type: Boolean, default: !1 } }, data: function() { return { tooltipId: void 0 }; }, methods: { shadowDisplay: function(t) { return this.tooltipId === t ? "always" : "hover"; }, capitalise: function(t) { return vq(t); }, handleTooltip: function(t) { this.tooltipId = this.tooltipId === t ? void 0 : t, this.$emit("featureTooltip", this.tooltipId); } } }, Yb = (t) => (Hh("data-v-8168ee98"), t = t(), Gh(), t), bq = { class: "dialog-container" }, xq = /* @__PURE__ */ Yb(() => /* @__PURE__ */ Ee("span", { class: "dialog-title" }, "Finalise drawing", -1)), wq = /* @__PURE__ */ Yb(() => /* @__PURE__ */ Ee("span", { class: "dialog-title" }, "Visualise connection", -1)), _q = /* @__PURE__ */ Yb(() => /* @__PURE__ */ Ee("b", null, [ /* @__PURE__ */ Ee("span", null, "Related Features") ], -1)); function Sq(t, e, r, i, n, a) { const o = us, s = J$, c = _g, l = Qh, u = i6; return Q(), be("div", bq, [ oe(c, null, { default: le(() => [ oe(l, null, { default: le(() => [ r.inDrawing ? (Q(), Re(c, { key: 0 }, { default: le(() => [ xq, oe(s, null, { default: le(() => [ oe(o, { type: "primary", plain: "", onClick: e[0] || (e[0] = (d) => t.$emit("confirmDrawn", !0)) }, { default: le(() => [ et(" Confirm ") ]), _: 1 }), oe(o, { type: "primary", plain: "", onClick: e[1] || (e[1] = (d) => t.$emit("cancelDrawn", !0)) }, { default: le(() => [ et(" Cancel ") ]), _: 1 }) ]), _: 1 }) ]), _: 1 })) : (Q(), Re(c, { key: 1 }, { default: le(() => [ wq, oe(o, { type: "primary", plain: "", onClick: e[2] || (e[2] = (d) => t.$emit("dialogDisplay", !1)) }, { default: le(() => [ et(" Close ") ]), _: 1 }) ]), _: 1 })) ]), _: 1 }) ]), _: 1 }), r.connectionExist ? (Q(), Re(c, { key: 0 }, { default: le(() => [ oe(l, null, { default: le(() => [ _q, (Q(!0), be(pt, null, ir(r.connectionEntry, (d, h) => (Q(), Re(c, { key: h }, { default: le(() => [ oe(u, { shadow: a.shadowDisplay(h), onClick: (f) => a.handleTooltip(h) }, { default: le(() => [ Ee("span", null, Ze(a.capitalise(d.label)), 1) ]), _: 2 }, 1032, ["shadow", "onClick"]) ]), _: 2 }, 1024))), 128)) ]), _: 1 }) ]), _: 1 })) : Pe("", !0) ]); } const Mq = /* @__PURE__ */ Cs(yq, [["render", Sq], ["__scopeId", "data-v-8168ee98"]]), Y3 = (t, e) => { const r = t.__vccOpts || t; for (const [i, n] of e) r[i] = n; return r; }, Eq = ["xlink:href"], Tq = { __name: "SvgIcon", props: { /** * The svg icon to show. */ icon: { type: String, required: !0 }, /** * The option to spin the icon. */ spin: { type: Boolean, default: !1 } }, setup(t) { return (e, r) => (Q(), be("svg", { class: xe(["map-icon", { "map-icon-spin": t.spin }]) }, [ Ee("use", { "xlink:href": `#${t.icon}` }, null, 8, Eq) ], 2)); } }, Cq = /* @__PURE__ */ Y3(Tq, [["__scopeId", "data-v-e172d5ff"]]), K3 = ` 2horpanel ? `, J3 = ` 2vertpanel ? `, Q3 = ` 3panel ? `, eL = ` 4panel ? `, tL = ` 2horpanel ? `, rL = ` 2horpanel ? `, iL = ` 4panel ? `, nL = ` changeBckgd `, aL = ` close no bk `, oL = ` close `, sL = ` closeFullScreen `, lL = ` Comment `, cL = ` Connection `, uL = ` dock `, dL = ` drawLine `, hL = ` drawPoint `, pL = ` drawPolygon `, fL = ` drawTrash `, mL = ` fitWindow `, gL = ` fullScreen `, vL = 'DataPortal-Icons', yL = ` magnifyingGlass `, bL = `Created by Wahyu Prihantorofrom the Noun Project`, xL = ` openMap `, wL = ` Artboard Copy 6 `, _L = ` permalink `, SL = ` play `, ML = ` resetZoom `, EL = ` singlepanel ? `, TL = ` tooltips ? `, CL = ` undock `, AL = ` zoomIn `, LL = ` zoomOut `, kL = (t, e, r, i) => { const n = ["title", "desc", "defs", "style"], a = ["width", "height"], o = i || []; let s = document.createElement("div"); s.innerHTML = t, n.map((l) => { const u = s.querySelector(l); u && u.remove(); }), a.map((l) => { s.querySelector("svg").removeAttribute(l); }), i && o.map((l) => { Object.values(s.querySelectorAll(`[${l}]`)).map((u) => { u.removeAttribute(l); }); }); const c = s.innerHTML; return s = null, c; }, PL = (t) => [ // 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), t).trim(), Aq = !0, Lq = !0, kq = ["fill"], cS = /* @__PURE__ */ Object.assign({ "/assets/icons/2horpanel.svg": K3, "/assets/icons/2vertpanel.svg": J3, "/assets/icons/3panel.svg": Q3, "/assets/icons/4panel.svg": eL, "/assets/icons/5panel.svg": tL, "/assets/icons/6panel.svg": rL, "/assets/icons/6panelVertical.svg": iL, "/assets/icons/changeBckgd.svg": nL, "/assets/icons/close-no-bk.svg": aL, "/assets/icons/close.svg": oL, "/assets/icons/closeFullScreen.svg": sL, "/assets/icons/comment.svg": lL, "/assets/icons/connection.svg": cL, "/assets/icons/dock.svg": uL, "/assets/icons/drawLine.svg": dL, "/assets/icons/drawPoint.svg": hL, "/assets/icons/drawPolygon.svg": pL, "/assets/icons/drawTrash.svg": fL, "/assets/icons/fitWindow.svg": mL, "/assets/icons/fullScreen.svg": gL, "/assets/icons/help.svg": vL, "/assets/icons/magnifyingGlass.svg": yL, "/assets/icons/noun-filter.svg": bL, "/assets/icons/openMap.svg": xL, "/assets/icons/pause.svg": wL, "/assets/icons/permalink.svg": _L, "/assets/icons/play.svg": SL, "/assets/icons/resetZoom.svg": ML, "/assets/icons/singlepanel.svg": EL, "/assets/icons/tooltips.svg": TL, "/assets/icons/undock.svg": CL, "/assets/icons/zoomIn.svg": AL, "/assets/icons/zoomOut.svg": LL }), Pq = Object.keys(cS).map((t) => { const e = kL(cS[t], Aq, Lq, kq), r = t.replace(/^.+\/(\w+).svg$/, "$1"); return PL(e).replace("", "symbol>"); }); Pq.join(` `); const Fy = /* @__PURE__ */ Object.assign({ "/assets/icons/2horpanel.svg": K3, "/assets/icons/2vertpanel.svg": J3, "/assets/icons/3panel.svg": Q3, "/assets/icons/4panel.svg": eL, "/assets/icons/5panel.svg": tL, "/assets/icons/6panel.svg": rL, "/assets/icons/6panelVertical.svg": iL, "/assets/icons/changeBckgd.svg": nL, "/assets/icons/close-no-bk.svg": aL, "/assets/icons/close.svg": oL, "/assets/icons/closeFullScreen.svg": sL, "/assets/icons/comment.svg": lL, "/assets/icons/connection.svg": cL, "/assets/icons/dock.svg": uL, "/assets/icons/drawLine.svg": dL, "/assets/icons/drawPoint.svg": hL, "/assets/icons/drawPolygon.svg": pL, "/assets/icons/drawTrash.svg": fL, "/assets/icons/fitWindow.svg": mL, "/assets/icons/fullScreen.svg": gL, "/assets/icons/help.svg": vL, "/assets/icons/magnifyingGlass.svg": yL, "/assets/icons/noun-filter.svg": bL, "/assets/icons/openMap.svg": xL, "/assets/icons/pause.svg": wL, "/assets/icons/permalink.svg": _L, "/assets/icons/play.svg": SL, "/assets/icons/resetZoom.svg": ML, "/assets/icons/singlepanel.svg": EL, "/assets/icons/tooltips.svg": TL, "/assets/icons/undock.svg": CL, "/assets/icons/zoomIn.svg": AL, "/assets/icons/zoomOut.svg": LL }), Rq = Object.keys(Fy).map((t) => { const e = kL(Fy[t]), r = t.replace(/^.+\/(\w+).svg$/, "$1"); return PL(e).replace("", "symbol>"); }), Oq = { name: "MapSvgSpriteColor", svgContext: Fy, svgSprite: Rq.join(` `) // concatenate all symbols into $options.svgSprite }, Dq = ["innerHTML"]; function Iq(t, e, r, i, n, a) { return Q(), be("svg", { width: "0", height: "0", style: { display: "none" }, innerHTML: t.$options.svgSprite }, null, 8, Dq); } const Nq = /* @__PURE__ */ Y3(Oq, [["render", Iq]]), Bq = (t, e) => { let r, i, n, a, o, s; e.style.left = "", e.style.top = "", e.addEventListener( "mousedown", (l) => { l.preventDefault(), r = e.offsetLeft, i = e.offsetTop, n = l.clientX, a = l.clientY, e.addEventListener("mousemove", c, !1), document.addEventListener( "mouseup", () => { e.removeEventListener("mousemove", c, !1); }, !1 ); }, !1 ); function c(l) { l.preventDefault(), o = r - (n - l.clientX), s = i - (a - l.clientY), e.style.left = `${o}px`, e.style.top = `${s}px`; } }, Fq = { name: "DrawToolbar", components: { MapSvgIcon: Cq, MapSvgSpriteColor: Nq }, props: { /** * Optional * * Associated with the Connection dialog. * This is needed to display the dialog and provides the additional drag capability to the dialog. * * e.g. * :mapCanvas="{ * containerHTML: appRef, // Reference to the map canvas container. * class: '.maplibregl-canvas', // CSS selector for the map canvas. * }" */ mapCanvas: { type: Object, default: void 0 }, /** * Array of toolbar options to display. * 'Connection' requires 'LineString' is included in the toolbar options. */ toolbarOptions: { type: Array, default: [ "Edit", "Delete", "Point", "LineString", "Polygon", "Connection" ] }, /** * Optional * * To update the toolbar icons or filter the features based on the tool type. * e.g. "All tools", "Point", "LineString", "Polygon" or "None". */ drawnType: { type: String, default: "All tools" }, activeDrawTool: { required: !0 }, activeDrawMode: { required: !0 }, /** * Optional * * Associated with the Connection dialog. * This will popup a dialog if new feature is drawn and map canvas exists. */ newlyDrawnEntry: { type: Object, default: {} }, /** * Optional * * Associated with the Connection dialog. * This will add entries to the dialog. */ connectionEntry: { type: Object, default: {} }, /** * Add following to the top hoverVisibilities array to enable tooltips for each icon. * [ * { value: false, refs: 'toolbarPopover', ref: 'editPopover' }, * { value: false, refs: 'toolbarPopover', ref: 'deletePopover' }, * { value: false, refs: 'toolbarPopover', ref: 'pointPopover' }, * { value: false, refs: 'toolbarPopover', ref: 'lineStringPopover' }, * { value: false, refs: 'toolbarPopover', ref: 'polygonPopover' }, * { value: false, refs: 'toolbarPopover', ref: 'connectionPopover' }, * ] */ hoverVisibilities: { type: Array, required: !0, default: [ { value: !1, ref: "editPopover" }, { value: !1, ref: "deletePopover" }, { value: !1, ref: "pointPopover" }, { value: !1, ref: "lineStringPopover" }, { value: !1, ref: "polygonPopover" }, { value: !1, ref: "connectionPopover" } ] } }, data: function() { return { toolbarIcons: [ { name: "Edit", active: !1, disabled: !1 }, { name: "Delete", active: !1, disabled: !1 }, { name: "Point", active: !1, disabled: !1 }, { name: "LineString", active: !1, disabled: !1 }, { name: "Polygon", active: !1, disabled: !1 }, { name: "Connection", active: !1, disabled: !0 } ], connectionDisplay: !1, dialogPosition: { offsetX: 0, offsetY: 0, x: void 0, y: void 0 } }; }, computed: { showAllToolIcons: function() { return this.drawnType === "All tools" || this.drawnType === "None"; }, showEditModeIcon: function() { return this.toolbarOptions.includes("Edit"); }, showDeleteModeIcon: function() { return this.toolbarOptions.includes("Delete"); }, showDrawPointIcon: function() { return this.toolbarOptions.includes("Point") && (this.showAllToolIcons || this.drawnType === "Point"); }, showDrawLineStringIcon: function() { return this.toolbarOptions.includes("LineString") && (this.showAllToolIcons || this.drawnType === "LineString"); }, showDrawPolygonIcon: function() { return this.toolbarOptions.includes("Polygon") && (this.showAllToolIcons || this.drawnType === "Polygon"); }, showConnectionIcon: function() { return this.toolbarOptions.includes("Connection") && this.toolbarOptions.includes("LineString") && (this.showAllToolIcons || this.drawnType === "LineString"); }, inDrawing: function() { return this.activeDrawTool !== void 0; }, newlyDrawnExist: function() { return Object.keys(this.newlyDrawnEntry).length > 0; }, connectionExist: function() { return Object.keys(this.connectionEntry).length > 0; } }, watch: { drawnType: function() { this.disabledToolbarConnectionIcon(!0); }, activeDrawMode: function(t) { this.updateToolbarIcons(t), t === "Delete" && (this.connectionDisplay = !1); }, activeDrawTool: function(t) { this.updateToolbarIcons(t), t || (this.connectionDisplay = !1); }, newlyDrawnExist: function(t) { t && (this.connectionDisplay = !0); }, connectionExist: function(t) { this.disabledToolbarConnectionIcon(!t), t || (this.connectionDisplay = !1); }, connectionDisplay: function(t) { this.activeToolbarConnectionIcon(t), t ? this.dialogCssHacks() : this.$emit("featureTooltip", void 0); }, dialogPosition: { handler: function() { const t = this.$el.getBoundingClientRect(); this.dialogPosition.offsetX = t.x, this.dialogPosition.offsetY = t.y; }, deep: !0, once: !0 } }, methods: { iconDisabled: function(t) { return this.toolbarIcons.filter((e) => e.name === t)[0].disabled; }, modeClickEvent: function(t) { if (!this.iconDisabled(t)) { const e = this.activeDrawMode === t ? void 0 : t; this.$emit("clickToolbar", "mode", e); } }, toolClickEvent: function(t) { if (!this.iconDisabled(t)) { const e = this.activeDrawTool === t ? void 0 : t; this.$emit("clickToolbar", "tool", e); } }, connectionClickEvent: function() { !this.iconDisabled("Connection") && !this.newlyDrawnExist && (this.connectionDisplay = !this.connectionDisplay); }, updateToolbarIcons: function(t) { this.toolbarIcons.map((e) => { e.name === t ? e.active = !0 : e.active = !1; }), this.toolbarIcons.filter((e) => e.name !== "Connection" && e.name !== t).map((e) => { t ? e.disabled = !0 : e.disabled = !1; }), this.toolbarCssHacks(); }, disabledToolbarConnectionIcon: function(t) { this.toolbarIcons.filter((e) => e.name === "Connection").map((e) => { t ? e.disabled = !0 : e.disabled = !1, this.activeDrawMode === "Delete" && (e.disabled = !0); }), this.toolbarCssHacks(); }, activeToolbarConnectionIcon: function(t) { this.toolbarIcons.filter((e) => e.name === "Connection").map((e) => { t ? e.active = !0 : e.active = !1; }), this.toolbarCssHacks(); }, toolbarCssHacks: function() { this.$nextTick(() => { this.toolbarIcons.map((t) => { const e = this.$el.querySelector(`.draw${t.name}`); e && (t.active ? e.classList.add("active") : e.classList.remove("active"), t.disabled ? e.classList.add("disabled") : e.classList.remove("disabled")); }); }); }, dialogCssHacks: function() { this.$nextTick(() => { const t = this.$el.querySelector(".connection-dialog"); Bq(this.mapCanvas.containerHTML, t); let e, r; const i = this.mapCanvas.containerHTML.getBoundingClientRect(), n = t.getBoundingClientRect(); this.dialogPosition.x > i.width / 2 ? e = this.dialogPosition.x - n.width : e = this.dialogPosition.x, this.dialogPosition.y > i.height / 2 ? r = this.dialogPosition.y - n.height : r = this.dialogPosition.y, t.style.transform = `translate(${e - this.dialogPosition.offsetX}px, ${r - this.dialogPosition.offsetY}px)`; }); }, hoverIndex: function(t) { return this.hoverVisibilities.findIndex((e) => e.ref === t); }, showTooltip: function(t) { this.$emit("showTooltip", t); }, hideTooltip: function(t) { this.$emit("hideTooltip", t); }, dialogPopUpPositionHandler: function(t) { t.preventDefault(), this.dialogPosition.x = t.clientX, this.dialogPosition.y = t.clientY, this.activeDrawTool === "Point" && this.dialogCssHacks(); } }, mounted: function() { this.$nextTick(() => { this.toolbarCssHacks(), this.mapCanvas && this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).addEventListener("click", this.dialogPopUpPositionHandler, !1); }); }, destroyed: function() { this.mapCanvas && this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).removeEventListener("click", this.dialogPopUpPositionHandler, !1); } }, zq = { class: "toolbar-container" }, $q = { class: "toolbar-icons" }; function Vq(t, e, r, i, n, a) { const o = qt("map-svg-sprite-color"), s = qt("map-svg-icon"), c = Mb, l = Mq; return Q(), be("div", zq, [ oe(o), Ee("div", $q, [ a.showEditModeIcon ? (Q(), Re(c, { key: 0, content: "Edit Mode", placement: "top", teleported: !1, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[a.hoverIndex("editPopover")].value, ref: "editPopover" }, { reference: le(() => [ oe(s, { icon: "comment", class: "icon-button drawEdit", onClick: e[0] || (e[0] = (u) => a.modeClickEvent("Edit")), onMouseover: e[1] || (e[1] = (u) => a.showTooltip(a.hoverIndex("editPopover"))), onMouseout: e[2] || (e[2] = (u) => a.hideTooltip(a.hoverIndex("editPopover"))) }) ]), _: 1 }, 8, ["visible"])) : Pe("", !0), a.showDeleteModeIcon ? (Q(), Re(c, { key: 1, content: "Delete Mode", placement: "top", teleported: !1, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[a.hoverIndex("deletePopover")].value, ref: "deletePopover" }, { reference: le(() => [ oe(s, { icon: "drawTrash", class: "icon-button drawDelete", onClick: e[3] || (e[3] = (u) => a.modeClickEvent("Delete")), onMouseover: e[4] || (e[4] = (u) => a.showTooltip(a.hoverIndex("deletePopover"))), onMouseout: e[5] || (e[5] = (u) => a.hideTooltip(a.hoverIndex("deletePopover"))) }) ]), _: 1 }, 8, ["visible"])) : Pe("", !0), a.showDrawPointIcon ? (Q(), Re(c, { key: 2, content: "Draw Point", placement: "top", teleported: !1, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[a.hoverIndex("pointPopover")].value, ref: "pointPopover" }, { reference: le(() => [ oe(s, { icon: "drawPoint", class: "icon-button drawPoint", onClick: e[6] || (e[6] = (u) => a.toolClickEvent("Point")), onMouseover: e[7] || (e[7] = (u) => a.showTooltip(a.hoverIndex("pointPopover"))), onMouseout: e[8] || (e[8] = (u) => a.hideTooltip(a.hoverIndex("pointPopover"))) }) ]), _: 1 }, 8, ["visible"])) : Pe("", !0), a.showDrawLineStringIcon ? (Q(), Re(c, { key: 3, content: "Draw LineString", placement: "top", teleported: !1, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[a.hoverIndex("lineStringPopover")].value, ref: "drawLinePopover" }, { reference: le(() => [ oe(s, { icon: "drawLine", class: "icon-button drawLineString", onClick: e[9] || (e[9] = (u) => a.toolClickEvent("LineString")), onMouseover: e[10] || (e[10] = (u) => a.showTooltip(a.hoverIndex("lineStringPopover"))), onMouseout: e[11] || (e[11] = (u) => a.hideTooltip(a.hoverIndex("lineStringPopover"))) }) ]), _: 1 }, 8, ["visible"])) : Pe("", !0), a.showDrawPolygonIcon ? (Q(), Re(c, { key: 4, content: "Draw Polygon", placement: "top", teleported: !1, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[a.hoverIndex("polygonPopover")].value, ref: "polygonPopover" }, { reference: le(() => [ oe(s, { icon: "drawPolygon", class: "icon-button drawPolygon", onClick: e[12] || (e[12] = (u) => a.toolClickEvent("Polygon")), onMouseover: e[13] || (e[13] = (u) => a.showTooltip(a.hoverIndex("polygonPopover"))), onMouseout: e[14] || (e[14] = (u) => a.hideTooltip(a.hoverIndex("polygonPopover"))) }) ]), _: 1 }, 8, ["visible"])) : Pe("", !0), a.showConnectionIcon ? (Q(), Re(c, { key: 5, content: "Connectivity", placement: "top", teleported: !1, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[a.hoverIndex("connectionPopover")].value, ref: "connectionPopover" }, { reference: le(() => [ oe(s, { icon: "connection", class: "icon-button drawConnection", onClick: e[15] || (e[15] = (u) => a.connectionClickEvent()), onMouseover: e[16] || (e[16] = (u) => a.showTooltip(a.hoverIndex("connectionPopover"))), onMouseout: e[17] || (e[17] = (u) => a.hideTooltip(a.hoverIndex("connectionPopover"))) }) ]), _: 1 }, 8, ["visible"])) : Pe("", !0) ]), r.mapCanvas ? ht((Q(), Re(l, { key: 0, class: "connection-dialog", connectionEntry: r.connectionEntry, inDrawing: a.inDrawing, connectionExist: a.connectionExist, onDialogDisplay: e[18] || (e[18] = (u) => a.connectionClickEvent()), onConfirmDrawn: e[19] || (e[19] = (u) => t.$emit("confirmDrawn", u)), onCancelDrawn: e[20] || (e[20] = (u) => t.$emit("cancelDrawn", u)), onFeatureTooltip: e[21] || (e[21] = (u) => t.$emit("featureTooltip", u)) }, null, 8, ["connectionEntry", "inDrawing", "connectionExist"])), [ [Ot, t.connectionDisplay] ]) : Pe("", !0) ]); } const Uq = /* @__PURE__ */ Cs(Fq, [["render", Vq], ["__scopeId", "data-v-6ac1a744"]]); function jq(t) { return { all: t = t || /* @__PURE__ */ new Map(), on: function(e, r) { var i = t.get(e); i ? i.push(r) : t.set(e, [r]); }, off: function(e, r) { var i = t.get(e); i && (r ? i.splice(i.indexOf(r) >>> 0, 1) : t.set(e, [])); }, emit: function(e, r) { var i = t.get(e); i && i.slice().map(function(n) { n(r); }), (i = t.get("*")) && i.slice().map(function(n) { n(e, r); }); } }; } const Yd = new jq(), Hq = { name: "ExternalResourceCard", props: { resources: { type: Array, default: () => [] } }, data: function() { return { pubmeds: [], pubmedIds: [], ElIconNotebook: mr(uB) }; }, methods: { capitalise: function(t) { return t.charAt(0).toUpperCase() + t.slice(1); }, openUrl: function(t) { Yd.emit("open-pubmed-url", t), window.open(t, "_blank"); } } }, Gq = { class: "resource-container" }; function Wq(t, e, r, i, n, a) { const o = us; return Q(), be("div", Gq, [ (Q(!0), be(pt, null, ir(r.resources, (s) => (Q(), be("div", { key: s.id, class: "resource" }, [ s.id === "pubmed" ? (Q(), Re(o, { key: 0, class: "button", id: "open-pubmed-button", icon: t.ElIconNotebook, onClick: (c) => a.openUrl(s.url) }, { default: le(() => [ et(" Open publications in PubMed ") ]), _: 2 }, 1032, ["icon", "onClick"])) : Pe("", !0) ]))), 128)) ]); } const qq = /* @__PURE__ */ Cs(Hq, [["render", Wq], ["__scopeId", "data-v-4f8d8b0f"]]), Xq = (t) => t.replace(/\w\S*/g, (e) => e.charAt(0).toUpperCase() + e.substr(1).toLowerCase()), Zq = function(t) { return t ? t.charAt(0).toUpperCase() + t.slice(1) : ""; }, Yq = { 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: !1, showToolip: !1, showDetails: !1, originDescriptions: { motor: "is the location of the initial cell body of the circuit", sensory: "is the location of the initial cell body in the PNS circuit" }, componentsWithDatasets: [], uberons: [{ id: void 0, name: void 0 }] }; }, computed: { featuresAlert() { return this.getFeaturesAlert(); }, resources: function() { let t = []; return this.tooltipEntry && this.tooltipEntry.hyperlinks && (t = this.tooltipEntry.hyperlinks), t; }, originDescription: function() { return this.tooltipEntry && this.tooltipEntry.title && this.tooltipEntry.title.toLowerCase().includes("motor") ? this.originDescriptions.motor : this.originDescriptions.sensory; }, provSpeciesDescription: function() { let t = "Studied in"; return this.tooltipEntry.provenanceTaxonomyLabel.forEach((e) => { t += ` ${e},`; }), t = t.slice(0, -1), t += " species", t; } }, methods: { titleCase: function(t) { return Xq(t); }, capitalise: function(t) { return Zq(t); }, openUrl: function(t) { window.open(t, "_blank"); }, openAll: function() { Yd.emit("onActionClick", { type: "Facets", labels: this.tooltipEntry.componentsWithDatasets.map((t) => t.name) }); }, openAxons: function() { Yd.emit("onActionClick", { type: "Facets", labels: this.tooltipEntry.destinationsWithDatasets.map((t) => t.name) }); }, openDendrites: function() { Yd.emit("onActionClick", { type: "Facets", labels: this.tooltipEntry.originsWithDatasets.map((t) => t.name) }); }, pubmedSearchUrlUpdate: function(t) { this.pubmedSearchUrl = t; } } }, Wu = (t) => (Hh("data-v-ef9a0f6d"), t = t(), Gh(), t), Kq = { key: 0, class: "main" }, Jq = { key: 0, class: "block" }, Qq = { class: "title" }, eX = { key: 0, class: "subtitle" }, tX = { key: 1, class: "block" }, rX = { class: "title" }, iX = { key: 2, class: "attribute-title-container" }, nX = /* @__PURE__ */ Wu(() => /* @__PURE__ */ Ee("span", { class: "attribute-title" }, "Alert", -1)), aX = { style: { "word-break": "keep-all" } }, oX = { class: "content-container scrollbar" }, sX = { key: 0, class: "block" }, lX = { class: "attribute-title-container" }, cX = /* @__PURE__ */ Wu(() => /* @__PURE__ */ Ee("span", { class: "attribute-title" }, "Origin", -1)), uX = { style: { "word-break": "keep-all" } }, dX = /* @__PURE__ */ Wu(() => /* @__PURE__ */ Ee("i", null, "Origin", -1)), hX = ["origin-item-label"], pX = { key: 0, class: "separator" }, fX = { key: 1, class: "block" }, mX = /* @__PURE__ */ Wu(() => /* @__PURE__ */ Ee("div", { class: "attribute-title-container" }, [ /* @__PURE__ */ Ee("div", { class: "attribute-title" }, "Components") ], -1)), gX = ["component-item-label"], vX = { key: 0, class: "separator" }, yX = { key: 2, class: "block" }, bX = { class: "attribute-title-container" }, xX = /* @__PURE__ */ Wu(() => /* @__PURE__ */ Ee("span", { class: "attribute-title" }, "Destination", -1)), wX = /* @__PURE__ */ Wu(() => /* @__PURE__ */ Ee("span", { style: { "word-break": "keep-all" } }, [ /* @__PURE__ */ Ee("i", null, "Destination"), /* @__PURE__ */ et(" is where the axons terminate ") ], -1)), _X = ["destination-item-label"], SX = { key: 0, class: "separator" }; function MX(t, e, r, i, n, a) { const o = fB, s = Oi, c = Mb, l = uC, u = gg, d = us, h = qq, f = hA; return r.tooltipEntry ? ht((Q(), be("div", Kq, [ r.tooltipEntry.title ? (Q(), be("div", Jq, [ Ee("div", Qq, Ze(a.capitalise(r.tooltipEntry.title)), 1), r.tooltipEntry.provenanceTaxonomyLabel && r.tooltipEntry.provenanceTaxonomyLabel.length > 0 ? (Q(), be("div", eX, Ze(a.provSpeciesDescription), 1)) : Pe("", !0) ])) : (Q(), be("div", tX, [ Ee("div", rX, Ze(r.tooltipEntry.featureId), 1) ])), a.featuresAlert ? (Q(), be("div", iX, [ nX, oe(c, { width: "250", trigger: "hover", teleported: !1, "popper-class": "popover-origin-help" }, { reference: le(() => [ oe(s, { class: "info" }, { default: le(() => [ oe(o) ]), _: 1 }) ]), default: le(() => [ Ee("span", aX, Ze(a.featuresAlert), 1) ]), _: 1 }) ])) : Pe("", !0), ht(Ee("div", { class: "hide", id: "hide-path-info", onClick: e[0] || (e[0] = (p) => t.showDetails = !1) }, [ et(" Hide path information "), oe(s, null, { default: le(() => [ oe(l) ]), _: 1 }) ], 512), [ [Ot, t.showDetails] ]), ht(Ee("div", { class: "hide", id: "show-path-info", onClick: e[1] || (e[1] = (p) => t.showDetails = !0) }, [ et(" Show path information "), oe(s, null, { default: le(() => [ oe(u) ]), _: 1 }) ], 512), [ [Ot, !t.showDetails] ]), oe(Zn, { name: "slide-fade" }, { default: le(() => [ ht(Ee("div", oX, [ et(Ze(r.tooltipEntry.paths) + " ", 1), r.tooltipEntry.origins && r.tooltipEntry.origins.length > 0 ? (Q(), be("div", sX, [ Ee("div", lX, [ cX, oe(c, { width: "250", trigger: "hover", teleported: !1, "popper-class": "popover-origin-help" }, { reference: le(() => [ oe(s, { class: "info" }, { default: le(() => [ oe(o) ]), _: 1 }) ]), default: le(() => [ Ee("span", uX, [ dX, et(" " + Ze(a.originDescription), 1) ]) ]), _: 1 }) ]), (Q(!0), be(pt, null, ir(r.tooltipEntry.origins, (p, m) => (Q(), be("div", { class: "attribute-content", "origin-item-label": p, key: p }, [ et(Ze(a.capitalise(p)) + " ", 1), m != r.tooltipEntry.origins.length - 1 ? (Q(), be("div", pX)) : Pe("", !0) ], 8, hX))), 128)), ht(oe(d, { class: "button", id: "open-dendrites-button", onClick: a.openDendrites }, { default: le(() => [ et(" Explore origin data ") ]), _: 1 }, 8, ["onClick"]), [ [ Ot, r.tooltipEntry.originsWithDatasets && r.tooltipEntry.originsWithDatasets.length > 0 ] ]) ])) : Pe("", !0), r.tooltipEntry.components && r.tooltipEntry.components.length > 0 ? (Q(), be("div", fX, [ mX, (Q(!0), be(pt, null, ir(r.tooltipEntry.components, (p, m) => (Q(), be("div", { class: "attribute-content", "component-item-label": p, key: p }, [ et(Ze(a.capitalise(p)) + " ", 1), m != r.tooltipEntry.components.length - 1 ? (Q(), be("div", vX)) : Pe("", !0) ], 8, gX))), 128)) ])) : Pe("", !0), r.tooltipEntry.destinations && r.tooltipEntry.destinations.length > 0 ? (Q(), be("div", yX, [ Ee("div", bX, [ xX, oe(c, { width: "250", trigger: "hover", teleported: !1, "popper-class": "popover-origin-help" }, { reference: le(() => [ oe(s, { class: "info" }, { default: le(() => [ oe(o) ]), _: 1 }) ]), default: le(() => [ wX ]), _: 1 }) ]), (Q(!0), be(pt, null, ir(r.tooltipEntry.destinations, (p, m) => (Q(), be("div", { class: "attribute-content", "destination-item-label": p, key: p }, [ et(Ze(a.capitalise(p)) + " ", 1), m != r.tooltipEntry.destinations.length - 1 ? (Q(), be("div", SX)) : Pe("", !0) ], 8, _X))), 128)), ht(oe(d, { class: "button", onClick: a.openAxons }, { default: le(() => [ et(" Explore destination data ") ]), _: 1 }, 8, ["onClick"]), [ [ Ot, r.tooltipEntry.destinationsWithDatasets && r.tooltipEntry.destinationsWithDatasets.length > 0 ] ]) ])) : Pe("", !0), ht(oe(d, { class: "button", onClick: a.openAll }, { default: le(() => [ et(" Search for data on components ") ]), _: 1 }, 8, ["onClick"]), [ [ Ot, r.tooltipEntry.componentsWithDatasets && r.tooltipEntry.componentsWithDatasets.length > 0 ] ]), oe(h, { resources: a.resources }, null, 8, ["resources"]) ], 512), [ [Ot, t.showDetails] ]) ]), _: 1 }) ])), [ [f, t.loading] ]) : Pe("", !0); } const EX = /* @__PURE__ */ Cs(Yq, [["render", MX], ["__scopeId", "data-v-ef9a0f6d"]]), TX = { name: "Tooltip", props: { tooltipEntry: { type: Object }, annotationDisplay: { type: Boolean, default: !1 }, annotationEntry: { type: Object } }, mounted: function() { Yd.on("onActionClick", (t) => { this.$emit("onActionClick", t); }); } }, CX = { class: "tooltip-container", id: "tooltip-container" }; function AX(t, e, r, i, n, a) { const o = L8, s = EX; return Q(), be("div", CX, [ r.annotationDisplay ? (Q(), Re(o, { key: 0, annotationEntry: r.annotationEntry, onAnnotation: e[0] || (e[0] = (c) => t.$emit("annotation", c)) }, null, 8, ["annotationEntry"])) : (Q(), Re(s, { key: 1, tooltipEntry: r.tooltipEntry }, null, 8, ["tooltipEntry"])) ]); } const LX = /* @__PURE__ */ Cs(TX, [["render", AX], ["__scopeId", "data-v-229b3988"]]), kX = { name: "TreeControls", props: { /** * The type of map that the TreeControls is used. Either "flatmap" or "scaffold". */ mapType: { type: String, required: !0 }, isReady: { type: Boolean, default: !0 }, /** * The title of the TreeControls. */ title: { type: String }, /** * The data of the tree. */ treeData: { type: Array, default: function() { return []; } }, showColourPicker: { type: Boolean, default: !1 }, /** * The active node of the tree. */ active: { type: [String, Array], required: !0 }, /** * The hover node of the tree. */ hover: { type: [String, Array], required: !0 }, enableFilter: { type: Boolean, default: !0 } }, data: function() { return { defaultExpandedKeys: ["All"], filterText: "", myPopperClass: "hide-scaffold-colour-popup", tooltipVisible: !1, tooltipLabel: "", tooltipAtBottom: !1 }; }, computed: { isFlatmap: function() { return this.mapType === "flatmap"; }, isScaffold: function() { return this.mapType === "scaffold"; }, nodeKey: function() { if (this.isFlatmap) return "key"; if (this.isScaffold) return "id"; }, expandedKeys: function() { if (this.isFlatmap) return this.defaultExpandedKeys; if (this.isScaffold) return []; } }, watch: { showColourPicker: { immediate: !0, handler: function() { this.showColourPicker ? this.myPopperClass = "showPicker" : this.myPopperClass = "hide-scaffold-colour-popup"; } }, filterText: { handler: function(t) { this.$refs.regionTree && this.$refs.regionTree.filter(t); } } }, methods: { filterNode: function(t, e) { return t ? e.label ? e.label.toLowerCase().includes(t.toLowerCase()) : !1 : !0; }, setColour: function(t, e) { this.$emit("setColour", t, e); }, getBackgroundStyles: function(t) { return "colour" in t ? { background: t.colour } : {}; }, nodeIsActive: function(t) { return this.active === t.models; }, nodeIsHover: function(t) { return this.hover === t.models; }, changeActiveByNode: function(t, e = !1) { this.isFlatmap ? t.models && this.$emit("changeActive", t.models) : this.isScaffold && (t.isPrimitives || t.isRegion) && this.$emit("changeActive", t, e); }, changeHoverByNode: function(t, e = !1) { this.isFlatmap ? t.models && this.$emit("changeHover", t.models) : this.isScaffold && t.isPrimitives && this.$emit("changeHover", t, e); }, checkChanged: function(t, e) { if (this.isFlatmap) { const r = e.checkedKeys.includes(t.key); t.key === "All" ? this.$emit("checkAll", r) : this.$emit("checkChanged", { key: t.key, value: r }); } else this.isScaffold && this.$emit("checkChanged", t, e); }, displayTooltip: function(t, e, r) { const i = r.target.closest(".el-tree-node__content"), n = i.clientWidth, a = i.getBoundingClientRect().x, o = i.querySelector(".lastChildInItem"); let s = 0; if (o) { const l = o.getBoundingClientRect(); s = l.x + l.width - a; } const c = s > n; this.tooltipVisible = c && e, this.tooltipLabel = t, this.tooltipAtBottom = 0.5 > r.layerY / this.$refs.treeContainer.clientHeight; } }, unmounted: function() { this.sortedPrimitiveGroups = void 0; }, mounted: function() { this.$refs.regionTree && this.$refs.regionTree.filter(this.filterText); } }, PX = { class: "selections-container" }, RX = { class: "title-text" }, OX = { class: "tree-container", ref: "treeContainer" }, DX = { class: "tooltip-text" }, IX = ["onClick", "onMouseover", "onMouseenter"], NX = ["onClick", "onMouseover", "onMouseenter"], BX = { class: "lastChildInItem" }, FX = { key: 0, class: "node-options" }; function zX(t, e, r, i, n, a) { const o = Qh, s = Jh, c = _g, l = Mb, u = sV, d = d8, h = hA; return Q(), be("div", PX, [ r.title ? (Q(), Re(c, { key: 0 }, { default: le(() => [ oe(o, { span: 12 }, { default: le(() => [ Ee("div", RX, Ze(r.title), 1) ]), _: 1 }), r.enableFilter ? (Q(), Re(o, { key: 0, span: 12 }, { default: le(() => [ Ee("div", null, [ oe(s, { class: "tree-filter-input", modelValue: t.filterText, "onUpdate:modelValue": e[0] || (e[0] = (f) => t.filterText = f), placeholder: "Filter keyword" }, null, 8, ["modelValue"]) ]) ]), _: 1 })) : Pe("", !0) ]), _: 1 })) : Pe("", !0), Ee("div", OX, [ Ee("div", { class: xe(["tree-tooltip", t.tooltipAtBottom ? "bottom" : ""]) }, [ oe(l, { ref: "tooltip", visible: t.tooltipVisible && t.tooltipLabel !== "", placement: "top", "show-arrow": !1, teleported: !1, trigger: "manual", "popper-class": "tree-tooltip-popper", "virtual-triggering": "", width: 260 }, { default: le(() => [ Ee("div", DX, Ze(t.tooltipLabel), 1) ]), _: 1 }, 8, ["visible"]) ], 2), ht((Q(), Re(d, { ref: "regionTree", "element-loading-background": "rgba(0, 0, 0, 0.3)", "show-checkbox": "", "node-key": a.nodeKey, data: r.treeData, "check-strictly": !1, "expand-on-click-node": !1, "render-after-expand": !1, "default-expanded-keys": a.expandedKeys, onCheck: a.checkChanged, indent: 8, "filter-node-method": a.filterNode, class: xe([r.mapType === "flatmap" ? "hide_grandchildren_checkbox" : ""]) }, { default: le(({ node: f, data: p }) => [ r.mapType === "flatmap" ? (Q(), be("span", { key: 0, class: xe(["region-tree-node", { activeItem: a.nodeIsActive(p), hoverItem: a.nodeIsHover(p) }]), onClick: (m) => a.changeActiveByNode(p), onMouseover: (m) => a.changeHoverByNode(p, !1), onMouseenter: (m) => a.displayTooltip(f.label, !0, m), onMouseleave: e[1] || (e[1] = (m) => a.displayTooltip("", !1, m)) }, [ Ee("div", { style: yt(a.getBackgroundStyles(p)), class: "lastChildInItem" }, Ze(f.label), 5) ], 42, IX)) : r.mapType === "scaffold" ? (Q(), be("span", { key: 1, class: xe(["region-tree-node", { activeItem: r.active.includes(p.id), hoverItem: r.hover.includes(p.id) }]), onClick: (m) => a.changeActiveByNode(p, !0), onMouseover: (m) => a.changeHoverByNode(p, !0, m), onMouseenter: (m) => a.displayTooltip(f.label, !0, m), onMouseleave: e[2] || (e[2] = (m) => a.displayTooltip("", !1, m)) }, [ p.isPrimitives ? (Q(), Re(u, { key: 0, class: xe({ "show-picker": r.showColourPicker }), modelValue: p.activeColour, "onUpdate:modelValue": (m) => p.activeColour = m, size: "small", "popper-class": t.myPopperClass, onChange: (m) => a.setColour(p, m) }, null, 8, ["class", "modelValue", "onUpdate:modelValue", "popper-class", "onChange"])) : Pe("", !0), Ee("div", BX, [ Ee("span", null, Ze(f.label), 1), p.isTextureSlides ? (Q(), be("span", FX, " (Texture) ")) : Pe("", !0) ]) ], 42, NX)) : Pe("", !0) ]), _: 1 }, 8, ["node-key", "data", "default-expanded-keys", "onCheck", "filter-node-method", "class"])), [ [h, !r.isReady] ]) ], 512) ]); } const $X = /* @__PURE__ */ Cs(kX, [["render", zX], ["__scopeId", "data-v-3713bced"]]), Va = (t, e, { checkForDefaultPrevented: r = !0 } = {}) => (i) => { const n = t == null ? void 0 : t(i); if (r === !1 || !n) return e == null ? void 0 : e(i); }; var VX = Object.defineProperty, UX = Object.defineProperties, jX = Object.getOwnPropertyDescriptors, uS = Object.getOwnPropertySymbols, HX = Object.prototype.hasOwnProperty, GX = Object.prototype.propertyIsEnumerable, dS = (t, e, r) => e in t ? VX(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, WX = (t, e) => { for (var r in e || (e = {})) HX.call(e, r) && dS(t, r, e[r]); if (uS) for (var r of uS(e)) GX.call(e, r) && dS(t, r, e[r]); return t; }, qX = (t, e) => UX(t, jX(e)); function hS(t, e) { var r; const i = mr(); return lg(() => { i.value = t(); }, qX(WX({}, e), { flush: (r = void 0) != null ? r : "sync" })), U1(i); } var pS; const Ur = typeof window < "u", XX = (t) => typeof t == "string", RL = () => { }, zy = Ur && ((pS = window == null ? void 0 : window.navigator) == null ? void 0 : pS.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent); function OL(t) { return typeof t == "function" ? t() : N(t); } function ZX(t) { return t; } function Vg(t) { return H1() ? (G1(t), !0) : !1; } function YX(t, e = !0) { Ct() ? Lt(t) : e ? t() : st(t); } function Xa(t) { var e; const r = OL(t); return (e = r == null ? void 0 : r.$el) != null ? e : r; } const up = Ur ? window : void 0, KX = Ur ? window.document : void 0; function ri(...t) { let e, r, i, n; if (XX(t[0]) || Array.isArray(t[0]) ? ([r, i, n] = t, e = up) : [e, r, i, n] = t, !e) return RL; Array.isArray(r) || (r = [r]), Array.isArray(i) || (i = [i]); const a = [], o = () => { a.forEach((u) => u()), a.length = 0; }, s = (u, d, h, f) => (u.addEventListener(d, h, f), () => u.removeEventListener(d, h, f)), c = ze(() => [Xa(e), OL(n)], ([u, d]) => { o(), u && a.push(...r.flatMap((h) => i.map((f) => s(u, h, f, d)))); }, { immediate: !0, flush: "post" }), l = () => { c(), o(); }; return Vg(l), l; } let fS = !1; function JX(t, e, r = {}) { const { window: i = up, ignore: n = [], capture: a = !0, detectIframe: o = !1 } = r; if (!i) return; zy && !fS && (fS = !0, Array.from(i.document.body.children).forEach((u) => u.addEventListener("click", RL))); let s = !0; const c = (u) => n.some((d) => { if (typeof d == "string") return Array.from(i.document.querySelectorAll(d)).some((h) => h === u.target || u.composedPath().includes(h)); { const h = Xa(d); return h && (u.target === h || u.composedPath().includes(h)); } }), l = [ ri(i, "click", (u) => { const d = Xa(t); if (!(!d || d === u.target || u.composedPath().includes(d))) { if (u.detail === 0 && (s = !c(u)), !s) { s = !0; return; } e(u); } }, { passive: !0, capture: a }), ri(i, "pointerdown", (u) => { const d = Xa(t); d && (s = !u.composedPath().includes(d) && !c(u)); }, { passive: !0 }), o && ri(i, "blur", (u) => { var d; const h = Xa(t); ((d = i.document.activeElement) == null ? void 0 : d.tagName) === "IFRAME" && !(h != null && h.contains(i.document.activeElement)) && e(u); }) ].filter(Boolean); return () => l.forEach((u) => u()); } function DL(t, e = !1) { const r = we(), i = () => r.value = !!t(); return i(), YX(i, e), r; } const mS = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, gS = "__vueuse_ssr_handlers__"; mS[gS] = mS[gS] || {}; function QX({ document: t = KX } = {}) { if (!t) return we("visible"); const e = we(t.visibilityState); return ri(t, "visibilitychange", () => { e.value = t.visibilityState; }), e; } var vS = Object.getOwnPropertySymbols, eZ = Object.prototype.hasOwnProperty, tZ = Object.prototype.propertyIsEnumerable, rZ = (t, e) => { var r = {}; for (var i in t) eZ.call(t, i) && e.indexOf(i) < 0 && (r[i] = t[i]); if (t != null && vS) for (var i of vS(t)) e.indexOf(i) < 0 && tZ.call(t, i) && (r[i] = t[i]); return r; }; function bn(t, e, r = {}) { const i = r, { window: n = up } = i, a = rZ(i, ["window"]); let o; const s = DL(() => n && "ResizeObserver" in n), c = () => { o && (o.disconnect(), o = void 0); }, l = ze(() => Xa(t), (d) => { c(), s.value && n && d && (o = new ResizeObserver(e), o.observe(d, a)); }, { immediate: !0, flush: "post" }), u = () => { c(), l(); }; return Vg(u), { isSupported: s, stop: u }; } var yS = Object.getOwnPropertySymbols, iZ = Object.prototype.hasOwnProperty, nZ = Object.prototype.propertyIsEnumerable, aZ = (t, e) => { var r = {}; for (var i in t) iZ.call(t, i) && e.indexOf(i) < 0 && (r[i] = t[i]); if (t != null && yS) for (var i of yS(t)) e.indexOf(i) < 0 && nZ.call(t, i) && (r[i] = t[i]); return r; }; function oZ(t, e, r = {}) { const i = r, { window: n = up } = i, a = aZ(i, ["window"]); let o; const s = DL(() => n && "MutationObserver" in n), c = () => { o && (o.disconnect(), o = void 0); }, l = ze(() => Xa(t), (d) => { c(), s.value && n && d && (o = new MutationObserver(e), o.observe(d, a)); }, { immediate: !0 }), u = () => { c(), l(); }; return Vg(u), { isSupported: s, stop: u }; } var bS; (function(t) { t.UP = "UP", t.RIGHT = "RIGHT", t.DOWN = "DOWN", t.LEFT = "LEFT", t.NONE = "NONE"; })(bS || (bS = {})); var sZ = Object.defineProperty, xS = Object.getOwnPropertySymbols, lZ = Object.prototype.hasOwnProperty, cZ = Object.prototype.propertyIsEnumerable, wS = (t, e, r) => e in t ? sZ(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, uZ = (t, e) => { for (var r in e || (e = {})) lZ.call(e, r) && wS(t, r, e[r]); if (xS) for (var r of xS(e)) cZ.call(e, r) && wS(t, r, e[r]); return t; }; const dZ = { 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] }; uZ({ linear: ZX }, dZ); function hZ({ window: t = up } = {}) { if (!t) return we(!1); const e = we(t.document.hasFocus()); return ri(t, "blur", () => { e.value = !1; }), ri(t, "focus", () => { e.value = !0; }), e; } const pZ = () => Ur && /firefox/i.test(window.navigator.userAgent); /** * @vue/shared v3.5.11 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ process.env.NODE_ENV !== "production" && Object.freeze({}); process.env.NODE_ENV !== "production" && Object.freeze([]); const Mh = () => { }, fZ = Object.prototype.hasOwnProperty, _S = (t, e) => fZ.call(t, e), ji = Array.isArray, Mi = (t) => typeof t == "function", Ni = (t) => typeof t == "string", Ii = (t) => t !== null && typeof t == "object", mZ = Object.prototype.toString, gZ = (t) => mZ.call(t), Qv = (t) => gZ(t).slice(8, -1), Kb = (t) => { const e = /* @__PURE__ */ Object.create(null); return (r) => e[r] || (e[r] = t(r)); }, vZ = /-(\w)/g, yZ = Kb( (t) => t.replace(vZ, (e, r) => r ? r.toUpperCase() : "") ), bZ = /\B([A-Z])/g, xZ = Kb( (t) => t.replace(bZ, "-$1").toLowerCase() ), wZ = Kb((t) => t.charAt(0).toUpperCase() + t.slice(1)); var IL = typeof global == "object" && global && global.Object === Object && global, _Z = typeof self == "object" && self && self.Object === Object && self, Ca = IL || _Z || Function("return this")(), ba = Ca.Symbol, NL = Object.prototype, SZ = NL.hasOwnProperty, MZ = NL.toString, vd = ba ? ba.toStringTag : void 0; function EZ(t) { var e = SZ.call(t, vd), r = t[vd]; try { t[vd] = void 0; var i = !0; } catch { } var n = MZ.call(t); return i && (e ? t[vd] = r : delete t[vd]), n; } var TZ = Object.prototype, CZ = TZ.toString; function AZ(t) { return CZ.call(t); } var LZ = "[object Null]", kZ = "[object Undefined]", SS = ba ? ba.toStringTag : void 0; function qu(t) { return t == null ? t === void 0 ? kZ : LZ : SS && SS in Object(t) ? EZ(t) : AZ(t); } function ou(t) { return t != null && typeof t == "object"; } var PZ = "[object Symbol]"; function Ug(t) { return typeof t == "symbol" || ou(t) && qu(t) == PZ; } function RZ(t, e) { for (var r = -1, i = t == null ? 0 : t.length, n = Array(i); ++r < i; ) n[r] = e(t[r], r, t); return n; } var Wn = Array.isArray, OZ = 1 / 0, MS = ba ? ba.prototype : void 0, ES = MS ? MS.toString : void 0; function BL(t) { if (typeof t == "string") return t; if (Wn(t)) return RZ(t, BL) + ""; if (Ug(t)) return ES ? ES.call(t) : ""; var e = t + ""; return e == "0" && 1 / t == -OZ ? "-0" : e; } var DZ = /\s/; function IZ(t) { for (var e = t.length; e-- && DZ.test(t.charAt(e)); ) ; return e; } var NZ = /^\s+/; function BZ(t) { return t && t.slice(0, IZ(t) + 1).replace(NZ, ""); } function gs(t) { var e = typeof t; return t != null && (e == "object" || e == "function"); } var TS = NaN, FZ = /^[-+]0x[0-9a-f]+$/i, zZ = /^0b[01]+$/i, $Z = /^0o[0-7]+$/i, VZ = parseInt; function CS(t) { if (typeof t == "number") return t; if (Ug(t)) return TS; if (gs(t)) { var e = typeof t.valueOf == "function" ? t.valueOf() : t; t = gs(e) ? e + "" : e; } if (typeof t != "string") return t === 0 ? t : +t; t = BZ(t); var r = zZ.test(t); return r || $Z.test(t) ? VZ(t.slice(2), r ? 2 : 8) : FZ.test(t) ? TS : +t; } function FL(t) { return t; } var UZ = "[object AsyncFunction]", jZ = "[object Function]", HZ = "[object GeneratorFunction]", GZ = "[object Proxy]"; function zL(t) { if (!gs(t)) return !1; var e = qu(t); return e == jZ || e == HZ || e == UZ || e == GZ; } var e0 = Ca["__core-js_shared__"], AS = function() { var t = /[^.]+$/.exec(e0 && e0.keys && e0.keys.IE_PROTO || ""); return t ? "Symbol(src)_1." + t : ""; }(); function WZ(t) { return !!AS && AS in t; } var qZ = Function.prototype, XZ = qZ.toString; function jl(t) { if (t != null) { try { return XZ.call(t); } catch { } try { return t + ""; } catch { } } return ""; } var ZZ = /[\\^$.*+?()[\]{}|]/g, YZ = /^\[object .+?Constructor\]$/, KZ = Function.prototype, JZ = Object.prototype, QZ = KZ.toString, eY = JZ.hasOwnProperty, tY = RegExp( "^" + QZ.call(eY).replace(ZZ, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); function rY(t) { if (!gs(t) || WZ(t)) return !1; var e = zL(t) ? tY : YZ; return e.test(jl(t)); } function iY(t, e) { return t == null ? void 0 : t[e]; } function Hl(t, e) { var r = iY(t, e); return rY(r) ? r : void 0; } var $y = Hl(Ca, "WeakMap"); function nY(t, e, r) { switch (r.length) { case 0: return t.call(e); case 1: return t.call(e, r[0]); case 2: return t.call(e, r[0], r[1]); case 3: return t.call(e, r[0], r[1], r[2]); } return t.apply(e, r); } var aY = 800, oY = 16, sY = Date.now; function lY(t) { var e = 0, r = 0; return function() { var i = sY(), n = oY - (i - r); if (r = i, n > 0) { if (++e >= aY) return arguments[0]; } else e = 0; return t.apply(void 0, arguments); }; } function cY(t) { return function() { return t; }; } var Hm = function() { try { var t = Hl(Object, "defineProperty"); return t({}, "", {}), t; } catch { } }(), uY = Hm ? function(t, e) { return Hm(t, "toString", { configurable: !0, enumerable: !1, value: cY(e), writable: !0 }); } : FL, dY = lY(uY); function hY(t, e, r, i) { t.length; for (var n = r + 1; n--; ) if (e(t[n], n, t)) return n; return -1; } var pY = 9007199254740991, fY = /^(?:0|[1-9]\d*)$/; function Jb(t, e) { var r = typeof t; return e = e ?? pY, !!e && (r == "number" || r != "symbol" && fY.test(t)) && t > -1 && t % 1 == 0 && t < e; } function mY(t, e, r) { e == "__proto__" && Hm ? Hm(t, e, { configurable: !0, enumerable: !0, value: r, writable: !0 }) : t[e] = r; } function Qb(t, e) { return t === e || t !== t && e !== e; } var gY = Object.prototype, vY = gY.hasOwnProperty; function yY(t, e, r) { var i = t[e]; (!(vY.call(t, e) && Qb(i, r)) || r === void 0 && !(e in t)) && mY(t, e, r); } var LS = Math.max; function bY(t, e, r) { return e = LS(e === void 0 ? t.length - 1 : e, 0), function() { for (var i = arguments, n = -1, a = LS(i.length - e, 0), o = Array(a); ++n < a; ) o[n] = i[e + n]; n = -1; for (var s = Array(e + 1); ++n < e; ) s[n] = i[n]; return s[e] = r(o), nY(t, this, s); }; } var xY = 9007199254740991; function ex(t) { return typeof t == "number" && t > -1 && t % 1 == 0 && t <= xY; } function wY(t) { return t != null && ex(t.length) && !zL(t); } var _Y = Object.prototype; function SY(t) { var e = t && t.constructor, r = typeof e == "function" && e.prototype || _Y; return t === r; } function MY(t, e) { for (var r = -1, i = Array(t); ++r < t; ) i[r] = e(r); return i; } var EY = "[object Arguments]"; function kS(t) { return ou(t) && qu(t) == EY; } var $L = Object.prototype, TY = $L.hasOwnProperty, CY = $L.propertyIsEnumerable, tx = kS(/* @__PURE__ */ function() { return arguments; }()) ? kS : function(t) { return ou(t) && TY.call(t, "callee") && !CY.call(t, "callee"); }; function AY() { return !1; } var VL = typeof exports == "object" && exports && !exports.nodeType && exports, PS = VL && typeof module == "object" && module && !module.nodeType && module, LY = PS && PS.exports === VL, RS = LY ? Ca.Buffer : void 0, kY = RS ? RS.isBuffer : void 0, Vy = kY || AY, PY = "[object Arguments]", RY = "[object Array]", OY = "[object Boolean]", DY = "[object Date]", IY = "[object Error]", NY = "[object Function]", BY = "[object Map]", FY = "[object Number]", zY = "[object Object]", $Y = "[object RegExp]", VY = "[object Set]", UY = "[object String]", jY = "[object WeakMap]", HY = "[object ArrayBuffer]", GY = "[object DataView]", WY = "[object Float32Array]", qY = "[object Float64Array]", XY = "[object Int8Array]", ZY = "[object Int16Array]", YY = "[object Int32Array]", KY = "[object Uint8Array]", JY = "[object Uint8ClampedArray]", QY = "[object Uint16Array]", eK = "[object Uint32Array]", dr = {}; dr[WY] = dr[qY] = dr[XY] = dr[ZY] = dr[YY] = dr[KY] = dr[JY] = dr[QY] = dr[eK] = !0; dr[PY] = dr[RY] = dr[HY] = dr[OY] = dr[GY] = dr[DY] = dr[IY] = dr[NY] = dr[BY] = dr[FY] = dr[zY] = dr[$Y] = dr[VY] = dr[UY] = dr[jY] = !1; function tK(t) { return ou(t) && ex(t.length) && !!dr[qu(t)]; } function rK(t) { return function(e) { return t(e); }; } var UL = typeof exports == "object" && exports && !exports.nodeType && exports, Kd = UL && typeof module == "object" && module && !module.nodeType && module, iK = Kd && Kd.exports === UL, t0 = iK && IL.process, OS = function() { try { var t = Kd && Kd.require && Kd.require("util").types; return t || t0 && t0.binding && t0.binding("util"); } catch { } }(), DS = OS && OS.isTypedArray, jL = DS ? rK(DS) : tK, nK = Object.prototype, aK = nK.hasOwnProperty; function oK(t, e) { var r = Wn(t), i = !r && tx(t), n = !r && !i && Vy(t), a = !r && !i && !n && jL(t), o = r || i || n || a, s = o ? MY(t.length, String) : [], c = s.length; for (var l in t) aK.call(t, l) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode. (l == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. n && (l == "offset" || l == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. a && (l == "buffer" || l == "byteLength" || l == "byteOffset") || // Skip index properties. Jb(l, c))) && s.push(l); return s; } function sK(t, e) { return function(r) { return t(e(r)); }; } var lK = sK(Object.keys, Object), cK = Object.prototype, uK = cK.hasOwnProperty; function dK(t) { if (!SY(t)) return lK(t); var e = []; for (var r in Object(t)) uK.call(t, r) && r != "constructor" && e.push(r); return e; } function HL(t) { return wY(t) ? oK(t) : dK(t); } var hK = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, pK = /^\w*$/; function rx(t, e) { if (Wn(t)) return !1; var r = typeof t; return r == "number" || r == "symbol" || r == "boolean" || t == null || Ug(t) ? !0 : pK.test(t) || !hK.test(t) || e != null && t in Object(e); } var Eh = Hl(Object, "create"); function fK() { this.__data__ = Eh ? Eh(null) : {}, this.size = 0; } function mK(t) { var e = this.has(t) && delete this.__data__[t]; return this.size -= e ? 1 : 0, e; } var gK = "__lodash_hash_undefined__", vK = Object.prototype, yK = vK.hasOwnProperty; function bK(t) { var e = this.__data__; if (Eh) { var r = e[t]; return r === gK ? void 0 : r; } return yK.call(e, t) ? e[t] : void 0; } var xK = Object.prototype, wK = xK.hasOwnProperty; function _K(t) { var e = this.__data__; return Eh ? e[t] !== void 0 : wK.call(e, t); } var SK = "__lodash_hash_undefined__"; function MK(t, e) { var r = this.__data__; return this.size += this.has(t) ? 0 : 1, r[t] = Eh && e === void 0 ? SK : e, this; } function Cl(t) { var e = -1, r = t == null ? 0 : t.length; for (this.clear(); ++e < r; ) { var i = t[e]; this.set(i[0], i[1]); } } Cl.prototype.clear = fK; Cl.prototype.delete = mK; Cl.prototype.get = bK; Cl.prototype.has = _K; Cl.prototype.set = MK; function EK() { this.__data__ = [], this.size = 0; } function jg(t, e) { for (var r = t.length; r--; ) if (Qb(t[r][0], e)) return r; return -1; } var TK = Array.prototype, CK = TK.splice; function AK(t) { var e = this.__data__, r = jg(e, t); if (r < 0) return !1; var i = e.length - 1; return r == i ? e.pop() : CK.call(e, r, 1), --this.size, !0; } function LK(t) { var e = this.__data__, r = jg(e, t); return r < 0 ? void 0 : e[r][1]; } function kK(t) { return jg(this.__data__, t) > -1; } function PK(t, e) { var r = this.__data__, i = jg(r, t); return i < 0 ? (++this.size, r.push([t, e])) : r[i][1] = e, this; } function go(t) { var e = -1, r = t == null ? 0 : t.length; for (this.clear(); ++e < r; ) { var i = t[e]; this.set(i[0], i[1]); } } go.prototype.clear = EK; go.prototype.delete = AK; go.prototype.get = LK; go.prototype.has = kK; go.prototype.set = PK; var Th = Hl(Ca, "Map"); function RK() { this.size = 0, this.__data__ = { hash: new Cl(), map: new (Th || go)(), string: new Cl() }; } function OK(t) { var e = typeof t; return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null; } function Hg(t, e) { var r = t.__data__; return OK(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map; } function DK(t) { var e = Hg(this, t).delete(t); return this.size -= e ? 1 : 0, e; } function IK(t) { return Hg(this, t).get(t); } function NK(t) { return Hg(this, t).has(t); } function BK(t, e) { var r = Hg(this, t), i = r.size; return r.set(t, e), this.size += r.size == i ? 0 : 1, this; } function vo(t) { var e = -1, r = t == null ? 0 : t.length; for (this.clear(); ++e < r; ) { var i = t[e]; this.set(i[0], i[1]); } } vo.prototype.clear = RK; vo.prototype.delete = DK; vo.prototype.get = IK; vo.prototype.has = NK; vo.prototype.set = BK; var FK = "Expected a function"; function ix(t, e) { if (typeof t != "function" || e != null && typeof e != "function") throw new TypeError(FK); var r = function() { var i = arguments, n = e ? e.apply(this, i) : i[0], a = r.cache; if (a.has(n)) return a.get(n); var o = t.apply(this, i); return r.cache = a.set(n, o) || a, o; }; return r.cache = new (ix.Cache || vo)(), r; } ix.Cache = vo; var zK = 500; function $K(t) { var e = ix(t, function(i) { return r.size === zK && r.clear(), i; }), r = e.cache; return e; } var VK = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, UK = /\\(\\)?/g, jK = $K(function(t) { var e = []; return t.charCodeAt(0) === 46 && e.push(""), t.replace(VK, function(r, i, n, a) { e.push(n ? a.replace(UK, "$1") : i || r); }), e; }); function HK(t) { return t == null ? "" : BL(t); } function Gg(t, e) { return Wn(t) ? t : rx(t, e) ? [t] : jK(HK(t)); } var GK = 1 / 0; function dp(t) { if (typeof t == "string" || Ug(t)) return t; var e = t + ""; return e == "0" && 1 / t == -GK ? "-0" : e; } function nx(t, e) { e = Gg(e, t); for (var r = 0, i = e.length; t != null && r < i; ) t = t[dp(e[r++])]; return r && r == i ? t : void 0; } function Ha(t, e, r) { var i = t == null ? void 0 : nx(t, e); return i === void 0 ? r : i; } function GL(t, e) { for (var r = -1, i = e.length, n = t.length; ++r < i; ) t[n + r] = e[r]; return t; } var IS = ba ? ba.isConcatSpreadable : void 0; function WK(t) { return Wn(t) || tx(t) || !!(IS && t && t[IS]); } function qK(t, e, r, i, n) { var a = -1, o = t.length; for (r || (r = WK), n || (n = []); ++a < o; ) { var s = t[a]; r(s) ? GL(n, s) : n[n.length] = s; } return n; } function XK(t) { var e = t == null ? 0 : t.length; return e ? qK(t) : []; } function ZK(t) { return dY(bY(t, void 0, XK), t + ""); } function sa() { if (!arguments.length) return []; var t = arguments[0]; return Wn(t) ? t : [t]; } function YK() { this.__data__ = new go(), this.size = 0; } function KK(t) { var e = this.__data__, r = e.delete(t); return this.size = e.size, r; } function JK(t) { return this.__data__.get(t); } function QK(t) { return this.__data__.has(t); } var eJ = 200; function tJ(t, e) { var r = this.__data__; if (r instanceof go) { var i = r.__data__; if (!Th || i.length < eJ - 1) return i.push([t, e]), this.size = ++r.size, this; r = this.__data__ = new vo(i); } return r.set(t, e), this.size = r.size, this; } function Ya(t) { var e = this.__data__ = new go(t); this.size = e.size; } Ya.prototype.clear = YK; Ya.prototype.delete = KK; Ya.prototype.get = JK; Ya.prototype.has = QK; Ya.prototype.set = tJ; function rJ(t, e) { for (var r = -1, i = t == null ? 0 : t.length, n = 0, a = []; ++r < i; ) { var o = t[r]; e(o, r, t) && (a[n++] = o); } return a; } function iJ() { return []; } var nJ = Object.prototype, aJ = nJ.propertyIsEnumerable, NS = Object.getOwnPropertySymbols, oJ = NS ? function(t) { return t == null ? [] : (t = Object(t), rJ(NS(t), function(e) { return aJ.call(t, e); })); } : iJ; function sJ(t, e, r) { var i = e(t); return Wn(t) ? i : GL(i, r(t)); } function BS(t) { return sJ(t, HL, oJ); } var Uy = Hl(Ca, "DataView"), jy = Hl(Ca, "Promise"), Hy = Hl(Ca, "Set"), FS = "[object Map]", lJ = "[object Object]", zS = "[object Promise]", $S = "[object Set]", VS = "[object WeakMap]", US = "[object DataView]", cJ = jl(Uy), uJ = jl(Th), dJ = jl(jy), hJ = jl(Hy), pJ = jl($y), Go = qu; (Uy && Go(new Uy(new ArrayBuffer(1))) != US || Th && Go(new Th()) != FS || jy && Go(jy.resolve()) != zS || Hy && Go(new Hy()) != $S || $y && Go(new $y()) != VS) && (Go = function(t) { var e = qu(t), r = e == lJ ? t.constructor : void 0, i = r ? jl(r) : ""; if (i) switch (i) { case cJ: return US; case uJ: return FS; case dJ: return zS; case hJ: return $S; case pJ: return VS; } return e; }); var jS = Ca.Uint8Array, fJ = "__lodash_hash_undefined__"; function mJ(t) { return this.__data__.set(t, fJ), this; } function gJ(t) { return this.__data__.has(t); } function Gm(t) { var e = -1, r = t == null ? 0 : t.length; for (this.__data__ = new vo(); ++e < r; ) this.add(t[e]); } Gm.prototype.add = Gm.prototype.push = mJ; Gm.prototype.has = gJ; function vJ(t, e) { for (var r = -1, i = t == null ? 0 : t.length; ++r < i; ) if (e(t[r], r, t)) return !0; return !1; } function yJ(t, e) { return t.has(e); } var bJ = 1, xJ = 2; function WL(t, e, r, i, n, a) { var o = r & bJ, s = t.length, c = e.length; if (s != c && !(o && c > s)) return !1; var l = a.get(t), u = a.get(e); if (l && u) return l == e && u == t; var d = -1, h = !0, f = r & xJ ? new Gm() : void 0; for (a.set(t, e), a.set(e, t); ++d < s; ) { var p = t[d], m = e[d]; if (i) var y = o ? i(m, p, d, e, t, a) : i(p, m, d, t, e, a); if (y !== void 0) { if (y) continue; h = !1; break; } if (f) { if (!vJ(e, function(g, v) { if (!yJ(f, v) && (p === g || n(p, g, r, i, a))) return f.push(v); })) { h = !1; break; } } else if (!(p === m || n(p, m, r, i, a))) { h = !1; break; } } return a.delete(t), a.delete(e), h; } function wJ(t) { var e = -1, r = Array(t.size); return t.forEach(function(i, n) { r[++e] = [n, i]; }), r; } function _J(t) { var e = -1, r = Array(t.size); return t.forEach(function(i) { r[++e] = i; }), r; } var SJ = 1, MJ = 2, EJ = "[object Boolean]", TJ = "[object Date]", CJ = "[object Error]", AJ = "[object Map]", LJ = "[object Number]", kJ = "[object RegExp]", PJ = "[object Set]", RJ = "[object String]", OJ = "[object Symbol]", DJ = "[object ArrayBuffer]", IJ = "[object DataView]", HS = ba ? ba.prototype : void 0, r0 = HS ? HS.valueOf : void 0; function NJ(t, e, r, i, n, a, o) { switch (r) { case IJ: if (t.byteLength != e.byteLength || t.byteOffset != e.byteOffset) return !1; t = t.buffer, e = e.buffer; case DJ: return !(t.byteLength != e.byteLength || !a(new jS(t), new jS(e))); case EJ: case TJ: case LJ: return Qb(+t, +e); case CJ: return t.name == e.name && t.message == e.message; case kJ: case RJ: return t == e + ""; case AJ: var s = wJ; case PJ: var c = i & SJ; if (s || (s = _J), t.size != e.size && !c) return !1; var l = o.get(t); if (l) return l == e; i |= MJ, o.set(t, e); var u = WL(s(t), s(e), i, n, a, o); return o.delete(t), u; case OJ: if (r0) return r0.call(t) == r0.call(e); } return !1; } var BJ = 1, FJ = Object.prototype, zJ = FJ.hasOwnProperty; function $J(t, e, r, i, n, a) { var o = r & BJ, s = BS(t), c = s.length, l = BS(e), u = l.length; if (c != u && !o) return !1; for (var d = c; d--; ) { var h = s[d]; if (!(o ? h in e : zJ.call(e, h))) return !1; } var f = a.get(t), p = a.get(e); if (f && p) return f == e && p == t; var m = !0; a.set(t, e), a.set(e, t); for (var y = o; ++d < c; ) { h = s[d]; var g = t[h], v = e[h]; if (i) var x = o ? i(v, g, h, e, t, a) : i(g, v, h, t, e, a); if (!(x === void 0 ? g === v || n(g, v, r, i, a) : x)) { m = !1; break; } y || (y = h == "constructor"); } if (m && !y) { var w = t.constructor, S = e.constructor; w != S && "constructor" in t && "constructor" in e && !(typeof w == "function" && w instanceof w && typeof S == "function" && S instanceof S) && (m = !1); } return a.delete(t), a.delete(e), m; } var VJ = 1, GS = "[object Arguments]", WS = "[object Array]", Qp = "[object Object]", UJ = Object.prototype, qS = UJ.hasOwnProperty; function jJ(t, e, r, i, n, a) { var o = Wn(t), s = Wn(e), c = o ? WS : Go(t), l = s ? WS : Go(e); c = c == GS ? Qp : c, l = l == GS ? Qp : l; var u = c == Qp, d = l == Qp, h = c == l; if (h && Vy(t)) { if (!Vy(e)) return !1; o = !0, u = !1; } if (h && !u) return a || (a = new Ya()), o || jL(t) ? WL(t, e, r, i, n, a) : NJ(t, e, c, r, i, n, a); if (!(r & VJ)) { var f = u && qS.call(t, "__wrapped__"), p = d && qS.call(e, "__wrapped__"); if (f || p) { var m = f ? t.value() : t, y = p ? e.value() : e; return a || (a = new Ya()), n(m, y, r, i, a); } } return h ? (a || (a = new Ya()), $J(t, e, r, i, n, a)) : !1; } function Wg(t, e, r, i, n) { return t === e ? !0 : t == null || e == null || !ou(t) && !ou(e) ? t !== t && e !== e : jJ(t, e, r, i, Wg, n); } var HJ = 1, GJ = 2; function WJ(t, e, r, i) { var n = r.length, a = n; if (t == null) return !a; for (t = Object(t); n--; ) { var o = r[n]; if (o[2] ? o[1] !== t[o[0]] : !(o[0] in t)) return !1; } for (; ++n < a; ) { o = r[n]; var s = o[0], c = t[s], l = o[1]; if (o[2]) { if (c === void 0 && !(s in t)) return !1; } else { var u = new Ya(), d; if (!(d === void 0 ? Wg(l, c, HJ | GJ, i, u) : d)) return !1; } } return !0; } function qL(t) { return t === t && !gs(t); } function qJ(t) { for (var e = HL(t), r = e.length; r--; ) { var i = e[r], n = t[i]; e[r] = [i, n, qL(n)]; } return e; } function XL(t, e) { return function(r) { return r == null ? !1 : r[t] === e && (e !== void 0 || t in Object(r)); }; } function XJ(t) { var e = qJ(t); return e.length == 1 && e[0][2] ? XL(e[0][0], e[0][1]) : function(r) { return r === t || WJ(r, t, e); }; } function ZJ(t, e) { return t != null && e in Object(t); } function YJ(t, e, r) { e = Gg(e, t); for (var i = -1, n = e.length, a = !1; ++i < n; ) { var o = dp(e[i]); if (!(a = t != null && r(t, o))) break; t = t[o]; } return a || ++i != n ? a : (n = t == null ? 0 : t.length, !!n && ex(n) && Jb(o, n) && (Wn(t) || tx(t))); } function ZL(t, e) { return t != null && YJ(t, e, ZJ); } var KJ = 1, JJ = 2; function QJ(t, e) { return rx(t) && qL(e) ? XL(dp(t), e) : function(r) { var i = Ha(r, t); return i === void 0 && i === e ? ZL(r, t) : Wg(e, i, KJ | JJ); }; } function eQ(t) { return function(e) { return e == null ? void 0 : e[t]; }; } function tQ(t) { return function(e) { return nx(e, t); }; } function rQ(t) { return rx(t) ? eQ(dp(t)) : tQ(t); } function iQ(t) { return typeof t == "function" ? t : t == null ? FL : typeof t == "object" ? Wn(t) ? QJ(t[0], t[1]) : XJ(t) : rQ(t); } var i0 = function() { return Ca.Date.now(); }, nQ = "Expected a function", aQ = Math.max, oQ = Math.min; function Gy(t, e, r) { var i, n, a, o, s, c, l = 0, u = !1, d = !1, h = !0; if (typeof t != "function") throw new TypeError(nQ); e = CS(e) || 0, gs(r) && (u = !!r.leading, d = "maxWait" in r, a = d ? aQ(CS(r.maxWait) || 0, e) : a, h = "trailing" in r ? !!r.trailing : h); function f(_) { var b = i, T = n; return i = n = void 0, l = _, o = t.apply(T, b), o; } function p(_) { return l = _, s = setTimeout(g, e), u ? f(_) : o; } function m(_) { var b = _ - c, T = _ - l, E = e - b; return d ? oQ(E, a - T) : E; } function y(_) { var b = _ - c, T = _ - l; return c === void 0 || b >= e || b < 0 || d && T >= a; } function g() { var _ = i0(); if (y(_)) return v(_); s = setTimeout(g, m(_)); } function v(_) { return s = void 0, h && i ? f(_) : (i = n = void 0, o); } function x() { s !== void 0 && clearTimeout(s), l = 0, i = c = n = s = void 0; } function w() { return s === void 0 ? o : v(i0()); } function S() { var _ = i0(), b = y(_); if (i = arguments, n = this, c = _, b) { if (s === void 0) return p(c); if (d) return clearTimeout(s), s = setTimeout(g, e), f(c); } return s === void 0 && (s = setTimeout(g, e)), o; } return S.cancel = x, S.flush = w, S; } function sQ(t, e, r) { var i = t == null ? 0 : t.length; if (!i) return -1; var n = i - 1; return hY(t, iQ(e), n); } function Wm(t) { for (var e = -1, r = t == null ? 0 : t.length, i = {}; ++e < r; ) { var n = t[e]; i[n[0]] = n[1]; } return i; } function Wy(t, e) { return Wg(t, e); } function Ka(t) { return t == null; } function lQ(t) { return t === void 0; } function cQ(t, e, r, i) { if (!gs(t)) return t; e = Gg(e, t); for (var n = -1, a = e.length, o = a - 1, s = t; s != null && ++n < a; ) { var c = dp(e[n]), l = r; if (c === "__proto__" || c === "constructor" || c === "prototype") return t; if (n != o) { var u = s[c]; l = void 0, l === void 0 && (l = gs(u) ? u : Jb(e[n + 1]) ? [] : {}); } yY(s, c, l), s = s[c]; } return t; } function uQ(t, e, r) { for (var i = -1, n = e.length, a = {}; ++i < n; ) { var o = e[i], s = nx(t, o); r(s, o) && cQ(a, Gg(o, t), s); } return a; } function dQ(t, e) { return uQ(t, e, function(r, i) { return ZL(t, i); }); } var hQ = ZK(function(t, e) { return t == null ? {} : dQ(t, e); }); const Un = (t) => t === void 0, ax = (t) => typeof t == "boolean", Jt = (t) => typeof t == "number", cl = (t) => typeof Element > "u" ? !1 : t instanceof Element, pQ = (t) => Ni(t) ? !Number.isNaN(Number(t)) : !1, fQ = (t = "") => t.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"), Zo = (t) => wZ(t), XS = (t) => Object.keys(t); class YL extends Error { constructor(e) { super(e), this.name = "ElementPlusError"; } } function Xu(t, e) { throw new YL(`[${t}] ${e}`); } function Br(t, e) { if (process.env.NODE_ENV !== "production") { const r = Ni(t) ? new YL(`[${t}] ${e}`) : t; console.warn(r); } } const mQ = "utils/dom/style", KL = (t = "") => t.split(" ").filter((e) => !!e.trim()), ZS = (t, e) => { !t || !e.trim() || t.classList.add(...KL(e)); }, qm = (t, e) => { !t || !e.trim() || t.classList.remove(...KL(e)); }, yd = (t, e) => { var r; if (!Ur || !t || !e) return ""; let i = yZ(e); i === "float" && (i = "cssFloat"); try { const n = t.style[i]; if (n) return n; const a = (r = document.defaultView) == null ? void 0 : r.getComputedStyle(t, ""); return a ? a[i] : ""; } catch { return t.style[i]; } }; function Xm(t, e = "px") { if (!t) return ""; if (Jt(t) || pQ(t)) return `${t}${e}`; if (Ni(t)) return t; Br(mQ, "binding value must be a string or number"); } function gQ(t, e) { if (!Ur) return; if (!e) { t.scrollTop = 0; return; } const r = []; let i = e.offsetParent; for (; i !== null && t !== i && t.contains(i); ) r.push(i), i = i.offsetParent; const n = e.offsetTop + r.reduce((c, l) => c + l.offsetTop, 0), a = n + e.offsetHeight, o = t.scrollTop, s = o + t.clientHeight; n < o ? t.scrollTop = n : a > s && (t.scrollTop = a - t.clientHeight); } /*! Element Plus Icons Vue v2.3.1 */ var vQ = /* @__PURE__ */ Le({ name: "ArrowDown", __name: "arrow-down", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("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" }) ])); } }), ox = vQ, yQ = /* @__PURE__ */ Le({ name: "ArrowLeft", __name: "arrow-left", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("path", { fill: "currentColor", d: "M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z" }) ])); } }), vs = yQ, bQ = /* @__PURE__ */ Le({ name: "ArrowRight", __name: "arrow-right", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("path", { fill: "currentColor", d: "M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z" }) ])); } }), ys = bQ, xQ = /* @__PURE__ */ Le({ name: "ArrowUp", __name: "arrow-up", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("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" }) ])); } }), wQ = xQ, _Q = /* @__PURE__ */ Le({ name: "CircleCheck", __name: "circle-check", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("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" }), Ee("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" }) ])); } }), SQ = _Q, MQ = /* @__PURE__ */ Le({ name: "CircleClose", __name: "circle-close", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("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" }), Ee("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" }) ])); } }), sx = MQ, EQ = /* @__PURE__ */ Le({ name: "Close", __name: "close", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("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" }) ])); } }), qy = EQ, TQ = /* @__PURE__ */ Le({ name: "Delete", __name: "delete", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("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" }) ])); } }), Zm = TQ, CQ = /* @__PURE__ */ Le({ name: "Hide", __name: "hide", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("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" }), Ee("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" }) ])); } }), AQ = CQ, LQ = /* @__PURE__ */ Le({ name: "Loading", __name: "loading", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("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" }) ])); } }), JL = LQ, kQ = /* @__PURE__ */ Le({ name: "Minus", __name: "minus", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("path", { fill: "currentColor", d: "M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64" }) ])); } }), PQ = kQ, RQ = /* @__PURE__ */ Le({ name: "Plus", __name: "plus", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("path", { fill: "currentColor", d: "M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z" }) ])); } }), qg = RQ, OQ = /* @__PURE__ */ Le({ name: "View", __name: "view", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("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" }) ])); } }), DQ = OQ, IQ = /* @__PURE__ */ Le({ name: "WarningFilled", __name: "warning-filled", setup(t) { return (e, r) => (Q(), be("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ Ee("path", { fill: "currentColor", d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4" }) ])); } }), QL = IQ; const ek = "__epPropKey", ot = (t) => t, NQ = (t) => Ii(t) && !!t[ek], Xg = (t, e) => { if (!Ii(t) || NQ(t)) return t; const { values: r, required: i, default: n, type: a, validator: o } = t, s = { type: a, required: !!i, validator: r || o ? (c) => { let l = !1, u = []; if (r && (u = Array.from(r), _S(t, "default") && u.push(n), l || (l = u.includes(c))), o && (l || (l = o(c))), !l && u.length > 0) { const d = [...new Set(u)].map((h) => JSON.stringify(h)).join(", "); DT(`Invalid prop: validation failed${e ? ` for prop "${e}"` : ""}. Expected one of [${d}], got value ${JSON.stringify(c)}.`); } return l; } : void 0, [ek]: !0 }; return _S(t, "default") && (s.default = n), s; }, $t = (t) => Wm(Object.entries(t).map(([e, r]) => [ e, Xg(r, e) ])), bs = ot([ String, Object, Function ]), tk = { validating: JL, success: SQ, error: sx }, ai = (t, e) => { if (t.install = (r) => { for (const i of [t, ...Object.values(e ?? {})]) r.component(i.name, i); }, e) for (const [r, i] of Object.entries(e)) t[r] = i; return t; }, BQ = (t, e) => (t.install = (r) => { r.directive(e, t); }, t), yo = (t) => (t.install = Mh, t), pa = { 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" }, gr = "update:modelValue", ks = "change", ul = "input", rk = ["", "default", "small", "large"], gm = (t) => { const e = ji(t) ? t : [t], r = []; return e.forEach((i) => { var n; ji(i) ? r.push(...gm(i)) : oy(i) && ji(i.children) ? r.push(...gm(i.children)) : (r.push(i), oy(i) && (n = i.component) != null && n.subTree && r.push(...gm(i.component.subTree))); }), r; }, FQ = (t) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(t), Ga = (t) => t, zQ = ["class", "style"], $Q = /^on[A-Z]/, VQ = (t = {}) => { const { excludeListeners: e = !1, excludeKeys: r } = t, i = ee(() => ((r == null ? void 0 : r.value) || []).concat(zQ)), n = Ct(); return n ? ee(() => { var a; return Wm(Object.entries((a = n.proxy) == null ? void 0 : a.$attrs).filter(([o]) => !i.value.includes(o) && !(e && $Q.test(o)))); }) : (Br("use-attrs", "getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"), ee(() => ({}))); }, UQ = ({ from: t, replacement: e, scope: r, version: i, ref: n, type: a = "API" }, o) => { ze(() => N(o), (s) => { s && Br(r, `[${a}] ${t} is about to be deprecated in version ${i}, please use ${e} instead. For more detail, please visit: ${n} `); }, { immediate: !0 }); }; var jQ = { name: "en", el: { breadcrumb: { label: "Breadcrumb" }, colorpicker: { confirm: "OK", clear: "Clear", defaultLabel: "color picker", description: "current color is {color}. press enter to select a new color.", alphaLabel: "pick alpha value" }, datepicker: { now: "Now", today: "Today", cancel: "Cancel", clear: "Clear", confirm: "OK", dateTablePrompt: "Use the arrow keys and enter to select the day of the month", monthTablePrompt: "Use the arrow keys and enter to select the month", yearTablePrompt: "Use the arrow keys and enter to select the year", selectedDate: "Selected date", selectDate: "Select date", selectTime: "Select time", startDate: "Start Date", startTime: "Start Time", endDate: "End Date", endTime: "End Time", prevYear: "Previous Year", nextYear: "Next Year", prevMonth: "Previous Month", nextMonth: "Next Month", year: "", month1: "January", month2: "February", month3: "March", month4: "April", month5: "May", month6: "June", month7: "July", month8: "August", month9: "September", month10: "October", month11: "November", month12: "December", week: "week", weeks: { sun: "Sun", mon: "Mon", tue: "Tue", wed: "Wed", thu: "Thu", fri: "Fri", sat: "Sat" }, weeksFull: { sun: "Sunday", mon: "Monday", tue: "Tuesday", wed: "Wednesday", thu: "Thursday", fri: "Friday", sat: "Saturday" }, months: { jan: "Jan", feb: "Feb", mar: "Mar", apr: "Apr", may: "May", jun: "Jun", jul: "Jul", aug: "Aug", sep: "Sep", oct: "Oct", nov: "Nov", dec: "Dec" } }, inputNumber: { decrease: "decrease number", increase: "increase number" }, select: { loading: "Loading", noMatch: "No matching data", noData: "No data", placeholder: "Select" }, mention: { loading: "Loading" }, dropdown: { toggleDropdown: "Toggle Dropdown" }, cascader: { noMatch: "No matching data", loading: "Loading", placeholder: "Select", noData: "No data" }, pagination: { goto: "Go to", pagesize: "/page", total: "Total {total}", pageClassifier: "", page: "Page", prev: "Go to previous page", next: "Go to next page", currentPage: "page {pager}", prevPages: "Previous {pager} pages", nextPages: "Next {pager} pages", deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details" }, dialog: { close: "Close this dialog" }, drawer: { close: "Close this dialog" }, messagebox: { title: "Message", confirm: "OK", cancel: "Cancel", error: "Illegal input", close: "Close this dialog" }, upload: { deleteTip: "press delete to remove", delete: "Delete", preview: "Preview", continue: "Continue" }, slider: { defaultLabel: "slider between {min} and {max}", defaultRangeStartLabel: "pick start value", defaultRangeEndLabel: "pick end value" }, table: { emptyText: "No Data", confirmFilter: "Confirm", resetFilter: "Reset", clearFilter: "All", sumText: "Sum" }, tour: { next: "Next", previous: "Previous", finish: "Finish" }, tree: { emptyText: "No Data" }, transfer: { noMatch: "No matching data", noData: "No data", titles: ["List 1", "List 2"], filterPlaceholder: "Enter keyword", noCheckedFormat: "{total} items", hasCheckedFormat: "{checked}/{total} checked" }, image: { error: "FAILED" }, pageHeader: { title: "Back" }, popconfirm: { confirmButtonText: "Yes", cancelButtonText: "No" }, carousel: { leftArrow: "Carousel arrow left", rightArrow: "Carousel arrow right", indicator: "Carousel switch to index {index}" } } }; const HQ = (t) => (e, r) => GQ(e, r, N(t)), GQ = (t, e, r) => Ha(r, t, t).replace(/\{(\w+)\}/g, (i, n) => { var a; return `${(a = e == null ? void 0 : e[n]) != null ? a : `{${n}}`}`; }), WQ = (t) => { const e = ee(() => N(t).name), r = cn(t) ? t : we(t); return { lang: e, locale: r, t: HQ(t) }; }, ik = Symbol("localeContextKey"), Zg = (t) => { const e = t || Ye(ik, we()); return WQ(ee(() => e.value || jQ)); }, vm = "el", qQ = "is-", $s = (t, e, r, i, n) => { let a = `${t}-${e}`; return r && (a += `-${r}`), i && (a += `__${i}`), n && (a += `--${n}`), a; }, nk = Symbol("namespaceContextKey"), lx = (t) => { const e = t || (Ct() ? Ye(nk, we(vm)) : we(vm)); return ee(() => N(e) || vm); }, Pt = (t, e) => { const r = lx(e); return { namespace: r, b: (i = "") => $s(r.value, t, i, "", ""), e: (i) => i ? $s(r.value, t, "", i, "") : "", m: (i) => i ? $s(r.value, t, "", "", i) : "", be: (i, n) => i && n ? $s(r.value, t, i, n, "") : "", em: (i, n) => i && n ? $s(r.value, t, "", i, n) : "", bm: (i, n) => i && n ? $s(r.value, t, i, "", n) : "", bem: (i, n, a) => i && n && a ? $s(r.value, t, i, n, a) : "", is: (i, ...n) => { const a = n.length >= 1 ? n[0] : !0; return i && a ? `${qQ}${i}` : ""; }, cssVar: (i) => { const n = {}; for (const a in i) i[a] && (n[`--${r.value}-${a}`] = i[a]); return n; }, cssVarName: (i) => `--${r.value}-${i}`, cssVarBlock: (i) => { const n = {}; for (const a in i) i[a] && (n[`--${r.value}-${t}-${a}`] = i[a]); return n; }, cssVarBlockName: (i) => `--${r.value}-${t}-${i}` }; }, XQ = Xg({ type: ot(Boolean), default: null }), ZQ = Xg({ type: ot(Function) }), YQ = (t) => { const e = `update:${t}`, r = `onUpdate:${t}`, i = [e], n = { [t]: XQ, [r]: ZQ }; return { useModelToggle: ({ indicator: a, toggleReason: o, shouldHideWhenRouteChanges: s, shouldProceed: c, onShow: l, onHide: u }) => { const d = Ct(), { emit: h } = d, f = d.props, p = ee(() => Mi(f[r])), m = ee(() => f[t] === null), y = (_) => { a.value !== !0 && (a.value = !0, o && (o.value = _), Mi(l) && l(_)); }, g = (_) => { a.value !== !1 && (a.value = !1, o && (o.value = _), Mi(u) && u(_)); }, v = (_) => { if (f.disabled === !0 || Mi(c) && !c()) return; const b = p.value && Ur; b && h(e, !0), (m.value || !b) && y(_); }, x = (_) => { if (f.disabled === !0 || !Ur) return; const b = p.value && Ur; b && h(e, !1), (m.value || !b) && g(_); }, w = (_) => { ax(_) && (f.disabled && _ ? p.value && h(e, !1) : a.value !== _ && (_ ? y() : g())); }, S = () => { a.value ? x() : v(); }; return ze(() => f[t], w), s && d.appContext.config.globalProperties.$route !== void 0 && ze(() => ({ ...d.proxy.$route }), () => { s.value && a.value && x(); }), Lt(() => { w(f[t]); }), { hide: x, show: v, toggle: S, hasUpdateHandler: p }; }, useModelToggleProps: n, useModelToggleEmits: i }; }, ak = (t) => { const e = Ct(); return ee(() => { var r, i; return (i = (r = e == null ? void 0 : e.proxy) == null ? void 0 : r.$props) == null ? void 0 : i[t]; }); }; var qi = "top", Tn = "bottom", Cn = "right", Xi = "left", cx = "auto", hp = [qi, Tn, Cn, Xi], su = "start", Ch = "end", KQ = "clippingParents", ok = "viewport", bd = "popper", JQ = "reference", YS = hp.reduce(function(t, e) { return t.concat([e + "-" + su, e + "-" + Ch]); }, []), Zu = [].concat(hp, [cx]).reduce(function(t, e) { return t.concat([e, e + "-" + su, e + "-" + Ch]); }, []), QQ = "beforeRead", eee = "read", tee = "afterRead", ree = "beforeMain", iee = "main", nee = "afterMain", aee = "beforeWrite", oee = "write", see = "afterWrite", lee = [QQ, eee, tee, ree, iee, nee, aee, oee, see]; function xa(t) { return t ? (t.nodeName || "").toLowerCase() : null; } function Kn(t) { if (t == null) return window; if (t.toString() !== "[object Window]") { var e = t.ownerDocument; return e && e.defaultView || window; } return t; } function lu(t) { var e = Kn(t).Element; return t instanceof e || t instanceof Element; } function Sn(t) { var e = Kn(t).HTMLElement; return t instanceof e || t instanceof HTMLElement; } function ux(t) { if (typeof ShadowRoot > "u") return !1; var e = Kn(t).ShadowRoot; return t instanceof e || t instanceof ShadowRoot; } function cee(t) { var e = t.state; Object.keys(e.elements).forEach(function(r) { var i = e.styles[r] || {}, n = e.attributes[r] || {}, a = e.elements[r]; !Sn(a) || !xa(a) || (Object.assign(a.style, i), Object.keys(n).forEach(function(o) { var s = n[o]; s === !1 ? a.removeAttribute(o) : a.setAttribute(o, s === !0 ? "" : s); })); }); } function uee(t) { var e = t.state, r = { popper: { position: e.options.strategy, left: "0", top: "0", margin: "0" }, arrow: { position: "absolute" }, reference: {} }; return Object.assign(e.elements.popper.style, r.popper), e.styles = r, e.elements.arrow && Object.assign(e.elements.arrow.style, r.arrow), function() { Object.keys(e.elements).forEach(function(i) { var n = e.elements[i], a = e.attributes[i] || {}, o = Object.keys(e.styles.hasOwnProperty(i) ? e.styles[i] : r[i]), s = o.reduce(function(c, l) { return c[l] = "", c; }, {}); !Sn(n) || !xa(n) || (Object.assign(n.style, s), Object.keys(a).forEach(function(c) { n.removeAttribute(c); })); }); }; } var sk = { name: "applyStyles", enabled: !0, phase: "write", fn: cee, effect: uee, requires: ["computeStyles"] }; function fa(t) { return t.split("-")[0]; } var dl = Math.max, Ym = Math.min, cu = Math.round; function uu(t, e) { e === void 0 && (e = !1); var r = t.getBoundingClientRect(), i = 1, n = 1; if (Sn(t) && e) { var a = t.offsetHeight, o = t.offsetWidth; o > 0 && (i = cu(r.width) / o || 1), a > 0 && (n = cu(r.height) / a || 1); } return { width: r.width / i, height: r.height / n, top: r.top / n, right: r.right / i, bottom: r.bottom / n, left: r.left / i, x: r.left / i, y: r.top / n }; } function dx(t) { var e = uu(t), r = t.offsetWidth, i = t.offsetHeight; return Math.abs(e.width - r) <= 1 && (r = e.width), Math.abs(e.height - i) <= 1 && (i = e.height), { x: t.offsetLeft, y: t.offsetTop, width: r, height: i }; } function lk(t, e) { var r = e.getRootNode && e.getRootNode(); if (t.contains(e)) return !0; if (r && ux(r)) { var i = e; do { if (i && t.isSameNode(i)) return !0; i = i.parentNode || i.host; } while (i); } return !1; } function ao(t) { return Kn(t).getComputedStyle(t); } function dee(t) { return ["table", "td", "th"].indexOf(xa(t)) >= 0; } function Ps(t) { return ((lu(t) ? t.ownerDocument : t.document) || window.document).documentElement; } function Yg(t) { return xa(t) === "html" ? t : t.assignedSlot || t.parentNode || (ux(t) ? t.host : null) || Ps(t); } function KS(t) { return !Sn(t) || ao(t).position === "fixed" ? null : t.offsetParent; } function hee(t) { var e = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1, r = navigator.userAgent.indexOf("Trident") !== -1; if (r && Sn(t)) { var i = ao(t); if (i.position === "fixed") return null; } var n = Yg(t); for (ux(n) && (n = n.host); Sn(n) && ["html", "body"].indexOf(xa(n)) < 0; ) { var a = ao(n); if (a.transform !== "none" || a.perspective !== "none" || a.contain === "paint" || ["transform", "perspective"].indexOf(a.willChange) !== -1 || e && a.willChange === "filter" || e && a.filter && a.filter !== "none") return n; n = n.parentNode; } return null; } function pp(t) { for (var e = Kn(t), r = KS(t); r && dee(r) && ao(r).position === "static"; ) r = KS(r); return r && (xa(r) === "html" || xa(r) === "body" && ao(r).position === "static") ? e : r || hee(t) || e; } function hx(t) { return ["top", "bottom"].indexOf(t) >= 0 ? "x" : "y"; } function Jd(t, e, r) { return dl(t, Ym(e, r)); } function pee(t, e, r) { var i = Jd(t, e, r); return i > r ? r : i; } function ck() { return { top: 0, right: 0, bottom: 0, left: 0 }; } function uk(t) { return Object.assign({}, ck(), t); } function dk(t, e) { return e.reduce(function(r, i) { return r[i] = t, r; }, {}); } var fee = function(t, e) { return t = typeof t == "function" ? t(Object.assign({}, e.rects, { placement: e.placement })) : t, uk(typeof t != "number" ? t : dk(t, hp)); }; function mee(t) { var e, r = t.state, i = t.name, n = t.options, a = r.elements.arrow, o = r.modifiersData.popperOffsets, s = fa(r.placement), c = hx(s), l = [Xi, Cn].indexOf(s) >= 0, u = l ? "height" : "width"; if (!(!a || !o)) { var d = fee(n.padding, r), h = dx(a), f = c === "y" ? qi : Xi, p = c === "y" ? Tn : Cn, m = r.rects.reference[u] + r.rects.reference[c] - o[c] - r.rects.popper[u], y = o[c] - r.rects.reference[c], g = pp(a), v = g ? c === "y" ? g.clientHeight || 0 : g.clientWidth || 0 : 0, x = m / 2 - y / 2, w = d[f], S = v - h[u] - d[p], _ = v / 2 - h[u] / 2 + x, b = Jd(w, _, S), T = c; r.modifiersData[i] = (e = {}, e[T] = b, e.centerOffset = b - _, e); } } function gee(t) { var e = t.state, r = t.options, i = r.element, n = i === void 0 ? "[data-popper-arrow]" : i; n != null && (typeof n == "string" && (n = e.elements.popper.querySelector(n), !n) || !lk(e.elements.popper, n) || (e.elements.arrow = n)); } var vee = { name: "arrow", enabled: !0, phase: "main", fn: mee, effect: gee, requires: ["popperOffsets"], requiresIfExists: ["preventOverflow"] }; function du(t) { return t.split("-")[1]; } var yee = { top: "auto", right: "auto", bottom: "auto", left: "auto" }; function bee(t) { var e = t.x, r = t.y, i = window, n = i.devicePixelRatio || 1; return { x: cu(e * n) / n || 0, y: cu(r * n) / n || 0 }; } function JS(t) { var e, r = t.popper, i = t.popperRect, n = t.placement, a = t.variation, o = t.offsets, s = t.position, c = t.gpuAcceleration, l = t.adaptive, u = t.roundOffsets, d = t.isFixed, h = o.x, f = h === void 0 ? 0 : h, p = o.y, m = p === void 0 ? 0 : p, y = typeof u == "function" ? u({ x: f, y: m }) : { x: f, y: m }; f = y.x, m = y.y; var g = o.hasOwnProperty("x"), v = o.hasOwnProperty("y"), x = Xi, w = qi, S = window; if (l) { var _ = pp(r), b = "clientHeight", T = "clientWidth"; if (_ === Kn(r) && (_ = Ps(r), ao(_).position !== "static" && s === "absolute" && (b = "scrollHeight", T = "scrollWidth")), _ = _, n === qi || (n === Xi || n === Cn) && a === Ch) { w = Tn; var E = d && _ === S && S.visualViewport ? S.visualViewport.height : _[b]; m -= E - i.height, m *= c ? 1 : -1; } if (n === Xi || (n === qi || n === Tn) && a === Ch) { x = Cn; var C = d && _ === S && S.visualViewport ? S.visualViewport.width : _[T]; f -= C - i.width, f *= c ? 1 : -1; } } var L = Object.assign({ position: s }, l && yee), A = u === !0 ? bee({ x: f, y: m }) : { x: f, y: m }; if (f = A.x, m = A.y, c) { var k; return Object.assign({}, L, (k = {}, k[w] = v ? "0" : "", k[x] = g ? "0" : "", k.transform = (S.devicePixelRatio || 1) <= 1 ? "translate(" + f + "px, " + m + "px)" : "translate3d(" + f + "px, " + m + "px, 0)", k)); } return Object.assign({}, L, (e = {}, e[w] = v ? m + "px" : "", e[x] = g ? f + "px" : "", e.transform = "", e)); } function xee(t) { var e = t.state, r = t.options, i = r.gpuAcceleration, n = i === void 0 ? !0 : i, a = r.adaptive, o = a === void 0 ? !0 : a, s = r.roundOffsets, c = s === void 0 ? !0 : s, l = { placement: fa(e.placement), variation: du(e.placement), popper: e.elements.popper, popperRect: e.rects.popper, gpuAcceleration: n, isFixed: e.options.strategy === "fixed" }; e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, JS(Object.assign({}, l, { offsets: e.modifiersData.popperOffsets, position: e.options.strategy, adaptive: o, roundOffsets: c })))), e.modifiersData.arrow != null && (e.styles.arrow = Object.assign({}, e.styles.arrow, JS(Object.assign({}, l, { offsets: e.modifiersData.arrow, position: "absolute", adaptive: !1, roundOffsets: c })))), e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-placement": e.placement }); } var hk = { name: "computeStyles", enabled: !0, phase: "beforeWrite", fn: xee, data: {} }, ef = { passive: !0 }; function wee(t) { var e = t.state, r = t.instance, i = t.options, n = i.scroll, a = n === void 0 ? !0 : n, o = i.resize, s = o === void 0 ? !0 : o, c = Kn(e.elements.popper), l = [].concat(e.scrollParents.reference, e.scrollParents.popper); return a && l.forEach(function(u) { u.addEventListener("scroll", r.update, ef); }), s && c.addEventListener("resize", r.update, ef), function() { a && l.forEach(function(u) { u.removeEventListener("scroll", r.update, ef); }), s && c.removeEventListener("resize", r.update, ef); }; } var pk = { name: "eventListeners", enabled: !0, phase: "write", fn: function() { }, effect: wee, data: {} }, _ee = { left: "right", right: "left", bottom: "top", top: "bottom" }; function ym(t) { return t.replace(/left|right|bottom|top/g, function(e) { return _ee[e]; }); } var See = { start: "end", end: "start" }; function QS(t) { return t.replace(/start|end/g, function(e) { return See[e]; }); } function px(t) { var e = Kn(t), r = e.pageXOffset, i = e.pageYOffset; return { scrollLeft: r, scrollTop: i }; } function fx(t) { return uu(Ps(t)).left + px(t).scrollLeft; } function Mee(t) { var e = Kn(t), r = Ps(t), i = e.visualViewport, n = r.clientWidth, a = r.clientHeight, o = 0, s = 0; return i && (n = i.width, a = i.height, /^((?!chrome|android).)*safari/i.test(navigator.userAgent) || (o = i.offsetLeft, s = i.offsetTop)), { width: n, height: a, x: o + fx(t), y: s }; } function Eee(t) { var e, r = Ps(t), i = px(t), n = (e = t.ownerDocument) == null ? void 0 : e.body, a = dl(r.scrollWidth, r.clientWidth, n ? n.scrollWidth : 0, n ? n.clientWidth : 0), o = dl(r.scrollHeight, r.clientHeight, n ? n.scrollHeight : 0, n ? n.clientHeight : 0), s = -i.scrollLeft + fx(t), c = -i.scrollTop; return ao(n || r).direction === "rtl" && (s += dl(r.clientWidth, n ? n.clientWidth : 0) - a), { width: a, height: o, x: s, y: c }; } function mx(t) { var e = ao(t), r = e.overflow, i = e.overflowX, n = e.overflowY; return /auto|scroll|overlay|hidden/.test(r + n + i); } function fk(t) { return ["html", "body", "#document"].indexOf(xa(t)) >= 0 ? t.ownerDocument.body : Sn(t) && mx(t) ? t : fk(Yg(t)); } function Qd(t, e) { var r; e === void 0 && (e = []); var i = fk(t), n = i === ((r = t.ownerDocument) == null ? void 0 : r.body), a = Kn(i), o = n ? [a].concat(a.visualViewport || [], mx(i) ? i : []) : i, s = e.concat(o); return n ? s : s.concat(Qd(Yg(o))); } function Xy(t) { return Object.assign({}, t, { left: t.x, top: t.y, right: t.x + t.width, bottom: t.y + t.height }); } function Tee(t) { var e = uu(t); return e.top = e.top + t.clientTop, e.left = e.left + t.clientLeft, e.bottom = e.top + t.clientHeight, e.right = e.left + t.clientWidth, e.width = t.clientWidth, e.height = t.clientHeight, e.x = e.left, e.y = e.top, e; } function eM(t, e) { return e === ok ? Xy(Mee(t)) : lu(e) ? Tee(e) : Xy(Eee(Ps(t))); } function Cee(t) { var e = Qd(Yg(t)), r = ["absolute", "fixed"].indexOf(ao(t).position) >= 0, i = r && Sn(t) ? pp(t) : t; return lu(i) ? e.filter(function(n) { return lu(n) && lk(n, i) && xa(n) !== "body"; }) : []; } function Aee(t, e, r) { var i = e === "clippingParents" ? Cee(t) : [].concat(e), n = [].concat(i, [r]), a = n[0], o = n.reduce(function(s, c) { var l = eM(t, c); return s.top = dl(l.top, s.top), s.right = Ym(l.right, s.right), s.bottom = Ym(l.bottom, s.bottom), s.left = dl(l.left, s.left), s; }, eM(t, a)); return o.width = o.right - o.left, o.height = o.bottom - o.top, o.x = o.left, o.y = o.top, o; } function mk(t) { var e = t.reference, r = t.element, i = t.placement, n = i ? fa(i) : null, a = i ? du(i) : null, o = e.x + e.width / 2 - r.width / 2, s = e.y + e.height / 2 - r.height / 2, c; switch (n) { case qi: c = { x: o, y: e.y - r.height }; break; case Tn: c = { x: o, y: e.y + e.height }; break; case Cn: c = { x: e.x + e.width, y: s }; break; case Xi: c = { x: e.x - r.width, y: s }; break; default: c = { x: e.x, y: e.y }; } var l = n ? hx(n) : null; if (l != null) { var u = l === "y" ? "height" : "width"; switch (a) { case su: c[l] = c[l] - (e[u] / 2 - r[u] / 2); break; case Ch: c[l] = c[l] + (e[u] / 2 - r[u] / 2); break; } } return c; } function Ah(t, e) { e === void 0 && (e = {}); var r = e, i = r.placement, n = i === void 0 ? t.placement : i, a = r.boundary, o = a === void 0 ? KQ : a, s = r.rootBoundary, c = s === void 0 ? ok : s, l = r.elementContext, u = l === void 0 ? bd : l, d = r.altBoundary, h = d === void 0 ? !1 : d, f = r.padding, p = f === void 0 ? 0 : f, m = uk(typeof p != "number" ? p : dk(p, hp)), y = u === bd ? JQ : bd, g = t.rects.popper, v = t.elements[h ? y : u], x = Aee(lu(v) ? v : v.contextElement || Ps(t.elements.popper), o, c), w = uu(t.elements.reference), S = mk({ reference: w, element: g, strategy: "absolute", placement: n }), _ = Xy(Object.assign({}, g, S)), b = u === bd ? _ : w, T = { top: x.top - b.top + m.top, bottom: b.bottom - x.bottom + m.bottom, left: x.left - b.left + m.left, right: b.right - x.right + m.right }, E = t.modifiersData.offset; if (u === bd && E) { var C = E[n]; Object.keys(T).forEach(function(L) { var A = [Cn, Tn].indexOf(L) >= 0 ? 1 : -1, k = [qi, Tn].indexOf(L) >= 0 ? "y" : "x"; T[L] += C[k] * A; }); } return T; } function Lee(t, e) { e === void 0 && (e = {}); var r = e, i = r.placement, n = r.boundary, a = r.rootBoundary, o = r.padding, s = r.flipVariations, c = r.allowedAutoPlacements, l = c === void 0 ? Zu : c, u = du(i), d = u ? s ? YS : YS.filter(function(p) { return du(p) === u; }) : hp, h = d.filter(function(p) { return l.indexOf(p) >= 0; }); h.length === 0 && (h = d); var f = h.reduce(function(p, m) { return p[m] = Ah(t, { placement: m, boundary: n, rootBoundary: a, padding: o })[fa(m)], p; }, {}); return Object.keys(f).sort(function(p, m) { return f[p] - f[m]; }); } function kee(t) { if (fa(t) === cx) return []; var e = ym(t); return [QS(t), e, QS(e)]; } function Pee(t) { var e = t.state, r = t.options, i = t.name; if (!e.modifiersData[i]._skip) { for (var n = r.mainAxis, a = n === void 0 ? !0 : n, o = r.altAxis, s = o === void 0 ? !0 : o, c = r.fallbackPlacements, l = r.padding, u = r.boundary, d = r.rootBoundary, h = r.altBoundary, f = r.flipVariations, p = f === void 0 ? !0 : f, m = r.allowedAutoPlacements, y = e.options.placement, g = fa(y), v = g === y, x = c || (v || !p ? [ym(y)] : kee(y)), w = [y].concat(x).reduce(function(re, K) { return re.concat(fa(K) === cx ? Lee(e, { placement: K, boundary: u, rootBoundary: d, padding: l, flipVariations: p, allowedAutoPlacements: m }) : K); }, []), S = e.rects.reference, _ = e.rects.popper, b = /* @__PURE__ */ new Map(), T = !0, E = w[0], C = 0; C < w.length; C++) { var L = w[C], A = fa(L), k = du(L) === su, P = [qi, Tn].indexOf(A) >= 0, R = P ? "width" : "height", M = Ah(e, { placement: L, boundary: u, rootBoundary: d, altBoundary: h, padding: l }), O = P ? k ? Cn : Xi : k ? Tn : qi; S[R] > _[R] && (O = ym(O)); var D = ym(O), I = []; if (a && I.push(M[A] <= 0), s && I.push(M[O] <= 0, M[D] <= 0), I.every(function(re) { return re; })) { E = L, T = !1; break; } b.set(L, I); } if (T) for (var F = p ? 3 : 1, z = function(re) { var K = w.find(function(V) { var H = b.get(V); if (H) return H.slice(0, re).every(function(G) { return G; }); }); if (K) return E = K, "break"; }, U = F; U > 0; U--) { var Z = z(U); if (Z === "break") break; } e.placement !== E && (e.modifiersData[i]._skip = !0, e.placement = E, e.reset = !0); } } var Ree = { name: "flip", enabled: !0, phase: "main", fn: Pee, requiresIfExists: ["offset"], data: { _skip: !1 } }; function tM(t, e, r) { return r === void 0 && (r = { x: 0, y: 0 }), { top: t.top - e.height - r.y, right: t.right - e.width + r.x, bottom: t.bottom - e.height + r.y, left: t.left - e.width - r.x }; } function rM(t) { return [qi, Cn, Tn, Xi].some(function(e) { return t[e] >= 0; }); } function Oee(t) { var e = t.state, r = t.name, i = e.rects.reference, n = e.rects.popper, a = e.modifiersData.preventOverflow, o = Ah(e, { elementContext: "reference" }), s = Ah(e, { altBoundary: !0 }), c = tM(o, i), l = tM(s, n, a), u = rM(c), d = rM(l); e.modifiersData[r] = { referenceClippingOffsets: c, popperEscapeOffsets: l, isReferenceHidden: u, hasPopperEscaped: d }, e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-reference-hidden": u, "data-popper-escaped": d }); } var Dee = { name: "hide", enabled: !0, phase: "main", requiresIfExists: ["preventOverflow"], fn: Oee }; function Iee(t, e, r) { var i = fa(t), n = [Xi, qi].indexOf(i) >= 0 ? -1 : 1, a = typeof r == "function" ? r(Object.assign({}, e, { placement: t })) : r, o = a[0], s = a[1]; return o = o || 0, s = (s || 0) * n, [Xi, Cn].indexOf(i) >= 0 ? { x: s, y: o } : { x: o, y: s }; } function Nee(t) { var e = t.state, r = t.options, i = t.name, n = r.offset, a = n === void 0 ? [0, 0] : n, o = Zu.reduce(function(u, d) { return u[d] = Iee(d, e.rects, a), u; }, {}), s = o[e.placement], c = s.x, l = s.y; e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += c, e.modifiersData.popperOffsets.y += l), e.modifiersData[i] = o; } var Bee = { name: "offset", enabled: !0, phase: "main", requires: ["popperOffsets"], fn: Nee }; function Fee(t) { var e = t.state, r = t.name; e.modifiersData[r] = mk({ reference: e.rects.reference, element: e.rects.popper, strategy: "absolute", placement: e.placement }); } var gk = { name: "popperOffsets", enabled: !0, phase: "read", fn: Fee, data: {} }; function zee(t) { return t === "x" ? "y" : "x"; } function $ee(t) { var e = t.state, r = t.options, i = t.name, n = r.mainAxis, a = n === void 0 ? !0 : n, o = r.altAxis, s = o === void 0 ? !1 : o, c = r.boundary, l = r.rootBoundary, u = r.altBoundary, d = r.padding, h = r.tether, f = h === void 0 ? !0 : h, p = r.tetherOffset, m = p === void 0 ? 0 : p, y = Ah(e, { boundary: c, rootBoundary: l, padding: d, altBoundary: u }), g = fa(e.placement), v = du(e.placement), x = !v, w = hx(g), S = zee(w), _ = e.modifiersData.popperOffsets, b = e.rects.reference, T = e.rects.popper, E = typeof m == "function" ? m(Object.assign({}, e.rects, { placement: e.placement })) : m, C = typeof E == "number" ? { mainAxis: E, altAxis: E } : Object.assign({ mainAxis: 0, altAxis: 0 }, E), L = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, A = { x: 0, y: 0 }; if (_) { if (a) { var k, P = w === "y" ? qi : Xi, R = w === "y" ? Tn : Cn, M = w === "y" ? "height" : "width", O = _[w], D = O + y[P], I = O - y[R], F = f ? -T[M] / 2 : 0, z = v === su ? b[M] : T[M], U = v === su ? -T[M] : -b[M], Z = e.elements.arrow, re = f && Z ? dx(Z) : { width: 0, height: 0 }, K = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : ck(), V = K[P], H = K[R], G = Jd(0, b[M], re[M]), W = x ? b[M] / 2 - F - G - V - C.mainAxis : z - G - V - C.mainAxis, Y = x ? -b[M] / 2 + F + G + H + C.mainAxis : U + G + H + C.mainAxis, X = e.elements.arrow && pp(e.elements.arrow), ie = X ? w === "y" ? X.clientTop || 0 : X.clientLeft || 0 : 0, ue = (k = L == null ? void 0 : L[w]) != null ? k : 0, $ = O + W - ue - ie, J = O + Y - ue, ne = Jd(f ? Ym(D, $) : D, O, f ? dl(I, J) : I); _[w] = ne, A[w] = ne - O; } if (s) { var j, q = w === "x" ? qi : Xi, ge = w === "x" ? Tn : Cn, ye = _[S], _e = S === "y" ? "height" : "width", Me = ye + y[q], Ce = ye - y[ge], B = [qi, Xi].indexOf(g) !== -1, ce = (j = L == null ? void 0 : L[S]) != null ? j : 0, ve = B ? Me : ye - b[_e] - T[_e] - ce + C.altAxis, te = B ? ye + b[_e] + T[_e] - ce - C.altAxis : Ce, pe = f && B ? pee(ve, ye, te) : Jd(f ? ve : Me, ye, f ? te : Ce); _[S] = pe, A[S] = pe - ye; } e.modifiersData[i] = A; } } var Vee = { name: "preventOverflow", enabled: !0, phase: "main", fn: $ee, requiresIfExists: ["offset"] }; function Uee(t) { return { scrollLeft: t.scrollLeft, scrollTop: t.scrollTop }; } function jee(t) { return t === Kn(t) || !Sn(t) ? px(t) : Uee(t); } function Hee(t) { var e = t.getBoundingClientRect(), r = cu(e.width) / t.offsetWidth || 1, i = cu(e.height) / t.offsetHeight || 1; return r !== 1 || i !== 1; } function Gee(t, e, r) { r === void 0 && (r = !1); var i = Sn(e), n = Sn(e) && Hee(e), a = Ps(e), o = uu(t, n), s = { scrollLeft: 0, scrollTop: 0 }, c = { x: 0, y: 0 }; return (i || !i && !r) && ((xa(e) !== "body" || mx(a)) && (s = jee(e)), Sn(e) ? (c = uu(e, !0), c.x += e.clientLeft, c.y += e.clientTop) : a && (c.x = fx(a))), { x: o.left + s.scrollLeft - c.x, y: o.top + s.scrollTop - c.y, width: o.width, height: o.height }; } function Wee(t) { var e = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), i = []; t.forEach(function(a) { e.set(a.name, a); }); function n(a) { r.add(a.name); var o = [].concat(a.requires || [], a.requiresIfExists || []); o.forEach(function(s) { if (!r.has(s)) { var c = e.get(s); c && n(c); } }), i.push(a); } return t.forEach(function(a) { r.has(a.name) || n(a); }), i; } function qee(t) { var e = Wee(t); return lee.reduce(function(r, i) { return r.concat(e.filter(function(n) { return n.phase === i; })); }, []); } function Xee(t) { var e; return function() { return e || (e = new Promise(function(r) { Promise.resolve().then(function() { e = void 0, r(t()); }); })), e; }; } function Zee(t) { var e = t.reduce(function(r, i) { var n = r[i.name]; return r[i.name] = n ? Object.assign({}, n, i, { options: Object.assign({}, n.options, i.options), data: Object.assign({}, n.data, i.data) }) : i, r; }, {}); return Object.keys(e).map(function(r) { return e[r]; }); } var iM = { placement: "bottom", modifiers: [], strategy: "absolute" }; function nM() { for (var t = arguments.length, e = new Array(t), r = 0; r < t; r++) e[r] = arguments[r]; return !e.some(function(i) { return !(i && typeof i.getBoundingClientRect == "function"); }); } function gx(t) { t === void 0 && (t = {}); var e = t, r = e.defaultModifiers, i = r === void 0 ? [] : r, n = e.defaultOptions, a = n === void 0 ? iM : n; return function(o, s, c) { c === void 0 && (c = a); var l = { placement: "bottom", orderedModifiers: [], options: Object.assign({}, iM, a), modifiersData: {}, elements: { reference: o, popper: s }, attributes: {}, styles: {} }, u = [], d = !1, h = { state: l, setOptions: function(m) { var y = typeof m == "function" ? m(l.options) : m; p(), l.options = Object.assign({}, a, l.options, y), l.scrollParents = { reference: lu(o) ? Qd(o) : o.contextElement ? Qd(o.contextElement) : [], popper: Qd(s) }; var g = qee(Zee([].concat(i, l.options.modifiers))); return l.orderedModifiers = g.filter(function(v) { return v.enabled; }), f(), h.update(); }, forceUpdate: function() { if (!d) { var m = l.elements, y = m.reference, g = m.popper; if (nM(y, g)) { l.rects = { reference: Gee(y, pp(g), l.options.strategy === "fixed"), popper: dx(g) }, l.reset = !1, l.placement = l.options.placement, l.orderedModifiers.forEach(function(T) { return l.modifiersData[T.name] = Object.assign({}, T.data); }); for (var v = 0; v < l.orderedModifiers.length; v++) { if (l.reset === !0) { l.reset = !1, v = -1; continue; } var x = l.orderedModifiers[v], w = x.fn, S = x.options, _ = S === void 0 ? {} : S, b = x.name; typeof w == "function" && (l = w({ state: l, options: _, name: b, instance: h }) || l); } } } }, update: Xee(function() { return new Promise(function(m) { h.forceUpdate(), m(l); }); }), destroy: function() { p(), d = !0; } }; if (!nM(o, s)) return h; h.setOptions(c).then(function(m) { !d && c.onFirstUpdate && c.onFirstUpdate(m); }); function f() { l.orderedModifiers.forEach(function(m) { var y = m.name, g = m.options, v = g === void 0 ? {} : g, x = m.effect; if (typeof x == "function") { var w = x({ state: l, name: y, instance: h, options: v }), S = function() { }; u.push(w || S); } }); } function p() { u.forEach(function(m) { return m(); }), u = []; } return h; }; } gx(); var Yee = [pk, gk, hk, sk]; gx({ defaultModifiers: Yee }); var Kee = [pk, gk, hk, sk, Bee, Ree, Vee, vee, Dee], Jee = gx({ defaultModifiers: Kee }); const Qee = (t, e, r = {}) => { const i = { name: "updateState", enabled: !0, phase: "write", fn: ({ state: c }) => { const l = ete(c); Object.assign(o.value, l); }, requires: ["computeStyles"] }, n = ee(() => { const { onFirstUpdate: c, placement: l, strategy: u, modifiers: d } = N(r); return { onFirstUpdate: c, placement: l || "bottom", strategy: u || "absolute", modifiers: [ ...d || [], i, { name: "applyStyles", enabled: !1 } ] }; }), a = mr(), o = we({ styles: { popper: { position: N(n).strategy, left: "0", top: "0" }, arrow: { position: "absolute" } }, attributes: {} }), s = () => { a.value && (a.value.destroy(), a.value = void 0); }; return ze(n, (c) => { const l = N(a); l && l.setOptions(c); }, { deep: !0 }), ze([t, e], ([c, l]) => { s(), !(!c || !l) && (a.value = Jee(c, l, N(n))); }), Sr(() => { s(); }), { state: ee(() => { var c; return { ...((c = N(a)) == null ? void 0 : c.state) || {} }; }), styles: ee(() => N(o).styles), attributes: ee(() => N(o).attributes), update: () => { var c; return (c = N(a)) == null ? void 0 : c.update(); }, forceUpdate: () => { var c; return (c = N(a)) == null ? void 0 : c.forceUpdate(); }, instanceRef: ee(() => N(a)) }; }; function ete(t) { const e = Object.keys(t.elements), r = Wm(e.map((n) => [n, t.styles[n] || {}])), i = Wm(e.map((n) => [n, t.attributes[n]])); return { styles: r, attributes: i }; } function aM() { let t; const e = (i, n) => { r(), t = window.setTimeout(i, n); }, r = () => window.clearTimeout(t); return Vg(() => r()), { registerTimeout: e, cancelTimeout: r }; } const Zy = { prefix: Math.floor(Math.random() * 1e4), current: 0 }, tte = Symbol("elIdInjection"), vx = () => Ct() ? Ye(tte, Zy) : Zy, Kg = (t) => { const e = vx(); !Ur && e === Zy && Br("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 = lx(); return ee(() => N(t) || `${r.value}-id-${e.prefix}-${e.current++}`); }; let Pc = []; const oM = (t) => { const e = t; e.key === pa.esc && Pc.forEach((r) => r(e)); }, rte = (t) => { Lt(() => { Pc.length === 0 && document.addEventListener("keydown", oM), Ur && Pc.push(t); }), Sr(() => { Pc = Pc.filter((e) => e !== t), Pc.length === 0 && Ur && document.removeEventListener("keydown", oM); }); }; let sM; const vk = () => { const t = lx(), e = vx(), r = ee(() => `${t.value}-popper-container-${e.prefix}`), i = ee(() => `#${r.value}`); return { id: r, selector: i }; }, ite = (t) => { const e = document.createElement("div"); return e.id = t, document.body.appendChild(e), e; }, nte = () => { const { id: t, selector: e } = vk(); return IT(() => { Ur && (process.env.NODE_ENV === "test" || !sM || !document.body.querySelector(e.value)) && (sM = ite(t.value)); }), { id: t, selector: e }; }, ate = $t({ showAfter: { type: Number, default: 0 }, hideAfter: { type: Number, default: 200 }, autoClose: { type: Number, default: 0 } }), ote = ({ showAfter: t, hideAfter: e, autoClose: r, open: i, close: n }) => { const { registerTimeout: a } = aM(), { registerTimeout: o, cancelTimeout: s } = aM(); return { onOpen: (c) => { a(() => { i(c); const l = N(r); Jt(l) && l > 0 && o(() => { n(c); }, l); }, N(t)); }, onClose: (c) => { s(), a(() => { n(c); }, N(e)); } }; }, yk = Symbol("elForwardRef"), ste = (t) => { Dt(yk, { setForwardRef: (e) => { t.value = e; } }); }, lte = (t) => ({ mounted(e) { t(e); }, updated(e) { t(e); }, unmounted() { t(null); } }), lM = { current: 0 }, cM = we(0), bk = 2e3, uM = Symbol("elZIndexContextKey"), xk = Symbol("zIndexContextKey"), wk = (t) => { const e = Ct() ? Ye(uM, lM) : lM, r = t || (Ct() ? Ye(xk, void 0) : void 0), i = ee(() => { const o = N(r); return Jt(o) ? o : bk; }), n = ee(() => i.value + cM.value), a = () => (e.current++, cM.value = e.current, n.value); return !Ur && !Ye(uM) && Br("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: i, currentZIndex: n, nextZIndex: a }; }; function cte(t) { let e; function r() { if (t.value == null) return; const { selectionStart: n, selectionEnd: a, value: o } = t.value; if (n == null || a == null) return; const s = o.slice(0, Math.max(0, n)), c = o.slice(Math.max(0, a)); e = { selectionStart: n, selectionEnd: a, value: o, beforeTxt: s, afterTxt: c }; } function i() { if (t.value == null || e == null) return; const { value: n } = t.value, { beforeTxt: a, afterTxt: o, selectionStart: s } = e; if (a == null || o == null || s == null) return; let c = n.length; if (n.endsWith(o)) c = n.length - o.length; else if (n.startsWith(a)) c = a.length; else { const l = a[s - 1], u = n.indexOf(l, s - 1); u !== -1 && (c = u + 1); } t.value.setSelectionRange(c, c); } return [r, i]; } const ute = (t, e, r) => gm(t.subTree).filter((i) => { var n; return oy(i) && ((n = i.type) == null ? void 0 : n.name) === e && !!i.component; }).map((i) => i.component.uid).map((i) => r[i]).filter((i) => !!i), dte = (t, e) => { const r = {}, i = mr([]); return { children: i, addChild: (n) => { r[n.uid] = n, i.value = ute(t, e, r); }, removeChild: (n) => { delete r[n], i.value = i.value.filter((a) => a.uid !== n); } }; }, hu = Xg({ type: String, values: rk, required: !1 }), _k = Symbol("size"), hte = () => { const t = Ye(_k, {}); return ee(() => N(t.size) || ""); }; function Sk(t, { beforeFocus: e, afterFocus: r, beforeBlur: i, afterBlur: n } = {}) { const a = Ct(), { emit: o } = a, s = mr(), c = we(!1), l = (h) => { Mi(e) && e(h) || c.value || (c.value = !0, o("focus", h), r == null || r()); }, u = (h) => { var f; Mi(i) && i(h) || h.relatedTarget && (f = s.value) != null && f.contains(h.relatedTarget) || (c.value = !1, o("blur", h), n == null || n()); }, d = () => { var h, f; (h = s.value) != null && h.contains(document.activeElement) && s.value !== document.activeElement || (f = t.value) == null || f.focus(); }; return ze(s, (h) => { h && h.setAttribute("tabindex", "-1"); }), ri(s, "focus", l, !0), ri(s, "blur", u, !0), ri(s, "click", d, !0), process.env.NODE_ENV === "test" && Lt(() => { const h = cl(t.value) ? t.value : document.querySelector("input,textarea"); h && (ri(h, "focus", l, !0), ri(h, "blur", u, !0)); }), { isFocused: c, wrapperRef: s, handleFocus: l, handleBlur: u }; } function Mk({ afterComposition: t, emit: e }) { const r = we(!1), i = (o) => { e == null || e("compositionstart", o), r.value = !0; }, n = (o) => { var s; e == null || e("compositionupdate", o); const c = (s = o.target) == null ? void 0 : s.value, l = c[c.length - 1] || ""; r.value = !FQ(l); }, a = (o) => { e == null || e("compositionend", o), r.value && (r.value = !1, st(() => t(o))); }; return { isComposing: r, handleComposition: (o) => { o.type === "compositionend" ? a(o) : n(o); }, handleCompositionStart: i, handleCompositionUpdate: n, handleCompositionEnd: a }; } const Ek = Symbol("emptyValuesContextKey"), pte = "use-empty-values", fte = ["", void 0, null], mte = void 0, gte = $t({ emptyValues: Array, valueOnClear: { type: [String, Number, Boolean, Function], default: void 0, validator: (t) => Mi(t) ? !t() : !t } }), vte = (t, e) => { const r = Ct() ? Ye(Ek, we({})) : we({}), i = ee(() => t.emptyValues || r.value.emptyValues || fte), n = ee(() => Mi(t.valueOnClear) ? t.valueOnClear() : t.valueOnClear !== void 0 ? t.valueOnClear : Mi(r.value.valueOnClear) ? r.value.valueOnClear() : r.value.valueOnClear !== void 0 ? r.value.valueOnClear : mte), a = (o) => i.value.includes(o); return i.value.includes(n.value) || Br(pte, "value-on-clear should be a value of empty-values"), { emptyValues: i, valueOnClear: n, isEmptyValue: a }; }, yte = $t({ ariaLabel: String, ariaOrientation: { type: String, values: ["horizontal", "vertical", "undefined"] }, ariaControls: String }), Gl = (t) => hQ(yte, t), Tk = Symbol(), Km = we(); function yx(t, e = void 0) { const r = Ct() ? Ye(Tk, Km) : Km; return t ? ee(() => { var i, n; return (n = (i = r.value) == null ? void 0 : i[t]) != null ? n : e; }) : r; } function bte(t, e) { const r = yx(), i = Pt(t, ee(() => { var s; return ((s = r.value) == null ? void 0 : s.namespace) || vm; })), n = Zg(ee(() => { var s; return (s = r.value) == null ? void 0 : s.locale; })), a = wk(ee(() => { var s; return ((s = r.value) == null ? void 0 : s.zIndex) || bk; })), o = ee(() => { var s; return N(e) || ((s = r.value) == null ? void 0 : s.size) || ""; }); return xte(ee(() => N(r) || {})), { ns: i, locale: n, zIndex: a, size: o }; } const xte = (t, e, r = !1) => { var i; const n = !!Ct(), a = n ? yx() : void 0, o = (i = void 0) != null ? i : n ? Dt : void 0; if (!o) { Br("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup()."); return; } const s = ee(() => { const c = N(t); return a != null && a.value ? wte(a.value, c) : c; }); return o(Tk, s), o(ik, ee(() => s.value.locale)), o(nk, ee(() => s.value.namespace)), o(xk, ee(() => s.value.zIndex)), o(_k, { size: ee(() => s.value.size || "") }), o(Ek, ee(() => ({ emptyValues: s.value.emptyValues, valueOnClear: s.value.valueOnClear }))), (r || !Km.value) && (Km.value = s.value), s; }, wte = (t, e) => { const r = [.../* @__PURE__ */ new Set([...XS(t), ...XS(e)])], i = {}; for (const n of r) i[n] = e[n] !== void 0 ? e[n] : t[n]; return i; }; var Nt = (t, e) => { const r = t.__vccOpts || t; for (const [i, n] of e) r[i] = n; return r; }; const _te = $t({ size: { type: ot([Number, String]) }, color: { type: String } }), Ste = Le({ name: "ElIcon", inheritAttrs: !1 }), Mte = /* @__PURE__ */ Le({ ...Ste, props: _te, setup(t) { const e = t, r = Pt("icon"), i = ee(() => { const { size: n, color: a } = e; return !n && !a ? {} : { fontSize: Un(n) ? void 0 : Xm(n), "--color": a }; }); return (n, a) => (Q(), be("i", Nr({ class: N(r).b(), style: N(i) }, n.$attrs), [ Fe(n.$slots, "default") ], 16)); } }); var Ete = /* @__PURE__ */ Nt(Mte, [["__file", "icon.vue"]]); const yr = ai(Ete), bx = Symbol("formContextKey"), Jm = Symbol("formItemContextKey"), Yu = (t, e = {}) => { const r = we(void 0), i = e.prop ? r : ak("size"), n = e.global ? r : hte(), a = e.form ? { size: void 0 } : Ye(bx, void 0), o = e.formItem ? { size: void 0 } : Ye(Jm, void 0); return ee(() => i.value || N(t) || (o == null ? void 0 : o.size) || (a == null ? void 0 : a.size) || n.value || ""); }, Jg = (t) => { const e = ak("disabled"), r = Ye(bx, void 0); return ee(() => e.value || N(t) || (r == null ? void 0 : r.disabled) || !1); }, fp = () => { const t = Ye(bx, void 0), e = Ye(Jm, void 0); return { form: t, formItem: e }; }, xx = (t, { formItemContext: e, disableIdGeneration: r, disableIdManagement: i }) => { r || (r = we(!1)), i || (i = we(!1)); const n = we(); let a; const o = ee(() => { var s; return !!(!(t.label || t.ariaLabel) && e && e.inputIds && ((s = e.inputIds) == null ? void 0 : s.length) <= 1); }); return Lt(() => { a = ze([pr(t, "id"), r], ([s, c]) => { const l = s ?? (c ? void 0 : Kg().value); l !== n.value && (e != null && e.removeInputId && (n.value && e.removeInputId(n.value), !(i != null && i.value) && !c && l && e.addInputId(l)), n.value = l); }, { immediate: !0 }); }), j1(() => { a && a(), e != null && e.removeInputId && n.value && e.removeInputId(n.value); }), { isLabeledByFormItem: o, inputId: n }; }; let Pn; const Tte = ` height:0 !important; visibility:hidden !important; ${pZ() ? "" : "overflow:hidden !important;"} position:absolute !important; z-index:-1000 !important; top:0 !important; right:0 !important; `, Cte = [ "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 Ate(t) { const e = window.getComputedStyle(t), r = e.getPropertyValue("box-sizing"), i = Number.parseFloat(e.getPropertyValue("padding-bottom")) + Number.parseFloat(e.getPropertyValue("padding-top")), n = Number.parseFloat(e.getPropertyValue("border-bottom-width")) + Number.parseFloat(e.getPropertyValue("border-top-width")); return { contextStyle: Cte.map((a) => `${a}:${e.getPropertyValue(a)}`).join(";"), paddingSize: i, borderSize: n, boxSizing: r }; } function dM(t, e = 1, r) { var i; Pn || (Pn = document.createElement("textarea"), document.body.appendChild(Pn)); const { paddingSize: n, borderSize: a, boxSizing: o, contextStyle: s } = Ate(t); Pn.setAttribute("style", `${s};${Tte}`), Pn.value = t.value || t.placeholder || ""; let c = Pn.scrollHeight; const l = {}; o === "border-box" ? c = c + a : o === "content-box" && (c = c - n), Pn.value = ""; const u = Pn.scrollHeight - n; if (Jt(e)) { let d = u * e; o === "border-box" && (d = d + n + a), c = Math.max(d, c), l.minHeight = `${d}px`; } if (Jt(r)) { let d = u * r; o === "border-box" && (d = d + n + a), c = Math.min(d, c); } return l.height = `${c}px`, (i = Pn.parentNode) == null || i.removeChild(Pn), Pn = void 0, l; } const Lte = $t({ id: { type: String, default: void 0 }, size: hu, disabled: Boolean, modelValue: { type: ot([ 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: ot([Boolean, Object]), default: !1 }, autocomplete: { type: String, default: "off" }, formatter: { type: Function }, parser: { type: Function }, placeholder: { type: String }, form: { type: String }, readonly: Boolean, clearable: Boolean, showPassword: Boolean, showWordLimit: Boolean, suffixIcon: { type: bs }, prefixIcon: { type: bs }, containerRole: { type: String, default: void 0 }, tabindex: { type: [String, Number], default: 0 }, validateEvent: { type: Boolean, default: !0 }, inputStyle: { type: ot([Object, Array, String]), default: () => Ga({}) }, autofocus: Boolean, rows: { type: Number, default: 2 }, ...Gl(["ariaLabel"]) }), kte = { [gr]: (t) => Ni(t), input: (t) => Ni(t), change: (t) => Ni(t), focus: (t) => t instanceof FocusEvent, blur: (t) => t instanceof FocusEvent, clear: () => !0, mouseleave: (t) => t instanceof MouseEvent, mouseenter: (t) => t instanceof MouseEvent, keydown: (t) => t instanceof Event, compositionstart: (t) => t instanceof CompositionEvent, compositionupdate: (t) => t instanceof CompositionEvent, compositionend: (t) => t instanceof CompositionEvent }, Pte = Le({ name: "ElInput", inheritAttrs: !1 }), Rte = /* @__PURE__ */ Le({ ...Pte, props: Lte, emits: kte, setup(t, { expose: e, emit: r }) { const i = t, n = AT(), a = co(), o = ee(() => { const B = {}; return i.containerRole === "combobox" && (B["aria-haspopup"] = n["aria-haspopup"], B["aria-owns"] = n["aria-owns"], B["aria-expanded"] = n["aria-expanded"]), B; }), s = ee(() => [ i.type === "textarea" ? y.b() : m.b(), m.m(f.value), m.is("disabled", p.value), m.is("exceed", Z.value), { [m.b("group")]: a.prepend || a.append, [m.m("prefix")]: a.prefix || i.prefixIcon, [m.m("suffix")]: a.suffix || i.suffixIcon || i.clearable || i.showPassword, [m.bm("suffix", "password-clear")]: I.value && F.value, [m.b("hidden")]: i.type === "hidden" }, n.class ]), c = ee(() => [ m.e("wrapper"), m.is("focus", E.value) ]), l = VQ({ excludeKeys: ee(() => Object.keys(o.value)) }), { form: u, formItem: d } = fp(), { inputId: h } = xx(i, { formItemContext: d }), f = Yu(), p = Jg(), m = Pt("input"), y = Pt("textarea"), g = mr(), v = mr(), x = we(!1), w = we(!1), S = we(), _ = mr(i.inputStyle), b = ee(() => g.value || v.value), { wrapperRef: T, isFocused: E, handleFocus: C, handleBlur: L } = Sk(b, { beforeFocus() { return p.value; }, afterBlur() { var B; i.validateEvent && ((B = d == null ? void 0 : d.validate) == null || B.call(d, "blur").catch((ce) => Br(ce))); } }), A = ee(() => { var B; return (B = u == null ? void 0 : u.statusIcon) != null ? B : !1; }), k = ee(() => (d == null ? void 0 : d.validateState) || ""), P = ee(() => k.value && tk[k.value]), R = ee(() => w.value ? DQ : AQ), M = ee(() => [ n.style ]), O = ee(() => [ i.inputStyle, _.value, { resize: i.resize } ]), D = ee(() => Ka(i.modelValue) ? "" : String(i.modelValue)), I = ee(() => i.clearable && !p.value && !i.readonly && !!D.value && (E.value || x.value)), F = ee(() => i.showPassword && !p.value && !i.readonly && !!D.value && (!!D.value || E.value)), z = ee(() => i.showWordLimit && !!i.maxlength && (i.type === "text" || i.type === "textarea") && !p.value && !i.readonly && !i.showPassword), U = ee(() => D.value.length), Z = ee(() => !!z.value && U.value > Number(i.maxlength)), re = ee(() => !!a.suffix || !!i.suffixIcon || I.value || i.showPassword || z.value || !!k.value && A.value), [K, V] = cte(g); bn(v, (B) => { if (G(), !z.value || i.resize !== "both") return; const ce = B[0], { width: ve } = ce.contentRect; S.value = { right: `calc(100% - ${ve + 15 + 6}px)` }; }); const H = () => { const { type: B, autosize: ce } = i; if (!(!Ur || B !== "textarea" || !v.value)) if (ce) { const ve = Ii(ce) ? ce.minRows : void 0, te = Ii(ce) ? ce.maxRows : void 0, pe = dM(v.value, ve, te); _.value = { overflowY: "hidden", ...pe }, st(() => { v.value.offsetHeight, _.value = pe; }); } else _.value = { minHeight: dM(v.value).minHeight }; }, G = /* @__PURE__ */ ((B) => { let ce = !1; return () => { var ve; ce || !i.autosize || ((ve = v.value) == null ? void 0 : ve.offsetParent) === null || (B(), ce = !0); }; })(H), W = () => { const B = b.value, ce = i.formatter ? i.formatter(D.value) : D.value; !B || B.value === ce || (B.value = ce); }, Y = async (B) => { K(); let { value: ce } = B.target; if (i.formatter && (ce = i.parser ? i.parser(ce) : ce), !ie.value) { if (ce === D.value) { W(); return; } r(gr, ce), r("input", ce), await st(), W(), V(); } }, X = (B) => { r("change", B.target.value); }, { isComposing: ie, handleCompositionStart: ue, handleCompositionUpdate: $, handleCompositionEnd: J } = Mk({ emit: r, afterComposition: Y }), ne = () => { w.value = !w.value, j(); }, j = async () => { var B; await st(), (B = b.value) == null || B.focus(); }, q = () => { var B; return (B = b.value) == null ? void 0 : B.blur(); }, ge = (B) => { x.value = !1, r("mouseleave", B); }, ye = (B) => { x.value = !0, r("mouseenter", B); }, _e = (B) => { r("keydown", B); }, Me = () => { var B; (B = b.value) == null || B.select(); }, Ce = () => { r(gr, ""), r("change", ""), r("clear"), r("input", ""); }; return ze(() => i.modelValue, () => { var B; st(() => H()), i.validateEvent && ((B = d == null ? void 0 : d.validate) == null || B.call(d, "change").catch((ce) => Br(ce))); }), ze(D, () => W()), ze(() => i.type, async () => { await st(), W(), H(); }), Lt(() => { !i.formatter && i.parser && Br("ElInput", "If you set the parser, you also need to set the formatter."), W(), st(H); }), e({ input: g, textarea: v, ref: b, textareaStyle: O, autosize: pr(i, "autosize"), isComposing: ie, focus: j, blur: q, select: Me, clear: Ce, resizeTextarea: H }), (B, ce) => (Q(), be("div", Nr(N(o), { class: [ N(s), { [N(m).bm("group", "append")]: B.$slots.append, [N(m).bm("group", "prepend")]: B.$slots.prepend } ], style: N(M), role: B.containerRole, onMouseenter: ye, onMouseleave: ge }), [ Pe(" input "), B.type !== "textarea" ? (Q(), be(pt, { key: 0 }, [ Pe(" prepend slot "), B.$slots.prepend ? (Q(), be("div", { key: 0, class: xe(N(m).be("group", "prepend")) }, [ Fe(B.$slots, "prepend") ], 2)) : Pe("v-if", !0), Ee("div", { ref_key: "wrapperRef", ref: T, class: xe(N(c)) }, [ Pe(" prefix slot "), B.$slots.prefix || B.prefixIcon ? (Q(), be("span", { key: 0, class: xe(N(m).e("prefix")) }, [ Ee("span", { class: xe(N(m).e("prefix-inner")) }, [ Fe(B.$slots, "prefix"), B.prefixIcon ? (Q(), Re(N(yr), { key: 0, class: xe(N(m).e("icon")) }, { default: le(() => [ (Q(), Re(Yt(B.prefixIcon))) ]), _: 1 }, 8, ["class"])) : Pe("v-if", !0) ], 2) ], 2)) : Pe("v-if", !0), Ee("input", Nr({ id: N(h), ref_key: "input", ref: g, class: N(m).e("inner") }, N(l), { minlength: B.minlength, maxlength: B.maxlength, type: B.showPassword ? w.value ? "text" : "password" : B.type, disabled: N(p), readonly: B.readonly, autocomplete: B.autocomplete, tabindex: B.tabindex, "aria-label": B.ariaLabel, placeholder: B.placeholder, style: B.inputStyle, form: B.form, autofocus: B.autofocus, onCompositionstart: N(ue), onCompositionupdate: N($), onCompositionend: N(J), onInput: Y, onChange: X, onKeydown: _e }), null, 16, ["id", "minlength", "maxlength", "type", "disabled", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form", "autofocus", "onCompositionstart", "onCompositionupdate", "onCompositionend"]), Pe(" suffix slot "), N(re) ? (Q(), be("span", { key: 1, class: xe(N(m).e("suffix")) }, [ Ee("span", { class: xe(N(m).e("suffix-inner")) }, [ !N(I) || !N(F) || !N(z) ? (Q(), be(pt, { key: 0 }, [ Fe(B.$slots, "suffix"), B.suffixIcon ? (Q(), Re(N(yr), { key: 0, class: xe(N(m).e("icon")) }, { default: le(() => [ (Q(), Re(Yt(B.suffixIcon))) ]), _: 1 }, 8, ["class"])) : Pe("v-if", !0) ], 64)) : Pe("v-if", !0), N(I) ? (Q(), Re(N(yr), { key: 1, class: xe([N(m).e("icon"), N(m).e("clear")]), onMousedown: Tt(N(Mh), ["prevent"]), onClick: Ce }, { default: le(() => [ oe(N(sx)) ]), _: 1 }, 8, ["class", "onMousedown"])) : Pe("v-if", !0), N(F) ? (Q(), Re(N(yr), { key: 2, class: xe([N(m).e("icon"), N(m).e("password")]), onClick: ne }, { default: le(() => [ (Q(), Re(Yt(N(R)))) ]), _: 1 }, 8, ["class"])) : Pe("v-if", !0), N(z) ? (Q(), be("span", { key: 3, class: xe(N(m).e("count")) }, [ Ee("span", { class: xe(N(m).e("count-inner")) }, Ze(N(U)) + " / " + Ze(B.maxlength), 3) ], 2)) : Pe("v-if", !0), N(k) && N(P) && N(A) ? (Q(), Re(N(yr), { key: 4, class: xe([ N(m).e("icon"), N(m).e("validateIcon"), N(m).is("loading", N(k) === "validating") ]) }, { default: le(() => [ (Q(), Re(Yt(N(P)))) ]), _: 1 }, 8, ["class"])) : Pe("v-if", !0) ], 2) ], 2)) : Pe("v-if", !0) ], 2), Pe(" append slot "), B.$slots.append ? (Q(), be("div", { key: 1, class: xe(N(m).be("group", "append")) }, [ Fe(B.$slots, "append") ], 2)) : Pe("v-if", !0) ], 64)) : (Q(), be(pt, { key: 1 }, [ Pe(" textarea "), Ee("textarea", Nr({ id: N(h), ref_key: "textarea", ref: v, class: [N(y).e("inner"), N(m).is("focus", N(E))] }, N(l), { minlength: B.minlength, maxlength: B.maxlength, tabindex: B.tabindex, disabled: N(p), readonly: B.readonly, autocomplete: B.autocomplete, style: N(O), "aria-label": B.ariaLabel, placeholder: B.placeholder, form: B.form, autofocus: B.autofocus, rows: B.rows, onCompositionstart: N(ue), onCompositionupdate: N($), onCompositionend: N(J), onInput: Y, onFocus: N(C), onBlur: N(L), onChange: X, onKeydown: _e }), null, 16, ["id", "minlength", "maxlength", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form", "autofocus", "rows", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onFocus", "onBlur"]), N(z) ? (Q(), be("span", { key: 0, style: yt(S.value), class: xe(N(m).e("count")) }, Ze(N(U)) + " / " + Ze(B.maxlength), 7)) : Pe("v-if", !0) ], 64)) ], 16, ["role"])); } }); var Ote = /* @__PURE__ */ Nt(Rte, [["__file", "input.vue"]]); const Dte = ai(Ote), oc = 4, Ite = { 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" } }, Nte = ({ move: t, size: e, bar: r }) => ({ [r.size]: e, transform: `translate${r.axis}(${t}%)` }), wx = Symbol("scrollbarContextKey"), Bte = $t({ vertical: Boolean, size: String, move: Number, ratio: { type: Number, required: !0 }, always: Boolean }), Fte = "Thumb", zte = /* @__PURE__ */ Le({ __name: "thumb", props: Bte, setup(t) { const e = t, r = Ye(wx), i = Pt("scrollbar"); r || Xu(Fte, "can not inject scrollbar context"); const n = we(), a = we(), o = we({}), s = we(!1); let c = !1, l = !1, u = Ur ? document.onselectstart : null; const d = ee(() => Ite[e.vertical ? "vertical" : "horizontal"]), h = ee(() => Nte({ size: e.size, move: e.move, bar: d.value })), f = ee(() => n.value[d.value.offset] ** 2 / r.wrapElement[d.value.scrollSize] / e.ratio / a.value[d.value.offset]), p = (_) => { var b; if (_.stopPropagation(), _.ctrlKey || [1, 2].includes(_.button)) return; (b = window.getSelection()) == null || b.removeAllRanges(), y(_); const T = _.currentTarget; T && (o.value[d.value.axis] = T[d.value.offset] - (_[d.value.client] - T.getBoundingClientRect()[d.value.direction])); }, m = (_) => { if (!a.value || !n.value || !r.wrapElement) return; const b = Math.abs(_.target.getBoundingClientRect()[d.value.direction] - _[d.value.client]), T = a.value[d.value.offset] / 2, E = (b - T) * 100 * f.value / n.value[d.value.offset]; r.wrapElement[d.value.scroll] = E * r.wrapElement[d.value.scrollSize] / 100; }, y = (_) => { _.stopImmediatePropagation(), c = !0, document.addEventListener("mousemove", g), document.addEventListener("mouseup", v), u = document.onselectstart, document.onselectstart = () => !1; }, g = (_) => { if (!n.value || !a.value || c === !1) return; const b = o.value[d.value.axis]; if (!b) return; const T = (n.value.getBoundingClientRect()[d.value.direction] - _[d.value.client]) * -1, E = a.value[d.value.offset] - b, C = (T - E) * 100 * f.value / n.value[d.value.offset]; r.wrapElement[d.value.scroll] = C * r.wrapElement[d.value.scrollSize] / 100; }, v = () => { c = !1, o.value[d.value.axis] = 0, document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", v), S(), l && (s.value = !1); }, x = () => { l = !1, s.value = !!e.size; }, w = () => { l = !0, s.value = c; }; Sr(() => { S(), document.removeEventListener("mouseup", v); }); const S = () => { document.onselectstart !== u && (document.onselectstart = u); }; return ri(pr(r, "scrollbarElement"), "mousemove", x), ri(pr(r, "scrollbarElement"), "mouseleave", w), (_, b) => (Q(), Re(Zn, { name: N(i).b("fade"), persisted: "" }, { default: le(() => [ ht(Ee("div", { ref_key: "instance", ref: n, class: xe([N(i).e("bar"), N(i).is(N(d).key)]), onMousedown: m }, [ Ee("div", { ref_key: "thumb", ref: a, class: xe(N(i).e("thumb")), style: yt(N(h)), onMousedown: p }, null, 38) ], 34), [ [Ot, _.always || s.value] ]) ]), _: 1 }, 8, ["name"])); } }); var hM = /* @__PURE__ */ Nt(zte, [["__file", "thumb.vue"]]); const $te = $t({ always: { type: Boolean, default: !0 }, minSize: { type: Number, required: !0 } }), Vte = /* @__PURE__ */ Le({ __name: "bar", props: $te, setup(t, { expose: e }) { const r = t, i = Ye(wx), n = we(0), a = we(0), o = we(""), s = we(""), c = we(1), l = we(1); return e({ handleScroll: (u) => { if (u) { const d = u.offsetHeight - oc, h = u.offsetWidth - oc; a.value = u.scrollTop * 100 / d * c.value, n.value = u.scrollLeft * 100 / h * l.value; } }, update: () => { const u = i == null ? void 0 : i.wrapElement; if (!u) return; const d = u.offsetHeight - oc, h = u.offsetWidth - oc, f = d ** 2 / u.scrollHeight, p = h ** 2 / u.scrollWidth, m = Math.max(f, r.minSize), y = Math.max(p, r.minSize); c.value = f / (d - f) / (m / (d - m)), l.value = p / (h - p) / (y / (h - y)), s.value = m + oc < d ? `${m}px` : "", o.value = y + oc < h ? `${y}px` : ""; } }), (u, d) => (Q(), be(pt, null, [ oe(hM, { move: n.value, ratio: l.value, size: o.value, always: u.always }, null, 8, ["move", "ratio", "size", "always"]), oe(hM, { move: a.value, ratio: c.value, size: s.value, vertical: "", always: u.always }, null, 8, ["move", "ratio", "size", "always"]) ], 64)); } }); var Ute = /* @__PURE__ */ Nt(Vte, [["__file", "bar.vue"]]); const jte = $t({ height: { type: [String, Number], default: "" }, maxHeight: { type: [String, Number], default: "" }, native: { type: Boolean, default: !1 }, wrapStyle: { type: ot([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, ...Gl(["ariaLabel", "ariaOrientation"]) }), Hte = { scroll: ({ scrollTop: t, scrollLeft: e }) => [t, e].every(Jt) }, Yy = "ElScrollbar", Gte = Le({ name: Yy }), Wte = /* @__PURE__ */ Le({ ...Gte, props: jte, emits: Hte, setup(t, { expose: e, emit: r }) { const i = t, n = Pt("scrollbar"); let a, o, s = 0, c = 0; const l = we(), u = we(), d = we(), h = we(), f = ee(() => { const S = {}; return i.height && (S.height = Xm(i.height)), i.maxHeight && (S.maxHeight = Xm(i.maxHeight)), [i.wrapStyle, S]; }), p = ee(() => [ i.wrapClass, n.e("wrap"), { [n.em("wrap", "hidden-default")]: !i.native } ]), m = ee(() => [n.e("view"), i.viewClass]), y = () => { var S; u.value && ((S = h.value) == null || S.handleScroll(u.value), s = u.value.scrollTop, c = u.value.scrollLeft, r("scroll", { scrollTop: u.value.scrollTop, scrollLeft: u.value.scrollLeft })); }; function g(S, _) { Ii(S) ? u.value.scrollTo(S) : Jt(S) && Jt(_) && u.value.scrollTo(S, _); } const v = (S) => { if (!Jt(S)) { Br(Yy, "value must be a number"); return; } u.value.scrollTop = S; }, x = (S) => { if (!Jt(S)) { Br(Yy, "value must be a number"); return; } u.value.scrollLeft = S; }, w = () => { var S; (S = h.value) == null || S.update(); }; return ze(() => i.noresize, (S) => { S ? (a == null || a(), o == null || o()) : ({ stop: a } = bn(d, w), o = ri("resize", w)); }, { immediate: !0 }), ze(() => [i.maxHeight, i.height], () => { i.native || st(() => { var S; w(), u.value && ((S = h.value) == null || S.handleScroll(u.value)); }); }), Dt(wx, _r({ scrollbarElement: l, wrapElement: u })), LT(() => { u.value && (u.value.scrollTop = s, u.value.scrollLeft = c); }), Lt(() => { i.native || st(() => { w(); }); }), jh(() => w()), e({ wrapRef: u, update: w, scrollTo: g, setScrollTop: v, setScrollLeft: x, handleScroll: y }), (S, _) => (Q(), be("div", { ref_key: "scrollbarRef", ref: l, class: xe(N(n).b()) }, [ Ee("div", { ref_key: "wrapRef", ref: u, class: xe(N(p)), style: yt(N(f)), tabindex: S.tabindex, onScroll: y }, [ (Q(), Re(Yt(S.tag), { id: S.id, ref_key: "resizeRef", ref: d, class: xe(N(m)), style: yt(S.viewStyle), role: S.role, "aria-label": S.ariaLabel, "aria-orientation": S.ariaOrientation }, { default: le(() => [ Fe(S.$slots, "default") ]), _: 3 }, 8, ["id", "class", "style", "role", "aria-label", "aria-orientation"])) ], 46, ["tabindex"]), S.native ? Pe("v-if", !0) : (Q(), Re(Ute, { key: 0, ref_key: "barRef", ref: h, always: S.always, "min-size": S.minSize }, null, 8, ["always", "min-size"])) ], 2)); } }); var qte = /* @__PURE__ */ Nt(Wte, [["__file", "scrollbar.vue"]]); const Xte = ai(qte), _x = Symbol("popper"), Ck = Symbol("popperContent"), Zte = [ "dialog", "grid", "group", "listbox", "menu", "navigation", "tooltip", "tree" ], Ak = $t({ role: { type: String, values: Zte, default: "tooltip" } }), Yte = Le({ name: "ElPopper", inheritAttrs: !1 }), Kte = /* @__PURE__ */ Le({ ...Yte, props: Ak, setup(t, { expose: e }) { const r = t, i = we(), n = we(), a = we(), o = we(), s = ee(() => r.role), c = { triggerRef: i, popperInstanceRef: n, contentRef: a, referenceRef: o, role: s }; return e(c), Dt(_x, c), (l, u) => Fe(l.$slots, "default"); } }); var Jte = /* @__PURE__ */ Nt(Kte, [["__file", "popper.vue"]]); const Lk = $t({ arrowOffset: { type: Number, default: 5 } }), Qte = Le({ name: "ElPopperArrow", inheritAttrs: !1 }), ere = /* @__PURE__ */ Le({ ...Qte, props: Lk, setup(t, { expose: e }) { const r = t, i = Pt("popper"), { arrowOffset: n, arrowRef: a, arrowStyle: o } = Ye(Ck, void 0); return ze(() => r.arrowOffset, (s) => { n.value = s; }), Sr(() => { a.value = void 0; }), e({ arrowRef: a }), (s, c) => (Q(), be("span", { ref_key: "arrowRef", ref: a, class: xe(N(i).e("arrow")), style: yt(N(o)), "data-popper-arrow": "" }, null, 6)); } }); var tre = /* @__PURE__ */ Nt(ere, [["__file", "arrow.vue"]]); const n0 = "ElOnlyChild", rre = Le({ name: n0, setup(t, { slots: e, attrs: r }) { var i; const n = Ye(yk), a = lte((i = n == null ? void 0 : n.setForwardRef) != null ? i : Mh); return () => { var o; const s = (o = e.default) == null ? void 0 : o.call(e, r); if (!s) return null; if (s.length > 1) return Br(n0, "requires exact only one valid child."), null; const c = kk(s); return c ? ht(kT(c, r), [[a]]) : (Br(n0, "no valid child node found"), null); }; } }); function kk(t) { if (!t) return null; const e = t; for (const r of e) { if (Ii(r)) switch (r.type) { case PT: continue; case sg: case "svg": return pM(r); case pt: return kk(r.children); default: return r; } return pM(r); } return null; } function pM(t) { const e = Pt("only-child"); return oe("span", { class: e.e("content") }, [t]); } const Pk = $t({ virtualRef: { type: ot(Object) }, virtualTriggering: Boolean, onMouseenter: { type: ot(Function) }, onMouseleave: { type: ot(Function) }, onClick: { type: ot(Function) }, onKeydown: { type: ot(Function) }, onFocus: { type: ot(Function) }, onBlur: { type: ot(Function) }, onContextmenu: { type: ot(Function) }, id: String, open: Boolean }), ire = Le({ name: "ElPopperTrigger", inheritAttrs: !1 }), nre = /* @__PURE__ */ Le({ ...ire, props: Pk, setup(t, { expose: e }) { const r = t, { role: i, triggerRef: n } = Ye(_x, void 0); ste(n); const a = ee(() => s.value ? r.id : void 0), o = ee(() => { if (i && i.value === "tooltip") return r.open && r.id ? r.id : void 0; }), s = ee(() => { if (i && i.value !== "tooltip") return i.value; }), c = ee(() => s.value ? `${r.open}` : void 0); let l; const u = [ "onMouseenter", "onMouseleave", "onClick", "onKeydown", "onFocus", "onBlur", "onContextmenu" ]; return Lt(() => { ze(() => r.virtualRef, (d) => { d && (n.value = Xa(d)); }, { immediate: !0 }), ze(n, (d, h) => { l == null || l(), l = void 0, cl(d) && (u.forEach((f) => { var p; const m = r[f]; m && (d.addEventListener(f.slice(2).toLowerCase(), m), (p = h == null ? void 0 : h.removeEventListener) == null || p.call(h, f.slice(2).toLowerCase(), m)); }), l = ze([a, o, s, c], (f) => { [ "aria-controls", "aria-describedby", "aria-haspopup", "aria-expanded" ].forEach((p, m) => { Ka(f[m]) ? d.removeAttribute(p) : d.setAttribute(p, f[m]); }); }, { immediate: !0 })), cl(h) && [ "aria-controls", "aria-describedby", "aria-haspopup", "aria-expanded" ].forEach((f) => h.removeAttribute(f)); }, { immediate: !0 }); }), Sr(() => { if (l == null || l(), l = void 0, n.value && cl(n.value)) { const d = n.value; u.forEach((h) => { const f = r[h]; f && d.removeEventListener(h.slice(2).toLowerCase(), f); }), n.value = void 0; } }), e({ triggerRef: n }), (d, h) => d.virtualTriggering ? Pe("v-if", !0) : (Q(), Re(N(rre), Nr({ key: 0 }, d.$attrs, { "aria-controls": N(a), "aria-describedby": N(o), "aria-expanded": N(c), "aria-haspopup": N(s) }), { default: le(() => [ Fe(d.$slots, "default") ]), _: 3 }, 16, ["aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup"])); } }); var are = /* @__PURE__ */ Nt(nre, [["__file", "trigger.vue"]]); const a0 = "focus-trap.focus-after-trapped", o0 = "focus-trap.focus-after-released", ore = "focus-trap.focusout-prevented", fM = { cancelable: !0, bubbles: !1 }, sre = { cancelable: !0, bubbles: !1 }, mM = "focusAfterTrapped", gM = "focusAfterReleased", lre = Symbol("elFocusTrap"), Sx = we(), Qg = we(0), Mx = we(0); let tf = 0; const Rk = (t) => { const e = [], r = document.createTreeWalker(t, NodeFilter.SHOW_ELEMENT, { acceptNode: (i) => { const n = i.tagName === "INPUT" && i.type === "hidden"; return i.disabled || i.hidden || n ? NodeFilter.FILTER_SKIP : i.tabIndex >= 0 || i === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; } }); for (; r.nextNode(); ) e.push(r.currentNode); return e; }, vM = (t, e) => { for (const r of t) if (!cre(r, e)) return r; }, cre = (t, e) => { if (process.env.NODE_ENV === "test") return !1; if (getComputedStyle(t).visibility === "hidden") return !0; for (; t; ) { if (e && t === e) return !1; if (getComputedStyle(t).display === "none") return !0; t = t.parentElement; } return !1; }, ure = (t) => { const e = Rk(t), r = vM(e, t), i = vM(e.reverse(), t); return [r, i]; }, dre = (t) => t instanceof HTMLInputElement && "select" in t, Vo = (t, e) => { if (t && t.focus) { const r = document.activeElement; t.focus({ preventScroll: !0 }), Mx.value = window.performance.now(), t !== r && dre(t) && e && t.select(); } }; function yM(t, e) { const r = [...t], i = t.indexOf(e); return i !== -1 && r.splice(i, 1), r; } const hre = () => { let t = []; return { push: (e) => { const r = t[0]; r && e !== r && r.pause(), t = yM(t, e), t.unshift(e); }, remove: (e) => { var r, i; t = yM(t, e), (i = (r = t[0]) == null ? void 0 : r.resume) == null || i.call(r); } }; }, pre = (t, e = !1) => { const r = document.activeElement; for (const i of t) if (Vo(i, e), document.activeElement !== r) return; }, bM = hre(), fre = () => Qg.value > Mx.value, rf = () => { Sx.value = "pointer", Qg.value = window.performance.now(); }, xM = () => { Sx.value = "keyboard", Qg.value = window.performance.now(); }, mre = () => (Lt(() => { tf === 0 && (document.addEventListener("mousedown", rf), document.addEventListener("touchstart", rf), document.addEventListener("keydown", xM)), tf++; }), Sr(() => { tf--, tf <= 0 && (document.removeEventListener("mousedown", rf), document.removeEventListener("touchstart", rf), document.removeEventListener("keydown", xM)); }), { focusReason: Sx, lastUserFocusTimestamp: Qg, lastAutomatedFocusTimestamp: Mx }), nf = (t) => new CustomEvent(ore, { ...sre, detail: t }), gre = Le({ name: "ElFocusTrap", inheritAttrs: !1, props: { loop: Boolean, trapped: Boolean, focusTrapEl: Object, focusStartEl: { type: [Object, String], default: "first" } }, emits: [ mM, gM, "focusin", "focusout", "focusout-prevented", "release-requested" ], setup(t, { emit: e }) { const r = we(); let i, n; const { focusReason: a } = mre(); rte((p) => { t.trapped && !o.paused && e("release-requested", p); }); const o = { paused: !1, pause() { this.paused = !0; }, resume() { this.paused = !1; } }, s = (p) => { if (!t.loop && !t.trapped || o.paused) return; const { key: m, altKey: y, ctrlKey: g, metaKey: v, currentTarget: x, shiftKey: w } = p, { loop: S } = t, _ = m === pa.tab && !y && !g && !v, b = document.activeElement; if (_ && b) { const T = x, [E, C] = ure(T); if (E && C) { if (!w && b === C) { const L = nf({ focusReason: a.value }); e("focusout-prevented", L), L.defaultPrevented || (p.preventDefault(), S && Vo(E, !0)); } else if (w && [E, T].includes(b)) { const L = nf({ focusReason: a.value }); e("focusout-prevented", L), L.defaultPrevented || (p.preventDefault(), S && Vo(C, !0)); } } else if (b === T) { const L = nf({ focusReason: a.value }); e("focusout-prevented", L), L.defaultPrevented || p.preventDefault(); } } }; Dt(lre, { focusTrapRef: r, onKeydown: s }), ze(() => t.focusTrapEl, (p) => { p && (r.value = p); }, { immediate: !0 }), ze([r], ([p], [m]) => { p && (p.addEventListener("keydown", s), p.addEventListener("focusin", u), p.addEventListener("focusout", d)), m && (m.removeEventListener("keydown", s), m.removeEventListener("focusin", u), m.removeEventListener("focusout", d)); }); const c = (p) => { e(mM, p); }, l = (p) => e(gM, p), u = (p) => { const m = N(r); if (!m) return; const y = p.target, g = p.relatedTarget, v = y && m.contains(y); t.trapped || g && m.contains(g) || (i = g), v && e("focusin", p), !o.paused && t.trapped && (v ? n = y : Vo(n, !0)); }, d = (p) => { const m = N(r); if (!(o.paused || !m)) if (t.trapped) { const y = p.relatedTarget; !Ka(y) && !m.contains(y) && setTimeout(() => { if (!o.paused && t.trapped) { const g = nf({ focusReason: a.value }); e("focusout-prevented", g), g.defaultPrevented || Vo(n, !0); } }, 0); } else { const y = p.target; y && m.contains(y) || e("focusout", p); } }; async function h() { await st(); const p = N(r); if (p) { bM.push(o); const m = p.contains(document.activeElement) ? i : document.activeElement; if (i = m, !p.contains(m)) { const y = new Event(a0, fM); p.addEventListener(a0, c), p.dispatchEvent(y), y.defaultPrevented || st(() => { let g = t.focusStartEl; Ni(g) || (Vo(g), document.activeElement !== g && (g = "first")), g === "first" && pre(Rk(p), !0), (document.activeElement === m || g === "container") && Vo(p); }); } } } function f() { const p = N(r); if (p) { p.removeEventListener(a0, c); const m = new CustomEvent(o0, { ...fM, detail: { focusReason: a.value } }); p.addEventListener(o0, l), p.dispatchEvent(m), !m.defaultPrevented && (a.value == "keyboard" || !fre() || p.contains(document.activeElement)) && Vo(i ?? document.body), p.removeEventListener(o0, l), bM.remove(o); } } return Lt(() => { t.trapped && h(), ze(() => t.trapped, (p) => { p ? h() : f(); }); }), Sr(() => { t.trapped && f(), r.value && (r.value.removeEventListener("keydown", s), r.value.removeEventListener("focusin", u), r.value.removeEventListener("focusout", d), r.value = void 0); }), { onKeydown: s }; } }); function vre(t, e, r, i, n, a) { return Fe(t.$slots, "default", { handleKeydown: t.onKeydown }); } var yre = /* @__PURE__ */ Nt(gre, [["render", vre], ["__file", "focus-trap.vue"]]); const bre = ["fixed", "absolute"], xre = $t({ boundariesPadding: { type: Number, default: 0 }, fallbackPlacements: { type: ot(Array), default: void 0 }, gpuAcceleration: { type: Boolean, default: !0 }, offset: { type: Number, default: 12 }, placement: { type: String, values: Zu, default: "bottom" }, popperOptions: { type: ot(Object), default: () => ({}) }, strategy: { type: String, values: bre, default: "absolute" } }), Ok = $t({ ...xre, id: String, style: { type: ot([String, Array, Object]) }, className: { type: ot([String, Array, Object]) }, effect: { type: ot(String), default: "dark" }, visible: Boolean, enterable: { type: Boolean, default: !0 }, pure: Boolean, focusOnShow: { type: Boolean, default: !1 }, trapping: { type: Boolean, default: !1 }, popperClass: { type: ot([String, Array, Object]) }, popperStyle: { type: ot([String, Array, Object]) }, referenceEl: { type: ot(Object) }, triggerTargetEl: { type: ot(Object) }, stopPopperMouseEvent: { type: Boolean, default: !0 }, virtualTriggering: Boolean, zIndex: Number, ...Gl(["ariaLabel"]) }), wre = { mouseenter: (t) => t instanceof MouseEvent, mouseleave: (t) => t instanceof MouseEvent, focus: () => !0, blur: () => !0, close: () => !0 }, _re = (t, e = []) => { const { placement: r, strategy: i, popperOptions: n } = t, a = { placement: r, strategy: i, ...n, modifiers: [...Mre(t), ...e] }; return Ere(a, n == null ? void 0 : n.modifiers), a; }, Sre = (t) => { if (Ur) return Xa(t); }; function Mre(t) { const { offset: e, gpuAcceleration: r, fallbackPlacements: i } = t; return [ { name: "offset", options: { offset: [0, e ?? 12] } }, { name: "preventOverflow", options: { padding: { top: 2, bottom: 2, left: 5, right: 5 } } }, { name: "flip", options: { padding: 5, fallbackPlacements: i } }, { name: "computeStyles", options: { gpuAcceleration: r } } ]; } function Ere(t, e) { e && (t.modifiers = [...t.modifiers, ...e ?? []]); } const Tre = 0, Cre = (t) => { const { popperInstanceRef: e, contentRef: r, triggerRef: i, role: n } = Ye(_x, void 0), a = we(), o = we(), s = ee(() => ({ name: "eventListeners", enabled: !!t.visible })), c = ee(() => { var g; const v = N(a), x = (g = N(o)) != null ? g : Tre; return { name: "arrow", enabled: !lQ(v), options: { element: v, padding: x } }; }), l = ee(() => ({ onFirstUpdate: () => { p(); }, ..._re(t, [ N(c), N(s) ]) })), u = ee(() => Sre(t.referenceEl) || N(i)), { attributes: d, state: h, styles: f, update: p, forceUpdate: m, instanceRef: y } = Qee(u, r, l); return ze(y, (g) => e.value = g), Lt(() => { ze(() => { var g; return (g = N(u)) == null ? void 0 : g.getBoundingClientRect(); }, () => { p(); }); }), { attributes: d, arrowRef: a, contentRef: r, instanceRef: y, state: h, styles: f, role: n, forceUpdate: m, update: p }; }, Are = (t, { attributes: e, styles: r, role: i }) => { const { nextZIndex: n } = wk(), a = Pt("popper"), o = ee(() => N(e).popper), s = we(Jt(t.zIndex) ? t.zIndex : n()), c = ee(() => [ a.b(), a.is("pure", t.pure), a.is(t.effect), t.popperClass ]), l = ee(() => [ { zIndex: N(s) }, N(r).popper, t.popperStyle || {} ]), u = ee(() => i.value === "dialog" ? "false" : void 0), d = ee(() => N(r).arrow || {}); return { ariaModal: u, arrowStyle: d, contentAttrs: o, contentClass: c, contentStyle: l, contentZIndex: s, updateZIndex: () => { s.value = Jt(t.zIndex) ? t.zIndex : n(); } }; }, Lre = (t, e) => { const r = we(!1), i = we(); return { focusStartRef: i, trapped: r, onFocusAfterReleased: (n) => { var a; ((a = n.detail) == null ? void 0 : a.focusReason) !== "pointer" && (i.value = "first", e("blur")); }, onFocusAfterTrapped: () => { e("focus"); }, onFocusInTrap: (n) => { t.visible && !r.value && (n.target && (i.value = n.target), r.value = !0); }, onFocusoutPrevented: (n) => { t.trapping || (n.detail.focusReason === "pointer" && n.preventDefault(), r.value = !1); }, onReleaseRequested: () => { r.value = !1, e("close"); } }; }, kre = Le({ name: "ElPopperContent" }), Pre = /* @__PURE__ */ Le({ ...kre, props: Ok, emits: wre, setup(t, { expose: e, emit: r }) { const i = t, { focusStartRef: n, trapped: a, onFocusAfterReleased: o, onFocusAfterTrapped: s, onFocusInTrap: c, onFocusoutPrevented: l, onReleaseRequested: u } = Lre(i, r), { attributes: d, arrowRef: h, contentRef: f, styles: p, instanceRef: m, role: y, update: g } = Cre(i), { ariaModal: v, arrowStyle: x, contentAttrs: w, contentClass: S, contentStyle: _, updateZIndex: b } = Are(i, { styles: p, attributes: d, role: y }), T = Ye(Jm, void 0), E = we(); Dt(Ck, { arrowStyle: x, arrowRef: h, arrowOffset: E }), T && Dt(Jm, { ...T, addInputId: Mh, removeInputId: Mh }); let C; const L = (k = !0) => { g(), k && b(); }, A = () => { L(!1), i.visible && i.focusOnShow ? a.value = !0 : i.visible === !1 && (a.value = !1); }; return Lt(() => { ze(() => i.triggerTargetEl, (k, P) => { C == null || C(), C = void 0; const R = N(k || f.value), M = N(P || f.value); cl(R) && (C = ze([y, () => i.ariaLabel, v, () => i.id], (O) => { ["role", "aria-label", "aria-modal", "id"].forEach((D, I) => { Ka(O[I]) ? R.removeAttribute(D) : R.setAttribute(D, O[I]); }); }, { immediate: !0 })), M !== R && cl(M) && ["role", "aria-label", "aria-modal", "id"].forEach((O) => { M.removeAttribute(O); }); }, { immediate: !0 }), ze(() => i.visible, A, { immediate: !0 }); }), Sr(() => { C == null || C(), C = void 0; }), e({ popperContentRef: f, popperInstanceRef: m, updatePopper: L, contentStyle: _ }), (k, P) => (Q(), be("div", Nr({ ref_key: "contentRef", ref: f }, N(w), { style: N(_), class: N(S), tabindex: "-1", onMouseenter: (R) => k.$emit("mouseenter", R), onMouseleave: (R) => k.$emit("mouseleave", R) }), [ oe(N(yre), { trapped: N(a), "trap-on-focus-in": !0, "focus-trap-el": N(f), "focus-start-el": N(n), onFocusAfterTrapped: N(s), onFocusAfterReleased: N(o), onFocusin: N(c), onFocusoutPrevented: N(l), onReleaseRequested: N(u) }, { default: le(() => [ Fe(k.$slots, "default") ]), _: 3 }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested"]) ], 16, ["onMouseenter", "onMouseleave"])); } }); var Rre = /* @__PURE__ */ Nt(Pre, [["__file", "content.vue"]]); const Ore = ai(Jte), Ex = Symbol("elTooltip"), nn = $t({ ...ate, ...Ok, appendTo: { type: ot([String, Object]) }, content: { type: String, default: "" }, rawContent: Boolean, persistent: Boolean, visible: { type: ot(Boolean), default: null }, transition: String, teleported: { type: Boolean, default: !0 }, disabled: Boolean, ...Gl(["ariaLabel"]) }), Lh = $t({ ...Pk, disabled: Boolean, trigger: { type: ot([String, Array]), default: "hover" }, triggerKeys: { type: ot(Array), default: () => [pa.enter, pa.space] } }), { useModelToggleProps: Dre, useModelToggleEmits: Ire, useModelToggle: Nre } = YQ("visible"), Bre = $t({ ...Ak, ...Dre, ...nn, ...Lh, ...Lk, showArrow: { type: Boolean, default: !0 } }), Fre = [ ...Ire, "before-show", "before-hide", "show", "hide", "open", "close" ], zre = (t, e) => ji(t) ? t.includes(e) : t === e, sc = (t, e, r) => (i) => { zre(N(t), e) && r(i); }, $re = Le({ name: "ElTooltipTrigger" }), Vre = /* @__PURE__ */ Le({ ...$re, props: Lh, setup(t, { expose: e }) { const r = t, i = Pt("tooltip"), { controlled: n, id: a, open: o, onOpen: s, onClose: c, onToggle: l } = Ye(Ex, void 0), u = we(null), d = () => { if (N(n) || r.disabled) return !0; }, h = pr(r, "trigger"), f = Va(d, sc(h, "hover", s)), p = Va(d, sc(h, "hover", c)), m = Va(d, sc(h, "click", (w) => { w.button === 0 && l(w); })), y = Va(d, sc(h, "focus", s)), g = Va(d, sc(h, "focus", c)), v = Va(d, sc(h, "contextmenu", (w) => { w.preventDefault(), l(w); })), x = Va(d, (w) => { const { code: S } = w; r.triggerKeys.includes(S) && (w.preventDefault(), l(w)); }); return e({ triggerRef: u }), (w, S) => (Q(), Re(N(are), { id: N(a), "virtual-ref": w.virtualRef, open: N(o), "virtual-triggering": w.virtualTriggering, class: xe(N(i).e("trigger")), onBlur: N(g), onClick: N(m), onContextmenu: N(v), onFocus: N(y), onMouseenter: N(f), onMouseleave: N(p), onKeydown: N(x) }, { default: le(() => [ Fe(w.$slots, "default") ]), _: 3 }, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"])); } }); var Ure = /* @__PURE__ */ Nt(Vre, [["__file", "trigger.vue"]]); const jre = $t({ to: { type: ot([String, Object]), required: !0 }, disabled: Boolean }), Hre = /* @__PURE__ */ Le({ __name: "teleport", props: jre, setup(t) { return (e, r) => e.disabled ? Fe(e.$slots, "default", { key: 0 }) : (Q(), Re(NT, { key: 1, to: e.to }, [ Fe(e.$slots, "default") ], 8, ["to"])); } }); var Gre = /* @__PURE__ */ Nt(Hre, [["__file", "teleport.vue"]]); const Wre = ai(Gre), qre = Le({ name: "ElTooltipContent", inheritAttrs: !1 }), Xre = /* @__PURE__ */ Le({ ...qre, props: nn, setup(t, { expose: e }) { const r = t, { selector: i } = vk(), n = Pt("tooltip"), a = we(null); let o; const { controlled: s, id: c, open: l, trigger: u, onClose: d, onOpen: h, onShow: f, onHide: p, onBeforeShow: m, onBeforeHide: y } = Ye(Ex, void 0), g = ee(() => r.transition || `${n.namespace.value}-fade-in-linear`), v = ee(() => process.env.NODE_ENV === "test" ? !0 : r.persistent); Sr(() => { o == null || o(); }); const x = ee(() => N(v) ? !0 : N(l)), w = ee(() => r.disabled ? !1 : N(l)), S = ee(() => r.appendTo || i.value), _ = ee(() => { var M; return (M = r.style) != null ? M : {}; }), b = we(!0), T = () => { p(), b.value = !0; }, E = () => { if (N(s)) return !0; }, C = Va(E, () => { r.enterable && N(u) === "hover" && h(); }), L = Va(E, () => { N(u) === "hover" && d(); }), A = () => { var M, O; (O = (M = a.value) == null ? void 0 : M.updatePopper) == null || O.call(M), m == null || m(); }, k = () => { y == null || y(); }, P = () => { f(), o = JX(ee(() => { var M; return (M = a.value) == null ? void 0 : M.popperContentRef; }), () => { N(s) || N(u) !== "hover" && d(); }); }, R = () => { r.virtualTriggering || d(); }; return ze(() => N(l), (M) => { M ? b.value = !1 : o == null || o(); }, { flush: "post" }), ze(() => r.content, () => { var M, O; (O = (M = a.value) == null ? void 0 : M.updatePopper) == null || O.call(M); }), e({ contentRef: a }), (M, O) => (Q(), Re(N(Wre), { disabled: !M.teleported, to: N(S) }, { default: le(() => [ oe(Zn, { name: N(g), onAfterLeave: T, onBeforeEnter: A, onAfterEnter: P, onBeforeLeave: k }, { default: le(() => [ N(x) ? ht((Q(), Re(N(Rre), Nr({ key: 0, id: N(c), ref_key: "contentRef", ref: a }, M.$attrs, { "aria-label": M.ariaLabel, "aria-hidden": b.value, "boundaries-padding": M.boundariesPadding, "fallback-placements": M.fallbackPlacements, "gpu-acceleration": M.gpuAcceleration, offset: M.offset, placement: M.placement, "popper-options": M.popperOptions, strategy: M.strategy, effect: M.effect, enterable: M.enterable, pure: M.pure, "popper-class": M.popperClass, "popper-style": [M.popperStyle, N(_)], "reference-el": M.referenceEl, "trigger-target-el": M.triggerTargetEl, visible: N(w), "z-index": M.zIndex, onMouseenter: N(C), onMouseleave: N(L), onBlur: R, onClose: N(d) }), { default: le(() => [ Fe(M.$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"])), [ [Ot, N(w)] ]) : Pe("v-if", !0) ]), _: 3 }, 8, ["name"]) ]), _: 3 }, 8, ["disabled", "to"])); } }); var Zre = /* @__PURE__ */ Nt(Xre, [["__file", "content.vue"]]); const Yre = Le({ name: "ElTooltip" }), Kre = /* @__PURE__ */ Le({ ...Yre, props: Bre, emits: Fre, setup(t, { expose: e, emit: r }) { const i = t; nte(); const n = Kg(), a = we(), o = we(), s = () => { var g; const v = N(a); v && ((g = v.popperInstanceRef) == null || g.update()); }, c = we(!1), l = we(), { show: u, hide: d, hasUpdateHandler: h } = Nre({ indicator: c, toggleReason: l }), { onOpen: f, onClose: p } = ote({ showAfter: pr(i, "showAfter"), hideAfter: pr(i, "hideAfter"), autoClose: pr(i, "autoClose"), open: u, close: d }), m = ee(() => ax(i.visible) && !h.value); Dt(Ex, { controlled: m, id: n, open: U1(c), trigger: pr(i, "trigger"), onOpen: (g) => { f(g); }, onClose: (g) => { p(g); }, onToggle: (g) => { N(c) ? p(g) : f(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 }), ze(() => i.disabled, (g) => { g && c.value && (c.value = !1); }); const y = (g) => { var v, x; const w = (x = (v = o.value) == null ? void 0 : v.contentRef) == null ? void 0 : x.popperContentRef, S = (g == null ? void 0 : g.relatedTarget) || document.activeElement; return w && w.contains(S); }; return RT(() => c.value && d()), e({ popperRef: a, contentRef: o, isFocusInsideContent: y, updatePopper: s, onOpen: f, onClose: p, hide: d }), (g, v) => (Q(), Re(N(Ore), { ref_key: "popperRef", ref: a, role: g.role }, { default: le(() => [ oe(Ure, { disabled: g.disabled, trigger: g.trigger, "trigger-keys": g.triggerKeys, "virtual-ref": g.virtualRef, "virtual-triggering": g.virtualTriggering }, { default: le(() => [ g.$slots.default ? Fe(g.$slots, "default", { key: 0 }) : Pe("v-if", !0) ]), _: 3 }, 8, ["disabled", "trigger", "trigger-keys", "virtual-ref", "virtual-triggering"]), oe(Zre, { 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: le(() => [ Fe(g.$slots, "content", {}, () => [ g.rawContent ? (Q(), be("span", { key: 0, innerHTML: g.content }, null, 8, ["innerHTML"])) : (Q(), be("span", { key: 1 }, Ze(g.content), 1)) ]), g.showArrow ? (Q(), Re(N(tre), { key: 0, "arrow-offset": g.arrowOffset }, null, 8, ["arrow-offset"])) : Pe("v-if", !0) ]), _: 3 }, 8, ["aria-label", "boundaries-padding", "content", "disabled", "effect", "enterable", "fallback-placements", "hide-after", "gpu-acceleration", "offset", "persistent", "popper-class", "popper-style", "placement", "popper-options", "pure", "raw-content", "reference-el", "trigger-target-el", "show-after", "strategy", "teleported", "transition", "virtual-triggering", "z-index", "append-to"]) ]), _: 3 }, 8, ["role"])); } }); var Jre = /* @__PURE__ */ Nt(Kre, [["__file", "tooltip.vue"]]); const Tx = ai(Jre), Dk = Symbol("buttonGroupContextKey"), Qre = (t, e) => { UQ({ from: "type.text", replacement: "link", version: "3.0.0", scope: "props", ref: "https://element-plus.org/en-US/component/button.html#button-attributes" }, ee(() => t.type === "text")); const r = Ye(Dk, void 0), i = yx("button"), { form: n } = fp(), a = Yu(ee(() => r == null ? void 0 : r.size)), o = Jg(), s = we(), c = co(), l = ee(() => t.type || (r == null ? void 0 : r.type) || ""), u = ee(() => { var f, p, m; return (m = (p = t.autoInsertSpace) != null ? p : (f = i.value) == null ? void 0 : f.autoInsertSpace) != null ? m : !1; }), d = ee(() => t.tag === "button" ? { ariaDisabled: o.value || t.loading, disabled: o.value || t.loading, autofocus: t.autofocus, type: t.nativeType } : {}), h = ee(() => { var f; const p = (f = c.default) == null ? void 0 : f.call(c); if (u.value && (p == null ? void 0 : p.length) === 1) { const m = p[0]; if ((m == null ? void 0 : m.type) === sg) { const y = m.children; return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(y.trim()); } } return !1; }); return { _disabled: o, _size: a, _type: l, _ref: s, _props: d, shouldAddSpace: h, handleClick: (f) => { if (o.value || t.loading) { f.stopPropagation(); return; } t.nativeType === "reset" && (n == null || n.resetFields()), e("click", f); } }; }, eie = [ "default", "primary", "success", "warning", "info", "danger", "text", "" ], tie = ["button", "submit", "reset"], Ky = $t({ size: hu, disabled: Boolean, type: { type: String, values: eie, default: "" }, icon: { type: bs }, nativeType: { type: String, values: tie, default: "button" }, loading: Boolean, loadingIcon: { type: bs, default: () => JL }, 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: ot([String, Object]), default: "button" } }), rie = { click: (t) => t instanceof MouseEvent }; function gi(t, e) { iie(t) && (t = "100%"); var r = nie(t); return t = e === 360 ? t : Math.min(e, Math.max(0, parseFloat(t))), r && (t = parseInt(String(t * e), 10) / 100), Math.abs(t - e) < 1e-6 ? 1 : (e === 360 ? t = (t < 0 ? t % e + e : t % e) / parseFloat(String(e)) : t = t % e / parseFloat(String(e)), t); } function af(t) { return Math.min(1, Math.max(0, t)); } function iie(t) { return typeof t == "string" && t.indexOf(".") !== -1 && parseFloat(t) === 1; } function nie(t) { return typeof t == "string" && t.indexOf("%") !== -1; } function Ik(t) { return t = parseFloat(t), (isNaN(t) || t < 0 || t > 1) && (t = 1), t; } function of(t) { return t <= 1 ? "".concat(Number(t) * 100, "%") : t; } function il(t) { return t.length === 1 ? "0" + t : String(t); } function aie(t, e, r) { return { r: gi(t, 255) * 255, g: gi(e, 255) * 255, b: gi(r, 255) * 255 }; } function wM(t, e, r) { t = gi(t, 255), e = gi(e, 255), r = gi(r, 255); var i = Math.max(t, e, r), n = Math.min(t, e, r), a = 0, o = 0, s = (i + n) / 2; if (i === n) o = 0, a = 0; else { var c = i - n; switch (o = s > 0.5 ? c / (2 - i - n) : c / (i + n), i) { case t: a = (e - r) / c + (e < r ? 6 : 0); break; case e: a = (r - t) / c + 2; break; case r: a = (t - e) / c + 4; break; } a /= 6; } return { h: a, s: o, l: s }; } function s0(t, e, r) { return r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? t + (e - t) * (6 * r) : r < 1 / 2 ? e : r < 2 / 3 ? t + (e - t) * (2 / 3 - r) * 6 : t; } function oie(t, e, r) { var i, n, a; if (t = gi(t, 360), e = gi(e, 100), r = gi(r, 100), e === 0) n = r, a = r, i = r; else { var o = r < 0.5 ? r * (1 + e) : r + e - r * e, s = 2 * r - o; i = s0(s, o, t + 1 / 3), n = s0(s, o, t), a = s0(s, o, t - 1 / 3); } return { r: i * 255, g: n * 255, b: a * 255 }; } function _M(t, e, r) { t = gi(t, 255), e = gi(e, 255), r = gi(r, 255); var i = Math.max(t, e, r), n = Math.min(t, e, r), a = 0, o = i, s = i - n, c = i === 0 ? 0 : s / i; if (i === n) a = 0; else { switch (i) { case t: a = (e - r) / s + (e < r ? 6 : 0); break; case e: a = (r - t) / s + 2; break; case r: a = (t - e) / s + 4; break; } a /= 6; } return { h: a, s: c, v: o }; } function sie(t, e, r) { t = gi(t, 360) * 6, e = gi(e, 100), r = gi(r, 100); var i = Math.floor(t), n = t - i, a = r * (1 - e), o = r * (1 - n * e), s = r * (1 - (1 - n) * e), c = i % 6, l = [r, o, a, a, s, r][c], u = [s, r, r, o, a, a][c], d = [a, a, s, r, r, o][c]; return { r: l * 255, g: u * 255, b: d * 255 }; } function SM(t, e, r, i) { var n = [ il(Math.round(t).toString(16)), il(Math.round(e).toString(16)), il(Math.round(r).toString(16)) ]; return i && n[0].startsWith(n[0].charAt(1)) && n[1].startsWith(n[1].charAt(1)) && n[2].startsWith(n[2].charAt(1)) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) : n.join(""); } function lie(t, e, r, i, n) { var a = [ il(Math.round(t).toString(16)), il(Math.round(e).toString(16)), il(Math.round(r).toString(16)), il(cie(i)) ]; return n && a[0].startsWith(a[0].charAt(1)) && a[1].startsWith(a[1].charAt(1)) && a[2].startsWith(a[2].charAt(1)) && a[3].startsWith(a[3].charAt(1)) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) + a[3].charAt(0) : a.join(""); } function cie(t) { return Math.round(parseFloat(t) * 255).toString(16); } function MM(t) { return rn(t) / 255; } function rn(t) { return parseInt(t, 16); } function uie(t) { return { r: t >> 16, g: (t & 65280) >> 8, b: t & 255 }; } var Jy = { 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 die(t) { var e = { r: 0, g: 0, b: 0 }, r = 1, i = null, n = null, a = null, o = !1, s = !1; return typeof t == "string" && (t = fie(t)), typeof t == "object" && (Ra(t.r) && Ra(t.g) && Ra(t.b) ? (e = aie(t.r, t.g, t.b), o = !0, s = String(t.r).substr(-1) === "%" ? "prgb" : "rgb") : Ra(t.h) && Ra(t.s) && Ra(t.v) ? (i = of(t.s), n = of(t.v), e = sie(t.h, i, n), o = !0, s = "hsv") : Ra(t.h) && Ra(t.s) && Ra(t.l) && (i = of(t.s), a = of(t.l), e = oie(t.h, i, a), o = !0, s = "hsl"), Object.prototype.hasOwnProperty.call(t, "a") && (r = t.a)), r = Ik(r), { ok: o, format: t.format || s, r: Math.min(255, Math.max(e.r, 0)), g: Math.min(255, Math.max(e.g, 0)), b: Math.min(255, Math.max(e.b, 0)), a: r }; } var hie = "[-\\+]?\\d+%?", pie = "[-\\+]?\\d*\\.\\d+%?", Qo = "(?:".concat(pie, ")|(?:").concat(hie, ")"), l0 = "[\\s|\\(]+(".concat(Qo, ")[,|\\s]+(").concat(Qo, ")[,|\\s]+(").concat(Qo, ")\\s*\\)?"), c0 = "[\\s|\\(]+(".concat(Qo, ")[,|\\s]+(").concat(Qo, ")[,|\\s]+(").concat(Qo, ")[,|\\s]+(").concat(Qo, ")\\s*\\)?"), Bn = { CSS_UNIT: new RegExp(Qo), rgb: new RegExp("rgb" + l0), rgba: new RegExp("rgba" + c0), hsl: new RegExp("hsl" + l0), hsla: new RegExp("hsla" + c0), hsv: new RegExp("hsv" + l0), hsva: new RegExp("hsva" + c0), 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 fie(t) { if (t = t.trim().toLowerCase(), t.length === 0) return !1; var e = !1; if (Jy[t]) t = Jy[t], e = !0; else if (t === "transparent") return { r: 0, g: 0, b: 0, a: 0, format: "name" }; var r = Bn.rgb.exec(t); return r ? { r: r[1], g: r[2], b: r[3] } : (r = Bn.rgba.exec(t), r ? { r: r[1], g: r[2], b: r[3], a: r[4] } : (r = Bn.hsl.exec(t), r ? { h: r[1], s: r[2], l: r[3] } : (r = Bn.hsla.exec(t), r ? { h: r[1], s: r[2], l: r[3], a: r[4] } : (r = Bn.hsv.exec(t), r ? { h: r[1], s: r[2], v: r[3] } : (r = Bn.hsva.exec(t), r ? { h: r[1], s: r[2], v: r[3], a: r[4] } : (r = Bn.hex8.exec(t), r ? { r: rn(r[1]), g: rn(r[2]), b: rn(r[3]), a: MM(r[4]), format: e ? "name" : "hex8" } : (r = Bn.hex6.exec(t), r ? { r: rn(r[1]), g: rn(r[2]), b: rn(r[3]), format: e ? "name" : "hex" } : (r = Bn.hex4.exec(t), r ? { r: rn(r[1] + r[1]), g: rn(r[2] + r[2]), b: rn(r[3] + r[3]), a: MM(r[4] + r[4]), format: e ? "name" : "hex8" } : (r = Bn.hex3.exec(t), r ? { r: rn(r[1] + r[1]), g: rn(r[2] + r[2]), b: rn(r[3] + r[3]), format: e ? "name" : "hex" } : !1))))))))); } function Ra(t) { return !!Bn.CSS_UNIT.exec(String(t)); } var mie = ( /** @class */ function() { function t(e, r) { e === void 0 && (e = ""), r === void 0 && (r = {}); var i; if (e instanceof t) return e; typeof e == "number" && (e = uie(e)), this.originalInput = e; var n = die(e); this.originalInput = e, this.r = n.r, this.g = n.g, this.b = n.b, this.a = n.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (i = r.format) !== null && i !== void 0 ? i : n.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 = n.ok; } return t.prototype.isDark = function() { return this.getBrightness() < 128; }, t.prototype.isLight = function() { return !this.isDark(); }, t.prototype.getBrightness = function() { var e = this.toRgb(); return (e.r * 299 + e.g * 587 + e.b * 114) / 1e3; }, t.prototype.getLuminance = function() { var e = this.toRgb(), r, i, n, a = e.r / 255, o = e.g / 255, s = e.b / 255; return a <= 0.03928 ? r = a / 12.92 : r = Math.pow((a + 0.055) / 1.055, 2.4), o <= 0.03928 ? i = o / 12.92 : i = Math.pow((o + 0.055) / 1.055, 2.4), s <= 0.03928 ? n = s / 12.92 : n = Math.pow((s + 0.055) / 1.055, 2.4), 0.2126 * r + 0.7152 * i + 0.0722 * n; }, t.prototype.getAlpha = function() { return this.a; }, t.prototype.setAlpha = function(e) { return this.a = Ik(e), this.roundA = Math.round(100 * this.a) / 100, this; }, t.prototype.isMonochrome = function() { var e = this.toHsl().s; return e === 0; }, t.prototype.toHsv = function() { var e = _M(this.r, this.g, this.b); return { h: e.h * 360, s: e.s, v: e.v, a: this.a }; }, t.prototype.toHsvString = function() { var e = _M(this.r, this.g, this.b), r = Math.round(e.h * 360), i = Math.round(e.s * 100), n = Math.round(e.v * 100); return this.a === 1 ? "hsv(".concat(r, ", ").concat(i, "%, ").concat(n, "%)") : "hsva(".concat(r, ", ").concat(i, "%, ").concat(n, "%, ").concat(this.roundA, ")"); }, t.prototype.toHsl = function() { var e = wM(this.r, this.g, this.b); return { h: e.h * 360, s: e.s, l: e.l, a: this.a }; }, t.prototype.toHslString = function() { var e = wM(this.r, this.g, this.b), r = Math.round(e.h * 360), i = Math.round(e.s * 100), n = Math.round(e.l * 100); return this.a === 1 ? "hsl(".concat(r, ", ").concat(i, "%, ").concat(n, "%)") : "hsla(".concat(r, ", ").concat(i, "%, ").concat(n, "%, ").concat(this.roundA, ")"); }, t.prototype.toHex = function(e) { return e === void 0 && (e = !1), SM(this.r, this.g, this.b, e); }, t.prototype.toHexString = function(e) { return e === void 0 && (e = !1), "#" + this.toHex(e); }, t.prototype.toHex8 = function(e) { return e === void 0 && (e = !1), lie(this.r, this.g, this.b, this.a, e); }, t.prototype.toHex8String = function(e) { return e === void 0 && (e = !1), "#" + this.toHex8(e); }, t.prototype.toHexShortString = function(e) { return e === void 0 && (e = !1), this.a === 1 ? this.toHexString(e) : this.toHex8String(e); }, t.prototype.toRgb = function() { return { r: Math.round(this.r), g: Math.round(this.g), b: Math.round(this.b), a: this.a }; }, t.prototype.toRgbString = function() { var e = Math.round(this.r), r = Math.round(this.g), i = Math.round(this.b); return this.a === 1 ? "rgb(".concat(e, ", ").concat(r, ", ").concat(i, ")") : "rgba(".concat(e, ", ").concat(r, ", ").concat(i, ", ").concat(this.roundA, ")"); }, t.prototype.toPercentageRgb = function() { var e = function(r) { return "".concat(Math.round(gi(r, 255) * 100), "%"); }; return { r: e(this.r), g: e(this.g), b: e(this.b), a: this.a }; }, t.prototype.toPercentageRgbString = function() { var e = function(r) { return Math.round(gi(r, 255) * 100); }; return this.a === 1 ? "rgb(".concat(e(this.r), "%, ").concat(e(this.g), "%, ").concat(e(this.b), "%)") : "rgba(".concat(e(this.r), "%, ").concat(e(this.g), "%, ").concat(e(this.b), "%, ").concat(this.roundA, ")"); }, t.prototype.toName = function() { if (this.a === 0) return "transparent"; if (this.a < 1) return !1; for (var e = "#" + SM(this.r, this.g, this.b, !1), r = 0, i = Object.entries(Jy); r < i.length; r++) { var n = i[r], a = n[0], o = n[1]; if (e === o) return a; } return !1; }, t.prototype.toString = function(e) { var r = !!e; e = e ?? this.format; var i = !1, n = this.a < 1 && this.a >= 0, a = !r && n && (e.startsWith("hex") || e === "name"); return a ? e === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (i = this.toRgbString()), e === "prgb" && (i = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (i = this.toHexString()), e === "hex3" && (i = this.toHexString(!0)), e === "hex4" && (i = this.toHex8String(!0)), e === "hex8" && (i = this.toHex8String()), e === "name" && (i = this.toName()), e === "hsl" && (i = this.toHslString()), e === "hsv" && (i = this.toHsvString()), i || this.toHexString()); }, t.prototype.toNumber = function() { return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b); }, t.prototype.clone = function() { return new t(this.toString()); }, t.prototype.lighten = function(e) { e === void 0 && (e = 10); var r = this.toHsl(); return r.l += e / 100, r.l = af(r.l), new t(r); }, t.prototype.brighten = function(e) { e === void 0 && (e = 10); var r = this.toRgb(); return r.r = Math.max(0, Math.min(255, r.r - Math.round(255 * -(e / 100)))), r.g = Math.max(0, Math.min(255, r.g - Math.round(255 * -(e / 100)))), r.b = Math.max(0, Math.min(255, r.b - Math.round(255 * -(e / 100)))), new t(r); }, t.prototype.darken = function(e) { e === void 0 && (e = 10); var r = this.toHsl(); return r.l -= e / 100, r.l = af(r.l), new t(r); }, t.prototype.tint = function(e) { return e === void 0 && (e = 10), this.mix("white", e); }, t.prototype.shade = function(e) { return e === void 0 && (e = 10), this.mix("black", e); }, t.prototype.desaturate = function(e) { e === void 0 && (e = 10); var r = this.toHsl(); return r.s -= e / 100, r.s = af(r.s), new t(r); }, t.prototype.saturate = function(e) { e === void 0 && (e = 10); var r = this.toHsl(); return r.s += e / 100, r.s = af(r.s), new t(r); }, t.prototype.greyscale = function() { return this.desaturate(100); }, t.prototype.spin = function(e) { var r = this.toHsl(), i = (r.h + e) % 360; return r.h = i < 0 ? 360 + i : i, new t(r); }, t.prototype.mix = function(e, r) { r === void 0 && (r = 50); var i = this.toRgb(), n = new t(e).toRgb(), a = r / 100, o = { r: (n.r - i.r) * a + i.r, g: (n.g - i.g) * a + i.g, b: (n.b - i.b) * a + i.b, a: (n.a - i.a) * a + i.a }; return new t(o); }, t.prototype.analogous = function(e, r) { e === void 0 && (e = 6), r === void 0 && (r = 30); var i = this.toHsl(), n = 360 / r, a = [this]; for (i.h = (i.h - (n * e >> 1) + 720) % 360; --e; ) i.h = (i.h + n) % 360, a.push(new t(i)); return a; }, t.prototype.complement = function() { var e = this.toHsl(); return e.h = (e.h + 180) % 360, new t(e); }, t.prototype.monochromatic = function(e) { e === void 0 && (e = 6); for (var r = this.toHsv(), i = r.h, n = r.s, a = r.v, o = [], s = 1 / e; e--; ) o.push(new t({ h: i, s: n, v: a })), a = (a + s) % 1; return o; }, t.prototype.splitcomplement = function() { var e = this.toHsl(), r = e.h; return [ this, new t({ h: (r + 72) % 360, s: e.s, l: e.l }), new t({ h: (r + 216) % 360, s: e.s, l: e.l }) ]; }, t.prototype.onBackground = function(e) { var r = this.toRgb(), i = new t(e).toRgb(), n = r.a + i.a * (1 - r.a); return new t({ r: (r.r * r.a + i.r * i.a * (1 - r.a)) / n, g: (r.g * r.a + i.g * i.a * (1 - r.a)) / n, b: (r.b * r.a + i.b * i.a * (1 - r.a)) / n, a: n }); }, t.prototype.triad = function() { return this.polyad(3); }, t.prototype.tetrad = function() { return this.polyad(4); }, t.prototype.polyad = function(e) { for (var r = this.toHsl(), i = r.h, n = [this], a = 360 / e, o = 1; o < e; o++) n.push(new t({ h: (i + o * a) % 360, s: r.s, l: r.l })); return n; }, t.prototype.equals = function(e) { return this.toRgbString() === new t(e).toRgbString(); }, t; }() ); function Lo(t, e = 20) { return t.mix("#141414", e).toString(); } function gie(t) { const e = Jg(), r = Pt("button"); return ee(() => { let i = {}, n = t.color; if (n) { const a = n.match(/var\((.*?)\)/); a && (n = window.getComputedStyle(window.document.documentElement).getPropertyValue(a[1])); const o = new mie(n), s = t.dark ? o.tint(20).toString() : Lo(o, 20); if (t.plain) i = r.cssVarBlock({ "bg-color": t.dark ? Lo(o, 90) : o.tint(90).toString(), "text-color": n, "border-color": t.dark ? Lo(o, 50) : o.tint(50).toString(), "hover-text-color": `var(${r.cssVarName("color-white")})`, "hover-bg-color": n, "hover-border-color": n, "active-bg-color": s, "active-text-color": `var(${r.cssVarName("color-white")})`, "active-border-color": s }), e.value && (i[r.cssVarBlockName("disabled-bg-color")] = t.dark ? Lo(o, 90) : o.tint(90).toString(), i[r.cssVarBlockName("disabled-text-color")] = t.dark ? Lo(o, 50) : o.tint(50).toString(), i[r.cssVarBlockName("disabled-border-color")] = t.dark ? Lo(o, 80) : o.tint(80).toString()); else { const c = t.dark ? Lo(o, 30) : o.tint(30).toString(), l = o.isDark() ? `var(${r.cssVarName("color-white")})` : `var(${r.cssVarName("color-black")})`; if (i = r.cssVarBlock({ "bg-color": n, "text-color": l, "border-color": n, "hover-bg-color": c, "hover-text-color": l, "hover-border-color": c, "active-bg-color": s, "active-border-color": s }), e.value) { const u = t.dark ? Lo(o, 50) : o.tint(50).toString(); i[r.cssVarBlockName("disabled-bg-color")] = u, i[r.cssVarBlockName("disabled-text-color")] = t.dark ? "rgba(255, 255, 255, 0.5)" : `var(${r.cssVarName("color-white")})`, i[r.cssVarBlockName("disabled-border-color")] = u; } } } return i; }); } const vie = Le({ name: "ElButton" }), yie = /* @__PURE__ */ Le({ ...vie, props: Ky, emits: rie, setup(t, { expose: e, emit: r }) { const i = t, n = gie(i), a = Pt("button"), { _ref: o, _size: s, _type: c, _disabled: l, _props: u, shouldAddSpace: d, handleClick: h } = Qre(i, r), f = ee(() => [ a.b(), a.m(c.value), a.m(s.value), a.is("disabled", l.value), a.is("loading", i.loading), a.is("plain", i.plain), a.is("round", i.round), a.is("circle", i.circle), a.is("text", i.text), a.is("link", i.link), a.is("has-bg", i.bg) ]); return e({ ref: o, size: s, type: c, disabled: l, shouldAddSpace: d }), (p, m) => (Q(), Re(Yt(p.tag), Nr({ ref_key: "_ref", ref: o }, N(u), { class: N(f), style: N(n), onClick: N(h) }), { default: le(() => [ p.loading ? (Q(), be(pt, { key: 0 }, [ p.$slots.loading ? Fe(p.$slots, "loading", { key: 0 }) : (Q(), Re(N(yr), { key: 1, class: xe(N(a).is("loading")) }, { default: le(() => [ (Q(), Re(Yt(p.loadingIcon))) ]), _: 1 }, 8, ["class"])) ], 64)) : p.icon || p.$slots.icon ? (Q(), Re(N(yr), { key: 1 }, { default: le(() => [ p.icon ? (Q(), Re(Yt(p.icon), { key: 0 })) : Fe(p.$slots, "icon", { key: 1 }) ]), _: 3 })) : Pe("v-if", !0), p.$slots.default ? (Q(), be("span", { key: 2, class: xe({ [N(a).em("text", "expand")]: N(d) }) }, [ Fe(p.$slots, "default") ], 2)) : Pe("v-if", !0) ]), _: 3 }, 16, ["class", "style", "onClick"])); } }); var bie = /* @__PURE__ */ Nt(yie, [["__file", "button.vue"]]); const xie = { size: Ky.size, type: Ky.type }, wie = Le({ name: "ElButtonGroup" }), _ie = /* @__PURE__ */ Le({ ...wie, props: xie, setup(t) { const e = t; Dt(Dk, _r({ size: pr(e, "size"), type: pr(e, "type") })); const r = Pt("button"); return (i, n) => (Q(), be("div", { class: xe(N(r).b("group")) }, [ Fe(i.$slots, "default") ], 2)); } }); var Nk = /* @__PURE__ */ Nt(_ie, [["__file", "button-group.vue"]]); const Ku = ai(bie, { ButtonGroup: Nk }); yo(Nk); var Wo = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function Sie(t) { return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; } function ev(t) { if (t.__esModule) return t; var e = t.default; if (typeof e == "function") { var r = function i() { return this instanceof i ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments); }; r.prototype = e.prototype; } else r = {}; return Object.defineProperty(r, "__esModule", { value: !0 }), Object.keys(t).forEach(function(i) { var n = Object.getOwnPropertyDescriptor(t, i); Object.defineProperty(r, i, n.get ? n : { enumerable: !0, get: function() { return t[i]; } }); }), r; } const Uo = /* @__PURE__ */ new Map(); if (Ur) { let t; document.addEventListener("mousedown", (e) => t = e), document.addEventListener("mouseup", (e) => { if (t) { for (const r of Uo.values()) for (const { documentHandler: i } of r) i(e, t); t = void 0; } }); } function EM(t, e) { let r = []; return Array.isArray(e.arg) ? r = e.arg : cl(e.arg) && r.push(e.arg), function(i, n) { const a = e.instance.popperRef, o = i.target, s = n == null ? void 0 : n.target, c = !e || !e.instance, l = !o || !s, u = t.contains(o) || t.contains(s), d = t === o, h = r.length && r.some((p) => p == null ? void 0 : p.contains(o)) || r.length && r.includes(s), f = a && (a.contains(o) || a.contains(s)); c || l || u || d || h || f || e.value(i, n); }; } const Mie = { beforeMount(t, e) { Uo.has(t) || Uo.set(t, []), Uo.get(t).push({ documentHandler: EM(t, e), bindingFn: e.value }); }, updated(t, e) { Uo.has(t) || Uo.set(t, []); const r = Uo.get(t), i = r.findIndex((a) => a.bindingFn === e.oldValue), n = { documentHandler: EM(t, e), bindingFn: e.value }; i >= 0 ? r.splice(i, 1, n) : r.push(n); }, unmounted(t) { Uo.delete(t); } }, Eie = 100, Tie = 600, TM = { beforeMount(t, e) { const r = e.value, { interval: i = Eie, delay: n = Tie } = Mi(r) ? {} : r; let a, o; const s = () => Mi(r) ? r() : r.handler(), c = () => { o && (clearTimeout(o), o = void 0), a && (clearInterval(a), a = void 0); }; t.addEventListener("mousedown", (l) => { l.button === 0 && (c(), s(), document.addEventListener("mouseup", () => c(), { once: !0 }), o = setTimeout(() => { a = setInterval(() => { s(); }, i); }, n)); }); } }, Qy = $t({ type: { type: String, values: ["primary", "success", "info", "warning", "danger"], default: "primary" }, closable: Boolean, disableTransitions: Boolean, hit: Boolean, color: String, size: { type: String, values: rk }, effect: { type: String, values: ["dark", "light", "plain"], default: "light" }, round: Boolean }), Cie = { close: (t) => t instanceof MouseEvent, click: (t) => t instanceof MouseEvent }, Aie = Le({ name: "ElTag" }), Lie = /* @__PURE__ */ Le({ ...Aie, props: Qy, emits: Cie, setup(t, { emit: e }) { const r = t, i = Yu(), n = Pt("tag"), a = ee(() => { const { type: l, hit: u, effect: d, closable: h, round: f } = r; return [ n.b(), n.is("closable", h), n.m(l || "primary"), n.m(i.value), n.m(d), n.is("hit", u), n.is("round", f) ]; }), o = (l) => { e("close", l); }, s = (l) => { e("click", l); }, c = (l) => { l.component.subTree.component.bum = null; }; return (l, u) => l.disableTransitions ? (Q(), be("span", { key: 0, class: xe(N(a)), style: yt({ backgroundColor: l.color }), onClick: s }, [ Ee("span", { class: xe(N(n).e("content")) }, [ Fe(l.$slots, "default") ], 2), l.closable ? (Q(), Re(N(yr), { key: 0, class: xe(N(n).e("close")), onClick: Tt(o, ["stop"]) }, { default: le(() => [ oe(N(qy)) ]), _: 1 }, 8, ["class", "onClick"])) : Pe("v-if", !0) ], 6)) : (Q(), Re(Zn, { key: 1, name: `${N(n).namespace.value}-zoom-in-center`, appear: "", onVnodeMounted: c }, { default: le(() => [ Ee("span", { class: xe(N(a)), style: yt({ backgroundColor: l.color }), onClick: s }, [ Ee("span", { class: xe(N(n).e("content")) }, [ Fe(l.$slots, "default") ], 2), l.closable ? (Q(), Re(N(yr), { key: 0, class: xe(N(n).e("close")), onClick: Tt(o, ["stop"]) }, { default: le(() => [ oe(N(qy)) ]), _: 1 }, 8, ["class", "onClick"])) : Pe("v-if", !0) ], 6) ]), _: 3 }, 8, ["name"])); } }); var kie = /* @__PURE__ */ Nt(Lie, [["__file", "tag.vue"]]); const Pie = ai(kie), Bk = Symbol("rowContextKey"), Rie = [ "start", "center", "end", "space-around", "space-between", "space-evenly" ], Oie = ["top", "middle", "bottom"], Die = $t({ tag: { type: String, default: "div" }, gutter: { type: Number, default: 0 }, justify: { type: String, values: Rie, default: "start" }, align: { type: String, values: Oie } }), Iie = Le({ name: "ElRow" }), Nie = /* @__PURE__ */ Le({ ...Iie, props: Die, setup(t) { const e = t, r = Pt("row"), i = ee(() => e.gutter); Dt(Bk, { gutter: i }); const n = ee(() => { const o = {}; return e.gutter && (o.marginRight = o.marginLeft = `-${e.gutter / 2}px`), o; }), a = ee(() => [ r.b(), r.is(`justify-${e.justify}`, e.justify !== "start"), r.is(`align-${e.align}`, !!e.align) ]); return (o, s) => (Q(), Re(Yt(o.tag), { class: xe(N(a)), style: yt(N(n)) }, { default: le(() => [ Fe(o.$slots, "default") ]), _: 3 }, 8, ["class", "style"])); } }); var Bie = /* @__PURE__ */ Nt(Nie, [["__file", "row.vue"]]); const Aa = ai(Bie), Fie = $t({ 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: ot([Number, Object]), default: () => Ga({}) }, sm: { type: ot([Number, Object]), default: () => Ga({}) }, md: { type: ot([Number, Object]), default: () => Ga({}) }, lg: { type: ot([Number, Object]), default: () => Ga({}) }, xl: { type: ot([Number, Object]), default: () => Ga({}) } }), zie = Le({ name: "ElCol" }), $ie = /* @__PURE__ */ Le({ ...zie, props: Fie, setup(t) { const e = t, { gutter: r } = Ye(Bk, { gutter: ee(() => 0) }), i = Pt("col"), n = ee(() => { const o = {}; return r.value && (o.paddingLeft = o.paddingRight = `${r.value / 2}px`), o; }), a = ee(() => { const o = []; return ["span", "offset", "pull", "push"].forEach((s) => { const c = e[s]; Jt(c) && (s === "span" ? o.push(i.b(`${e[s]}`)) : c > 0 && o.push(i.b(`${s}-${e[s]}`))); }), ["xs", "sm", "md", "lg", "xl"].forEach((s) => { Jt(e[s]) ? o.push(i.b(`${s}-${e[s]}`)) : Ii(e[s]) && Object.entries(e[s]).forEach(([c, l]) => { o.push(c !== "span" ? i.b(`${s}-${c}-${l}`) : i.b(`${s}-${l}`)); }); }), r.value && o.push(i.is("guttered")), [i.b(), o]; }); return (o, s) => (Q(), Re(Yt(o.tag), { class: xe(N(a)), style: yt(N(n)) }, { default: le(() => [ Fe(o.$slots, "default") ]), _: 3 }, 8, ["class", "style"])); } }); var Vie = /* @__PURE__ */ Nt($ie, [["__file", "col.vue"]]); const Jn = ai(Vie), CM = (t) => Jt(t) || Ni(t) || ji(t), Uie = $t({ accordion: Boolean, modelValue: { type: ot([Array, String, Number]), default: () => Ga([]) } }), jie = { [gr]: CM, [ks]: CM }, Fk = Symbol("collapseContextKey"), Hie = (t, e) => { const r = we(sa(t.modelValue)), i = (a) => { r.value = a; const o = t.accordion ? r.value[0] : r.value; e(gr, o), e(ks, o); }, n = (a) => { if (t.accordion) i([r.value[0] === a ? "" : a]); else { const o = [...r.value], s = o.indexOf(a); s > -1 ? o.splice(s, 1) : o.push(a), i(o); } }; return ze(() => t.modelValue, () => r.value = sa(t.modelValue), { deep: !0 }), Dt(Fk, { activeNames: r, handleItemClick: n }), { activeNames: r, setActiveNames: i }; }, Gie = () => { const t = Pt("collapse"); return { rootKls: ee(() => t.b()) }; }, Wie = Le({ name: "ElCollapse" }), qie = /* @__PURE__ */ Le({ ...Wie, props: Uie, emits: jie, setup(t, { expose: e, emit: r }) { const i = t, { activeNames: n, setActiveNames: a } = Hie(i, r), { rootKls: o } = Gie(); return e({ activeNames: n, setActiveNames: a }), (s, c) => (Q(), be("div", { class: xe(N(o)) }, [ Fe(s.$slots, "default") ], 2)); } }); var Xie = /* @__PURE__ */ Nt(qie, [["__file", "collapse.vue"]]); const Zie = Le({ name: "ElCollapseTransition" }), Yie = /* @__PURE__ */ Le({ ...Zie, setup(t) { const e = Pt("collapse-transition"), r = (n) => { n.style.maxHeight = "", n.style.overflow = n.dataset.oldOverflow, n.style.paddingTop = n.dataset.oldPaddingTop, n.style.paddingBottom = n.dataset.oldPaddingBottom; }, i = { beforeEnter(n) { n.dataset || (n.dataset = {}), n.dataset.oldPaddingTop = n.style.paddingTop, n.dataset.oldPaddingBottom = n.style.paddingBottom, n.style.height && (n.dataset.elExistsHeight = n.style.height), n.style.maxHeight = 0, n.style.paddingTop = 0, n.style.paddingBottom = 0; }, enter(n) { requestAnimationFrame(() => { n.dataset.oldOverflow = n.style.overflow, n.dataset.elExistsHeight ? n.style.maxHeight = n.dataset.elExistsHeight : n.scrollHeight !== 0 ? n.style.maxHeight = `${n.scrollHeight}px` : n.style.maxHeight = 0, n.style.paddingTop = n.dataset.oldPaddingTop, n.style.paddingBottom = n.dataset.oldPaddingBottom, n.style.overflow = "hidden"; }); }, afterEnter(n) { n.style.maxHeight = "", n.style.overflow = n.dataset.oldOverflow; }, enterCancelled(n) { r(n); }, beforeLeave(n) { n.dataset || (n.dataset = {}), n.dataset.oldPaddingTop = n.style.paddingTop, n.dataset.oldPaddingBottom = n.style.paddingBottom, n.dataset.oldOverflow = n.style.overflow, n.style.maxHeight = `${n.scrollHeight}px`, n.style.overflow = "hidden"; }, leave(n) { n.scrollHeight !== 0 && (n.style.maxHeight = 0, n.style.paddingTop = 0, n.style.paddingBottom = 0); }, afterLeave(n) { r(n); }, leaveCancelled(n) { r(n); } }; return (n, a) => (Q(), Re(Zn, Nr({ name: N(e).b() }, OT(i)), { default: le(() => [ Fe(n.$slots, "default") ]), _: 3 }, 16, ["name"])); } }); var Kie = /* @__PURE__ */ Nt(Yie, [["__file", "collapse-transition.vue"]]); const Jie = ai(Kie), Qie = $t({ title: { type: String, default: "" }, name: { type: ot([String, Number]), default: void 0 }, icon: { type: bs, default: ys }, disabled: Boolean }), ene = (t) => { const e = Ye(Fk), { namespace: r } = Pt("collapse"), i = we(!1), n = we(!1), a = vx(), o = ee(() => a.current++), s = ee(() => { var l; return (l = t.name) != null ? l : `${r.value}-id-${a.prefix}-${N(o)}`; }), c = ee(() => e == null ? void 0 : e.activeNames.value.includes(N(s))); return { focusing: i, id: o, isActive: c, handleFocus: () => { setTimeout(() => { n.value ? n.value = !1 : i.value = !0; }, 50); }, handleHeaderClick: () => { t.disabled || (e == null || e.handleItemClick(N(s)), i.value = !1, n.value = !0); }, handleEnterClick: () => { e == null || e.handleItemClick(N(s)); } }; }, tne = (t, { focusing: e, isActive: r, id: i }) => { const n = Pt("collapse"), a = ee(() => [ n.b("item"), n.is("active", N(r)), n.is("disabled", t.disabled) ]), o = ee(() => [ n.be("item", "header"), n.is("active", N(r)), { focusing: N(e) && !t.disabled } ]), s = ee(() => [ n.be("item", "arrow"), n.is("active", N(r)) ]), c = ee(() => n.be("item", "wrap")), l = ee(() => n.be("item", "content")), u = ee(() => n.b(`content-${N(i)}`)), d = ee(() => n.b(`head-${N(i)}`)); return { arrowKls: s, headKls: o, rootKls: a, itemWrapperKls: c, itemContentKls: l, scopedContentId: u, scopedHeadId: d }; }, rne = Le({ name: "ElCollapseItem" }), ine = /* @__PURE__ */ Le({ ...rne, props: Qie, setup(t, { expose: e }) { const r = t, { focusing: i, id: n, isActive: a, handleFocus: o, handleHeaderClick: s, handleEnterClick: c } = ene(r), { arrowKls: l, headKls: u, rootKls: d, itemWrapperKls: h, itemContentKls: f, scopedContentId: p, scopedHeadId: m } = tne(r, { focusing: i, isActive: a, id: n }); return e({ isActive: a }), (y, g) => (Q(), be("div", { class: xe(N(d)) }, [ Ee("button", { id: N(m), class: xe(N(u)), "aria-expanded": N(a), "aria-controls": N(p), "aria-describedby": N(p), tabindex: y.disabled ? -1 : 0, type: "button", onClick: N(s), onKeydown: ti(Tt(N(c), ["stop", "prevent"]), ["space", "enter"]), onFocus: N(o), onBlur: (v) => i.value = !1 }, [ Fe(y.$slots, "title", {}, () => [ et(Ze(y.title), 1) ]), Fe(y.$slots, "icon", { isActive: N(a) }, () => [ oe(N(yr), { class: xe(N(l)) }, { default: le(() => [ (Q(), Re(Yt(y.icon))) ]), _: 1 }, 8, ["class"]) ]) ], 42, ["id", "aria-expanded", "aria-controls", "aria-describedby", "tabindex", "onClick", "onKeydown", "onFocus", "onBlur"]), oe(N(Jie), null, { default: le(() => [ ht(Ee("div", { id: N(p), role: "region", class: xe(N(h)), "aria-hidden": !N(a), "aria-labelledby": N(m) }, [ Ee("div", { class: xe(N(f)) }, [ Fe(y.$slots, "default") ], 2) ], 10, ["id", "aria-hidden", "aria-labelledby"]), [ [Ot, N(a)] ]) ]), _: 3 }) ], 2)); } }); var zk = /* @__PURE__ */ Nt(ine, [["__file", "collapse-item.vue"]]); const $k = ai(Xie, { CollapseItem: zk }), Vk = yo(zk), nne = Le({ name: "ElContainer" }), ane = /* @__PURE__ */ Le({ ...nne, props: { direction: { type: String } }, setup(t) { const e = t, r = co(), i = Pt("container"), n = ee(() => e.direction === "vertical" ? !0 : e.direction === "horizontal" ? !1 : r && r.default ? r.default().some((a) => { const o = a.type.name; return o === "ElHeader" || o === "ElFooter"; }) : !1); return (a, o) => (Q(), be("section", { class: xe([N(i).b(), N(i).is("vertical", N(n))]) }, [ Fe(a.$slots, "default") ], 2)); } }); var one = /* @__PURE__ */ Nt(ane, [["__file", "container.vue"]]); const sne = Le({ name: "ElAside" }), lne = /* @__PURE__ */ Le({ ...sne, props: { width: { type: String, default: null } }, setup(t) { const e = t, r = Pt("aside"), i = ee(() => e.width ? r.cssVarBlock({ width: e.width }) : {}); return (n, a) => (Q(), be("aside", { class: xe(N(r).b()), style: yt(N(i)) }, [ Fe(n.$slots, "default") ], 6)); } }); var Uk = /* @__PURE__ */ Nt(lne, [["__file", "aside.vue"]]); const cne = Le({ name: "ElFooter" }), une = /* @__PURE__ */ Le({ ...cne, props: { height: { type: String, default: null } }, setup(t) { const e = t, r = Pt("footer"), i = ee(() => e.height ? r.cssVarBlock({ height: e.height }) : {}); return (n, a) => (Q(), be("footer", { class: xe(N(r).b()), style: yt(N(i)) }, [ Fe(n.$slots, "default") ], 6)); } }); var jk = /* @__PURE__ */ Nt(une, [["__file", "footer.vue"]]); const dne = Le({ name: "ElHeader" }), hne = /* @__PURE__ */ Le({ ...dne, props: { height: { type: String, default: null } }, setup(t) { const e = t, r = Pt("header"), i = ee(() => e.height ? r.cssVarBlock({ height: e.height }) : {}); return (n, a) => (Q(), be("header", { class: xe(N(r).b()), style: yt(N(i)) }, [ Fe(n.$slots, "default") ], 6)); } }); var Hk = /* @__PURE__ */ Nt(hne, [["__file", "header.vue"]]); const pne = Le({ name: "ElMain" }), fne = /* @__PURE__ */ Le({ ...pne, setup(t) { const e = Pt("main"); return (r, i) => (Q(), be("main", { class: xe(N(e).b()) }, [ Fe(r.$slots, "default") ], 2)); } }); var Gk = /* @__PURE__ */ Nt(fne, [["__file", "main.vue"]]); const La = ai(one, { Aside: Uk, Footer: jk, Header: Hk, Main: Gk }); yo(Uk); const Wk = yo(jk), mne = yo(Hk), bo = yo(Gk), gne = /* @__PURE__ */ Le({ inheritAttrs: !1 }); function vne(t, e, r, i, n, a) { return Fe(t.$slots, "default"); } var yne = /* @__PURE__ */ Nt(gne, [["render", vne], ["__file", "collection.vue"]]); const bne = /* @__PURE__ */ Le({ name: "ElCollectionItem", inheritAttrs: !1 }); function xne(t, e, r, i, n, a) { return Fe(t.$slots, "default"); } var wne = /* @__PURE__ */ Nt(bne, [["render", xne], ["__file", "collection-item.vue"]]); const _ne = "data-el-collection-item", Sne = (t) => { const e = `El${t}Collection`, r = `${e}Item`, i = Symbol(e), n = Symbol(r), a = { ...yne, name: e, setup() { const s = we(null), c = /* @__PURE__ */ new Map(); Dt(i, { itemMap: c, getItems: () => { const l = N(s); if (!l) return []; const u = Array.from(l.querySelectorAll(`[${_ne}]`)); return [...c.values()].sort((d, h) => u.indexOf(d.ref) - u.indexOf(h.ref)); }, collectionRef: s }); } }, o = { ...wne, name: r, setup(s, { attrs: c }) { const l = we(null), u = Ye(i, void 0); Dt(n, { collectionItemRef: l }), Lt(() => { const d = N(l); d && u.itemMap.set(d, { ref: d, ...c }); }), Sr(() => { const d = N(l); u.itemMap.delete(d); }); } }; return { COLLECTION_INJECTION_KEY: i, COLLECTION_ITEM_INJECTION_KEY: n, ElCollection: a, ElCollectionItem: o }; }, u0 = $t({ trigger: Lh.trigger, effect: { ...nn.effect, default: "light" }, type: { type: ot(String) }, placement: { type: ot(String), default: "bottom" }, popperOptions: { type: ot(Object), default: () => ({}) }, id: String, size: { type: String, default: "" }, splitButton: Boolean, hideOnClick: { type: Boolean, default: !0 }, loop: { type: Boolean, default: !0 }, showTimeout: { type: Number, default: 150 }, hideTimeout: { type: Number, default: 150 }, tabindex: { type: ot([Number, String]), default: 0 }, maxHeight: { type: ot([Number, String]), default: "" }, popperClass: { type: String, default: "" }, disabled: Boolean, role: { type: String, default: "menu" }, buttonProps: { type: ot(Object) }, teleported: nn.teleported }); $t({ command: { type: [Object, String, Number], default: () => ({}) }, disabled: Boolean, divided: Boolean, textValue: String, icon: { type: bs } }); $t({ onKeydown: { type: ot(Function) } }); Sne("Dropdown"); const Mne = $t({ id: { type: String, default: void 0 }, step: { type: Number, default: 1 }, stepStrictly: Boolean, max: { type: Number, default: Number.POSITIVE_INFINITY }, min: { type: Number, default: Number.NEGATIVE_INFINITY }, modelValue: Number, readonly: Boolean, disabled: Boolean, size: hu, controls: { type: Boolean, default: !0 }, controlsPosition: { type: String, default: "", values: ["", "right"] }, valueOnClear: { type: [String, Number, null], validator: (t) => t === null || Jt(t) || ["min", "max"].includes(t), default: null }, name: String, placeholder: String, precision: { type: Number, validator: (t) => t >= 0 && t === Number.parseInt(`${t}`, 10) }, validateEvent: { type: Boolean, default: !0 }, ...Gl(["ariaLabel"]) }), Ene = { [ks]: (t, e) => e !== t, blur: (t) => t instanceof FocusEvent, focus: (t) => t instanceof FocusEvent, [ul]: (t) => Jt(t) || Ka(t), [gr]: (t) => Jt(t) || Ka(t) }, Tne = Le({ name: "ElInputNumber" }), Cne = /* @__PURE__ */ Le({ ...Tne, props: Mne, emits: Ene, setup(t, { expose: e, emit: r }) { const i = t, { t: n } = Zg(), a = Pt("input-number"), o = we(), s = _r({ currentValue: i.modelValue, userInput: null }), { formItem: c } = fp(), l = ee(() => Jt(i.modelValue) && i.modelValue <= i.min), u = ee(() => Jt(i.modelValue) && i.modelValue >= i.max), d = ee(() => { const R = g(i.step); return Un(i.precision) ? Math.max(g(i.modelValue), R) : (R > i.precision && Br("InputNumber", "precision should not be less than the decimal places of step"), i.precision); }), h = ee(() => i.controls && i.controlsPosition === "right"), f = Yu(), p = Jg(), m = ee(() => { if (s.userInput !== null) return s.userInput; let R = s.currentValue; if (Ka(R)) return ""; if (Jt(R)) { if (Number.isNaN(R)) return ""; Un(i.precision) || (R = R.toFixed(i.precision)); } return R; }), y = (R, M) => { if (Un(M) && (M = d.value), M === 0) return Math.round(R); let O = String(R); const D = O.indexOf("."); if (D === -1 || !O.replace(".", "").split("")[D + M]) return R; const I = O.length; return O.charAt(I - 1) === "5" && (O = `${O.slice(0, Math.max(0, I - 1))}6`), Number.parseFloat(Number(O).toFixed(M)); }, g = (R) => { if (Ka(R)) return 0; const M = R.toString(), O = M.indexOf("."); let D = 0; return O !== -1 && (D = M.length - O - 1), D; }, v = (R, M = 1) => Jt(R) ? y(R + i.step * M) : s.currentValue, x = () => { if (i.readonly || p.value || u.value) return; const R = Number(m.value) || 0, M = v(R); _(M), r(ul, s.currentValue), k(); }, w = () => { if (i.readonly || p.value || l.value) return; const R = Number(m.value) || 0, M = v(R, -1); _(M), r(ul, s.currentValue), k(); }, S = (R, M) => { const { max: O, min: D, step: I, precision: F, stepStrictly: z, valueOnClear: U } = i; O < D && Xu("InputNumber", "min should not be greater than max."); let Z = Number(R); if (Ka(R) || Number.isNaN(Z)) return null; if (R === "") { if (U === null) return null; Z = Ni(U) ? { min: D, max: O }[U] : U; } return z && (Z = y(Math.round(Z / I) * I, F), Z !== R && M && r(gr, Z)), Un(F) || (Z = y(Z, F)), (Z > O || Z < D) && (Z = Z > O ? O : D, M && r(gr, Z)), Z; }, _ = (R, M = !0) => { var O; const D = s.currentValue, I = S(R); if (!M) { r(gr, I); return; } D === I && R || (s.userInput = null, r(gr, I), D !== I && r(ks, I, D), i.validateEvent && ((O = c == null ? void 0 : c.validate) == null || O.call(c, "change").catch((F) => Br(F))), s.currentValue = I); }, b = (R) => { s.userInput = R; const M = R === "" ? null : Number(R); r(ul, M), _(M, !1); }, T = (R) => { const M = R !== "" ? Number(R) : ""; (Jt(M) && !Number.isNaN(M) || R === "") && _(M), k(), s.userInput = null; }, E = () => { var R, M; (M = (R = o.value) == null ? void 0 : R.focus) == null || M.call(R); }, C = () => { var R, M; (M = (R = o.value) == null ? void 0 : R.blur) == null || M.call(R); }, L = (R) => { r("focus", R); }, A = (R) => { var M; s.userInput = null, r("blur", R), i.validateEvent && ((M = c == null ? void 0 : c.validate) == null || M.call(c, "blur").catch((O) => Br(O))); }, k = () => { s.currentValue !== i.modelValue && (s.currentValue = i.modelValue); }, P = (R) => { document.activeElement === R.target && R.preventDefault(); }; return ze(() => i.modelValue, (R, M) => { const O = S(R, !0); s.userInput === null && O !== M && (s.currentValue = O); }, { immediate: !0 }), Lt(() => { var R; const { min: M, max: O, modelValue: D } = i, I = (R = o.value) == null ? void 0 : R.input; if (I.setAttribute("role", "spinbutton"), Number.isFinite(O) ? I.setAttribute("aria-valuemax", String(O)) : I.removeAttribute("aria-valuemax"), Number.isFinite(M) ? I.setAttribute("aria-valuemin", String(M)) : I.removeAttribute("aria-valuemin"), I.setAttribute("aria-valuenow", s.currentValue || s.currentValue === 0 ? String(s.currentValue) : ""), I.setAttribute("aria-disabled", String(p.value)), !Jt(D) && D != null) { let F = Number(D); Number.isNaN(F) && (F = null), r(gr, F); } I.addEventListener("wheel", P, { passive: !1 }); }), jh(() => { var R, M; const O = (R = o.value) == null ? void 0 : R.input; O == null || O.setAttribute("aria-valuenow", `${(M = s.currentValue) != null ? M : ""}`); }), e({ focus: E, blur: C }), (R, M) => (Q(), be("div", { class: xe([ N(a).b(), N(a).m(N(f)), N(a).is("disabled", N(p)), N(a).is("without-controls", !R.controls), N(a).is("controls-right", N(h)) ]), onDragstart: Tt(() => { }, ["prevent"]) }, [ R.controls ? ht((Q(), be("span", { key: 0, role: "button", "aria-label": N(n)("el.inputNumber.decrease"), class: xe([N(a).e("decrease"), N(a).is("disabled", N(l))]), onKeydown: ti(w, ["enter"]) }, [ Fe(R.$slots, "decrease-icon", {}, () => [ oe(N(yr), null, { default: le(() => [ N(h) ? (Q(), Re(N(ox), { key: 0 })) : (Q(), Re(N(PQ), { key: 1 })) ]), _: 1 }) ]) ], 42, ["aria-label", "onKeydown"])), [ [N(TM), w] ]) : Pe("v-if", !0), R.controls ? ht((Q(), be("span", { key: 1, role: "button", "aria-label": N(n)("el.inputNumber.increase"), class: xe([N(a).e("increase"), N(a).is("disabled", N(u))]), onKeydown: ti(x, ["enter"]) }, [ Fe(R.$slots, "increase-icon", {}, () => [ oe(N(yr), null, { default: le(() => [ N(h) ? (Q(), Re(N(wQ), { key: 0 })) : (Q(), Re(N(qg), { key: 1 })) ]), _: 1 }) ]) ], 42, ["aria-label", "onKeydown"])), [ [N(TM), x] ]) : Pe("v-if", !0), oe(N(Dte), { id: R.id, ref_key: "input", ref: o, type: "number", step: R.step, "model-value": N(m), placeholder: R.placeholder, readonly: R.readonly, disabled: N(p), size: N(f), max: R.max, min: R.min, name: R.name, "aria-label": R.ariaLabel, "validate-event": !1, onKeydown: [ ti(Tt(x, ["prevent"]), ["up"]), ti(Tt(w, ["prevent"]), ["down"]) ], onBlur: A, onFocus: L, onInput: b, onChange: T }, MD({ _: 2 }, [ R.$slots.prefix ? { name: "prefix", fn: le(() => [ Fe(R.$slots, "prefix") ]) } : void 0, R.$slots.suffix ? { name: "suffix", fn: le(() => [ Fe(R.$slots, "suffix") ]) } : void 0 ]), 1032, ["id", "step", "model-value", "placeholder", "readonly", "disabled", "size", "max", "min", "name", "aria-label", "onKeydown"]) ], 42, ["onDragstart"])); } }); var Ane = /* @__PURE__ */ Nt(Cne, [["__file", "input-number.vue"]]); const xo = ai(Ane), qk = Symbol("ElSelectGroup"), tv = Symbol("ElSelect"); function Lne(t, e) { const r = Ye(tv), i = Ye(qk, { disabled: !1 }), n = ee(() => u(sa(r.props.modelValue), t.value)), a = ee(() => { var f; if (r.props.multiple) { const p = sa((f = r.props.modelValue) != null ? f : []); return !n.value && p.length >= r.props.multipleLimit && r.props.multipleLimit > 0; } else return !1; }), o = ee(() => t.label || (Ii(t.value) ? "" : t.value)), s = ee(() => t.value || t.label || ""), c = ee(() => t.disabled || e.groupDisabled || a.value), l = Ct(), u = (f = [], p) => { if (Ii(t.value)) { const m = r.props.valueKey; return f && f.some((y) => gl(Ha(y, m)) === Ha(p, m)); } else return f && f.includes(p); }, d = () => { !t.disabled && !i.disabled && (r.states.hoveringIndex = r.optionsArray.indexOf(l.proxy)); }, h = (f) => { const p = new RegExp(fQ(f), "i"); e.visible = p.test(o.value) || t.created; }; return ze(() => o.value, () => { !t.created && !r.props.remote && r.setSelected(); }), ze(() => t.value, (f, p) => { const { remote: m, valueKey: y } = r.props; if (f !== p && (r.onOptionDestroy(p, l.proxy), r.onOptionCreate(l.proxy)), !t.created && !m) { if (y && Ii(f) && Ii(p) && f[y] === p[y]) return; r.setSelected(); } }), ze(() => i.disabled, () => { e.groupDisabled = i.disabled; }, { immediate: !0 }), { select: r, currentLabel: o, currentValue: s, itemSelected: n, isDisabled: c, hoverItem: d, updateOption: h }; } const kne = Le({ name: "ElOption", componentName: "ElOption", props: { value: { required: !0, type: [String, Number, Boolean, Object] }, label: [String, Number], created: Boolean, disabled: Boolean }, setup(t) { const e = Pt("select"), r = Kg(), i = ee(() => [ e.be("dropdown", "item"), e.is("disabled", N(s)), e.is("selected", N(o)), e.is("hovering", N(h)) ]), n = _r({ index: -1, groupDisabled: !1, visible: !0, hover: !1 }), { currentLabel: a, itemSelected: o, isDisabled: s, select: c, hoverItem: l, updateOption: u } = Lne(t, n), { visible: d, hover: h } = Zi(n), f = Ct().proxy; c.onOptionCreate(f), Sr(() => { const m = f.value, { selected: y } = c.states, g = (c.props.multiple ? y : [y]).some((v) => v.value === f.value); st(() => { c.states.cachedOptions.get(m) === f && !g && c.states.cachedOptions.delete(m); }), c.onOptionDestroy(m, f); }); function p() { s.value || c.handleOptionSelect(f); } return { ns: e, id: r, containerKls: i, currentLabel: a, itemSelected: o, isDisabled: s, select: c, hoverItem: l, updateOption: u, visible: d, hover: h, selectOptionClick: p, states: n }; } }); function Pne(t, e, r, i, n, a) { return ht((Q(), be("li", { id: t.id, class: xe(t.containerKls), role: "option", "aria-disabled": t.isDisabled || void 0, "aria-selected": t.itemSelected, onMouseenter: t.hoverItem, onClick: Tt(t.selectOptionClick, ["stop"]) }, [ Fe(t.$slots, "default", {}, () => [ Ee("span", null, Ze(t.currentLabel), 1) ]) ], 42, ["id", "aria-disabled", "aria-selected", "onMouseenter", "onClick"])), [ [Ot, t.visible] ]); } var Cx = /* @__PURE__ */ Nt(kne, [["render", Pne], ["__file", "option.vue"]]); const Rne = Le({ name: "ElSelectDropdown", componentName: "ElSelectDropdown", setup() { const t = Ye(tv), e = Pt("select"), r = ee(() => t.props.popperClass), i = ee(() => t.props.multiple), n = ee(() => t.props.fitInputWidth), a = we(""); function o() { var s; a.value = `${(s = t.selectRef) == null ? void 0 : s.offsetWidth}px`; } return Lt(() => { o(), bn(t.selectRef, o); }), { ns: e, minWidth: a, popperClass: r, isMultiple: i, isFitInputWidth: n }; } }); function One(t, e, r, i, n, a) { return Q(), be("div", { class: xe([t.ns.b("dropdown"), t.ns.is("multiple", t.isMultiple), t.popperClass]), style: yt({ [t.isFitInputWidth ? "width" : "minWidth"]: t.minWidth }) }, [ t.$slots.header ? (Q(), be("div", { key: 0, class: xe(t.ns.be("dropdown", "header")) }, [ Fe(t.$slots, "header") ], 2)) : Pe("v-if", !0), Fe(t.$slots, "default"), t.$slots.footer ? (Q(), be("div", { key: 1, class: xe(t.ns.be("dropdown", "footer")) }, [ Fe(t.$slots, "footer") ], 2)) : Pe("v-if", !0) ], 6); } var Dne = /* @__PURE__ */ Nt(Rne, [["render", One], ["__file", "select-dropdown.vue"]]); const Ine = 11, Nne = (t, e) => { const { t: r } = Zg(), i = Kg(), n = Pt("select"), a = Pt("input"), o = _r({ inputValue: "", options: /* @__PURE__ */ new Map(), cachedOptions: /* @__PURE__ */ new Map(), disabledOptions: /* @__PURE__ */ new Map(), optionValues: [], selected: [], selectionWidth: 0, calculatorWidth: 0, collapseItemWidth: 0, selectedLabel: "", hoveringIndex: -1, previousQuery: null, inputHovering: !1, menuVisibleOnFocus: !1, isBeforeHide: !1 }), s = we(null), c = we(null), l = we(null), u = we(null), d = we(null), h = we(null), f = we(null), p = we(null), m = we(null), y = we(null), g = we(null), v = we(null), { isComposing: x, handleCompositionStart: w, handleCompositionUpdate: S, handleCompositionEnd: _ } = Mk({ afterComposition: (ae) => te(ae) }), { wrapperRef: b, isFocused: T } = Sk(d, { beforeFocus() { return M.value; }, afterFocus() { t.automaticDropdown && !E.value && (E.value = !0, o.menuVisibleOnFocus = !0); }, beforeBlur(ae) { var Se, Be; return ((Se = l.value) == null ? void 0 : Se.isFocusInsideContent(ae)) || ((Be = u.value) == null ? void 0 : Be.isFocusInsideContent(ae)); }, afterBlur() { E.value = !1, o.menuVisibleOnFocus = !1; } }), E = we(!1), C = we(), { form: L, formItem: A } = fp(), { inputId: k } = xx(t, { formItemContext: A }), { valueOnClear: P, isEmptyValue: R } = vte(t), M = ee(() => t.disabled || (L == null ? void 0 : L.disabled)), O = ee(() => ji(t.modelValue) ? t.modelValue.length > 0 : !R(t.modelValue)), D = ee(() => t.clearable && !M.value && o.inputHovering && O.value), I = ee(() => t.remote && t.filterable && !t.remoteShowSuffix ? "" : t.suffixIcon), F = ee(() => n.is("reverse", I.value && E.value)), z = ee(() => (A == null ? void 0 : A.validateState) || ""), U = ee(() => tk[z.value]), Z = ee(() => t.remote ? 300 : 0), re = ee(() => t.loading ? t.loadingText || r("el.select.loading") : t.remote && !o.inputValue && o.options.size === 0 ? !1 : t.filterable && o.inputValue && o.options.size > 0 && K.value === 0 ? t.noMatchText || r("el.select.noMatch") : o.options.size === 0 ? t.noDataText || r("el.select.noData") : null), K = ee(() => V.value.filter((ae) => ae.visible).length), V = ee(() => { const ae = Array.from(o.options.values()), Se = []; return o.optionValues.forEach((Be) => { const Ge = ae.findIndex((tt) => tt.value === Be); Ge > -1 && Se.push(ae[Ge]); }), Se.length >= ae.length ? Se : ae; }), H = ee(() => Array.from(o.cachedOptions.values())), G = ee(() => { const ae = V.value.filter((Se) => !Se.created).some((Se) => Se.currentLabel === o.inputValue); return t.filterable && t.allowCreate && o.inputValue !== "" && !ae; }), W = () => { t.filterable && Mi(t.filterMethod) || t.filterable && t.remote && Mi(t.remoteMethod) || V.value.forEach((ae) => { var Se; (Se = ae.updateOption) == null || Se.call(ae, o.inputValue); }); }, Y = Yu(), X = ee(() => ["small"].includes(Y.value) ? "small" : "default"), ie = ee({ get() { return E.value && re.value !== !1; }, set(ae) { E.value = ae; } }), ue = ee(() => { if (t.multiple && !Un(t.modelValue)) return sa(t.modelValue).length === 0 && !o.inputValue; const ae = ji(t.modelValue) ? t.modelValue[0] : t.modelValue; return t.filterable || Un(ae) ? !o.inputValue : !0; }), $ = ee(() => { var ae; const Se = (ae = t.placeholder) != null ? ae : r("el.select.placeholder"); return t.multiple || !O.value ? Se : o.selectedLabel; }), J = ee(() => zy ? null : "mouseenter"); ze(() => t.modelValue, (ae, Se) => { t.multiple && t.filterable && !t.reserveKeyword && (o.inputValue = "", ne("")), q(), !Wy(ae, Se) && t.validateEvent && (A == null || A.validate("change").catch((Be) => Br(Be))); }, { flush: "post", deep: !0 }), ze(() => E.value, (ae) => { ae ? ne(o.inputValue) : (o.inputValue = "", o.previousQuery = null, o.isBeforeHide = !0), e("visible-change", ae); }), ze(() => o.options.entries(), () => { var ae; if (!Ur) return; const Se = ((ae = s.value) == null ? void 0 : ae.querySelectorAll("input")) || []; (!t.filterable && !t.defaultFirstOption && !Un(t.modelValue) || !Array.from(Se).includes(document.activeElement)) && q(), t.defaultFirstOption && (t.filterable || t.remote) && K.value && j(); }, { flush: "post" }), ze(() => o.hoveringIndex, (ae) => { Jt(ae) && ae > -1 ? C.value = V.value[ae] || {} : C.value = {}, V.value.forEach((Se) => { Se.hover = C.value === Se; }); }), lg(() => { o.isBeforeHide || W(); }); const ne = (ae) => { o.previousQuery === ae || x.value || (o.previousQuery = ae, t.filterable && Mi(t.filterMethod) ? t.filterMethod(ae) : t.filterable && t.remote && Mi(t.remoteMethod) && t.remoteMethod(ae), t.defaultFirstOption && (t.filterable || t.remote) && K.value ? st(j) : st(ye)); }, j = () => { const ae = V.value.filter((Ge) => Ge.visible && !Ge.disabled && !Ge.states.groupDisabled), Se = ae.find((Ge) => Ge.created), Be = ae[0]; o.hoveringIndex = qe(V.value, Se || Be); }, q = () => { if (t.multiple) o.selectedLabel = ""; else { const Se = ji(t.modelValue) ? t.modelValue[0] : t.modelValue, Be = ge(Se); o.selectedLabel = Be.currentLabel, o.selected = [Be]; return; } const ae = []; Un(t.modelValue) || sa(t.modelValue).forEach((Se) => { ae.push(ge(Se)); }), o.selected = ae; }, ge = (ae) => { let Se; const Be = Qv(ae).toLowerCase() === "object", Ge = Qv(ae).toLowerCase() === "null", tt = Qv(ae).toLowerCase() === "undefined"; for (let ut = o.cachedOptions.size - 1; ut >= 0; ut--) { const St = H.value[ut]; if (Be ? Ha(St.value, t.valueKey) === Ha(ae, t.valueKey) : St.value === ae) { Se = { value: ae, currentLabel: St.currentLabel, get isDisabled() { return St.isDisabled; } }; break; } } if (Se) return Se; const gt = Be ? ae.label : !Ge && !tt ? ae : ""; return { value: ae, currentLabel: gt }; }, ye = () => { o.hoveringIndex = V.value.findIndex((ae) => o.selected.some((Se) => xt(Se) === xt(ae))); }, _e = () => { o.selectionWidth = c.value.getBoundingClientRect().width; }, Me = () => { o.calculatorWidth = h.value.getBoundingClientRect().width; }, Ce = () => { o.collapseItemWidth = g.value.getBoundingClientRect().width; }, B = () => { var ae, Se; (Se = (ae = l.value) == null ? void 0 : ae.updatePopper) == null || Se.call(ae); }, ce = () => { var ae, Se; (Se = (ae = u.value) == null ? void 0 : ae.updatePopper) == null || Se.call(ae); }, ve = () => { o.inputValue.length > 0 && !E.value && (E.value = !0), ne(o.inputValue); }, te = (ae) => { if (o.inputValue = ae.target.value, t.remote) pe(); else return ve(); }, pe = Gy(() => { ve(); }, Z.value), fe = (ae) => { Wy(t.modelValue, ae) || e(ks, ae); }, he = (ae) => sQ(ae, (Se) => !o.disabledOptions.has(Se)), Te = (ae) => { if (t.multiple && ae.code !== pa.delete && ae.target.value.length <= 0) { const Se = sa(t.modelValue).slice(), Be = he(Se); if (Be < 0) return; const Ge = Se[Be]; Se.splice(Be, 1), e(gr, Se), fe(Se), e("remove-tag", Ge); } }, He = (ae, Se) => { const Be = o.selected.indexOf(Se); if (Be > -1 && !M.value) { const Ge = sa(t.modelValue).slice(); Ge.splice(Be, 1), e(gr, Ge), fe(Ge), e("remove-tag", Se.value); } ae.stopPropagation(), _t(); }, We = (ae) => { ae.stopPropagation(); const Se = t.multiple ? [] : P.value; if (t.multiple) for (const Be of o.selected) Be.isDisabled && Se.push(Be.value); e(gr, Se), fe(Se), o.hoveringIndex = -1, E.value = !1, e("clear"), _t(); }, Ie = (ae) => { var Se; if (t.multiple) { const Be = sa((Se = t.modelValue) != null ? Se : []).slice(), Ge = qe(Be, ae.value); Ge > -1 ? Be.splice(Ge, 1) : (t.multipleLimit <= 0 || Be.length < t.multipleLimit) && Be.push(ae.value), e(gr, Be), fe(Be), ae.created && ne(""), t.filterable && !t.reserveKeyword && (o.inputValue = ""); } else e(gr, ae.value), fe(ae.value), E.value = !1; _t(), !E.value && st(() => { De(ae); }); }, qe = (ae = [], Se) => { if (!Ii(Se)) return ae.indexOf(Se); const Be = t.valueKey; let Ge = -1; return ae.some((tt, gt) => gl(Ha(tt, Be)) === Ha(Se, Be) ? (Ge = gt, !0) : !1), Ge; }, De = (ae) => { var Se, Be, Ge, tt, gt; const ut = ji(ae) ? ae[0] : ae; let St = null; if (ut != null && ut.value) { const er = V.value.filter((vr) => vr.value === ut.value); er.length > 0 && (St = er[0].$el); } if (l.value && St) { const er = (tt = (Ge = (Be = (Se = l.value) == null ? void 0 : Se.popperRef) == null ? void 0 : Be.contentRef) == null ? void 0 : Ge.querySelector) == null ? void 0 : tt.call(Ge, `.${n.be("dropdown", "wrap")}`); er && gQ(er, St); } (gt = v.value) == null || gt.handleScroll(); }, $e = (ae) => { o.options.set(ae.value, ae), o.cachedOptions.set(ae.value, ae), ae.disabled && o.disabledOptions.set(ae.value, ae); }, nt = (ae, Se) => { o.options.get(ae) === Se && o.options.delete(ae); }, lt = ee(() => { var ae, Se; return (Se = (ae = l.value) == null ? void 0 : ae.popperRef) == null ? void 0 : Se.contentRef; }), mt = () => { o.isBeforeHide = !1, st(() => De(o.selected)); }, _t = () => { var ae; (ae = d.value) == null || ae.focus(); }, wt = () => { var ae; (ae = d.value) == null || ae.blur(); }, me = (ae) => { We(ae); }, Ne = () => { E.value = !1, T.value && wt(); }, Ue = () => { o.inputValue.length > 0 ? o.inputValue = "" : E.value = !1; }, Ke = () => { M.value || (zy && (o.inputHovering = !0), o.menuVisibleOnFocus ? o.menuVisibleOnFocus = !1 : E.value = !E.value); }, ct = () => { E.value ? V.value[o.hoveringIndex] && Ie(V.value[o.hoveringIndex]) : Ke(); }, xt = (ae) => Ii(ae.value) ? Ha(ae.value, t.valueKey) : ae.value, At = ee(() => V.value.filter((ae) => ae.visible).every((ae) => ae.disabled)), Ft = ee(() => t.multiple ? t.collapseTags ? o.selected.slice(0, t.maxCollapseTags) : o.selected : []), zt = ee(() => t.multiple ? t.collapseTags ? o.selected.slice(t.maxCollapseTags) : [] : []), se = (ae) => { if (!E.value) { E.value = !0; return; } if (!(o.options.size === 0 || o.filteredOptionsCount === 0 || x.value) && !At.value) { ae === "next" ? (o.hoveringIndex++, o.hoveringIndex === o.options.size && (o.hoveringIndex = 0)) : ae === "prev" && (o.hoveringIndex--, o.hoveringIndex < 0 && (o.hoveringIndex = o.options.size - 1)); const Se = V.value[o.hoveringIndex]; (Se.disabled === !0 || Se.states.groupDisabled === !0 || !Se.visible) && se(ae), st(() => De(C.value)); } }, ke = () => { if (!c.value) return 0; const ae = window.getComputedStyle(c.value); return Number.parseFloat(ae.gap || "6px"); }, Ae = ee(() => { const ae = ke(); return { maxWidth: `${g.value && t.maxCollapseTags === 1 ? o.selectionWidth - o.collapseItemWidth - ae : o.selectionWidth}px` }; }), Oe = ee(() => ({ maxWidth: `${o.selectionWidth}px` })), Ve = ee(() => ({ width: `${Math.max(o.calculatorWidth, Ine)}px` })); return bn(c, _e), bn(h, Me), bn(m, B), bn(b, B), bn(y, ce), bn(g, Ce), Lt(() => { q(); }), { inputId: k, contentId: i, nsSelect: n, nsInput: a, states: o, isFocused: T, expanded: E, optionsArray: V, hoverOption: C, selectSize: Y, filteredOptionsCount: K, resetCalculatorWidth: Me, updateTooltip: B, updateTagTooltip: ce, debouncedOnInputChange: pe, onInput: te, deletePrevTag: Te, deleteTag: He, deleteSelected: We, handleOptionSelect: Ie, scrollToOption: De, hasModelValue: O, shouldShowPlaceholder: ue, currentPlaceholder: $, mouseEnterEventName: J, showClose: D, iconComponent: I, iconReverse: F, validateState: z, validateIcon: U, showNewOption: G, updateOptions: W, collapseTagSize: X, setSelected: q, selectDisabled: M, emptyText: re, handleCompositionStart: w, handleCompositionUpdate: S, handleCompositionEnd: _, onOptionCreate: $e, onOptionDestroy: nt, handleMenuEnter: mt, focus: _t, blur: wt, handleClearClick: me, handleClickOutside: Ne, handleEsc: Ue, toggleMenu: Ke, selectOption: ct, getValueKey: xt, navigateOptions: se, dropdownMenuVisible: ie, showTagList: Ft, collapseTagList: zt, tagStyle: Ae, collapseTagStyle: Oe, inputStyle: Ve, popperRef: lt, inputRef: d, tooltipRef: l, tagTooltipRef: u, calculatorRef: h, prefixRef: f, suffixRef: p, selectRef: s, wrapperRef: b, selectionRef: c, scrollbarRef: v, menuRef: m, tagMenuRef: y, collapseItemRef: g }; }; var Bne = Le({ name: "ElOptions", setup(t, { slots: e }) { const r = Ye(tv); let i = []; return () => { var n, a; const o = (n = e.default) == null ? void 0 : n.call(e), s = []; function c(l) { ji(l) && l.forEach((u) => { var d, h, f, p; const m = (d = (u == null ? void 0 : u.type) || {}) == null ? void 0 : d.name; m === "ElOptionGroup" ? c(!Ni(u.children) && !ji(u.children) && Mi((h = u.children) == null ? void 0 : h.default) ? (f = u.children) == null ? void 0 : f.default() : u.children) : m === "ElOption" ? s.push((p = u.props) == null ? void 0 : p.value) : ji(u.children) && c(u.children); }); } return o.length && c((a = o[0]) == null ? void 0 : a.children), Wy(s, i) || (i = s, r && (r.states.optionValues = s)), o; }; } }); const Fne = $t({ name: String, id: String, modelValue: { type: [Array, String, Number, Boolean, Object], default: void 0 }, autocomplete: { type: String, default: "off" }, automaticDropdown: Boolean, size: hu, effect: { type: ot(String), default: "light" }, disabled: Boolean, clearable: Boolean, filterable: Boolean, allowCreate: Boolean, loading: Boolean, popperClass: { type: String, default: "" }, popperOptions: { type: ot(Object), default: () => ({}) }, remote: Boolean, loadingText: String, noMatchText: String, noDataText: String, remoteMethod: Function, filterMethod: Function, multiple: Boolean, multipleLimit: { type: Number, default: 0 }, placeholder: { type: String }, defaultFirstOption: Boolean, reserveKeyword: { type: Boolean, default: !0 }, valueKey: { type: String, default: "value" }, collapseTags: Boolean, collapseTagsTooltip: Boolean, maxCollapseTags: { type: Number, default: 1 }, teleported: nn.teleported, persistent: { type: Boolean, default: !0 }, clearIcon: { type: bs, default: sx }, fitInputWidth: Boolean, suffixIcon: { type: bs, default: ox }, tagType: { ...Qy.type, default: "info" }, tagEffect: { ...Qy.effect, default: "light" }, validateEvent: { type: Boolean, default: !0 }, remoteShowSuffix: Boolean, placement: { type: ot(String), values: Zu, default: "bottom-start" }, fallbackPlacements: { type: ot(Array), default: ["bottom-start", "top-start", "right", "left"] }, appendTo: String, ...gte, ...Gl(["ariaLabel"]) }), AM = "ElSelect", zne = Le({ name: AM, componentName: AM, components: { ElSelectMenu: Dne, ElOption: Cx, ElOptions: Bne, ElTag: Pie, ElScrollbar: Xte, ElTooltip: Tx, ElIcon: yr }, directives: { ClickOutside: Mie }, props: Fne, emits: [ gr, ks, "remove-tag", "clear", "visible-change", "focus", "blur" ], setup(t, { emit: e }) { const r = ee(() => { const { modelValue: a, multiple: o } = t, s = o ? [] : void 0; return ji(a) ? o ? a : s : o ? s : a; }), i = _r({ ...Zi(t), modelValue: r }), n = Nne(i, e); return Dt(tv, _r({ props: i, states: n.states, optionsArray: n.optionsArray, handleOptionSelect: n.handleOptionSelect, onOptionCreate: n.onOptionCreate, onOptionDestroy: n.onOptionDestroy, selectRef: n.selectRef, setSelected: n.setSelected })), { ...n, modelValue: r }; } }); function $ne(t, e, r, i, n, a) { const o = qt("el-tag"), s = qt("el-tooltip"), c = qt("el-icon"), l = qt("el-option"), u = qt("el-options"), d = qt("el-scrollbar"), h = qt("el-select-menu"), f = BT("click-outside"); return ht((Q(), be("div", { ref: "selectRef", class: xe([t.nsSelect.b(), t.nsSelect.m(t.selectSize)]), [FT(t.mouseEnterEventName)]: (p) => t.states.inputHovering = !0, onMouseleave: (p) => t.states.inputHovering = !1 }, [ oe(s, { ref: "tooltipRef", visible: t.dropdownMenuVisible, placement: t.placement, teleported: t.teleported, "popper-class": [t.nsSelect.e("popper"), t.popperClass], "popper-options": t.popperOptions, "fallback-placements": t.fallbackPlacements, effect: t.effect, pure: "", trigger: "click", transition: `${t.nsSelect.namespace.value}-zoom-in-top`, "stop-popper-mouse-event": !1, "gpu-acceleration": !1, persistent: t.persistent, "append-to": t.appendTo, onBeforeShow: t.handleMenuEnter, onHide: (p) => t.states.isBeforeHide = !1 }, { default: le(() => { var p; return [ Ee("div", { ref: "wrapperRef", class: xe([ t.nsSelect.e("wrapper"), t.nsSelect.is("focused", t.isFocused), t.nsSelect.is("hovering", t.states.inputHovering), t.nsSelect.is("filterable", t.filterable), t.nsSelect.is("disabled", t.selectDisabled) ]), onClick: Tt(t.toggleMenu, ["prevent"]) }, [ t.$slots.prefix ? (Q(), be("div", { key: 0, ref: "prefixRef", class: xe(t.nsSelect.e("prefix")) }, [ Fe(t.$slots, "prefix") ], 2)) : Pe("v-if", !0), Ee("div", { ref: "selectionRef", class: xe([ t.nsSelect.e("selection"), t.nsSelect.is("near", t.multiple && !t.$slots.prefix && !!t.states.selected.length) ]) }, [ t.multiple ? Fe(t.$slots, "tag", { key: 0 }, () => [ (Q(!0), be(pt, null, ir(t.showTagList, (m) => (Q(), be("div", { key: t.getValueKey(m), class: xe(t.nsSelect.e("selected-item")) }, [ oe(o, { closable: !t.selectDisabled && !m.isDisabled, size: t.collapseTagSize, type: t.tagType, effect: t.tagEffect, "disable-transitions": "", style: yt(t.tagStyle), onClose: (y) => t.deleteTag(y, m) }, { default: le(() => [ Ee("span", { class: xe(t.nsSelect.e("tags-text")) }, [ Fe(t.$slots, "label", { label: m.currentLabel, value: m.value }, () => [ et(Ze(m.currentLabel), 1) ]) ], 2) ]), _: 2 }, 1032, ["closable", "size", "type", "effect", "style", "onClose"]) ], 2))), 128)), t.collapseTags && t.states.selected.length > t.maxCollapseTags ? (Q(), Re(s, { key: 0, ref: "tagTooltipRef", disabled: t.dropdownMenuVisible || !t.collapseTagsTooltip, "fallback-placements": ["bottom", "top", "right", "left"], effect: t.effect, placement: "bottom", teleported: t.teleported }, { default: le(() => [ Ee("div", { ref: "collapseItemRef", class: xe(t.nsSelect.e("selected-item")) }, [ oe(o, { closable: !1, size: t.collapseTagSize, type: t.tagType, effect: t.tagEffect, "disable-transitions": "", style: yt(t.collapseTagStyle) }, { default: le(() => [ Ee("span", { class: xe(t.nsSelect.e("tags-text")) }, " + " + Ze(t.states.selected.length - t.maxCollapseTags), 3) ]), _: 1 }, 8, ["size", "type", "effect", "style"]) ], 2) ]), content: le(() => [ Ee("div", { ref: "tagMenuRef", class: xe(t.nsSelect.e("selection")) }, [ (Q(!0), be(pt, null, ir(t.collapseTagList, (m) => (Q(), be("div", { key: t.getValueKey(m), class: xe(t.nsSelect.e("selected-item")) }, [ oe(o, { class: "in-tooltip", closable: !t.selectDisabled && !m.isDisabled, size: t.collapseTagSize, type: t.tagType, effect: t.tagEffect, "disable-transitions": "", onClose: (y) => t.deleteTag(y, m) }, { default: le(() => [ Ee("span", { class: xe(t.nsSelect.e("tags-text")) }, [ Fe(t.$slots, "label", { label: m.currentLabel, value: m.value }, () => [ et(Ze(m.currentLabel), 1) ]) ], 2) ]), _: 2 }, 1032, ["closable", "size", "type", "effect", "onClose"]) ], 2))), 128)) ], 2) ]), _: 3 }, 8, ["disabled", "effect", "teleported"])) : Pe("v-if", !0) ]) : Pe("v-if", !0), t.selectDisabled ? Pe("v-if", !0) : (Q(), be("div", { key: 1, class: xe([ t.nsSelect.e("selected-item"), t.nsSelect.e("input-wrapper"), t.nsSelect.is("hidden", !t.filterable) ]) }, [ ht(Ee("input", { id: t.inputId, ref: "inputRef", "onUpdate:modelValue": (m) => t.states.inputValue = m, type: "text", name: t.name, class: xe([t.nsSelect.e("input"), t.nsSelect.is(t.selectSize)]), disabled: t.selectDisabled, autocomplete: t.autocomplete, style: yt(t.inputStyle), role: "combobox", readonly: !t.filterable, spellcheck: "false", "aria-activedescendant": ((p = t.hoverOption) == null ? void 0 : p.id) || "", "aria-controls": t.contentId, "aria-expanded": t.dropdownMenuVisible, "aria-label": t.ariaLabel, "aria-autocomplete": "none", "aria-haspopup": "listbox", onKeydown: [ ti(Tt((m) => t.navigateOptions("next"), ["stop", "prevent"]), ["down"]), ti(Tt((m) => t.navigateOptions("prev"), ["stop", "prevent"]), ["up"]), ti(Tt(t.handleEsc, ["stop", "prevent"]), ["esc"]), ti(Tt(t.selectOption, ["stop", "prevent"]), ["enter"]), ti(Tt(t.deletePrevTag, ["stop"]), ["delete"]) ], onCompositionstart: t.handleCompositionStart, onCompositionupdate: t.handleCompositionUpdate, onCompositionend: t.handleCompositionEnd, onInput: t.onInput, onClick: Tt(t.toggleMenu, ["stop"]) }, null, 46, ["id", "onUpdate:modelValue", "name", "disabled", "autocomplete", "readonly", "aria-activedescendant", "aria-controls", "aria-expanded", "aria-label", "onKeydown", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onInput", "onClick"]), [ [zT, t.states.inputValue] ]), t.filterable ? (Q(), be("span", { key: 0, ref: "calculatorRef", "aria-hidden": "true", class: xe(t.nsSelect.e("input-calculator")), textContent: Ze(t.states.inputValue) }, null, 10, ["textContent"])) : Pe("v-if", !0) ], 2)), t.shouldShowPlaceholder ? (Q(), be("div", { key: 2, class: xe([ t.nsSelect.e("selected-item"), t.nsSelect.e("placeholder"), t.nsSelect.is("transparent", !t.hasModelValue || t.expanded && !t.states.inputValue) ]) }, [ t.hasModelValue ? Fe(t.$slots, "label", { key: 0, label: t.currentPlaceholder, value: t.modelValue }, () => [ Ee("span", null, Ze(t.currentPlaceholder), 1) ]) : (Q(), be("span", { key: 1 }, Ze(t.currentPlaceholder), 1)) ], 2)) : Pe("v-if", !0) ], 2), Ee("div", { ref: "suffixRef", class: xe(t.nsSelect.e("suffix")) }, [ t.iconComponent && !t.showClose ? (Q(), Re(c, { key: 0, class: xe([t.nsSelect.e("caret"), t.nsSelect.e("icon"), t.iconReverse]) }, { default: le(() => [ (Q(), Re(Yt(t.iconComponent))) ]), _: 1 }, 8, ["class"])) : Pe("v-if", !0), t.showClose && t.clearIcon ? (Q(), Re(c, { key: 1, class: xe([ t.nsSelect.e("caret"), t.nsSelect.e("icon"), t.nsSelect.e("clear") ]), onClick: t.handleClearClick }, { default: le(() => [ (Q(), Re(Yt(t.clearIcon))) ]), _: 1 }, 8, ["class", "onClick"])) : Pe("v-if", !0), t.validateState && t.validateIcon ? (Q(), Re(c, { key: 2, class: xe([t.nsInput.e("icon"), t.nsInput.e("validateIcon")]) }, { default: le(() => [ (Q(), Re(Yt(t.validateIcon))) ]), _: 1 }, 8, ["class"])) : Pe("v-if", !0) ], 2) ], 10, ["onClick"]) ]; }), content: le(() => [ oe(h, { ref: "menuRef" }, { default: le(() => [ t.$slots.header ? (Q(), be("div", { key: 0, class: xe(t.nsSelect.be("dropdown", "header")), onClick: Tt(() => { }, ["stop"]) }, [ Fe(t.$slots, "header") ], 10, ["onClick"])) : Pe("v-if", !0), ht(oe(d, { id: t.contentId, ref: "scrollbarRef", tag: "ul", "wrap-class": t.nsSelect.be("dropdown", "wrap"), "view-class": t.nsSelect.be("dropdown", "list"), class: xe([t.nsSelect.is("empty", t.filteredOptionsCount === 0)]), role: "listbox", "aria-label": t.ariaLabel, "aria-orientation": "vertical" }, { default: le(() => [ t.showNewOption ? (Q(), Re(l, { key: 0, value: t.states.inputValue, created: !0 }, null, 8, ["value"])) : Pe("v-if", !0), oe(u, null, { default: le(() => [ Fe(t.$slots, "default") ]), _: 3 }) ]), _: 3 }, 8, ["id", "wrap-class", "view-class", "class", "aria-label"]), [ [Ot, t.states.options.size > 0 && !t.loading] ]), t.$slots.loading && t.loading ? (Q(), be("div", { key: 1, class: xe(t.nsSelect.be("dropdown", "loading")) }, [ Fe(t.$slots, "loading") ], 2)) : t.loading || t.filteredOptionsCount === 0 ? (Q(), be("div", { key: 2, class: xe(t.nsSelect.be("dropdown", "empty")) }, [ Fe(t.$slots, "empty", {}, () => [ Ee("span", null, Ze(t.emptyText), 1) ]) ], 2)) : Pe("v-if", !0), t.$slots.footer ? (Q(), be("div", { key: 3, class: xe(t.nsSelect.be("dropdown", "footer")), onClick: Tt(() => { }, ["stop"]) }, [ Fe(t.$slots, "footer") ], 10, ["onClick"])) : Pe("v-if", !0) ]), _: 3 }, 512) ]), _: 3 }, 8, ["visible", "placement", "teleported", "popper-class", "popper-options", "fallback-placements", "effect", "transition", "persistent", "append-to", "onBeforeShow", "onHide"]) ], 16, ["onMouseleave"])), [ [f, t.handleClickOutside, t.popperRef] ]); } var Vne = /* @__PURE__ */ Nt(zne, [["render", $ne], ["__file", "select.vue"]]); const Une = Le({ name: "ElOptionGroup", componentName: "ElOptionGroup", props: { label: String, disabled: Boolean }, setup(t) { const e = Pt("select"), r = we(null), i = Ct(), n = we([]); Dt(qk, _r({ ...Zi(t) })); const a = ee(() => n.value.some((l) => l.visible === !0)), o = (l) => { var u, d; return ((u = l.type) == null ? void 0 : u.name) === "ElOption" && !!((d = l.component) != null && d.proxy); }, s = (l) => { const u = sa(l), d = []; return u.forEach((h) => { var f, p; o(h) ? d.push(h.component.proxy) : (f = h.children) != null && f.length ? d.push(...s(h.children)) : (p = h.component) != null && p.subTree && d.push(...s(h.component.subTree)); }), d; }, c = () => { n.value = s(i.subTree); }; return Lt(() => { c(); }), oZ(r, c, { attributes: !0, subtree: !0, childList: !0 }), { groupRef: r, visible: a, ns: e }; } }); function jne(t, e, r, i, n, a) { return ht((Q(), be("ul", { ref: "groupRef", class: xe(t.ns.be("group", "wrap")) }, [ Ee("li", { class: xe(t.ns.be("group", "title")) }, Ze(t.label), 3), Ee("li", null, [ Ee("ul", { class: xe(t.ns.b("group")) }, [ Fe(t.$slots, "default") ], 2) ]) ], 2)), [ [Ot, t.visible] ]); } var Xk = /* @__PURE__ */ Nt(Une, [["render", jne], ["__file", "option-group.vue"]]); const Ju = ai(Vne, { Option: Cx, OptionGroup: Xk }), Qu = yo(Cx); yo(Xk); const Hne = $t({ trigger: Lh.trigger, placement: u0.placement, disabled: Lh.disabled, visible: nn.visible, transition: nn.transition, popperOptions: u0.popperOptions, tabindex: u0.tabindex, content: nn.content, popperStyle: nn.popperStyle, popperClass: nn.popperClass, enterable: { ...nn.enterable, default: !0 }, effect: { ...nn.effect, default: "light" }, teleported: nn.teleported, title: String, width: { type: [String, Number], default: 150 }, offset: { type: Number, default: void 0 }, showAfter: { type: Number, default: 0 }, hideAfter: { type: Number, default: 200 }, autoClose: { type: Number, default: 0 }, showArrow: { type: Boolean, default: !0 }, persistent: { type: Boolean, default: !0 }, "onUpdate:visible": { type: Function } }), Gne = { "update:visible": (t) => ax(t), "before-enter": () => !0, "before-leave": () => !0, "after-enter": () => !0, "after-leave": () => !0 }, Wne = "onUpdate:visible", qne = Le({ name: "ElPopover" }), Xne = /* @__PURE__ */ Le({ ...qne, props: Hne, emits: Gne, setup(t, { expose: e, emit: r }) { const i = t, n = ee(() => i[Wne]), a = Pt("popover"), o = we(), s = ee(() => { var y; return (y = N(o)) == null ? void 0 : y.popperRef; }), c = ee(() => [ { width: Xm(i.width) }, i.popperStyle ]), l = ee(() => [a.b(), i.popperClass, { [a.m("plain")]: !!i.content }]), u = ee(() => i.transition === `${a.namespace.value}-fade-in-linear`), d = () => { var y; (y = o.value) == null || y.hide(); }, h = () => { r("before-enter"); }, f = () => { r("before-leave"); }, p = () => { r("after-enter"); }, m = () => { r("update:visible", !1), r("after-leave"); }; return e({ popperRef: s, hide: d }), (y, g) => (Q(), Re(N(Tx), Nr({ ref_key: "tooltipRef", ref: o }, y.$attrs, { trigger: y.trigger, placement: y.placement, disabled: y.disabled, visible: y.visible, transition: y.transition, "popper-options": y.popperOptions, tabindex: y.tabindex, content: y.content, offset: y.offset, "show-after": y.showAfter, "hide-after": y.hideAfter, "auto-close": y.autoClose, "show-arrow": y.showArrow, "aria-label": y.title, effect: y.effect, enterable: y.enterable, "popper-class": N(l), "popper-style": N(c), teleported: y.teleported, persistent: y.persistent, "gpu-acceleration": N(u), "onUpdate:visible": N(n), onBeforeShow: h, onBeforeHide: f, onShow: p, onHide: m }), { content: le(() => [ y.title ? (Q(), be("div", { key: 0, class: xe(N(a).e("title")), role: "title" }, Ze(y.title), 3)) : Pe("v-if", !0), Fe(y.$slots, "default", {}, () => [ et(Ze(y.content), 1) ]) ]), default: le(() => [ y.$slots.reference ? Fe(y.$slots, "reference", { key: 0 }) : Pe("v-if", !0) ]), _: 3 }, 16, ["trigger", "placement", "disabled", "visible", "transition", "popper-options", "tabindex", "content", "offset", "show-after", "hide-after", "auto-close", "show-arrow", "aria-label", "effect", "enterable", "popper-class", "popper-style", "teleported", "persistent", "gpu-acceleration", "onUpdate:visible"])); } }); var Zne = /* @__PURE__ */ Nt(Xne, [["__file", "popover.vue"]]); const LM = (t, e) => { const r = e.arg || e.value, i = r == null ? void 0 : r.popperRef; i && (i.triggerRef = t); }; var Yne = { mounted(t, e) { LM(t, e); }, updated(t, e) { LM(t, e); } }; const Kne = "popover", Jne = BQ(Yne, Kne), rv = ai(Zne, { directive: Jne }), Zk = Symbol("sliderContextKey"), Qne = $t({ modelValue: { type: ot([Number, Array]), default: 0 }, id: { type: String, default: void 0 }, min: { type: Number, default: 0 }, max: { type: Number, default: 100 }, step: { type: Number, default: 1 }, showInput: Boolean, showInputControls: { type: Boolean, default: !0 }, size: hu, inputSize: hu, showStops: Boolean, showTooltip: { type: Boolean, default: !0 }, formatTooltip: { type: ot(Function), default: void 0 }, disabled: Boolean, range: Boolean, vertical: Boolean, height: String, debounce: { type: Number, default: 300 }, rangeStartLabel: { type: String, default: void 0 }, rangeEndLabel: { type: String, default: void 0 }, formatValueText: { type: ot(Function), default: void 0 }, tooltipClass: { type: String, default: void 0 }, placement: { type: String, values: Zu, default: "top" }, marks: { type: ot(Object) }, validateEvent: { type: Boolean, default: !0 }, ...Gl(["ariaLabel"]) }), d0 = (t) => Jt(t) || ji(t) && t.every(Jt), eae = { [gr]: d0, [ul]: d0, [ks]: d0 }, tae = (t, e, r) => { const i = we(); return Lt(async () => { t.range ? (Array.isArray(t.modelValue) ? (e.firstValue = Math.max(t.min, t.modelValue[0]), e.secondValue = Math.min(t.max, t.modelValue[1])) : (e.firstValue = t.min, e.secondValue = t.max), e.oldValue = [e.firstValue, e.secondValue]) : (typeof t.modelValue != "number" || Number.isNaN(t.modelValue) ? e.firstValue = t.min : e.firstValue = Math.min(t.max, Math.max(t.min, t.modelValue)), e.oldValue = e.firstValue), ri(window, "resize", r), await st(), r(); }), { sliderWrapper: i }; }, rae = (t) => ee(() => t.marks ? Object.keys(t.marks).map(Number.parseFloat).sort((e, r) => e - r).filter((e) => e <= t.max && e >= t.min).map((e) => ({ point: e, position: (e - t.min) * 100 / (t.max - t.min), mark: t.marks[e] })) : []), iae = (t, e, r) => { const { form: i, formItem: n } = fp(), a = mr(), o = we(), s = we(), c = { firstButton: o, secondButton: s }, l = ee(() => t.disabled || (i == null ? void 0 : i.disabled) || !1), u = ee(() => Math.min(e.firstValue, e.secondValue)), d = ee(() => Math.max(e.firstValue, e.secondValue)), h = ee(() => t.range ? `${100 * (d.value - u.value) / (t.max - t.min)}%` : `${100 * (e.firstValue - t.min) / (t.max - t.min)}%`), f = ee(() => t.range ? `${100 * (u.value - t.min) / (t.max - t.min)}%` : "0%"), p = ee(() => t.vertical ? { height: t.height } : {}), m = ee(() => t.vertical ? { height: h.value, bottom: f.value } : { width: h.value, left: f.value }), y = () => { a.value && (e.sliderSize = a.value[`client${t.vertical ? "Height" : "Width"}`]); }, g = (T) => { const E = t.min + T * (t.max - t.min) / 100; if (!t.range) return o; let C; return Math.abs(u.value - E) < Math.abs(d.value - E) ? C = e.firstValue < e.secondValue ? "firstButton" : "secondButton" : C = e.firstValue > e.secondValue ? "firstButton" : "secondButton", c[C]; }, v = (T) => { const E = g(T); return E.value.setPosition(T), E; }, x = (T) => { e.firstValue = T ?? t.min, S(t.range ? [u.value, d.value] : T ?? t.min); }, w = (T) => { e.secondValue = T, t.range && S([u.value, d.value]); }, S = (T) => { r(gr, T), r(ul, T); }, _ = async () => { await st(), r(ks, t.range ? [u.value, d.value] : t.modelValue); }, b = (T) => { var E, C, L, A, k, P; if (l.value || e.dragging) return; y(); let R = 0; if (t.vertical) { const M = (L = (C = (E = T.touches) == null ? void 0 : E.item(0)) == null ? void 0 : C.clientY) != null ? L : T.clientY; R = (a.value.getBoundingClientRect().bottom - M) / e.sliderSize * 100; } else { const M = (P = (k = (A = T.touches) == null ? void 0 : A.item(0)) == null ? void 0 : k.clientX) != null ? P : T.clientX, O = a.value.getBoundingClientRect().left; R = (M - O) / e.sliderSize * 100; } if (!(R < 0 || R > 100)) return v(R); }; return { elFormItem: n, slider: a, firstButton: o, secondButton: s, sliderDisabled: l, minValue: u, maxValue: d, runwayStyle: p, barStyle: m, resetSize: y, setPosition: v, emitChange: _, onSliderWrapperPrevent: (T) => { var E, C; ((E = c.firstButton.value) != null && E.dragging || (C = c.secondButton.value) != null && C.dragging) && T.preventDefault(); }, onSliderClick: (T) => { b(T) && _(); }, onSliderDown: async (T) => { const E = b(T); E && (await st(), E.value.onButtonDown(T)); }, onSliderMarkerDown: (T) => { l.value || e.dragging || v(T); }, setFirstValue: x, setSecondValue: w }; }, { left: nae, down: aae, right: oae, up: sae, home: lae, end: cae, pageUp: uae, pageDown: dae } = pa, hae = (t, e, r) => { const i = we(), n = we(!1), a = ee(() => e.value instanceof Function), o = ee(() => a.value && e.value(t.modelValue) || t.modelValue), s = Gy(() => { r.value && (n.value = !0); }, 50), c = Gy(() => { r.value && (n.value = !1); }, 50); return { tooltip: i, tooltipVisible: n, formatValue: o, displayTooltip: s, hideTooltip: c }; }, pae = (t, e, r) => { const { disabled: i, min: n, max: a, step: o, showTooltip: s, precision: c, sliderSize: l, formatTooltip: u, emitChange: d, resetSize: h, updateDragging: f } = Ye(Zk), { tooltip: p, tooltipVisible: m, formatValue: y, displayTooltip: g, hideTooltip: v } = hae(t, u, s), x = we(), w = ee(() => `${(t.modelValue - n.value) / (a.value - n.value) * 100}%`), S = ee(() => t.vertical ? { bottom: w.value } : { left: w.value }), _ = () => { e.hovering = !0, g(); }, b = () => { e.hovering = !1, e.dragging || v(); }, T = (U) => { i.value || (U.preventDefault(), D(U), window.addEventListener("mousemove", I), window.addEventListener("touchmove", I), window.addEventListener("mouseup", F), window.addEventListener("touchend", F), window.addEventListener("contextmenu", F), x.value.focus()); }, E = (U) => { i.value || (e.newPosition = Number.parseFloat(w.value) + U / (a.value - n.value) * 100, z(e.newPosition), d()); }, C = () => { E(-o.value); }, L = () => { E(o.value); }, A = () => { E(-o.value * 4); }, k = () => { E(o.value * 4); }, P = () => { i.value || (z(0), d()); }, R = () => { i.value || (z(100), d()); }, M = (U) => { let Z = !0; [nae, aae].includes(U.key) ? C() : [oae, sae].includes(U.key) ? L() : U.key === lae ? P() : U.key === cae ? R() : U.key === dae ? A() : U.key === uae ? k() : Z = !1, Z && U.preventDefault(); }, O = (U) => { let Z, re; return U.type.startsWith("touch") ? (re = U.touches[0].clientY, Z = U.touches[0].clientX) : (re = U.clientY, Z = U.clientX), { clientX: Z, clientY: re }; }, D = (U) => { e.dragging = !0, e.isClick = !0; const { clientX: Z, clientY: re } = O(U); t.vertical ? e.startY = re : e.startX = Z, e.startPosition = Number.parseFloat(w.value), e.newPosition = e.startPosition; }, I = (U) => { if (e.dragging) { e.isClick = !1, g(), h(); let Z; const { clientX: re, clientY: K } = O(U); t.vertical ? (e.currentY = K, Z = (e.startY - e.currentY) / l.value * 100) : (e.currentX = re, Z = (e.currentX - e.startX) / l.value * 100), e.newPosition = e.startPosition + Z, z(e.newPosition); } }, F = () => { e.dragging && (setTimeout(() => { e.dragging = !1, e.hovering || v(), e.isClick || z(e.newPosition), d(); }, 0), window.removeEventListener("mousemove", I), window.removeEventListener("touchmove", I), window.removeEventListener("mouseup", F), window.removeEventListener("touchend", F), window.removeEventListener("contextmenu", F)); }, z = async (U) => { if (U === null || Number.isNaN(+U)) return; U < 0 ? U = 0 : U > 100 && (U = 100); const Z = 100 / ((a.value - n.value) / o.value); let re = Math.round(U / Z) * Z * (a.value - n.value) * 0.01 + n.value; re = Number.parseFloat(re.toFixed(c.value)), re !== t.modelValue && r(gr, re), !e.dragging && t.modelValue !== e.oldValue && (e.oldValue = t.modelValue), await st(), e.dragging && g(), p.value.updatePopper(); }; return ze(() => e.dragging, (U) => { f(U); }), ri(x, "touchstart", T, { passive: !1 }), { disabled: i, button: x, tooltip: p, tooltipVisible: m, showTooltip: s, wrapperStyle: S, formatValue: y, handleMouseEnter: _, handleMouseLeave: b, onButtonDown: T, onKeyDown: M, setPosition: z }; }, fae = (t, e, r, i) => ({ stops: ee(() => { if (!t.showStops || t.min > t.max) return []; if (t.step === 0) return Br("ElSlider", "step should not be 0."), []; const n = (t.max - t.min) / t.step, a = 100 * t.step / (t.max - t.min), o = Array.from({ length: n - 1 }).map((s, c) => (c + 1) * a); return t.range ? o.filter((s) => s < 100 * (r.value - t.min) / (t.max - t.min) || s > 100 * (i.value - t.min) / (t.max - t.min)) : o.filter((s) => s > 100 * (e.firstValue - t.min) / (t.max - t.min)); }), getStopStyle: (n) => t.vertical ? { bottom: `${n}%` } : { left: `${n}%` } }), mae = (t, e, r, i, n, a) => { const o = (l) => { n(gr, l), n(ul, l); }, s = () => t.range ? ![r.value, i.value].every((l, u) => l === e.oldValue[u]) : t.modelValue !== e.oldValue, c = () => { var l, u; t.min > t.max && Xu("Slider", "min should not be greater than max."); const d = t.modelValue; t.range && Array.isArray(d) ? d[1] < t.min ? o([t.min, t.min]) : d[0] > t.max ? o([t.max, t.max]) : d[0] < t.min ? o([t.min, d[1]]) : d[1] > t.max ? o([d[0], t.max]) : (e.firstValue = d[0], e.secondValue = d[1], s() && (t.validateEvent && ((l = a == null ? void 0 : a.validate) == null || l.call(a, "change").catch((h) => Br(h))), e.oldValue = d.slice())) : !t.range && typeof d == "number" && !Number.isNaN(d) && (d < t.min ? o(t.min) : d > t.max ? o(t.max) : (e.firstValue = d, s() && (t.validateEvent && ((u = a == null ? void 0 : a.validate) == null || u.call(a, "change").catch((h) => Br(h))), e.oldValue = d))); }; c(), ze(() => e.dragging, (l) => { l || c(); }), ze(() => t.modelValue, (l, u) => { e.dragging || Array.isArray(l) && Array.isArray(u) && l.every((d, h) => d === u[h]) && e.firstValue === l[0] && e.secondValue === l[1] || c(); }, { deep: !0 }), ze(() => [t.min, t.max], () => { c(); }); }, gae = $t({ modelValue: { type: Number, default: 0 }, vertical: Boolean, tooltipClass: String, placement: { type: String, values: Zu, default: "top" } }), vae = { [gr]: (t) => Jt(t) }, yae = Le({ name: "ElSliderButton" }), bae = /* @__PURE__ */ Le({ ...yae, props: gae, emits: vae, setup(t, { expose: e, emit: r }) { const i = t, n = Pt("slider"), a = _r({ hovering: !1, dragging: !1, isClick: !1, startX: 0, currentX: 0, startY: 0, currentY: 0, startPosition: 0, newPosition: 0, oldValue: i.modelValue }), { disabled: o, button: s, tooltip: c, showTooltip: l, tooltipVisible: u, wrapperStyle: d, formatValue: h, handleMouseEnter: f, handleMouseLeave: p, onButtonDown: m, onKeyDown: y, setPosition: g } = pae(i, a, r), { hovering: v, dragging: x } = Zi(a); return e({ onButtonDown: m, onKeyDown: y, setPosition: g, hovering: v, dragging: x }), (w, S) => (Q(), be("div", { ref_key: "button", ref: s, class: xe([N(n).e("button-wrapper"), { hover: N(v), dragging: N(x) }]), style: yt(N(d)), tabindex: N(o) ? -1 : 0, onMouseenter: N(f), onMouseleave: N(p), onMousedown: N(m), onFocus: N(f), onBlur: N(p), onKeydown: N(y) }, [ oe(N(Tx), { ref_key: "tooltip", ref: c, visible: N(u), placement: w.placement, "fallback-placements": ["top", "bottom", "right", "left"], "stop-popper-mouse-event": !1, "popper-class": w.tooltipClass, disabled: !N(l), persistent: "" }, { content: le(() => [ Ee("span", null, Ze(N(h)), 1) ]), default: le(() => [ Ee("div", { class: xe([N(n).e("button"), { hover: N(v), dragging: N(x) }]) }, null, 2) ]), _: 1 }, 8, ["visible", "placement", "popper-class", "disabled"]) ], 46, ["tabindex", "onMouseenter", "onMouseleave", "onMousedown", "onFocus", "onBlur", "onKeydown"])); } }); var kM = /* @__PURE__ */ Nt(bae, [["__file", "button.vue"]]); const xae = $t({ mark: { type: ot([String, Object]), default: void 0 } }); var wae = Le({ name: "ElSliderMarker", props: xae, setup(t) { const e = Pt("slider"), r = ee(() => Ni(t.mark) ? t.mark : t.mark.label), i = ee(() => Ni(t.mark) ? void 0 : t.mark.style); return () => an("div", { class: e.e("marks-text"), style: i.value }, r.value); } }); const _ae = Le({ name: "ElSlider" }), Sae = /* @__PURE__ */ Le({ ..._ae, props: Qne, emits: eae, setup(t, { expose: e, emit: r }) { const i = t, n = Pt("slider"), { t: a } = Zg(), o = _r({ firstValue: 0, secondValue: 0, oldValue: 0, dragging: !1, sliderSize: 1 }), { elFormItem: s, slider: c, firstButton: l, secondButton: u, sliderDisabled: d, minValue: h, maxValue: f, runwayStyle: p, barStyle: m, resetSize: y, emitChange: g, onSliderWrapperPrevent: v, onSliderClick: x, onSliderDown: w, onSliderMarkerDown: S, setFirstValue: _, setSecondValue: b } = iae(i, o, r), { stops: T, getStopStyle: E } = fae(i, o, h, f), { inputId: C, isLabeledByFormItem: L } = xx(i, { formItemContext: s }), A = Yu(), k = ee(() => i.inputSize || A.value), P = ee(() => i.ariaLabel || a("el.slider.defaultLabel", { min: i.min, max: i.max })), R = ee(() => i.range ? i.rangeStartLabel || a("el.slider.defaultRangeStartLabel") : P.value), M = ee(() => i.formatValueText ? i.formatValueText(Z.value) : `${Z.value}`), O = ee(() => i.rangeEndLabel || a("el.slider.defaultRangeEndLabel")), D = ee(() => i.formatValueText ? i.formatValueText(re.value) : `${re.value}`), I = ee(() => [ n.b(), n.m(A.value), n.is("vertical", i.vertical), { [n.m("with-input")]: i.showInput } ]), F = rae(i); mae(i, o, h, f, r, s); const z = ee(() => { const H = [i.min, i.max, i.step].map((G) => { const W = `${G}`.split(".")[1]; return W ? W.length : 0; }); return Math.max.apply(null, H); }), { sliderWrapper: U } = tae(i, o, y), { firstValue: Z, secondValue: re, sliderSize: K } = Zi(o), V = (H) => { o.dragging = H; }; return ri(U, "touchstart", v, { passive: !1 }), ri(U, "touchmove", v, { passive: !1 }), Dt(Zk, { ...Zi(i), sliderSize: K, disabled: d, precision: z, emitChange: g, resetSize: y, updateDragging: V }), e({ onSliderClick: x }), (H, G) => { var W, Y; return Q(), be("div", { id: H.range ? N(C) : void 0, ref_key: "sliderWrapper", ref: U, class: xe(N(I)), role: H.range ? "group" : void 0, "aria-label": H.range && !N(L) ? N(P) : void 0, "aria-labelledby": H.range && N(L) ? (W = N(s)) == null ? void 0 : W.labelId : void 0 }, [ Ee("div", { ref_key: "slider", ref: c, class: xe([ N(n).e("runway"), { "show-input": H.showInput && !H.range }, N(n).is("disabled", N(d)) ]), style: yt(N(p)), onMousedown: N(w), onTouchstartPassive: N(w) }, [ Ee("div", { class: xe(N(n).e("bar")), style: yt(N(m)) }, null, 6), oe(kM, { id: H.range ? void 0 : N(C), ref_key: "firstButton", ref: l, "model-value": N(Z), vertical: H.vertical, "tooltip-class": H.tooltipClass, placement: H.placement, role: "slider", "aria-label": H.range || !N(L) ? N(R) : void 0, "aria-labelledby": !H.range && N(L) ? (Y = N(s)) == null ? void 0 : Y.labelId : void 0, "aria-valuemin": H.min, "aria-valuemax": H.range ? N(re) : H.max, "aria-valuenow": N(Z), "aria-valuetext": N(M), "aria-orientation": H.vertical ? "vertical" : "horizontal", "aria-disabled": N(d), "onUpdate:modelValue": N(_) }, null, 8, ["id", "model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-labelledby", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue"]), H.range ? (Q(), Re(kM, { key: 0, ref_key: "secondButton", ref: u, "model-value": N(re), vertical: H.vertical, "tooltip-class": H.tooltipClass, placement: H.placement, role: "slider", "aria-label": N(O), "aria-valuemin": N(Z), "aria-valuemax": H.max, "aria-valuenow": N(re), "aria-valuetext": N(D), "aria-orientation": H.vertical ? "vertical" : "horizontal", "aria-disabled": N(d), "onUpdate:modelValue": N(b) }, null, 8, ["model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue"])) : Pe("v-if", !0), H.showStops ? (Q(), be("div", { key: 1 }, [ (Q(!0), be(pt, null, ir(N(T), (X, ie) => (Q(), be("div", { key: ie, class: xe(N(n).e("stop")), style: yt(N(E)(X)) }, null, 6))), 128)) ])) : Pe("v-if", !0), N(F).length > 0 ? (Q(), be(pt, { key: 2 }, [ Ee("div", null, [ (Q(!0), be(pt, null, ir(N(F), (X, ie) => (Q(), be("div", { key: ie, style: yt(N(E)(X.position)), class: xe([N(n).e("stop"), N(n).e("marks-stop")]) }, null, 6))), 128)) ]), Ee("div", { class: xe(N(n).e("marks")) }, [ (Q(!0), be(pt, null, ir(N(F), (X, ie) => (Q(), Re(N(wae), { key: ie, mark: X.mark, style: yt(N(E)(X.position)), onMousedown: Tt((ue) => N(S)(X.position), ["stop"]) }, null, 8, ["mark", "style", "onMousedown"]))), 128)) ], 2) ], 64)) : Pe("v-if", !0) ], 46, ["onMousedown", "onTouchstartPassive"]), H.showInput && !H.range ? (Q(), Re(N(xo), { key: 0, ref: "input", "model-value": N(Z), class: xe(N(n).e("input")), step: H.step, disabled: N(d), controls: H.showInputControls, min: H.min, max: H.max, precision: N(z), debounce: H.debounce, size: N(k), "onUpdate:modelValue": N(_), onChange: N(g) }, null, 8, ["model-value", "class", "step", "disabled", "controls", "min", "max", "precision", "debounce", "size", "onUpdate:modelValue", "onChange"])) : Pe("v-if", !0) ], 10, ["id", "role", "aria-label", "aria-labelledby"]); }; } }); var Mae = /* @__PURE__ */ Nt(Sae, [["__file", "slider.vue"]]); const An = ai(Mae), iv = Symbol("tabsRootContextKey"), Eae = $t({ tabs: { type: ot(Array), default: () => Ga([]) } }), Yk = "ElTabBar", Tae = Le({ name: Yk }), Cae = /* @__PURE__ */ Le({ ...Tae, props: Eae, setup(t, { expose: e }) { const r = t, i = Ct(), n = Ye(iv); n || Xu(Yk, ""); const a = Pt("tabs"), o = we(), s = we(), c = () => { let f = 0, p = 0; const m = ["top", "bottom"].includes(n.props.tabPosition) ? "width" : "height", y = m === "width" ? "x" : "y", g = y === "x" ? "left" : "top"; return r.tabs.every((v) => { var x, w; const S = (w = (x = i.parent) == null ? void 0 : x.refs) == null ? void 0 : w[`tab-${v.uid}`]; if (!S) return !1; if (!v.active) return !0; f = S[`offset${Zo(g)}`], p = S[`client${Zo(m)}`]; const _ = window.getComputedStyle(S); return m === "width" && (p -= Number.parseFloat(_.paddingLeft) + Number.parseFloat(_.paddingRight), f += Number.parseFloat(_.paddingLeft)), !1; }), { [m]: `${p}px`, transform: `translate${Zo(y)}(${f}px)` }; }, l = () => s.value = c(), u = [], d = () => { var f; u.forEach((m) => m.stop()), u.length = 0; const p = (f = i.parent) == null ? void 0 : f.refs; if (p) { for (const m in p) if (m.startsWith("tab-")) { const y = p[m]; y && u.push(bn(y, l)); } } }; ze(() => r.tabs, async () => { await st(), l(), d(); }, { immediate: !0 }); const h = bn(o, () => l()); return Sr(() => { u.forEach((f) => f.stop()), u.length = 0, h.stop(); }), e({ ref: o, update: l }), (f, p) => (Q(), be("div", { ref_key: "barRef", ref: o, class: xe([N(a).e("active-bar"), N(a).is(N(n).props.tabPosition)]), style: yt(s.value) }, null, 6)); } }); var Aae = /* @__PURE__ */ Nt(Cae, [["__file", "tab-bar.vue"]]); const Lae = $t({ panes: { type: ot(Array), default: () => Ga([]) }, currentName: { type: [String, Number], default: "" }, editable: Boolean, type: { type: String, values: ["card", "border-card", ""], default: "" }, stretch: Boolean }), kae = { tabClick: (t, e, r) => r instanceof Event, tabRemove: (t, e) => e instanceof Event }, PM = "ElTabNav", Pae = Le({ name: PM, props: Lae, emits: kae, setup(t, { expose: e, emit: r }) { const i = Ye(iv); i || Xu(PM, ""); const n = Pt("tabs"), a = QX(), o = hZ(), s = we(), c = we(), l = we(), u = we(), d = we(!1), h = we(0), f = we(!1), p = we(!0), m = ee(() => ["top", "bottom"].includes(i.props.tabPosition) ? "width" : "height"), y = ee(() => ({ transform: `translate${m.value === "width" ? "X" : "Y"}(-${h.value}px)` })), g = () => { if (!s.value) return; const T = s.value[`offset${Zo(m.value)}`], E = h.value; if (!E) return; const C = E > T ? E - T : 0; h.value = C; }, v = () => { if (!s.value || !c.value) return; const T = c.value[`offset${Zo(m.value)}`], E = s.value[`offset${Zo(m.value)}`], C = h.value; if (T - C <= E) return; const L = T - C > E * 2 ? C + E : T - E; h.value = L; }, x = async () => { const T = c.value; if (!d.value || !l.value || !s.value || !T) return; await st(); const E = l.value.querySelector(".is-active"); if (!E) return; const C = s.value, L = ["top", "bottom"].includes(i.props.tabPosition), A = E.getBoundingClientRect(), k = C.getBoundingClientRect(), P = L ? T.offsetWidth - k.width : T.offsetHeight - k.height, R = h.value; let M = R; L ? (A.left < k.left && (M = R - (k.left - A.left)), A.right > k.right && (M = R + A.right - k.right)) : (A.top < k.top && (M = R - (k.top - A.top)), A.bottom > k.bottom && (M = R + (A.bottom - k.bottom))), M = Math.max(M, 0), h.value = Math.min(M, P); }, w = () => { var T; if (!c.value || !s.value) return; t.stretch && ((T = u.value) == null || T.update()); const E = c.value[`offset${Zo(m.value)}`], C = s.value[`offset${Zo(m.value)}`], L = h.value; C < E ? (d.value = d.value || {}, d.value.prev = L, d.value.next = L + C < E, E - L < C && (h.value = E - C)) : (d.value = !1, L > 0 && (h.value = 0)); }, S = (T) => { const E = T.code, { up: C, down: L, left: A, right: k } = pa; if (![C, L, A, k].includes(E)) return; const P = Array.from(T.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")), R = P.indexOf(T.target); let M; E === A || E === C ? R === 0 ? M = P.length - 1 : M = R - 1 : R < P.length - 1 ? M = R + 1 : M = 0, P[M].focus({ preventScroll: !0 }), P[M].click(), _(); }, _ = () => { p.value && (f.value = !0); }, b = () => f.value = !1; return ze(a, (T) => { T === "hidden" ? p.value = !1 : T === "visible" && setTimeout(() => p.value = !0, 50); }), ze(o, (T) => { T ? setTimeout(() => p.value = !0, 50) : p.value = !1; }), bn(l, w), Lt(() => setTimeout(() => x(), 0)), jh(() => w()), e({ scrollToActiveTab: x, removeFocus: b }), () => { const T = d.value ? [oe("span", { class: [n.e("nav-prev"), n.is("disabled", !d.value.prev)], onClick: g }, [oe(yr, null, { default: () => [oe(vs, null, null)] })]), oe("span", { class: [n.e("nav-next"), n.is("disabled", !d.value.next)], onClick: v }, [oe(yr, null, { default: () => [oe(ys, null, null)] })])] : null, E = t.panes.map((C, L) => { var A, k, P, R; const M = C.uid, O = C.props.disabled, D = (k = (A = C.props.name) != null ? A : C.index) != null ? k : `${L}`, I = !O && (C.isClosable || t.editable); C.index = `${L}`; const F = I ? oe(yr, { class: "is-icon-close", onClick: (Z) => r("tabRemove", C, Z) }, { default: () => [oe(qy, null, null)] }) : null, z = ((R = (P = C.slots).label) == null ? void 0 : R.call(P)) || C.props.label, U = !O && C.active ? 0 : -1; return oe("div", { ref: `tab-${M}`, class: [n.e("item"), n.is(i.props.tabPosition), n.is("active", C.active), n.is("disabled", O), n.is("closable", I), n.is("focus", f.value)], id: `tab-${D}`, key: `tab-${M}`, "aria-controls": `pane-${D}`, role: "tab", "aria-selected": C.active, tabindex: U, onFocus: () => _(), onBlur: () => b(), onClick: (Z) => { b(), r("tabClick", C, D, Z); }, onKeydown: (Z) => { I && (Z.code === pa.delete || Z.code === pa.backspace) && r("tabRemove", C, Z); } }, [z, F]); }); return oe("div", { ref: l, class: [n.e("nav-wrap"), n.is("scrollable", !!d.value), n.is(i.props.tabPosition)] }, [T, oe("div", { class: n.e("nav-scroll"), ref: s }, [oe("div", { class: [n.e("nav"), n.is(i.props.tabPosition), n.is("stretch", t.stretch && ["top", "bottom"].includes(i.props.tabPosition))], ref: c, style: y.value, role: "tablist", onKeydown: S }, [t.type ? null : oe(Aae, { ref: u, tabs: [...t.panes] }, null), E])])]); }; } }), Rae = $t({ type: { type: String, values: ["card", "border-card", ""], default: "" }, closable: Boolean, addable: Boolean, modelValue: { type: [String, Number] }, editable: Boolean, tabPosition: { type: String, values: ["top", "right", "bottom", "left"], default: "top" }, beforeLeave: { type: ot(Function), default: () => !0 }, stretch: Boolean }), h0 = (t) => Ni(t) || Jt(t), Oae = { [gr]: (t) => h0(t), tabClick: (t, e) => e instanceof Event, tabChange: (t) => h0(t), edit: (t, e) => ["remove", "add"].includes(e), tabRemove: (t) => h0(t), tabAdd: () => !0 }, Dae = Le({ name: "ElTabs", props: Rae, emits: Oae, setup(t, { emit: e, slots: r, expose: i }) { var n; const a = Pt("tabs"), o = ee(() => ["left", "right"].includes(t.tabPosition)), { children: s, addChild: c, removeChild: l } = dte(Ct(), "ElTabPane"), u = we(), d = we((n = t.modelValue) != null ? n : "0"), h = async (g, v = !1) => { var x, w, S; if (!(d.value === g || Un(g))) try { await ((x = t.beforeLeave) == null ? void 0 : x.call(t, g, d.value)) !== !1 && (d.value = g, v && (e(gr, g), e("tabChange", g)), (S = (w = u.value) == null ? void 0 : w.removeFocus) == null || S.call(w)); } catch { } }, f = (g, v, x) => { g.props.disabled || (h(v, !0), e("tabClick", g, x)); }, p = (g, v) => { g.props.disabled || Un(g.props.name) || (v.stopPropagation(), e("edit", g.props.name, "remove"), e("tabRemove", g.props.name)); }, m = () => { e("edit", void 0, "add"), e("tabAdd"); }; ze(() => t.modelValue, (g) => h(g)), ze(d, async () => { var g; await st(), (g = u.value) == null || g.scrollToActiveTab(); }), Dt(iv, { props: t, currentName: d, registerPane: (g) => { s.value.push(g); }, sortPane: c, unregisterPane: l }), i({ currentName: d }); const y = ({ render: g }) => g(); return () => { const g = r["add-icon"], v = t.editable || t.addable ? oe("div", { class: [a.e("new-tab"), o.value && a.e("new-tab-vertical")], tabindex: "0", onClick: m, onKeydown: (S) => { S.code === pa.enter && m(); } }, [g ? Fe(r, "add-icon") : oe(yr, { class: a.is("icon-plus") }, { default: () => [oe(qg, null, null)] })]) : null, x = oe("div", { class: [a.e("header"), o.value && a.e("header-vertical"), a.is(t.tabPosition)] }, [oe(y, { render: () => { const S = s.value.some((_) => _.slots.label); return oe(Pae, { ref: u, currentName: d.value, editable: t.editable, type: t.type, panes: s.value, stretch: t.stretch, onTabClick: f, onTabRemove: p }, { $stable: !S }); } }, null), v]), w = oe("div", { class: a.e("content") }, [Fe(r, "default")]); return oe("div", { class: [a.b(), a.m(t.tabPosition), { [a.m("card")]: t.type === "card", [a.m("border-card")]: t.type === "border-card" }] }, [w, x]); }; } }), Iae = $t({ label: { type: String, default: "" }, name: { type: [String, Number] }, closable: Boolean, disabled: Boolean, lazy: Boolean }), Kk = "ElTabPane", Nae = Le({ name: Kk }), Bae = /* @__PURE__ */ Le({ ...Nae, props: Iae, setup(t) { const e = t, r = Ct(), i = co(), n = Ye(iv); n || Xu(Kk, "usage: "); const a = Pt("tab-pane"), o = we(), s = ee(() => e.closable || n.props.closable), c = hS(() => { var f; return n.currentName.value === ((f = e.name) != null ? f : o.value); }), l = we(c.value), u = ee(() => { var f; return (f = e.name) != null ? f : o.value; }), d = hS(() => !e.lazy || l.value || c.value); ze(c, (f) => { f && (l.value = !0); }); const h = _r({ uid: r.uid, slots: i, props: e, paneName: u, active: c, index: o, isClosable: s }); return n.registerPane(h), Lt(() => { n.sortPane(h); }), j1(() => { n.unregisterPane(h.uid); }), (f, p) => N(d) ? ht((Q(), be("div", { key: 0, id: `pane-${N(u)}`, class: xe(N(a).b()), role: "tabpanel", "aria-hidden": !N(c), "aria-labelledby": `tab-${N(u)}` }, [ Fe(f.$slots, "default") ], 10, ["id", "aria-hidden", "aria-labelledby"])), [ [Ot, N(c)] ]) : Pe("v-if", !0); } }); var Jk = /* @__PURE__ */ Nt(Bae, [["__file", "tab-pane.vue"]]); const Qk = ai(Dae, { TabPane: Jk }), eP = yo(Jk); function Fae(t) { let e; const r = we(!1), i = _r({ ...t, originalPosition: "", originalOverflow: "", visible: !1 }); function n(h) { i.text = h; } function a() { const h = i.parent, f = d.ns; if (!h.vLoadingAddClassList) { let p = h.getAttribute("loading-number"); p = Number.parseInt(p) - 1, p ? h.setAttribute("loading-number", p.toString()) : (qm(h, f.bm("parent", "relative")), h.removeAttribute("loading-number")), qm(h, f.bm("parent", "hidden")); } o(), u.unmount(); } function o() { var h, f; (f = (h = d.$el) == null ? void 0 : h.parentNode) == null || f.removeChild(d.$el); } function s() { var h; t.beforeClose && !t.beforeClose() || (r.value = !0, clearTimeout(e), e = setTimeout(c, 400), i.visible = !1, (h = t.closed) == null || h.call(t)); } function c() { if (!r.value) return; const h = i.parent; r.value = !1, h.vLoadingAddClassList = void 0, a(); } const l = Le({ name: "ElLoading", setup(h, { expose: f }) { const { ns: p, zIndex: m } = bte("loading"); return f({ ns: p, zIndex: m }), () => { const y = i.spinner || i.svg, g = an("svg", { class: "circular", viewBox: i.svgViewBox ? i.svgViewBox : "0 0 50 50", ...y ? { innerHTML: y } : {} }, [ an("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none" }) ]), v = i.text ? an("p", { class: p.b("text") }, [i.text]) : void 0; return an(Zn, { name: p.b("fade"), onAfterLeave: c }, { default: le(() => [ ht(oe("div", { style: { backgroundColor: i.background || "" }, class: [ p.b("mask"), i.customClass, i.fullscreen ? "is-fullscreen" : "" ] }, [ an("div", { class: p.b("spinner") }, [g, v]) ]), [[Ot, i.visible]]) ]) }); }; } }), u = $T(l), d = u.mount(document.createElement("div")); return { ...Zi(i), setText: n, removeElLoadingChild: o, close: s, handleAfterLeave: c, vm: d, get $el() { return d.$el; } }; } let sf; const e1 = function(t = {}) { if (!Ur) return; const e = zae(t); if (e.fullscreen && sf) return sf; const r = Fae({ ...e, closed: () => { var n; (n = e.closed) == null || n.call(e), e.fullscreen && (sf = void 0); } }); $ae(e, e.parent, r), RM(e, e.parent, r), e.parent.vLoadingAddClassList = () => RM(e, e.parent, r); let i = e.parent.getAttribute("loading-number"); return i ? i = `${Number.parseInt(i) + 1}` : i = "1", e.parent.setAttribute("loading-number", i), e.parent.appendChild(r.$el), st(() => r.visible.value = e.visible), e.fullscreen && (sf = r), r; }, zae = (t) => { var e, r, i, n; let a; return Ni(t.target) ? a = (e = document.querySelector(t.target)) != null ? e : document.body : a = t.target || document.body, { parent: a === document.body || t.body ? document.body : a, background: t.background || "", svg: t.svg || "", svgViewBox: t.svgViewBox || "", spinner: t.spinner || !1, text: t.text || "", fullscreen: a === document.body && ((r = t.fullscreen) != null ? r : !0), lock: (i = t.lock) != null ? i : !1, customClass: t.customClass || "", visible: (n = t.visible) != null ? n : !0, beforeClose: t.beforeClose, closed: t.closed, target: a }; }, $ae = async (t, e, r) => { const { nextZIndex: i } = r.vm.zIndex || r.vm._.exposed.zIndex, n = {}; if (t.fullscreen) r.originalPosition.value = yd(document.body, "position"), r.originalOverflow.value = yd(document.body, "overflow"), n.zIndex = i(); else if (t.parent === document.body) { r.originalPosition.value = yd(document.body, "position"), await st(); for (const a of ["top", "left"]) { const o = a === "top" ? "scrollTop" : "scrollLeft"; n[a] = `${t.target.getBoundingClientRect()[a] + document.body[o] + document.documentElement[o] - Number.parseInt(yd(document.body, `margin-${a}`), 10)}px`; } for (const a of ["height", "width"]) n[a] = `${t.target.getBoundingClientRect()[a]}px`; } else r.originalPosition.value = yd(e, "position"); for (const [a, o] of Object.entries(n)) r.$el.style[a] = o; }, RM = (t, e, r) => { const i = r.vm.ns || r.vm._.exposed.ns; ["absolute", "fixed", "sticky"].includes(r.originalPosition.value) ? qm(e, i.bm("parent", "relative")) : ZS(e, i.bm("parent", "relative")), t.fullscreen && t.lock ? ZS(e, i.bm("parent", "hidden")) : qm(e, i.bm("parent", "hidden")); }, bm = Symbol("ElLoading"), OM = (t, e) => { var r, i, n, a; const o = e.instance, s = (h) => Ii(e.value) ? e.value[h] : void 0, c = (h) => { const f = Ni(h) && (o == null ? void 0 : o[h]) || h; return f && we(f); }, l = (h) => c(s(h) || t.getAttribute(`element-loading-${xZ(h)}`)), u = (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: u, target: (i = s("target")) != null ? i : u ? void 0 : t, body: (n = s("body")) != null ? n : e.modifiers.body, lock: (a = s("lock")) != null ? a : e.modifiers.lock }; t[bm] = { options: d, instance: e1(d) }; }, Vae = (t, e) => { for (const r of Object.keys(e)) cn(e[r]) && (e[r].value = t[r]); }, t1 = { mounted(t, e) { e.value && OM(t, e); }, updated(t, e) { const r = t[bm]; e.oldValue !== e.value && (e.value && !e.oldValue ? OM(t, e) : e.value && e.oldValue ? Ii(e.value) && Vae(e.value, r.options) : r == null || r.instance.close()); }, unmounted(t) { var e; (e = t[bm]) == null || e.instance.close(), t[bm] = null; } }, Uae = { install(t) { t.directive("loading", t1), t.config.globalProperties.$loading = e1; }, directive: t1, service: e1 }; var tP = { exports: {} }, jae = {}, DM; function Hae() { return DM || (DM = 1, function(t) { var e = function() { try { return !!Symbol.iterator; } catch { return !1; } }, r = e(), i = function(l) { var u = { next: function() { var d = l.shift(); return { done: d === void 0, value: d }; } }; return r && (u[Symbol.iterator] = function() { return u; }), u; }, n = function(l) { return encodeURIComponent(l).replace(/%20/g, "+"); }, a = function(l) { return decodeURIComponent(String(l).replace(/\+/g, " ")); }, o = function() { var l = function(d) { Object.defineProperty(this, "_entries", { writable: !0, value: {} }); var h = typeof d; if (h !== "undefined") if (h === "string") d !== "" && this._fromString(d); else if (d instanceof l) { var f = this; d.forEach(function(g, v) { f.append(v, g); }); } else if (d !== null && h === "object") if (Object.prototype.toString.call(d) === "[object Array]") for (var p = 0; p < d.length; p++) { var m = d[p]; if (Object.prototype.toString.call(m) === "[object Array]" || m.length !== 2) this.append(m[0], m[1]); else throw new TypeError("Expected [string, any] as entry at index " + p + " of URLSearchParams's input"); } else for (var y in d) d.hasOwnProperty(y) && this.append(y, d[y]); else throw new TypeError("Unsupported input's type for URLSearchParams"); }, u = l.prototype; u.append = function(d, h) { d in this._entries ? this._entries[d].push(String(h)) : this._entries[d] = [String(h)]; }, u.delete = function(d) { delete this._entries[d]; }, u.get = function(d) { return d in this._entries ? this._entries[d][0] : null; }, u.getAll = function(d) { return d in this._entries ? this._entries[d].slice(0) : []; }, u.has = function(d) { return d in this._entries; }, u.set = function(d, h) { this._entries[d] = [String(h)]; }, u.forEach = function(d, h) { var f; for (var p in this._entries) if (this._entries.hasOwnProperty(p)) { f = this._entries[p]; for (var m = 0; m < f.length; m++) d.call(h, f[m], p, this); } }, u.keys = function() { var d = []; return this.forEach(function(h, f) { d.push(f); }), i(d); }, u.values = function() { var d = []; return this.forEach(function(h) { d.push(h); }), i(d); }, u.entries = function() { var d = []; return this.forEach(function(h, f) { d.push([f, h]); }), i(d); }, r && (u[Symbol.iterator] = u.entries), u.toString = function() { var d = []; return this.forEach(function(h, f) { d.push(n(f) + "=" + n(h)); }), d.join("&"); }, t.URLSearchParams = l; }, s = function() { try { var l = t.URLSearchParams; return new l("?a=1").toString() === "a=1" && typeof l.prototype.set == "function" && typeof l.prototype.entries == "function"; } catch { return !1; } }; s() || o(); var c = t.URLSearchParams.prototype; typeof c.sort != "function" && (c.sort = function() { var l = this, u = []; this.forEach(function(h, f) { u.push([f, h]), l._entries || l.delete(f); }), u.sort(function(h, f) { return h[0] < f[0] ? -1 : h[0] > f[0] ? 1 : 0; }), l._entries && (l._entries = {}); for (var d = 0; d < u.length; d++) this.append(u[d][0], u[d][1]); }), typeof c._fromString != "function" && Object.defineProperty(c, "_fromString", { enumerable: !1, configurable: !1, writable: !1, value: function(l) { if (this._entries) this._entries = {}; else { var u = []; this.forEach(function(p, m) { u.push(m); }); for (var d = 0; d < u.length; d++) this.delete(u[d]); } l = l.replace(/^\?/, ""); for (var h = l.split("&"), f, d = 0; d < h.length; d++) f = h[d].split("="), this.append( a(f[0]), f.length > 1 ? a(f[1]) : "" ); } }); }( typeof Wo < "u" ? Wo : typeof window < "u" ? window : typeof self < "u" ? self : Wo ), function(t) { var e = function() { try { var n = new t.URL("b", "http://a"); return n.pathname = "c d", n.href === "http://a/c%20d" && n.searchParams; } catch { return !1; } }, r = function() { var n = t.URL, a = function(c, l) { typeof c != "string" && (c = String(c)), l && typeof l != "string" && (l = String(l)); var u = document, d; if (l && (t.location === void 0 || l !== t.location.href)) { l = l.toLowerCase(), u = document.implementation.createHTMLDocument(""), d = u.createElement("base"), d.href = l, u.head.appendChild(d); try { if (d.href.indexOf(l) !== 0) throw new Error(d.href); } catch (x) { throw new Error("URL unable to set base " + l + " due to " + x); } } var h = u.createElement("a"); h.href = c, d && (u.body.appendChild(h), h.href = h.href); var f = u.createElement("input"); if (f.type = "url", f.value = c, h.protocol === ":" || !/:/.test(h.href) || !f.checkValidity() && !l) throw new TypeError("Invalid URL"); Object.defineProperty(this, "_anchorElement", { value: h }); var p = new t.URLSearchParams(this.search), m = !0, y = !0, g = this; ["append", "delete", "set"].forEach(function(x) { var w = p[x]; p[x] = function() { w.apply(p, arguments), m && (y = !1, g.search = p.toString(), y = !0); }; }), Object.defineProperty(this, "searchParams", { value: p, enumerable: !0 }); var v = void 0; Object.defineProperty(this, "_updateSearchParams", { enumerable: !1, configurable: !1, writable: !1, value: function() { this.search !== v && (v = this.search, y && (m = !1, this.searchParams._fromString(this.search), m = !0)); } }); }, o = a.prototype, s = function(c) { Object.defineProperty(o, c, { get: function() { return this._anchorElement[c]; }, set: function(l) { this._anchorElement[c] = l; }, enumerable: !0 }); }; ["hash", "host", "hostname", "port", "protocol"].forEach(function(c) { s(c); }), Object.defineProperty(o, "search", { get: function() { return this._anchorElement.search; }, set: function(c) { this._anchorElement.search = c, this._updateSearchParams(); }, enumerable: !0 }), Object.defineProperties(o, { toString: { get: function() { var c = this; return function() { return c.href; }; } }, href: { get: function() { return this._anchorElement.href.replace(/\?$/, ""); }, set: function(c) { this._anchorElement.href = c, this._updateSearchParams(); }, enumerable: !0 }, pathname: { get: function() { return this._anchorElement.pathname.replace(/(^\/?)/, "/"); }, set: function(c) { this._anchorElement.pathname = c; }, enumerable: !0 }, origin: { get: function() { var c = { "http:": 80, "https:": 443, "ftp:": 21 }[this._anchorElement.protocol], l = this._anchorElement.port != c && this._anchorElement.port !== ""; return this._anchorElement.protocol + "//" + this._anchorElement.hostname + (l ? ":" + this._anchorElement.port : ""); }, enumerable: !0 }, password: { // TODO get: function() { return ""; }, set: function(c) { }, enumerable: !0 }, username: { // TODO get: function() { return ""; }, set: function(c) { }, enumerable: !0 } }), a.createObjectURL = function(c) { return n.createObjectURL.apply(n, arguments); }, a.revokeObjectURL = function(c) { return n.revokeObjectURL.apply(n, arguments); }, t.URL = a; }; if (e() || r(), t.location !== void 0 && !("origin" in t.location)) { var i = function() { return t.location.protocol + "//" + t.location.hostname + (t.location.port ? ":" + t.location.port : ""); }; try { Object.defineProperty(t.location, "origin", { get: i, enumerable: !0 }); } catch { setInterval(function() { t.location.origin = i(); }, 100); } } }( typeof Wo < "u" ? Wo : typeof window < "u" ? window : typeof self < "u" ? self : Wo )), jae; } /** * @license * Copyright 2010-2021 Three.js Authors * SPDX-License-Identifier: MIT */ const Ax = "130", Gae = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 }, Wae = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 }, rP = 0, r1 = 1, iP = 2, qae = 3, Xae = 0, Lx = 1, nP = 2, Ic = 3, xs = 0, Or = 1, ws = 2, kx = 1, Zae = 2, Ja = 0, Hc = 1, i1 = 2, n1 = 3, a1 = 4, aP = 5, el = 100, oP = 101, sP = 102, o1 = 103, s1 = 104, lP = 200, cP = 201, uP = 202, dP = 203, Px = 204, Rx = 205, hP = 206, pP = 207, fP = 208, mP = 209, gP = 210, vP = 0, yP = 1, bP = 2, Qm = 3, xP = 4, wP = 5, _P = 6, SP = 7, mp = 0, MP = 1, EP = 2, ns = 0, TP = 1, CP = 2, AP = 3, LP = 4, kP = 5, nv = 300, gp = 301, vp = 302, eg = 303, tg = 304, ed = 306, yp = 307, _s = 1e3, ii = 1001, pu = 1002, Dr = 1003, kh = 1004, Yae = 1004, Ph = 1005, Kae = 1005, Cr = 1006, av = 1007, Jae = 1007, wo = 1008, Qae = 1008, Al = 1009, PP = 1010, RP = 1011, Rh = 1012, OP = 1013, eh = 1014, Wa = 1015, hl = 1016, DP = 1017, IP = 1018, NP = 1019, Gc = 1020, BP = 1021, Qa = 1022, sn = 1023, FP = 1024, zP = 1025, $P = sn, pl = 1026, fu = 1027, VP = 1028, UP = 1029, jP = 1030, HP = 1031, GP = 1032, WP = 1033, l1 = 33776, c1 = 33777, u1 = 33778, d1 = 33779, h1 = 35840, p1 = 35841, f1 = 35842, m1 = 35843, qP = 36196, g1 = 37492, v1 = 37496, XP = 37808, ZP = 37809, YP = 37810, KP = 37811, JP = 37812, QP = 37813, eR = 37814, tR = 37815, rR = 37816, iR = 37817, nR = 37818, aR = 37819, oR = 37820, sR = 37821, lR = 36492, cR = 37840, uR = 37841, dR = 37842, hR = 37843, pR = 37844, fR = 37845, mR = 37846, gR = 37847, vR = 37848, yR = 37849, bR = 37850, xR = 37851, wR = 37852, _R = 37853, SR = 2200, MR = 2201, ER = 2202, mu = 2300, Ll = 2301, xm = 2302, nl = 2400, al = 2401, Oh = 2402, ov = 2500, Ox = 2501, TR = 0, CR = 1, Dx = 2, Bi = 3e3, kl = 3001, sv = 3007, lv = 3002, AR = 3003, Ix = 3004, Nx = 3005, Bx = 3006, LR = 3200, kR = 3201, Rs = 0, PR = 1, eoe = 0, wm = 7680, toe = 7681, roe = 7682, ioe = 7683, noe = 34055, aoe = 34056, ooe = 5386, soe = 512, loe = 513, coe = 514, uoe = 515, doe = 516, hoe = 517, poe = 518, RR = 519, gu = 35044, vu = 35048, foe = 35040, moe = 35045, goe = 35049, voe = 35041, yoe = 35046, boe = 35050, xoe = 35042, woe = "100", y1 = "300 es"; class Os { addEventListener(e, r) { this._listeners === void 0 && (this._listeners = {}); const i = this._listeners; i[e] === void 0 && (i[e] = []), i[e].indexOf(r) === -1 && i[e].push(r); } hasEventListener(e, r) { if (this._listeners === void 0) return !1; const i = this._listeners; return i[e] !== void 0 && i[e].indexOf(r) !== -1; } removeEventListener(e, r) { if (this._listeners === void 0) return; const i = this._listeners[e]; if (i !== void 0) { const n = i.indexOf(r); n !== -1 && i.splice(n, 1); } } dispatchEvent(e) { if (this._listeners === void 0) return; const r = this._listeners[e.type]; if (r !== void 0) { e.target = this; const i = r.slice(0); for (let n = 0, a = i.length; n < a; n++) i[n].call(this, e); e.target = null; } } } const oi = []; for (let t = 0; t < 256; t++) oi[t] = (t < 16 ? "0" : "") + t.toString(16); let lf = 1234567; const fl = Math.PI / 180, Dh = 180 / Math.PI; function ln() { const t = Math.random() * 4294967295 | 0, e = Math.random() * 4294967295 | 0, r = Math.random() * 4294967295 | 0, i = Math.random() * 4294967295 | 0; return (oi[t & 255] + oi[t >> 8 & 255] + oi[t >> 16 & 255] + oi[t >> 24 & 255] + "-" + oi[e & 255] + oi[e >> 8 & 255] + "-" + oi[e >> 16 & 15 | 64] + oi[e >> 24 & 255] + "-" + oi[r & 63 | 128] + oi[r >> 8 & 255] + "-" + oi[r >> 16 & 255] + oi[r >> 24 & 255] + oi[i & 255] + oi[i >> 8 & 255] + oi[i >> 16 & 255] + oi[i >> 24 & 255]).toUpperCase(); } function ci(t, e, r) { return Math.max(e, Math.min(r, t)); } function Fx(t, e) { return (t % e + e) % e; } function _oe(t, e, r, i, n) { return i + (t - e) * (n - i) / (r - e); } function Soe(t, e, r) { return t !== e ? (r - t) / (e - t) : 0; } function th(t, e, r) { return (1 - r) * t + r * e; } function Moe(t, e, r, i) { return th(t, e, 1 - Math.exp(-r * i)); } function Eoe(t, e = 1) { return e - Math.abs(Fx(t, e * 2) - e); } function Toe(t, e, r) { return t <= e ? 0 : t >= r ? 1 : (t = (t - e) / (r - e), t * t * (3 - 2 * t)); } function Coe(t, e, r) { return t <= e ? 0 : t >= r ? 1 : (t = (t - e) / (r - e), t * t * t * (t * (t * 6 - 15) + 10)); } function Aoe(t, e) { return t + Math.floor(Math.random() * (e - t + 1)); } function Loe(t, e) { return t + Math.random() * (e - t); } function koe(t) { return t * (0.5 - Math.random()); } function Poe(t) { return t !== void 0 && (lf = t % 2147483647), lf = lf * 16807 % 2147483647, (lf - 1) / 2147483646; } function Roe(t) { return t * fl; } function Ooe(t) { return t * Dh; } function b1(t) { return (t & t - 1) === 0 && t !== 0; } function OR(t) { return Math.pow(2, Math.ceil(Math.log(t) / Math.LN2)); } function DR(t) { return Math.pow(2, Math.floor(Math.log(t) / Math.LN2)); } function Doe(t, e, r, i, n) { const a = Math.cos, o = Math.sin, s = a(r / 2), c = o(r / 2), l = a((e + i) / 2), u = o((e + i) / 2), d = a((e - i) / 2), h = o((e - i) / 2), f = a((i - e) / 2), p = o((i - e) / 2); switch (n) { case "XYX": t.set(s * u, c * d, c * h, s * l); break; case "YZY": t.set(c * h, s * u, c * d, s * l); break; case "ZXZ": t.set(c * d, c * h, s * u, s * l); break; case "XZX": t.set(s * u, c * p, c * f, s * l); break; case "YXY": t.set(c * f, s * u, c * p, s * l); break; case "ZYZ": t.set(c * p, c * f, s * u, s * l); break; default: console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: " + n); } } var x1 = /* @__PURE__ */ Object.freeze({ __proto__: null, DEG2RAD: fl, RAD2DEG: Dh, generateUUID: ln, clamp: ci, euclideanModulo: Fx, mapLinear: _oe, inverseLerp: Soe, lerp: th, damp: Moe, pingpong: Eoe, smoothstep: Toe, smootherstep: Coe, randInt: Aoe, randFloat: Loe, randFloatSpread: koe, seededRandom: Poe, degToRad: Roe, radToDeg: Ooe, isPowerOfTwo: b1, ceilPowerOfTwo: OR, floorPowerOfTwo: DR, setQuaternionFromProperEuler: Doe }); class je { constructor(e = 0, r = 0) { this.x = e, this.y = r; } get width() { return this.x; } set width(e) { this.x = e; } get height() { return this.y; } set height(e) { this.y = e; } set(e, r) { return this.x = e, this.y = r, this; } setScalar(e) { return this.x = e, this.y = e, this; } setX(e) { return this.x = e, this; } setY(e) { return this.y = e, this; } setComponent(e, r) { switch (e) { case 0: this.x = r; break; case 1: this.y = r; break; default: throw new Error("index is out of range: " + e); } return this; } getComponent(e) { switch (e) { case 0: return this.x; case 1: return this.y; default: throw new Error("index is out of range: " + e); } } clone() { return new this.constructor(this.x, this.y); } copy(e) { return this.x = e.x, this.y = e.y, this; } add(e, r) { return r !== void 0 ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(e, r)) : (this.x += e.x, this.y += e.y, this); } addScalar(e) { return this.x += e, this.y += e, this; } addVectors(e, r) { return this.x = e.x + r.x, this.y = e.y + r.y, this; } addScaledVector(e, r) { return this.x += e.x * r, this.y += e.y * r, this; } sub(e, r) { return r !== void 0 ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(e, r)) : (this.x -= e.x, this.y -= e.y, this); } subScalar(e) { return this.x -= e, this.y -= e, this; } subVectors(e, r) { return this.x = e.x - r.x, this.y = e.y - r.y, this; } multiply(e) { return this.x *= e.x, this.y *= e.y, this; } multiplyScalar(e) { return this.x *= e, this.y *= e, this; } divide(e) { return this.x /= e.x, this.y /= e.y, this; } divideScalar(e) { return this.multiplyScalar(1 / e); } applyMatrix3(e) { const r = this.x, i = this.y, n = e.elements; return this.x = n[0] * r + n[3] * i + n[6], this.y = n[1] * r + n[4] * i + n[7], this; } min(e) { return this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this; } max(e) { return this.x = Math.max(this.x, e.x), this.y = Math.max(this.y, e.y), this; } clamp(e, r) { return this.x = Math.max(e.x, Math.min(r.x, this.x)), this.y = Math.max(e.y, Math.min(r.y, this.y)), this; } clampScalar(e, r) { return this.x = Math.max(e, Math.min(r, this.x)), this.y = Math.max(e, Math.min(r, this.y)), this; } clampLength(e, r) { const i = this.length(); return this.divideScalar(i || 1).multiplyScalar(Math.max(e, Math.min(r, i))); } floor() { return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this; } ceil() { return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this; } round() { return this.x = Math.round(this.x), this.y = Math.round(this.y), this; } roundToZero() { return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x), this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y), this; } negate() { return this.x = -this.x, this.y = -this.y, this; } dot(e) { return this.x * e.x + this.y * e.y; } cross(e) { return this.x * e.y - this.y * e.x; } lengthSq() { return this.x * this.x + this.y * this.y; } length() { return Math.sqrt(this.x * this.x + this.y * this.y); } manhattanLength() { return Math.abs(this.x) + Math.abs(this.y); } normalize() { return this.divideScalar(this.length() || 1); } angle() { return Math.atan2(-this.y, -this.x) + Math.PI; } distanceTo(e) { return Math.sqrt(this.distanceToSquared(e)); } distanceToSquared(e) { const r = this.x - e.x, i = this.y - e.y; return r * r + i * i; } manhattanDistanceTo(e) { return Math.abs(this.x - e.x) + Math.abs(this.y - e.y); } setLength(e) { return this.normalize().multiplyScalar(e); } lerp(e, r) { return this.x += (e.x - this.x) * r, this.y += (e.y - this.y) * r, this; } lerpVectors(e, r, i) { return this.x = e.x + (r.x - e.x) * i, this.y = e.y + (r.y - e.y) * i, this; } equals(e) { return e.x === this.x && e.y === this.y; } fromArray(e, r = 0) { return this.x = e[r], this.y = e[r + 1], this; } toArray(e = [], r = 0) { return e[r] = this.x, e[r + 1] = this.y, e; } fromBufferAttribute(e, r, i) { return i !== void 0 && console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."), this.x = e.getX(r), this.y = e.getY(r), this; } rotateAround(e, r) { const i = Math.cos(r), n = Math.sin(r), a = this.x - e.x, o = this.y - e.y; return this.x = a * i - o * n + e.x, this.y = a * n + o * i + e.y, this; } random() { return this.x = Math.random(), this.y = Math.random(), this; } } je.prototype.isVector2 = !0; class Xr { constructor() { this.elements = [ 1, 0, 0, 0, 1, 0, 0, 0, 1 ], arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead."); } set(e, r, i, n, a, o, s, c, l) { const u = this.elements; return u[0] = e, u[1] = n, u[2] = s, u[3] = r, u[4] = a, u[5] = c, u[6] = i, u[7] = o, u[8] = l, this; } identity() { return this.set( 1, 0, 0, 0, 1, 0, 0, 0, 1 ), this; } copy(e) { const r = this.elements, i = e.elements; return r[0] = i[0], r[1] = i[1], r[2] = i[2], r[3] = i[3], r[4] = i[4], r[5] = i[5], r[6] = i[6], r[7] = i[7], r[8] = i[8], this; } extractBasis(e, r, i) { return e.setFromMatrix3Column(this, 0), r.setFromMatrix3Column(this, 1), i.setFromMatrix3Column(this, 2), this; } setFromMatrix4(e) { const r = e.elements; return this.set( r[0], r[4], r[8], r[1], r[5], r[9], r[2], r[6], r[10] ), this; } multiply(e) { return this.multiplyMatrices(this, e); } premultiply(e) { return this.multiplyMatrices(e, this); } multiplyMatrices(e, r) { const i = e.elements, n = r.elements, a = this.elements, o = i[0], s = i[3], c = i[6], l = i[1], u = i[4], d = i[7], h = i[2], f = i[5], p = i[8], m = n[0], y = n[3], g = n[6], v = n[1], x = n[4], w = n[7], S = n[2], _ = n[5], b = n[8]; return a[0] = o * m + s * v + c * S, a[3] = o * y + s * x + c * _, a[6] = o * g + s * w + c * b, a[1] = l * m + u * v + d * S, a[4] = l * y + u * x + d * _, a[7] = l * g + u * w + d * b, a[2] = h * m + f * v + p * S, a[5] = h * y + f * x + p * _, a[8] = h * g + f * w + p * b, this; } multiplyScalar(e) { const r = this.elements; return r[0] *= e, r[3] *= e, r[6] *= e, r[1] *= e, r[4] *= e, r[7] *= e, r[2] *= e, r[5] *= e, r[8] *= e, this; } determinant() { const e = this.elements, r = e[0], i = e[1], n = e[2], a = e[3], o = e[4], s = e[5], c = e[6], l = e[7], u = e[8]; return r * o * u - r * s * l - i * a * u + i * s * c + n * a * l - n * o * c; } invert() { const e = this.elements, r = e[0], i = e[1], n = e[2], a = e[3], o = e[4], s = e[5], c = e[6], l = e[7], u = e[8], d = u * o - s * l, h = s * c - u * a, f = l * a - o * c, p = r * d + i * h + n * f; if (p === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0); const m = 1 / p; return e[0] = d * m, e[1] = (n * l - u * i) * m, e[2] = (s * i - n * o) * m, e[3] = h * m, e[4] = (u * r - n * c) * m, e[5] = (n * a - s * r) * m, e[6] = f * m, e[7] = (i * c - l * r) * m, e[8] = (o * r - i * a) * m, this; } transpose() { let e; const r = this.elements; return e = r[1], r[1] = r[3], r[3] = e, e = r[2], r[2] = r[6], r[6] = e, e = r[5], r[5] = r[7], r[7] = e, this; } getNormalMatrix(e) { return this.setFromMatrix4(e).invert().transpose(); } transposeIntoArray(e) { const r = this.elements; return e[0] = r[0], e[1] = r[3], e[2] = r[6], e[3] = r[1], e[4] = r[4], e[5] = r[7], e[6] = r[2], e[7] = r[5], e[8] = r[8], this; } setUvTransform(e, r, i, n, a, o, s) { const c = Math.cos(a), l = Math.sin(a); return this.set( i * c, i * l, -i * (c * o + l * s) + o + e, -n * l, n * c, -n * (-l * o + c * s) + s + r, 0, 0, 1 ), this; } scale(e, r) { const i = this.elements; return i[0] *= e, i[3] *= e, i[6] *= e, i[1] *= r, i[4] *= r, i[7] *= r, this; } rotate(e) { const r = Math.cos(e), i = Math.sin(e), n = this.elements, a = n[0], o = n[3], s = n[6], c = n[1], l = n[4], u = n[7]; return n[0] = r * a + i * c, n[3] = r * o + i * l, n[6] = r * s + i * u, n[1] = -i * a + r * c, n[4] = -i * o + r * l, n[7] = -i * s + r * u, this; } translate(e, r) { const i = this.elements; return i[0] += e * i[2], i[3] += e * i[5], i[6] += e * i[8], i[1] += r * i[2], i[4] += r * i[5], i[7] += r * i[8], this; } equals(e) { const r = this.elements, i = e.elements; for (let n = 0; n < 9; n++) if (r[n] !== i[n]) return !1; return !0; } fromArray(e, r = 0) { for (let i = 0; i < 9; i++) this.elements[i] = e[i + r]; return this; } toArray(e = [], r = 0) { const i = this.elements; return e[r] = i[0], e[r + 1] = i[1], e[r + 2] = i[2], e[r + 3] = i[3], e[r + 4] = i[4], e[r + 5] = i[5], e[r + 6] = i[6], e[r + 7] = i[7], e[r + 8] = i[8], e; } clone() { return new this.constructor().fromArray(this.elements); } } Xr.prototype.isMatrix3 = !0; let lc; class Wl { static getDataURL(e) { if (/^data:/i.test(e.src) || typeof HTMLCanvasElement > "u") return e.src; let r; if (e instanceof HTMLCanvasElement) r = e; else { lc === void 0 && (lc = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas")), lc.width = e.width, lc.height = e.height; const i = lc.getContext("2d"); e instanceof ImageData ? i.putImageData(e, 0, 0) : i.drawImage(e, 0, 0, e.width, e.height), r = lc; } return r.width > 2048 || r.height > 2048 ? (console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons", e), r.toDataURL("image/jpeg", 0.6)) : r.toDataURL("image/png"); } } let Ioe = 0; class zr extends Os { constructor(e = zr.DEFAULT_IMAGE, r = zr.DEFAULT_MAPPING, i = ii, n = ii, a = Cr, o = wo, s = sn, c = Al, l = 1, u = Bi) { super(), Object.defineProperty(this, "id", { value: Ioe++ }), this.uuid = ln(), this.name = "", this.image = e, this.mipmaps = [], this.mapping = r, this.wrapS = i, this.wrapT = n, this.magFilter = a, this.minFilter = o, this.anisotropy = l, this.format = s, this.internalFormat = null, this.type = c, this.offset = new je(0, 0), this.repeat = new je(1, 1), this.center = new je(0, 0), this.rotation = 0, this.matrixAutoUpdate = !0, this.matrix = new Xr(), this.generateMipmaps = !0, this.premultiplyAlpha = !1, this.flipY = !0, this.unpackAlignment = 4, this.encoding = u, this.version = 0, this.onUpdate = null; } updateMatrix() { this.matrix.setUvTransform(this.offset.x, this.offset.y, this.repeat.x, this.repeat.y, this.rotation, this.center.x, this.center.y); } clone() { return new this.constructor().copy(this); } copy(e) { return this.name = e.name, this.image = e.image, this.mipmaps = e.mipmaps.slice(0), this.mapping = e.mapping, this.wrapS = e.wrapS, this.wrapT = e.wrapT, this.magFilter = e.magFilter, this.minFilter = e.minFilter, this.anisotropy = e.anisotropy, this.format = e.format, this.internalFormat = e.internalFormat, this.type = e.type, this.offset.copy(e.offset), this.repeat.copy(e.repeat), this.center.copy(e.center), this.rotation = e.rotation, this.matrixAutoUpdate = e.matrixAutoUpdate, this.matrix.copy(e.matrix), this.generateMipmaps = e.generateMipmaps, this.premultiplyAlpha = e.premultiplyAlpha, this.flipY = e.flipY, this.unpackAlignment = e.unpackAlignment, this.encoding = e.encoding, this; } toJSON(e) { const r = e === void 0 || typeof e == "string"; if (!r && e.textures[this.uuid] !== void 0) return e.textures[this.uuid]; const i = { metadata: { version: 4.5, type: "Texture", generator: "Texture.toJSON" }, uuid: this.uuid, name: this.name, mapping: this.mapping, repeat: [this.repeat.x, this.repeat.y], offset: [this.offset.x, this.offset.y], center: [this.center.x, this.center.y], rotation: this.rotation, wrap: [this.wrapS, this.wrapT], format: this.format, type: this.type, encoding: this.encoding, minFilter: this.minFilter, magFilter: this.magFilter, anisotropy: this.anisotropy, flipY: this.flipY, premultiplyAlpha: this.premultiplyAlpha, unpackAlignment: this.unpackAlignment }; if (this.image !== void 0) { const n = this.image; if (n.uuid === void 0 && (n.uuid = ln()), !r && e.images[n.uuid] === void 0) { let a; if (Array.isArray(n)) { a = []; for (let o = 0, s = n.length; o < s; o++) n[o].isDataTexture ? a.push(p0(n[o].image)) : a.push(p0(n[o])); } else a = p0(n); e.images[n.uuid] = { uuid: n.uuid, url: a }; } i.image = n.uuid; } return r || (e.textures[this.uuid] = i), i; } dispose() { this.dispatchEvent({ type: "dispose" }); } transformUv(e) { if (this.mapping !== nv) return e; if (e.applyMatrix3(this.matrix), e.x < 0 || e.x > 1) switch (this.wrapS) { case _s: e.x = e.x - Math.floor(e.x); break; case ii: e.x = e.x < 0 ? 0 : 1; break; case pu: Math.abs(Math.floor(e.x) % 2) === 1 ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x); break; } if (e.y < 0 || e.y > 1) switch (this.wrapT) { case _s: e.y = e.y - Math.floor(e.y); break; case ii: e.y = e.y < 0 ? 0 : 1; break; case pu: Math.abs(Math.floor(e.y) % 2) === 1 ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y); break; } return this.flipY && (e.y = 1 - e.y), e; } set needsUpdate(e) { e === !0 && this.version++; } } zr.DEFAULT_IMAGE = void 0; zr.DEFAULT_MAPPING = nv; zr.prototype.isTexture = !0; function p0(t) { return typeof HTMLImageElement < "u" && t instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && t instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && t instanceof ImageBitmap ? Wl.getDataURL(t) : t.data ? { data: Array.prototype.slice.call(t.data), width: t.width, height: t.height, type: t.data.constructor.name } : (console.warn("THREE.Texture: Unable to serialize Texture."), {}); } class Qt { constructor(e = 0, r = 0, i = 0, n = 1) { this.x = e, this.y = r, this.z = i, this.w = n; } get width() { return this.z; } set width(e) { this.z = e; } get height() { return this.w; } set height(e) { this.w = e; } set(e, r, i, n) { return this.x = e, this.y = r, this.z = i, this.w = n, this; } setScalar(e) { return this.x = e, this.y = e, this.z = e, this.w = e, this; } setX(e) { return this.x = e, this; } setY(e) { return this.y = e, this; } setZ(e) { return this.z = e, this; } setW(e) { return this.w = e, this; } setComponent(e, r) { switch (e) { case 0: this.x = r; break; case 1: this.y = r; break; case 2: this.z = r; break; case 3: this.w = r; break; default: throw new Error("index is out of range: " + e); } return this; } getComponent(e) { switch (e) { case 0: return this.x; case 1: return this.y; case 2: return this.z; case 3: return this.w; default: throw new Error("index is out of range: " + e); } } clone() { return new this.constructor(this.x, this.y, this.z, this.w); } copy(e) { return this.x = e.x, this.y = e.y, this.z = e.z, this.w = e.w !== void 0 ? e.w : 1, this; } add(e, r) { return r !== void 0 ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(e, r)) : (this.x += e.x, this.y += e.y, this.z += e.z, this.w += e.w, this); } addScalar(e) { return this.x += e, this.y += e, this.z += e, this.w += e, this; } addVectors(e, r) { return this.x = e.x + r.x, this.y = e.y + r.y, this.z = e.z + r.z, this.w = e.w + r.w, this; } addScaledVector(e, r) { return this.x += e.x * r, this.y += e.y * r, this.z += e.z * r, this.w += e.w * r, this; } sub(e, r) { return r !== void 0 ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(e, r)) : (this.x -= e.x, this.y -= e.y, this.z -= e.z, this.w -= e.w, this); } subScalar(e) { return this.x -= e, this.y -= e, this.z -= e, this.w -= e, this; } subVectors(e, r) { return this.x = e.x - r.x, this.y = e.y - r.y, this.z = e.z - r.z, this.w = e.w - r.w, this; } multiply(e) { return this.x *= e.x, this.y *= e.y, this.z *= e.z, this.w *= e.w, this; } multiplyScalar(e) { return this.x *= e, this.y *= e, this.z *= e, this.w *= e, this; } applyMatrix4(e) { const r = this.x, i = this.y, n = this.z, a = this.w, o = e.elements; return this.x = o[0] * r + o[4] * i + o[8] * n + o[12] * a, this.y = o[1] * r + o[5] * i + o[9] * n + o[13] * a, this.z = o[2] * r + o[6] * i + o[10] * n + o[14] * a, this.w = o[3] * r + o[7] * i + o[11] * n + o[15] * a, this; } divideScalar(e) { return this.multiplyScalar(1 / e); } setAxisAngleFromQuaternion(e) { this.w = 2 * Math.acos(e.w); const r = Math.sqrt(1 - e.w * e.w); return r < 1e-4 ? (this.x = 1, this.y = 0, this.z = 0) : (this.x = e.x / r, this.y = e.y / r, this.z = e.z / r), this; } setAxisAngleFromRotationMatrix(e) { let r, i, n, a; const o = e.elements, s = o[0], c = o[4], l = o[8], u = o[1], d = o[5], h = o[9], f = o[2], p = o[6], m = o[10]; if (Math.abs(c - u) < 0.01 && Math.abs(l - f) < 0.01 && Math.abs(h - p) < 0.01) { if (Math.abs(c + u) < 0.1 && Math.abs(l + f) < 0.1 && Math.abs(h + p) < 0.1 && Math.abs(s + d + m - 3) < 0.1) return this.set(1, 0, 0, 0), this; r = Math.PI; const g = (s + 1) / 2, v = (d + 1) / 2, x = (m + 1) / 2, w = (c + u) / 4, S = (l + f) / 4, _ = (h + p) / 4; return g > v && g > x ? g < 0.01 ? (i = 0, n = 0.707106781, a = 0.707106781) : (i = Math.sqrt(g), n = w / i, a = S / i) : v > x ? v < 0.01 ? (i = 0.707106781, n = 0, a = 0.707106781) : (n = Math.sqrt(v), i = w / n, a = _ / n) : x < 0.01 ? (i = 0.707106781, n = 0.707106781, a = 0) : (a = Math.sqrt(x), i = S / a, n = _ / a), this.set(i, n, a, r), this; } let y = Math.sqrt((p - h) * (p - h) + (l - f) * (l - f) + (u - c) * (u - c)); return Math.abs(y) < 1e-3 && (y = 1), this.x = (p - h) / y, this.y = (l - f) / y, this.z = (u - c) / y, this.w = Math.acos((s + d + m - 1) / 2), this; } min(e) { return this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this.z = Math.min(this.z, e.z), this.w = Math.min(this.w, e.w), this; } max(e) { return this.x = Math.max(this.x, e.x), this.y = Math.max(this.y, e.y), this.z = Math.max(this.z, e.z), this.w = Math.max(this.w, e.w), this; } clamp(e, r) { return this.x = Math.max(e.x, Math.min(r.x, this.x)), this.y = Math.max(e.y, Math.min(r.y, this.y)), this.z = Math.max(e.z, Math.min(r.z, this.z)), this.w = Math.max(e.w, Math.min(r.w, this.w)), this; } clampScalar(e, r) { return this.x = Math.max(e, Math.min(r, this.x)), this.y = Math.max(e, Math.min(r, this.y)), this.z = Math.max(e, Math.min(r, this.z)), this.w = Math.max(e, Math.min(r, this.w)), this; } clampLength(e, r) { const i = this.length(); return this.divideScalar(i || 1).multiplyScalar(Math.max(e, Math.min(r, i))); } floor() { return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this.w = Math.floor(this.w), this; } ceil() { return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this.w = Math.ceil(this.w), this; } round() { return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this.w = Math.round(this.w), this; } roundToZero() { return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x), this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y), this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z), this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w), this; } negate() { return this.x = -this.x, this.y = -this.y, this.z = -this.z, this.w = -this.w, this; } dot(e) { return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w; } lengthSq() { return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w; } length() { return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w); } manhattanLength() { return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w); } normalize() { return this.divideScalar(this.length() || 1); } setLength(e) { return this.normalize().multiplyScalar(e); } lerp(e, r) { return this.x += (e.x - this.x) * r, this.y += (e.y - this.y) * r, this.z += (e.z - this.z) * r, this.w += (e.w - this.w) * r, this; } lerpVectors(e, r, i) { return this.x = e.x + (r.x - e.x) * i, this.y = e.y + (r.y - e.y) * i, this.z = e.z + (r.z - e.z) * i, this.w = e.w + (r.w - e.w) * i, this; } equals(e) { return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w; } fromArray(e, r = 0) { return this.x = e[r], this.y = e[r + 1], this.z = e[r + 2], this.w = e[r + 3], this; } toArray(e = [], r = 0) { return e[r] = this.x, e[r + 1] = this.y, e[r + 2] = this.z, e[r + 3] = this.w, e; } fromBufferAttribute(e, r, i) { return i !== void 0 && console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."), this.x = e.getX(r), this.y = e.getY(r), this.z = e.getZ(r), this.w = e.getW(r), this; } random() { return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this.w = Math.random(), this; } } Qt.prototype.isVector4 = !0; class Hn extends Os { constructor(e, r, i = {}) { super(), this.width = e, this.height = r, this.depth = 1, this.scissor = new Qt(0, 0, e, r), this.scissorTest = !1, this.viewport = new Qt(0, 0, e, r), this.texture = new zr(void 0, i.mapping, i.wrapS, i.wrapT, i.magFilter, i.minFilter, i.format, i.type, i.anisotropy, i.encoding), this.texture.image = { width: e, height: r, depth: 1 }, this.texture.generateMipmaps = i.generateMipmaps !== void 0 ? i.generateMipmaps : !1, this.texture.minFilter = i.minFilter !== void 0 ? i.minFilter : Cr, this.depthBuffer = i.depthBuffer !== void 0 ? i.depthBuffer : !0, this.stencilBuffer = i.stencilBuffer !== void 0 ? i.stencilBuffer : !1, this.depthTexture = i.depthTexture !== void 0 ? i.depthTexture : null; } setTexture(e) { e.image = { width: this.width, height: this.height, depth: this.depth }, this.texture = e; } setSize(e, r, i = 1) { (this.width !== e || this.height !== r || this.depth !== i) && (this.width = e, this.height = r, this.depth = i, this.texture.image.width = e, this.texture.image.height = r, this.texture.image.depth = i, this.dispose()), this.viewport.set(0, 0, e, r), this.scissor.set(0, 0, e, r); } clone() { return new this.constructor().copy(this); } copy(e) { return this.width = e.width, this.height = e.height, this.depth = e.depth, this.viewport.copy(e.viewport), this.texture = e.texture.clone(), this.texture.image = { ...this.texture.image }, this.depthBuffer = e.depthBuffer, this.stencilBuffer = e.stencilBuffer, this.depthTexture = e.depthTexture, this; } dispose() { this.dispatchEvent({ type: "dispose" }); } } Hn.prototype.isWebGLRenderTarget = !0; class IR extends Hn { constructor(e, r, i) { super(e, r); const n = this.texture; this.texture = []; for (let a = 0; a < i; a++) this.texture[a] = n.clone(); } setSize(e, r, i = 1) { if (this.width !== e || this.height !== r || this.depth !== i) { this.width = e, this.height = r, this.depth = i; for (let n = 0, a = this.texture.length; n < a; n++) this.texture[n].image.width = e, this.texture[n].image.height = r, this.texture[n].image.depth = i; this.dispose(); } return this.viewport.set(0, 0, e, r), this.scissor.set(0, 0, e, r), this; } copy(e) { this.dispose(), this.width = e.width, this.height = e.height, this.depth = e.depth, this.viewport.set(0, 0, this.width, this.height), this.scissor.set(0, 0, this.width, this.height), this.depthBuffer = e.depthBuffer, this.stencilBuffer = e.stencilBuffer, this.depthTexture = e.depthTexture, this.texture.length = 0; for (let r = 0, i = e.texture.length; r < i; r++) this.texture[r] = e.texture[r].clone(); return this; } } IR.prototype.isWebGLMultipleRenderTargets = !0; class zx extends Hn { constructor(e, r, i) { super(e, r, i), this.samples = 4; } copy(e) { return super.copy.call(this, e), this.samples = e.samples, this; } } zx.prototype.isWebGLMultisampleRenderTarget = !0; class vi { constructor(e = 0, r = 0, i = 0, n = 1) { this._x = e, this._y = r, this._z = i, this._w = n; } static slerp(e, r, i, n) { return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."), i.slerpQuaternions(e, r, n); } static slerpFlat(e, r, i, n, a, o, s) { let c = i[n + 0], l = i[n + 1], u = i[n + 2], d = i[n + 3]; const h = a[o + 0], f = a[o + 1], p = a[o + 2], m = a[o + 3]; if (s === 0) { e[r + 0] = c, e[r + 1] = l, e[r + 2] = u, e[r + 3] = d; return; } if (s === 1) { e[r + 0] = h, e[r + 1] = f, e[r + 2] = p, e[r + 3] = m; return; } if (d !== m || c !== h || l !== f || u !== p) { let y = 1 - s; const g = c * h + l * f + u * p + d * m, v = g >= 0 ? 1 : -1, x = 1 - g * g; if (x > Number.EPSILON) { const S = Math.sqrt(x), _ = Math.atan2(S, g * v); y = Math.sin(y * _) / S, s = Math.sin(s * _) / S; } const w = s * v; if (c = c * y + h * w, l = l * y + f * w, u = u * y + p * w, d = d * y + m * w, y === 1 - s) { const S = 1 / Math.sqrt(c * c + l * l + u * u + d * d); c *= S, l *= S, u *= S, d *= S; } } e[r] = c, e[r + 1] = l, e[r + 2] = u, e[r + 3] = d; } static multiplyQuaternionsFlat(e, r, i, n, a, o) { const s = i[n], c = i[n + 1], l = i[n + 2], u = i[n + 3], d = a[o], h = a[o + 1], f = a[o + 2], p = a[o + 3]; return e[r] = s * p + u * d + c * f - l * h, e[r + 1] = c * p + u * h + l * d - s * f, e[r + 2] = l * p + u * f + s * h - c * d, e[r + 3] = u * p - s * d - c * h - l * f, e; } get x() { return this._x; } set x(e) { this._x = e, this._onChangeCallback(); } get y() { return this._y; } set y(e) { this._y = e, this._onChangeCallback(); } get z() { return this._z; } set z(e) { this._z = e, this._onChangeCallback(); } get w() { return this._w; } set w(e) { this._w = e, this._onChangeCallback(); } set(e, r, i, n) { return this._x = e, this._y = r, this._z = i, this._w = n, this._onChangeCallback(), this; } clone() { return new this.constructor(this._x, this._y, this._z, this._w); } copy(e) { return this._x = e.x, this._y = e.y, this._z = e.z, this._w = e.w, this._onChangeCallback(), this; } setFromEuler(e, r) { if (!(e && e.isEuler)) throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order."); const i = e._x, n = e._y, a = e._z, o = e._order, s = Math.cos, c = Math.sin, l = s(i / 2), u = s(n / 2), d = s(a / 2), h = c(i / 2), f = c(n / 2), p = c(a / 2); switch (o) { case "XYZ": this._x = h * u * d + l * f * p, this._y = l * f * d - h * u * p, this._z = l * u * p + h * f * d, this._w = l * u * d - h * f * p; break; case "YXZ": this._x = h * u * d + l * f * p, this._y = l * f * d - h * u * p, this._z = l * u * p - h * f * d, this._w = l * u * d + h * f * p; break; case "ZXY": this._x = h * u * d - l * f * p, this._y = l * f * d + h * u * p, this._z = l * u * p + h * f * d, this._w = l * u * d - h * f * p; break; case "ZYX": this._x = h * u * d - l * f * p, this._y = l * f * d + h * u * p, this._z = l * u * p - h * f * d, this._w = l * u * d + h * f * p; break; case "YZX": this._x = h * u * d + l * f * p, this._y = l * f * d + h * u * p, this._z = l * u * p - h * f * d, this._w = l * u * d - h * f * p; break; case "XZY": this._x = h * u * d - l * f * p, this._y = l * f * d - h * u * p, this._z = l * u * p + h * f * d, this._w = l * u * d + h * f * p; break; default: console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + o); } return r !== !1 && this._onChangeCallback(), this; } setFromAxisAngle(e, r) { const i = r / 2, n = Math.sin(i); return this._x = e.x * n, this._y = e.y * n, this._z = e.z * n, this._w = Math.cos(i), this._onChangeCallback(), this; } setFromRotationMatrix(e) { const r = e.elements, i = r[0], n = r[4], a = r[8], o = r[1], s = r[5], c = r[9], l = r[2], u = r[6], d = r[10], h = i + s + d; if (h > 0) { const f = 0.5 / Math.sqrt(h + 1); this._w = 0.25 / f, this._x = (u - c) * f, this._y = (a - l) * f, this._z = (o - n) * f; } else if (i > s && i > d) { const f = 2 * Math.sqrt(1 + i - s - d); this._w = (u - c) / f, this._x = 0.25 * f, this._y = (n + o) / f, this._z = (a + l) / f; } else if (s > d) { const f = 2 * Math.sqrt(1 + s - i - d); this._w = (a - l) / f, this._x = (n + o) / f, this._y = 0.25 * f, this._z = (c + u) / f; } else { const f = 2 * Math.sqrt(1 + d - i - s); this._w = (o - n) / f, this._x = (a + l) / f, this._y = (c + u) / f, this._z = 0.25 * f; } return this._onChangeCallback(), this; } setFromUnitVectors(e, r) { let i = e.dot(r) + 1; return i < Number.EPSILON ? (i = 0, Math.abs(e.x) > Math.abs(e.z) ? (this._x = -e.y, this._y = e.x, this._z = 0, this._w = i) : (this._x = 0, this._y = -e.z, this._z = e.y, this._w = i)) : (this._x = e.y * r.z - e.z * r.y, this._y = e.z * r.x - e.x * r.z, this._z = e.x * r.y - e.y * r.x, this._w = i), this.normalize(); } angleTo(e) { return 2 * Math.acos(Math.abs(ci(this.dot(e), -1, 1))); } rotateTowards(e, r) { const i = this.angleTo(e); if (i === 0) return this; const n = Math.min(1, r / i); return this.slerp(e, n), this; } identity() { return this.set(0, 0, 0, 1); } invert() { return this.conjugate(); } conjugate() { return this._x *= -1, this._y *= -1, this._z *= -1, this._onChangeCallback(), this; } dot(e) { return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w; } lengthSq() { return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w; } length() { return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w); } normalize() { let e = this.length(); return e === 0 ? (this._x = 0, this._y = 0, this._z = 0, this._w = 1) : (e = 1 / e, this._x = this._x * e, this._y = this._y * e, this._z = this._z * e, this._w = this._w * e), this._onChangeCallback(), this; } multiply(e, r) { return r !== void 0 ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."), this.multiplyQuaternions(e, r)) : this.multiplyQuaternions(this, e); } premultiply(e) { return this.multiplyQuaternions(e, this); } multiplyQuaternions(e, r) { const i = e._x, n = e._y, a = e._z, o = e._w, s = r._x, c = r._y, l = r._z, u = r._w; return this._x = i * u + o * s + n * l - a * c, this._y = n * u + o * c + a * s - i * l, this._z = a * u + o * l + i * c - n * s, this._w = o * u - i * s - n * c - a * l, this._onChangeCallback(), this; } slerp(e, r) { if (r === 0) return this; if (r === 1) return this.copy(e); const i = this._x, n = this._y, a = this._z, o = this._w; let s = o * e._w + i * e._x + n * e._y + a * e._z; if (s < 0 ? (this._w = -e._w, this._x = -e._x, this._y = -e._y, this._z = -e._z, s = -s) : this.copy(e), s >= 1) return this._w = o, this._x = i, this._y = n, this._z = a, this; const c = 1 - s * s; if (c <= Number.EPSILON) { const f = 1 - r; return this._w = f * o + r * this._w, this._x = f * i + r * this._x, this._y = f * n + r * this._y, this._z = f * a + r * this._z, this.normalize(), this._onChangeCallback(), this; } const l = Math.sqrt(c), u = Math.atan2(l, s), d = Math.sin((1 - r) * u) / l, h = Math.sin(r * u) / l; return this._w = o * d + this._w * h, this._x = i * d + this._x * h, this._y = n * d + this._y * h, this._z = a * d + this._z * h, this._onChangeCallback(), this; } slerpQuaternions(e, r, i) { this.copy(e).slerp(r, i); } equals(e) { return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w; } fromArray(e, r = 0) { return this._x = e[r], this._y = e[r + 1], this._z = e[r + 2], this._w = e[r + 3], this._onChangeCallback(), this; } toArray(e = [], r = 0) { return e[r] = this._x, e[r + 1] = this._y, e[r + 2] = this._z, e[r + 3] = this._w, e; } fromBufferAttribute(e, r) { return this._x = e.getX(r), this._y = e.getY(r), this._z = e.getZ(r), this._w = e.getW(r), this; } _onChange(e) { return this._onChangeCallback = e, this; } _onChangeCallback() { } } vi.prototype.isQuaternion = !0; class de { constructor(e = 0, r = 0, i = 0) { this.x = e, this.y = r, this.z = i; } set(e, r, i) { return i === void 0 && (i = this.z), this.x = e, this.y = r, this.z = i, this; } setScalar(e) { return this.x = e, this.y = e, this.z = e, this; } setX(e) { return this.x = e, this; } setY(e) { return this.y = e, this; } setZ(e) { return this.z = e, this; } setComponent(e, r) { switch (e) { case 0: this.x = r; break; case 1: this.y = r; break; case 2: this.z = r; break; default: throw new Error("index is out of range: " + e); } return this; } getComponent(e) { switch (e) { case 0: return this.x; case 1: return this.y; case 2: return this.z; default: throw new Error("index is out of range: " + e); } } clone() { return new this.constructor(this.x, this.y, this.z); } copy(e) { return this.x = e.x, this.y = e.y, this.z = e.z, this; } add(e, r) { return r !== void 0 ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(e, r)) : (this.x += e.x, this.y += e.y, this.z += e.z, this); } addScalar(e) { return this.x += e, this.y += e, this.z += e, this; } addVectors(e, r) { return this.x = e.x + r.x, this.y = e.y + r.y, this.z = e.z + r.z, this; } addScaledVector(e, r) { return this.x += e.x * r, this.y += e.y * r, this.z += e.z * r, this; } sub(e, r) { return r !== void 0 ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(e, r)) : (this.x -= e.x, this.y -= e.y, this.z -= e.z, this); } subScalar(e) { return this.x -= e, this.y -= e, this.z -= e, this; } subVectors(e, r) { return this.x = e.x - r.x, this.y = e.y - r.y, this.z = e.z - r.z, this; } multiply(e, r) { return r !== void 0 ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."), this.multiplyVectors(e, r)) : (this.x *= e.x, this.y *= e.y, this.z *= e.z, this); } multiplyScalar(e) { return this.x *= e, this.y *= e, this.z *= e, this; } multiplyVectors(e, r) { return this.x = e.x * r.x, this.y = e.y * r.y, this.z = e.z * r.z, this; } applyEuler(e) { return e && e.isEuler || console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."), this.applyQuaternion(IM.setFromEuler(e)); } applyAxisAngle(e, r) { return this.applyQuaternion(IM.setFromAxisAngle(e, r)); } applyMatrix3(e) { const r = this.x, i = this.y, n = this.z, a = e.elements; return this.x = a[0] * r + a[3] * i + a[6] * n, this.y = a[1] * r + a[4] * i + a[7] * n, this.z = a[2] * r + a[5] * i + a[8] * n, this; } applyNormalMatrix(e) { return this.applyMatrix3(e).normalize(); } applyMatrix4(e) { const r = this.x, i = this.y, n = this.z, a = e.elements, o = 1 / (a[3] * r + a[7] * i + a[11] * n + a[15]); return this.x = (a[0] * r + a[4] * i + a[8] * n + a[12]) * o, this.y = (a[1] * r + a[5] * i + a[9] * n + a[13]) * o, this.z = (a[2] * r + a[6] * i + a[10] * n + a[14]) * o, this; } applyQuaternion(e) { const r = this.x, i = this.y, n = this.z, a = e.x, o = e.y, s = e.z, c = e.w, l = c * r + o * n - s * i, u = c * i + s * r - a * n, d = c * n + a * i - o * r, h = -a * r - o * i - s * n; return this.x = l * c + h * -a + u * -s - d * -o, this.y = u * c + h * -o + d * -a - l * -s, this.z = d * c + h * -s + l * -o - u * -a, this; } project(e) { return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix); } unproject(e) { return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld); } transformDirection(e) { const r = this.x, i = this.y, n = this.z, a = e.elements; return this.x = a[0] * r + a[4] * i + a[8] * n, this.y = a[1] * r + a[5] * i + a[9] * n, this.z = a[2] * r + a[6] * i + a[10] * n, this.normalize(); } divide(e) { return this.x /= e.x, this.y /= e.y, this.z /= e.z, this; } divideScalar(e) { return this.multiplyScalar(1 / e); } min(e) { return this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this.z = Math.min(this.z, e.z), this; } max(e) { return this.x = Math.max(this.x, e.x), this.y = Math.max(this.y, e.y), this.z = Math.max(this.z, e.z), this; } clamp(e, r) { return this.x = Math.max(e.x, Math.min(r.x, this.x)), this.y = Math.max(e.y, Math.min(r.y, this.y)), this.z = Math.max(e.z, Math.min(r.z, this.z)), this; } clampScalar(e, r) { return this.x = Math.max(e, Math.min(r, this.x)), this.y = Math.max(e, Math.min(r, this.y)), this.z = Math.max(e, Math.min(r, this.z)), this; } clampLength(e, r) { const i = this.length(); return this.divideScalar(i || 1).multiplyScalar(Math.max(e, Math.min(r, i))); } floor() { return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this; } ceil() { return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this; } round() { return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this; } roundToZero() { return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x), this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y), this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z), this; } negate() { return this.x = -this.x, this.y = -this.y, this.z = -this.z, this; } dot(e) { return this.x * e.x + this.y * e.y + this.z * e.z; } // TODO lengthSquared? lengthSq() { return this.x * this.x + this.y * this.y + this.z * this.z; } length() { return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); } manhattanLength() { return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z); } normalize() { return this.divideScalar(this.length() || 1); } setLength(e) { return this.normalize().multiplyScalar(e); } lerp(e, r) { return this.x += (e.x - this.x) * r, this.y += (e.y - this.y) * r, this.z += (e.z - this.z) * r, this; } lerpVectors(e, r, i) { return this.x = e.x + (r.x - e.x) * i, this.y = e.y + (r.y - e.y) * i, this.z = e.z + (r.z - e.z) * i, this; } cross(e, r) { return r !== void 0 ? (console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."), this.crossVectors(e, r)) : this.crossVectors(this, e); } crossVectors(e, r) { const i = e.x, n = e.y, a = e.z, o = r.x, s = r.y, c = r.z; return this.x = n * c - a * s, this.y = a * o - i * c, this.z = i * s - n * o, this; } projectOnVector(e) { const r = e.lengthSq(); if (r === 0) return this.set(0, 0, 0); const i = e.dot(this) / r; return this.copy(e).multiplyScalar(i); } projectOnPlane(e) { return f0.copy(this).projectOnVector(e), this.sub(f0); } reflect(e) { return this.sub(f0.copy(e).multiplyScalar(2 * this.dot(e))); } angleTo(e) { const r = Math.sqrt(this.lengthSq() * e.lengthSq()); if (r === 0) return Math.PI / 2; const i = this.dot(e) / r; return Math.acos(ci(i, -1, 1)); } distanceTo(e) { return Math.sqrt(this.distanceToSquared(e)); } distanceToSquared(e) { const r = this.x - e.x, i = this.y - e.y, n = this.z - e.z; return r * r + i * i + n * n; } manhattanDistanceTo(e) { return Math.abs(this.x - e.x) + Math.abs(this.y - e.y) + Math.abs(this.z - e.z); } setFromSpherical(e) { return this.setFromSphericalCoords(e.radius, e.phi, e.theta); } setFromSphericalCoords(e, r, i) { const n = Math.sin(r) * e; return this.x = n * Math.sin(i), this.y = Math.cos(r) * e, this.z = n * Math.cos(i), this; } setFromCylindrical(e) { return this.setFromCylindricalCoords(e.radius, e.theta, e.y); } setFromCylindricalCoords(e, r, i) { return this.x = e * Math.sin(r), this.y = i, this.z = e * Math.cos(r), this; } setFromMatrixPosition(e) { const r = e.elements; return this.x = r[12], this.y = r[13], this.z = r[14], this; } setFromMatrixScale(e) { const r = this.setFromMatrixColumn(e, 0).length(), i = this.setFromMatrixColumn(e, 1).length(), n = this.setFromMatrixColumn(e, 2).length(); return this.x = r, this.y = i, this.z = n, this; } setFromMatrixColumn(e, r) { return this.fromArray(e.elements, r * 4); } setFromMatrix3Column(e, r) { return this.fromArray(e.elements, r * 3); } equals(e) { return e.x === this.x && e.y === this.y && e.z === this.z; } fromArray(e, r = 0) { return this.x = e[r], this.y = e[r + 1], this.z = e[r + 2], this; } toArray(e = [], r = 0) { return e[r] = this.x, e[r + 1] = this.y, e[r + 2] = this.z, e; } fromBufferAttribute(e, r, i) { return i !== void 0 && console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."), this.x = e.getX(r), this.y = e.getY(r), this.z = e.getZ(r), this; } random() { return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this; } } de.prototype.isVector3 = !0; const f0 = /* @__PURE__ */ new de(), IM = /* @__PURE__ */ new vi(); class Ki { constructor(e = new de(1 / 0, 1 / 0, 1 / 0), r = new de(-1 / 0, -1 / 0, -1 / 0)) { this.min = e, this.max = r; } set(e, r) { return this.min.copy(e), this.max.copy(r), this; } setFromArray(e) { let r = 1 / 0, i = 1 / 0, n = 1 / 0, a = -1 / 0, o = -1 / 0, s = -1 / 0; for (let c = 0, l = e.length; c < l; c += 3) { const u = e[c], d = e[c + 1], h = e[c + 2]; u < r && (r = u), d < i && (i = d), h < n && (n = h), u > a && (a = u), d > o && (o = d), h > s && (s = h); } return this.min.set(r, i, n), this.max.set(a, o, s), this; } setFromBufferAttribute(e) { let r = 1 / 0, i = 1 / 0, n = 1 / 0, a = -1 / 0, o = -1 / 0, s = -1 / 0; for (let c = 0, l = e.count; c < l; c++) { const u = e.getX(c), d = e.getY(c), h = e.getZ(c); u < r && (r = u), d < i && (i = d), h < n && (n = h), u > a && (a = u), d > o && (o = d), h > s && (s = h); } return this.min.set(r, i, n), this.max.set(a, o, s), this; } setFromPoints(e) { this.makeEmpty(); for (let r = 0, i = e.length; r < i; r++) this.expandByPoint(e[r]); return this; } setFromCenterAndSize(e, r) { const i = xd.copy(r).multiplyScalar(0.5); return this.min.copy(e).sub(i), this.max.copy(e).add(i), this; } setFromObject(e) { return this.makeEmpty(), this.expandByObject(e); } clone() { return new this.constructor().copy(this); } copy(e) { return this.min.copy(e.min), this.max.copy(e.max), this; } makeEmpty() { return this.min.x = this.min.y = this.min.z = 1 / 0, this.max.x = this.max.y = this.max.z = -1 / 0, this; } isEmpty() { return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z; } getCenter(e) { return this.isEmpty() ? e.set(0, 0, 0) : e.addVectors(this.min, this.max).multiplyScalar(0.5); } getSize(e) { return this.isEmpty() ? e.set(0, 0, 0) : e.subVectors(this.max, this.min); } expandByPoint(e) { return this.min.min(e), this.max.max(e), this; } expandByVector(e) { return this.min.sub(e), this.max.add(e), this; } expandByScalar(e) { return this.min.addScalar(-e), this.max.addScalar(e), this; } expandByObject(e) { e.updateWorldMatrix(!1, !1); const r = e.geometry; r !== void 0 && (r.boundingBox === null && r.computeBoundingBox(), m0.copy(r.boundingBox), m0.applyMatrix4(e.matrixWorld), this.union(m0)); const i = e.children; for (let n = 0, a = i.length; n < a; n++) this.expandByObject(i[n]); return this; } containsPoint(e) { return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y || e.z < this.min.z || e.z > this.max.z); } containsBox(e) { return this.min.x <= e.min.x && e.max.x <= this.max.x && this.min.y <= e.min.y && e.max.y <= this.max.y && this.min.z <= e.min.z && e.max.z <= this.max.z; } getParameter(e, r) { return r.set( (e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y), (e.z - this.min.z) / (this.max.z - this.min.z) ); } intersectsBox(e) { return !(e.max.x < this.min.x || e.min.x > this.max.x || e.max.y < this.min.y || e.min.y > this.max.y || e.max.z < this.min.z || e.min.z > this.max.z); } intersectsSphere(e) { return this.clampPoint(e.center, xd), xd.distanceToSquared(e.center) <= e.radius * e.radius; } intersectsPlane(e) { let r, i; return e.normal.x > 0 ? (r = e.normal.x * this.min.x, i = e.normal.x * this.max.x) : (r = e.normal.x * this.max.x, i = e.normal.x * this.min.x), e.normal.y > 0 ? (r += e.normal.y * this.min.y, i += e.normal.y * this.max.y) : (r += e.normal.y * this.max.y, i += e.normal.y * this.min.y), e.normal.z > 0 ? (r += e.normal.z * this.min.z, i += e.normal.z * this.max.z) : (r += e.normal.z * this.max.z, i += e.normal.z * this.min.z), r <= -e.constant && i >= -e.constant; } intersectsTriangle(e) { if (this.isEmpty()) return !1; this.getCenter(wd), cf.subVectors(this.max, wd), cc.subVectors(e.a, wd), uc.subVectors(e.b, wd), dc.subVectors(e.c, wd), ko.subVectors(uc, cc), Po.subVectors(dc, uc), Vs.subVectors(cc, dc); let r = [ 0, -ko.z, ko.y, 0, -Po.z, Po.y, 0, -Vs.z, Vs.y, ko.z, 0, -ko.x, Po.z, 0, -Po.x, Vs.z, 0, -Vs.x, -ko.y, ko.x, 0, -Po.y, Po.x, 0, -Vs.y, Vs.x, 0 ]; return !g0(r, cc, uc, dc, cf) || (r = [1, 0, 0, 0, 1, 0, 0, 0, 1], !g0(r, cc, uc, dc, cf)) ? !1 : (uf.crossVectors(ko, Po), r = [uf.x, uf.y, uf.z], g0(r, cc, uc, dc, cf)); } clampPoint(e, r) { return r.copy(e).clamp(this.min, this.max); } distanceToPoint(e) { return xd.copy(e).clamp(this.min, this.max).sub(e).length(); } getBoundingSphere(e) { return this.getCenter(e.center), e.radius = this.getSize(xd).length() * 0.5, e; } intersect(e) { return this.min.max(e.min), this.max.min(e.max), this.isEmpty() && this.makeEmpty(), this; } union(e) { return this.min.min(e.min), this.max.max(e.max), this; } applyMatrix4(e) { return this.isEmpty() ? this : (Oa[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e), Oa[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e), Oa[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e), Oa[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e), Oa[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e), Oa[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e), Oa[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e), Oa[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e), this.setFromPoints(Oa), this); } translate(e) { return this.min.add(e), this.max.add(e), this; } equals(e) { return e.min.equals(this.min) && e.max.equals(this.max); } } Ki.prototype.isBox3 = !0; const Oa = [ /* @__PURE__ */ new de(), /* @__PURE__ */ new de(), /* @__PURE__ */ new de(), /* @__PURE__ */ new de(), /* @__PURE__ */ new de(), /* @__PURE__ */ new de(), /* @__PURE__ */ new de(), /* @__PURE__ */ new de() ], xd = /* @__PURE__ */ new de(), m0 = /* @__PURE__ */ new Ki(), cc = /* @__PURE__ */ new de(), uc = /* @__PURE__ */ new de(), dc = /* @__PURE__ */ new de(), ko = /* @__PURE__ */ new de(), Po = /* @__PURE__ */ new de(), Vs = /* @__PURE__ */ new de(), wd = /* @__PURE__ */ new de(), cf = /* @__PURE__ */ new de(), uf = /* @__PURE__ */ new de(), Us = /* @__PURE__ */ new de(); function g0(t, e, r, i, n) { for (let a = 0, o = t.length - 3; a <= o; a += 3) { Us.fromArray(t, a); const s = n.x * Math.abs(Us.x) + n.y * Math.abs(Us.y) + n.z * Math.abs(Us.z), c = e.dot(Us), l = r.dot(Us), u = i.dot(Us); if (Math.max(-Math.max(c, l, u), Math.min(c, l, u)) > s) return !1; } return !0; } const Noe = /* @__PURE__ */ new Ki(), NM = /* @__PURE__ */ new de(), v0 = /* @__PURE__ */ new de(), y0 = /* @__PURE__ */ new de(); class _o { constructor(e = new de(), r = -1) { this.center = e, this.radius = r; } set(e, r) { return this.center.copy(e), this.radius = r, this; } setFromPoints(e, r) { const i = this.center; r !== void 0 ? i.copy(r) : Noe.setFromPoints(e).getCenter(i); let n = 0; for (let a = 0, o = e.length; a < o; a++) n = Math.max(n, i.distanceToSquared(e[a])); return this.radius = Math.sqrt(n), this; } copy(e) { return this.center.copy(e.center), this.radius = e.radius, this; } isEmpty() { return this.radius < 0; } makeEmpty() { return this.center.set(0, 0, 0), this.radius = -1, this; } containsPoint(e) { return e.distanceToSquared(this.center) <= this.radius * this.radius; } distanceToPoint(e) { return e.distanceTo(this.center) - this.radius; } intersectsSphere(e) { const r = this.radius + e.radius; return e.center.distanceToSquared(this.center) <= r * r; } intersectsBox(e) { return e.intersectsSphere(this); } intersectsPlane(e) { return Math.abs(e.distanceToPoint(this.center)) <= this.radius; } clampPoint(e, r) { const i = this.center.distanceToSquared(e); return r.copy(e), i > this.radius * this.radius && (r.sub(this.center).normalize(), r.multiplyScalar(this.radius).add(this.center)), r; } getBoundingBox(e) { return this.isEmpty() ? (e.makeEmpty(), e) : (e.set(this.center, this.center), e.expandByScalar(this.radius), e); } applyMatrix4(e) { return this.center.applyMatrix4(e), this.radius = this.radius * e.getMaxScaleOnAxis(), this; } translate(e) { return this.center.add(e), this; } expandByPoint(e) { y0.subVectors(e, this.center); const r = y0.lengthSq(); if (r > this.radius * this.radius) { const i = Math.sqrt(r), n = (i - this.radius) * 0.5; this.center.add(y0.multiplyScalar(n / i)), this.radius += n; } return this; } union(e) { return v0.subVectors(e.center, this.center).normalize().multiplyScalar(e.radius), this.expandByPoint(NM.copy(e.center).add(v0)), this.expandByPoint(NM.copy(e.center).sub(v0)), this; } equals(e) { return e.center.equals(this.center) && e.radius === this.radius; } clone() { return new this.constructor().copy(this); } } const Da = /* @__PURE__ */ new de(), b0 = /* @__PURE__ */ new de(), df = /* @__PURE__ */ new de(), Ro = /* @__PURE__ */ new de(), x0 = /* @__PURE__ */ new de(), hf = /* @__PURE__ */ new de(), w0 = /* @__PURE__ */ new de(); class Ds { constructor(e = new de(), r = new de(0, 0, -1)) { this.origin = e, this.direction = r; } set(e, r) { return this.origin.copy(e), this.direction.copy(r), this; } copy(e) { return this.origin.copy(e.origin), this.direction.copy(e.direction), this; } at(e, r) { return r.copy(this.direction).multiplyScalar(e).add(this.origin); } lookAt(e) { return this.direction.copy(e).sub(this.origin).normalize(), this; } recast(e) { return this.origin.copy(this.at(e, Da)), this; } closestPointToPoint(e, r) { r.subVectors(e, this.origin); const i = r.dot(this.direction); return i < 0 ? r.copy(this.origin) : r.copy(this.direction).multiplyScalar(i).add(this.origin); } distanceToPoint(e) { return Math.sqrt(this.distanceSqToPoint(e)); } distanceSqToPoint(e) { const r = Da.subVectors(e, this.origin).dot(this.direction); return r < 0 ? this.origin.distanceToSquared(e) : (Da.copy(this.direction).multiplyScalar(r).add(this.origin), Da.distanceToSquared(e)); } distanceSqToSegment(e, r, i, n) { b0.copy(e).add(r).multiplyScalar(0.5), df.copy(r).sub(e).normalize(), Ro.copy(this.origin).sub(b0); const a = e.distanceTo(r) * 0.5, o = -this.direction.dot(df), s = Ro.dot(this.direction), c = -Ro.dot(df), l = Ro.lengthSq(), u = Math.abs(1 - o * o); let d, h, f, p; if (u > 0) if (d = o * c - s, h = o * s - c, p = a * u, d >= 0) if (h >= -p) if (h <= p) { const m = 1 / u; d *= m, h *= m, f = d * (d + o * h + 2 * s) + h * (o * d + h + 2 * c) + l; } else h = a, d = Math.max(0, -(o * h + s)), f = -d * d + h * (h + 2 * c) + l; else h = -a, d = Math.max(0, -(o * h + s)), f = -d * d + h * (h + 2 * c) + l; else h <= -p ? (d = Math.max(0, -(-o * a + s)), h = d > 0 ? -a : Math.min(Math.max(-a, -c), a), f = -d * d + h * (h + 2 * c) + l) : h <= p ? (d = 0, h = Math.min(Math.max(-a, -c), a), f = h * (h + 2 * c) + l) : (d = Math.max(0, -(o * a + s)), h = d > 0 ? a : Math.min(Math.max(-a, -c), a), f = -d * d + h * (h + 2 * c) + l); else h = o > 0 ? -a : a, d = Math.max(0, -(o * h + s)), f = -d * d + h * (h + 2 * c) + l; return i && i.copy(this.direction).multiplyScalar(d).add(this.origin), n && n.copy(df).multiplyScalar(h).add(b0), f; } intersectSphere(e, r) { Da.subVectors(e.center, this.origin); const i = Da.dot(this.direction), n = Da.dot(Da) - i * i, a = e.radius * e.radius; if (n > a) return null; const o = Math.sqrt(a - n), s = i - o, c = i + o; return s < 0 && c < 0 ? null : s < 0 ? this.at(c, r) : this.at(s, r); } intersectsSphere(e) { return this.distanceSqToPoint(e.center) <= e.radius * e.radius; } distanceToPlane(e) { const r = e.normal.dot(this.direction); if (r === 0) return e.distanceToPoint(this.origin) === 0 ? 0 : null; const i = -(this.origin.dot(e.normal) + e.constant) / r; return i >= 0 ? i : null; } intersectPlane(e, r) { const i = this.distanceToPlane(e); return i === null ? null : this.at(i, r); } intersectsPlane(e) { const r = e.distanceToPoint(this.origin); return r === 0 || e.normal.dot(this.direction) * r < 0; } intersectBox(e, r) { let i, n, a, o, s, c; const l = 1 / this.direction.x, u = 1 / this.direction.y, d = 1 / this.direction.z, h = this.origin; return l >= 0 ? (i = (e.min.x - h.x) * l, n = (e.max.x - h.x) * l) : (i = (e.max.x - h.x) * l, n = (e.min.x - h.x) * l), u >= 0 ? (a = (e.min.y - h.y) * u, o = (e.max.y - h.y) * u) : (a = (e.max.y - h.y) * u, o = (e.min.y - h.y) * u), i > o || a > n || ((a > i || i !== i) && (i = a), (o < n || n !== n) && (n = o), d >= 0 ? (s = (e.min.z - h.z) * d, c = (e.max.z - h.z) * d) : (s = (e.max.z - h.z) * d, c = (e.min.z - h.z) * d), i > c || s > n) || ((s > i || i !== i) && (i = s), (c < n || n !== n) && (n = c), n < 0) ? null : this.at(i >= 0 ? i : n, r); } intersectsBox(e) { return this.intersectBox(e, Da) !== null; } intersectTriangle(e, r, i, n, a) { x0.subVectors(r, e), hf.subVectors(i, e), w0.crossVectors(x0, hf); let o = this.direction.dot(w0), s; if (o > 0) { if (n) return null; s = 1; } else if (o < 0) s = -1, o = -o; else return null; Ro.subVectors(this.origin, e); const c = s * this.direction.dot(hf.crossVectors(Ro, hf)); if (c < 0) return null; const l = s * this.direction.dot(x0.cross(Ro)); if (l < 0 || c + l > o) return null; const u = -s * Ro.dot(w0); return u < 0 ? null : this.at(u / o, a); } applyMatrix4(e) { return this.origin.applyMatrix4(e), this.direction.transformDirection(e), this; } equals(e) { return e.origin.equals(this.origin) && e.direction.equals(this.direction); } clone() { return new this.constructor().copy(this); } } class at { constructor() { this.elements = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ], arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead."); } set(e, r, i, n, a, o, s, c, l, u, d, h, f, p, m, y) { const g = this.elements; return g[0] = e, g[4] = r, g[8] = i, g[12] = n, g[1] = a, g[5] = o, g[9] = s, g[13] = c, g[2] = l, g[6] = u, g[10] = d, g[14] = h, g[3] = f, g[7] = p, g[11] = m, g[15] = y, this; } identity() { return this.set( 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ), this; } clone() { return new at().fromArray(this.elements); } copy(e) { const r = this.elements, i = e.elements; return r[0] = i[0], r[1] = i[1], r[2] = i[2], r[3] = i[3], r[4] = i[4], r[5] = i[5], r[6] = i[6], r[7] = i[7], r[8] = i[8], r[9] = i[9], r[10] = i[10], r[11] = i[11], r[12] = i[12], r[13] = i[13], r[14] = i[14], r[15] = i[15], this; } copyPosition(e) { const r = this.elements, i = e.elements; return r[12] = i[12], r[13] = i[13], r[14] = i[14], this; } setFromMatrix3(e) { const r = e.elements; return this.set( r[0], r[3], r[6], 0, r[1], r[4], r[7], 0, r[2], r[5], r[8], 0, 0, 0, 0, 1 ), this; } extractBasis(e, r, i) { return e.setFromMatrixColumn(this, 0), r.setFromMatrixColumn(this, 1), i.setFromMatrixColumn(this, 2), this; } makeBasis(e, r, i) { return this.set( e.x, r.x, i.x, 0, e.y, r.y, i.y, 0, e.z, r.z, i.z, 0, 0, 0, 0, 1 ), this; } extractRotation(e) { const r = this.elements, i = e.elements, n = 1 / hc.setFromMatrixColumn(e, 0).length(), a = 1 / hc.setFromMatrixColumn(e, 1).length(), o = 1 / hc.setFromMatrixColumn(e, 2).length(); return r[0] = i[0] * n, r[1] = i[1] * n, r[2] = i[2] * n, r[3] = 0, r[4] = i[4] * a, r[5] = i[5] * a, r[6] = i[6] * a, r[7] = 0, r[8] = i[8] * o, r[9] = i[9] * o, r[10] = i[10] * o, r[11] = 0, r[12] = 0, r[13] = 0, r[14] = 0, r[15] = 1, this; } makeRotationFromEuler(e) { e && e.isEuler || console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order."); const r = this.elements, i = e.x, n = e.y, a = e.z, o = Math.cos(i), s = Math.sin(i), c = Math.cos(n), l = Math.sin(n), u = Math.cos(a), d = Math.sin(a); if (e.order === "XYZ") { const h = o * u, f = o * d, p = s * u, m = s * d; r[0] = c * u, r[4] = -c * d, r[8] = l, r[1] = f + p * l, r[5] = h - m * l, r[9] = -s * c, r[2] = m - h * l, r[6] = p + f * l, r[10] = o * c; } else if (e.order === "YXZ") { const h = c * u, f = c * d, p = l * u, m = l * d; r[0] = h + m * s, r[4] = p * s - f, r[8] = o * l, r[1] = o * d, r[5] = o * u, r[9] = -s, r[2] = f * s - p, r[6] = m + h * s, r[10] = o * c; } else if (e.order === "ZXY") { const h = c * u, f = c * d, p = l * u, m = l * d; r[0] = h - m * s, r[4] = -o * d, r[8] = p + f * s, r[1] = f + p * s, r[5] = o * u, r[9] = m - h * s, r[2] = -o * l, r[6] = s, r[10] = o * c; } else if (e.order === "ZYX") { const h = o * u, f = o * d, p = s * u, m = s * d; r[0] = c * u, r[4] = p * l - f, r[8] = h * l + m, r[1] = c * d, r[5] = m * l + h, r[9] = f * l - p, r[2] = -l, r[6] = s * c, r[10] = o * c; } else if (e.order === "YZX") { const h = o * c, f = o * l, p = s * c, m = s * l; r[0] = c * u, r[4] = m - h * d, r[8] = p * d + f, r[1] = d, r[5] = o * u, r[9] = -s * u, r[2] = -l * u, r[6] = f * d + p, r[10] = h - m * d; } else if (e.order === "XZY") { const h = o * c, f = o * l, p = s * c, m = s * l; r[0] = c * u, r[4] = -d, r[8] = l * u, r[1] = h * d + m, r[5] = o * u, r[9] = f * d - p, r[2] = p * d - f, r[6] = s * u, r[10] = m * d + h; } return r[3] = 0, r[7] = 0, r[11] = 0, r[12] = 0, r[13] = 0, r[14] = 0, r[15] = 1, this; } makeRotationFromQuaternion(e) { return this.compose(Boe, e, Foe); } lookAt(e, r, i) { const n = this.elements; return Qi.subVectors(e, r), Qi.lengthSq() === 0 && (Qi.z = 1), Qi.normalize(), Oo.crossVectors(i, Qi), Oo.lengthSq() === 0 && (Math.abs(i.z) === 1 ? Qi.x += 1e-4 : Qi.z += 1e-4, Qi.normalize(), Oo.crossVectors(i, Qi)), Oo.normalize(), pf.crossVectors(Qi, Oo), n[0] = Oo.x, n[4] = pf.x, n[8] = Qi.x, n[1] = Oo.y, n[5] = pf.y, n[9] = Qi.y, n[2] = Oo.z, n[6] = pf.z, n[10] = Qi.z, this; } multiply(e, r) { return r !== void 0 ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."), this.multiplyMatrices(e, r)) : this.multiplyMatrices(this, e); } premultiply(e) { return this.multiplyMatrices(e, this); } multiplyMatrices(e, r) { const i = e.elements, n = r.elements, a = this.elements, o = i[0], s = i[4], c = i[8], l = i[12], u = i[1], d = i[5], h = i[9], f = i[13], p = i[2], m = i[6], y = i[10], g = i[14], v = i[3], x = i[7], w = i[11], S = i[15], _ = n[0], b = n[4], T = n[8], E = n[12], C = n[1], L = n[5], A = n[9], k = n[13], P = n[2], R = n[6], M = n[10], O = n[14], D = n[3], I = n[7], F = n[11], z = n[15]; return a[0] = o * _ + s * C + c * P + l * D, a[4] = o * b + s * L + c * R + l * I, a[8] = o * T + s * A + c * M + l * F, a[12] = o * E + s * k + c * O + l * z, a[1] = u * _ + d * C + h * P + f * D, a[5] = u * b + d * L + h * R + f * I, a[9] = u * T + d * A + h * M + f * F, a[13] = u * E + d * k + h * O + f * z, a[2] = p * _ + m * C + y * P + g * D, a[6] = p * b + m * L + y * R + g * I, a[10] = p * T + m * A + y * M + g * F, a[14] = p * E + m * k + y * O + g * z, a[3] = v * _ + x * C + w * P + S * D, a[7] = v * b + x * L + w * R + S * I, a[11] = v * T + x * A + w * M + S * F, a[15] = v * E + x * k + w * O + S * z, this; } multiplyScalar(e) { const r = this.elements; return r[0] *= e, r[4] *= e, r[8] *= e, r[12] *= e, r[1] *= e, r[5] *= e, r[9] *= e, r[13] *= e, r[2] *= e, r[6] *= e, r[10] *= e, r[14] *= e, r[3] *= e, r[7] *= e, r[11] *= e, r[15] *= e, this; } determinant() { const e = this.elements, r = e[0], i = e[4], n = e[8], a = e[12], o = e[1], s = e[5], c = e[9], l = e[13], u = e[2], d = e[6], h = e[10], f = e[14], p = e[3], m = e[7], y = e[11], g = e[15]; return p * (+a * c * d - n * l * d - a * s * h + i * l * h + n * s * f - i * c * f) + m * (+r * c * f - r * l * h + a * o * h - n * o * f + n * l * u - a * c * u) + y * (+r * l * d - r * s * f - a * o * d + i * o * f + a * s * u - i * l * u) + g * (-n * s * u - r * c * d + r * s * h + n * o * d - i * o * h + i * c * u); } transpose() { const e = this.elements; let r; return r = e[1], e[1] = e[4], e[4] = r, r = e[2], e[2] = e[8], e[8] = r, r = e[6], e[6] = e[9], e[9] = r, r = e[3], e[3] = e[12], e[12] = r, r = e[7], e[7] = e[13], e[13] = r, r = e[11], e[11] = e[14], e[14] = r, this; } setPosition(e, r, i) { const n = this.elements; return e.isVector3 ? (n[12] = e.x, n[13] = e.y, n[14] = e.z) : (n[12] = e, n[13] = r, n[14] = i), this; } invert() { const e = this.elements, r = e[0], i = e[1], n = e[2], a = e[3], o = e[4], s = e[5], c = e[6], l = e[7], u = e[8], d = e[9], h = e[10], f = e[11], p = e[12], m = e[13], y = e[14], g = e[15], v = d * y * l - m * h * l + m * c * f - s * y * f - d * c * g + s * h * g, x = p * h * l - u * y * l - p * c * f + o * y * f + u * c * g - o * h * g, w = u * m * l - p * d * l + p * s * f - o * m * f - u * s * g + o * d * g, S = p * d * c - u * m * c - p * s * h + o * m * h + u * s * y - o * d * y, _ = r * v + i * x + n * w + a * S; if (_ === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); const b = 1 / _; return e[0] = v * b, e[1] = (m * h * a - d * y * a - m * n * f + i * y * f + d * n * g - i * h * g) * b, e[2] = (s * y * a - m * c * a + m * n * l - i * y * l - s * n * g + i * c * g) * b, e[3] = (d * c * a - s * h * a - d * n * l + i * h * l + s * n * f - i * c * f) * b, e[4] = x * b, e[5] = (u * y * a - p * h * a + p * n * f - r * y * f - u * n * g + r * h * g) * b, e[6] = (p * c * a - o * y * a - p * n * l + r * y * l + o * n * g - r * c * g) * b, e[7] = (o * h * a - u * c * a + u * n * l - r * h * l - o * n * f + r * c * f) * b, e[8] = w * b, e[9] = (p * d * a - u * m * a - p * i * f + r * m * f + u * i * g - r * d * g) * b, e[10] = (o * m * a - p * s * a + p * i * l - r * m * l - o * i * g + r * s * g) * b, e[11] = (u * s * a - o * d * a - u * i * l + r * d * l + o * i * f - r * s * f) * b, e[12] = S * b, e[13] = (u * m * n - p * d * n + p * i * h - r * m * h - u * i * y + r * d * y) * b, e[14] = (p * s * n - o * m * n - p * i * c + r * m * c + o * i * y - r * s * y) * b, e[15] = (o * d * n - u * s * n + u * i * c - r * d * c - o * i * h + r * s * h) * b, this; } scale(e) { const r = this.elements, i = e.x, n = e.y, a = e.z; return r[0] *= i, r[4] *= n, r[8] *= a, r[1] *= i, r[5] *= n, r[9] *= a, r[2] *= i, r[6] *= n, r[10] *= a, r[3] *= i, r[7] *= n, r[11] *= a, this; } getMaxScaleOnAxis() { const e = this.elements, r = e[0] * e[0] + e[1] * e[1] + e[2] * e[2], i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6], n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10]; return Math.sqrt(Math.max(r, i, n)); } makeTranslation(e, r, i) { return this.set( 1, 0, 0, e, 0, 1, 0, r, 0, 0, 1, i, 0, 0, 0, 1 ), this; } makeRotationX(e) { const r = Math.cos(e), i = Math.sin(e); return this.set( 1, 0, 0, 0, 0, r, -i, 0, 0, i, r, 0, 0, 0, 0, 1 ), this; } makeRotationY(e) { const r = Math.cos(e), i = Math.sin(e); return this.set( r, 0, i, 0, 0, 1, 0, 0, -i, 0, r, 0, 0, 0, 0, 1 ), this; } makeRotationZ(e) { const r = Math.cos(e), i = Math.sin(e); return this.set( r, -i, 0, 0, i, r, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ), this; } makeRotationAxis(e, r) { const i = Math.cos(r), n = Math.sin(r), a = 1 - i, o = e.x, s = e.y, c = e.z, l = a * o, u = a * s; return this.set( l * o + i, l * s - n * c, l * c + n * s, 0, l * s + n * c, u * s + i, u * c - n * o, 0, l * c - n * s, u * c + n * o, a * c * c + i, 0, 0, 0, 0, 1 ), this; } makeScale(e, r, i) { return this.set( e, 0, 0, 0, 0, r, 0, 0, 0, 0, i, 0, 0, 0, 0, 1 ), this; } makeShear(e, r, i, n, a, o) { return this.set( 1, i, a, 0, e, 1, o, 0, r, n, 1, 0, 0, 0, 0, 1 ), this; } compose(e, r, i) { const n = this.elements, a = r._x, o = r._y, s = r._z, c = r._w, l = a + a, u = o + o, d = s + s, h = a * l, f = a * u, p = a * d, m = o * u, y = o * d, g = s * d, v = c * l, x = c * u, w = c * d, S = i.x, _ = i.y, b = i.z; return n[0] = (1 - (m + g)) * S, n[1] = (f + w) * S, n[2] = (p - x) * S, n[3] = 0, n[4] = (f - w) * _, n[5] = (1 - (h + g)) * _, n[6] = (y + v) * _, n[7] = 0, n[8] = (p + x) * b, n[9] = (y - v) * b, n[10] = (1 - (h + m)) * b, n[11] = 0, n[12] = e.x, n[13] = e.y, n[14] = e.z, n[15] = 1, this; } decompose(e, r, i) { const n = this.elements; let a = hc.set(n[0], n[1], n[2]).length(); const o = hc.set(n[4], n[5], n[6]).length(), s = hc.set(n[8], n[9], n[10]).length(); this.determinant() < 0 && (a = -a), e.x = n[12], e.y = n[13], e.z = n[14], Rn.copy(this); const c = 1 / a, l = 1 / o, u = 1 / s; return Rn.elements[0] *= c, Rn.elements[1] *= c, Rn.elements[2] *= c, Rn.elements[4] *= l, Rn.elements[5] *= l, Rn.elements[6] *= l, Rn.elements[8] *= u, Rn.elements[9] *= u, Rn.elements[10] *= u, r.setFromRotationMatrix(Rn), i.x = a, i.y = o, i.z = s, this; } makePerspective(e, r, i, n, a, o) { o === void 0 && console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs."); const s = this.elements, c = 2 * a / (r - e), l = 2 * a / (i - n), u = (r + e) / (r - e), d = (i + n) / (i - n), h = -(o + a) / (o - a), f = -2 * o * a / (o - a); return s[0] = c, s[4] = 0, s[8] = u, s[12] = 0, s[1] = 0, s[5] = l, s[9] = d, s[13] = 0, s[2] = 0, s[6] = 0, s[10] = h, s[14] = f, s[3] = 0, s[7] = 0, s[11] = -1, s[15] = 0, this; } makeOrthographic(e, r, i, n, a, o) { const s = this.elements, c = 1 / (r - e), l = 1 / (i - n), u = 1 / (o - a), d = (r + e) * c, h = (i + n) * l, f = (o + a) * u; return s[0] = 2 * c, s[4] = 0, s[8] = 0, s[12] = -d, s[1] = 0, s[5] = 2 * l, s[9] = 0, s[13] = -h, s[2] = 0, s[6] = 0, s[10] = -2 * u, s[14] = -f, s[3] = 0, s[7] = 0, s[11] = 0, s[15] = 1, this; } equals(e) { const r = this.elements, i = e.elements; for (let n = 0; n < 16; n++) if (r[n] !== i[n]) return !1; return !0; } fromArray(e, r = 0) { for (let i = 0; i < 16; i++) this.elements[i] = e[i + r]; return this; } toArray(e = [], r = 0) { const i = this.elements; return e[r] = i[0], e[r + 1] = i[1], e[r + 2] = i[2], e[r + 3] = i[3], e[r + 4] = i[4], e[r + 5] = i[5], e[r + 6] = i[6], e[r + 7] = i[7], e[r + 8] = i[8], e[r + 9] = i[9], e[r + 10] = i[10], e[r + 11] = i[11], e[r + 12] = i[12], e[r + 13] = i[13], e[r + 14] = i[14], e[r + 15] = i[15], e; } } at.prototype.isMatrix4 = !0; const hc = /* @__PURE__ */ new de(), Rn = /* @__PURE__ */ new at(), Boe = /* @__PURE__ */ new de(0, 0, 0), Foe = /* @__PURE__ */ new de(1, 1, 1), Oo = /* @__PURE__ */ new de(), pf = /* @__PURE__ */ new de(), Qi = /* @__PURE__ */ new de(), BM = /* @__PURE__ */ new at(), FM = /* @__PURE__ */ new vi(); class ql { constructor(e = 0, r = 0, i = 0, n = ql.DefaultOrder) { this._x = e, this._y = r, this._z = i, this._order = n; } get x() { return this._x; } set x(e) { this._x = e, this._onChangeCallback(); } get y() { return this._y; } set y(e) { this._y = e, this._onChangeCallback(); } get z() { return this._z; } set z(e) { this._z = e, this._onChangeCallback(); } get order() { return this._order; } set order(e) { this._order = e, this._onChangeCallback(); } set(e, r, i, n = this._order) { return this._x = e, this._y = r, this._z = i, this._order = n, this._onChangeCallback(), this; } clone() { return new this.constructor(this._x, this._y, this._z, this._order); } copy(e) { return this._x = e._x, this._y = e._y, this._z = e._z, this._order = e._order, this._onChangeCallback(), this; } setFromRotationMatrix(e, r = this._order, i = !0) { const n = e.elements, a = n[0], o = n[4], s = n[8], c = n[1], l = n[5], u = n[9], d = n[2], h = n[6], f = n[10]; switch (r) { case "XYZ": this._y = Math.asin(ci(s, -1, 1)), Math.abs(s) < 0.9999999 ? (this._x = Math.atan2(-u, f), this._z = Math.atan2(-o, a)) : (this._x = Math.atan2(h, l), this._z = 0); break; case "YXZ": this._x = Math.asin(-ci(u, -1, 1)), Math.abs(u) < 0.9999999 ? (this._y = Math.atan2(s, f), this._z = Math.atan2(c, l)) : (this._y = Math.atan2(-d, a), this._z = 0); break; case "ZXY": this._x = Math.asin(ci(h, -1, 1)), Math.abs(h) < 0.9999999 ? (this._y = Math.atan2(-d, f), this._z = Math.atan2(-o, l)) : (this._y = 0, this._z = Math.atan2(c, a)); break; case "ZYX": this._y = Math.asin(-ci(d, -1, 1)), Math.abs(d) < 0.9999999 ? (this._x = Math.atan2(h, f), this._z = Math.atan2(c, a)) : (this._x = 0, this._z = Math.atan2(-o, l)); break; case "YZX": this._z = Math.asin(ci(c, -1, 1)), Math.abs(c) < 0.9999999 ? (this._x = Math.atan2(-u, l), this._y = Math.atan2(-d, a)) : (this._x = 0, this._y = Math.atan2(s, f)); break; case "XZY": this._z = Math.asin(-ci(o, -1, 1)), Math.abs(o) < 0.9999999 ? (this._x = Math.atan2(h, l), this._y = Math.atan2(s, a)) : (this._x = Math.atan2(-u, f), this._y = 0); break; default: console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: " + r); } return this._order = r, i === !0 && this._onChangeCallback(), this; } setFromQuaternion(e, r, i) { return BM.makeRotationFromQuaternion(e), this.setFromRotationMatrix(BM, r, i); } setFromVector3(e, r = this._order) { return this.set(e.x, e.y, e.z, r); } reorder(e) { return FM.setFromEuler(this), this.setFromQuaternion(FM, e); } equals(e) { return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order; } fromArray(e) { return this._x = e[0], this._y = e[1], this._z = e[2], e[3] !== void 0 && (this._order = e[3]), this._onChangeCallback(), this; } toArray(e = [], r = 0) { return e[r] = this._x, e[r + 1] = this._y, e[r + 2] = this._z, e[r + 3] = this._order, e; } toVector3(e) { return e ? e.set(this._x, this._y, this._z) : new de(this._x, this._y, this._z); } _onChange(e) { return this._onChangeCallback = e, this; } _onChangeCallback() { } } ql.prototype.isEuler = !0; ql.DefaultOrder = "XYZ"; ql.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"]; class $x { constructor() { this.mask = 1; } set(e) { this.mask = 1 << e | 0; } enable(e) { this.mask |= 1 << e | 0; } enableAll() { this.mask = -1; } toggle(e) { this.mask ^= 1 << e | 0; } disable(e) { this.mask &= ~(1 << e | 0); } disableAll() { this.mask = 0; } test(e) { return (this.mask & e.mask) !== 0; } } let zoe = 0; const zM = /* @__PURE__ */ new de(), pc = /* @__PURE__ */ new vi(), Ia = /* @__PURE__ */ new at(), ff = /* @__PURE__ */ new de(), _d = /* @__PURE__ */ new de(), $oe = /* @__PURE__ */ new de(), Voe = /* @__PURE__ */ new vi(), $M = /* @__PURE__ */ new de(1, 0, 0), VM = /* @__PURE__ */ new de(0, 1, 0), UM = /* @__PURE__ */ new de(0, 0, 1), Uoe = { type: "added" }, jM = { type: "removed" }; class It extends Os { constructor() { super(), Object.defineProperty(this, "id", { value: zoe++ }), this.uuid = ln(), this.name = "", this.type = "Object3D", this.parent = null, this.children = [], this.up = It.DefaultUp.clone(); const e = new de(), r = new ql(), i = new vi(), n = new de(1, 1, 1); function a() { i.setFromEuler(r, !1); } function o() { r.setFromQuaternion(i, void 0, !1); } r._onChange(a), i._onChange(o), Object.defineProperties(this, { position: { configurable: !0, enumerable: !0, value: e }, rotation: { configurable: !0, enumerable: !0, value: r }, quaternion: { configurable: !0, enumerable: !0, value: i }, scale: { configurable: !0, enumerable: !0, value: n }, modelViewMatrix: { value: new at() }, normalMatrix: { value: new Xr() } }), this.matrix = new at(), this.matrixWorld = new at(), this.matrixAutoUpdate = It.DefaultMatrixAutoUpdate, this.matrixWorldNeedsUpdate = !1, this.layers = new $x(), this.visible = !0, this.castShadow = !1, this.receiveShadow = !1, this.frustumCulled = !0, this.renderOrder = 0, this.animations = [], this.userData = {}; } onBeforeRender() { } onAfterRender() { } applyMatrix4(e) { this.matrixAutoUpdate && this.updateMatrix(), this.matrix.premultiply(e), this.matrix.decompose(this.position, this.quaternion, this.scale); } applyQuaternion(e) { return this.quaternion.premultiply(e), this; } setRotationFromAxisAngle(e, r) { this.quaternion.setFromAxisAngle(e, r); } setRotationFromEuler(e) { this.quaternion.setFromEuler(e, !0); } setRotationFromMatrix(e) { this.quaternion.setFromRotationMatrix(e); } setRotationFromQuaternion(e) { this.quaternion.copy(e); } rotateOnAxis(e, r) { return pc.setFromAxisAngle(e, r), this.quaternion.multiply(pc), this; } rotateOnWorldAxis(e, r) { return pc.setFromAxisAngle(e, r), this.quaternion.premultiply(pc), this; } rotateX(e) { return this.rotateOnAxis($M, e); } rotateY(e) { return this.rotateOnAxis(VM, e); } rotateZ(e) { return this.rotateOnAxis(UM, e); } translateOnAxis(e, r) { return zM.copy(e).applyQuaternion(this.quaternion), this.position.add(zM.multiplyScalar(r)), this; } translateX(e) { return this.translateOnAxis($M, e); } translateY(e) { return this.translateOnAxis(VM, e); } translateZ(e) { return this.translateOnAxis(UM, e); } localToWorld(e) { return e.applyMatrix4(this.matrixWorld); } worldToLocal(e) { return e.applyMatrix4(Ia.copy(this.matrixWorld).invert()); } lookAt(e, r, i) { e.isVector3 ? ff.copy(e) : ff.set(e, r, i); const n = this.parent; this.updateWorldMatrix(!0, !1), _d.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? Ia.lookAt(_d, ff, this.up) : Ia.lookAt(ff, _d, this.up), this.quaternion.setFromRotationMatrix(Ia), n && (Ia.extractRotation(n.matrixWorld), pc.setFromRotationMatrix(Ia), this.quaternion.premultiply(pc.invert())); } add(e) { if (arguments.length > 1) { for (let r = 0; r < arguments.length; r++) this.add(arguments[r]); return this; } return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e), this) : (e && e.isObject3D ? (e.parent !== null && e.parent.remove(e), e.parent = this, this.children.push(e), e.dispatchEvent(Uoe)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e), this); } remove(e) { if (arguments.length > 1) { for (let i = 0; i < arguments.length; i++) this.remove(arguments[i]); return this; } const r = this.children.indexOf(e); return r !== -1 && (e.parent = null, this.children.splice(r, 1), e.dispatchEvent(jM)), this; } removeFromParent() { const e = this.parent; return e !== null && e.remove(this), this; } clear() { for (let e = 0; e < this.children.length; e++) { const r = this.children[e]; r.parent = null, r.dispatchEvent(jM); } return this.children.length = 0, this; } attach(e) { return this.updateWorldMatrix(!0, !1), Ia.copy(this.matrixWorld).invert(), e.parent !== null && (e.parent.updateWorldMatrix(!0, !1), Ia.multiply(e.parent.matrixWorld)), e.applyMatrix4(Ia), this.add(e), e.updateWorldMatrix(!1, !0), this; } getObjectById(e) { return this.getObjectByProperty("id", e); } getObjectByName(e) { return this.getObjectByProperty("name", e); } getObjectByProperty(e, r) { if (this[e] === r) return this; for (let i = 0, n = this.children.length; i < n; i++) { const a = this.children[i].getObjectByProperty(e, r); if (a !== void 0) return a; } } getWorldPosition(e) { return this.updateWorldMatrix(!0, !1), e.setFromMatrixPosition(this.matrixWorld); } getWorldQuaternion(e) { return this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(_d, e, $oe), e; } getWorldScale(e) { return this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(_d, Voe, e), e; } getWorldDirection(e) { this.updateWorldMatrix(!0, !1); const r = this.matrixWorld.elements; return e.set(r[8], r[9], r[10]).normalize(); } raycast() { } traverse(e) { e(this); const r = this.children; for (let i = 0, n = r.length; i < n; i++) r[i].traverse(e); } traverseVisible(e) { if (this.visible === !1) return; e(this); const r = this.children; for (let i = 0, n = r.length; i < n; i++) r[i].traverseVisible(e); } traverseAncestors(e) { const r = this.parent; r !== null && (e(r), r.traverseAncestors(e)); } updateMatrix() { this.matrix.compose(this.position, this.quaternion, this.scale), this.matrixWorldNeedsUpdate = !0; } updateMatrixWorld(e) { this.matrixAutoUpdate && this.updateMatrix(), (this.matrixWorldNeedsUpdate || e) && (this.parent === null ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix), this.matrixWorldNeedsUpdate = !1, e = !0); const r = this.children; for (let i = 0, n = r.length; i < n; i++) r[i].updateMatrixWorld(e); } updateWorldMatrix(e, r) { const i = this.parent; if (e === !0 && i !== null && i.updateWorldMatrix(!0, !1), this.matrixAutoUpdate && this.updateMatrix(), this.parent === null ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix), r === !0) { const n = this.children; for (let a = 0, o = n.length; a < o; a++) n[a].updateWorldMatrix(!1, !0); } } toJSON(e) { const r = e === void 0 || typeof e == "string", i = {}; r && (e = { geometries: {}, materials: {}, textures: {}, images: {}, shapes: {}, skeletons: {}, animations: {} }, i.metadata = { version: 4.5, type: "Object", generator: "Object3D.toJSON" }); const n = {}; n.uuid = this.uuid, n.type = this.type, this.name !== "" && (n.name = this.name), this.castShadow === !0 && (n.castShadow = !0), this.receiveShadow === !0 && (n.receiveShadow = !0), this.visible === !1 && (n.visible = !1), this.frustumCulled === !1 && (n.frustumCulled = !1), this.renderOrder !== 0 && (n.renderOrder = this.renderOrder), JSON.stringify(this.userData) !== "{}" && (n.userData = this.userData), n.layers = this.layers.mask, n.matrix = this.matrix.toArray(), this.matrixAutoUpdate === !1 && (n.matrixAutoUpdate = !1), this.isInstancedMesh && (n.type = "InstancedMesh", n.count = this.count, n.instanceMatrix = this.instanceMatrix.toJSON(), this.instanceColor !== null && (n.instanceColor = this.instanceColor.toJSON())); function a(s, c) { return s[c.uuid] === void 0 && (s[c.uuid] = c.toJSON(e)), c.uuid; } if (this.isScene) this.background && (this.background.isColor ? n.background = this.background.toJSON() : this.background.isTexture && (n.background = this.background.toJSON(e).uuid)), this.environment && this.environment.isTexture && (n.environment = this.environment.toJSON(e).uuid); else if (this.isMesh || this.isLine || this.isPoints) { n.geometry = a(e.geometries, this.geometry); const s = this.geometry.parameters; if (s !== void 0 && s.shapes !== void 0) { const c = s.shapes; if (Array.isArray(c)) for (let l = 0, u = c.length; l < u; l++) { const d = c[l]; a(e.shapes, d); } else a(e.shapes, c); } } if (this.isSkinnedMesh && (n.bindMode = this.bindMode, n.bindMatrix = this.bindMatrix.toArray(), this.skeleton !== void 0 && (a(e.skeletons, this.skeleton), n.skeleton = this.skeleton.uuid)), this.material !== void 0) if (Array.isArray(this.material)) { const s = []; for (let c = 0, l = this.material.length; c < l; c++) s.push(a(e.materials, this.material[c])); n.material = s; } else n.material = a(e.materials, this.material); if (this.children.length > 0) { n.children = []; for (let s = 0; s < this.children.length; s++) n.children.push(this.children[s].toJSON(e).object); } if (this.animations.length > 0) { n.animations = []; for (let s = 0; s < this.animations.length; s++) { const c = this.animations[s]; n.animations.push(a(e.animations, c)); } } if (r) { const s = o(e.geometries), c = o(e.materials), l = o(e.textures), u = o(e.images), d = o(e.shapes), h = o(e.skeletons), f = o(e.animations); s.length > 0 && (i.geometries = s), c.length > 0 && (i.materials = c), l.length > 0 && (i.textures = l), u.length > 0 && (i.images = u), d.length > 0 && (i.shapes = d), h.length > 0 && (i.skeletons = h), f.length > 0 && (i.animations = f); } return i.object = n, i; function o(s) { const c = []; for (const l in s) { const u = s[l]; delete u.metadata, c.push(u); } return c; } } clone(e) { return new this.constructor().copy(this, e); } copy(e, r = !0) { if (this.name = e.name, this.up.copy(e.up), this.position.copy(e.position), this.rotation.order = e.rotation.order, this.quaternion.copy(e.quaternion), this.scale.copy(e.scale), this.matrix.copy(e.matrix), this.matrixWorld.copy(e.matrixWorld), this.matrixAutoUpdate = e.matrixAutoUpdate, this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate, this.layers.mask = e.layers.mask, this.visible = e.visible, this.castShadow = e.castShadow, this.receiveShadow = e.receiveShadow, this.frustumCulled = e.frustumCulled, this.renderOrder = e.renderOrder, this.userData = JSON.parse(JSON.stringify(e.userData)), r === !0) for (let i = 0; i < e.children.length; i++) { const n = e.children[i]; this.add(n.clone()); } return this; } } It.DefaultUp = new de(0, 1, 0); It.DefaultMatrixAutoUpdate = !0; It.prototype.isObject3D = !0; const On = /* @__PURE__ */ new de(), Na = /* @__PURE__ */ new de(), _0 = /* @__PURE__ */ new de(), Ba = /* @__PURE__ */ new de(), fc = /* @__PURE__ */ new de(), mc = /* @__PURE__ */ new de(), HM = /* @__PURE__ */ new de(), S0 = /* @__PURE__ */ new de(), M0 = /* @__PURE__ */ new de(), E0 = /* @__PURE__ */ new de(); class Ir { constructor(e = new de(), r = new de(), i = new de()) { this.a = e, this.b = r, this.c = i; } static getNormal(e, r, i, n) { n.subVectors(i, r), On.subVectors(e, r), n.cross(On); const a = n.lengthSq(); return a > 0 ? n.multiplyScalar(1 / Math.sqrt(a)) : n.set(0, 0, 0); } // static/instance method to calculate barycentric coordinates // based on: http://www.blackpawn.com/texts/pointinpoly/default.html static getBarycoord(e, r, i, n, a) { On.subVectors(n, r), Na.subVectors(i, r), _0.subVectors(e, r); const o = On.dot(On), s = On.dot(Na), c = On.dot(_0), l = Na.dot(Na), u = Na.dot(_0), d = o * l - s * s; if (d === 0) return a.set(-2, -1, -1); const h = 1 / d, f = (l * c - s * u) * h, p = (o * u - s * c) * h; return a.set(1 - f - p, p, f); } static containsPoint(e, r, i, n) { return this.getBarycoord(e, r, i, n, Ba), Ba.x >= 0 && Ba.y >= 0 && Ba.x + Ba.y <= 1; } static getUV(e, r, i, n, a, o, s, c) { return this.getBarycoord(e, r, i, n, Ba), c.set(0, 0), c.addScaledVector(a, Ba.x), c.addScaledVector(o, Ba.y), c.addScaledVector(s, Ba.z), c; } static isFrontFacing(e, r, i, n) { return On.subVectors(i, r), Na.subVectors(e, r), On.cross(Na).dot(n) < 0; } set(e, r, i) { return this.a.copy(e), this.b.copy(r), this.c.copy(i), this; } setFromPointsAndIndices(e, r, i, n) { return this.a.copy(e[r]), this.b.copy(e[i]), this.c.copy(e[n]), this; } clone() { return new this.constructor().copy(this); } copy(e) { return this.a.copy(e.a), this.b.copy(e.b), this.c.copy(e.c), this; } getArea() { return On.subVectors(this.c, this.b), Na.subVectors(this.a, this.b), On.cross(Na).length() * 0.5; } getMidpoint(e) { return e.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3); } getNormal(e) { return Ir.getNormal(this.a, this.b, this.c, e); } getPlane(e) { return e.setFromCoplanarPoints(this.a, this.b, this.c); } getBarycoord(e, r) { return Ir.getBarycoord(e, this.a, this.b, this.c, r); } getUV(e, r, i, n, a) { return Ir.getUV(e, this.a, this.b, this.c, r, i, n, a); } containsPoint(e) { return Ir.containsPoint(e, this.a, this.b, this.c); } isFrontFacing(e) { return Ir.isFrontFacing(this.a, this.b, this.c, e); } intersectsBox(e) { return e.intersectsTriangle(this); } closestPointToPoint(e, r) { const i = this.a, n = this.b, a = this.c; let o, s; fc.subVectors(n, i), mc.subVectors(a, i), S0.subVectors(e, i); const c = fc.dot(S0), l = mc.dot(S0); if (c <= 0 && l <= 0) return r.copy(i); M0.subVectors(e, n); const u = fc.dot(M0), d = mc.dot(M0); if (u >= 0 && d <= u) return r.copy(n); const h = c * d - u * l; if (h <= 0 && c >= 0 && u <= 0) return o = c / (c - u), r.copy(i).addScaledVector(fc, o); E0.subVectors(e, a); const f = fc.dot(E0), p = mc.dot(E0); if (p >= 0 && f <= p) return r.copy(a); const m = f * l - c * p; if (m <= 0 && l >= 0 && p <= 0) return s = l / (l - p), r.copy(i).addScaledVector(mc, s); const y = u * p - f * d; if (y <= 0 && d - u >= 0 && f - p >= 0) return HM.subVectors(a, n), s = (d - u) / (d - u + (f - p)), r.copy(n).addScaledVector(HM, s); const g = 1 / (y + m + h); return o = m * g, s = h * g, r.copy(i).addScaledVector(fc, o).addScaledVector(mc, s); } equals(e) { return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c); } } let joe = 0; class jr extends Os { constructor() { super(), Object.defineProperty(this, "id", { value: joe++ }), this.uuid = ln(), this.name = "", this.type = "Material", this.fog = !0, this.blending = Hc, this.side = xs, this.vertexColors = !1, this.opacity = 1, this.transparent = !1, this.blendSrc = Px, this.blendDst = Rx, this.blendEquation = el, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.depthFunc = Qm, this.depthTest = !0, this.depthWrite = !0, this.stencilWriteMask = 255, this.stencilFunc = RR, this.stencilRef = 0, this.stencilFuncMask = 255, this.stencilFail = wm, this.stencilZFail = wm, this.stencilZPass = wm, this.stencilWrite = !1, this.clippingPlanes = null, this.clipIntersection = !1, this.clipShadows = !1, this.shadowSide = null, this.colorWrite = !0, this.precision = null, this.polygonOffset = !1, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.dithering = !1, this.alphaTest = 0, this.alphaToCoverage = !1, this.premultipliedAlpha = !1, this.visible = !0, this.toneMapped = !0, this.userData = {}, this.version = 0; } onBuild() { } onBeforeCompile() { } customProgramCacheKey() { return this.onBeforeCompile.toString(); } setValues(e) { if (e !== void 0) for (const r in e) { const i = e[r]; if (i === void 0) { console.warn("THREE.Material: '" + r + "' parameter is undefined."); continue; } if (r === "shading") { console.warn("THREE." + this.type + ": .shading has been removed. Use the boolean .flatShading instead."), this.flatShading = i === kx; continue; } const n = this[r]; if (n === void 0) { console.warn("THREE." + this.type + ": '" + r + "' is not a property of this material."); continue; } n && n.isColor ? n.set(i) : n && n.isVector3 && i && i.isVector3 ? n.copy(i) : this[r] = i; } } toJSON(e) { const r = e === void 0 || typeof e == "string"; r && (e = { textures: {}, images: {} }); const i = { metadata: { version: 4.5, type: "Material", generator: "Material.toJSON" } }; i.uuid = this.uuid, i.type = this.type, this.name !== "" && (i.name = this.name), this.color && this.color.isColor && (i.color = this.color.getHex()), this.roughness !== void 0 && (i.roughness = this.roughness), this.metalness !== void 0 && (i.metalness = this.metalness), this.sheen && this.sheen.isColor && (i.sheen = this.sheen.getHex()), this.emissive && this.emissive.isColor && (i.emissive = this.emissive.getHex()), this.emissiveIntensity && this.emissiveIntensity !== 1 && (i.emissiveIntensity = this.emissiveIntensity), this.specular && this.specular.isColor && (i.specular = this.specular.getHex()), this.shininess !== void 0 && (i.shininess = this.shininess), this.clearcoat !== void 0 && (i.clearcoat = this.clearcoat), this.clearcoatRoughness !== void 0 && (i.clearcoatRoughness = this.clearcoatRoughness), this.clearcoatMap && this.clearcoatMap.isTexture && (i.clearcoatMap = this.clearcoatMap.toJSON(e).uuid), this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture && (i.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(e).uuid), this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture && (i.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(e).uuid, i.clearcoatNormalScale = this.clearcoatNormalScale.toArray()), this.map && this.map.isTexture && (i.map = this.map.toJSON(e).uuid), this.matcap && this.matcap.isTexture && (i.matcap = this.matcap.toJSON(e).uuid), this.alphaMap && this.alphaMap.isTexture && (i.alphaMap = this.alphaMap.toJSON(e).uuid), this.lightMap && this.lightMap.isTexture && (i.lightMap = this.lightMap.toJSON(e).uuid, i.lightMapIntensity = this.lightMapIntensity), this.aoMap && this.aoMap.isTexture && (i.aoMap = this.aoMap.toJSON(e).uuid, i.aoMapIntensity = this.aoMapIntensity), this.bumpMap && this.bumpMap.isTexture && (i.bumpMap = this.bumpMap.toJSON(e).uuid, i.bumpScale = this.bumpScale), this.normalMap && this.normalMap.isTexture && (i.normalMap = this.normalMap.toJSON(e).uuid, i.normalMapType = this.normalMapType, i.normalScale = this.normalScale.toArray()), this.displacementMap && this.displacementMap.isTexture && (i.displacementMap = this.displacementMap.toJSON(e).uuid, i.displacementScale = this.displacementScale, i.displacementBias = this.displacementBias), this.roughnessMap && this.roughnessMap.isTexture && (i.roughnessMap = this.roughnessMap.toJSON(e).uuid), this.metalnessMap && this.metalnessMap.isTexture && (i.metalnessMap = this.metalnessMap.toJSON(e).uuid), this.emissiveMap && this.emissiveMap.isTexture && (i.emissiveMap = this.emissiveMap.toJSON(e).uuid), this.specularMap && this.specularMap.isTexture && (i.specularMap = this.specularMap.toJSON(e).uuid), this.envMap && this.envMap.isTexture && (i.envMap = this.envMap.toJSON(e).uuid, this.combine !== void 0 && (i.combine = this.combine)), this.envMapIntensity !== void 0 && (i.envMapIntensity = this.envMapIntensity), this.reflectivity !== void 0 && (i.reflectivity = this.reflectivity), this.refractionRatio !== void 0 && (i.refractionRatio = this.refractionRatio), this.gradientMap && this.gradientMap.isTexture && (i.gradientMap = this.gradientMap.toJSON(e).uuid), this.transmission !== void 0 && (i.transmission = this.transmission), this.transmissionMap && this.transmissionMap.isTexture && (i.transmissionMap = this.transmissionMap.toJSON(e).uuid), this.thickness !== void 0 && (i.thickness = this.thickness), this.thicknessMap && this.thicknessMap.isTexture && (i.thicknessMap = this.thicknessMap.toJSON(e).uuid), this.attenuationDistance !== void 0 && (i.attenuationDistance = this.attenuationDistance), this.attenuationColor !== void 0 && (i.attenuationColor = this.attenuationColor.getHex()), this.size !== void 0 && (i.size = this.size), this.shadowSide !== null && (i.shadowSide = this.shadowSide), this.sizeAttenuation !== void 0 && (i.sizeAttenuation = this.sizeAttenuation), this.blending !== Hc && (i.blending = this.blending), this.side !== xs && (i.side = this.side), this.vertexColors && (i.vertexColors = !0), this.opacity < 1 && (i.opacity = this.opacity), this.transparent === !0 && (i.transparent = this.transparent), i.depthFunc = this.depthFunc, i.depthTest = this.depthTest, i.depthWrite = this.depthWrite, i.colorWrite = this.colorWrite, i.stencilWrite = this.stencilWrite, i.stencilWriteMask = this.stencilWriteMask, i.stencilFunc = this.stencilFunc, i.stencilRef = this.stencilRef, i.stencilFuncMask = this.stencilFuncMask, i.stencilFail = this.stencilFail, i.stencilZFail = this.stencilZFail, i.stencilZPass = this.stencilZPass, this.rotation && this.rotation !== 0 && (i.rotation = this.rotation), this.polygonOffset === !0 && (i.polygonOffset = !0), this.polygonOffsetFactor !== 0 && (i.polygonOffsetFactor = this.polygonOffsetFactor), this.polygonOffsetUnits !== 0 && (i.polygonOffsetUnits = this.polygonOffsetUnits), this.linewidth && this.linewidth !== 1 && (i.linewidth = this.linewidth), this.dashSize !== void 0 && (i.dashSize = this.dashSize), this.gapSize !== void 0 && (i.gapSize = this.gapSize), this.scale !== void 0 && (i.scale = this.scale), this.dithering === !0 && (i.dithering = !0), this.alphaTest > 0 && (i.alphaTest = this.alphaTest), this.alphaToCoverage === !0 && (i.alphaToCoverage = this.alphaToCoverage), this.premultipliedAlpha === !0 && (i.premultipliedAlpha = this.premultipliedAlpha), this.wireframe === !0 && (i.wireframe = this.wireframe), this.wireframeLinewidth > 1 && (i.wireframeLinewidth = this.wireframeLinewidth), this.wireframeLinecap !== "round" && (i.wireframeLinecap = this.wireframeLinecap), this.wireframeLinejoin !== "round" && (i.wireframeLinejoin = this.wireframeLinejoin), this.morphTargets === !0 && (i.morphTargets = !0), this.morphNormals === !0 && (i.morphNormals = !0), this.flatShading === !0 && (i.flatShading = this.flatShading), this.visible === !1 && (i.visible = !1), this.toneMapped === !1 && (i.toneMapped = !1), JSON.stringify(this.userData) !== "{}" && (i.userData = this.userData); function n(a) { const o = []; for (const s in a) { const c = a[s]; delete c.metadata, o.push(c); } return o; } if (r) { const a = n(e.textures), o = n(e.images); a.length > 0 && (i.textures = a), o.length > 0 && (i.images = o); } return i; } clone() { return new this.constructor().copy(this); } copy(e) { this.name = e.name, this.fog = e.fog, this.blending = e.blending, this.side = e.side, this.vertexColors = e.vertexColors, this.opacity = e.opacity, this.transparent = e.transparent, this.blendSrc = e.blendSrc, this.blendDst = e.blendDst, this.blendEquation = e.blendEquation, this.blendSrcAlpha = e.blendSrcAlpha, this.blendDstAlpha = e.blendDstAlpha, this.blendEquationAlpha = e.blendEquationAlpha, this.depthFunc = e.depthFunc, this.depthTest = e.depthTest, this.depthWrite = e.depthWrite, this.stencilWriteMask = e.stencilWriteMask, this.stencilFunc = e.stencilFunc, this.stencilRef = e.stencilRef, this.stencilFuncMask = e.stencilFuncMask, this.stencilFail = e.stencilFail, this.stencilZFail = e.stencilZFail, this.stencilZPass = e.stencilZPass, this.stencilWrite = e.stencilWrite; const r = e.clippingPlanes; let i = null; if (r !== null) { const n = r.length; i = new Array(n); for (let a = 0; a !== n; ++a) i[a] = r[a].clone(); } return this.clippingPlanes = i, this.clipIntersection = e.clipIntersection, this.clipShadows = e.clipShadows, this.shadowSide = e.shadowSide, this.colorWrite = e.colorWrite, this.precision = e.precision, this.polygonOffset = e.polygonOffset, this.polygonOffsetFactor = e.polygonOffsetFactor, this.polygonOffsetUnits = e.polygonOffsetUnits, this.dithering = e.dithering, this.alphaTest = e.alphaTest, this.alphaToCoverage = e.alphaToCoverage, this.premultipliedAlpha = e.premultipliedAlpha, this.visible = e.visible, this.toneMapped = e.toneMapped, this.userData = JSON.parse(JSON.stringify(e.userData)), this; } dispose() { this.dispatchEvent({ type: "dispose" }); } set needsUpdate(e) { e === !0 && this.version++; } } jr.prototype.isMaterial = !0; const NR = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, aquamarine: 8388564, azure: 15794175, beige: 16119260, bisque: 16770244, black: 0, blanchedalmond: 16772045, blue: 255, blueviolet: 9055202, brown: 10824234, burlywood: 14596231, cadetblue: 6266528, chartreuse: 8388352, chocolate: 13789470, coral: 16744272, cornflowerblue: 6591981, cornsilk: 16775388, crimson: 14423100, cyan: 65535, darkblue: 139, darkcyan: 35723, darkgoldenrod: 12092939, darkgray: 11119017, darkgreen: 25600, darkgrey: 11119017, darkkhaki: 12433259, darkmagenta: 9109643, darkolivegreen: 5597999, darkorange: 16747520, darkorchid: 10040012, darkred: 9109504, darksalmon: 15308410, darkseagreen: 9419919, darkslateblue: 4734347, darkslategray: 3100495, darkslategrey: 3100495, darkturquoise: 52945, darkviolet: 9699539, deeppink: 16716947, deepskyblue: 49151, dimgray: 6908265, dimgrey: 6908265, dodgerblue: 2003199, firebrick: 11674146, floralwhite: 16775920, forestgreen: 2263842, fuchsia: 16711935, gainsboro: 14474460, ghostwhite: 16316671, gold: 16766720, goldenrod: 14329120, gray: 8421504, green: 32768, greenyellow: 11403055, grey: 8421504, honeydew: 15794160, hotpink: 16738740, indianred: 13458524, indigo: 4915330, ivory: 16777200, khaki: 15787660, lavender: 15132410, lavenderblush: 16773365, lawngreen: 8190976, lemonchiffon: 16775885, lightblue: 11393254, lightcoral: 15761536, lightcyan: 14745599, lightgoldenrodyellow: 16448210, lightgray: 13882323, lightgreen: 9498256, lightgrey: 13882323, lightpink: 16758465, lightsalmon: 16752762, lightseagreen: 2142890, lightskyblue: 8900346, lightslategray: 7833753, lightslategrey: 7833753, lightsteelblue: 11584734, lightyellow: 16777184, lime: 65280, limegreen: 3329330, linen: 16445670, magenta: 16711935, maroon: 8388608, mediumaquamarine: 6737322, mediumblue: 205, mediumorchid: 12211667, mediumpurple: 9662683, mediumseagreen: 3978097, mediumslateblue: 8087790, mediumspringgreen: 64154, mediumturquoise: 4772300, mediumvioletred: 13047173, midnightblue: 1644912, mintcream: 16121850, mistyrose: 16770273, moccasin: 16770229, navajowhite: 16768685, navy: 128, oldlace: 16643558, olive: 8421376, olivedrab: 7048739, orange: 16753920, orangered: 16729344, orchid: 14315734, palegoldenrod: 15657130, palegreen: 10025880, paleturquoise: 11529966, palevioletred: 14381203, papayawhip: 16773077, peachpuff: 16767673, peru: 13468991, pink: 16761035, plum: 14524637, powderblue: 11591910, purple: 8388736, rebeccapurple: 6697881, red: 16711680, rosybrown: 12357519, royalblue: 4286945, saddlebrown: 9127187, salmon: 16416882, sandybrown: 16032864, seagreen: 3050327, seashell: 16774638, sienna: 10506797, silver: 12632256, skyblue: 8900331, slateblue: 6970061, slategray: 7372944, slategrey: 7372944, snow: 16775930, springgreen: 65407, steelblue: 4620980, tan: 13808780, teal: 32896, thistle: 14204888, tomato: 16737095, turquoise: 4251856, violet: 15631086, wheat: 16113331, white: 16777215, whitesmoke: 16119285, yellow: 16776960, yellowgreen: 10145074 }, Dn = { h: 0, s: 0, l: 0 }, mf = { h: 0, s: 0, l: 0 }; function T0(t, e, r) { return r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? t + (e - t) * 6 * r : r < 1 / 2 ? e : r < 2 / 3 ? t + (e - t) * 6 * (2 / 3 - r) : t; } function C0(t) { return t < 0.04045 ? t * 0.0773993808 : Math.pow(t * 0.9478672986 + 0.0521327014, 2.4); } function A0(t) { return t < 31308e-7 ? t * 12.92 : 1.055 * Math.pow(t, 0.41666) - 0.055; } class Je { constructor(e, r, i) { return r === void 0 && i === void 0 ? this.set(e) : this.setRGB(e, r, i); } set(e) { return e && e.isColor ? this.copy(e) : typeof e == "number" ? this.setHex(e) : typeof e == "string" && this.setStyle(e), this; } setScalar(e) { return this.r = e, this.g = e, this.b = e, this; } setHex(e) { return e = Math.floor(e), this.r = (e >> 16 & 255) / 255, this.g = (e >> 8 & 255) / 255, this.b = (e & 255) / 255, this; } setRGB(e, r, i) { return this.r = e, this.g = r, this.b = i, this; } setHSL(e, r, i) { if (e = Fx(e, 1), r = ci(r, 0, 1), i = ci(i, 0, 1), r === 0) this.r = this.g = this.b = i; else { const n = i <= 0.5 ? i * (1 + r) : i + r - i * r, a = 2 * i - n; this.r = T0(a, n, e + 1 / 3), this.g = T0(a, n, e), this.b = T0(a, n, e - 1 / 3); } return this; } setStyle(e) { function r(n) { n !== void 0 && parseFloat(n) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored."); } let i; if (i = /^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)) { let n; const a = i[1], o = i[2]; switch (a) { case "rgb": case "rgba": if (n = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)) return this.r = Math.min(255, parseInt(n[1], 10)) / 255, this.g = Math.min(255, parseInt(n[2], 10)) / 255, this.b = Math.min(255, parseInt(n[3], 10)) / 255, r(n[4]), this; if (n = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)) return this.r = Math.min(100, parseInt(n[1], 10)) / 100, this.g = Math.min(100, parseInt(n[2], 10)) / 100, this.b = Math.min(100, parseInt(n[3], 10)) / 100, r(n[4]), this; break; case "hsl": case "hsla": if (n = /^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)) { const s = parseFloat(n[1]) / 360, c = parseInt(n[2], 10) / 100, l = parseInt(n[3], 10) / 100; return r(n[4]), this.setHSL(s, c, l); } break; } } else if (i = /^\#([A-Fa-f\d]+)$/.exec(e)) { const n = i[1], a = n.length; if (a === 3) return this.r = parseInt(n.charAt(0) + n.charAt(0), 16) / 255, this.g = parseInt(n.charAt(1) + n.charAt(1), 16) / 255, this.b = parseInt(n.charAt(2) + n.charAt(2), 16) / 255, this; if (a === 6) return this.r = parseInt(n.charAt(0) + n.charAt(1), 16) / 255, this.g = parseInt(n.charAt(2) + n.charAt(3), 16) / 255, this.b = parseInt(n.charAt(4) + n.charAt(5), 16) / 255, this; } return e && e.length > 0 ? this.setColorName(e) : this; } setColorName(e) { const r = NR[e.toLowerCase()]; return r !== void 0 ? this.setHex(r) : console.warn("THREE.Color: Unknown color " + e), this; } clone() { return new this.constructor(this.r, this.g, this.b); } copy(e) { return this.r = e.r, this.g = e.g, this.b = e.b, this; } copyGammaToLinear(e, r = 2) { return this.r = Math.pow(e.r, r), this.g = Math.pow(e.g, r), this.b = Math.pow(e.b, r), this; } copyLinearToGamma(e, r = 2) { const i = r > 0 ? 1 / r : 1; return this.r = Math.pow(e.r, i), this.g = Math.pow(e.g, i), this.b = Math.pow(e.b, i), this; } convertGammaToLinear(e) { return this.copyGammaToLinear(this, e), this; } convertLinearToGamma(e) { return this.copyLinearToGamma(this, e), this; } copySRGBToLinear(e) { return this.r = C0(e.r), this.g = C0(e.g), this.b = C0(e.b), this; } copyLinearToSRGB(e) { return this.r = A0(e.r), this.g = A0(e.g), this.b = A0(e.b), this; } convertSRGBToLinear() { return this.copySRGBToLinear(this), this; } convertLinearToSRGB() { return this.copyLinearToSRGB(this), this; } getHex() { return this.r * 255 << 16 ^ this.g * 255 << 8 ^ this.b * 255 << 0; } getHexString() { return ("000000" + this.getHex().toString(16)).slice(-6); } getHSL(e) { const r = this.r, i = this.g, n = this.b, a = Math.max(r, i, n), o = Math.min(r, i, n); let s, c; const l = (o + a) / 2; if (o === a) s = 0, c = 0; else { const u = a - o; switch (c = l <= 0.5 ? u / (a + o) : u / (2 - a - o), a) { case r: s = (i - n) / u + (i < n ? 6 : 0); break; case i: s = (n - r) / u + 2; break; case n: s = (r - i) / u + 4; break; } s /= 6; } return e.h = s, e.s = c, e.l = l, e; } getStyle() { return "rgb(" + (this.r * 255 | 0) + "," + (this.g * 255 | 0) + "," + (this.b * 255 | 0) + ")"; } offsetHSL(e, r, i) { return this.getHSL(Dn), Dn.h += e, Dn.s += r, Dn.l += i, this.setHSL(Dn.h, Dn.s, Dn.l), this; } add(e) { return this.r += e.r, this.g += e.g, this.b += e.b, this; } addColors(e, r) { return this.r = e.r + r.r, this.g = e.g + r.g, this.b = e.b + r.b, this; } addScalar(e) { return this.r += e, this.g += e, this.b += e, this; } sub(e) { return this.r = Math.max(0, this.r - e.r), this.g = Math.max(0, this.g - e.g), this.b = Math.max(0, this.b - e.b), this; } multiply(e) { return this.r *= e.r, this.g *= e.g, this.b *= e.b, this; } multiplyScalar(e) { return this.r *= e, this.g *= e, this.b *= e, this; } lerp(e, r) { return this.r += (e.r - this.r) * r, this.g += (e.g - this.g) * r, this.b += (e.b - this.b) * r, this; } lerpColors(e, r, i) { return this.r = e.r + (r.r - e.r) * i, this.g = e.g + (r.g - e.g) * i, this.b = e.b + (r.b - e.b) * i, this; } lerpHSL(e, r) { this.getHSL(Dn), e.getHSL(mf); const i = th(Dn.h, mf.h, r), n = th(Dn.s, mf.s, r), a = th(Dn.l, mf.l, r); return this.setHSL(i, n, a), this; } equals(e) { return e.r === this.r && e.g === this.g && e.b === this.b; } fromArray(e, r = 0) { return this.r = e[r], this.g = e[r + 1], this.b = e[r + 2], this; } toArray(e = [], r = 0) { return e[r] = this.r, e[r + 1] = this.g, e[r + 2] = this.b, e; } fromBufferAttribute(e, r) { return this.r = e.getX(r), this.g = e.getY(r), this.b = e.getZ(r), e.normalized === !0 && (this.r /= 255, this.g /= 255, this.b /= 255), this; } toJSON() { return this.getHex(); } } Je.NAMES = NR; Je.prototype.isColor = !0; Je.prototype.r = 1; Je.prototype.g = 1; Je.prototype.b = 1; class Hi extends jr { constructor(e) { super(), this.type = "MeshBasicMaterial", this.color = new Je(16777215), this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.combine = mp, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.morphTargets = !1, this.setValues(e); } copy(e) { return super.copy(e), this.color.copy(e.color), this.map = e.map, this.lightMap = e.lightMap, this.lightMapIntensity = e.lightMapIntensity, this.aoMap = e.aoMap, this.aoMapIntensity = e.aoMapIntensity, this.specularMap = e.specularMap, this.alphaMap = e.alphaMap, this.envMap = e.envMap, this.combine = e.combine, this.reflectivity = e.reflectivity, this.refractionRatio = e.refractionRatio, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.morphTargets = e.morphTargets, this; } } Hi.prototype.isMeshBasicMaterial = !0; const sr = /* @__PURE__ */ new de(), gf = /* @__PURE__ */ new je(); class kt { constructor(e, r, i) { if (Array.isArray(e)) throw new TypeError("THREE.BufferAttribute: array should be a Typed Array."); this.name = "", this.array = e, this.itemSize = r, this.count = e !== void 0 ? e.length / r : 0, this.normalized = i === !0, this.usage = gu, this.updateRange = { offset: 0, count: -1 }, this.version = 0; } onUploadCallback() { } set needsUpdate(e) { e === !0 && this.version++; } setUsage(e) { return this.usage = e, this; } copy(e) { return this.name = e.name, this.array = new e.array.constructor(e.array), this.itemSize = e.itemSize, this.count = e.count, this.normalized = e.normalized, this.usage = e.usage, this; } copyAt(e, r, i) { e *= this.itemSize, i *= r.itemSize; for (let n = 0, a = this.itemSize; n < a; n++) this.array[e + n] = r.array[i + n]; return this; } copyArray(e) { return this.array.set(e), this; } copyColorsArray(e) { const r = this.array; let i = 0; for (let n = 0, a = e.length; n < a; n++) { let o = e[n]; o === void 0 && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n), o = new Je()), r[i++] = o.r, r[i++] = o.g, r[i++] = o.b; } return this; } copyVector2sArray(e) { const r = this.array; let i = 0; for (let n = 0, a = e.length; n < a; n++) { let o = e[n]; o === void 0 && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n), o = new je()), r[i++] = o.x, r[i++] = o.y; } return this; } copyVector3sArray(e) { const r = this.array; let i = 0; for (let n = 0, a = e.length; n < a; n++) { let o = e[n]; o === void 0 && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n), o = new de()), r[i++] = o.x, r[i++] = o.y, r[i++] = o.z; } return this; } copyVector4sArray(e) { const r = this.array; let i = 0; for (let n = 0, a = e.length; n < a; n++) { let o = e[n]; o === void 0 && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n), o = new Qt()), r[i++] = o.x, r[i++] = o.y, r[i++] = o.z, r[i++] = o.w; } return this; } applyMatrix3(e) { if (this.itemSize === 2) for (let r = 0, i = this.count; r < i; r++) gf.fromBufferAttribute(this, r), gf.applyMatrix3(e), this.setXY(r, gf.x, gf.y); else if (this.itemSize === 3) for (let r = 0, i = this.count; r < i; r++) sr.fromBufferAttribute(this, r), sr.applyMatrix3(e), this.setXYZ(r, sr.x, sr.y, sr.z); return this; } applyMatrix4(e) { for (let r = 0, i = this.count; r < i; r++) sr.x = this.getX(r), sr.y = this.getY(r), sr.z = this.getZ(r), sr.applyMatrix4(e), this.setXYZ(r, sr.x, sr.y, sr.z); return this; } applyNormalMatrix(e) { for (let r = 0, i = this.count; r < i; r++) sr.x = this.getX(r), sr.y = this.getY(r), sr.z = this.getZ(r), sr.applyNormalMatrix(e), this.setXYZ(r, sr.x, sr.y, sr.z); return this; } transformDirection(e) { for (let r = 0, i = this.count; r < i; r++) sr.x = this.getX(r), sr.y = this.getY(r), sr.z = this.getZ(r), sr.transformDirection(e), this.setXYZ(r, sr.x, sr.y, sr.z); return this; } set(e, r = 0) { return this.array.set(e, r), this; } getX(e) { return this.array[e * this.itemSize]; } setX(e, r) { return this.array[e * this.itemSize] = r, this; } getY(e) { return this.array[e * this.itemSize + 1]; } setY(e, r) { return this.array[e * this.itemSize + 1] = r, this; } getZ(e) { return this.array[e * this.itemSize + 2]; } setZ(e, r) { return this.array[e * this.itemSize + 2] = r, this; } getW(e) { return this.array[e * this.itemSize + 3]; } setW(e, r) { return this.array[e * this.itemSize + 3] = r, this; } setXY(e, r, i) { return e *= this.itemSize, this.array[e + 0] = r, this.array[e + 1] = i, this; } setXYZ(e, r, i, n) { return e *= this.itemSize, this.array[e + 0] = r, this.array[e + 1] = i, this.array[e + 2] = n, this; } setXYZW(e, r, i, n, a) { return e *= this.itemSize, this.array[e + 0] = r, this.array[e + 1] = i, this.array[e + 2] = n, this.array[e + 3] = a, this; } onUpload(e) { return this.onUploadCallback = e, this; } clone() { return new this.constructor(this.array, this.itemSize).copy(this); } toJSON() { const e = { itemSize: this.itemSize, type: this.array.constructor.name, array: Array.prototype.slice.call(this.array), normalized: this.normalized }; return this.name !== "" && (e.name = this.name), this.usage !== gu && (e.usage = this.usage), (this.updateRange.offset !== 0 || this.updateRange.count !== -1) && (e.updateRange = this.updateRange), e; } } kt.prototype.isBufferAttribute = !0; class BR extends kt { constructor(e, r, i) { super(new Int8Array(e), r, i); } } class FR extends kt { constructor(e, r, i) { super(new Uint8Array(e), r, i); } } class zR extends kt { constructor(e, r, i) { super(new Uint8ClampedArray(e), r, i); } } class $R extends kt { constructor(e, r, i) { super(new Int16Array(e), r, i); } } class cv extends kt { constructor(e, r, i) { super(new Uint16Array(e), r, i); } } class VR extends kt { constructor(e, r, i) { super(new Int32Array(e), r, i); } } class uv extends kt { constructor(e, r, i) { super(new Uint32Array(e), r, i); } } class UR extends kt { constructor(e, r, i) { super(new Uint16Array(e), r, i); } } UR.prototype.isFloat16BufferAttribute = !0; class it extends kt { constructor(e, r, i) { super(new Float32Array(e), r, i); } } class jR extends kt { constructor(e, r, i) { super(new Float64Array(e), r, i); } } function HR(t) { if (t.length === 0) return -1 / 0; let e = t[0]; for (let r = 1, i = t.length; r < i; ++r) t[r] > e && (e = t[r]); return e; } const Hoe = { Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array }; function Nc(t, e) { return new Hoe[t](e); } let Goe = 0; const mn = /* @__PURE__ */ new at(), L0 = /* @__PURE__ */ new It(), gc = /* @__PURE__ */ new de(), en = /* @__PURE__ */ new Ki(), Sd = /* @__PURE__ */ new Ki(), Qr = /* @__PURE__ */ new de(); class ft extends Os { constructor() { super(), Object.defineProperty(this, "id", { value: Goe++ }), this.uuid = ln(), this.name = "", this.type = "BufferGeometry", this.index = null, this.attributes = {}, this.morphAttributes = {}, this.morphTargetsRelative = !1, this.groups = [], this.boundingBox = null, this.boundingSphere = null, this.drawRange = { start: 0, count: 1 / 0 }, this.userData = {}; } getIndex() { return this.index; } setIndex(e) { return Array.isArray(e) ? this.index = new (HR(e) > 65535 ? uv : cv)(e, 1) : this.index = e, this; } getAttribute(e) { return this.attributes[e]; } setAttribute(e, r) { return this.attributes[e] = r, this; } deleteAttribute(e) { return delete this.attributes[e], this; } hasAttribute(e) { return this.attributes[e] !== void 0; } addGroup(e, r, i = 0) { this.groups.push({ start: e, count: r, materialIndex: i }); } clearGroups() { this.groups = []; } setDrawRange(e, r) { this.drawRange.start = e, this.drawRange.count = r; } applyMatrix4(e) { const r = this.attributes.position; r !== void 0 && (r.applyMatrix4(e), r.needsUpdate = !0); const i = this.attributes.normal; if (i !== void 0) { const a = new Xr().getNormalMatrix(e); i.applyNormalMatrix(a), i.needsUpdate = !0; } const n = this.attributes.tangent; return n !== void 0 && (n.transformDirection(e), n.needsUpdate = !0), this.boundingBox !== null && this.computeBoundingBox(), this.boundingSphere !== null && this.computeBoundingSphere(), this; } applyQuaternion(e) { return mn.makeRotationFromQuaternion(e), this.applyMatrix4(mn), this; } rotateX(e) { return mn.makeRotationX(e), this.applyMatrix4(mn), this; } rotateY(e) { return mn.makeRotationY(e), this.applyMatrix4(mn), this; } rotateZ(e) { return mn.makeRotationZ(e), this.applyMatrix4(mn), this; } translate(e, r, i) { return mn.makeTranslation(e, r, i), this.applyMatrix4(mn), this; } scale(e, r, i) { return mn.makeScale(e, r, i), this.applyMatrix4(mn), this; } lookAt(e) { return L0.lookAt(e), L0.updateMatrix(), this.applyMatrix4(L0.matrix), this; } center() { return this.computeBoundingBox(), this.boundingBox.getCenter(gc).negate(), this.translate(gc.x, gc.y, gc.z), this; } setFromPoints(e) { const r = []; for (let i = 0, n = e.length; i < n; i++) { const a = e[i]; r.push(a.x, a.y, a.z || 0); } return this.setAttribute("position", new it(r, 3)), this; } computeBoundingBox() { this.boundingBox === null && (this.boundingBox = new Ki()); const e = this.attributes.position, r = this.morphAttributes.position; if (e && e.isGLBufferAttribute) { console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".', this), this.boundingBox.set( new de(-1 / 0, -1 / 0, -1 / 0), new de(1 / 0, 1 / 0, 1 / 0) ); return; } if (e !== void 0) { if (this.boundingBox.setFromBufferAttribute(e), r) for (let i = 0, n = r.length; i < n; i++) { const a = r[i]; en.setFromBufferAttribute(a), this.morphTargetsRelative ? (Qr.addVectors(this.boundingBox.min, en.min), this.boundingBox.expandByPoint(Qr), Qr.addVectors(this.boundingBox.max, en.max), this.boundingBox.expandByPoint(Qr)) : (this.boundingBox.expandByPoint(en.min), this.boundingBox.expandByPoint(en.max)); } } else this.boundingBox.makeEmpty(); (isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) && console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this); } computeBoundingSphere() { this.boundingSphere === null && (this.boundingSphere = new _o()); const e = this.attributes.position, r = this.morphAttributes.position; if (e && e.isGLBufferAttribute) { console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".', this), this.boundingSphere.set(new de(), 1 / 0); return; } if (e) { const i = this.boundingSphere.center; if (en.setFromBufferAttribute(e), r) for (let a = 0, o = r.length; a < o; a++) { const s = r[a]; Sd.setFromBufferAttribute(s), this.morphTargetsRelative ? (Qr.addVectors(en.min, Sd.min), en.expandByPoint(Qr), Qr.addVectors(en.max, Sd.max), en.expandByPoint(Qr)) : (en.expandByPoint(Sd.min), en.expandByPoint(Sd.max)); } en.getCenter(i); let n = 0; for (let a = 0, o = e.count; a < o; a++) Qr.fromBufferAttribute(e, a), n = Math.max(n, i.distanceToSquared(Qr)); if (r) for (let a = 0, o = r.length; a < o; a++) { const s = r[a], c = this.morphTargetsRelative; for (let l = 0, u = s.count; l < u; l++) Qr.fromBufferAttribute(s, l), c && (gc.fromBufferAttribute(e, l), Qr.add(gc)), n = Math.max(n, i.distanceToSquared(Qr)); } this.boundingSphere.radius = Math.sqrt(n), isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this); } } computeFaceNormals() { } computeTangents() { const e = this.index, r = this.attributes; if (e === null || r.position === void 0 || r.normal === void 0 || r.uv === void 0) { console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)"); return; } const i = e.array, n = r.position.array, a = r.normal.array, o = r.uv.array, s = n.length / 3; r.tangent === void 0 && this.setAttribute("tangent", new kt(new Float32Array(4 * s), 4)); const c = r.tangent.array, l = [], u = []; for (let C = 0; C < s; C++) l[C] = new de(), u[C] = new de(); const d = new de(), h = new de(), f = new de(), p = new je(), m = new je(), y = new je(), g = new de(), v = new de(); function x(C, L, A) { d.fromArray(n, C * 3), h.fromArray(n, L * 3), f.fromArray(n, A * 3), p.fromArray(o, C * 2), m.fromArray(o, L * 2), y.fromArray(o, A * 2), h.sub(d), f.sub(d), m.sub(p), y.sub(p); const k = 1 / (m.x * y.y - y.x * m.y); isFinite(k) && (g.copy(h).multiplyScalar(y.y).addScaledVector(f, -m.y).multiplyScalar(k), v.copy(f).multiplyScalar(m.x).addScaledVector(h, -y.x).multiplyScalar(k), l[C].add(g), l[L].add(g), l[A].add(g), u[C].add(v), u[L].add(v), u[A].add(v)); } let w = this.groups; w.length === 0 && (w = [{ start: 0, count: i.length }]); for (let C = 0, L = w.length; C < L; ++C) { const A = w[C], k = A.start, P = A.count; for (let R = k, M = k + P; R < M; R += 3) x( i[R + 0], i[R + 1], i[R + 2] ); } const S = new de(), _ = new de(), b = new de(), T = new de(); function E(C) { b.fromArray(a, C * 3), T.copy(b); const L = l[C]; S.copy(L), S.sub(b.multiplyScalar(b.dot(L))).normalize(), _.crossVectors(T, L); const A = _.dot(u[C]) < 0 ? -1 : 1; c[C * 4] = S.x, c[C * 4 + 1] = S.y, c[C * 4 + 2] = S.z, c[C * 4 + 3] = A; } for (let C = 0, L = w.length; C < L; ++C) { const A = w[C], k = A.start, P = A.count; for (let R = k, M = k + P; R < M; R += 3) E(i[R + 0]), E(i[R + 1]), E(i[R + 2]); } } computeVertexNormals() { const e = this.index, r = this.getAttribute("position"); if (r !== void 0) { let i = this.getAttribute("normal"); if (i === void 0) i = new kt(new Float32Array(r.count * 3), 3), this.setAttribute("normal", i); else for (let h = 0, f = i.count; h < f; h++) i.setXYZ(h, 0, 0, 0); const n = new de(), a = new de(), o = new de(), s = new de(), c = new de(), l = new de(), u = new de(), d = new de(); if (e) for (let h = 0, f = e.count; h < f; h += 3) { const p = e.getX(h + 0), m = e.getX(h + 1), y = e.getX(h + 2); n.fromBufferAttribute(r, p), a.fromBufferAttribute(r, m), o.fromBufferAttribute(r, y), u.subVectors(o, a), d.subVectors(n, a), u.cross(d), s.fromBufferAttribute(i, p), c.fromBufferAttribute(i, m), l.fromBufferAttribute(i, y), s.add(u), c.add(u), l.add(u), i.setXYZ(p, s.x, s.y, s.z), i.setXYZ(m, c.x, c.y, c.z), i.setXYZ(y, l.x, l.y, l.z); } else for (let h = 0, f = r.count; h < f; h += 3) n.fromBufferAttribute(r, h + 0), a.fromBufferAttribute(r, h + 1), o.fromBufferAttribute(r, h + 2), u.subVectors(o, a), d.subVectors(n, a), u.cross(d), i.setXYZ(h + 0, u.x, u.y, u.z), i.setXYZ(h + 1, u.x, u.y, u.z), i.setXYZ(h + 2, u.x, u.y, u.z); this.normalizeNormals(), i.needsUpdate = !0; } } merge(e, r) { if (!(e && e.isBufferGeometry)) { console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e); return; } r === void 0 && (r = 0, console.warn( "THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge." )); const i = this.attributes; for (const n in i) { if (e.attributes[n] === void 0) continue; const a = i[n].array, o = e.attributes[n], s = o.array, c = o.itemSize * r, l = Math.min(s.length, a.length - c); for (let u = 0, d = c; u < l; u++, d++) a[d] = s[u]; } return this; } normalizeNormals() { const e = this.attributes.normal; for (let r = 0, i = e.count; r < i; r++) Qr.fromBufferAttribute(e, r), Qr.normalize(), e.setXYZ(r, Qr.x, Qr.y, Qr.z); } toNonIndexed() { function e(s, c) { const l = s.array, u = s.itemSize, d = s.normalized, h = new l.constructor(c.length * u); let f = 0, p = 0; for (let m = 0, y = c.length; m < y; m++) { s.isInterleavedBufferAttribute ? f = c[m] * s.data.stride + s.offset : f = c[m] * u; for (let g = 0; g < u; g++) h[p++] = l[f++]; } return new kt(h, u, d); } if (this.index === null) return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."), this; const r = new ft(), i = this.index.array, n = this.attributes; for (const s in n) { const c = n[s], l = e(c, i); r.setAttribute(s, l); } const a = this.morphAttributes; for (const s in a) { const c = [], l = a[s]; for (let u = 0, d = l.length; u < d; u++) { const h = l[u], f = e(h, i); c.push(f); } r.morphAttributes[s] = c; } r.morphTargetsRelative = this.morphTargetsRelative; const o = this.groups; for (let s = 0, c = o.length; s < c; s++) { const l = o[s]; r.addGroup(l.start, l.count, l.materialIndex); } return r; } toJSON() { const e = { metadata: { version: 4.5, type: "BufferGeometry", generator: "BufferGeometry.toJSON" } }; if (e.uuid = this.uuid, e.type = this.type, this.name !== "" && (e.name = this.name), Object.keys(this.userData).length > 0 && (e.userData = this.userData), this.parameters !== void 0) { const c = this.parameters; for (const l in c) c[l] !== void 0 && (e[l] = c[l]); return e; } e.data = { attributes: {} }; const r = this.index; r !== null && (e.data.index = { type: r.array.constructor.name, array: Array.prototype.slice.call(r.array) }); const i = this.attributes; for (const c in i) { const l = i[c]; e.data.attributes[c] = l.toJSON(e.data); } const n = {}; let a = !1; for (const c in this.morphAttributes) { const l = this.morphAttributes[c], u = []; for (let d = 0, h = l.length; d < h; d++) { const f = l[d]; u.push(f.toJSON(e.data)); } u.length > 0 && (n[c] = u, a = !0); } a && (e.data.morphAttributes = n, e.data.morphTargetsRelative = this.morphTargetsRelative); const o = this.groups; o.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(o))); const s = this.boundingSphere; return s !== null && (e.data.boundingSphere = { center: s.center.toArray(), radius: s.radius }), e; } clone() { return new ft().copy(this); } copy(e) { this.index = null, this.attributes = {}, this.morphAttributes = {}, this.groups = [], this.boundingBox = null, this.boundingSphere = null; const r = {}; this.name = e.name; const i = e.index; i !== null && this.setIndex(i.clone(r)); const n = e.attributes; for (const l in n) { const u = n[l]; this.setAttribute(l, u.clone(r)); } const a = e.morphAttributes; for (const l in a) { const u = [], d = a[l]; for (let h = 0, f = d.length; h < f; h++) u.push(d[h].clone(r)); this.morphAttributes[l] = u; } this.morphTargetsRelative = e.morphTargetsRelative; const o = e.groups; for (let l = 0, u = o.length; l < u; l++) { const d = o[l]; this.addGroup(d.start, d.count, d.materialIndex); } const s = e.boundingBox; s !== null && (this.boundingBox = s.clone()); const c = e.boundingSphere; return c !== null && (this.boundingSphere = c.clone()), this.drawRange.start = e.drawRange.start, this.drawRange.count = e.drawRange.count, this.userData = e.userData, this; } dispose() { this.dispatchEvent({ type: "dispose" }); } } ft.prototype.isBufferGeometry = !0; const GM = /* @__PURE__ */ new at(), vc = /* @__PURE__ */ new Ds(), k0 = /* @__PURE__ */ new _o(), Do = /* @__PURE__ */ new de(), Io = /* @__PURE__ */ new de(), No = /* @__PURE__ */ new de(), P0 = /* @__PURE__ */ new de(), R0 = /* @__PURE__ */ new de(), O0 = /* @__PURE__ */ new de(), vf = /* @__PURE__ */ new de(), yf = /* @__PURE__ */ new de(), bf = /* @__PURE__ */ new de(), xf = /* @__PURE__ */ new je(), wf = /* @__PURE__ */ new je(), _f = /* @__PURE__ */ new je(), D0 = /* @__PURE__ */ new de(), Sf = /* @__PURE__ */ new de(); class Fr extends It { constructor(e = new ft(), r = new Hi()) { super(), this.type = "Mesh", this.geometry = e, this.material = r, this.updateMorphTargets(); } copy(e) { return super.copy(e), e.morphTargetInfluences !== void 0 && (this.morphTargetInfluences = e.morphTargetInfluences.slice()), e.morphTargetDictionary !== void 0 && (this.morphTargetDictionary = Object.assign({}, e.morphTargetDictionary)), this.material = e.material, this.geometry = e.geometry, this; } updateMorphTargets() { const e = this.geometry; if (e.isBufferGeometry) { const r = e.morphAttributes, i = Object.keys(r); if (i.length > 0) { const n = r[i[0]]; if (n !== void 0) { this.morphTargetInfluences = [], this.morphTargetDictionary = {}; for (let a = 0, o = n.length; a < o; a++) { const s = n[a].name || String(a); this.morphTargetInfluences.push(0), this.morphTargetDictionary[s] = a; } } } } else { const r = e.morphTargets; r !== void 0 && r.length > 0 && console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); } } raycast(e, r) { const i = this.geometry, n = this.material, a = this.matrixWorld; if (n === void 0 || (i.boundingSphere === null && i.computeBoundingSphere(), k0.copy(i.boundingSphere), k0.applyMatrix4(a), e.ray.intersectsSphere(k0) === !1) || (GM.copy(a).invert(), vc.copy(e.ray).applyMatrix4(GM), i.boundingBox !== null && vc.intersectsBox(i.boundingBox) === !1)) return; let o; if (i.isBufferGeometry) { const s = i.index, c = i.attributes.position, l = i.morphAttributes.position, u = i.morphTargetsRelative, d = i.attributes.uv, h = i.attributes.uv2, f = i.groups, p = i.drawRange; if (s !== null) if (Array.isArray(n)) for (let m = 0, y = f.length; m < y; m++) { const g = f[m], v = n[g.materialIndex], x = Math.max(g.start, p.start), w = Math.min(g.start + g.count, p.start + p.count); for (let S = x, _ = w; S < _; S += 3) { const b = s.getX(S), T = s.getX(S + 1), E = s.getX(S + 2); o = Mf(this, v, e, vc, c, l, u, d, h, b, T, E), o && (o.faceIndex = Math.floor(S / 3), o.face.materialIndex = g.materialIndex, r.push(o)); } } else { const m = Math.max(0, p.start), y = Math.min(s.count, p.start + p.count); for (let g = m, v = y; g < v; g += 3) { const x = s.getX(g), w = s.getX(g + 1), S = s.getX(g + 2); o = Mf(this, n, e, vc, c, l, u, d, h, x, w, S), o && (o.faceIndex = Math.floor(g / 3), r.push(o)); } } else if (c !== void 0) if (Array.isArray(n)) for (let m = 0, y = f.length; m < y; m++) { const g = f[m], v = n[g.materialIndex], x = Math.max(g.start, p.start), w = Math.min(g.start + g.count, p.start + p.count); for (let S = x, _ = w; S < _; S += 3) { const b = S, T = S + 1, E = S + 2; o = Mf(this, v, e, vc, c, l, u, d, h, b, T, E), o && (o.faceIndex = Math.floor(S / 3), o.face.materialIndex = g.materialIndex, r.push(o)); } } else { const m = Math.max(0, p.start), y = Math.min(c.count, p.start + p.count); for (let g = m, v = y; g < v; g += 3) { const x = g, w = g + 1, S = g + 2; o = Mf(this, n, e, vc, c, l, u, d, h, x, w, S), o && (o.faceIndex = Math.floor(g / 3), r.push(o)); } } } else i.isGeometry && console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); } } Fr.prototype.isMesh = !0; function Woe(t, e, r, i, n, a, o, s) { let c; if (e.side === Or ? c = i.intersectTriangle(o, a, n, !0, s) : c = i.intersectTriangle(n, a, o, e.side !== ws, s), c === null) return null; Sf.copy(s), Sf.applyMatrix4(t.matrixWorld); const l = r.ray.origin.distanceTo(Sf); return l < r.near || l > r.far ? null : { distance: l, point: Sf.clone(), object: t }; } function Mf(t, e, r, i, n, a, o, s, c, l, u, d) { Do.fromBufferAttribute(n, l), Io.fromBufferAttribute(n, u), No.fromBufferAttribute(n, d); const h = t.morphTargetInfluences; if (e.morphTargets && a && h) { vf.set(0, 0, 0), yf.set(0, 0, 0), bf.set(0, 0, 0); for (let p = 0, m = a.length; p < m; p++) { const y = h[p], g = a[p]; y !== 0 && (P0.fromBufferAttribute(g, l), R0.fromBufferAttribute(g, u), O0.fromBufferAttribute(g, d), o ? (vf.addScaledVector(P0, y), yf.addScaledVector(R0, y), bf.addScaledVector(O0, y)) : (vf.addScaledVector(P0.sub(Do), y), yf.addScaledVector(R0.sub(Io), y), bf.addScaledVector(O0.sub(No), y))); } Do.add(vf), Io.add(yf), No.add(bf); } t.isSkinnedMesh && (t.boneTransform(l, Do), t.boneTransform(u, Io), t.boneTransform(d, No)); const f = Woe(t, e, r, i, Do, Io, No, D0); if (f) { s && (xf.fromBufferAttribute(s, l), wf.fromBufferAttribute(s, u), _f.fromBufferAttribute(s, d), f.uv = Ir.getUV(D0, Do, Io, No, xf, wf, _f, new je())), c && (xf.fromBufferAttribute(c, l), wf.fromBufferAttribute(c, u), _f.fromBufferAttribute(c, d), f.uv2 = Ir.getUV(D0, Do, Io, No, xf, wf, _f, new je())); const p = { a: l, b: u, c: d, normal: new de(), materialIndex: 0 }; Ir.getNormal(Do, Io, No, p.normal), f.face = p; } return f; } class oo extends ft { constructor(e = 1, r = 1, i = 1, n = 1, a = 1, o = 1) { super(), this.type = "BoxGeometry", this.parameters = { width: e, height: r, depth: i, widthSegments: n, heightSegments: a, depthSegments: o }; const s = this; n = Math.floor(n), a = Math.floor(a), o = Math.floor(o); const c = [], l = [], u = [], d = []; let h = 0, f = 0; p("z", "y", "x", -1, -1, i, r, e, o, a, 0), p("z", "y", "x", 1, -1, i, r, -e, o, a, 1), p("x", "z", "y", 1, 1, e, i, r, n, o, 2), p("x", "z", "y", 1, -1, e, i, -r, n, o, 3), p("x", "y", "z", 1, -1, e, r, i, n, a, 4), p("x", "y", "z", -1, -1, e, r, -i, n, a, 5), this.setIndex(c), this.setAttribute("position", new it(l, 3)), this.setAttribute("normal", new it(u, 3)), this.setAttribute("uv", new it(d, 2)); function p(m, y, g, v, x, w, S, _, b, T, E) { const C = w / b, L = S / T, A = w / 2, k = S / 2, P = _ / 2, R = b + 1, M = T + 1; let O = 0, D = 0; const I = new de(); for (let F = 0; F < M; F++) { const z = F * L - k; for (let U = 0; U < R; U++) { const Z = U * C - A; I[m] = Z * v, I[y] = z * x, I[g] = P, l.push(I.x, I.y, I.z), I[m] = 0, I[y] = 0, I[g] = _ > 0 ? 1 : -1, u.push(I.x, I.y, I.z), d.push(U / b), d.push(1 - F / T), O += 1; } } for (let F = 0; F < T; F++) for (let z = 0; z < b; z++) { const U = h + z + R * F, Z = h + z + R * (F + 1), re = h + (z + 1) + R * (F + 1), K = h + (z + 1) + R * F; c.push(U, Z, K), c.push(Z, re, K), D += 6; } s.addGroup(f, D, E), f += D, h += O; } } static fromJSON(e) { return new oo(e.width, e.height, e.depth, e.widthSegments, e.heightSegments, e.depthSegments); } } function yu(t) { const e = {}; for (const r in t) { e[r] = {}; for (const i in t[r]) { const n = t[r][i]; n && (n.isColor || n.isMatrix3 || n.isMatrix4 || n.isVector2 || n.isVector3 || n.isVector4 || n.isTexture || n.isQuaternion) ? e[r][i] = n.clone() : Array.isArray(n) ? e[r][i] = n.slice() : e[r][i] = n; } } return e; } function wi(t) { const e = {}; for (let r = 0; r < t.length; r++) { const i = yu(t[r]); for (const n in i) e[n] = i[n]; } return e; } const GR = { clone: yu, merge: wi }; var qoe = `void main() { gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); }`, Xoe = `void main() { gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); }`; class so extends jr { constructor(e) { super(), this.type = "ShaderMaterial", this.defines = {}, this.uniforms = {}, this.vertexShader = qoe, this.fragmentShader = Xoe, this.linewidth = 1, this.wireframe = !1, this.wireframeLinewidth = 1, this.fog = !1, this.lights = !1, this.clipping = !1, this.morphTargets = !1, this.morphNormals = !1, this.extensions = { derivatives: !1, // set to use derivatives fragDepth: !1, // set to use fragment depth values drawBuffers: !1, // set to use draw buffers shaderTextureLOD: !1 // set to use shader texture LOD }, this.defaultAttributeValues = { color: [1, 1, 1], uv: [0, 0], uv2: [0, 0] }, this.index0AttributeName = void 0, this.uniformsNeedUpdate = !1, this.glslVersion = null, e !== void 0 && (e.attributes !== void 0 && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."), this.setValues(e)); } copy(e) { return super.copy(e), this.fragmentShader = e.fragmentShader, this.vertexShader = e.vertexShader, this.uniforms = yu(e.uniforms), this.defines = Object.assign({}, e.defines), this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.lights = e.lights, this.clipping = e.clipping, this.morphTargets = e.morphTargets, this.morphNormals = e.morphNormals, this.extensions = Object.assign({}, e.extensions), this.glslVersion = e.glslVersion, this; } toJSON(e) { const r = super.toJSON(e); r.glslVersion = this.glslVersion, r.uniforms = {}; for (const n in this.uniforms) { const a = this.uniforms[n].value; a && a.isTexture ? r.uniforms[n] = { type: "t", value: a.toJSON(e).uuid } : a && a.isColor ? r.uniforms[n] = { type: "c", value: a.getHex() } : a && a.isVector2 ? r.uniforms[n] = { type: "v2", value: a.toArray() } : a && a.isVector3 ? r.uniforms[n] = { type: "v3", value: a.toArray() } : a && a.isVector4 ? r.uniforms[n] = { type: "v4", value: a.toArray() } : a && a.isMatrix3 ? r.uniforms[n] = { type: "m3", value: a.toArray() } : a && a.isMatrix4 ? r.uniforms[n] = { type: "m4", value: a.toArray() } : r.uniforms[n] = { value: a }; } Object.keys(this.defines).length > 0 && (r.defines = this.defines), r.vertexShader = this.vertexShader, r.fragmentShader = this.fragmentShader; const i = {}; for (const n in this.extensions) this.extensions[n] === !0 && (i[n] = !0); return Object.keys(i).length > 0 && (r.extensions = i), r; } } so.prototype.isShaderMaterial = !0; class bp extends It { constructor() { super(), this.type = "Camera", this.matrixWorldInverse = new at(), this.projectionMatrix = new at(), this.projectionMatrixInverse = new at(); } copy(e, r) { return super.copy(e, r), this.matrixWorldInverse.copy(e.matrixWorldInverse), this.projectionMatrix.copy(e.projectionMatrix), this.projectionMatrixInverse.copy(e.projectionMatrixInverse), this; } getWorldDirection(e) { this.updateWorldMatrix(!0, !1); const r = this.matrixWorld.elements; return e.set(-r[8], -r[9], -r[10]).normalize(); } updateMatrixWorld(e) { super.updateMatrixWorld(e), this.matrixWorldInverse.copy(this.matrixWorld).invert(); } updateWorldMatrix(e, r) { super.updateWorldMatrix(e, r), this.matrixWorldInverse.copy(this.matrixWorld).invert(); } clone() { return new this.constructor().copy(this); } } bp.prototype.isCamera = !0; class Wr extends bp { constructor(e = 50, r = 1, i = 0.1, n = 2e3) { super(), this.type = "PerspectiveCamera", this.fov = e, this.zoom = 1, this.near = i, this.far = n, this.focus = 10, this.aspect = r, this.view = null, this.filmGauge = 35, this.filmOffset = 0, this.updateProjectionMatrix(); } copy(e, r) { return super.copy(e, r), this.fov = e.fov, this.zoom = e.zoom, this.near = e.near, this.far = e.far, this.focus = e.focus, this.aspect = e.aspect, this.view = e.view === null ? null : Object.assign({}, e.view), this.filmGauge = e.filmGauge, this.filmOffset = e.filmOffset, this; } /** * Sets the FOV by focal length in respect to the current .filmGauge. * * The default film gauge is 35, so that the focal length can be specified for * a 35mm (full frame) camera. * * Values for focal length and film gauge must have the same unit. */ setFocalLength(e) { const r = 0.5 * this.getFilmHeight() / e; this.fov = Dh * 2 * Math.atan(r), this.updateProjectionMatrix(); } /** * Calculates the focal length from the current .fov and .filmGauge. */ getFocalLength() { const e = Math.tan(fl * 0.5 * this.fov); return 0.5 * this.getFilmHeight() / e; } getEffectiveFOV() { return Dh * 2 * Math.atan( Math.tan(fl * 0.5 * this.fov) / this.zoom ); } getFilmWidth() { return this.filmGauge * Math.min(this.aspect, 1); } getFilmHeight() { return this.filmGauge / Math.max(this.aspect, 1); } /** * Sets an offset in a larger frustum. This is useful for multi-window or * multi-monitor/multi-machine setups. * * For example, if you have 3x2 monitors and each monitor is 1920x1080 and * the monitors are in grid like this * * +---+---+---+ * | A | B | C | * +---+---+---+ * | D | E | F | * +---+---+---+ * * then for each monitor you would call it like this * * const w = 1920; * const h = 1080; * const fullWidth = w * 3; * const fullHeight = h * 2; * * --A-- * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h ); * --B-- * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h ); * --C-- * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h ); * --D-- * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h ); * --E-- * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h ); * --F-- * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h ); * * Note there is no reason monitors have to be the same size or in a grid. */ setViewOffset(e, r, i, n, a, o) { this.aspect = e / r, this.view === null && (this.view = { enabled: !0, fullWidth: 1, fullHeight: 1, offsetX: 0, offsetY: 0, width: 1, height: 1 }), this.view.enabled = !0, this.view.fullWidth = e, this.view.fullHeight = r, this.view.offsetX = i, this.view.offsetY = n, this.view.width = a, this.view.height = o, this.updateProjectionMatrix(); } clearViewOffset() { this.view !== null && (this.view.enabled = !1), this.updateProjectionMatrix(); } updateProjectionMatrix() { const e = this.near; let r = e * Math.tan(fl * 0.5 * this.fov) / this.zoom, i = 2 * r, n = this.aspect * i, a = -0.5 * n; const o = this.view; if (this.view !== null && this.view.enabled) { const c = o.fullWidth, l = o.fullHeight; a += o.offsetX * n / c, r -= o.offsetY * i / l, n *= o.width / c, i *= o.height / l; } const s = this.filmOffset; s !== 0 && (a += e * s / this.getFilmWidth()), this.projectionMatrix.makePerspective(a, a + n, r, r - i, e, this.far), this.projectionMatrixInverse.copy(this.projectionMatrix).invert(); } toJSON(e) { const r = super.toJSON(e); return r.object.fov = this.fov, r.object.zoom = this.zoom, r.object.near = this.near, r.object.far = this.far, r.object.focus = this.focus, r.object.aspect = this.aspect, this.view !== null && (r.object.view = Object.assign({}, this.view)), r.object.filmGauge = this.filmGauge, r.object.filmOffset = this.filmOffset, r; } } Wr.prototype.isPerspectiveCamera = !0; const yc = 90, bc = 1; class dv extends It { constructor(e, r, i) { if (super(), this.type = "CubeCamera", i.isWebGLCubeRenderTarget !== !0) { console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter."); return; } this.renderTarget = i; const n = new Wr(yc, bc, e, r); n.layers = this.layers, n.up.set(0, -1, 0), n.lookAt(new de(1, 0, 0)), this.add(n); const a = new Wr(yc, bc, e, r); a.layers = this.layers, a.up.set(0, -1, 0), a.lookAt(new de(-1, 0, 0)), this.add(a); const o = new Wr(yc, bc, e, r); o.layers = this.layers, o.up.set(0, 0, 1), o.lookAt(new de(0, 1, 0)), this.add(o); const s = new Wr(yc, bc, e, r); s.layers = this.layers, s.up.set(0, 0, -1), s.lookAt(new de(0, -1, 0)), this.add(s); const c = new Wr(yc, bc, e, r); c.layers = this.layers, c.up.set(0, -1, 0), c.lookAt(new de(0, 0, 1)), this.add(c); const l = new Wr(yc, bc, e, r); l.layers = this.layers, l.up.set(0, -1, 0), l.lookAt(new de(0, 0, -1)), this.add(l); } update(e, r) { this.parent === null && this.updateMatrixWorld(); const i = this.renderTarget, [n, a, o, s, c, l] = this.children, u = e.xr.enabled, d = e.getRenderTarget(); e.xr.enabled = !1; const h = i.texture.generateMipmaps; i.texture.generateMipmaps = !1, e.setRenderTarget(i, 0), e.render(r, n), e.setRenderTarget(i, 1), e.render(r, a), e.setRenderTarget(i, 2), e.render(r, o), e.setRenderTarget(i, 3), e.render(r, s), e.setRenderTarget(i, 4), e.render(r, c), i.texture.generateMipmaps = h, e.setRenderTarget(i, 5), e.render(r, l), e.setRenderTarget(d), e.xr.enabled = u; } } class td extends zr { constructor(e, r, i, n, a, o, s, c, l, u) { e = e !== void 0 ? e : [], r = r !== void 0 ? r : gp, s = s !== void 0 ? s : Qa, super(e, r, i, n, a, o, s, c, l, u), this._needsFlipEnvMap = !0, this.flipY = !1; } get images() { return this.image; } set images(e) { this.image = e; } } td.prototype.isCubeTexture = !0; class hv extends Hn { constructor(e, r, i) { Number.isInteger(r) && (console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"), r = i), super(e, e, r), r = r || {}, this.texture = new td(void 0, r.mapping, r.wrapS, r.wrapT, r.magFilter, r.minFilter, r.format, r.type, r.anisotropy, r.encoding), this.texture.generateMipmaps = r.generateMipmaps !== void 0 ? r.generateMipmaps : !1, this.texture.minFilter = r.minFilter !== void 0 ? r.minFilter : Cr, this.texture._needsFlipEnvMap = !1; } fromEquirectangularTexture(e, r) { this.texture.type = r.type, this.texture.format = sn, this.texture.encoding = r.encoding, this.texture.generateMipmaps = r.generateMipmaps, this.texture.minFilter = r.minFilter, this.texture.magFilter = r.magFilter; const i = { uniforms: { tEquirect: { value: null } }, vertexShader: ( /* glsl */ ` varying vec3 vWorldDirection; vec3 transformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); } void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include } ` ), fragmentShader: ( /* glsl */ ` uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { vec3 direction = normalize( vWorldDirection ); vec2 sampleUV = equirectUv( direction ); gl_FragColor = texture2D( tEquirect, sampleUV ); } ` ) }, n = new oo(5, 5, 5), a = new so({ name: "CubemapFromEquirect", uniforms: yu(i.uniforms), vertexShader: i.vertexShader, fragmentShader: i.fragmentShader, side: Or, blending: Ja }); a.uniforms.tEquirect.value = r; const o = new Fr(n, a), s = r.minFilter; return r.minFilter === wo && (r.minFilter = Cr), new dv(1, 10, this).update(e, o), r.minFilter = s, o.geometry.dispose(), o.material.dispose(), this; } clear(e, r, i, n) { const a = e.getRenderTarget(); for (let o = 0; o < 6; o++) e.setRenderTarget(this, o), e.clear(r, i, n); e.setRenderTarget(a); } } hv.prototype.isWebGLCubeRenderTarget = !0; const I0 = /* @__PURE__ */ new de(), Zoe = /* @__PURE__ */ new de(), Yoe = /* @__PURE__ */ new Xr(); class oa { constructor(e = new de(1, 0, 0), r = 0) { this.normal = e, this.constant = r; } set(e, r) { return this.normal.copy(e), this.constant = r, this; } setComponents(e, r, i, n) { return this.normal.set(e, r, i), this.constant = n, this; } setFromNormalAndCoplanarPoint(e, r) { return this.normal.copy(e), this.constant = -r.dot(this.normal), this; } setFromCoplanarPoints(e, r, i) { const n = I0.subVectors(i, r).cross(Zoe.subVectors(e, r)).normalize(); return this.setFromNormalAndCoplanarPoint(n, e), this; } copy(e) { return this.normal.copy(e.normal), this.constant = e.constant, this; } normalize() { const e = 1 / this.normal.length(); return this.normal.multiplyScalar(e), this.constant *= e, this; } negate() { return this.constant *= -1, this.normal.negate(), this; } distanceToPoint(e) { return this.normal.dot(e) + this.constant; } distanceToSphere(e) { return this.distanceToPoint(e.center) - e.radius; } projectPoint(e, r) { return r.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e); } intersectLine(e, r) { const i = e.delta(I0), n = this.normal.dot(i); if (n === 0) return this.distanceToPoint(e.start) === 0 ? r.copy(e.start) : null; const a = -(e.start.dot(this.normal) + this.constant) / n; return a < 0 || a > 1 ? null : r.copy(i).multiplyScalar(a).add(e.start); } intersectsLine(e) { const r = this.distanceToPoint(e.start), i = this.distanceToPoint(e.end); return r < 0 && i > 0 || i < 0 && r > 0; } intersectsBox(e) { return e.intersectsPlane(this); } intersectsSphere(e) { return e.intersectsPlane(this); } coplanarPoint(e) { return e.copy(this.normal).multiplyScalar(-this.constant); } applyMatrix4(e, r) { const i = r || Yoe.getNormalMatrix(e), n = this.coplanarPoint(I0).applyMatrix4(e), a = this.normal.applyMatrix3(i).normalize(); return this.constant = -n.dot(a), this; } translate(e) { return this.constant -= e.dot(this.normal), this; } equals(e) { return e.normal.equals(this.normal) && e.constant === this.constant; } clone() { return new this.constructor().copy(this); } } oa.prototype.isPlane = !0; const xc = /* @__PURE__ */ new _o(), Ef = /* @__PURE__ */ new de(); class xp { constructor(e = new oa(), r = new oa(), i = new oa(), n = new oa(), a = new oa(), o = new oa()) { this.planes = [e, r, i, n, a, o]; } set(e, r, i, n, a, o) { const s = this.planes; return s[0].copy(e), s[1].copy(r), s[2].copy(i), s[3].copy(n), s[4].copy(a), s[5].copy(o), this; } copy(e) { const r = this.planes; for (let i = 0; i < 6; i++) r[i].copy(e.planes[i]); return this; } setFromProjectionMatrix(e) { const r = this.planes, i = e.elements, n = i[0], a = i[1], o = i[2], s = i[3], c = i[4], l = i[5], u = i[6], d = i[7], h = i[8], f = i[9], p = i[10], m = i[11], y = i[12], g = i[13], v = i[14], x = i[15]; return r[0].setComponents(s - n, d - c, m - h, x - y).normalize(), r[1].setComponents(s + n, d + c, m + h, x + y).normalize(), r[2].setComponents(s + a, d + l, m + f, x + g).normalize(), r[3].setComponents(s - a, d - l, m - f, x - g).normalize(), r[4].setComponents(s - o, d - u, m - p, x - v).normalize(), r[5].setComponents(s + o, d + u, m + p, x + v).normalize(), this; } intersectsObject(e) { const r = e.geometry; return r.boundingSphere === null && r.computeBoundingSphere(), xc.copy(r.boundingSphere).applyMatrix4(e.matrixWorld), this.intersectsSphere(xc); } intersectsSprite(e) { return xc.center.set(0, 0, 0), xc.radius = 0.7071067811865476, xc.applyMatrix4(e.matrixWorld), this.intersectsSphere(xc); } intersectsSphere(e) { const r = this.planes, i = e.center, n = -e.radius; for (let a = 0; a < 6; a++) if (r[a].distanceToPoint(i) < n) return !1; return !0; } intersectsBox(e) { const r = this.planes; for (let i = 0; i < 6; i++) { const n = r[i]; if (Ef.x = n.normal.x > 0 ? e.max.x : e.min.x, Ef.y = n.normal.y > 0 ? e.max.y : e.min.y, Ef.z = n.normal.z > 0 ? e.max.z : e.min.z, n.distanceToPoint(Ef) < 0) return !1; } return !0; } containsPoint(e) { const r = this.planes; for (let i = 0; i < 6; i++) if (r[i].distanceToPoint(e) < 0) return !1; return !0; } clone() { return new this.constructor().copy(this); } } function WR() { let t = null, e = !1, r = null, i = null; function n(a, o) { r(a, o), i = t.requestAnimationFrame(n); } return { start: function() { e !== !0 && r !== null && (i = t.requestAnimationFrame(n), e = !0); }, stop: function() { t.cancelAnimationFrame(i), e = !1; }, setAnimationLoop: function(a) { r = a; }, setContext: function(a) { t = a; } }; } function Koe(t, e) { const r = e.isWebGL2, i = /* @__PURE__ */ new WeakMap(); function n(l, u) { const d = l.array, h = l.usage, f = t.createBuffer(); t.bindBuffer(u, f), t.bufferData(u, d, h), l.onUploadCallback(); let p = 5126; return d instanceof Float32Array ? p = 5126 : d instanceof Float64Array ? console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array.") : d instanceof Uint16Array ? l.isFloat16BufferAttribute ? r ? p = 5131 : console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.") : p = 5123 : d instanceof Int16Array ? p = 5122 : d instanceof Uint32Array ? p = 5125 : d instanceof Int32Array ? p = 5124 : d instanceof Int8Array ? p = 5120 : (d instanceof Uint8Array || d instanceof Uint8ClampedArray) && (p = 5121), { buffer: f, type: p, bytesPerElement: d.BYTES_PER_ELEMENT, version: l.version }; } function a(l, u, d) { const h = u.array, f = u.updateRange; t.bindBuffer(d, l), f.count === -1 ? t.bufferSubData(d, 0, h) : (r ? t.bufferSubData( d, f.offset * h.BYTES_PER_ELEMENT, h, f.offset, f.count ) : t.bufferSubData( d, f.offset * h.BYTES_PER_ELEMENT, h.subarray(f.offset, f.offset + f.count) ), f.count = -1); } function o(l) { return l.isInterleavedBufferAttribute && (l = l.data), i.get(l); } function s(l) { l.isInterleavedBufferAttribute && (l = l.data); const u = i.get(l); u && (t.deleteBuffer(u.buffer), i.delete(l)); } function c(l, u) { if (l.isGLBufferAttribute) { const h = i.get(l); (!h || h.version < l.version) && i.set(l, { buffer: l.buffer, type: l.type, bytesPerElement: l.elementSize, version: l.version }); return; } l.isInterleavedBufferAttribute && (l = l.data); const d = i.get(l); d === void 0 ? i.set(l, n(l, u)) : d.version < l.version && (a(d.buffer, l, u), d.version = l.version); } return { get: o, remove: s, update: c }; } class Pl extends ft { constructor(e = 1, r = 1, i = 1, n = 1) { super(), this.type = "PlaneGeometry", this.parameters = { width: e, height: r, widthSegments: i, heightSegments: n }; const a = e / 2, o = r / 2, s = Math.floor(i), c = Math.floor(n), l = s + 1, u = c + 1, d = e / s, h = r / c, f = [], p = [], m = [], y = []; for (let g = 0; g < u; g++) { const v = g * h - o; for (let x = 0; x < l; x++) { const w = x * d - a; p.push(w, -v, 0), m.push(0, 0, 1), y.push(x / s), y.push(1 - g / c); } } for (let g = 0; g < c; g++) for (let v = 0; v < s; v++) { const x = v + l * g, w = v + l * (g + 1), S = v + 1 + l * (g + 1), _ = v + 1 + l * g; f.push(x, w, _), f.push(w, S, _); } this.setIndex(f), this.setAttribute("position", new it(p, 3)), this.setAttribute("normal", new it(m, 3)), this.setAttribute("uv", new it(y, 2)); } static fromJSON(e) { return new Pl(e.width, e.height, e.widthSegments, e.heightSegments); } } var Joe = `#ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, vUv ).g; #endif`, Qoe = `#ifdef USE_ALPHAMAP uniform sampler2D alphaMap; #endif`, ese = `#ifdef ALPHATEST if ( diffuseColor.a < ALPHATEST ) discard; #endif`, tse = `#ifdef USE_AOMAP float ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0; reflectedLight.indirectDiffuse *= ambientOcclusion; #if defined( USE_ENVMAP ) && defined( STANDARD ) float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness ); #endif #endif`, rse = `#ifdef USE_AOMAP uniform sampler2D aoMap; uniform float aoMapIntensity; #endif`, ise = "vec3 transformed = vec3( position );", nse = `vec3 objectNormal = vec3( normal ); #ifdef USE_TANGENT vec3 objectTangent = vec3( tangent.xyz ); #endif`, ase = `vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) { const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); vec4 r = roughness * c0 + c1; float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; return vec2( -1.04, 1.04 ) * a004 + r.zw; } float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { #if defined ( PHYSICALLY_CORRECT_LIGHTS ) float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); if( cutoffDistance > 0.0 ) { distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); } return distanceFalloff; #else if( cutoffDistance > 0.0 && decayExponent > 0.0 ) { return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent ); } return 1.0; #endif } vec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) { return RECIPROCAL_PI * diffuseColor; } vec3 F_Schlick( const in vec3 specularColor, const in float dotVH ) { float fresnel = exp2( ( -5.55473 * dotVH - 6.98316 ) * dotVH ); return ( 1.0 - specularColor ) * fresnel + specularColor; } vec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) { float fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV ); vec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0; return Fr * fresnel + F0; } float G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) { float a2 = pow2( alpha ); float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); return 1.0 / ( gl * gv ); } float G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { float a2 = pow2( alpha ); float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); return 0.5 / max( gv + gl, EPSILON ); } float D_GGX( const in float alpha, const in float dotNH ) { float a2 = pow2( alpha ); float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; return RECIPROCAL_PI * a2 / pow2( denom ); } vec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) { float alpha = pow2( roughness ); vec3 halfDir = normalize( incidentLight.direction + viewDir ); float dotNL = saturate( dot( normal, incidentLight.direction ) ); float dotNV = saturate( dot( normal, viewDir ) ); float dotNH = saturate( dot( normal, halfDir ) ); float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); vec3 F = F_Schlick( specularColor, dotLH ); float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV ); float D = D_GGX( alpha, dotNH ); return F * ( G * D ); } vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { const float LUT_SIZE = 64.0; const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; const float LUT_BIAS = 0.5 / LUT_SIZE; float dotNV = saturate( dot( N, V ) ); vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); uv = uv * LUT_SCALE + LUT_BIAS; return uv; } float LTC_ClippedSphereFormFactor( const in vec3 f ) { float l = length( f ); return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); } vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { float x = dot( v1, v2 ); float y = abs( x ); float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; float b = 3.4175940 + ( 4.1616724 + y ) * y; float v = a / b; float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; return cross( v1, v2 ) * theta_sintheta; } vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; vec3 lightNormal = cross( v1, v2 ); if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); vec3 T1, T2; T1 = normalize( V - N * dot( V, N ) ); T2 = - cross( N, T1 ); mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); vec3 coords[ 4 ]; coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); coords[ 0 ] = normalize( coords[ 0 ] ); coords[ 1 ] = normalize( coords[ 1 ] ); coords[ 2 ] = normalize( coords[ 2 ] ); coords[ 3 ] = normalize( coords[ 3 ] ); vec3 vectorFormFactor = vec3( 0.0 ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); return vec3( result ); } vec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) { float dotNV = saturate( dot( normal, viewDir ) ); vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); return specularColor * brdf.x + brdf.y; } void BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); vec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness ); vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); vec3 FssEss = F * brdf.x + brdf.y; float Ess = brdf.x + brdf.y; float Ems = 1.0 - Ess; vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); singleScatter += FssEss; multiScatter += Fms * Ems; } float G_BlinnPhong_Implicit( ) { return 0.25; } float D_BlinnPhong( const in float shininess, const in float dotNH ) { return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); } vec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) { vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir ); float dotNH = saturate( dot( geometry.normal, halfDir ) ); float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); vec3 F = F_Schlick( specularColor, dotLH ); float G = G_BlinnPhong_Implicit( ); float D = D_BlinnPhong( shininess, dotNH ); return F * ( G * D ); } float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) { return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 ); } float BlinnExponentToGGXRoughness( const in float blinnExponent ) { return sqrt( 2.0 / ( blinnExponent + 2.0 ) ); } #if defined( USE_SHEEN ) float D_Charlie(float roughness, float NoH) { float invAlpha = 1.0 / roughness; float cos2h = NoH * NoH; float sin2h = max(1.0 - cos2h, 0.0078125); return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI); } float V_Neubelt(float NoV, float NoL) { return saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV))); } vec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) { vec3 N = geometry.normal; vec3 V = geometry.viewDir; vec3 H = normalize( V + L ); float dotNH = saturate( dot( N, H ) ); return specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) ); } #endif`, ose = `#ifdef USE_BUMPMAP uniform sampler2D bumpMap; uniform float bumpScale; vec2 dHdxy_fwd() { vec2 dSTdx = dFdx( vUv ); vec2 dSTdy = dFdy( vUv ); float Hll = bumpScale * texture2D( bumpMap, vUv ).x; float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll; float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll; return vec2( dBx, dBy ); } vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) ); vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) ); vec3 vN = surf_norm; vec3 R1 = cross( vSigmaY, vN ); vec3 R2 = cross( vN, vSigmaX ); float fDet = dot( vSigmaX, R1 ) * faceDirection; vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); return normalize( abs( fDet ) * surf_norm - vGrad ); } #endif`, sse = `#if NUM_CLIPPING_PLANES > 0 vec4 plane; #pragma unroll_loop_start for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; } #pragma unroll_loop_end #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES bool clipped = true; #pragma unroll_loop_start for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; } #pragma unroll_loop_end if ( clipped ) discard; #endif #endif`, lse = `#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; #endif`, cse = `#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; #endif`, use = `#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; #endif`, dse = `#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; #endif`, hse = `#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; #endif`, pse = `#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) varying vec3 vColor; #endif`, fse = `#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) vColor = vec3( 1.0 ); #endif #ifdef USE_COLOR vColor *= color; #endif #ifdef USE_INSTANCING_COLOR vColor.xyz *= instanceColor.xyz; #endif`, mse = `#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 #define RECIPROCAL_PI2 0.15915494309189535 #define EPSILON 1e-6 #ifndef saturate #define saturate(a) clamp( a, 0.0, 1.0 ) #endif #define whiteComplement(a) ( 1.0 - saturate( a ) ) float pow2( const in float x ) { return x*x; } float pow3( const in float x ) { return x*x*x; } float pow4( const in float x ) { float x2 = x*x; return x2*x2; } float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); } highp float rand( const in vec2 uv ) { const highp float a = 12.9898, b = 78.233, c = 43758.5453; highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); return fract(sin(sn) * c); } #ifdef HIGH_PRECISION float precisionSafeLength( vec3 v ) { return length( v ); } #else float max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); } float precisionSafeLength( vec3 v ) { float maxComponent = max3( abs( v ) ); return length( v / maxComponent ) * maxComponent; } #endif struct IncidentLight { vec3 color; vec3 direction; bool visible; }; struct ReflectedLight { vec3 directDiffuse; vec3 directSpecular; vec3 indirectDiffuse; vec3 indirectSpecular; }; struct GeometricContext { vec3 position; vec3 normal; vec3 viewDir; #ifdef CLEARCOAT vec3 clearcoatNormal; #endif }; vec3 transformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); } vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); } vec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { float distance = dot( planeNormal, point - pointOnPlane ); return - distance * planeNormal + point; } float sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { return sign( dot( point - pointOnPlane, planeNormal ) ); } vec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) { return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine; } mat3 transposeMat3( const in mat3 m ) { mat3 tmp; tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); return tmp; } float linearToRelativeLuminance( const in vec3 color ) { vec3 weights = vec3( 0.2126, 0.7152, 0.0722 ); return dot( weights, color.rgb ); } bool isPerspectiveMatrix( mat4 m ) { return m[ 2 ][ 3 ] == - 1.0; } vec2 equirectUv( in vec3 dir ) { float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; return vec2( u, v ); }`, gse = `#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_maxMipLevel 8.0 #define cubeUV_minMipLevel 4.0 #define cubeUV_maxTileSize 256.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { vec3 absDirection = abs( direction ); float face = - 1.0; if ( absDirection.x > absDirection.z ) { if ( absDirection.x > absDirection.y ) face = direction.x > 0.0 ? 0.0 : 3.0; else face = direction.y > 0.0 ? 1.0 : 4.0; } else { if ( absDirection.z > absDirection.y ) face = direction.z > 0.0 ? 2.0 : 5.0; else face = direction.y > 0.0 ? 1.0 : 4.0; } return face; } vec2 getUV( vec3 direction, float face ) { vec2 uv; if ( face == 0.0 ) { uv = vec2( direction.z, direction.y ) / abs( direction.x ); } else if ( face == 1.0 ) { uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); } else if ( face == 2.0 ) { uv = vec2( - direction.x, direction.y ) / abs( direction.z ); } else if ( face == 3.0 ) { uv = vec2( - direction.z, direction.y ) / abs( direction.x ); } else if ( face == 4.0 ) { uv = vec2( - direction.x, direction.z ) / abs( direction.y ); } else { uv = vec2( direction.x, direction.y ) / abs( direction.z ); } return 0.5 * ( uv + 1.0 ); } vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { float face = getFace( direction ); float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); mipInt = max( mipInt, cubeUV_minMipLevel ); float faceSize = exp2( mipInt ); float texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize ); vec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ); vec2 f = fract( uv ); uv += 0.5 - f; if ( face > 2.0 ) { uv.y += faceSize; face -= 3.0; } uv.x += face * faceSize; if ( mipInt < cubeUV_maxMipLevel ) { uv.y += 2.0 * cubeUV_maxTileSize; } uv.y += filterInt * 2.0 * cubeUV_minTileSize; uv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize ); uv *= texelSize; vec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; uv.x += texelSize; vec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; uv.y += texelSize; vec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; uv.x -= texelSize; vec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb; vec3 tm = mix( tl, tr, f.x ); vec3 bm = mix( bl, br, f.x ); return mix( tm, bm, f.y ); } #define r0 1.0 #define v0 0.339 #define m0 - 2.0 #define r1 0.8 #define v1 0.276 #define m1 - 1.0 #define r4 0.4 #define v4 0.046 #define m4 2.0 #define r5 0.305 #define v5 0.016 #define m5 3.0 #define r6 0.21 #define v6 0.0038 #define m6 4.0 float roughnessToMip( float roughness ) { float mip = 0.0; if ( roughness >= r1 ) { mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0; } else if ( roughness >= r4 ) { mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1; } else if ( roughness >= r5 ) { mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4; } else if ( roughness >= r6 ) { mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5; } else { mip = - 2.0 * log2( 1.16 * roughness ); } return mip; } vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { float mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel ); float mipF = fract( mip ); float mipInt = floor( mip ); vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); if ( mipF == 0.0 ) { return vec4( color0, 1.0 ); } else { vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); return vec4( mix( color0, color1, mipF ), 1.0 ); } } #endif`, vse = `vec3 transformedNormal = objectNormal; #ifdef USE_INSTANCING mat3 m = mat3( instanceMatrix ); transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); transformedNormal = m * transformedNormal; #endif transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedNormal = - transformedNormal; #endif #ifdef USE_TANGENT vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif #endif`, yse = `#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; #endif`, bse = `#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); #endif`, xse = `#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vUv ); emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb; totalEmissiveRadiance *= emissiveColor.rgb; #endif`, wse = `#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; #endif`, _se = "gl_FragColor = linearToOutputTexel( gl_FragColor );", Sse = ` vec4 LinearToLinear( in vec4 value ) { return value; } vec4 GammaToLinear( in vec4 value, in float gammaFactor ) { return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a ); } vec4 LinearToGamma( in vec4 value, in float gammaFactor ) { return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a ); } vec4 sRGBToLinear( in vec4 value ) { return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); } vec4 LinearTosRGB( in vec4 value ) { return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); } vec4 RGBEToLinear( in vec4 value ) { return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 ); } vec4 LinearToRGBE( in vec4 value ) { float maxComponent = max( max( value.r, value.g ), value.b ); float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 ); return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 ); } vec4 RGBMToLinear( in vec4 value, in float maxRange ) { return vec4( value.rgb * value.a * maxRange, 1.0 ); } vec4 LinearToRGBM( in vec4 value, in float maxRange ) { float maxRGB = max( value.r, max( value.g, value.b ) ); float M = clamp( maxRGB / maxRange, 0.0, 1.0 ); M = ceil( M * 255.0 ) / 255.0; return vec4( value.rgb / ( M * maxRange ), M ); } vec4 RGBDToLinear( in vec4 value, in float maxRange ) { return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 ); } vec4 LinearToRGBD( in vec4 value, in float maxRange ) { float maxRGB = max( value.r, max( value.g, value.b ) ); float D = max( maxRange / maxRGB, 1.0 ); D = clamp( floor( D ) / 255.0, 0.0, 1.0 ); return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D ); } const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 ); vec4 LinearToLogLuv( in vec4 value ) { vec3 Xp_Y_XYZp = cLogLuvM * value.rgb; Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) ); vec4 vResult; vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z; float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0; vResult.w = fract( Le ); vResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0; return vResult; } const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 ); vec4 LogLuvToLinear( in vec4 value ) { float Le = value.z * 255.0 + value.w; vec3 Xp_Y_XYZp; Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 ); Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y; Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z; vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb; return vec4( max( vRGB, 0.0 ), 1.0 ); }`, Mse = `#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); } else { cameraToFrag = normalize( vWorldPosition - cameraPosition ); } vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); #ifdef ENVMAP_MODE_REFLECTION vec3 reflectVec = reflect( cameraToFrag, worldNormal ); #else vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); #endif #else vec3 reflectVec = vReflect; #endif #ifdef ENVMAP_TYPE_CUBE vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); #elif defined( ENVMAP_TYPE_CUBE_UV ) vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 ); #else vec4 envColor = vec4( 0.0 ); #endif #ifndef ENVMAP_TYPE_CUBE_UV envColor = envMapTexelToLinear( envColor ); #endif #ifdef ENVMAP_BLENDING_MULTIPLY outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); #elif defined( ENVMAP_BLENDING_MIX ) outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif #endif`, Ese = `#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; uniform int maxMipLevel; #ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #else uniform sampler2D envMap; #endif #endif`, Tse = `#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) #define ENV_WORLDPOS #endif #ifdef ENV_WORLDPOS varying vec3 vWorldPosition; uniform float refractionRatio; #else varying vec3 vReflect; #endif #endif`, Cse = `#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG ) #define ENV_WORLDPOS #endif #ifdef ENV_WORLDPOS varying vec3 vWorldPosition; #else varying vec3 vReflect; uniform float refractionRatio; #endif #endif`, Ase = `#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else vec3 cameraToVertex; if ( isOrthographic ) { cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); } else { cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); } vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); #ifdef ENVMAP_MODE_REFLECTION vReflect = reflect( cameraToVertex, worldNormal ); #else vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif #endif`, Lse = `#ifdef USE_FOG fogDepth = - mvPosition.z; #endif`, kse = `#ifdef USE_FOG varying float fogDepth; #endif`, Pse = `#ifdef USE_FOG #ifdef FOG_EXP2 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth ); #else float fogFactor = smoothstep( fogNear, fogFar, fogDepth ); #endif gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); #endif`, Rse = `#ifdef USE_FOG uniform vec3 fogColor; varying float fogDepth; #ifdef FOG_EXP2 uniform float fogDensity; #else uniform float fogNear; uniform float fogFar; #endif #endif`, Ose = `#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { float dotNL = dot( normal, lightDirection ); vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); #ifdef USE_GRADIENTMAP return texture2D( gradientMap, coord ).rgb; #else return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 ); #endif }`, Dse = `#ifdef USE_LIGHTMAP vec4 lightMapTexel= texture2D( lightMap, vUv2 ); reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; #endif`, Ise = `#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; #endif`, Nse = `vec3 diffuse = vec3( 1.0 ); GeometricContext geometry; geometry.position = mvPosition.xyz; geometry.normal = normalize( transformedNormal ); geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); GeometricContext backGeometry; backGeometry.position = geometry.position; backGeometry.normal = -geometry.normal; backGeometry.viewDir = geometry.viewDir; vLightFront = vec3( 0.0 ); vIndirectFront = vec3( 0.0 ); #ifdef DOUBLE_SIDED vLightBack = vec3( 0.0 ); vIndirectBack = vec3( 0.0 ); #endif IncidentLight directLight; float dotNL; vec3 directLightColor_Diffuse; vIndirectFront += getAmbientLightIrradiance( ambientLightColor ); vIndirectFront += getLightProbeIrradiance( lightProbe, geometry ); #ifdef DOUBLE_SIDED vIndirectBack += getAmbientLightIrradiance( ambientLightColor ); vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry ); #endif #if NUM_POINT_LIGHTS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); dotNL = dot( geometry.normal, directLight.direction ); directLightColor_Diffuse = PI * directLight.color; vLightFront += saturate( dotNL ) * directLightColor_Diffuse; #ifdef DOUBLE_SIDED vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; #endif } #pragma unroll_loop_end #endif #if NUM_SPOT_LIGHTS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); dotNL = dot( geometry.normal, directLight.direction ); directLightColor_Diffuse = PI * directLight.color; vLightFront += saturate( dotNL ) * directLightColor_Diffuse; #ifdef DOUBLE_SIDED vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; #endif } #pragma unroll_loop_end #endif #if NUM_DIR_LIGHTS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); dotNL = dot( geometry.normal, directLight.direction ); directLightColor_Diffuse = PI * directLight.color; vLightFront += saturate( dotNL ) * directLightColor_Diffuse; #ifdef DOUBLE_SIDED vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; #endif } #pragma unroll_loop_end #endif #if NUM_HEMI_LIGHTS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); #ifdef DOUBLE_SIDED vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); #endif } #pragma unroll_loop_end #endif`, Bse = `uniform bool receiveShadow; uniform vec3 ambientLightColor; uniform vec3 lightProbe[ 9 ]; vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { float x = normal.x, y = normal.y, z = normal.z; vec3 result = shCoefficients[ 0 ] * 0.886227; result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); return result; } vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) { vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); return irradiance; } vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { vec3 irradiance = ambientLightColor; #ifndef PHYSICALLY_CORRECT_LIGHTS irradiance *= PI; #endif return irradiance; } #if NUM_DIR_LIGHTS > 0 struct DirectionalLight { vec3 direction; vec3 color; }; uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) { directLight.color = directionalLight.color; directLight.direction = directionalLight.direction; directLight.visible = true; } #endif #if NUM_POINT_LIGHTS > 0 struct PointLight { vec3 position; vec3 color; float distance; float decay; }; uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) { vec3 lVector = pointLight.position - geometry.position; directLight.direction = normalize( lVector ); float lightDistance = length( lVector ); directLight.color = pointLight.color; directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay ); directLight.visible = ( directLight.color != vec3( 0.0 ) ); } #endif #if NUM_SPOT_LIGHTS > 0 struct SpotLight { vec3 position; vec3 direction; vec3 color; float distance; float decay; float coneCos; float penumbraCos; }; uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) { vec3 lVector = spotLight.position - geometry.position; directLight.direction = normalize( lVector ); float lightDistance = length( lVector ); float angleCos = dot( directLight.direction, spotLight.direction ); if ( angleCos > spotLight.coneCos ) { float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos ); directLight.color = spotLight.color; directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay ); directLight.visible = true; } else { directLight.color = vec3( 0.0 ); directLight.visible = false; } } #endif #if NUM_RECT_AREA_LIGHTS > 0 struct RectAreaLight { vec3 color; vec3 position; vec3 halfWidth; vec3 halfHeight; }; uniform sampler2D ltc_1; uniform sampler2D ltc_2; uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; #endif #if NUM_HEMI_LIGHTS > 0 struct HemisphereLight { vec3 direction; vec3 skyColor; vec3 groundColor; }; uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) { float dotNL = dot( geometry.normal, hemiLight.direction ); float hemiDiffuseWeight = 0.5 * dotNL + 0.5; vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); #ifndef PHYSICALLY_CORRECT_LIGHTS irradiance *= PI; #endif return irradiance; } #endif`, Fse = `#if defined( USE_ENVMAP ) #ifdef ENVMAP_MODE_REFRACTION uniform float refractionRatio; #endif vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) { vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); #ifdef ENVMAP_TYPE_CUBE vec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz ); #ifdef TEXTURE_LOD_EXT vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) ); #else vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) ); #endif envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; #elif defined( ENVMAP_TYPE_CUBE_UV ) vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); #else vec4 envMapColor = vec4( 0.0 ); #endif return PI * envMapColor.rgb * envMapIntensity; } float getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) { float maxMIPLevelScalar = float( maxMIPLevel ); float sigma = PI * roughness * roughness / ( 1.0 + roughness ); float desiredMIPLevel = maxMIPLevelScalar + log2( sigma ); return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar ); } vec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) { #ifdef ENVMAP_MODE_REFLECTION vec3 reflectVec = reflect( -viewDir, normal ); reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); #else vec3 reflectVec = refract( -viewDir, normal, refractionRatio ); #endif reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); float specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel ); #ifdef ENVMAP_TYPE_CUBE vec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz ); #ifdef TEXTURE_LOD_EXT vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel ); #else vec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel ); #endif envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; #elif defined( ENVMAP_TYPE_CUBE_UV ) vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); #endif return envMapColor.rgb * envMapIntensity; } #endif`, zse = `ToonMaterial material; material.diffuseColor = diffuseColor.rgb;`, $se = `varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #endif struct ToonMaterial { vec3 diffuseColor; }; void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; #ifndef PHYSICALLY_CORRECT_LIGHTS irradiance *= PI; #endif reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); } void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Toon #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon #define Material_LightProbeLOD( material ) (0)`, Vse = `BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; material.specularStrength = specularStrength;`, Use = `varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #endif struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; float specularShininess; float specularStrength; }; void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); vec3 irradiance = dotNL * directLight.color; #ifndef PHYSICALLY_CORRECT_LIGHTS irradiance *= PI; #endif reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; } void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_BlinnPhong #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong #define Material_LightProbeLOD( material ) (0)`, jse = `PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); material.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness; material.specularRoughness = min( material.specularRoughness, 1.0 ); #ifdef REFLECTIVITY material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor ); #else material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor ); #endif #ifdef CLEARCOAT material.clearcoat = clearcoat; material.clearcoatRoughness = clearcoatRoughness; #ifdef USE_CLEARCOATMAP material.clearcoat *= texture2D( clearcoatMap, vUv ).x; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y; #endif material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); material.clearcoatRoughness += geometryRoughness; material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); #endif #ifdef USE_SHEEN material.sheenColor = sheen; #endif`, Hse = `struct PhysicalMaterial { vec3 diffuseColor; float specularRoughness; vec3 specularColor; #ifdef CLEARCOAT float clearcoat; float clearcoatRoughness; #endif #ifdef USE_SHEEN vec3 sheenColor; #endif }; #define MAXIMUM_SPECULAR_COEFFICIENT 0.16 #define DEFAULT_SPECULAR_COEFFICIENT 0.04 float clearcoatDHRApprox( const in float roughness, const in float dotNL ) { return DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) ); } #if NUM_RECT_AREA_LIGHTS > 0 void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { vec3 normal = geometry.normal; vec3 viewDir = geometry.viewDir; vec3 position = geometry.position; vec3 lightPos = rectAreaLight.position; vec3 halfWidth = rectAreaLight.halfWidth; vec3 halfHeight = rectAreaLight.halfHeight; vec3 lightColor = rectAreaLight.color; float roughness = material.specularRoughness; vec3 rectCoords[ 4 ]; rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; vec2 uv = LTC_Uv( normal, viewDir, roughness ); vec4 t1 = texture2D( ltc_1, uv ); vec4 t2 = texture2D( ltc_2, uv ); mat3 mInv = mat3( vec3( t1.x, 0, t1.y ), vec3( 0, 1, 0 ), vec3( t1.z, 0, t1.w ) ); vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); } #endif void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); vec3 irradiance = dotNL * directLight.color; #ifndef PHYSICALLY_CORRECT_LIGHTS irradiance *= PI; #endif #ifdef CLEARCOAT float ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) ); vec3 ccIrradiance = ccDotNL * directLight.color; #ifndef PHYSICALLY_CORRECT_LIGHTS ccIrradiance *= PI; #endif float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); reflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness ); #else float clearcoatDHR = 0.0; #endif #ifdef USE_SHEEN reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen( material.specularRoughness, directLight.direction, geometry, material.sheenColor ); #else reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness); #endif reflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); } void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); } void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { #ifdef CLEARCOAT float ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) ); reflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness ); float ccDotNL = ccDotNV; float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); #else float clearcoatDHR = 0.0; #endif float clearcoatInv = 1.0 - clearcoatDHR; vec3 singleScattering = vec3( 0.0 ); vec3 multiScattering = vec3( 0.0 ); vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; BRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering ); vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) ); reflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering; reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; } #define RE_Direct RE_Direct_Physical #define RE_Direct_RectArea RE_Direct_RectArea_Physical #define RE_IndirectDiffuse RE_IndirectDiffuse_Physical #define RE_IndirectSpecular RE_IndirectSpecular_Physical float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); }`, Gse = ` GeometricContext geometry; geometry.position = - vViewPosition; geometry.normal = normal; geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); #ifdef CLEARCOAT geometry.clearcoatNormal = clearcoatNormal; #endif IncidentLight directLight; #if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) PointLight pointLight; #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 PointLightShadow pointLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { pointLight = pointLights[ i ]; getPointDirectLightIrradiance( pointLight, geometry, directLight ); #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) pointLightShadow = pointLightShadows[ i ]; directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; #endif RE_Direct( directLight, geometry, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) SpotLight spotLight; #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 SpotLightShadow spotLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { spotLight = spotLights[ i ]; getSpotDirectLightIrradiance( spotLight, geometry, directLight ); #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) spotLightShadow = spotLightShadows[ i ]; directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; #endif RE_Direct( directLight, geometry, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) DirectionalLight directionalLight; #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 DirectionalLightShadow directionalLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { directionalLight = directionalLights[ i ]; getDirectionalDirectLightIrradiance( directionalLight, geometry, directLight ); #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) directionalLightShadow = directionalLightShadows[ i ]; directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; #endif RE_Direct( directLight, geometry, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) RectAreaLight rectAreaLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { rectAreaLight = rectAreaLights[ i ]; RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight ); } #pragma unroll_loop_end #endif #if defined( RE_IndirectDiffuse ) vec3 iblIrradiance = vec3( 0.0 ); vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); irradiance += getLightProbeIrradiance( lightProbe, geometry ); #if ( NUM_HEMI_LIGHTS > 0 ) #pragma unroll_loop_start for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); } #pragma unroll_loop_end #endif #endif #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); #endif`, Wse = `#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel= texture2D( lightMap, vUv2 ); vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; #ifndef PHYSICALLY_CORRECT_LIGHTS lightMapIrradiance *= PI; #endif irradiance += lightMapIrradiance; #endif #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) iblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel ); #endif #endif #if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) radiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel ); #ifdef CLEARCOAT clearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel ); #endif #endif`, qse = `#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); #endif`, Xse = `#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; #endif`, Zse = `#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; #endif`, Yse = `#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT varying float vFragDepth; varying float vIsPerspective; #else uniform float logDepthBufFC; #endif #endif`, Kse = `#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); #else if ( isPerspectiveMatrix( projectionMatrix ) ) { gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; gl_Position.z *= gl_Position.w; } #endif #endif`, Jse = `#ifdef USE_MAP vec4 texelColor = texture2D( map, vUv ); texelColor = mapTexelToLinear( texelColor ); diffuseColor *= texelColor; #endif`, Qse = `#ifdef USE_MAP uniform sampler2D map; #endif`, ele = `#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; #endif #ifdef USE_MAP vec4 mapTexel = texture2D( map, uv ); diffuseColor *= mapTexelToLinear( mapTexel ); #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; #endif`, tle = `#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) uniform mat3 uvTransform; #endif #ifdef USE_MAP uniform sampler2D map; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; #endif`, rle = `float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vUv ); metalnessFactor *= texelMetalness.b; #endif`, ile = `#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; #endif`, nle = `#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; #endif`, ale = `#ifdef USE_MORPHTARGETS uniform float morphTargetBaseInfluence; #ifndef USE_MORPHNORMALS uniform float morphTargetInfluences[ 8 ]; #else uniform float morphTargetInfluences[ 4 ]; #endif #endif`, ole = `#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; transformed += morphTarget0 * morphTargetInfluences[ 0 ]; transformed += morphTarget1 * morphTargetInfluences[ 1 ]; transformed += morphTarget2 * morphTargetInfluences[ 2 ]; transformed += morphTarget3 * morphTargetInfluences[ 3 ]; #ifndef USE_MORPHNORMALS transformed += morphTarget4 * morphTargetInfluences[ 4 ]; transformed += morphTarget5 * morphTargetInfluences[ 5 ]; transformed += morphTarget6 * morphTargetInfluences[ 6 ]; transformed += morphTarget7 * morphTargetInfluences[ 7 ]; #endif #endif`, sle = `float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) ); vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) ); vec3 normal = normalize( cross( fdx, fdy ) ); #else vec3 normal = normalize( vNormal ); #ifdef DOUBLE_SIDED normal = normal * faceDirection; #endif #ifdef USE_TANGENT vec3 tangent = normalize( vTangent ); vec3 bitangent = normalize( vBitangent ); #ifdef DOUBLE_SIDED tangent = tangent * faceDirection; bitangent = bitangent * faceDirection; #endif #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) mat3 vTBN = mat3( tangent, bitangent, normal ); #endif #endif #endif vec3 geometryNormal = normal;`, lle = `#ifdef OBJECTSPACE_NORMALMAP normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; #endif #ifdef DOUBLE_SIDED normal = normal * faceDirection; #endif normal = normalize( normalMatrix * normal ); #elif defined( TANGENTSPACE_NORMALMAP ) vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; mapN.xy *= normalScale; #ifdef USE_TANGENT normal = normalize( vTBN * mapN ); #else normal = perturbNormal2Arb( -vViewPosition, normal, mapN, faceDirection ); #endif #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd(), faceDirection ); #endif`, cle = `#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif #ifdef OBJECTSPACE_NORMALMAP uniform mat3 normalMatrix; #endif #if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) ) vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) { vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) ); vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) ); vec2 st0 = dFdx( vUv.st ); vec2 st1 = dFdy( vUv.st ); vec3 N = surf_norm; vec3 q1perp = cross( q1, N ); vec3 q0perp = cross( N, q0 ); vec3 T = q1perp * st0.x + q0perp * st1.x; vec3 B = q1perp * st0.y + q0perp * st1.y; float det = max( dot( T, T ), dot( B, B ) ); float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); } #endif`, ule = `#ifdef CLEARCOAT vec3 clearcoatNormal = geometryNormal; #endif`, dle = `#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; #ifdef USE_TANGENT clearcoatNormal = normalize( vTBN * clearcoatMapN ); #else clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); #endif #endif`, hle = `#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform sampler2D clearcoatRoughnessMap; #endif #ifdef USE_CLEARCOAT_NORMALMAP uniform sampler2D clearcoatNormalMap; uniform vec2 clearcoatNormalScale; #endif`, ple = `vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { return 2.0 * rgb.xyz - 1.0; } const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); const float ShiftRight8 = 1. / 256.; vec4 packDepthToRGBA( const in float v ) { vec4 r = vec4( fract( v * PackFactors ), v ); r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; } float unpackRGBAToDepth( const in vec4 v ) { return dot( v, UnpackFactors ); } vec4 pack2HalfToRGBA( vec2 v ) { vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 )); return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w); } vec2 unpackRGBATo2Half( vec4 v ) { return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); } float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { return ( viewZ + near ) / ( near - far ); } float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { return linearClipZ * ( near - far ) - near; } float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { return (( near + viewZ ) * far ) / (( far - near ) * viewZ ); } float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * invClipZ - far ); }`, fle = `#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; #endif`, mle = `vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_INSTANCING mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; gl_Position = projectionMatrix * mvPosition;`, gle = `#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); #endif`, vle = `#ifdef DITHERING vec3 dithering( vec3 color ) { float grid_position = rand( gl_FragCoord.xy ); vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); return color + dither_shift_RGB; } #endif`, yle = `float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vUv ); roughnessFactor *= texelRoughness.g; #endif`, ble = `#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; #endif`, xle = `#ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; struct DirectionalLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; struct SpotLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; #endif #if NUM_POINT_LIGHT_SHADOWS > 0 uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; struct PointLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; float shadowCameraNear; float shadowCameraFar; }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); } vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { return unpackRGBATo2Half( texture2D( shadow, uv ) ); } float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ float occlusion = 1.0; vec2 distribution = texture2DDistribution( shadow, uv ); float hard_shadow = step( compare , distribution.x ); if (hard_shadow != 1.0 ) { float distance = compare - distribution.x ; float variance = max( 0.00000, distribution.y * distribution.y ); float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); } return occlusion; } float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { float shadow = 1.0; shadowCoord.xyz /= shadowCoord.w; shadowCoord.z += shadowBias; bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 ); bool inFrustum = all( inFrustumVec ); bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 ); bool frustumTest = all( frustumTestVec ); if ( frustumTest ) { #if defined( SHADOWMAP_TYPE_PCF ) vec2 texelSize = vec2( 1.0 ) / shadowMapSize; float dx0 = - texelSize.x * shadowRadius; float dy0 = - texelSize.y * shadowRadius; float dx1 = + texelSize.x * shadowRadius; float dy1 = + texelSize.y * shadowRadius; float dx2 = dx0 / 2.0; float dy2 = dy0 / 2.0; float dx3 = dx1 / 2.0; float dy3 = dy1 / 2.0; shadow = ( texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) ) * ( 1.0 / 17.0 ); #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) vec2 texelSize = vec2( 1.0 ) / shadowMapSize; float dx = texelSize.x; float dy = texelSize.y; vec2 uv = shadowCoord.xy; vec2 f = fract( uv * shadowMapSize + 0.5 ); uv -= f * texelSize; shadow = ( texture2DCompare( shadowMap, uv, shadowCoord.z ) + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), f.x ) + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), f.x ) + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), f.y ) + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), f.y ) + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), f.x ), mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), f.x ), f.y ) ) * ( 1.0 / 9.0 ); #elif defined( SHADOWMAP_TYPE_VSM ) shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); #else shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); #endif } return shadow; } vec2 cubeToUV( vec3 v, float texelSizeY ) { vec3 absV = abs( v ); float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); absV *= scaleToCube; v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); vec2 planar = v.xy; float almostATexel = 1.5 * texelSizeY; float almostOne = 1.0 - almostATexel; if ( absV.z >= almostOne ) { if ( v.z > 0.0 ) planar.x = 4.0 - v.x; } else if ( absV.x >= almostOne ) { float signX = sign( v.x ); planar.x = v.z * signX + 2.0 * signX; } else if ( absV.y >= almostOne ) { float signY = sign( v.y ); planar.x = v.x + 2.0 * signY + 2.0; planar.y = v.z * signY - 2.0; } return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); } float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); vec3 lightToPosition = shadowCoord.xyz; float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; vec3 bd3D = normalize( lightToPosition ); #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; return ( texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) ) * ( 1.0 / 9.0 ); #else return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); #endif } #endif`, wle = `#ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; struct DirectionalLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ]; varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; struct SpotLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; #endif #if NUM_POINT_LIGHT_SHADOWS > 0 uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; struct PointLightShadow { float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; float shadowCameraNear; float shadowCameraFar; }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif #endif`, _le = `#ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); vec4 shadowWorldPosition; #endif #if NUM_DIR_LIGHT_SHADOWS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 ); vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif #if NUM_POINT_LIGHT_SHADOWS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif #endif`, Sle = `float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 DirectionalLightShadow directionalLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { directionalLight = directionalLightShadows[ i ]; shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; } #pragma unroll_loop_end #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 SpotLightShadow spotLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { spotLight = spotLightShadows[ i ]; shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; } #pragma unroll_loop_end #endif #if NUM_POINT_LIGHT_SHADOWS > 0 PointLightShadow pointLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { pointLight = pointLightShadows[ i ]; shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; } #pragma unroll_loop_end #endif #endif return shadow; }`, Mle = `#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); #endif`, Ele = `#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; #ifdef BONE_TEXTURE uniform highp sampler2D boneTexture; uniform int boneTextureSize; mat4 getBoneMatrix( const in float i ) { float j = i * 4.0; float x = mod( j, float( boneTextureSize ) ); float y = floor( j / float( boneTextureSize ) ); float dx = 1.0 / float( boneTextureSize ); float dy = 1.0 / float( boneTextureSize ); y = dy * ( y + 0.5 ); vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); mat4 bone = mat4( v1, v2, v3, v4 ); return bone; } #else uniform mat4 boneMatrices[ MAX_BONES ]; mat4 getBoneMatrix( const in float i ) { mat4 bone = boneMatrices[ int(i) ]; return bone; } #endif #endif`, Tle = `#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; skinned += boneMatY * skinVertex * skinWeight.y; skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; #endif`, Cle = `#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; skinMatrix += skinWeight.z * boneMatZ; skinMatrix += skinWeight.w * boneMatW; skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif #endif`, Ale = `float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; #endif`, Lle = `#ifdef USE_SPECULARMAP uniform sampler2D specularMap; #endif`, kle = `#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); #endif`, Ple = `#ifndef saturate #define saturate(a) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; vec3 LinearToneMapping( vec3 color ) { return toneMappingExposure * color; } vec3 ReinhardToneMapping( vec3 color ) { color *= toneMappingExposure; return saturate( color / ( vec3( 1.0 ) + color ) ); } vec3 OptimizedCineonToneMapping( vec3 color ) { color *= toneMappingExposure; color = max( vec3( 0.0 ), color - 0.004 ); return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); } vec3 RRTAndODTFit( vec3 v ) { vec3 a = v * ( v + 0.0245786 ) - 0.000090537; vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; return a / b; } vec3 ACESFilmicToneMapping( vec3 color ) { const mat3 ACESInputMat = mat3( vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), vec3( 0.04823, 0.01566, 0.83777 ) ); const mat3 ACESOutputMat = mat3( vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), vec3( -0.07367, -0.00605, 1.07602 ) ); color *= toneMappingExposure / 0.6; color = ACESInputMat * color; color = RRTAndODTFit( color ); color = ACESOutputMat * color; return saturate( color ); } vec3 CustomToneMapping( vec3 color ) { return color; }`, Rle = `#ifdef USE_TRANSMISSION float transmissionFactor = transmission; float thicknessFactor = thickness; #ifdef USE_TRANSMISSIONMAP transmissionFactor *= texture2D( transmissionMap, vUv ).r; #endif #ifdef USE_THICKNESSNMAP thicknessFactor *= texture2D( thicknessMap, vUv ).g; #endif vec3 pos = vWorldPosition.xyz / vWorldPosition.w; vec3 v = normalize( cameraPosition - pos ); float ior = ( 1.0 + 0.4 * reflectivity ) / ( 1.0 - 0.4 * reflectivity ); vec3 transmission = transmissionFactor * getIBLVolumeRefraction( normal, v, roughnessFactor, material.diffuseColor, totalSpecular, pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor, attenuationColor, attenuationDistance ); totalDiffuse = mix( totalDiffuse, transmission, transmissionFactor ); #endif`, Ole = `#ifdef USE_TRANSMISSION #ifdef USE_TRANSMISSIONMAP uniform sampler2D transmissionMap; #endif #ifdef USE_THICKNESSMAP uniform sampler2D thicknessMap; #endif uniform vec2 transmissionSamplerSize; uniform sampler2D transmissionSamplerMap; uniform mat4 modelMatrix; uniform mat4 projectionMatrix; varying vec4 vWorldPosition; vec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix) { vec3 refractionVector = refract(-v, normalize(n), 1.0 / ior); vec3 modelScale; modelScale.x = length(vec3(modelMatrix[0].xyz)); modelScale.y = length(vec3(modelMatrix[1].xyz)); modelScale.z = length(vec3(modelMatrix[2].xyz)); return normalize(refractionVector) * thickness * modelScale; } float applyIorToRoughness(float roughness, float ior) { return roughness * clamp(ior * 2.0 - 2.0, 0.0, 1.0); } vec3 getTransmissionSample(vec2 fragCoord, float roughness, float ior) { float framebufferLod = log2(transmissionSamplerSize.x) * applyIorToRoughness(roughness, ior); return texture2DLodEXT(transmissionSamplerMap, fragCoord.xy, framebufferLod).rgb; } vec3 applyVolumeAttenuation(vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance) { if (attenuationDistance == 0.0) { return radiance; } else { vec3 attenuationCoefficient = -log(attenuationColor) / attenuationDistance; vec3 transmittance = exp(-attenuationCoefficient * transmissionDistance); return transmittance * radiance; } } vec3 getIBLVolumeRefraction(vec3 n, vec3 v, float perceptualRoughness, vec3 baseColor, vec3 specularColor, vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, vec3 attenuationColor, float attenuationDistance) { vec3 transmissionRay = getVolumeTransmissionRay(n, v, thickness, ior, modelMatrix); vec3 refractedRayExit = position + transmissionRay; vec4 ndcPos = projMatrix * viewMatrix * vec4(refractedRayExit, 1.0); vec2 refractionCoords = ndcPos.xy / ndcPos.w; refractionCoords += 1.0; refractionCoords /= 2.0; vec3 transmittedLight = getTransmissionSample(refractionCoords, perceptualRoughness, ior); vec3 attenuatedColor = applyVolumeAttenuation(transmittedLight, length(transmissionRay), attenuationColor, attenuationDistance); return (1.0 - specularColor) * attenuatedColor * baseColor; } #endif`, Dle = `#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) varying vec2 vUv; #endif`, Ile = `#ifdef USE_UV #ifdef UVS_VERTEX_ONLY vec2 vUv; #else varying vec2 vUv; #endif uniform mat3 uvTransform; #endif`, Nle = `#ifdef USE_UV vUv = ( uvTransform * vec3( uv, 1 ) ).xy; #endif`, Ble = `#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) varying vec2 vUv2; #endif`, Fle = `#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) attribute vec2 uv2; varying vec2 vUv2; uniform mat3 uv2Transform; #endif`, zle = `#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; #endif`, $le = `#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) vec4 worldPosition = vec4( transformed, 1.0 ); #ifdef USE_INSTANCING worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; #endif`, Vle = `uniform sampler2D t2D; varying vec2 vUv; void main() { vec4 texColor = texture2D( t2D, vUv ); gl_FragColor = mapTexelToLinear( texColor ); #include #include }`, Ule = `varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); }`, jle = `#include uniform float opacity; varying vec3 vWorldDirection; #include void main() { vec3 vReflect = vWorldDirection; #include gl_FragColor = envColor; gl_FragColor.a *= opacity; #include #include }`, Hle = `varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; }`, Gle = `#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include #include #include #include #include #include #include varying vec2 vHighPrecisionZW; void main() { #include vec4 diffuseColor = vec4( 1.0 ); #if DEPTH_PACKING == 3200 diffuseColor.a = opacity; #endif #include #include #include #include float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; #if DEPTH_PACKING == 3200 gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); #elif DEPTH_PACKING == 3201 gl_FragColor = packDepthToRGBA( fragCoordZ ); #endif }`, Wle = `#include #include #include #include #include #include #include varying vec2 vHighPrecisionZW; void main() { #include #include #ifdef USE_DISPLACEMENTMAP #include #include #include #endif #include #include #include #include #include #include #include vHighPrecisionZW = gl_Position.zw; }`, qle = `#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; varying vec3 vWorldPosition; #include #include #include #include #include #include void main () { #include vec4 diffuseColor = vec4( 1.0 ); #include #include #include float dist = length( vWorldPosition - referencePosition ); dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); }`, Xle = `#define DISTANCE varying vec3 vWorldPosition; #include #include #include #include #include #include void main() { #include #include #ifdef USE_DISPLACEMENTMAP #include #include #include #endif #include #include #include #include #include #include #include vWorldPosition = worldPosition.xyz; }`, Zle = `uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { vec3 direction = normalize( vWorldDirection ); vec2 sampleUV = equirectUv( direction ); vec4 texColor = texture2D( tEquirect, sampleUV ); gl_FragColor = mapTexelToLinear( texColor ); #include #include }`, Yle = `varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include }`, Kle = `uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; varying float vLineDistance; #include #include #include #include #include void main() { #include if ( mod( vLineDistance, totalSize ) > dashSize ) { discard; } vec3 outgoingLight = vec3( 0.0 ); vec4 diffuseColor = vec4( diffuse, opacity ); #include #include outgoingLight = diffuseColor.rgb; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include }`, Jle = `uniform float scale; attribute float lineDistance; varying float vLineDistance; #include #include #include #include #include #include void main() { vLineDistance = scale * lineDistance; #include #include #include #include #include #include #include }`, Qle = `uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include #include #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); #ifdef USE_LIGHTMAP vec4 lightMapTexel= texture2D( lightMap, vUv2 ); reflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; #else reflectedLight.indirectDiffuse += vec3( 1.0 ); #endif #include reflectedLight.indirectDiffuse *= diffuseColor.rgb; vec3 outgoingLight = reflectedLight.indirectDiffuse; #include gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include #include }`, ece = `#include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #ifdef USE_ENVMAP #include #include #include #include #endif #include #include #include #include #include #include #include #include #include }`, tce = `uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; varying vec3 vLightFront; varying vec3 vIndirectFront; #ifdef DOUBLE_SIDED varying vec3 vLightBack; varying vec3 vIndirectBack; #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include vec4 diffuseColor = vec4( diffuse, opacity ); ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #ifdef DOUBLE_SIDED reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack; #else reflectedLight.indirectDiffuse += vIndirectFront; #endif #include reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ); #ifdef DOUBLE_SIDED reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack; #else reflectedLight.directDiffuse = vLightFront; #endif reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask(); #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; #include gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include #include }`, rce = `#define LAMBERT varying vec3 vLightFront; varying vec3 vIndirectFront; #ifdef DOUBLE_SIDED varying vec3 vLightBack; varying vec3 vIndirectBack; #endif #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include }`, ice = `#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include #include #include #include #include #include #include #include #include #include #include void main() { #include vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include #include #include #include vec3 viewDir = normalize( vViewPosition ); vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); vec3 y = cross( viewDir, x ); vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; #ifdef USE_MATCAP vec4 matcapColor = texture2D( matcap, uv ); matcapColor = matcapTexelToLinear( matcapColor ); #else vec4 matcapColor = vec4( 1.0 ); #endif vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include #include }`, nce = `#define MATCAP varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #endif #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; }`, ace = `#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include vec4 diffuseColor = vec4( diffuse, opacity ); ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include #include }`, oce = `#define TOON varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #endif #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include }`, sce = `#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; uniform float shininess; uniform float opacity; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include vec4 diffuseColor = vec4( diffuse, opacity ); ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; #include gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include #include }`, lce = `#define PHONG varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #endif #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include #include }`, cce = `#define STANDARD #ifdef PHYSICAL #define REFLECTIVITY #define CLEARCOAT #endif uniform vec3 diffuse; uniform vec3 emissive; uniform float roughness; uniform float metalness; uniform float opacity; #ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform vec3 attenuationColor; uniform float attenuationDistance; #endif #ifdef REFLECTIVITY uniform float reflectivity; #endif #ifdef CLEARCOAT uniform float clearcoat; uniform float clearcoatRoughness; #endif #ifdef USE_SHEEN uniform vec3 sheen; #endif varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include vec4 diffuseColor = vec4( diffuse, opacity ); ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; #include vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include #include }`, uce = `#define STANDARD varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif #ifdef USE_TRANSMISSION varying vec4 vWorldPosition; #endif #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif #endif #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include #ifdef USE_TRANSMISSION vWorldPosition = worldPosition; #endif }`, dce = `#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) varying vec3 vViewPosition; #endif #ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif #include #include #include #include #include #include void main() { #include #include #include #include gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); }`, hce = `#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) varying vec3 vViewPosition; #endif #ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif #endif #include #include #include #include #include #include #include #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) vViewPosition = - mvPosition.xyz; #endif }`, pce = `uniform vec3 diffuse; uniform float opacity; #include #include #include #include #include #include void main() { #include vec3 outgoingLight = vec3( 0.0 ); vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include outgoingLight = diffuseColor.rgb; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include #include }`, fce = `uniform float size; uniform float scale; #include #include #include #include #include #include void main() { #include #include #include #include gl_PointSize = size; #ifdef USE_SIZEATTENUATION bool isPerspective = isPerspectiveMatrix( projectionMatrix ); if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); #endif #include #include #include #include }`, mce = `uniform vec3 color; uniform float opacity; #include #include #include #include #include #include #include void main() { gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); #include #include #include }`, gce = `#include #include #include void main() { #include #include #include #include #include #include #include #include #include #include }`, vce = `uniform vec3 diffuse; uniform float opacity; #include #include #include #include #include #include #include void main() { #include vec3 outgoingLight = vec3( 0.0 ); vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include outgoingLight = diffuseColor.rgb; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include #include #include }`, yce = `uniform float rotation; uniform vec2 center; #include #include #include #include #include void main() { #include vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); vec2 scale; scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); #ifndef USE_SIZEATTENUATION bool isPerspective = isPerspectiveMatrix( projectionMatrix ); if ( isPerspective ) scale *= - mvPosition.z; #endif vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; vec2 rotatedPosition; rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; mvPosition.xy += rotatedPosition; gl_Position = projectionMatrix * mvPosition; #include #include #include }`; const Bt = { alphamap_fragment: Joe, alphamap_pars_fragment: Qoe, alphatest_fragment: ese, aomap_fragment: tse, aomap_pars_fragment: rse, begin_vertex: ise, beginnormal_vertex: nse, bsdfs: ase, bumpmap_pars_fragment: ose, clipping_planes_fragment: sse, clipping_planes_pars_fragment: lse, clipping_planes_pars_vertex: cse, clipping_planes_vertex: use, color_fragment: dse, color_pars_fragment: hse, color_pars_vertex: pse, color_vertex: fse, common: mse, cube_uv_reflection_fragment: gse, defaultnormal_vertex: vse, displacementmap_pars_vertex: yse, displacementmap_vertex: bse, emissivemap_fragment: xse, emissivemap_pars_fragment: wse, encodings_fragment: _se, encodings_pars_fragment: Sse, envmap_fragment: Mse, envmap_common_pars_fragment: Ese, envmap_pars_fragment: Tse, envmap_pars_vertex: Cse, envmap_physical_pars_fragment: Fse, envmap_vertex: Ase, fog_vertex: Lse, fog_pars_vertex: kse, fog_fragment: Pse, fog_pars_fragment: Rse, gradientmap_pars_fragment: Ose, lightmap_fragment: Dse, lightmap_pars_fragment: Ise, lights_lambert_vertex: Nse, lights_pars_begin: Bse, lights_toon_fragment: zse, lights_toon_pars_fragment: $se, lights_phong_fragment: Vse, lights_phong_pars_fragment: Use, lights_physical_fragment: jse, lights_physical_pars_fragment: Hse, lights_fragment_begin: Gse, lights_fragment_maps: Wse, lights_fragment_end: qse, logdepthbuf_fragment: Xse, logdepthbuf_pars_fragment: Zse, logdepthbuf_pars_vertex: Yse, logdepthbuf_vertex: Kse, map_fragment: Jse, map_pars_fragment: Qse, map_particle_fragment: ele, map_particle_pars_fragment: tle, metalnessmap_fragment: rle, metalnessmap_pars_fragment: ile, morphnormal_vertex: nle, morphtarget_pars_vertex: ale, morphtarget_vertex: ole, normal_fragment_begin: sle, normal_fragment_maps: lle, normalmap_pars_fragment: cle, clearcoat_normal_fragment_begin: ule, clearcoat_normal_fragment_maps: dle, clearcoat_pars_fragment: hle, packing: ple, premultiplied_alpha_fragment: fle, project_vertex: mle, dithering_fragment: gle, dithering_pars_fragment: vle, roughnessmap_fragment: yle, roughnessmap_pars_fragment: ble, shadowmap_pars_fragment: xle, shadowmap_pars_vertex: wle, shadowmap_vertex: _le, shadowmask_pars_fragment: Sle, skinbase_vertex: Mle, skinning_pars_vertex: Ele, skinning_vertex: Tle, skinnormal_vertex: Cle, specularmap_fragment: Ale, specularmap_pars_fragment: Lle, tonemapping_fragment: kle, tonemapping_pars_fragment: Ple, transmission_fragment: Rle, transmission_pars_fragment: Ole, uv_pars_fragment: Dle, uv_pars_vertex: Ile, uv_vertex: Nle, uv2_pars_fragment: Ble, uv2_pars_vertex: Fle, uv2_vertex: zle, worldpos_vertex: $le, background_frag: Vle, background_vert: Ule, cube_frag: jle, cube_vert: Hle, depth_frag: Gle, depth_vert: Wle, distanceRGBA_frag: qle, distanceRGBA_vert: Xle, equirect_frag: Zle, equirect_vert: Yle, linedashed_frag: Kle, linedashed_vert: Jle, meshbasic_frag: Qle, meshbasic_vert: ece, meshlambert_frag: tce, meshlambert_vert: rce, meshmatcap_frag: ice, meshmatcap_vert: nce, meshtoon_frag: ace, meshtoon_vert: oce, meshphong_frag: sce, meshphong_vert: lce, meshphysical_frag: cce, meshphysical_vert: uce, normal_frag: dce, normal_vert: hce, points_frag: pce, points_vert: fce, shadow_frag: mce, shadow_vert: gce, sprite_frag: vce, sprite_vert: yce }, Qe = { common: { diffuse: { value: new Je(16777215) }, opacity: { value: 1 }, map: { value: null }, uvTransform: { value: new Xr() }, uv2Transform: { value: new Xr() }, alphaMap: { value: null } }, specularmap: { specularMap: { value: null } }, envmap: { envMap: { value: null }, flipEnvMap: { value: -1 }, reflectivity: { value: 1 }, refractionRatio: { value: 0.98 }, maxMipLevel: { value: 0 } }, aomap: { aoMap: { value: null }, aoMapIntensity: { value: 1 } }, lightmap: { lightMap: { value: null }, lightMapIntensity: { value: 1 } }, emissivemap: { emissiveMap: { value: null } }, bumpmap: { bumpMap: { value: null }, bumpScale: { value: 1 } }, normalmap: { normalMap: { value: null }, normalScale: { value: new je(1, 1) } }, displacementmap: { displacementMap: { value: null }, displacementScale: { value: 1 }, displacementBias: { value: 0 } }, roughnessmap: { roughnessMap: { value: null } }, metalnessmap: { metalnessMap: { value: null } }, gradientmap: { gradientMap: { value: null } }, fog: { fogDensity: { value: 25e-5 }, fogNear: { value: 1 }, fogFar: { value: 2e3 }, fogColor: { value: new Je(16777215) } }, lights: { ambientLightColor: { value: [] }, lightProbe: { value: [] }, directionalLights: { value: [], properties: { direction: {}, color: {} } }, directionalLightShadows: { value: [], properties: { shadowBias: {}, shadowNormalBias: {}, shadowRadius: {}, shadowMapSize: {} } }, directionalShadowMap: { value: [] }, directionalShadowMatrix: { value: [] }, spotLights: { value: [], properties: { color: {}, position: {}, direction: {}, distance: {}, coneCos: {}, penumbraCos: {}, decay: {} } }, spotLightShadows: { value: [], properties: { shadowBias: {}, shadowNormalBias: {}, shadowRadius: {}, shadowMapSize: {} } }, spotShadowMap: { value: [] }, spotShadowMatrix: { value: [] }, pointLights: { value: [], properties: { color: {}, position: {}, decay: {}, distance: {} } }, pointLightShadows: { value: [], properties: { shadowBias: {}, shadowNormalBias: {}, shadowRadius: {}, shadowMapSize: {}, shadowCameraNear: {}, shadowCameraFar: {} } }, pointShadowMap: { value: [] }, pointShadowMatrix: { value: [] }, hemisphereLights: { value: [], properties: { direction: {}, skyColor: {}, groundColor: {} } }, // TODO (abelnation): RectAreaLight BRDF data needs to be moved from example to main src rectAreaLights: { value: [], properties: { color: {}, position: {}, width: {}, height: {} } }, ltc_1: { value: null }, ltc_2: { value: null } }, points: { diffuse: { value: new Je(16777215) }, opacity: { value: 1 }, size: { value: 1 }, scale: { value: 1 }, map: { value: null }, alphaMap: { value: null }, uvTransform: { value: new Xr() } }, sprite: { diffuse: { value: new Je(16777215) }, opacity: { value: 1 }, center: { value: new je(0.5, 0.5) }, rotation: { value: 0 }, map: { value: null }, alphaMap: { value: null }, uvTransform: { value: new Xr() } } }, Vn = { basic: { uniforms: wi([ Qe.common, Qe.specularmap, Qe.envmap, Qe.aomap, Qe.lightmap, Qe.fog ]), vertexShader: Bt.meshbasic_vert, fragmentShader: Bt.meshbasic_frag }, lambert: { uniforms: wi([ Qe.common, Qe.specularmap, Qe.envmap, Qe.aomap, Qe.lightmap, Qe.emissivemap, Qe.fog, Qe.lights, { emissive: { value: new Je(0) } } ]), vertexShader: Bt.meshlambert_vert, fragmentShader: Bt.meshlambert_frag }, phong: { uniforms: wi([ Qe.common, Qe.specularmap, Qe.envmap, Qe.aomap, Qe.lightmap, Qe.emissivemap, Qe.bumpmap, Qe.normalmap, Qe.displacementmap, Qe.fog, Qe.lights, { emissive: { value: new Je(0) }, specular: { value: new Je(1118481) }, shininess: { value: 30 } } ]), vertexShader: Bt.meshphong_vert, fragmentShader: Bt.meshphong_frag }, standard: { uniforms: wi([ Qe.common, Qe.envmap, Qe.aomap, Qe.lightmap, Qe.emissivemap, Qe.bumpmap, Qe.normalmap, Qe.displacementmap, Qe.roughnessmap, Qe.metalnessmap, Qe.fog, Qe.lights, { emissive: { value: new Je(0) }, roughness: { value: 1 }, metalness: { value: 0 }, envMapIntensity: { value: 1 } // temporary } ]), vertexShader: Bt.meshphysical_vert, fragmentShader: Bt.meshphysical_frag }, toon: { uniforms: wi([ Qe.common, Qe.aomap, Qe.lightmap, Qe.emissivemap, Qe.bumpmap, Qe.normalmap, Qe.displacementmap, Qe.gradientmap, Qe.fog, Qe.lights, { emissive: { value: new Je(0) } } ]), vertexShader: Bt.meshtoon_vert, fragmentShader: Bt.meshtoon_frag }, matcap: { uniforms: wi([ Qe.common, Qe.bumpmap, Qe.normalmap, Qe.displacementmap, Qe.fog, { matcap: { value: null } } ]), vertexShader: Bt.meshmatcap_vert, fragmentShader: Bt.meshmatcap_frag }, points: { uniforms: wi([ Qe.points, Qe.fog ]), vertexShader: Bt.points_vert, fragmentShader: Bt.points_frag }, dashed: { uniforms: wi([ Qe.common, Qe.fog, { scale: { value: 1 }, dashSize: { value: 1 }, totalSize: { value: 2 } } ]), vertexShader: Bt.linedashed_vert, fragmentShader: Bt.linedashed_frag }, depth: { uniforms: wi([ Qe.common, Qe.displacementmap ]), vertexShader: Bt.depth_vert, fragmentShader: Bt.depth_frag }, normal: { uniforms: wi([ Qe.common, Qe.bumpmap, Qe.normalmap, Qe.displacementmap, { opacity: { value: 1 } } ]), vertexShader: Bt.normal_vert, fragmentShader: Bt.normal_frag }, sprite: { uniforms: wi([ Qe.sprite, Qe.fog ]), vertexShader: Bt.sprite_vert, fragmentShader: Bt.sprite_frag }, background: { uniforms: { uvTransform: { value: new Xr() }, t2D: { value: null } }, vertexShader: Bt.background_vert, fragmentShader: Bt.background_frag }, /* ------------------------------------------------------------------------- // Cube map shader ------------------------------------------------------------------------- */ cube: { uniforms: wi([ Qe.envmap, { opacity: { value: 1 } } ]), vertexShader: Bt.cube_vert, fragmentShader: Bt.cube_frag }, equirect: { uniforms: { tEquirect: { value: null } }, vertexShader: Bt.equirect_vert, fragmentShader: Bt.equirect_frag }, distanceRGBA: { uniforms: wi([ Qe.common, Qe.displacementmap, { referencePosition: { value: new de() }, nearDistance: { value: 1 }, farDistance: { value: 1e3 } } ]), vertexShader: Bt.distanceRGBA_vert, fragmentShader: Bt.distanceRGBA_frag }, shadow: { uniforms: wi([ Qe.lights, Qe.fog, { color: { value: new Je(0) }, opacity: { value: 1 } } ]), vertexShader: Bt.shadow_vert, fragmentShader: Bt.shadow_frag } }; Vn.physical = { uniforms: wi([ Vn.standard.uniforms, { clearcoat: { value: 0 }, clearcoatMap: { value: null }, clearcoatRoughness: { value: 0 }, clearcoatRoughnessMap: { value: null }, clearcoatNormalScale: { value: new je(1, 1) }, clearcoatNormalMap: { value: null }, sheen: { value: new Je(0) }, transmission: { value: 0 }, transmissionMap: { value: null }, transmissionSamplerSize: { value: new je() }, transmissionSamplerMap: { value: null }, thickness: { value: 0 }, thicknessMap: { value: null }, attenuationDistance: { value: 0 }, attenuationColor: { value: new Je(0) } } ]), vertexShader: Bt.meshphysical_vert, fragmentShader: Bt.meshphysical_frag }; function bce(t, e, r, i, n) { const a = new Je(0); let o = 0, s, c, l = null, u = 0, d = null; function h(p, m) { let y = !1, g = m.isScene === !0 ? m.background : null; g && g.isTexture && (g = e.get(g)); const v = t.xr, x = v.getSession && v.getSession(); x && x.environmentBlendMode === "additive" && (g = null), g === null ? f(a, o) : g && g.isColor && (f(g, 1), y = !0), (t.autoClear || y) && t.clear(t.autoClearColor, t.autoClearDepth, t.autoClearStencil), g && (g.isCubeTexture || g.mapping === ed) ? (c === void 0 && (c = new Fr( new oo(1, 1, 1), new so({ name: "BackgroundCubeMaterial", uniforms: yu(Vn.cube.uniforms), vertexShader: Vn.cube.vertexShader, fragmentShader: Vn.cube.fragmentShader, side: Or, depthTest: !1, depthWrite: !1, fog: !1 }) ), c.geometry.deleteAttribute("normal"), c.geometry.deleteAttribute("uv"), c.onBeforeRender = function(w, S, _) { this.matrixWorld.copyPosition(_.matrixWorld); }, Object.defineProperty(c.material, "envMap", { get: function() { return this.uniforms.envMap.value; } }), i.update(c)), c.material.uniforms.envMap.value = g, c.material.uniforms.flipEnvMap.value = g.isCubeTexture && g._needsFlipEnvMap ? -1 : 1, (l !== g || u !== g.version || d !== t.toneMapping) && (c.material.needsUpdate = !0, l = g, u = g.version, d = t.toneMapping), p.unshift(c, c.geometry, c.material, 0, 0, null)) : g && g.isTexture && (s === void 0 && (s = new Fr( new Pl(2, 2), new so({ name: "BackgroundMaterial", uniforms: yu(Vn.background.uniforms), vertexShader: Vn.background.vertexShader, fragmentShader: Vn.background.fragmentShader, side: xs, depthTest: !1, depthWrite: !1, fog: !1 }) ), s.geometry.deleteAttribute("normal"), Object.defineProperty(s.material, "map", { get: function() { return this.uniforms.t2D.value; } }), i.update(s)), s.material.uniforms.t2D.value = g, g.matrixAutoUpdate === !0 && g.updateMatrix(), s.material.uniforms.uvTransform.value.copy(g.matrix), (l !== g || u !== g.version || d !== t.toneMapping) && (s.material.needsUpdate = !0, l = g, u = g.version, d = t.toneMapping), p.unshift(s, s.geometry, s.material, 0, 0, null)); } function f(p, m) { r.buffers.color.setClear(p.r, p.g, p.b, m, n); } return { getClearColor: function() { return a; }, setClearColor: function(p, m = 1) { a.set(p), o = m, f(a, o); }, getClearAlpha: function() { return o; }, setClearAlpha: function(p) { o = p, f(a, o); }, render: h }; } function xce(t, e, r, i) { const n = t.getParameter(34921), a = i.isWebGL2 ? null : e.get("OES_vertex_array_object"), o = i.isWebGL2 || a !== null, s = {}, c = m(null); let l = c; function u(k, P, R, M, O) { let D = !1; if (o) { const I = p(M, R, P); l !== I && (l = I, h(l.object)), D = y(M, O), D && g(M, O); } else { const I = P.wireframe === !0; (l.geometry !== M.id || l.program !== R.id || l.wireframe !== I) && (l.geometry = M.id, l.program = R.id, l.wireframe = I, D = !0); } k.isInstancedMesh === !0 && (D = !0), O !== null && r.update(O, 34963), D && (b(k, P, R, M), O !== null && t.bindBuffer(34963, r.get(O).buffer)); } function d() { return i.isWebGL2 ? t.createVertexArray() : a.createVertexArrayOES(); } function h(k) { return i.isWebGL2 ? t.bindVertexArray(k) : a.bindVertexArrayOES(k); } function f(k) { return i.isWebGL2 ? t.deleteVertexArray(k) : a.deleteVertexArrayOES(k); } function p(k, P, R) { const M = R.wireframe === !0; let O = s[k.id]; O === void 0 && (O = {}, s[k.id] = O); let D = O[P.id]; D === void 0 && (D = {}, O[P.id] = D); let I = D[M]; return I === void 0 && (I = m(d()), D[M] = I), I; } function m(k) { const P = [], R = [], M = []; for (let O = 0; O < n; O++) P[O] = 0, R[O] = 0, M[O] = 0; return { // for backward compatibility on non-VAO support browser geometry: null, program: null, wireframe: !1, newAttributes: P, enabledAttributes: R, attributeDivisors: M, object: k, attributes: {}, index: null }; } function y(k, P) { const R = l.attributes, M = k.attributes; let O = 0; for (const D in M) { const I = R[D], F = M[D]; if (I === void 0 || I.attribute !== F || I.data !== F.data) return !0; O++; } return l.attributesNum !== O || l.index !== P; } function g(k, P) { const R = {}, M = k.attributes; let O = 0; for (const D in M) { const I = M[D], F = {}; F.attribute = I, I.data && (F.data = I.data), R[D] = F, O++; } l.attributes = R, l.attributesNum = O, l.index = P; } function v() { const k = l.newAttributes; for (let P = 0, R = k.length; P < R; P++) k[P] = 0; } function x(k) { w(k, 0); } function w(k, P) { const R = l.newAttributes, M = l.enabledAttributes, O = l.attributeDivisors; R[k] = 1, M[k] === 0 && (t.enableVertexAttribArray(k), M[k] = 1), O[k] !== P && ((i.isWebGL2 ? t : e.get("ANGLE_instanced_arrays"))[i.isWebGL2 ? "vertexAttribDivisor" : "vertexAttribDivisorANGLE"](k, P), O[k] = P); } function S() { const k = l.newAttributes, P = l.enabledAttributes; for (let R = 0, M = P.length; R < M; R++) P[R] !== k[R] && (t.disableVertexAttribArray(R), P[R] = 0); } function _(k, P, R, M, O, D) { i.isWebGL2 === !0 && (R === 5124 || R === 5125) ? t.vertexAttribIPointer(k, P, R, O, D) : t.vertexAttribPointer(k, P, R, M, O, D); } function b(k, P, R, M) { if (i.isWebGL2 === !1 && (k.isInstancedMesh || M.isInstancedBufferGeometry) && e.get("ANGLE_instanced_arrays") === null) return; v(); const O = M.attributes, D = R.getAttributes(), I = P.defaultAttributeValues; for (const F in D) { const z = D[F]; if (z >= 0) { const U = O[F]; if (U !== void 0) { const Z = U.normalized, re = U.itemSize, K = r.get(U); if (K === void 0) continue; const V = K.buffer, H = K.type, G = K.bytesPerElement; if (U.isInterleavedBufferAttribute) { const W = U.data, Y = W.stride, X = U.offset; W && W.isInstancedInterleavedBuffer ? (w(z, W.meshPerAttribute), M._maxInstanceCount === void 0 && (M._maxInstanceCount = W.meshPerAttribute * W.count)) : x(z), t.bindBuffer(34962, V), _(z, re, H, Z, Y * G, X * G); } else U.isInstancedBufferAttribute ? (w(z, U.meshPerAttribute), M._maxInstanceCount === void 0 && (M._maxInstanceCount = U.meshPerAttribute * U.count)) : x(z), t.bindBuffer(34962, V), _(z, re, H, Z, 0, 0); } else if (F === "instanceMatrix") { const Z = r.get(k.instanceMatrix); if (Z === void 0) continue; const re = Z.buffer, K = Z.type; w(z + 0, 1), w(z + 1, 1), w(z + 2, 1), w(z + 3, 1), t.bindBuffer(34962, re), t.vertexAttribPointer(z + 0, 4, K, !1, 64, 0), t.vertexAttribPointer(z + 1, 4, K, !1, 64, 16), t.vertexAttribPointer(z + 2, 4, K, !1, 64, 32), t.vertexAttribPointer(z + 3, 4, K, !1, 64, 48); } else if (F === "instanceColor") { const Z = r.get(k.instanceColor); if (Z === void 0) continue; const re = Z.buffer, K = Z.type; w(z, 1), t.bindBuffer(34962, re), t.vertexAttribPointer(z, 3, K, !1, 12, 0); } else if (I !== void 0) { const Z = I[F]; if (Z !== void 0) switch (Z.length) { case 2: t.vertexAttrib2fv(z, Z); break; case 3: t.vertexAttrib3fv(z, Z); break; case 4: t.vertexAttrib4fv(z, Z); break; default: t.vertexAttrib1fv(z, Z); } } } } S(); } function T() { L(); for (const k in s) { const P = s[k]; for (const R in P) { const M = P[R]; for (const O in M) f(M[O].object), delete M[O]; delete P[R]; } delete s[k]; } } function E(k) { if (s[k.id] === void 0) return; const P = s[k.id]; for (const R in P) { const M = P[R]; for (const O in M) f(M[O].object), delete M[O]; delete P[R]; } delete s[k.id]; } function C(k) { for (const P in s) { const R = s[P]; if (R[k.id] === void 0) continue; const M = R[k.id]; for (const O in M) f(M[O].object), delete M[O]; delete R[k.id]; } } function L() { A(), l !== c && (l = c, h(l.object)); } function A() { c.geometry = null, c.program = null, c.wireframe = !1; } return { setup: u, reset: L, resetDefaultState: A, dispose: T, releaseStatesOfGeometry: E, releaseStatesOfProgram: C, initAttributes: v, enableAttribute: x, disableUnusedAttributes: S }; } function wce(t, e, r, i) { const n = i.isWebGL2; let a; function o(l) { a = l; } function s(l, u) { t.drawArrays(a, l, u), r.update(u, a, 1); } function c(l, u, d) { if (d === 0) return; let h, f; if (n) h = t, f = "drawArraysInstanced"; else if (h = e.get("ANGLE_instanced_arrays"), f = "drawArraysInstancedANGLE", h === null) { console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."); return; } h[f](a, l, u, d), r.update(u, a, d); } this.setMode = o, this.render = s, this.renderInstances = c; } function _ce(t, e, r) { let i; function n() { if (i !== void 0) return i; if (e.has("EXT_texture_filter_anisotropic") === !0) { const b = e.get("EXT_texture_filter_anisotropic"); i = t.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT); } else i = 0; return i; } function a(b) { if (b === "highp") { if (t.getShaderPrecisionFormat(35633, 36338).precision > 0 && t.getShaderPrecisionFormat(35632, 36338).precision > 0) return "highp"; b = "mediump"; } return b === "mediump" && t.getShaderPrecisionFormat(35633, 36337).precision > 0 && t.getShaderPrecisionFormat(35632, 36337).precision > 0 ? "mediump" : "lowp"; } const o = typeof WebGL2RenderingContext < "u" && t instanceof WebGL2RenderingContext || typeof WebGL2ComputeRenderingContext < "u" && t instanceof WebGL2ComputeRenderingContext; let s = r.precision !== void 0 ? r.precision : "highp"; const c = a(s); c !== s && (console.warn("THREE.WebGLRenderer:", s, "not supported, using", c, "instead."), s = c); const l = o || e.has("WEBGL_draw_buffers"), u = r.logarithmicDepthBuffer === !0, d = t.getParameter(34930), h = t.getParameter(35660), f = t.getParameter(3379), p = t.getParameter(34076), m = t.getParameter(34921), y = t.getParameter(36347), g = t.getParameter(36348), v = t.getParameter(36349), x = h > 0, w = o || e.has("OES_texture_float"), S = x && w, _ = o ? t.getParameter(36183) : 0; return { isWebGL2: o, drawBuffers: l, getMaxAnisotropy: n, getMaxPrecision: a, precision: s, logarithmicDepthBuffer: u, maxTextures: d, maxVertexTextures: h, maxTextureSize: f, maxCubemapSize: p, maxAttributes: m, maxVertexUniforms: y, maxVaryings: g, maxFragmentUniforms: v, vertexTextures: x, floatFragmentTextures: w, floatVertexTextures: S, maxSamples: _ }; } function Sce(t) { const e = this; let r = null, i = 0, n = !1, a = !1; const o = new oa(), s = new Xr(), c = { value: null, needsUpdate: !1 }; this.uniform = c, this.numPlanes = 0, this.numIntersection = 0, this.init = function(d, h, f) { const p = d.length !== 0 || h || // enable state of previous frame - the clipping code has to // run another frame in order to reset the state: i !== 0 || n; return n = h, r = u(d, f, 0), i = d.length, p; }, this.beginShadows = function() { a = !0, u(null); }, this.endShadows = function() { a = !1, l(); }, this.setState = function(d, h, f) { const p = d.clippingPlanes, m = d.clipIntersection, y = d.clipShadows, g = t.get(d); if (!n || p === null || p.length === 0 || a && !y) a ? u(null) : l(); else { const v = a ? 0 : i, x = v * 4; let w = g.clippingState || null; c.value = w, w = u(p, h, x, f); for (let S = 0; S !== x; ++S) w[S] = r[S]; g.clippingState = w, this.numIntersection = m ? this.numPlanes : 0, this.numPlanes += v; } }; function l() { c.value !== r && (c.value = r, c.needsUpdate = i > 0), e.numPlanes = i, e.numIntersection = 0; } function u(d, h, f, p) { const m = d !== null ? d.length : 0; let y = null; if (m !== 0) { if (y = c.value, p !== !0 || y === null) { const g = f + m * 4, v = h.matrixWorldInverse; s.getNormalMatrix(v), (y === null || y.length < g) && (y = new Float32Array(g)); for (let x = 0, w = f; x !== m; ++x, w += 4) o.copy(d[x]).applyMatrix4(v, s), o.normal.toArray(y, w), y[w + 3] = o.constant; } c.value = y, c.needsUpdate = !0; } return e.numPlanes = m, e.numIntersection = 0, y; } } function Mce(t) { let e = /* @__PURE__ */ new WeakMap(); function r(o, s) { return s === eg ? o.mapping = gp : s === tg && (o.mapping = vp), o; } function i(o) { if (o && o.isTexture) { const s = o.mapping; if (s === eg || s === tg) if (e.has(o)) { const c = e.get(o).texture; return r(c, o.mapping); } else { const c = o.image; if (c && c.height > 0) { const l = t.getRenderTarget(), u = new hv(c.height / 2); return u.fromEquirectangularTexture(t, o), e.set(o, u), t.setRenderTarget(l), o.addEventListener("dispose", n), r(u.texture, o.mapping); } else return null; } } return o; } function n(o) { const s = o.target; s.removeEventListener("dispose", n); const c = e.get(s); c !== void 0 && (e.delete(s), c.dispose()); } function a() { e = /* @__PURE__ */ new WeakMap(); } return { get: i, dispose: a }; } function Ece(t) { const e = {}; function r(i) { if (e[i] !== void 0) return e[i]; let n; switch (i) { case "WEBGL_depth_texture": n = t.getExtension("WEBGL_depth_texture") || t.getExtension("MOZ_WEBGL_depth_texture") || t.getExtension("WEBKIT_WEBGL_depth_texture"); break; case "EXT_texture_filter_anisotropic": n = t.getExtension("EXT_texture_filter_anisotropic") || t.getExtension("MOZ_EXT_texture_filter_anisotropic") || t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"); break; case "WEBGL_compressed_texture_s3tc": n = t.getExtension("WEBGL_compressed_texture_s3tc") || t.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"); break; case "WEBGL_compressed_texture_pvrtc": n = t.getExtension("WEBGL_compressed_texture_pvrtc") || t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"); break; default: n = t.getExtension(i); } return e[i] = n, n; } return { has: function(i) { return r(i) !== null; }, init: function(i) { i.isWebGL2 ? r("EXT_color_buffer_float") : (r("WEBGL_depth_texture"), r("OES_texture_float"), r("OES_texture_half_float"), r("OES_texture_half_float_linear"), r("OES_standard_derivatives"), r("OES_element_index_uint"), r("OES_vertex_array_object"), r("ANGLE_instanced_arrays")), r("OES_texture_float_linear"), r("EXT_color_buffer_half_float"); }, get: function(i) { const n = r(i); return n === null && console.warn("THREE.WebGLRenderer: " + i + " extension not supported."), n; } }; } function Tce(t, e, r, i) { const n = {}, a = /* @__PURE__ */ new WeakMap(); function o(d) { const h = d.target; h.index !== null && e.remove(h.index); for (const p in h.attributes) e.remove(h.attributes[p]); h.removeEventListener("dispose", o), delete n[h.id]; const f = a.get(h); f && (e.remove(f), a.delete(h)), i.releaseStatesOfGeometry(h), h.isInstancedBufferGeometry === !0 && delete h._maxInstanceCount, r.memory.geometries--; } function s(d, h) { return n[h.id] === !0 || (h.addEventListener("dispose", o), n[h.id] = !0, r.memory.geometries++), h; } function c(d) { const h = d.attributes; for (const p in h) e.update(h[p], 34962); const f = d.morphAttributes; for (const p in f) { const m = f[p]; for (let y = 0, g = m.length; y < g; y++) e.update(m[y], 34962); } } function l(d) { const h = [], f = d.index, p = d.attributes.position; let m = 0; if (f !== null) { const v = f.array; m = f.version; for (let x = 0, w = v.length; x < w; x += 3) { const S = v[x + 0], _ = v[x + 1], b = v[x + 2]; h.push(S, _, _, b, b, S); } } else { const v = p.array; m = p.version; for (let x = 0, w = v.length / 3 - 1; x < w; x += 3) { const S = x + 0, _ = x + 1, b = x + 2; h.push(S, _, _, b, b, S); } } const y = new (HR(h) > 65535 ? uv : cv)(h, 1); y.version = m; const g = a.get(d); g && e.remove(g), a.set(d, y); } function u(d) { const h = a.get(d); if (h) { const f = d.index; f !== null && h.version < f.version && l(d); } else l(d); return a.get(d); } return { get: s, update: c, getWireframeAttribute: u }; } function Cce(t, e, r, i) { const n = i.isWebGL2; let a; function o(h) { a = h; } let s, c; function l(h) { s = h.type, c = h.bytesPerElement; } function u(h, f) { t.drawElements(a, f, s, h * c), r.update(f, a, 1); } function d(h, f, p) { if (p === 0) return; let m, y; if (n) m = t, y = "drawElementsInstanced"; else if (m = e.get("ANGLE_instanced_arrays"), y = "drawElementsInstancedANGLE", m === null) { console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."); return; } m[y](a, f, s, h * c, p), r.update(f, a, p); } this.setMode = o, this.setIndex = l, this.render = u, this.renderInstances = d; } function Ace(t) { const e = { geometries: 0, textures: 0 }, r = { frame: 0, calls: 0, triangles: 0, points: 0, lines: 0 }; function i(a, o, s) { switch (r.calls++, o) { case 4: r.triangles += s * (a / 3); break; case 1: r.lines += s * (a / 2); break; case 3: r.lines += s * (a - 1); break; case 2: r.lines += s * a; break; case 0: r.points += s * a; break; default: console.error("THREE.WebGLInfo: Unknown draw mode:", o); break; } } function n() { r.frame++, r.calls = 0, r.triangles = 0, r.points = 0, r.lines = 0; } return { memory: e, render: r, programs: null, autoReset: !0, reset: n, update: i }; } function Lce(t, e) { return t[0] - e[0]; } function kce(t, e) { return Math.abs(e[1]) - Math.abs(t[1]); } function Pce(t) { const e = {}, r = new Float32Array(8), i = []; for (let a = 0; a < 8; a++) i[a] = [a, 0]; function n(a, o, s, c) { const l = a.morphTargetInfluences, u = l === void 0 ? 0 : l.length; let d = e[o.id]; if (d === void 0 || d.length !== u) { d = []; for (let y = 0; y < u; y++) d[y] = [y, 0]; e[o.id] = d; } for (let y = 0; y < u; y++) { const g = d[y]; g[0] = y, g[1] = l[y]; } d.sort(kce); for (let y = 0; y < 8; y++) y < u && d[y][1] ? (i[y][0] = d[y][0], i[y][1] = d[y][1]) : (i[y][0] = Number.MAX_SAFE_INTEGER, i[y][1] = 0); i.sort(Lce); const h = s.morphTargets && o.morphAttributes.position, f = s.morphNormals && o.morphAttributes.normal; let p = 0; for (let y = 0; y < 8; y++) { const g = i[y], v = g[0], x = g[1]; v !== Number.MAX_SAFE_INTEGER && x ? (h && o.getAttribute("morphTarget" + y) !== h[v] && o.setAttribute("morphTarget" + y, h[v]), f && o.getAttribute("morphNormal" + y) !== f[v] && o.setAttribute("morphNormal" + y, f[v]), r[y] = x, p += x) : (h && o.hasAttribute("morphTarget" + y) === !0 && o.deleteAttribute("morphTarget" + y), f && o.hasAttribute("morphNormal" + y) === !0 && o.deleteAttribute("morphNormal" + y), r[y] = 0); } const m = o.morphTargetsRelative ? 1 : 1 - p; c.getUniforms().setValue(t, "morphTargetBaseInfluence", m), c.getUniforms().setValue(t, "morphTargetInfluences", r); } return { update: n }; } function Rce(t, e, r, i) { let n = /* @__PURE__ */ new WeakMap(); function a(c) { const l = i.render.frame, u = c.geometry, d = e.get(c, u); return n.get(d) !== l && (e.update(d), n.set(d, l)), c.isInstancedMesh && (c.hasEventListener("dispose", s) === !1 && c.addEventListener("dispose", s), r.update(c.instanceMatrix, 34962), c.instanceColor !== null && r.update(c.instanceColor, 34962)), d; } function o() { n = /* @__PURE__ */ new WeakMap(); } function s(c) { const l = c.target; l.removeEventListener("dispose", s), r.remove(l.instanceMatrix), l.instanceColor !== null && r.remove(l.instanceColor); } return { update: a, dispose: o }; } class Vx extends zr { constructor(e = null, r = 1, i = 1, n = 1) { super(null), this.image = { data: e, width: r, height: i, depth: n }, this.magFilter = Dr, this.minFilter = Dr, this.wrapR = ii, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1, this.needsUpdate = !0; } } Vx.prototype.isDataTexture2DArray = !0; class Ux extends zr { constructor(e = null, r = 1, i = 1, n = 1) { super(null), this.image = { data: e, width: r, height: i, depth: n }, this.magFilter = Dr, this.minFilter = Dr, this.wrapR = ii, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1, this.needsUpdate = !0; } } Ux.prototype.isDataTexture3D = !0; const qR = new zr(), Oce = new Vx(), Dce = new Ux(), XR = new td(), WM = [], qM = [], XM = new Float32Array(16), ZM = new Float32Array(9), YM = new Float32Array(4); function rd(t, e, r) { const i = t[0]; if (i <= 0 || i > 0) return t; const n = e * r; let a = WM[n]; if (a === void 0 && (a = new Float32Array(n), WM[n] = a), e !== 0) { i.toArray(a, 0); for (let o = 1, s = 0; o !== e; ++o) s += r, t[o].toArray(a, s); } return a; } function Fi(t, e) { if (t.length !== e.length) return !1; for (let r = 0, i = t.length; r < i; r++) if (t[r] !== e[r]) return !1; return !0; } function Li(t, e) { for (let r = 0, i = e.length; r < i; r++) t[r] = e[r]; } function ZR(t, e) { let r = qM[e]; r === void 0 && (r = new Int32Array(e), qM[e] = r); for (let i = 0; i !== e; ++i) r[i] = t.allocateTextureUnit(); return r; } function Ice(t, e) { const r = this.cache; r[0] !== e && (t.uniform1f(this.addr, e), r[0] = e); } function Nce(t, e) { const r = this.cache; if (e.x !== void 0) (r[0] !== e.x || r[1] !== e.y) && (t.uniform2f(this.addr, e.x, e.y), r[0] = e.x, r[1] = e.y); else { if (Fi(r, e)) return; t.uniform2fv(this.addr, e), Li(r, e); } } function Bce(t, e) { const r = this.cache; if (e.x !== void 0) (r[0] !== e.x || r[1] !== e.y || r[2] !== e.z) && (t.uniform3f(this.addr, e.x, e.y, e.z), r[0] = e.x, r[1] = e.y, r[2] = e.z); else if (e.r !== void 0) (r[0] !== e.r || r[1] !== e.g || r[2] !== e.b) && (t.uniform3f(this.addr, e.r, e.g, e.b), r[0] = e.r, r[1] = e.g, r[2] = e.b); else { if (Fi(r, e)) return; t.uniform3fv(this.addr, e), Li(r, e); } } function Fce(t, e) { const r = this.cache; if (e.x !== void 0) (r[0] !== e.x || r[1] !== e.y || r[2] !== e.z || r[3] !== e.w) && (t.uniform4f(this.addr, e.x, e.y, e.z, e.w), r[0] = e.x, r[1] = e.y, r[2] = e.z, r[3] = e.w); else { if (Fi(r, e)) return; t.uniform4fv(this.addr, e), Li(r, e); } } function zce(t, e) { const r = this.cache, i = e.elements; if (i === void 0) { if (Fi(r, e)) return; t.uniformMatrix2fv(this.addr, !1, e), Li(r, e); } else { if (Fi(r, i)) return; YM.set(i), t.uniformMatrix2fv(this.addr, !1, YM), Li(r, i); } } function $ce(t, e) { const r = this.cache, i = e.elements; if (i === void 0) { if (Fi(r, e)) return; t.uniformMatrix3fv(this.addr, !1, e), Li(r, e); } else { if (Fi(r, i)) return; ZM.set(i), t.uniformMatrix3fv(this.addr, !1, ZM), Li(r, i); } } function Vce(t, e) { const r = this.cache, i = e.elements; if (i === void 0) { if (Fi(r, e)) return; t.uniformMatrix4fv(this.addr, !1, e), Li(r, e); } else { if (Fi(r, i)) return; XM.set(i), t.uniformMatrix4fv(this.addr, !1, XM), Li(r, i); } } function Uce(t, e) { const r = this.cache; r[0] !== e && (t.uniform1i(this.addr, e), r[0] = e); } function jce(t, e) { const r = this.cache; Fi(r, e) || (t.uniform2iv(this.addr, e), Li(r, e)); } function Hce(t, e) { const r = this.cache; Fi(r, e) || (t.uniform3iv(this.addr, e), Li(r, e)); } function Gce(t, e) { const r = this.cache; Fi(r, e) || (t.uniform4iv(this.addr, e), Li(r, e)); } function Wce(t, e) { const r = this.cache; r[0] !== e && (t.uniform1ui(this.addr, e), r[0] = e); } function qce(t, e) { const r = this.cache; Fi(r, e) || (t.uniform2uiv(this.addr, e), Li(r, e)); } function Xce(t, e) { const r = this.cache; Fi(r, e) || (t.uniform3uiv(this.addr, e), Li(r, e)); } function Zce(t, e) { const r = this.cache; Fi(r, e) || (t.uniform4uiv(this.addr, e), Li(r, e)); } function Yce(t, e, r) { const i = this.cache, n = r.allocateTextureUnit(); i[0] !== n && (t.uniform1i(this.addr, n), i[0] = n), r.safeSetTexture2D(e || qR, n); } function Kce(t, e, r) { const i = this.cache, n = r.allocateTextureUnit(); i[0] !== n && (t.uniform1i(this.addr, n), i[0] = n), r.setTexture3D(e || Dce, n); } function Jce(t, e, r) { const i = this.cache, n = r.allocateTextureUnit(); i[0] !== n && (t.uniform1i(this.addr, n), i[0] = n), r.safeSetTextureCube(e || XR, n); } function Qce(t, e, r) { const i = this.cache, n = r.allocateTextureUnit(); i[0] !== n && (t.uniform1i(this.addr, n), i[0] = n), r.setTexture2DArray(e || Oce, n); } function eue(t) { switch (t) { case 5126: return Ice; case 35664: return Nce; case 35665: return Bce; case 35666: return Fce; case 35674: return zce; case 35675: return $ce; case 35676: return Vce; case 5124: case 35670: return Uce; case 35667: case 35671: return jce; case 35668: case 35672: return Hce; case 35669: case 35673: return Gce; case 5125: return Wce; case 36294: return qce; case 36295: return Xce; case 36296: return Zce; case 35678: case 36198: case 36298: case 36306: case 35682: return Yce; case 35679: case 36299: case 36307: return Kce; case 35680: case 36300: case 36308: case 36293: return Jce; case 36289: case 36303: case 36311: case 36292: return Qce; } } function tue(t, e) { t.uniform1fv(this.addr, e); } function rue(t, e) { const r = rd(e, this.size, 2); t.uniform2fv(this.addr, r); } function iue(t, e) { const r = rd(e, this.size, 3); t.uniform3fv(this.addr, r); } function nue(t, e) { const r = rd(e, this.size, 4); t.uniform4fv(this.addr, r); } function aue(t, e) { const r = rd(e, this.size, 4); t.uniformMatrix2fv(this.addr, !1, r); } function oue(t, e) { const r = rd(e, this.size, 9); t.uniformMatrix3fv(this.addr, !1, r); } function sue(t, e) { const r = rd(e, this.size, 16); t.uniformMatrix4fv(this.addr, !1, r); } function lue(t, e) { t.uniform1iv(this.addr, e); } function cue(t, e) { t.uniform2iv(this.addr, e); } function uue(t, e) { t.uniform3iv(this.addr, e); } function due(t, e) { t.uniform4iv(this.addr, e); } function hue(t, e) { t.uniform1uiv(this.addr, e); } function pue(t, e) { t.uniform2uiv(this.addr, e); } function fue(t, e) { t.uniform3uiv(this.addr, e); } function mue(t, e) { t.uniform4uiv(this.addr, e); } function gue(t, e, r) { const i = e.length, n = ZR(r, i); t.uniform1iv(this.addr, n); for (let a = 0; a !== i; ++a) r.safeSetTexture2D(e[a] || qR, n[a]); } function vue(t, e, r) { const i = e.length, n = ZR(r, i); t.uniform1iv(this.addr, n); for (let a = 0; a !== i; ++a) r.safeSetTextureCube(e[a] || XR, n[a]); } function yue(t) { switch (t) { case 5126: return tue; case 35664: return rue; case 35665: return iue; case 35666: return nue; case 35674: return aue; case 35675: return oue; case 35676: return sue; case 5124: case 35670: return lue; case 35667: case 35671: return cue; case 35668: case 35672: return uue; case 35669: case 35673: return due; case 5125: return hue; case 36294: return pue; case 36295: return fue; case 36296: return mue; case 35678: case 36198: case 36298: case 36306: case 35682: return gue; case 35680: case 36300: case 36308: case 36293: return vue; } } function bue(t, e, r) { this.id = t, this.addr = r, this.cache = [], this.setValue = eue(e.type); } function YR(t, e, r) { this.id = t, this.addr = r, this.cache = [], this.size = e.size, this.setValue = yue(e.type); } YR.prototype.updateCache = function(t) { const e = this.cache; t instanceof Float32Array && e.length !== t.length && (this.cache = new Float32Array(t.length)), Li(e, t); }; function KR(t) { this.id = t, this.seq = [], this.map = {}; } KR.prototype.setValue = function(t, e, r) { const i = this.seq; for (let n = 0, a = i.length; n !== a; ++n) { const o = i[n]; o.setValue(t, e[o.id], r); } }; const N0 = /(\w+)(\])?(\[|\.)?/g; function KM(t, e) { t.seq.push(e), t.map[e.id] = e; } function xue(t, e, r) { const i = t.name, n = i.length; for (N0.lastIndex = 0; ; ) { const a = N0.exec(i), o = N0.lastIndex; let s = a[1]; const c = a[2] === "]", l = a[3]; if (c && (s = s | 0), l === void 0 || l === "[" && o + 2 === n) { KM(r, l === void 0 ? new bue(s, t, e) : new YR(s, t, e)); break; } else { let u = r.map[s]; u === void 0 && (u = new KR(s), KM(r, u)), r = u; } } } function as(t, e) { this.seq = [], this.map = {}; const r = t.getProgramParameter(e, 35718); for (let i = 0; i < r; ++i) { const n = t.getActiveUniform(e, i), a = t.getUniformLocation(e, n.name); xue(n, a, this); } } as.prototype.setValue = function(t, e, r, i) { const n = this.map[e]; n !== void 0 && n.setValue(t, r, i); }; as.prototype.setOptional = function(t, e, r) { const i = e[r]; i !== void 0 && this.setValue(t, r, i); }; as.upload = function(t, e, r, i) { for (let n = 0, a = e.length; n !== a; ++n) { const o = e[n], s = r[o.id]; s.needsUpdate !== !1 && o.setValue(t, s.value, i); } }; as.seqWithValue = function(t, e) { const r = []; for (let i = 0, n = t.length; i !== n; ++i) { const a = t[i]; a.id in e && r.push(a); } return r; }; function JM(t, e, r) { const i = t.createShader(e); return t.shaderSource(i, r), t.compileShader(i), i; } let wue = 0; function _ue(t) { const e = t.split(` `); for (let r = 0; r < e.length; r++) e[r] = r + 1 + ": " + e[r]; return e.join(` `); } function JR(t) { switch (t) { case Bi: return ["Linear", "( value )"]; case kl: return ["sRGB", "( value )"]; case lv: return ["RGBE", "( value )"]; case Ix: return ["RGBM", "( value, 7.0 )"]; case Nx: return ["RGBM", "( value, 16.0 )"]; case Bx: return ["RGBD", "( value, 256.0 )"]; case sv: return ["Gamma", "( value, float( GAMMA_FACTOR ) )"]; case AR: return ["LogLuv", "( value )"]; default: return console.warn("THREE.WebGLProgram: Unsupported encoding:", t), ["Linear", "( value )"]; } } function QM(t, e, r) { const i = t.getShaderParameter(e, 35713), n = t.getShaderInfoLog(e).trim(); if (i && n === "") return ""; const a = t.getShaderSource(e); return "THREE.WebGLShader: gl.getShaderInfoLog() " + r + ` ` + n + _ue(a); } function Md(t, e) { const r = JR(e); return "vec4 " + t + "( vec4 value ) { return " + r[0] + "ToLinear" + r[1] + "; }"; } function Sue(t, e) { const r = JR(e); return "vec4 " + t + "( vec4 value ) { return LinearTo" + r[0] + r[1] + "; }"; } function Mue(t, e) { let r; switch (e) { case TP: r = "Linear"; break; case CP: r = "Reinhard"; break; case AP: r = "OptimizedCineon"; break; case LP: r = "ACESFilmic"; break; case kP: r = "Custom"; break; default: console.warn("THREE.WebGLProgram: Unsupported toneMapping:", e), r = "Linear"; } return "vec3 " + t + "( vec3 color ) { return " + r + "ToneMapping( color ); }"; } function Eue(t) { return [ t.extensionDerivatives || t.envMapCubeUV || t.bumpMap || t.tangentSpaceNormalMap || t.clearcoatNormalMap || t.flatShading || t.shaderID === "physical" ? "#extension GL_OES_standard_derivatives : enable" : "", (t.extensionFragDepth || t.logarithmicDepthBuffer) && t.rendererExtensionFragDepth ? "#extension GL_EXT_frag_depth : enable" : "", t.extensionDrawBuffers && t.rendererExtensionDrawBuffers ? "#extension GL_EXT_draw_buffers : require" : "", (t.extensionShaderTextureLOD || t.envMap || t.transmission > 0) && t.rendererExtensionShaderTextureLod ? "#extension GL_EXT_shader_texture_lod : enable" : "" ].filter(Vd).join(` `); } function Tue(t) { const e = []; for (const r in t) { const i = t[r]; i !== !1 && e.push("#define " + r + " " + i); } return e.join(` `); } function Cue(t, e) { const r = {}, i = t.getProgramParameter(e, 35721); for (let n = 0; n < i; n++) { const a = t.getActiveAttrib(e, n).name; r[a] = t.getAttribLocation(e, a); } return r; } function Vd(t) { return t !== ""; } function eE(t, e) { return t.replace(/NUM_DIR_LIGHTS/g, e.numDirLights).replace(/NUM_SPOT_LIGHTS/g, e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g, e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g, e.numPointLights).replace(/NUM_HEMI_LIGHTS/g, e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g, e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g, e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g, e.numPointLightShadows); } function tE(t, e) { return t.replace(/NUM_CLIPPING_PLANES/g, e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g, e.numClippingPlanes - e.numClipIntersection); } const Aue = /^[ \t]*#include +<([\w\d./]+)>/gm; function w1(t) { return t.replace(Aue, Lue); } function Lue(t, e) { const r = Bt[e]; if (r === void 0) throw new Error("Can not resolve #include <" + e + ">"); return w1(r); } const kue = /#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, Pue = /#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g; function rE(t) { return t.replace(Pue, QR).replace(kue, Rue); } function Rue(t, e, r, i) { return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."), QR(t, e, r, i); } function QR(t, e, r, i) { let n = ""; for (let a = parseInt(e); a < parseInt(r); a++) n += i.replace(/\[\s*i\s*\]/g, "[ " + a + " ]").replace(/UNROLLED_LOOP_INDEX/g, a); return n; } function iE(t) { let e = "precision " + t.precision + ` float; precision ` + t.precision + " int;"; return t.precision === "highp" ? e += ` #define HIGH_PRECISION` : t.precision === "mediump" ? e += ` #define MEDIUM_PRECISION` : t.precision === "lowp" && (e += ` #define LOW_PRECISION`), e; } function Oue(t) { let e = "SHADOWMAP_TYPE_BASIC"; return t.shadowMapType === Lx ? e = "SHADOWMAP_TYPE_PCF" : t.shadowMapType === nP ? e = "SHADOWMAP_TYPE_PCF_SOFT" : t.shadowMapType === Ic && (e = "SHADOWMAP_TYPE_VSM"), e; } function Due(t) { let e = "ENVMAP_TYPE_CUBE"; if (t.envMap) switch (t.envMapMode) { case gp: case vp: e = "ENVMAP_TYPE_CUBE"; break; case ed: case yp: e = "ENVMAP_TYPE_CUBE_UV"; break; } return e; } function Iue(t) { let e = "ENVMAP_MODE_REFLECTION"; if (t.envMap) switch (t.envMapMode) { case vp: case yp: e = "ENVMAP_MODE_REFRACTION"; break; } return e; } function Nue(t) { let e = "ENVMAP_BLENDING_NONE"; if (t.envMap) switch (t.combine) { case mp: e = "ENVMAP_BLENDING_MULTIPLY"; break; case MP: e = "ENVMAP_BLENDING_MIX"; break; case EP: e = "ENVMAP_BLENDING_ADD"; break; } return e; } function Bue(t, e, r, i) { const n = t.getContext(), a = r.defines; let o = r.vertexShader, s = r.fragmentShader; const c = Oue(r), l = Due(r), u = Iue(r), d = Nue(r), h = t.gammaFactor > 0 ? t.gammaFactor : 1, f = r.isWebGL2 ? "" : Eue(r), p = Tue(a), m = n.createProgram(); let y, g, v = r.glslVersion ? "#version " + r.glslVersion + ` ` : ""; r.isRawShaderMaterial ? (y = [ p ].filter(Vd).join(` `), y.length > 0 && (y += ` `), g = [ f, p ].filter(Vd).join(` `), g.length > 0 && (g += ` `)) : (y = [ iE(r), "#define SHADER_NAME " + r.shaderName, p, r.instancing ? "#define USE_INSTANCING" : "", r.instancingColor ? "#define USE_INSTANCING_COLOR" : "", r.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "", "#define GAMMA_FACTOR " + h, "#define MAX_BONES " + r.maxBones, r.useFog && r.fog ? "#define USE_FOG" : "", r.useFog && r.fogExp2 ? "#define FOG_EXP2" : "", r.map ? "#define USE_MAP" : "", r.envMap ? "#define USE_ENVMAP" : "", r.envMap ? "#define " + u : "", r.lightMap ? "#define USE_LIGHTMAP" : "", r.aoMap ? "#define USE_AOMAP" : "", r.emissiveMap ? "#define USE_EMISSIVEMAP" : "", r.bumpMap ? "#define USE_BUMPMAP" : "", r.normalMap ? "#define USE_NORMALMAP" : "", r.normalMap && r.objectSpaceNormalMap ? "#define OBJECTSPACE_NORMALMAP" : "", r.normalMap && r.tangentSpaceNormalMap ? "#define TANGENTSPACE_NORMALMAP" : "", r.clearcoatMap ? "#define USE_CLEARCOATMAP" : "", r.clearcoatRoughnessMap ? "#define USE_CLEARCOAT_ROUGHNESSMAP" : "", r.clearcoatNormalMap ? "#define USE_CLEARCOAT_NORMALMAP" : "", r.displacementMap && r.supportsVertexTextures ? "#define USE_DISPLACEMENTMAP" : "", r.specularMap ? "#define USE_SPECULARMAP" : "", r.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", r.metalnessMap ? "#define USE_METALNESSMAP" : "", r.alphaMap ? "#define USE_ALPHAMAP" : "", r.transmission ? "#define USE_TRANSMISSION" : "", r.transmissionMap ? "#define USE_TRANSMISSIONMAP" : "", r.thicknessMap ? "#define USE_THICKNESSMAP" : "", r.vertexTangents ? "#define USE_TANGENT" : "", r.vertexColors ? "#define USE_COLOR" : "", r.vertexAlphas ? "#define USE_COLOR_ALPHA" : "", r.vertexUvs ? "#define USE_UV" : "", r.uvsVertexOnly ? "#define UVS_VERTEX_ONLY" : "", r.flatShading ? "#define FLAT_SHADED" : "", r.skinning ? "#define USE_SKINNING" : "", r.useVertexTexture ? "#define BONE_TEXTURE" : "", r.morphTargets ? "#define USE_MORPHTARGETS" : "", r.morphNormals && r.flatShading === !1 ? "#define USE_MORPHNORMALS" : "", r.doubleSided ? "#define DOUBLE_SIDED" : "", r.flipSided ? "#define FLIP_SIDED" : "", r.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", r.shadowMapEnabled ? "#define " + c : "", r.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", r.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", r.logarithmicDepthBuffer && r.rendererExtensionFragDepth ? "#define USE_LOGDEPTHBUF_EXT" : "", "uniform mat4 modelMatrix;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform mat4 viewMatrix;", "uniform mat3 normalMatrix;", "uniform vec3 cameraPosition;", "uniform bool isOrthographic;", "#ifdef USE_INSTANCING", " attribute mat4 instanceMatrix;", "#endif", "#ifdef USE_INSTANCING_COLOR", " attribute vec3 instanceColor;", "#endif", "attribute vec3 position;", "attribute vec3 normal;", "attribute vec2 uv;", "#ifdef USE_TANGENT", " attribute vec4 tangent;", "#endif", "#if defined( USE_COLOR_ALPHA )", " attribute vec4 color;", "#elif defined( USE_COLOR )", " attribute vec3 color;", "#endif", "#ifdef USE_MORPHTARGETS", " attribute vec3 morphTarget0;", " attribute vec3 morphTarget1;", " attribute vec3 morphTarget2;", " attribute vec3 morphTarget3;", " #ifdef USE_MORPHNORMALS", " attribute vec3 morphNormal0;", " attribute vec3 morphNormal1;", " attribute vec3 morphNormal2;", " attribute vec3 morphNormal3;", " #else", " attribute vec3 morphTarget4;", " attribute vec3 morphTarget5;", " attribute vec3 morphTarget6;", " attribute vec3 morphTarget7;", " #endif", "#endif", "#ifdef USE_SKINNING", " attribute vec4 skinIndex;", " attribute vec4 skinWeight;", "#endif", ` ` ].filter(Vd).join(` `), g = [ f, iE(r), "#define SHADER_NAME " + r.shaderName, p, r.alphaTest ? "#define ALPHATEST " + r.alphaTest + (r.alphaTest % 1 ? "" : ".0") : "", // add '.0' if integer "#define GAMMA_FACTOR " + h, r.useFog && r.fog ? "#define USE_FOG" : "", r.useFog && r.fogExp2 ? "#define FOG_EXP2" : "", r.map ? "#define USE_MAP" : "", r.matcap ? "#define USE_MATCAP" : "", r.envMap ? "#define USE_ENVMAP" : "", r.envMap ? "#define " + l : "", r.envMap ? "#define " + u : "", r.envMap ? "#define " + d : "", r.lightMap ? "#define USE_LIGHTMAP" : "", r.aoMap ? "#define USE_AOMAP" : "", r.emissiveMap ? "#define USE_EMISSIVEMAP" : "", r.bumpMap ? "#define USE_BUMPMAP" : "", r.normalMap ? "#define USE_NORMALMAP" : "", r.normalMap && r.objectSpaceNormalMap ? "#define OBJECTSPACE_NORMALMAP" : "", r.normalMap && r.tangentSpaceNormalMap ? "#define TANGENTSPACE_NORMALMAP" : "", r.clearcoatMap ? "#define USE_CLEARCOATMAP" : "", r.clearcoatRoughnessMap ? "#define USE_CLEARCOAT_ROUGHNESSMAP" : "", r.clearcoatNormalMap ? "#define USE_CLEARCOAT_NORMALMAP" : "", r.specularMap ? "#define USE_SPECULARMAP" : "", r.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", r.metalnessMap ? "#define USE_METALNESSMAP" : "", r.alphaMap ? "#define USE_ALPHAMAP" : "", r.sheen ? "#define USE_SHEEN" : "", r.transmission ? "#define USE_TRANSMISSION" : "", r.transmissionMap ? "#define USE_TRANSMISSIONMAP" : "", r.thicknessMap ? "#define USE_THICKNESSMAP" : "", r.vertexTangents ? "#define USE_TANGENT" : "", r.vertexColors || r.instancingColor ? "#define USE_COLOR" : "", r.vertexAlphas ? "#define USE_COLOR_ALPHA" : "", r.vertexUvs ? "#define USE_UV" : "", r.uvsVertexOnly ? "#define UVS_VERTEX_ONLY" : "", r.gradientMap ? "#define USE_GRADIENTMAP" : "", r.flatShading ? "#define FLAT_SHADED" : "", r.doubleSided ? "#define DOUBLE_SIDED" : "", r.flipSided ? "#define FLIP_SIDED" : "", r.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", r.shadowMapEnabled ? "#define " + c : "", r.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", r.physicallyCorrectLights ? "#define PHYSICALLY_CORRECT_LIGHTS" : "", r.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", r.logarithmicDepthBuffer && r.rendererExtensionFragDepth ? "#define USE_LOGDEPTHBUF_EXT" : "", (r.extensionShaderTextureLOD || r.envMap) && r.rendererExtensionShaderTextureLod ? "#define TEXTURE_LOD_EXT" : "", "uniform mat4 viewMatrix;", "uniform vec3 cameraPosition;", "uniform bool isOrthographic;", r.toneMapping !== ns ? "#define TONE_MAPPING" : "", r.toneMapping !== ns ? Bt.tonemapping_pars_fragment : "", // this code is required here because it is used by the toneMapping() function defined below r.toneMapping !== ns ? Mue("toneMapping", r.toneMapping) : "", r.dithering ? "#define DITHERING" : "", Bt.encodings_pars_fragment, // this code is required here because it is used by the various encoding/decoding function defined below r.map ? Md("mapTexelToLinear", r.mapEncoding) : "", r.matcap ? Md("matcapTexelToLinear", r.matcapEncoding) : "", r.envMap ? Md("envMapTexelToLinear", r.envMapEncoding) : "", r.emissiveMap ? Md("emissiveMapTexelToLinear", r.emissiveMapEncoding) : "", r.lightMap ? Md("lightMapTexelToLinear", r.lightMapEncoding) : "", Sue("linearToOutputTexel", r.outputEncoding), r.depthPacking ? "#define DEPTH_PACKING " + r.depthPacking : "", ` ` ].filter(Vd).join(` `)), o = w1(o), o = eE(o, r), o = tE(o, r), s = w1(s), s = eE(s, r), s = tE(s, r), o = rE(o), s = rE(s), r.isWebGL2 && r.isRawShaderMaterial !== !0 && (v = `#version 300 es `, y = [ "#define attribute in", "#define varying out", "#define texture2D texture" ].join(` `) + ` ` + y, g = [ "#define varying in", r.glslVersion === y1 ? "" : "out highp vec4 pc_fragColor;", r.glslVersion === y1 ? "" : "#define gl_FragColor pc_fragColor", "#define gl_FragDepthEXT gl_FragDepth", "#define texture2D texture", "#define textureCube texture", "#define texture2DProj textureProj", "#define texture2DLodEXT textureLod", "#define texture2DProjLodEXT textureProjLod", "#define textureCubeLodEXT textureLod", "#define texture2DGradEXT textureGrad", "#define texture2DProjGradEXT textureProjGrad", "#define textureCubeGradEXT textureGrad" ].join(` `) + ` ` + g); const x = v + y + o, w = v + g + s, S = JM(n, 35633, x), _ = JM(n, 35632, w); if (n.attachShader(m, S), n.attachShader(m, _), r.index0AttributeName !== void 0 ? n.bindAttribLocation(m, 0, r.index0AttributeName) : r.morphTargets === !0 && n.bindAttribLocation(m, 0, "position"), n.linkProgram(m), t.debug.checkShaderErrors) { const E = n.getProgramInfoLog(m).trim(), C = n.getShaderInfoLog(S).trim(), L = n.getShaderInfoLog(_).trim(); let A = !0, k = !0; if (n.getProgramParameter(m, 35714) === !1) { A = !1; const P = QM(n, S, "vertex"), R = QM(n, _, "fragment"); console.error("THREE.WebGLProgram: shader error: ", n.getError(), "35715", n.getProgramParameter(m, 35715), "gl.getProgramInfoLog", E, P, R); } else E !== "" ? console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()", E) : (C === "" || L === "") && (k = !1); k && (this.diagnostics = { runnable: A, programLog: E, vertexShader: { log: C, prefix: y }, fragmentShader: { log: L, prefix: g } }); } n.deleteShader(S), n.deleteShader(_); let b; this.getUniforms = function() { return b === void 0 && (b = new as(n, m)), b; }; let T; return this.getAttributes = function() { return T === void 0 && (T = Cue(n, m)), T; }, this.destroy = function() { i.releaseStatesOfProgram(this), n.deleteProgram(m), this.program = void 0; }, this.name = r.shaderName, this.id = wue++, this.cacheKey = e, this.usedTimes = 1, this.program = m, this.vertexShader = S, this.fragmentShader = _, this; } function Fue(t, e, r, i, n, a) { const o = [], s = i.isWebGL2, c = i.logarithmicDepthBuffer, l = i.floatVertexTextures, u = i.maxVertexUniforms, d = i.vertexTextures; let h = i.precision; const f = { MeshDepthMaterial: "depth", MeshDistanceMaterial: "distanceRGBA", MeshNormalMaterial: "normal", MeshBasicMaterial: "basic", MeshLambertMaterial: "lambert", MeshPhongMaterial: "phong", MeshToonMaterial: "toon", MeshStandardMaterial: "physical", MeshPhysicalMaterial: "physical", MeshMatcapMaterial: "matcap", LineBasicMaterial: "basic", LineDashedMaterial: "dashed", PointsMaterial: "points", ShadowMaterial: "shadow", SpriteMaterial: "sprite" }, p = [ "precision", "isWebGL2", "supportsVertexTextures", "outputEncoding", "instancing", "instancingColor", "map", "mapEncoding", "matcap", "matcapEncoding", "envMap", "envMapMode", "envMapEncoding", "envMapCubeUV", "lightMap", "lightMapEncoding", "aoMap", "emissiveMap", "emissiveMapEncoding", "bumpMap", "normalMap", "objectSpaceNormalMap", "tangentSpaceNormalMap", "clearcoatMap", "clearcoatRoughnessMap", "clearcoatNormalMap", "displacementMap", "specularMap", "roughnessMap", "metalnessMap", "gradientMap", "alphaMap", "combine", "vertexColors", "vertexAlphas", "vertexTangents", "vertexUvs", "uvsVertexOnly", "fog", "useFog", "fogExp2", "flatShading", "sizeAttenuation", "logarithmicDepthBuffer", "skinning", "maxBones", "useVertexTexture", "morphTargets", "morphNormals", "premultipliedAlpha", "numDirLights", "numPointLights", "numSpotLights", "numHemiLights", "numRectAreaLights", "numDirLightShadows", "numPointLightShadows", "numSpotLightShadows", "shadowMapEnabled", "shadowMapType", "toneMapping", "physicallyCorrectLights", "alphaTest", "doubleSided", "flipSided", "numClippingPlanes", "numClipIntersection", "depthPacking", "dithering", "sheen", "transmission", "transmissionMap", "thicknessMap" ]; function m(_) { const b = _.skeleton.bones; if (l) return 1024; { const T = Math.floor((u - 20) / 4), E = Math.min(T, b.length); return E < b.length ? (console.warn("THREE.WebGLRenderer: Skeleton has " + b.length + " bones. This GPU supports " + E + "."), 0) : E; } } function y(_) { let b; return _ && _.isTexture ? b = _.encoding : _ && _.isWebGLRenderTarget ? (console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."), b = _.texture.encoding) : b = Bi, b; } function g(_, b, T, E, C) { const L = E.fog, A = _.isMeshStandardMaterial ? E.environment : null, k = e.get(_.envMap || A), P = f[_.type], R = C.isSkinnedMesh ? m(C) : 0; _.precision !== null && (h = i.getMaxPrecision(_.precision), h !== _.precision && console.warn("THREE.WebGLProgram.getParameters:", _.precision, "not supported, using", h, "instead.")); let M, O; if (P) { const I = Vn[P]; M = I.vertexShader, O = I.fragmentShader; } else M = _.vertexShader, O = _.fragmentShader; const D = t.getRenderTarget(); return { isWebGL2: s, shaderID: P, shaderName: _.type, vertexShader: M, fragmentShader: O, defines: _.defines, isRawShaderMaterial: _.isRawShaderMaterial === !0, glslVersion: _.glslVersion, precision: h, instancing: C.isInstancedMesh === !0, instancingColor: C.isInstancedMesh === !0 && C.instanceColor !== null, supportsVertexTextures: d, outputEncoding: D !== null ? y(D.texture) : t.outputEncoding, map: !!_.map, mapEncoding: y(_.map), matcap: !!_.matcap, matcapEncoding: y(_.matcap), envMap: !!k, envMapMode: k && k.mapping, envMapEncoding: y(k), envMapCubeUV: !!k && (k.mapping === ed || k.mapping === yp), lightMap: !!_.lightMap, lightMapEncoding: y(_.lightMap), aoMap: !!_.aoMap, emissiveMap: !!_.emissiveMap, emissiveMapEncoding: y(_.emissiveMap), bumpMap: !!_.bumpMap, normalMap: !!_.normalMap, objectSpaceNormalMap: _.normalMapType === PR, tangentSpaceNormalMap: _.normalMapType === Rs, clearcoatMap: !!_.clearcoatMap, clearcoatRoughnessMap: !!_.clearcoatRoughnessMap, clearcoatNormalMap: !!_.clearcoatNormalMap, displacementMap: !!_.displacementMap, roughnessMap: !!_.roughnessMap, metalnessMap: !!_.metalnessMap, specularMap: !!_.specularMap, alphaMap: !!_.alphaMap, gradientMap: !!_.gradientMap, sheen: !!_.sheen, transmission: !!_.transmission, transmissionMap: !!_.transmissionMap, thicknessMap: !!_.thicknessMap, combine: _.combine, vertexTangents: _.normalMap && _.vertexTangents, vertexColors: _.vertexColors, vertexAlphas: _.vertexColors === !0 && C.geometry && C.geometry.attributes.color && C.geometry.attributes.color.itemSize === 4, vertexUvs: !!_.map || !!_.bumpMap || !!_.normalMap || !!_.specularMap || !!_.alphaMap || !!_.emissiveMap || !!_.roughnessMap || !!_.metalnessMap || !!_.clearcoatMap || !!_.clearcoatRoughnessMap || !!_.clearcoatNormalMap || !!_.displacementMap || !!_.transmissionMap || !!_.thicknessMap, uvsVertexOnly: !(_.map || _.bumpMap || _.normalMap || _.specularMap || _.alphaMap || _.emissiveMap || _.roughnessMap || _.metalnessMap || _.clearcoatNormalMap || _.transmission || _.transmissionMap || _.thicknessMap) && !!_.displacementMap, fog: !!L, useFog: _.fog, fogExp2: L && L.isFogExp2, flatShading: !!_.flatShading, sizeAttenuation: _.sizeAttenuation, logarithmicDepthBuffer: c, skinning: C.isSkinnedMesh === !0 && R > 0, maxBones: R, useVertexTexture: l, morphTargets: _.morphTargets, morphNormals: _.morphNormals, numDirLights: b.directional.length, numPointLights: b.point.length, numSpotLights: b.spot.length, numRectAreaLights: b.rectArea.length, numHemiLights: b.hemi.length, numDirLightShadows: b.directionalShadowMap.length, numPointLightShadows: b.pointShadowMap.length, numSpotLightShadows: b.spotShadowMap.length, numClippingPlanes: a.numPlanes, numClipIntersection: a.numIntersection, dithering: _.dithering, shadowMapEnabled: t.shadowMap.enabled && T.length > 0, shadowMapType: t.shadowMap.type, toneMapping: _.toneMapped ? t.toneMapping : ns, physicallyCorrectLights: t.physicallyCorrectLights, premultipliedAlpha: _.premultipliedAlpha, alphaTest: _.alphaTest, doubleSided: _.side === ws, flipSided: _.side === Or, depthPacking: _.depthPacking !== void 0 ? _.depthPacking : !1, index0AttributeName: _.index0AttributeName, extensionDerivatives: _.extensions && _.extensions.derivatives, extensionFragDepth: _.extensions && _.extensions.fragDepth, extensionDrawBuffers: _.extensions && _.extensions.drawBuffers, extensionShaderTextureLOD: _.extensions && _.extensions.shaderTextureLOD, rendererExtensionFragDepth: s || r.has("EXT_frag_depth"), rendererExtensionDrawBuffers: s || r.has("WEBGL_draw_buffers"), rendererExtensionShaderTextureLod: s || r.has("EXT_shader_texture_lod"), customProgramCacheKey: _.customProgramCacheKey() }; } function v(_) { const b = []; if (_.shaderID ? b.push(_.shaderID) : (b.push(_.fragmentShader), b.push(_.vertexShader)), _.defines !== void 0) for (const T in _.defines) b.push(T), b.push(_.defines[T]); if (_.isRawShaderMaterial === !1) { for (let T = 0; T < p.length; T++) b.push(_[p[T]]); b.push(t.outputEncoding), b.push(t.gammaFactor); } return b.push(_.customProgramCacheKey), b.join(); } function x(_) { const b = f[_.type]; let T; if (b) { const E = Vn[b]; T = GR.clone(E.uniforms); } else T = _.uniforms; return T; } function w(_, b) { let T; for (let E = 0, C = o.length; E < C; E++) { const L = o[E]; if (L.cacheKey === b) { T = L, ++T.usedTimes; break; } } return T === void 0 && (T = new Bue(t, b, _, n), o.push(T)), T; } function S(_) { if (--_.usedTimes === 0) { const b = o.indexOf(_); o[b] = o[o.length - 1], o.pop(), _.destroy(); } } return { getParameters: g, getProgramCacheKey: v, getUniforms: x, acquireProgram: w, releaseProgram: S, // Exposed for resource monitoring & error feedback via renderer.info: programs: o }; } function zue() { let t = /* @__PURE__ */ new WeakMap(); function e(a) { let o = t.get(a); return o === void 0 && (o = {}, t.set(a, o)), o; } function r(a) { t.delete(a); } function i(a, o, s) { t.get(a)[o] = s; } function n() { t = /* @__PURE__ */ new WeakMap(); } return { get: e, remove: r, update: i, dispose: n }; } function $ue(t, e) { return t.groupOrder !== e.groupOrder ? t.groupOrder - e.groupOrder : t.renderOrder !== e.renderOrder ? t.renderOrder - e.renderOrder : t.program !== e.program ? t.program.id - e.program.id : t.material.id !== e.material.id ? t.material.id - e.material.id : t.z !== e.z ? t.z - e.z : t.id - e.id; } function nE(t, e) { return t.groupOrder !== e.groupOrder ? t.groupOrder - e.groupOrder : t.renderOrder !== e.renderOrder ? t.renderOrder - e.renderOrder : t.z !== e.z ? e.z - t.z : t.id - e.id; } function aE(t) { const e = []; let r = 0; const i = [], n = [], a = [], o = { id: -1 }; function s() { r = 0, i.length = 0, n.length = 0, a.length = 0; } function c(f, p, m, y, g, v) { let x = e[r]; const w = t.get(m); return x === void 0 ? (x = { id: f.id, object: f, geometry: p, material: m, program: w.program || o, groupOrder: y, renderOrder: f.renderOrder, z: g, group: v }, e[r] = x) : (x.id = f.id, x.object = f, x.geometry = p, x.material = m, x.program = w.program || o, x.groupOrder = y, x.renderOrder = f.renderOrder, x.z = g, x.group = v), r++, x; } function l(f, p, m, y, g, v) { const x = c(f, p, m, y, g, v); m.transmission > 0 ? n.push(x) : m.transparent === !0 ? a.push(x) : i.push(x); } function u(f, p, m, y, g, v) { const x = c(f, p, m, y, g, v); m.transmission > 0 ? n.unshift(x) : m.transparent === !0 ? a.unshift(x) : i.unshift(x); } function d(f, p) { i.length > 1 && i.sort(f || $ue), n.length > 1 && n.sort(p || nE), a.length > 1 && a.sort(p || nE); } function h() { for (let f = r, p = e.length; f < p; f++) { const m = e[f]; if (m.id === null) break; m.id = null, m.object = null, m.geometry = null, m.material = null, m.program = null, m.group = null; } } return { opaque: i, transmissive: n, transparent: a, init: s, push: l, unshift: u, finish: h, sort: d }; } function Vue(t) { let e = /* @__PURE__ */ new WeakMap(); function r(n, a) { let o; return e.has(n) === !1 ? (o = new aE(t), e.set(n, [o])) : a >= e.get(n).length ? (o = new aE(t), e.get(n).push(o)) : o = e.get(n)[a], o; } function i() { e = /* @__PURE__ */ new WeakMap(); } return { get: r, dispose: i }; } function Uue() { const t = {}; return { get: function(e) { if (t[e.id] !== void 0) return t[e.id]; let r; switch (e.type) { case "DirectionalLight": r = { direction: new de(), color: new Je() }; break; case "SpotLight": r = { position: new de(), direction: new de(), color: new Je(), distance: 0, coneCos: 0, penumbraCos: 0, decay: 0 }; break; case "PointLight": r = { position: new de(), color: new Je(), distance: 0, decay: 0 }; break; case "HemisphereLight": r = { direction: new de(), skyColor: new Je(), groundColor: new Je() }; break; case "RectAreaLight": r = { color: new Je(), position: new de(), halfWidth: new de(), halfHeight: new de() }; break; } return t[e.id] = r, r; } }; } function jue() { const t = {}; return { get: function(e) { if (t[e.id] !== void 0) return t[e.id]; let r; switch (e.type) { case "DirectionalLight": r = { shadowBias: 0, shadowNormalBias: 0, shadowRadius: 1, shadowMapSize: new je() }; break; case "SpotLight": r = { shadowBias: 0, shadowNormalBias: 0, shadowRadius: 1, shadowMapSize: new je() }; break; case "PointLight": r = { shadowBias: 0, shadowNormalBias: 0, shadowRadius: 1, shadowMapSize: new je(), shadowCameraNear: 1, shadowCameraFar: 1e3 }; break; } return t[e.id] = r, r; } }; } let Hue = 0; function Gue(t, e) { return (e.castShadow ? 1 : 0) - (t.castShadow ? 1 : 0); } function Wue(t, e) { const r = new Uue(), i = jue(), n = { version: 0, hash: { directionalLength: -1, pointLength: -1, spotLength: -1, rectAreaLength: -1, hemiLength: -1, numDirectionalShadows: -1, numPointShadows: -1, numSpotShadows: -1 }, ambient: [0, 0, 0], probe: [], directional: [], directionalShadow: [], directionalShadowMap: [], directionalShadowMatrix: [], spot: [], spotShadow: [], spotShadowMap: [], spotShadowMatrix: [], rectArea: [], rectAreaLTC1: null, rectAreaLTC2: null, point: [], pointShadow: [], pointShadowMap: [], pointShadowMatrix: [], hemi: [] }; for (let u = 0; u < 9; u++) n.probe.push(new de()); const a = new de(), o = new at(), s = new at(); function c(u) { let d = 0, h = 0, f = 0; for (let b = 0; b < 9; b++) n.probe[b].set(0, 0, 0); let p = 0, m = 0, y = 0, g = 0, v = 0, x = 0, w = 0, S = 0; u.sort(Gue); for (let b = 0, T = u.length; b < T; b++) { const E = u[b], C = E.color, L = E.intensity, A = E.distance, k = E.shadow && E.shadow.map ? E.shadow.map.texture : null; if (E.isAmbientLight) d += C.r * L, h += C.g * L, f += C.b * L; else if (E.isLightProbe) for (let P = 0; P < 9; P++) n.probe[P].addScaledVector(E.sh.coefficients[P], L); else if (E.isDirectionalLight) { const P = r.get(E); if (P.color.copy(E.color).multiplyScalar(E.intensity), E.castShadow) { const R = E.shadow, M = i.get(E); M.shadowBias = R.bias, M.shadowNormalBias = R.normalBias, M.shadowRadius = R.radius, M.shadowMapSize = R.mapSize, n.directionalShadow[p] = M, n.directionalShadowMap[p] = k, n.directionalShadowMatrix[p] = E.shadow.matrix, x++; } n.directional[p] = P, p++; } else if (E.isSpotLight) { const P = r.get(E); if (P.position.setFromMatrixPosition(E.matrixWorld), P.color.copy(C).multiplyScalar(L), P.distance = A, P.coneCos = Math.cos(E.angle), P.penumbraCos = Math.cos(E.angle * (1 - E.penumbra)), P.decay = E.decay, E.castShadow) { const R = E.shadow, M = i.get(E); M.shadowBias = R.bias, M.shadowNormalBias = R.normalBias, M.shadowRadius = R.radius, M.shadowMapSize = R.mapSize, n.spotShadow[y] = M, n.spotShadowMap[y] = k, n.spotShadowMatrix[y] = E.shadow.matrix, S++; } n.spot[y] = P, y++; } else if (E.isRectAreaLight) { const P = r.get(E); P.color.copy(C).multiplyScalar(L), P.halfWidth.set(E.width * 0.5, 0, 0), P.halfHeight.set(0, E.height * 0.5, 0), n.rectArea[g] = P, g++; } else if (E.isPointLight) { const P = r.get(E); if (P.color.copy(E.color).multiplyScalar(E.intensity), P.distance = E.distance, P.decay = E.decay, E.castShadow) { const R = E.shadow, M = i.get(E); M.shadowBias = R.bias, M.shadowNormalBias = R.normalBias, M.shadowRadius = R.radius, M.shadowMapSize = R.mapSize, M.shadowCameraNear = R.camera.near, M.shadowCameraFar = R.camera.far, n.pointShadow[m] = M, n.pointShadowMap[m] = k, n.pointShadowMatrix[m] = E.shadow.matrix, w++; } n.point[m] = P, m++; } else if (E.isHemisphereLight) { const P = r.get(E); P.skyColor.copy(E.color).multiplyScalar(L), P.groundColor.copy(E.groundColor).multiplyScalar(L), n.hemi[v] = P, v++; } } g > 0 && (e.isWebGL2 || t.has("OES_texture_float_linear") === !0 ? (n.rectAreaLTC1 = Qe.LTC_FLOAT_1, n.rectAreaLTC2 = Qe.LTC_FLOAT_2) : t.has("OES_texture_half_float_linear") === !0 ? (n.rectAreaLTC1 = Qe.LTC_HALF_1, n.rectAreaLTC2 = Qe.LTC_HALF_2) : console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")), n.ambient[0] = d, n.ambient[1] = h, n.ambient[2] = f; const _ = n.hash; (_.directionalLength !== p || _.pointLength !== m || _.spotLength !== y || _.rectAreaLength !== g || _.hemiLength !== v || _.numDirectionalShadows !== x || _.numPointShadows !== w || _.numSpotShadows !== S) && (n.directional.length = p, n.spot.length = y, n.rectArea.length = g, n.point.length = m, n.hemi.length = v, n.directionalShadow.length = x, n.directionalShadowMap.length = x, n.pointShadow.length = w, n.pointShadowMap.length = w, n.spotShadow.length = S, n.spotShadowMap.length = S, n.directionalShadowMatrix.length = x, n.pointShadowMatrix.length = w, n.spotShadowMatrix.length = S, _.directionalLength = p, _.pointLength = m, _.spotLength = y, _.rectAreaLength = g, _.hemiLength = v, _.numDirectionalShadows = x, _.numPointShadows = w, _.numSpotShadows = S, n.version = Hue++); } function l(u, d) { let h = 0, f = 0, p = 0, m = 0, y = 0; const g = d.matrixWorldInverse; for (let v = 0, x = u.length; v < x; v++) { const w = u[v]; if (w.isDirectionalLight) { const S = n.directional[h]; S.direction.setFromMatrixPosition(w.matrixWorld), a.setFromMatrixPosition(w.target.matrixWorld), S.direction.sub(a), S.direction.transformDirection(g), h++; } else if (w.isSpotLight) { const S = n.spot[p]; S.position.setFromMatrixPosition(w.matrixWorld), S.position.applyMatrix4(g), S.direction.setFromMatrixPosition(w.matrixWorld), a.setFromMatrixPosition(w.target.matrixWorld), S.direction.sub(a), S.direction.transformDirection(g), p++; } else if (w.isRectAreaLight) { const S = n.rectArea[m]; S.position.setFromMatrixPosition(w.matrixWorld), S.position.applyMatrix4(g), s.identity(), o.copy(w.matrixWorld), o.premultiply(g), s.extractRotation(o), S.halfWidth.set(w.width * 0.5, 0, 0), S.halfHeight.set(0, w.height * 0.5, 0), S.halfWidth.applyMatrix4(s), S.halfHeight.applyMatrix4(s), m++; } else if (w.isPointLight) { const S = n.point[f]; S.position.setFromMatrixPosition(w.matrixWorld), S.position.applyMatrix4(g), f++; } else if (w.isHemisphereLight) { const S = n.hemi[y]; S.direction.setFromMatrixPosition(w.matrixWorld), S.direction.transformDirection(g), S.direction.normalize(), y++; } } } return { setup: c, setupView: l, state: n }; } function oE(t, e) { const r = new Wue(t, e), i = [], n = []; function a() { i.length = 0, n.length = 0; } function o(u) { i.push(u); } function s(u) { n.push(u); } function c() { r.setup(i); } function l(u) { r.setupView(i, u); } return { init: a, state: { lightsArray: i, shadowsArray: n, lights: r }, setupLights: c, setupLightsView: l, pushLight: o, pushShadow: s }; } function que(t, e) { let r = /* @__PURE__ */ new WeakMap(); function i(a, o = 0) { let s; return r.has(a) === !1 ? (s = new oE(t, e), r.set(a, [s])) : o >= r.get(a).length ? (s = new oE(t, e), r.get(a).push(s)) : s = r.get(a)[o], s; } function n() { r = /* @__PURE__ */ new WeakMap(); } return { get: i, dispose: n }; } class pv extends jr { constructor(e) { super(), this.type = "MeshDepthMaterial", this.depthPacking = LR, this.morphTargets = !1, this.map = null, this.alphaMap = null, this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.wireframe = !1, this.wireframeLinewidth = 1, this.fog = !1, this.setValues(e); } copy(e) { return super.copy(e), this.depthPacking = e.depthPacking, this.morphTargets = e.morphTargets, this.map = e.map, this.alphaMap = e.alphaMap, this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this; } } pv.prototype.isMeshDepthMaterial = !0; class fv extends jr { constructor(e) { super(), this.type = "MeshDistanceMaterial", this.referencePosition = new de(), this.nearDistance = 1, this.farDistance = 1e3, this.morphTargets = !1, this.map = null, this.alphaMap = null, this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.fog = !1, this.setValues(e); } copy(e) { return super.copy(e), this.referencePosition.copy(e.referencePosition), this.nearDistance = e.nearDistance, this.farDistance = e.farDistance, this.morphTargets = e.morphTargets, this.map = e.map, this.alphaMap = e.alphaMap, this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this; } } fv.prototype.isMeshDistanceMaterial = !0; var Xue = `uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include void main() { float mean = 0.0; float squared_mean = 0.0; float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) ); for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) { #ifdef HORIZONTAL_PASS vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) ); mean += distribution.x; squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; #else float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) ); mean += depth; squared_mean += depth * depth; #endif } mean = mean * HALF_SAMPLE_RATE; squared_mean = squared_mean * HALF_SAMPLE_RATE; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); }`, Zue = `void main() { gl_Position = vec4( position, 1.0 ); }`; function eO(t, e, r) { let i = new xp(); const n = new je(), a = new je(), o = new Qt(), s = [], c = [], l = {}, u = r.maxTextureSize, d = { 0: Or, 1: xs, 2: ws }, h = new so({ defines: { SAMPLE_RATE: 2 / 8, HALF_SAMPLE_RATE: 1 / 8 }, uniforms: { shadow_pass: { value: null }, resolution: { value: new je() }, radius: { value: 4 } }, vertexShader: Zue, fragmentShader: Xue }), f = h.clone(); f.defines.HORIZONTAL_PASS = 1; const p = new ft(); p.setAttribute( "position", new kt( new Float32Array([-1, -1, 0.5, 3, -1, 0.5, -1, 3, 0.5]), 3 ) ); const m = new Fr(p, h), y = this; this.enabled = !1, this.autoUpdate = !0, this.needsUpdate = !1, this.type = Lx, this.render = function(_, b, T) { if (y.enabled === !1 || y.autoUpdate === !1 && y.needsUpdate === !1 || _.length === 0) return; const E = t.getRenderTarget(), C = t.getActiveCubeFace(), L = t.getActiveMipmapLevel(), A = t.state; A.setBlending(Ja), A.buffers.color.setClear(1, 1, 1, 1), A.buffers.depth.setTest(!0), A.setScissorTest(!1); for (let k = 0, P = _.length; k < P; k++) { const R = _[k], M = R.shadow; if (M === void 0) { console.warn("THREE.WebGLShadowMap:", R, "has no shadow."); continue; } if (M.autoUpdate === !1 && M.needsUpdate === !1) continue; n.copy(M.mapSize); const O = M.getFrameExtents(); if (n.multiply(O), a.copy(M.mapSize), (n.x > u || n.y > u) && (n.x > u && (a.x = Math.floor(u / O.x), n.x = a.x * O.x, M.mapSize.x = a.x), n.y > u && (a.y = Math.floor(u / O.y), n.y = a.y * O.y, M.mapSize.y = a.y)), M.map === null && !M.isPointLightShadow && this.type === Ic) { const I = { minFilter: Cr, magFilter: Cr, format: sn }; M.map = new Hn(n.x, n.y, I), M.map.texture.name = R.name + ".shadowMap", M.mapPass = new Hn(n.x, n.y, I), M.camera.updateProjectionMatrix(); } if (M.map === null) { const I = { minFilter: Dr, magFilter: Dr, format: sn }; M.map = new Hn(n.x, n.y, I), M.map.texture.name = R.name + ".shadowMap", M.camera.updateProjectionMatrix(); } t.setRenderTarget(M.map), t.clear(); const D = M.getViewportCount(); for (let I = 0; I < D; I++) { const F = M.getViewport(I); o.set( a.x * F.x, a.y * F.y, a.x * F.z, a.y * F.w ), A.viewport(o), M.updateMatrices(R, I), i = M.getFrustum(), S(b, T, M.camera, R, this.type); } !M.isPointLightShadow && this.type === Ic && g(M, T), M.needsUpdate = !1; } y.needsUpdate = !1, t.setRenderTarget(E, C, L); }; function g(_, b) { const T = e.update(m); h.uniforms.shadow_pass.value = _.map.texture, h.uniforms.resolution.value = _.mapSize, h.uniforms.radius.value = _.radius, t.setRenderTarget(_.mapPass), t.clear(), t.renderBufferDirect(b, null, T, h, m, null), f.uniforms.shadow_pass.value = _.mapPass.texture, f.uniforms.resolution.value = _.mapSize, f.uniforms.radius.value = _.radius, t.setRenderTarget(_.map), t.clear(), t.renderBufferDirect(b, null, T, f, m, null); } function v(_) { const b = _ << 0; let T = s[b]; return T === void 0 && (T = new pv({ depthPacking: kR, morphTargets: _ }), s[b] = T), T; } function x(_) { const b = _ << 0; let T = c[b]; return T === void 0 && (T = new fv({ morphTargets: _ }), c[b] = T), T; } function w(_, b, T, E, C, L, A) { let k = null, P = v, R = _.customDepthMaterial; if (E.isPointLight === !0 && (P = x, R = _.customDistanceMaterial), R === void 0) { let M = !1; T.morphTargets === !0 && (M = b.morphAttributes && b.morphAttributes.position && b.morphAttributes.position.length > 0), k = P(M); } else k = R; if (t.localClippingEnabled && T.clipShadows === !0 && T.clippingPlanes.length !== 0) { const M = k.uuid, O = T.uuid; let D = l[M]; D === void 0 && (D = {}, l[M] = D); let I = D[O]; I === void 0 && (I = k.clone(), D[O] = I), k = I; } return k.visible = T.visible, k.wireframe = T.wireframe, A === Ic ? k.side = T.shadowSide !== null ? T.shadowSide : T.side : k.side = T.shadowSide !== null ? T.shadowSide : d[T.side], k.clipShadows = T.clipShadows, k.clippingPlanes = T.clippingPlanes, k.clipIntersection = T.clipIntersection, k.wireframeLinewidth = T.wireframeLinewidth, k.linewidth = T.linewidth, E.isPointLight === !0 && k.isMeshDistanceMaterial === !0 && (k.referencePosition.setFromMatrixPosition(E.matrixWorld), k.nearDistance = C, k.farDistance = L), k; } function S(_, b, T, E, C) { if (_.visible === !1) return; if (_.layers.test(b.layers) && (_.isMesh || _.isLine || _.isPoints) && (_.castShadow || _.receiveShadow && C === Ic) && (!_.frustumCulled || i.intersectsObject(_))) { _.modelViewMatrix.multiplyMatrices(T.matrixWorldInverse, _.matrixWorld); const A = e.update(_), k = _.material; if (Array.isArray(k)) { const P = A.groups; for (let R = 0, M = P.length; R < M; R++) { const O = P[R], D = k[O.materialIndex]; if (D && D.visible) { const I = w(_, A, D, E, T.near, T.far, C); t.renderBufferDirect(T, null, A, I, _, O); } } } else if (k.visible) { const P = w(_, A, k, E, T.near, T.far, C); t.renderBufferDirect(T, null, A, P, _, null); } } const L = _.children; for (let A = 0, k = L.length; A < k; A++) S(L[A], b, T, E, C); } } function Yue(t, e, r) { const i = r.isWebGL2; function n() { let te = !1; const pe = new Qt(); let fe = null; const he = new Qt(0, 0, 0, 0); return { setMask: function(Te) { fe !== Te && !te && (t.colorMask(Te, Te, Te, Te), fe = Te); }, setLocked: function(Te) { te = Te; }, setClear: function(Te, He, We, Ie, qe) { qe === !0 && (Te *= Ie, He *= Ie, We *= Ie), pe.set(Te, He, We, Ie), he.equals(pe) === !1 && (t.clearColor(Te, He, We, Ie), he.copy(pe)); }, reset: function() { te = !1, fe = null, he.set(-1, 0, 0, 0); } }; } function a() { let te = !1, pe = null, fe = null, he = null; return { setTest: function(Te) { Te ? re(2929) : K(2929); }, setMask: function(Te) { pe !== Te && !te && (t.depthMask(Te), pe = Te); }, setFunc: function(Te) { if (fe !== Te) { if (Te) switch (Te) { case vP: t.depthFunc(512); break; case yP: t.depthFunc(519); break; case bP: t.depthFunc(513); break; case Qm: t.depthFunc(515); break; case xP: t.depthFunc(514); break; case wP: t.depthFunc(518); break; case _P: t.depthFunc(516); break; case SP: t.depthFunc(517); break; default: t.depthFunc(515); } else t.depthFunc(515); fe = Te; } }, setLocked: function(Te) { te = Te; }, setClear: function(Te) { he !== Te && (t.clearDepth(Te), he = Te); }, reset: function() { te = !1, pe = null, fe = null, he = null; } }; } function o() { let te = !1, pe = null, fe = null, he = null, Te = null, He = null, We = null, Ie = null, qe = null; return { setTest: function(De) { te || (De ? re(2960) : K(2960)); }, setMask: function(De) { pe !== De && !te && (t.stencilMask(De), pe = De); }, setFunc: function(De, $e, nt) { (fe !== De || he !== $e || Te !== nt) && (t.stencilFunc(De, $e, nt), fe = De, he = $e, Te = nt); }, setOp: function(De, $e, nt) { (He !== De || We !== $e || Ie !== nt) && (t.stencilOp(De, $e, nt), He = De, We = $e, Ie = nt); }, setLocked: function(De) { te = De; }, setClear: function(De) { qe !== De && (t.clearStencil(De), qe = De); }, reset: function() { te = !1, pe = null, fe = null, he = null, Te = null, He = null, We = null, Ie = null, qe = null; } }; } const s = new n(), c = new a(), l = new o(); let u = {}, d = null, h = {}, f = null, p = !1, m = null, y = null, g = null, v = null, x = null, w = null, S = null, _ = !1, b = null, T = null, E = null, C = null, L = null; const A = t.getParameter(35661); let k = !1, P = 0; const R = t.getParameter(7938); R.indexOf("WebGL") !== -1 ? (P = parseFloat(/^WebGL (\d)/.exec(R)[1]), k = P >= 1) : R.indexOf("OpenGL ES") !== -1 && (P = parseFloat(/^OpenGL ES (\d)/.exec(R)[1]), k = P >= 2); let M = null, O = {}; const D = t.getParameter(3088), I = t.getParameter(2978), F = new Qt().fromArray(D), z = new Qt().fromArray(I); function U(te, pe, fe) { const he = new Uint8Array(4), Te = t.createTexture(); t.bindTexture(te, Te), t.texParameteri(te, 10241, 9728), t.texParameteri(te, 10240, 9728); for (let He = 0; He < fe; He++) t.texImage2D(pe + He, 0, 6408, 1, 1, 0, 6408, 5121, he); return Te; } const Z = {}; Z[3553] = U(3553, 3553, 1), Z[34067] = U(34067, 34069, 6), s.setClear(0, 0, 0, 1), c.setClear(1), l.setClear(0), re(2929), c.setFunc(Qm), ue(!1), $(r1), re(2884), X(Ja); function re(te) { u[te] !== !0 && (t.enable(te), u[te] = !0); } function K(te) { u[te] !== !1 && (t.disable(te), u[te] = !1); } function V(te) { te !== d && (t.bindFramebuffer(36160, te), d = te); } function H(te, pe) { return pe === null && d !== null && (pe = d), h[te] !== pe ? (t.bindFramebuffer(te, pe), h[te] = pe, i && (te === 36009 && (h[36160] = pe), te === 36160 && (h[36009] = pe)), !0) : !1; } function G(te) { return f !== te ? (t.useProgram(te), f = te, !0) : !1; } const W = { [el]: 32774, [oP]: 32778, [sP]: 32779 }; if (i) W[o1] = 32775, W[s1] = 32776; else { const te = e.get("EXT_blend_minmax"); te !== null && (W[o1] = te.MIN_EXT, W[s1] = te.MAX_EXT); } const Y = { [lP]: 0, [cP]: 1, [uP]: 768, [Px]: 770, [gP]: 776, [fP]: 774, [hP]: 772, [dP]: 769, [Rx]: 771, [mP]: 775, [pP]: 773 }; function X(te, pe, fe, he, Te, He, We, Ie) { if (te === Ja) { p === !0 && (K(3042), p = !1); return; } if (p === !1 && (re(3042), p = !0), te !== aP) { if (te !== m || Ie !== _) { if ((y !== el || x !== el) && (t.blendEquation(32774), y = el, x = el), Ie) switch (te) { case Hc: t.blendFuncSeparate(1, 771, 1, 771); break; case i1: t.blendFunc(1, 1); break; case n1: t.blendFuncSeparate(0, 0, 769, 771); break; case a1: t.blendFuncSeparate(0, 768, 0, 770); break; default: console.error("THREE.WebGLState: Invalid blending: ", te); break; } else switch (te) { case Hc: t.blendFuncSeparate(770, 771, 1, 771); break; case i1: t.blendFunc(770, 1); break; case n1: t.blendFunc(0, 769); break; case a1: t.blendFunc(0, 768); break; default: console.error("THREE.WebGLState: Invalid blending: ", te); break; } g = null, v = null, w = null, S = null, m = te, _ = Ie; } return; } Te = Te || pe, He = He || fe, We = We || he, (pe !== y || Te !== x) && (t.blendEquationSeparate(W[pe], W[Te]), y = pe, x = Te), (fe !== g || he !== v || He !== w || We !== S) && (t.blendFuncSeparate(Y[fe], Y[he], Y[He], Y[We]), g = fe, v = he, w = He, S = We), m = te, _ = null; } function ie(te, pe) { te.side === ws ? K(2884) : re(2884); let fe = te.side === Or; pe && (fe = !fe), ue(fe), te.blending === Hc && te.transparent === !1 ? X(Ja) : X(te.blending, te.blendEquation, te.blendSrc, te.blendDst, te.blendEquationAlpha, te.blendSrcAlpha, te.blendDstAlpha, te.premultipliedAlpha), c.setFunc(te.depthFunc), c.setTest(te.depthTest), c.setMask(te.depthWrite), s.setMask(te.colorWrite); const he = te.stencilWrite; l.setTest(he), he && (l.setMask(te.stencilWriteMask), l.setFunc(te.stencilFunc, te.stencilRef, te.stencilFuncMask), l.setOp(te.stencilFail, te.stencilZFail, te.stencilZPass)), ne(te.polygonOffset, te.polygonOffsetFactor, te.polygonOffsetUnits), te.alphaToCoverage === !0 ? re(32926) : K(32926); } function ue(te) { b !== te && (te ? t.frontFace(2304) : t.frontFace(2305), b = te); } function $(te) { te !== rP ? (re(2884), te !== T && (te === r1 ? t.cullFace(1029) : te === iP ? t.cullFace(1028) : t.cullFace(1032))) : K(2884), T = te; } function J(te) { te !== E && (k && t.lineWidth(te), E = te); } function ne(te, pe, fe) { te ? (re(32823), (C !== pe || L !== fe) && (t.polygonOffset(pe, fe), C = pe, L = fe)) : K(32823); } function j(te) { te ? re(3089) : K(3089); } function q(te) { te === void 0 && (te = 33984 + A - 1), M !== te && (t.activeTexture(te), M = te); } function ge(te, pe) { M === null && q(); let fe = O[M]; fe === void 0 && (fe = { type: void 0, texture: void 0 }, O[M] = fe), (fe.type !== te || fe.texture !== pe) && (t.bindTexture(te, pe || Z[te]), fe.type = te, fe.texture = pe); } function ye() { const te = O[M]; te !== void 0 && te.type !== void 0 && (t.bindTexture(te.type, null), te.type = void 0, te.texture = void 0); } function _e() { try { t.compressedTexImage2D.apply(t, arguments); } catch (te) { console.error("THREE.WebGLState:", te); } } function Me() { try { t.texImage2D.apply(t, arguments); } catch (te) { console.error("THREE.WebGLState:", te); } } function Ce() { try { t.texImage3D.apply(t, arguments); } catch (te) { console.error("THREE.WebGLState:", te); } } function B(te) { F.equals(te) === !1 && (t.scissor(te.x, te.y, te.z, te.w), F.copy(te)); } function ce(te) { z.equals(te) === !1 && (t.viewport(te.x, te.y, te.z, te.w), z.copy(te)); } function ve() { t.disable(3042), t.disable(2884), t.disable(2929), t.disable(32823), t.disable(3089), t.disable(2960), t.disable(32926), t.blendEquation(32774), t.blendFunc(1, 0), t.blendFuncSeparate(1, 0, 1, 0), t.colorMask(!0, !0, !0, !0), t.clearColor(0, 0, 0, 0), t.depthMask(!0), t.depthFunc(513), t.clearDepth(1), t.stencilMask(4294967295), t.stencilFunc(519, 0, 4294967295), t.stencilOp(7680, 7680, 7680), t.clearStencil(0), t.cullFace(1029), t.frontFace(2305), t.polygonOffset(0, 0), t.activeTexture(33984), t.bindFramebuffer(36160, null), i === !0 && (t.bindFramebuffer(36009, null), t.bindFramebuffer(36008, null)), t.useProgram(null), t.lineWidth(1), t.scissor(0, 0, t.canvas.width, t.canvas.height), t.viewport(0, 0, t.canvas.width, t.canvas.height), u = {}, M = null, O = {}, d = null, h = {}, f = null, p = !1, m = null, y = null, g = null, v = null, x = null, w = null, S = null, _ = !1, b = null, T = null, E = null, C = null, L = null, F.set(0, 0, t.canvas.width, t.canvas.height), z.set(0, 0, t.canvas.width, t.canvas.height), s.reset(), c.reset(), l.reset(); } return { buffers: { color: s, depth: c, stencil: l }, enable: re, disable: K, bindFramebuffer: H, bindXRFramebuffer: V, useProgram: G, setBlending: X, setMaterial: ie, setFlipSided: ue, setCullFace: $, setLineWidth: J, setPolygonOffset: ne, setScissorTest: j, activeTexture: q, bindTexture: ge, unbindTexture: ye, compressedTexImage2D: _e, texImage2D: Me, texImage3D: Ce, scissor: B, viewport: ce, reset: ve }; } function Kue(t, e, r, i, n, a, o) { const s = n.isWebGL2, c = n.maxTextures, l = n.maxCubemapSize, u = n.maxTextureSize, d = n.maxSamples, h = /* @__PURE__ */ new WeakMap(); let f, p = !1; try { p = typeof OffscreenCanvas < "u" && new OffscreenCanvas(1, 1).getContext("2d") !== null; } catch { } function m(j, q) { return p ? new OffscreenCanvas(j, q) : document.createElementNS("http://www.w3.org/1999/xhtml", "canvas"); } function y(j, q, ge, ye) { let _e = 1; if ((j.width > ye || j.height > ye) && (_e = ye / Math.max(j.width, j.height)), _e < 1 || q === !0) if (typeof HTMLImageElement < "u" && j instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && j instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && j instanceof ImageBitmap) { const Me = q ? DR : Math.floor, Ce = Me(_e * j.width), B = Me(_e * j.height); f === void 0 && (f = m(Ce, B)); const ce = ge ? m(Ce, B) : f; return ce.width = Ce, ce.height = B, ce.getContext("2d").drawImage(j, 0, 0, Ce, B), console.warn("THREE.WebGLRenderer: Texture has been resized from (" + j.width + "x" + j.height + ") to (" + Ce + "x" + B + ")."), ce; } else return "data" in j && console.warn("THREE.WebGLRenderer: Image in DataTexture is too big (" + j.width + "x" + j.height + ")."), j; return j; } function g(j) { return b1(j.width) && b1(j.height); } function v(j) { return s ? !1 : j.wrapS !== ii || j.wrapT !== ii || j.minFilter !== Dr && j.minFilter !== Cr; } function x(j, q) { return j.generateMipmaps && q && j.minFilter !== Dr && j.minFilter !== Cr; } function w(j, q, ge, ye, _e = 1) { t.generateMipmap(j); const Me = i.get(q); Me.__maxMipLevel = Math.log2(Math.max(ge, ye, _e)); } function S(j, q, ge) { if (s === !1) return q; if (j !== null) { if (t[j] !== void 0) return t[j]; console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '" + j + "'"); } let ye = q; return q === 6403 && (ge === 5126 && (ye = 33326), ge === 5131 && (ye = 33325), ge === 5121 && (ye = 33321)), q === 6407 && (ge === 5126 && (ye = 34837), ge === 5131 && (ye = 34843), ge === 5121 && (ye = 32849)), q === 6408 && (ge === 5126 && (ye = 34836), ge === 5131 && (ye = 34842), ge === 5121 && (ye = 32856)), (ye === 33325 || ye === 33326 || ye === 34842 || ye === 34836) && e.get("EXT_color_buffer_float"), ye; } function _(j) { return j === Dr || j === kh || j === Ph ? 9728 : 9729; } function b(j) { const q = j.target; q.removeEventListener("dispose", b), E(q), q.isVideoTexture && h.delete(q), o.memory.textures--; } function T(j) { const q = j.target; q.removeEventListener("dispose", T), C(q); } function E(j) { const q = i.get(j); q.__webglInit !== void 0 && (t.deleteTexture(q.__webglTexture), i.remove(j)); } function C(j) { const q = j.texture, ge = i.get(j), ye = i.get(q); if (j) { if (ye.__webglTexture !== void 0 && (t.deleteTexture(ye.__webglTexture), o.memory.textures--), j.depthTexture && j.depthTexture.dispose(), j.isWebGLCubeRenderTarget) for (let _e = 0; _e < 6; _e++) t.deleteFramebuffer(ge.__webglFramebuffer[_e]), ge.__webglDepthbuffer && t.deleteRenderbuffer(ge.__webglDepthbuffer[_e]); else t.deleteFramebuffer(ge.__webglFramebuffer), ge.__webglDepthbuffer && t.deleteRenderbuffer(ge.__webglDepthbuffer), ge.__webglMultisampledFramebuffer && t.deleteFramebuffer(ge.__webglMultisampledFramebuffer), ge.__webglColorRenderbuffer && t.deleteRenderbuffer(ge.__webglColorRenderbuffer), ge.__webglDepthRenderbuffer && t.deleteRenderbuffer(ge.__webglDepthRenderbuffer); if (j.isWebGLMultipleRenderTargets) for (let _e = 0, Me = q.length; _e < Me; _e++) { const Ce = i.get(q[_e]); Ce.__webglTexture && (t.deleteTexture(Ce.__webglTexture), o.memory.textures--), i.remove(q[_e]); } i.remove(q), i.remove(j); } } let L = 0; function A() { L = 0; } function k() { const j = L; return j >= c && console.warn("THREE.WebGLTextures: Trying to use " + j + " texture units while this GPU supports only " + c), L += 1, j; } function P(j, q) { const ge = i.get(j); if (j.isVideoTexture && ie(j), j.version > 0 && ge.__version !== j.version) { const ye = j.image; if (ye === void 0) console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined"); else if (ye.complete === !1) console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete"); else { U(ge, j, q); return; } } r.activeTexture(33984 + q), r.bindTexture(3553, ge.__webglTexture); } function R(j, q) { const ge = i.get(j); if (j.version > 0 && ge.__version !== j.version) { U(ge, j, q); return; } r.activeTexture(33984 + q), r.bindTexture(35866, ge.__webglTexture); } function M(j, q) { const ge = i.get(j); if (j.version > 0 && ge.__version !== j.version) { U(ge, j, q); return; } r.activeTexture(33984 + q), r.bindTexture(32879, ge.__webglTexture); } function O(j, q) { const ge = i.get(j); if (j.version > 0 && ge.__version !== j.version) { Z(ge, j, q); return; } r.activeTexture(33984 + q), r.bindTexture(34067, ge.__webglTexture); } const D = { [_s]: 10497, [ii]: 33071, [pu]: 33648 }, I = { [Dr]: 9728, [kh]: 9984, [Ph]: 9986, [Cr]: 9729, [av]: 9985, [wo]: 9987 }; function F(j, q, ge) { if (ge ? (t.texParameteri(j, 10242, D[q.wrapS]), t.texParameteri(j, 10243, D[q.wrapT]), (j === 32879 || j === 35866) && t.texParameteri(j, 32882, D[q.wrapR]), t.texParameteri(j, 10240, I[q.magFilter]), t.texParameteri(j, 10241, I[q.minFilter])) : (t.texParameteri(j, 10242, 33071), t.texParameteri(j, 10243, 33071), (j === 32879 || j === 35866) && t.texParameteri(j, 32882, 33071), (q.wrapS !== ii || q.wrapT !== ii) && console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."), t.texParameteri(j, 10240, _(q.magFilter)), t.texParameteri(j, 10241, _(q.minFilter)), q.minFilter !== Dr && q.minFilter !== Cr && console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")), e.has("EXT_texture_filter_anisotropic") === !0) { const ye = e.get("EXT_texture_filter_anisotropic"); if (q.type === Wa && e.has("OES_texture_float_linear") === !1 || s === !1 && q.type === hl && e.has("OES_texture_half_float_linear") === !1) return; (q.anisotropy > 1 || i.get(q).__currentAnisotropy) && (t.texParameterf(j, ye.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(q.anisotropy, n.getMaxAnisotropy())), i.get(q).__currentAnisotropy = q.anisotropy); } } function z(j, q) { j.__webglInit === void 0 && (j.__webglInit = !0, q.addEventListener("dispose", b), j.__webglTexture = t.createTexture(), o.memory.textures++); } function U(j, q, ge) { let ye = 3553; q.isDataTexture2DArray && (ye = 35866), q.isDataTexture3D && (ye = 32879), z(j, q), r.activeTexture(33984 + ge), r.bindTexture(ye, j.__webglTexture), t.pixelStorei(37440, q.flipY), t.pixelStorei(37441, q.premultiplyAlpha), t.pixelStorei(3317, q.unpackAlignment), t.pixelStorei(37443, 0); const _e = v(q) && g(q.image) === !1, Me = y(q.image, _e, !1, u), Ce = g(Me) || s, B = a.convert(q.format); let ce = a.convert(q.type), ve = S(q.internalFormat, B, ce); F(ye, q, Ce); let te; const pe = q.mipmaps; if (q.isDepthTexture) ve = 6402, s ? q.type === Wa ? ve = 36012 : q.type === eh ? ve = 33190 : q.type === Gc ? ve = 35056 : ve = 33189 : q.type === Wa && console.error("WebGLRenderer: Floating point depth texture requires WebGL2."), q.format === pl && ve === 6402 && q.type !== Rh && q.type !== eh && (console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."), q.type = Rh, ce = a.convert(q.type)), q.format === fu && ve === 6402 && (ve = 34041, q.type !== Gc && (console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."), q.type = Gc, ce = a.convert(q.type))), r.texImage2D(3553, 0, ve, Me.width, Me.height, 0, B, ce, null); else if (q.isDataTexture) if (pe.length > 0 && Ce) { for (let fe = 0, he = pe.length; fe < he; fe++) te = pe[fe], r.texImage2D(3553, fe, ve, te.width, te.height, 0, B, ce, te.data); q.generateMipmaps = !1, j.__maxMipLevel = pe.length - 1; } else r.texImage2D(3553, 0, ve, Me.width, Me.height, 0, B, ce, Me.data), j.__maxMipLevel = 0; else if (q.isCompressedTexture) { for (let fe = 0, he = pe.length; fe < he; fe++) te = pe[fe], q.format !== sn && q.format !== Qa ? B !== null ? r.compressedTexImage2D(3553, fe, ve, te.width, te.height, 0, te.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : r.texImage2D(3553, fe, ve, te.width, te.height, 0, B, ce, te.data); j.__maxMipLevel = pe.length - 1; } else if (q.isDataTexture2DArray) r.texImage3D(35866, 0, ve, Me.width, Me.height, Me.depth, 0, B, ce, Me.data), j.__maxMipLevel = 0; else if (q.isDataTexture3D) r.texImage3D(32879, 0, ve, Me.width, Me.height, Me.depth, 0, B, ce, Me.data), j.__maxMipLevel = 0; else if (pe.length > 0 && Ce) { for (let fe = 0, he = pe.length; fe < he; fe++) te = pe[fe], r.texImage2D(3553, fe, ve, B, ce, te); q.generateMipmaps = !1, j.__maxMipLevel = pe.length - 1; } else r.texImage2D(3553, 0, ve, B, ce, Me), j.__maxMipLevel = 0; x(q, Ce) && w(ye, q, Me.width, Me.height), j.__version = q.version, q.onUpdate && q.onUpdate(q); } function Z(j, q, ge) { if (q.image.length !== 6) return; z(j, q), r.activeTexture(33984 + ge), r.bindTexture(34067, j.__webglTexture), t.pixelStorei(37440, q.flipY), t.pixelStorei(37441, q.premultiplyAlpha), t.pixelStorei(3317, q.unpackAlignment), t.pixelStorei(37443, 0); const ye = q && (q.isCompressedTexture || q.image[0].isCompressedTexture), _e = q.image[0] && q.image[0].isDataTexture, Me = []; for (let fe = 0; fe < 6; fe++) !ye && !_e ? Me[fe] = y(q.image[fe], !1, !0, l) : Me[fe] = _e ? q.image[fe].image : q.image[fe]; const Ce = Me[0], B = g(Ce) || s, ce = a.convert(q.format), ve = a.convert(q.type), te = S(q.internalFormat, ce, ve); F(34067, q, B); let pe; if (ye) { for (let fe = 0; fe < 6; fe++) { pe = Me[fe].mipmaps; for (let he = 0; he < pe.length; he++) { const Te = pe[he]; q.format !== sn && q.format !== Qa ? ce !== null ? r.compressedTexImage2D(34069 + fe, he, te, Te.width, Te.height, 0, Te.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()") : r.texImage2D(34069 + fe, he, te, Te.width, Te.height, 0, ce, ve, Te.data); } } j.__maxMipLevel = pe.length - 1; } else { pe = q.mipmaps; for (let fe = 0; fe < 6; fe++) if (_e) { r.texImage2D(34069 + fe, 0, te, Me[fe].width, Me[fe].height, 0, ce, ve, Me[fe].data); for (let he = 0; he < pe.length; he++) { const Te = pe[he].image[fe].image; r.texImage2D(34069 + fe, he + 1, te, Te.width, Te.height, 0, ce, ve, Te.data); } } else { r.texImage2D(34069 + fe, 0, te, ce, ve, Me[fe]); for (let he = 0; he < pe.length; he++) { const Te = pe[he]; r.texImage2D(34069 + fe, he + 1, te, ce, ve, Te.image[fe]); } } j.__maxMipLevel = pe.length; } x(q, B) && w(34067, q, Ce.width, Ce.height), j.__version = q.version, q.onUpdate && q.onUpdate(q); } function re(j, q, ge, ye, _e) { const Me = a.convert(ge.format), Ce = a.convert(ge.type), B = S(ge.internalFormat, Me, Ce); _e === 32879 || _e === 35866 ? r.texImage3D(_e, 0, B, q.width, q.height, q.depth, 0, Me, Ce, null) : r.texImage2D(_e, 0, B, q.width, q.height, 0, Me, Ce, null), r.bindFramebuffer(36160, j), t.framebufferTexture2D(36160, ye, _e, i.get(ge).__webglTexture, 0), r.bindFramebuffer(36160, null); } function K(j, q, ge) { if (t.bindRenderbuffer(36161, j), q.depthBuffer && !q.stencilBuffer) { let ye = 33189; if (ge) { const _e = q.depthTexture; _e && _e.isDepthTexture && (_e.type === Wa ? ye = 36012 : _e.type === eh && (ye = 33190)); const Me = X(q); t.renderbufferStorageMultisample(36161, Me, ye, q.width, q.height); } else t.renderbufferStorage(36161, ye, q.width, q.height); t.framebufferRenderbuffer(36160, 36096, 36161, j); } else if (q.depthBuffer && q.stencilBuffer) { if (ge) { const ye = X(q); t.renderbufferStorageMultisample(36161, ye, 35056, q.width, q.height); } else t.renderbufferStorage(36161, 34041, q.width, q.height); t.framebufferRenderbuffer(36160, 33306, 36161, j); } else { const ye = q.isWebGLMultipleRenderTargets === !0 ? q.texture[0] : q.texture, _e = a.convert(ye.format), Me = a.convert(ye.type), Ce = S(ye.internalFormat, _e, Me); if (ge) { const B = X(q); t.renderbufferStorageMultisample(36161, B, Ce, q.width, q.height); } else t.renderbufferStorage(36161, Ce, q.width, q.height); } t.bindRenderbuffer(36161, null); } function V(j, q) { if (q && q.isWebGLCubeRenderTarget) throw new Error("Depth Texture with cube render targets is not supported"); if (r.bindFramebuffer(36160, j), !(q.depthTexture && q.depthTexture.isDepthTexture)) throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture"); (!i.get(q.depthTexture).__webglTexture || q.depthTexture.image.width !== q.width || q.depthTexture.image.height !== q.height) && (q.depthTexture.image.width = q.width, q.depthTexture.image.height = q.height, q.depthTexture.needsUpdate = !0), P(q.depthTexture, 0); const ge = i.get(q.depthTexture).__webglTexture; if (q.depthTexture.format === pl) t.framebufferTexture2D(36160, 36096, 3553, ge, 0); else if (q.depthTexture.format === fu) t.framebufferTexture2D(36160, 33306, 3553, ge, 0); else throw new Error("Unknown depthTexture format"); } function H(j) { const q = i.get(j), ge = j.isWebGLCubeRenderTarget === !0; if (j.depthTexture) { if (ge) throw new Error("target.depthTexture not supported in Cube render targets"); V(q.__webglFramebuffer, j); } else if (ge) { q.__webglDepthbuffer = []; for (let ye = 0; ye < 6; ye++) r.bindFramebuffer(36160, q.__webglFramebuffer[ye]), q.__webglDepthbuffer[ye] = t.createRenderbuffer(), K(q.__webglDepthbuffer[ye], j, !1); } else r.bindFramebuffer(36160, q.__webglFramebuffer), q.__webglDepthbuffer = t.createRenderbuffer(), K(q.__webglDepthbuffer, j, !1); r.bindFramebuffer(36160, null); } function G(j) { const q = j.texture, ge = i.get(j), ye = i.get(q); j.addEventListener("dispose", T), j.isWebGLMultipleRenderTargets !== !0 && (ye.__webglTexture = t.createTexture(), ye.__version = q.version, o.memory.textures++); const _e = j.isWebGLCubeRenderTarget === !0, Me = j.isWebGLMultipleRenderTargets === !0, Ce = j.isWebGLMultisampleRenderTarget === !0, B = q.isDataTexture3D || q.isDataTexture2DArray, ce = g(j) || s; if (s && q.format === Qa && (q.type === Wa || q.type === hl) && (q.format = sn, console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")), _e) { ge.__webglFramebuffer = []; for (let ve = 0; ve < 6; ve++) ge.__webglFramebuffer[ve] = t.createFramebuffer(); } else if (ge.__webglFramebuffer = t.createFramebuffer(), Me) if (n.drawBuffers) { const ve = j.texture; for (let te = 0, pe = ve.length; te < pe; te++) { const fe = i.get(ve[te]); fe.__webglTexture === void 0 && (fe.__webglTexture = t.createTexture(), o.memory.textures++); } } else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension."); else if (Ce) if (s) { ge.__webglMultisampledFramebuffer = t.createFramebuffer(), ge.__webglColorRenderbuffer = t.createRenderbuffer(), t.bindRenderbuffer(36161, ge.__webglColorRenderbuffer); const ve = a.convert(q.format), te = a.convert(q.type), pe = S(q.internalFormat, ve, te), fe = X(j); t.renderbufferStorageMultisample(36161, fe, pe, j.width, j.height), r.bindFramebuffer(36160, ge.__webglMultisampledFramebuffer), t.framebufferRenderbuffer(36160, 36064, 36161, ge.__webglColorRenderbuffer), t.bindRenderbuffer(36161, null), j.depthBuffer && (ge.__webglDepthRenderbuffer = t.createRenderbuffer(), K(ge.__webglDepthRenderbuffer, j, !0)), r.bindFramebuffer(36160, null); } else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2."); if (_e) { r.bindTexture(34067, ye.__webglTexture), F(34067, q, ce); for (let ve = 0; ve < 6; ve++) re(ge.__webglFramebuffer[ve], j, q, 36064, 34069 + ve); x(q, ce) && w(34067, q, j.width, j.height), r.bindTexture(34067, null); } else if (Me) { const ve = j.texture; for (let te = 0, pe = ve.length; te < pe; te++) { const fe = ve[te], he = i.get(fe); r.bindTexture(3553, he.__webglTexture), F(3553, fe, ce), re(ge.__webglFramebuffer, j, fe, 36064 + te, 3553), x(fe, ce) && w(3553, fe, j.width, j.height); } r.bindTexture(3553, null); } else { let ve = 3553; B && (s ? ve = q.isDataTexture3D ? 32879 : 35866 : console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")), r.bindTexture(ve, ye.__webglTexture), F(ve, q, ce), re(ge.__webglFramebuffer, j, q, 36064, ve), x(q, ce) && w(ve, q, j.width, j.height, j.depth), r.bindTexture(ve, null); } j.depthBuffer && H(j); } function W(j) { const q = g(j) || s, ge = j.isWebGLMultipleRenderTargets === !0 ? j.texture : [j.texture]; for (let ye = 0, _e = ge.length; ye < _e; ye++) { const Me = ge[ye]; if (x(Me, q)) { const Ce = j.isWebGLCubeRenderTarget ? 34067 : 3553, B = i.get(Me).__webglTexture; r.bindTexture(Ce, B), w(Ce, Me, j.width, j.height), r.bindTexture(Ce, null); } } } function Y(j) { if (j.isWebGLMultisampleRenderTarget) if (s) { const q = j.width, ge = j.height; let ye = 16384; j.depthBuffer && (ye |= 256), j.stencilBuffer && (ye |= 1024); const _e = i.get(j); r.bindFramebuffer(36008, _e.__webglMultisampledFramebuffer), r.bindFramebuffer(36009, _e.__webglFramebuffer), t.blitFramebuffer(0, 0, q, ge, 0, 0, q, ge, ye, 9728), r.bindFramebuffer(36008, null), r.bindFramebuffer(36009, _e.__webglMultisampledFramebuffer); } else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2."); } function X(j) { return s && j.isWebGLMultisampleRenderTarget ? Math.min(d, j.samples) : 0; } function ie(j) { const q = o.render.frame; h.get(j) !== q && (h.set(j, q), j.update()); } let ue = !1, $ = !1; function J(j, q) { j && j.isWebGLRenderTarget && (ue === !1 && (console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."), ue = !0), j = j.texture), P(j, q); } function ne(j, q) { j && j.isWebGLCubeRenderTarget && ($ === !1 && (console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."), $ = !0), j = j.texture), O(j, q); } this.allocateTextureUnit = k, this.resetTextureUnits = A, this.setTexture2D = P, this.setTexture2DArray = R, this.setTexture3D = M, this.setTextureCube = O, this.setupRenderTarget = G, this.updateRenderTargetMipmap = W, this.updateMultisampleRenderTarget = Y, this.safeSetTexture2D = J, this.safeSetTextureCube = ne; } function tO(t, e, r) { const i = r.isWebGL2; function n(a) { let o; if (a === Al) return 5121; if (a === DP) return 32819; if (a === IP) return 32820; if (a === NP) return 33635; if (a === PP) return 5120; if (a === RP) return 5122; if (a === Rh) return 5123; if (a === OP) return 5124; if (a === eh) return 5125; if (a === Wa) return 5126; if (a === hl) return i ? 5131 : (o = e.get("OES_texture_half_float"), o !== null ? o.HALF_FLOAT_OES : null); if (a === BP) return 6406; if (a === Qa) return 6407; if (a === sn) return 6408; if (a === FP) return 6409; if (a === zP) return 6410; if (a === pl) return 6402; if (a === fu) return 34041; if (a === VP) return 6403; if (a === UP) return 36244; if (a === jP) return 33319; if (a === HP) return 33320; if (a === GP) return 36248; if (a === WP) return 36249; if (a === l1 || a === c1 || a === u1 || a === d1) if (o = e.get("WEBGL_compressed_texture_s3tc"), o !== null) { if (a === l1) return o.COMPRESSED_RGB_S3TC_DXT1_EXT; if (a === c1) return o.COMPRESSED_RGBA_S3TC_DXT1_EXT; if (a === u1) return o.COMPRESSED_RGBA_S3TC_DXT3_EXT; if (a === d1) return o.COMPRESSED_RGBA_S3TC_DXT5_EXT; } else return null; if (a === h1 || a === p1 || a === f1 || a === m1) if (o = e.get("WEBGL_compressed_texture_pvrtc"), o !== null) { if (a === h1) return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG; if (a === p1) return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG; if (a === f1) return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; if (a === m1) return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; } else return null; if (a === qP) return o = e.get("WEBGL_compressed_texture_etc1"), o !== null ? o.COMPRESSED_RGB_ETC1_WEBGL : null; if ((a === g1 || a === v1) && (o = e.get("WEBGL_compressed_texture_etc"), o !== null)) { if (a === g1) return o.COMPRESSED_RGB8_ETC2; if (a === v1) return o.COMPRESSED_RGBA8_ETC2_EAC; } if (a === XP || a === ZP || a === YP || a === KP || a === JP || a === QP || a === eR || a === tR || a === rR || a === iR || a === nR || a === aR || a === oR || a === sR || a === cR || a === uR || a === dR || a === hR || a === pR || a === fR || a === mR || a === gR || a === vR || a === yR || a === bR || a === xR || a === wR || a === _R) return o = e.get("WEBGL_compressed_texture_astc"), o !== null ? a : null; if (a === lR) return o = e.get("EXT_texture_compression_bptc"), o !== null ? a : null; if (a === Gc) return i ? 34042 : (o = e.get("WEBGL_depth_texture"), o !== null ? o.UNSIGNED_INT_24_8_WEBGL : null); } return { convert: n }; } class jx extends Wr { constructor(e = []) { super(), this.cameras = e; } } jx.prototype.isArrayCamera = !0; class ua extends It { constructor() { super(), this.type = "Group"; } } ua.prototype.isGroup = !0; const Jue = { type: "move" }; class B0 { constructor() { this._targetRay = null, this._grip = null, this._hand = null; } getHandSpace() { return this._hand === null && (this._hand = new ua(), this._hand.matrixAutoUpdate = !1, this._hand.visible = !1, this._hand.joints = {}, this._hand.inputState = { pinching: !1 }), this._hand; } getTargetRaySpace() { return this._targetRay === null && (this._targetRay = new ua(), this._targetRay.matrixAutoUpdate = !1, this._targetRay.visible = !1, this._targetRay.hasLinearVelocity = !1, this._targetRay.linearVelocity = new de(), this._targetRay.hasAngularVelocity = !1, this._targetRay.angularVelocity = new de()), this._targetRay; } getGripSpace() { return this._grip === null && (this._grip = new ua(), this._grip.matrixAutoUpdate = !1, this._grip.visible = !1, this._grip.hasLinearVelocity = !1, this._grip.linearVelocity = new de(), this._grip.hasAngularVelocity = !1, this._grip.angularVelocity = new de()), this._grip; } dispatchEvent(e) { return this._targetRay !== null && this._targetRay.dispatchEvent(e), this._grip !== null && this._grip.dispatchEvent(e), this._hand !== null && this._hand.dispatchEvent(e), this; } disconnect(e) { return this.dispatchEvent({ type: "disconnected", data: e }), this._targetRay !== null && (this._targetRay.visible = !1), this._grip !== null && (this._grip.visible = !1), this._hand !== null && (this._hand.visible = !1), this; } update(e, r, i) { let n = null, a = null, o = null; const s = this._targetRay, c = this._grip, l = this._hand; if (e && r.session.visibilityState !== "visible-blurred") if (s !== null && (n = r.getPose(e.targetRaySpace, i), n !== null && (s.matrix.fromArray(n.transform.matrix), s.matrix.decompose(s.position, s.rotation, s.scale), n.linearVelocity ? (s.hasLinearVelocity = !0, s.linearVelocity.copy(n.linearVelocity)) : s.hasLinearVelocity = !1, n.angularVelocity ? (s.hasAngularVelocity = !0, s.angularVelocity.copy(n.angularVelocity)) : s.hasAngularVelocity = !1, this.dispatchEvent(Jue))), l && e.hand) { o = !0; for (const m of e.hand.values()) { const y = r.getJointPose(m, i); if (l.joints[m.jointName] === void 0) { const v = new ua(); v.matrixAutoUpdate = !1, v.visible = !1, l.joints[m.jointName] = v, l.add(v); } const g = l.joints[m.jointName]; y !== null && (g.matrix.fromArray(y.transform.matrix), g.matrix.decompose(g.position, g.rotation, g.scale), g.jointRadius = y.radius), g.visible = y !== null; } const u = l.joints["index-finger-tip"], d = l.joints["thumb-tip"], h = u.position.distanceTo(d.position), f = 0.02, p = 5e-3; l.inputState.pinching && h > f + p ? (l.inputState.pinching = !1, this.dispatchEvent({ type: "pinchend", handedness: e.handedness, target: this })) : !l.inputState.pinching && h <= f - p && (l.inputState.pinching = !0, this.dispatchEvent({ type: "pinchstart", handedness: e.handedness, target: this })); } else c !== null && e.gripSpace && (a = r.getPose(e.gripSpace, i), a !== null && (c.matrix.fromArray(a.transform.matrix), c.matrix.decompose(c.position, c.rotation, c.scale), a.linearVelocity ? (c.hasLinearVelocity = !0, c.linearVelocity.copy(a.linearVelocity)) : c.hasLinearVelocity = !1, a.angularVelocity ? (c.hasAngularVelocity = !0, c.angularVelocity.copy(a.angularVelocity)) : c.hasAngularVelocity = !1)); return s !== null && (s.visible = n !== null), c !== null && (c.visible = a !== null), l !== null && (l.visible = o !== null), this; } } class Que extends Os { constructor(e, r) { super(); const i = this, n = e.state; let a = null, o = 1, s = null, c = "local-floor", l = null, u = null, d = null, h = null; const f = [], p = /* @__PURE__ */ new Map(), m = new Wr(); m.layers.enable(1), m.viewport = new Qt(); const y = new Wr(); y.layers.enable(2), y.viewport = new Qt(); const g = [m, y], v = new jx(); v.layers.enable(1), v.layers.enable(2); let x = null, w = null; this.cameraAutoUpdate = !0, this.enabled = !1, this.isPresenting = !1, this.getController = function(R) { let M = f[R]; return M === void 0 && (M = new B0(), f[R] = M), M.getTargetRaySpace(); }, this.getControllerGrip = function(R) { let M = f[R]; return M === void 0 && (M = new B0(), f[R] = M), M.getGripSpace(); }, this.getHand = function(R) { let M = f[R]; return M === void 0 && (M = new B0(), f[R] = M), M.getHandSpace(); }; function S(R) { const M = p.get(R.inputSource); M && M.dispatchEvent({ type: R.type, data: R.inputSource }); } function _() { p.forEach(function(R, M) { R.disconnect(M); }), p.clear(), x = null, w = null, n.bindXRFramebuffer(null), e.setRenderTarget(e.getRenderTarget()), P.stop(), i.isPresenting = !1, i.dispatchEvent({ type: "sessionend" }); } this.setFramebufferScaleFactor = function(R) { o = R, i.isPresenting === !0 && console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting."); }, this.setReferenceSpaceType = function(R) { c = R, i.isPresenting === !0 && console.warn("THREE.WebXRManager: Cannot change reference space type while presenting."); }, this.getReferenceSpace = function() { return s; }, this.getSession = function() { return a; }, this.setSession = async function(R) { if (a = R, a !== null) { a.addEventListener("select", S), a.addEventListener("selectstart", S), a.addEventListener("selectend", S), a.addEventListener("squeeze", S), a.addEventListener("squeezestart", S), a.addEventListener("squeezeend", S), a.addEventListener("end", _), a.addEventListener("inputsourceschange", b); const M = r.getContextAttributes(); if (M.xrCompatible !== !0 && await r.makeXRCompatible(), a.renderState.layers === void 0) { const O = { antialias: M.antialias, alpha: M.alpha, depth: M.depth, stencil: M.stencil, framebufferScaleFactor: o }, D = new XRWebGLLayer(a, r, O); a.updateRenderState({ baseLayer: D }); } else { let O = 0; M.depth && (O = M.stencil ? 34041 : 6402); const D = { colorFormat: M.alpha ? 6408 : 6407, depthFormat: O, scaleFactor: o }; u = new XRWebGLBinding(a, r), h = u.createProjectionLayer(D), d = r.createFramebuffer(), a.updateRenderState({ layers: [h] }); } s = await a.requestReferenceSpace(c), P.setContext(a), P.start(), i.isPresenting = !0, i.dispatchEvent({ type: "sessionstart" }); } }; function b(R) { const M = a.inputSources; for (let O = 0; O < f.length; O++) p.set(M[O], f[O]); for (let O = 0; O < R.removed.length; O++) { const D = R.removed[O], I = p.get(D); I && (I.dispatchEvent({ type: "disconnected", data: D }), p.delete(D)); } for (let O = 0; O < R.added.length; O++) { const D = R.added[O], I = p.get(D); I && I.dispatchEvent({ type: "connected", data: D }); } } const T = new de(), E = new de(); function C(R, M, O) { T.setFromMatrixPosition(M.matrixWorld), E.setFromMatrixPosition(O.matrixWorld); const D = T.distanceTo(E), I = M.projectionMatrix.elements, F = O.projectionMatrix.elements, z = I[14] / (I[10] - 1), U = I[14] / (I[10] + 1), Z = (I[9] + 1) / I[5], re = (I[9] - 1) / I[5], K = (I[8] - 1) / I[0], V = (F[8] + 1) / F[0], H = z * K, G = z * V, W = D / (-K + V), Y = W * -K; M.matrixWorld.decompose(R.position, R.quaternion, R.scale), R.translateX(Y), R.translateZ(W), R.matrixWorld.compose(R.position, R.quaternion, R.scale), R.matrixWorldInverse.copy(R.matrixWorld).invert(); const X = z + W, ie = U + W, ue = H - Y, $ = G + (D - Y), J = Z * U / ie * X, ne = re * U / ie * X; R.projectionMatrix.makePerspective(ue, $, J, ne, X, ie); } function L(R, M) { M === null ? R.matrixWorld.copy(R.matrix) : R.matrixWorld.multiplyMatrices(M.matrixWorld, R.matrix), R.matrixWorldInverse.copy(R.matrixWorld).invert(); } this.updateCamera = function(R) { if (a === null) return; v.near = y.near = m.near = R.near, v.far = y.far = m.far = R.far, (x !== v.near || w !== v.far) && (a.updateRenderState({ depthNear: v.near, depthFar: v.far }), x = v.near, w = v.far); const M = R.parent, O = v.cameras; L(v, M); for (let I = 0; I < O.length; I++) L(O[I], M); v.matrixWorld.decompose(v.position, v.quaternion, v.scale), R.position.copy(v.position), R.quaternion.copy(v.quaternion), R.scale.copy(v.scale), R.matrix.copy(v.matrix), R.matrixWorld.copy(v.matrixWorld); const D = R.children; for (let I = 0, F = D.length; I < F; I++) D[I].updateMatrixWorld(!0); O.length === 2 ? C(v, m, y) : v.projectionMatrix.copy(m.projectionMatrix); }, this.getCamera = function() { return v; }; let A = null; function k(R, M) { if (l = M.getViewerPose(s), l !== null) { const D = l.views, I = a.renderState.baseLayer; a.renderState.layers === void 0 && n.bindXRFramebuffer(I.framebuffer); let F = !1; D.length !== v.cameras.length && (v.cameras.length = 0, F = !0); for (let z = 0; z < D.length; z++) { const U = D[z]; let Z = null; if (a.renderState.layers === void 0) Z = I.getViewport(U); else { const K = u.getViewSubImage(h, U); n.bindXRFramebuffer(d), r.framebufferTexture2D(36160, 36064, 3553, K.colorTexture, 0), K.depthStencilTexture !== void 0 && r.framebufferTexture2D(36160, 36096, 3553, K.depthStencilTexture, 0), Z = K.viewport; } const re = g[z]; re.matrix.fromArray(U.transform.matrix), re.projectionMatrix.fromArray(U.projectionMatrix), re.viewport.set(Z.x, Z.y, Z.width, Z.height), z === 0 && v.matrix.copy(re.matrix), F === !0 && v.cameras.push(re); } } const O = a.inputSources; for (let D = 0; D < f.length; D++) { const I = f[D], F = O[D]; I.update(F, M, s); } A && A(R, M); } const P = new WR(); P.setAnimationLoop(k), this.setAnimationLoop = function(R) { A = R; }, this.dispose = function() { }; } } function ede(t) { function e(g, v) { g.fogColor.value.copy(v.color), v.isFog ? (g.fogNear.value = v.near, g.fogFar.value = v.far) : v.isFogExp2 && (g.fogDensity.value = v.density); } function r(g, v, x, w, S) { v.isMeshBasicMaterial ? i(g, v) : v.isMeshLambertMaterial ? (i(g, v), c(g, v)) : v.isMeshToonMaterial ? (i(g, v), u(g, v)) : v.isMeshPhongMaterial ? (i(g, v), l(g, v)) : v.isMeshStandardMaterial ? (i(g, v), v.isMeshPhysicalMaterial ? h(g, v, S) : d(g, v)) : v.isMeshMatcapMaterial ? (i(g, v), f(g, v)) : v.isMeshDepthMaterial ? (i(g, v), p(g, v)) : v.isMeshDistanceMaterial ? (i(g, v), m(g, v)) : v.isMeshNormalMaterial ? (i(g, v), y(g, v)) : v.isLineBasicMaterial ? (n(g, v), v.isLineDashedMaterial && a(g, v)) : v.isPointsMaterial ? o(g, v, x, w) : v.isSpriteMaterial ? s(g, v) : v.isShadowMaterial ? (g.color.value.copy(v.color), g.opacity.value = v.opacity) : v.isShaderMaterial && (v.uniformsNeedUpdate = !1); } function i(g, v) { g.opacity.value = v.opacity, v.color && g.diffuse.value.copy(v.color), v.emissive && g.emissive.value.copy(v.emissive).multiplyScalar(v.emissiveIntensity), v.map && (g.map.value = v.map), v.alphaMap && (g.alphaMap.value = v.alphaMap), v.specularMap && (g.specularMap.value = v.specularMap); const x = t.get(v).envMap; if (x) { g.envMap.value = x, g.flipEnvMap.value = x.isCubeTexture && x._needsFlipEnvMap ? -1 : 1, g.reflectivity.value = v.reflectivity, g.refractionRatio.value = v.refractionRatio; const _ = t.get(x).__maxMipLevel; _ !== void 0 && (g.maxMipLevel.value = _); } v.lightMap && (g.lightMap.value = v.lightMap, g.lightMapIntensity.value = v.lightMapIntensity), v.aoMap && (g.aoMap.value = v.aoMap, g.aoMapIntensity.value = v.aoMapIntensity); let w; v.map ? w = v.map : v.specularMap ? w = v.specularMap : v.displacementMap ? w = v.displacementMap : v.normalMap ? w = v.normalMap : v.bumpMap ? w = v.bumpMap : v.roughnessMap ? w = v.roughnessMap : v.metalnessMap ? w = v.metalnessMap : v.alphaMap ? w = v.alphaMap : v.emissiveMap ? w = v.emissiveMap : v.clearcoatMap ? w = v.clearcoatMap : v.clearcoatNormalMap ? w = v.clearcoatNormalMap : v.clearcoatRoughnessMap && (w = v.clearcoatRoughnessMap), w !== void 0 && (w.isWebGLRenderTarget && (w = w.texture), w.matrixAutoUpdate === !0 && w.updateMatrix(), g.uvTransform.value.copy(w.matrix)); let S; v.aoMap ? S = v.aoMap : v.lightMap && (S = v.lightMap), S !== void 0 && (S.isWebGLRenderTarget && (S = S.texture), S.matrixAutoUpdate === !0 && S.updateMatrix(), g.uv2Transform.value.copy(S.matrix)); } function n(g, v) { g.diffuse.value.copy(v.color), g.opacity.value = v.opacity; } function a(g, v) { g.dashSize.value = v.dashSize, g.totalSize.value = v.dashSize + v.gapSize, g.scale.value = v.scale; } function o(g, v, x, w) { g.diffuse.value.copy(v.color), g.opacity.value = v.opacity, g.size.value = v.size * x, g.scale.value = w * 0.5, v.map && (g.map.value = v.map), v.alphaMap && (g.alphaMap.value = v.alphaMap); let S; v.map ? S = v.map : v.alphaMap && (S = v.alphaMap), S !== void 0 && (S.matrixAutoUpdate === !0 && S.updateMatrix(), g.uvTransform.value.copy(S.matrix)); } function s(g, v) { g.diffuse.value.copy(v.color), g.opacity.value = v.opacity, g.rotation.value = v.rotation, v.map && (g.map.value = v.map), v.alphaMap && (g.alphaMap.value = v.alphaMap); let x; v.map ? x = v.map : v.alphaMap && (x = v.alphaMap), x !== void 0 && (x.matrixAutoUpdate === !0 && x.updateMatrix(), g.uvTransform.value.copy(x.matrix)); } function c(g, v) { v.emissiveMap && (g.emissiveMap.value = v.emissiveMap); } function l(g, v) { g.specular.value.copy(v.specular), g.shininess.value = Math.max(v.shininess, 1e-4), v.emissiveMap && (g.emissiveMap.value = v.emissiveMap), v.bumpMap && (g.bumpMap.value = v.bumpMap, g.bumpScale.value = v.bumpScale, v.side === Or && (g.bumpScale.value *= -1)), v.normalMap && (g.normalMap.value = v.normalMap, g.normalScale.value.copy(v.normalScale), v.side === Or && g.normalScale.value.negate()), v.displacementMap && (g.displacementMap.value = v.displacementMap, g.displacementScale.value = v.displacementScale, g.displacementBias.value = v.displacementBias); } function u(g, v) { v.gradientMap && (g.gradientMap.value = v.gradientMap), v.emissiveMap && (g.emissiveMap.value = v.emissiveMap), v.bumpMap && (g.bumpMap.value = v.bumpMap, g.bumpScale.value = v.bumpScale, v.side === Or && (g.bumpScale.value *= -1)), v.normalMap && (g.normalMap.value = v.normalMap, g.normalScale.value.copy(v.normalScale), v.side === Or && g.normalScale.value.negate()), v.displacementMap && (g.displacementMap.value = v.displacementMap, g.displacementScale.value = v.displacementScale, g.displacementBias.value = v.displacementBias); } function d(g, v) { g.roughness.value = v.roughness, g.metalness.value = v.metalness, v.roughnessMap && (g.roughnessMap.value = v.roughnessMap), v.metalnessMap && (g.metalnessMap.value = v.metalnessMap), v.emissiveMap && (g.emissiveMap.value = v.emissiveMap), v.bumpMap && (g.bumpMap.value = v.bumpMap, g.bumpScale.value = v.bumpScale, v.side === Or && (g.bumpScale.value *= -1)), v.normalMap && (g.normalMap.value = v.normalMap, g.normalScale.value.copy(v.normalScale), v.side === Or && g.normalScale.value.negate()), v.displacementMap && (g.displacementMap.value = v.displacementMap, g.displacementScale.value = v.displacementScale, g.displacementBias.value = v.displacementBias), t.get(v).envMap && (g.envMapIntensity.value = v.envMapIntensity); } function h(g, v, x) { d(g, v), g.reflectivity.value = v.reflectivity, g.clearcoat.value = v.clearcoat, g.clearcoatRoughness.value = v.clearcoatRoughness, v.sheen && g.sheen.value.copy(v.sheen), v.clearcoatMap && (g.clearcoatMap.value = v.clearcoatMap), v.clearcoatRoughnessMap && (g.clearcoatRoughnessMap.value = v.clearcoatRoughnessMap), v.clearcoatNormalMap && (g.clearcoatNormalScale.value.copy(v.clearcoatNormalScale), g.clearcoatNormalMap.value = v.clearcoatNormalMap, v.side === Or && g.clearcoatNormalScale.value.negate()), g.transmission.value = v.transmission, v.transmissionMap && (g.transmissionMap.value = v.transmissionMap), v.transmission > 0 && (g.transmissionSamplerMap.value = x.texture, g.transmissionSamplerSize.value.set(x.width, x.height)), g.thickness.value = v.thickness, v.thicknessMap && (g.thicknessMap.value = v.thicknessMap), g.attenuationDistance.value = v.attenuationDistance, g.attenuationColor.value.copy(v.attenuationColor); } function f(g, v) { v.matcap && (g.matcap.value = v.matcap), v.bumpMap && (g.bumpMap.value = v.bumpMap, g.bumpScale.value = v.bumpScale, v.side === Or && (g.bumpScale.value *= -1)), v.normalMap && (g.normalMap.value = v.normalMap, g.normalScale.value.copy(v.normalScale), v.side === Or && g.normalScale.value.negate()), v.displacementMap && (g.displacementMap.value = v.displacementMap, g.displacementScale.value = v.displacementScale, g.displacementBias.value = v.displacementBias); } function p(g, v) { v.displacementMap && (g.displacementMap.value = v.displacementMap, g.displacementScale.value = v.displacementScale, g.displacementBias.value = v.displacementBias); } function m(g, v) { v.displacementMap && (g.displacementMap.value = v.displacementMap, g.displacementScale.value = v.displacementScale, g.displacementBias.value = v.displacementBias), g.referencePosition.value.copy(v.referencePosition), g.nearDistance.value = v.nearDistance, g.farDistance.value = v.farDistance; } function y(g, v) { v.bumpMap && (g.bumpMap.value = v.bumpMap, g.bumpScale.value = v.bumpScale, v.side === Or && (g.bumpScale.value *= -1)), v.normalMap && (g.normalMap.value = v.normalMap, g.normalScale.value.copy(v.normalScale), v.side === Or && g.normalScale.value.negate()), v.displacementMap && (g.displacementMap.value = v.displacementMap, g.displacementScale.value = v.displacementScale, g.displacementBias.value = v.displacementBias); } return { refreshFogUniforms: e, refreshMaterialUniforms: r }; } function tde() { const t = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas"); return t.style.display = "block", t; } function nr(t = {}) { const e = t.canvas !== void 0 ? t.canvas : tde(), r = t.context !== void 0 ? t.context : null, i = t.alpha !== void 0 ? t.alpha : !1, n = t.depth !== void 0 ? t.depth : !0, a = t.stencil !== void 0 ? t.stencil : !0, o = t.antialias !== void 0 ? t.antialias : !1, s = t.premultipliedAlpha !== void 0 ? t.premultipliedAlpha : !0, c = t.preserveDrawingBuffer !== void 0 ? t.preserveDrawingBuffer : !1, l = t.powerPreference !== void 0 ? t.powerPreference : "default", u = t.failIfMajorPerformanceCaveat !== void 0 ? t.failIfMajorPerformanceCaveat : !1; let d = null, h = null; const f = [], p = []; this.domElement = e, this.debug = { /** * Enables error checking and reporting when shader programs are being compiled * @type {boolean} */ checkShaderErrors: !0 }, this.autoClear = !0, this.autoClearColor = !0, this.autoClearDepth = !0, this.autoClearStencil = !0, this.sortObjects = !0, this.clippingPlanes = [], this.localClippingEnabled = !1, this.gammaFactor = 2, this.outputEncoding = Bi, this.physicallyCorrectLights = !1, this.toneMapping = ns, this.toneMappingExposure = 1; const m = this; let y = !1, g = 0, v = 0, x = null, w = -1, S = null; const _ = new Qt(), b = new Qt(); let T = null, E = e.width, C = e.height, L = 1, A = null, k = null; const P = new Qt(0, 0, E, C), R = new Qt(0, 0, E, C); let M = !1; const O = [], D = new xp(); let I = !1, F = !1, z = null; const U = new at(), Z = new de(), re = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: !0 }; function K() { return x === null ? L : 1; } let V = r; function H(se, ke) { for (let Ae = 0; Ae < se.length; Ae++) { const Oe = se[Ae], Ve = e.getContext(Oe, ke); if (Ve !== null) return Ve; } return null; } try { const se = { alpha: i, depth: n, stencil: a, antialias: o, premultipliedAlpha: s, preserveDrawingBuffer: c, powerPreference: l, failIfMajorPerformanceCaveat: u }; if (e.addEventListener("webglcontextlost", He, !1), e.addEventListener("webglcontextrestored", We, !1), V === null) { const ke = ["webgl2", "webgl", "experimental-webgl"]; if (m.isWebGL1Renderer === !0 && ke.shift(), V = H(ke, se), V === null) throw H(ke) ? new Error("Error creating WebGL context with your selected attributes.") : new Error("Error creating WebGL context."); } V.getShaderPrecisionFormat === void 0 && (V.getShaderPrecisionFormat = function() { return { rangeMin: 1, rangeMax: 1, precision: 1 }; }); } catch (se) { throw console.error("THREE.WebGLRenderer: " + se.message), se; } let G, W, Y, X, ie, ue, $, J, ne, j, q, ge, ye, _e, Me, Ce, B, ce, ve, te, pe, fe; function he() { G = new Ece(V), W = new _ce(V, G, t), G.init(W), pe = new tO(V, G, W), Y = new Yue(V, G, W), O[0] = 1029, X = new Ace(), ie = new zue(), ue = new Kue(V, G, Y, ie, W, pe, X), $ = new Mce(m), J = new Koe(V, W), fe = new xce(V, G, J, W), ne = new Tce(V, J, X, fe), j = new Rce(V, ne, J, X), ce = new Pce(V), Me = new Sce(ie), q = new Fue(m, $, G, W, fe, Me), ge = new ede(ie), ye = new Vue(ie), _e = new que(G, W), B = new bce(m, $, Y, j, s), Ce = new eO(m, j, W), ve = new wce(V, G, X, W), te = new Cce(V, G, X, W), X.programs = q.programs, m.capabilities = W, m.extensions = G, m.properties = ie, m.renderLists = ye, m.shadowMap = Ce, m.state = Y, m.info = X; } he(); const Te = new Que(m, V); this.xr = Te, this.getContext = function() { return V; }, this.getContextAttributes = function() { return V.getContextAttributes(); }, this.forceContextLoss = function() { const se = G.get("WEBGL_lose_context"); se && se.loseContext(); }, this.forceContextRestore = function() { const se = G.get("WEBGL_lose_context"); se && se.restoreContext(); }, this.getPixelRatio = function() { return L; }, this.setPixelRatio = function(se) { se !== void 0 && (L = se, this.setSize(E, C, !1)); }, this.getSize = function(se) { return se.set(E, C); }, this.setSize = function(se, ke, Ae) { if (Te.isPresenting) { console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."); return; } E = se, C = ke, e.width = Math.floor(se * L), e.height = Math.floor(ke * L), Ae !== !1 && (e.style.width = se + "px", e.style.height = ke + "px"), this.setViewport(0, 0, se, ke); }, this.getDrawingBufferSize = function(se) { return se.set(E * L, C * L).floor(); }, this.setDrawingBufferSize = function(se, ke, Ae) { E = se, C = ke, L = Ae, e.width = Math.floor(se * Ae), e.height = Math.floor(ke * Ae), this.setViewport(0, 0, se, ke); }, this.getCurrentViewport = function(se) { return se.copy(_); }, this.getViewport = function(se) { return se.copy(P); }, this.setViewport = function(se, ke, Ae, Oe) { se.isVector4 ? P.set(se.x, se.y, se.z, se.w) : P.set(se, ke, Ae, Oe), Y.viewport(_.copy(P).multiplyScalar(L).floor()); }, this.getScissor = function(se) { return se.copy(R); }, this.setScissor = function(se, ke, Ae, Oe) { se.isVector4 ? R.set(se.x, se.y, se.z, se.w) : R.set(se, ke, Ae, Oe), Y.scissor(b.copy(R).multiplyScalar(L).floor()); }, this.getScissorTest = function() { return M; }, this.setScissorTest = function(se) { Y.setScissorTest(M = se); }, this.setOpaqueSort = function(se) { A = se; }, this.setTransparentSort = function(se) { k = se; }, this.getClearColor = function(se) { return se.copy(B.getClearColor()); }, this.setClearColor = function() { B.setClearColor.apply(B, arguments); }, this.getClearAlpha = function() { return B.getClearAlpha(); }, this.setClearAlpha = function() { B.setClearAlpha.apply(B, arguments); }, this.clear = function(se, ke, Ae) { let Oe = 0; (se === void 0 || se) && (Oe |= 16384), (ke === void 0 || ke) && (Oe |= 256), (Ae === void 0 || Ae) && (Oe |= 1024), V.clear(Oe); }, this.clearColor = function() { this.clear(!0, !1, !1); }, this.clearDepth = function() { this.clear(!1, !0, !1); }, this.clearStencil = function() { this.clear(!1, !1, !0); }, this.dispose = function() { e.removeEventListener("webglcontextlost", He, !1), e.removeEventListener("webglcontextrestored", We, !1), ye.dispose(), _e.dispose(), ie.dispose(), $.dispose(), j.dispose(), fe.dispose(), Te.dispose(), Te.removeEventListener("sessionstart", mt), Te.removeEventListener("sessionend", _t), z && (z.dispose(), z = null), wt.stop(); }; function He(se) { se.preventDefault(), console.log("THREE.WebGLRenderer: Context Lost."), y = !0; } function We() { console.log("THREE.WebGLRenderer: Context Restored."), y = !1; const se = X.autoReset, ke = Ce.enabled, Ae = Ce.autoUpdate, Oe = Ce.needsUpdate, Ve = Ce.type; he(), X.autoReset = se, Ce.enabled = ke, Ce.autoUpdate = Ae, Ce.needsUpdate = Oe, Ce.type = Ve; } function Ie(se) { const ke = se.target; ke.removeEventListener("dispose", Ie), qe(ke); } function qe(se) { De(se), ie.remove(se); } function De(se) { const ke = ie.get(se).programs; ke !== void 0 && ke.forEach(function(Ae) { q.releaseProgram(Ae); }); } function $e(se, ke) { se.render(function(Ae) { m.renderBufferImmediate(Ae, ke); }); } this.renderBufferImmediate = function(se, ke) { fe.initAttributes(); const Ae = ie.get(se); se.hasPositions && !Ae.position && (Ae.position = V.createBuffer()), se.hasNormals && !Ae.normal && (Ae.normal = V.createBuffer()), se.hasUvs && !Ae.uv && (Ae.uv = V.createBuffer()), se.hasColors && !Ae.color && (Ae.color = V.createBuffer()); const Oe = ke.getAttributes(); se.hasPositions && (V.bindBuffer(34962, Ae.position), V.bufferData(34962, se.positionArray, 35048), fe.enableAttribute(Oe.position), V.vertexAttribPointer(Oe.position, 3, 5126, !1, 0, 0)), se.hasNormals && (V.bindBuffer(34962, Ae.normal), V.bufferData(34962, se.normalArray, 35048), fe.enableAttribute(Oe.normal), V.vertexAttribPointer(Oe.normal, 3, 5126, !1, 0, 0)), se.hasUvs && (V.bindBuffer(34962, Ae.uv), V.bufferData(34962, se.uvArray, 35048), fe.enableAttribute(Oe.uv), V.vertexAttribPointer(Oe.uv, 2, 5126, !1, 0, 0)), se.hasColors && (V.bindBuffer(34962, Ae.color), V.bufferData(34962, se.colorArray, 35048), fe.enableAttribute(Oe.color), V.vertexAttribPointer(Oe.color, 3, 5126, !1, 0, 0)), fe.disableUnusedAttributes(), V.drawArrays(4, 0, se.count), se.count = 0; }, this.renderBufferDirect = function(se, ke, Ae, Oe, Ve, ae) { ke === null && (ke = re); const Se = Ve.isMesh && Ve.matrixWorld.determinant() < 0, Be = At(se, ke, Oe, Ve); Y.setMaterial(Oe, Se); let Ge = Ae.index; const tt = Ae.attributes.position; if (Ge === null) { if (tt === void 0 || tt.count === 0) return; } else if (Ge.count === 0) return; let gt = 1; Oe.wireframe === !0 && (Ge = ne.getWireframeAttribute(Ae), gt = 2), (Oe.morphTargets || Oe.morphNormals) && ce.update(Ve, Ae, Oe, Be), fe.setup(Ve, Oe, Be, Ae, Ge); let ut, St = ve; Ge !== null && (ut = J.get(Ge), St = te, St.setIndex(ut)); const er = Ge !== null ? Ge.count : tt.count, vr = Ae.drawRange.start * gt, fn = Ae.drawRange.count * gt, tr = ae !== null ? ae.start * gt : 0, ea = ae !== null ? ae.count * gt : 1 / 0, Jr = Math.max(vr, tr), Ji = Math.min(er, vr + fn, tr + ea) - 1, Mo = Math.max(0, Ji - Jr + 1); if (Mo !== 0) { if (Ve.isMesh) Oe.wireframe === !0 ? (Y.setLineWidth(Oe.wireframeLinewidth * K()), St.setMode(1)) : St.setMode(4); else if (Ve.isLine) { let Eo = Oe.linewidth; Eo === void 0 && (Eo = 1), Y.setLineWidth(Eo * K()), Ve.isLineSegments ? St.setMode(1) : Ve.isLineLoop ? St.setMode(2) : St.setMode(3); } else Ve.isPoints ? St.setMode(0) : Ve.isSprite && St.setMode(4); if (Ve.isInstancedMesh) St.renderInstances(Jr, Mo, Ve.count); else if (Ae.isInstancedBufferGeometry) { const Eo = Math.min(Ae.instanceCount, Ae._maxInstanceCount); St.renderInstances(Jr, Mo, Eo); } else St.render(Jr, Mo); } }, this.compile = function(se, ke) { h = _e.get(se), h.init(), se.traverseVisible(function(Ae) { Ae.isLight && Ae.layers.test(ke.layers) && (h.pushLight(Ae), Ae.castShadow && h.pushShadow(Ae)); }), h.setupLights(), se.traverse(function(Ae) { const Oe = Ae.material; if (Oe) if (Array.isArray(Oe)) for (let Ve = 0; Ve < Oe.length; Ve++) { const ae = Oe[Ve]; ct(ae, se, Ae); } else ct(Oe, se, Ae); }); }; let nt = null; function lt(se) { nt && nt(se); } function mt() { wt.stop(); } function _t() { wt.start(); } const wt = new WR(); wt.setAnimationLoop(lt), typeof window < "u" && wt.setContext(window), this.setAnimationLoop = function(se) { nt = se, Te.setAnimationLoop(se), se === null ? wt.stop() : wt.start(); }, Te.addEventListener("sessionstart", mt), Te.addEventListener("sessionend", _t), this.render = function(se, ke) { if (ke !== void 0 && ke.isCamera !== !0) { console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera."); return; } if (y === !0) return; se.autoUpdate === !0 && se.updateMatrixWorld(), ke.parent === null && ke.updateMatrixWorld(), Te.enabled === !0 && Te.isPresenting === !0 && (Te.cameraAutoUpdate === !0 && Te.updateCamera(ke), ke = Te.getCamera()), se.isScene === !0 && se.onBeforeRender(m, se, ke, x), h = _e.get(se, p.length), h.init(), p.push(h), U.multiplyMatrices(ke.projectionMatrix, ke.matrixWorldInverse), D.setFromProjectionMatrix(U), F = this.localClippingEnabled, I = Me.init(this.clippingPlanes, F, ke), d = ye.get(se, f.length), d.init(), f.push(d), me(se, ke, 0, m.sortObjects), d.finish(), m.sortObjects === !0 && d.sort(A, k), I === !0 && Me.beginShadows(); const Ae = h.state.shadowsArray; Ce.render(Ae, se, ke), h.setupLights(), h.setupLightsView(ke), I === !0 && Me.endShadows(), this.info.autoReset === !0 && this.info.reset(), B.render(d, se); const Oe = d.opaque, Ve = d.transmissive, ae = d.transparent; Oe.length > 0 && Ue(Oe, se, ke), Ve.length > 0 && Ne(Oe, Ve, se, ke), ae.length > 0 && Ue(ae, se, ke), x !== null && (ue.updateMultisampleRenderTarget(x), ue.updateRenderTargetMipmap(x)), se.isScene === !0 && se.onAfterRender(m, se, ke), Y.buffers.depth.setTest(!0), Y.buffers.depth.setMask(!0), Y.buffers.color.setMask(!0), Y.setPolygonOffset(!1), fe.resetDefaultState(), w = -1, S = null, p.pop(), p.length > 0 ? h = p[p.length - 1] : h = null, f.pop(), f.length > 0 ? d = f[f.length - 1] : d = null; }; function me(se, ke, Ae, Oe) { if (se.visible === !1) return; if (se.layers.test(ke.layers)) { if (se.isGroup) Ae = se.renderOrder; else if (se.isLOD) se.autoUpdate === !0 && se.update(ke); else if (se.isLight) h.pushLight(se), se.castShadow && h.pushShadow(se); else if (se.isSprite) { if (!se.frustumCulled || D.intersectsSprite(se)) { Oe && Z.setFromMatrixPosition(se.matrixWorld).applyMatrix4(U); const ae = j.update(se), Se = se.material; Se.visible && d.push(se, ae, Se, Ae, Z.z, null); } } else if (se.isImmediateRenderObject) Oe && Z.setFromMatrixPosition(se.matrixWorld).applyMatrix4(U), d.push(se, null, se.material, Ae, Z.z, null); else if ((se.isMesh || se.isLine || se.isPoints) && (se.isSkinnedMesh && se.skeleton.frame !== X.render.frame && (se.skeleton.update(), se.skeleton.frame = X.render.frame), !se.frustumCulled || D.intersectsObject(se))) { Oe && Z.setFromMatrixPosition(se.matrixWorld).applyMatrix4(U); const ae = j.update(se), Se = se.material; if (Array.isArray(Se)) { const Be = ae.groups; for (let Ge = 0, tt = Be.length; Ge < tt; Ge++) { const gt = Be[Ge], ut = Se[gt.materialIndex]; ut && ut.visible && d.push(se, ae, ut, Ae, Z.z, gt); } } else Se.visible && d.push(se, ae, Se, Ae, Z.z, null); } } const Ve = se.children; for (let ae = 0, Se = Ve.length; ae < Se; ae++) me(Ve[ae], ke, Ae, Oe); } function Ne(se, ke, Ae, Oe) { if (z === null) { const Se = o === !0 && W.isWebGL2 === !0 ? zx : Hn; z = new Se(1024, 1024, { generateMipmaps: !0, type: pe.convert(hl) !== null ? hl : Al, minFilter: wo, magFilter: Dr, wrapS: ii, wrapT: ii }); } const Ve = m.getRenderTarget(); m.setRenderTarget(z), m.clear(); const ae = m.toneMapping; m.toneMapping = ns, Ue(se, Ae, Oe), m.toneMapping = ae, ue.updateMultisampleRenderTarget(z), ue.updateRenderTargetMipmap(z), m.setRenderTarget(Ve), Ue(ke, Ae, Oe); } function Ue(se, ke, Ae) { const Oe = ke.isScene === !0 ? ke.overrideMaterial : null; for (let Ve = 0, ae = se.length; Ve < ae; Ve++) { const Se = se[Ve], Be = Se.object, Ge = Se.geometry, tt = Oe === null ? Se.material : Oe, gt = Se.group; if (Ae.isArrayCamera) { const ut = Ae.cameras; for (let St = 0, er = ut.length; St < er; St++) { const vr = ut[St]; Be.layers.test(vr.layers) && (Y.viewport(_.copy(vr.viewport)), h.setupLightsView(vr), Ke(Be, ke, vr, Ge, tt, gt)); } } else Ke(Be, ke, Ae, Ge, tt, gt); } } function Ke(se, ke, Ae, Oe, Ve, ae) { if (se.onBeforeRender(m, ke, Ae, Oe, Ve, ae), se.modelViewMatrix.multiplyMatrices(Ae.matrixWorldInverse, se.matrixWorld), se.normalMatrix.getNormalMatrix(se.modelViewMatrix), se.isImmediateRenderObject) { const Se = At(Ae, ke, Ve, se); Y.setMaterial(Ve), fe.reset(), $e(se, Se); } else Ve.transparent === !0 && Ve.side === ws ? (Ve.side = Or, Ve.needsUpdate = !0, m.renderBufferDirect(Ae, ke, Oe, Ve, se, ae), Ve.side = xs, Ve.needsUpdate = !0, m.renderBufferDirect(Ae, ke, Oe, Ve, se, ae), Ve.side = ws) : m.renderBufferDirect(Ae, ke, Oe, Ve, se, ae); se.onAfterRender(m, ke, Ae, Oe, Ve, ae); } function ct(se, ke, Ae) { ke.isScene !== !0 && (ke = re); const Oe = ie.get(se), Ve = h.state.lights, ae = h.state.shadowsArray, Se = Ve.state.version, Be = q.getParameters(se, Ve.state, ae, ke, Ae), Ge = q.getProgramCacheKey(Be); let tt = Oe.programs; Oe.environment = se.isMeshStandardMaterial ? ke.environment : null, Oe.fog = ke.fog, Oe.envMap = $.get(se.envMap || Oe.environment), tt === void 0 && (se.addEventListener("dispose", Ie), tt = /* @__PURE__ */ new Map(), Oe.programs = tt); let gt = tt.get(Ge); if (gt !== void 0) { if (Oe.currentProgram === gt && Oe.lightsStateVersion === Se) return xt(se, Be), gt; } else Be.uniforms = q.getUniforms(se), se.onBuild(Be, m), se.onBeforeCompile(Be, m), gt = q.acquireProgram(Be, Ge), tt.set(Ge, gt), Oe.uniforms = Be.uniforms; const ut = Oe.uniforms; (!se.isShaderMaterial && !se.isRawShaderMaterial || se.clipping === !0) && (ut.clippingPlanes = Me.uniform), xt(se, Be), Oe.needsLights = zt(se), Oe.lightsStateVersion = Se, Oe.needsLights && (ut.ambientLightColor.value = Ve.state.ambient, ut.lightProbe.value = Ve.state.probe, ut.directionalLights.value = Ve.state.directional, ut.directionalLightShadows.value = Ve.state.directionalShadow, ut.spotLights.value = Ve.state.spot, ut.spotLightShadows.value = Ve.state.spotShadow, ut.rectAreaLights.value = Ve.state.rectArea, ut.ltc_1.value = Ve.state.rectAreaLTC1, ut.ltc_2.value = Ve.state.rectAreaLTC2, ut.pointLights.value = Ve.state.point, ut.pointLightShadows.value = Ve.state.pointShadow, ut.hemisphereLights.value = Ve.state.hemi, ut.directionalShadowMap.value = Ve.state.directionalShadowMap, ut.directionalShadowMatrix.value = Ve.state.directionalShadowMatrix, ut.spotShadowMap.value = Ve.state.spotShadowMap, ut.spotShadowMatrix.value = Ve.state.spotShadowMatrix, ut.pointShadowMap.value = Ve.state.pointShadowMap, ut.pointShadowMatrix.value = Ve.state.pointShadowMatrix); const St = gt.getUniforms(), er = as.seqWithValue(St.seq, ut); return Oe.currentProgram = gt, Oe.uniformsList = er, gt; } function xt(se, ke) { const Ae = ie.get(se); Ae.outputEncoding = ke.outputEncoding, Ae.instancing = ke.instancing, Ae.skinning = ke.skinning, Ae.numClippingPlanes = ke.numClippingPlanes, Ae.numIntersection = ke.numClipIntersection, Ae.vertexAlphas = ke.vertexAlphas; } function At(se, ke, Ae, Oe) { ke.isScene !== !0 && (ke = re), ue.resetTextureUnits(); const Ve = ke.fog, ae = Ae.isMeshStandardMaterial ? ke.environment : null, Se = x === null ? m.outputEncoding : x.texture.encoding, Be = $.get(Ae.envMap || ae), Ge = Ae.vertexColors === !0 && Oe.geometry && Oe.geometry.attributes.color && Oe.geometry.attributes.color.itemSize === 4, tt = ie.get(Ae), gt = h.state.lights; if (I === !0 && (F === !0 || se !== S)) { const Jr = se === S && Ae.id === w; Me.setState(Ae, se, Jr); } let ut = !1; Ae.version === tt.__version ? (tt.needsLights && tt.lightsStateVersion !== gt.state.version || tt.outputEncoding !== Se || Oe.isInstancedMesh && tt.instancing === !1 || !Oe.isInstancedMesh && tt.instancing === !0 || Oe.isSkinnedMesh && tt.skinning === !1 || !Oe.isSkinnedMesh && tt.skinning === !0 || tt.envMap !== Be || Ae.fog && tt.fog !== Ve || tt.numClippingPlanes !== void 0 && (tt.numClippingPlanes !== Me.numPlanes || tt.numIntersection !== Me.numIntersection) || tt.vertexAlphas !== Ge) && (ut = !0) : (ut = !0, tt.__version = Ae.version); let St = tt.currentProgram; ut === !0 && (St = ct(Ae, ke, Oe)); let er = !1, vr = !1, fn = !1; const tr = St.getUniforms(), ea = tt.uniforms; if (Y.useProgram(St.program) && (er = !0, vr = !0, fn = !0), Ae.id !== w && (w = Ae.id, vr = !0), er || S !== se) { if (tr.setValue(V, "projectionMatrix", se.projectionMatrix), W.logarithmicDepthBuffer && tr.setValue( V, "logDepthBufFC", 2 / (Math.log(se.far + 1) / Math.LN2) ), S !== se && (S = se, vr = !0, fn = !0), Ae.isShaderMaterial || Ae.isMeshPhongMaterial || Ae.isMeshToonMaterial || Ae.isMeshStandardMaterial || Ae.envMap) { const Jr = tr.map.cameraPosition; Jr !== void 0 && Jr.setValue( V, Z.setFromMatrixPosition(se.matrixWorld) ); } (Ae.isMeshPhongMaterial || Ae.isMeshToonMaterial || Ae.isMeshLambertMaterial || Ae.isMeshBasicMaterial || Ae.isMeshStandardMaterial || Ae.isShaderMaterial) && tr.setValue(V, "isOrthographic", se.isOrthographicCamera === !0), (Ae.isMeshPhongMaterial || Ae.isMeshToonMaterial || Ae.isMeshLambertMaterial || Ae.isMeshBasicMaterial || Ae.isMeshStandardMaterial || Ae.isShaderMaterial || Ae.isShadowMaterial || Oe.isSkinnedMesh) && tr.setValue(V, "viewMatrix", se.matrixWorldInverse); } if (Oe.isSkinnedMesh) { tr.setOptional(V, Oe, "bindMatrix"), tr.setOptional(V, Oe, "bindMatrixInverse"); const Jr = Oe.skeleton; Jr && (W.floatVertexTextures ? (Jr.boneTexture === null && Jr.computeBoneTexture(), tr.setValue(V, "boneTexture", Jr.boneTexture, ue), tr.setValue(V, "boneTextureSize", Jr.boneTextureSize)) : tr.setOptional(V, Jr, "boneMatrices")); } return (vr || tt.receiveShadow !== Oe.receiveShadow) && (tt.receiveShadow = Oe.receiveShadow, tr.setValue(V, "receiveShadow", Oe.receiveShadow)), vr && (tr.setValue(V, "toneMappingExposure", m.toneMappingExposure), tt.needsLights && Ft(ea, fn), Ve && Ae.fog && ge.refreshFogUniforms(ea, Ve), ge.refreshMaterialUniforms(ea, Ae, L, C, z), as.upload(V, tt.uniformsList, ea, ue)), Ae.isShaderMaterial && Ae.uniformsNeedUpdate === !0 && (as.upload(V, tt.uniformsList, ea, ue), Ae.uniformsNeedUpdate = !1), Ae.isSpriteMaterial && tr.setValue(V, "center", Oe.center), tr.setValue(V, "modelViewMatrix", Oe.modelViewMatrix), tr.setValue(V, "normalMatrix", Oe.normalMatrix), tr.setValue(V, "modelMatrix", Oe.matrixWorld), St; } function Ft(se, ke) { se.ambientLightColor.needsUpdate = ke, se.lightProbe.needsUpdate = ke, se.directionalLights.needsUpdate = ke, se.directionalLightShadows.needsUpdate = ke, se.pointLights.needsUpdate = ke, se.pointLightShadows.needsUpdate = ke, se.spotLights.needsUpdate = ke, se.spotLightShadows.needsUpdate = ke, se.rectAreaLights.needsUpdate = ke, se.hemisphereLights.needsUpdate = ke; } function zt(se) { return se.isMeshLambertMaterial || se.isMeshToonMaterial || se.isMeshPhongMaterial || se.isMeshStandardMaterial || se.isShadowMaterial || se.isShaderMaterial && se.lights === !0; } this.getActiveCubeFace = function() { return g; }, this.getActiveMipmapLevel = function() { return v; }, this.getRenderTarget = function() { return x; }, this.setRenderTarget = function(se, ke = 0, Ae = 0) { x = se, g = ke, v = Ae, se && ie.get(se).__webglFramebuffer === void 0 && ue.setupRenderTarget(se); let Oe = null, Ve = !1, ae = !1; if (se) { const Se = se.texture; (Se.isDataTexture3D || Se.isDataTexture2DArray) && (ae = !0); const Be = ie.get(se).__webglFramebuffer; se.isWebGLCubeRenderTarget ? (Oe = Be[ke], Ve = !0) : se.isWebGLMultisampleRenderTarget ? Oe = ie.get(se).__webglMultisampledFramebuffer : Oe = Be, _.copy(se.viewport), b.copy(se.scissor), T = se.scissorTest; } else _.copy(P).multiplyScalar(L).floor(), b.copy(R).multiplyScalar(L).floor(), T = M; if (Y.bindFramebuffer(36160, Oe) && W.drawBuffers) { let Se = !1; if (se) if (se.isWebGLMultipleRenderTargets) { const Be = se.texture; if (O.length !== Be.length || O[0] !== 36064) { for (let Ge = 0, tt = Be.length; Ge < tt; Ge++) O[Ge] = 36064 + Ge; O.length = Be.length, Se = !0; } } else (O.length !== 1 || O[0] !== 36064) && (O[0] = 36064, O.length = 1, Se = !0); else (O.length !== 1 || O[0] !== 1029) && (O[0] = 1029, O.length = 1, Se = !0); Se && (W.isWebGL2 ? V.drawBuffers(O) : G.get("WEBGL_draw_buffers").drawBuffersWEBGL(O)); } if (Y.viewport(_), Y.scissor(b), Y.setScissorTest(T), Ve) { const Se = ie.get(se.texture); V.framebufferTexture2D(36160, 36064, 34069 + ke, Se.__webglTexture, Ae); } else if (ae) { const Se = ie.get(se.texture), Be = ke || 0; V.framebufferTextureLayer(36160, 36064, Se.__webglTexture, Ae || 0, Be); } }, this.readRenderTargetPixels = function(se, ke, Ae, Oe, Ve, ae, Se) { if (!(se && se.isWebGLRenderTarget)) { console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget."); return; } let Be = ie.get(se).__webglFramebuffer; if (se.isWebGLCubeRenderTarget && Se !== void 0 && (Be = Be[Se]), Be) { Y.bindFramebuffer(36160, Be); try { const Ge = se.texture, tt = Ge.format, gt = Ge.type; if (tt !== sn && pe.convert(tt) !== V.getParameter(35739)) { console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."); return; } const ut = gt === hl && (G.has("EXT_color_buffer_half_float") || W.isWebGL2 && G.has("EXT_color_buffer_float")); if (gt !== Al && pe.convert(gt) !== V.getParameter(35738) && // Edge and Chrome Mac < 52 (#9513) !(gt === Wa && (W.isWebGL2 || G.has("OES_texture_float") || G.has("WEBGL_color_buffer_float"))) && // Chrome Mac >= 52 and Firefox !ut) { console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type."); return; } V.checkFramebufferStatus(36160) === 36053 ? ke >= 0 && ke <= se.width - Oe && Ae >= 0 && Ae <= se.height - Ve && V.readPixels(ke, Ae, Oe, Ve, pe.convert(tt), pe.convert(gt), ae) : console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."); } finally { const Ge = x !== null ? ie.get(x).__webglFramebuffer : null; Y.bindFramebuffer(36160, Ge); } } }, this.copyFramebufferToTexture = function(se, ke, Ae = 0) { const Oe = Math.pow(2, -Ae), Ve = Math.floor(ke.image.width * Oe), ae = Math.floor(ke.image.height * Oe); let Se = pe.convert(ke.format); W.isWebGL2 && (Se === 6407 && (Se = 32849), Se === 6408 && (Se = 32856)), ue.setTexture2D(ke, 0), V.copyTexImage2D(3553, Ae, Se, se.x, se.y, Ve, ae, 0), Y.unbindTexture(); }, this.copyTextureToTexture = function(se, ke, Ae, Oe = 0) { const Ve = ke.image.width, ae = ke.image.height, Se = pe.convert(Ae.format), Be = pe.convert(Ae.type); ue.setTexture2D(Ae, 0), V.pixelStorei(37440, Ae.flipY), V.pixelStorei(37441, Ae.premultiplyAlpha), V.pixelStorei(3317, Ae.unpackAlignment), ke.isDataTexture ? V.texSubImage2D(3553, Oe, se.x, se.y, Ve, ae, Se, Be, ke.image.data) : ke.isCompressedTexture ? V.compressedTexSubImage2D(3553, Oe, se.x, se.y, ke.mipmaps[0].width, ke.mipmaps[0].height, Se, ke.mipmaps[0].data) : V.texSubImage2D(3553, Oe, se.x, se.y, Se, Be, ke.image), Oe === 0 && Ae.generateMipmaps && V.generateMipmap(3553), Y.unbindTexture(); }, this.copyTextureToTexture3D = function(se, ke, Ae, Oe, Ve = 0) { if (m.isWebGL1Renderer) { console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2."); return; } const ae = se.max.x - se.min.x + 1, Se = se.max.y - se.min.y + 1, Be = se.max.z - se.min.z + 1, Ge = pe.convert(Oe.format), tt = pe.convert(Oe.type); let gt; if (Oe.isDataTexture3D) ue.setTexture3D(Oe, 0), gt = 32879; else if (Oe.isDataTexture2DArray) ue.setTexture2DArray(Oe, 0), gt = 35866; else { console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray."); return; } V.pixelStorei(37440, Oe.flipY), V.pixelStorei(37441, Oe.premultiplyAlpha), V.pixelStorei(3317, Oe.unpackAlignment); const ut = V.getParameter(3314), St = V.getParameter(32878), er = V.getParameter(3316), vr = V.getParameter(3315), fn = V.getParameter(32877), tr = Ae.isCompressedTexture ? Ae.mipmaps[0] : Ae.image; V.pixelStorei(3314, tr.width), V.pixelStorei(32878, tr.height), V.pixelStorei(3316, se.min.x), V.pixelStorei(3315, se.min.y), V.pixelStorei(32877, se.min.z), Ae.isDataTexture || Ae.isDataTexture3D ? V.texSubImage3D(gt, Ve, ke.x, ke.y, ke.z, ae, Se, Be, Ge, tt, tr.data) : Ae.isCompressedTexture ? (console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."), V.compressedTexSubImage3D(gt, Ve, ke.x, ke.y, ke.z, ae, Se, Be, Ge, tr.data)) : V.texSubImage3D(gt, Ve, ke.x, ke.y, ke.z, ae, Se, Be, Ge, tt, tr), V.pixelStorei(3314, ut), V.pixelStorei(32878, St), V.pixelStorei(3316, er), V.pixelStorei(3315, vr), V.pixelStorei(32877, fn), Ve === 0 && Oe.generateMipmaps && V.generateMipmap(gt), Y.unbindTexture(); }, this.initTexture = function(se) { ue.setTexture2D(se, 0), Y.unbindTexture(); }, this.resetState = function() { g = 0, v = 0, x = null, Y.reset(), fe.reset(); }, typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this })); } class rO extends nr { } rO.prototype.isWebGL1Renderer = !0; class wp { constructor(e, r = 25e-5) { this.name = "", this.color = new Je(e), this.density = r; } clone() { return new wp(this.color, this.density); } toJSON() { return { type: "FogExp2", color: this.color.getHex(), density: this.density }; } } wp.prototype.isFogExp2 = !0; class _p { constructor(e, r = 1, i = 1e3) { this.name = "", this.color = new Je(e), this.near = r, this.far = i; } clone() { return new _p(this.color, this.near, this.far); } toJSON() { return { type: "Fog", color: this.color.getHex(), near: this.near, far: this.far }; } } _p.prototype.isFog = !0; class mv extends It { constructor() { super(), this.type = "Scene", this.background = null, this.environment = null, this.fog = null, this.overrideMaterial = null, this.autoUpdate = !0, typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this })); } copy(e, r) { return super.copy(e, r), e.background !== null && (this.background = e.background.clone()), e.environment !== null && (this.environment = e.environment.clone()), e.fog !== null && (this.fog = e.fog.clone()), e.overrideMaterial !== null && (this.overrideMaterial = e.overrideMaterial.clone()), this.autoUpdate = e.autoUpdate, this.matrixAutoUpdate = e.matrixAutoUpdate, this; } toJSON(e) { const r = super.toJSON(e); return this.fog !== null && (r.object.fog = this.fog.toJSON()), r; } } mv.prototype.isScene = !0; class Is { constructor(e, r) { this.array = e, this.stride = r, this.count = e !== void 0 ? e.length / r : 0, this.usage = gu, this.updateRange = { offset: 0, count: -1 }, this.version = 0, this.uuid = ln(); } onUploadCallback() { } set needsUpdate(e) { e === !0 && this.version++; } setUsage(e) { return this.usage = e, this; } copy(e) { return this.array = new e.array.constructor(e.array), this.count = e.count, this.stride = e.stride, this.usage = e.usage, this; } copyAt(e, r, i) { e *= this.stride, i *= r.stride; for (let n = 0, a = this.stride; n < a; n++) this.array[e + n] = r.array[i + n]; return this; } set(e, r = 0) { return this.array.set(e, r), this; } clone(e) { e.arrayBuffers === void 0 && (e.arrayBuffers = {}), this.array.buffer._uuid === void 0 && (this.array.buffer._uuid = ln()), e.arrayBuffers[this.array.buffer._uuid] === void 0 && (e.arrayBuffers[this.array.buffer._uuid] = this.array.slice(0).buffer); const r = new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]), i = new this.constructor(r, this.stride); return i.setUsage(this.usage), i; } onUpload(e) { return this.onUploadCallback = e, this; } toJSON(e) { return e.arrayBuffers === void 0 && (e.arrayBuffers = {}), this.array.buffer._uuid === void 0 && (this.array.buffer._uuid = ln()), e.arrayBuffers[this.array.buffer._uuid] === void 0 && (e.arrayBuffers[this.array.buffer._uuid] = Array.prototype.slice.call(new Uint32Array(this.array.buffer))), { uuid: this.uuid, buffer: this.array.buffer._uuid, type: this.array.constructor.name, stride: this.stride }; } } Is.prototype.isInterleavedBuffer = !0; const kr = /* @__PURE__ */ new de(); class lo { constructor(e, r, i, n = !1) { this.name = "", this.data = e, this.itemSize = r, this.offset = i, this.normalized = n === !0; } get count() { return this.data.count; } get array() { return this.data.array; } set needsUpdate(e) { this.data.needsUpdate = e; } applyMatrix4(e) { for (let r = 0, i = this.data.count; r < i; r++) kr.x = this.getX(r), kr.y = this.getY(r), kr.z = this.getZ(r), kr.applyMatrix4(e), this.setXYZ(r, kr.x, kr.y, kr.z); return this; } applyNormalMatrix(e) { for (let r = 0, i = this.count; r < i; r++) kr.x = this.getX(r), kr.y = this.getY(r), kr.z = this.getZ(r), kr.applyNormalMatrix(e), this.setXYZ(r, kr.x, kr.y, kr.z); return this; } transformDirection(e) { for (let r = 0, i = this.count; r < i; r++) kr.x = this.getX(r), kr.y = this.getY(r), kr.z = this.getZ(r), kr.transformDirection(e), this.setXYZ(r, kr.x, kr.y, kr.z); return this; } setX(e, r) { return this.data.array[e * this.data.stride + this.offset] = r, this; } setY(e, r) { return this.data.array[e * this.data.stride + this.offset + 1] = r, this; } setZ(e, r) { return this.data.array[e * this.data.stride + this.offset + 2] = r, this; } setW(e, r) { return this.data.array[e * this.data.stride + this.offset + 3] = r, this; } getX(e) { return this.data.array[e * this.data.stride + this.offset]; } getY(e) { return this.data.array[e * this.data.stride + this.offset + 1]; } getZ(e) { return this.data.array[e * this.data.stride + this.offset + 2]; } getW(e) { return this.data.array[e * this.data.stride + this.offset + 3]; } setXY(e, r, i) { return e = e * this.data.stride + this.offset, this.data.array[e + 0] = r, this.data.array[e + 1] = i, this; } setXYZ(e, r, i, n) { return e = e * this.data.stride + this.offset, this.data.array[e + 0] = r, this.data.array[e + 1] = i, this.data.array[e + 2] = n, this; } setXYZW(e, r, i, n, a) { return e = e * this.data.stride + this.offset, this.data.array[e + 0] = r, this.data.array[e + 1] = i, this.data.array[e + 2] = n, this.data.array[e + 3] = a, this; } clone(e) { if (e === void 0) { console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data."); const r = []; for (let i = 0; i < this.count; i++) { const n = i * this.data.stride + this.offset; for (let a = 0; a < this.itemSize; a++) r.push(this.data.array[n + a]); } return new kt(new this.array.constructor(r), this.itemSize, this.normalized); } else return e.interleavedBuffers === void 0 && (e.interleavedBuffers = {}), e.interleavedBuffers[this.data.uuid] === void 0 && (e.interleavedBuffers[this.data.uuid] = this.data.clone(e)), new lo(e.interleavedBuffers[this.data.uuid], this.itemSize, this.offset, this.normalized); } toJSON(e) { if (e === void 0) { console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data."); const r = []; for (let i = 0; i < this.count; i++) { const n = i * this.data.stride + this.offset; for (let a = 0; a < this.itemSize; a++) r.push(this.data.array[n + a]); } return { itemSize: this.itemSize, type: this.array.constructor.name, array: r, normalized: this.normalized }; } else return e.interleavedBuffers === void 0 && (e.interleavedBuffers = {}), e.interleavedBuffers[this.data.uuid] === void 0 && (e.interleavedBuffers[this.data.uuid] = this.data.toJSON(e)), { isInterleavedBufferAttribute: !0, itemSize: this.itemSize, data: this.data.uuid, offset: this.offset, normalized: this.normalized }; } } lo.prototype.isInterleavedBufferAttribute = !0; class Sp extends jr { constructor(e) { super(), this.type = "SpriteMaterial", this.color = new Je(16777215), this.map = null, this.alphaMap = null, this.rotation = 0, this.sizeAttenuation = !0, this.transparent = !0, this.setValues(e); } copy(e) { return super.copy(e), this.color.copy(e.color), this.map = e.map, this.alphaMap = e.alphaMap, this.rotation = e.rotation, this.sizeAttenuation = e.sizeAttenuation, this; } } Sp.prototype.isSpriteMaterial = !0; let wc; const Ed = /* @__PURE__ */ new de(), _c = /* @__PURE__ */ new de(), Sc = /* @__PURE__ */ new de(), Mc = /* @__PURE__ */ new je(), Td = /* @__PURE__ */ new je(), iO = /* @__PURE__ */ new at(), Tf = /* @__PURE__ */ new de(), Cd = /* @__PURE__ */ new de(), Cf = /* @__PURE__ */ new de(), sE = /* @__PURE__ */ new je(), F0 = /* @__PURE__ */ new je(), lE = /* @__PURE__ */ new je(); class Mp extends It { constructor(e) { if (super(), this.type = "Sprite", wc === void 0) { wc = new ft(); const r = new Float32Array([ -0.5, -0.5, 0, 0, 0, 0.5, -0.5, 0, 1, 0, 0.5, 0.5, 0, 1, 1, -0.5, 0.5, 0, 0, 1 ]), i = new Is(r, 5); wc.setIndex([0, 1, 2, 0, 2, 3]), wc.setAttribute("position", new lo(i, 3, 0, !1)), wc.setAttribute("uv", new lo(i, 2, 3, !1)); } this.geometry = wc, this.material = e !== void 0 ? e : new Sp(), this.center = new je(0.5, 0.5); } raycast(e, r) { e.camera === null && console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'), _c.setFromMatrixScale(this.matrixWorld), iO.copy(e.camera.matrixWorld), this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse, this.matrixWorld), Sc.setFromMatrixPosition(this.modelViewMatrix), e.camera.isPerspectiveCamera && this.material.sizeAttenuation === !1 && _c.multiplyScalar(-Sc.z); const i = this.material.rotation; let n, a; i !== 0 && (a = Math.cos(i), n = Math.sin(i)); const o = this.center; Af(Tf.set(-0.5, -0.5, 0), Sc, o, _c, n, a), Af(Cd.set(0.5, -0.5, 0), Sc, o, _c, n, a), Af(Cf.set(0.5, 0.5, 0), Sc, o, _c, n, a), sE.set(0, 0), F0.set(1, 0), lE.set(1, 1); let s = e.ray.intersectTriangle(Tf, Cd, Cf, !1, Ed); if (s === null && (Af(Cd.set(-0.5, 0.5, 0), Sc, o, _c, n, a), F0.set(0, 1), s = e.ray.intersectTriangle(Tf, Cf, Cd, !1, Ed), s === null)) return; const c = e.ray.origin.distanceTo(Ed); c < e.near || c > e.far || r.push({ distance: c, point: Ed.clone(), uv: Ir.getUV(Ed, Tf, Cd, Cf, sE, F0, lE, new je()), face: null, object: this }); } copy(e) { return super.copy(e), e.center !== void 0 && this.center.copy(e.center), this.material = e.material, this; } } Mp.prototype.isSprite = !0; function Af(t, e, r, i, n, a) { Mc.subVectors(t, r).addScalar(0.5).multiply(i), n !== void 0 ? (Td.x = a * Mc.x - n * Mc.y, Td.y = n * Mc.x + a * Mc.y) : Td.copy(Mc), t.copy(e), t.x += Td.x, t.y += Td.y, t.applyMatrix4(iO); } const Lf = /* @__PURE__ */ new de(), cE = /* @__PURE__ */ new de(); class nO extends It { constructor() { super(), this._currentLevel = 0, this.type = "LOD", Object.defineProperties(this, { levels: { enumerable: !0, value: [] }, isLOD: { value: !0 } }), this.autoUpdate = !0; } copy(e) { super.copy(e, !1); const r = e.levels; for (let i = 0, n = r.length; i < n; i++) { const a = r[i]; this.addLevel(a.object.clone(), a.distance); } return this.autoUpdate = e.autoUpdate, this; } addLevel(e, r = 0) { r = Math.abs(r); const i = this.levels; let n; for (n = 0; n < i.length && !(r < i[n].distance); n++) ; return i.splice(n, 0, { distance: r, object: e }), this.add(e), this; } getCurrentLevel() { return this._currentLevel; } getObjectForDistance(e) { const r = this.levels; if (r.length > 0) { let i, n; for (i = 1, n = r.length; i < n && !(e < r[i].distance); i++) ; return r[i - 1].object; } return null; } raycast(e, r) { if (this.levels.length > 0) { Lf.setFromMatrixPosition(this.matrixWorld); const i = e.ray.origin.distanceTo(Lf); this.getObjectForDistance(i).raycast(e, r); } } update(e) { const r = this.levels; if (r.length > 1) { Lf.setFromMatrixPosition(e.matrixWorld), cE.setFromMatrixPosition(this.matrixWorld); const i = Lf.distanceTo(cE) / e.zoom; r[0].object.visible = !0; let n, a; for (n = 1, a = r.length; n < a && i >= r[n].distance; n++) r[n - 1].object.visible = !1, r[n].object.visible = !0; for (this._currentLevel = n - 1; n < a; n++) r[n].object.visible = !1; } } toJSON(e) { const r = super.toJSON(e); this.autoUpdate === !1 && (r.object.autoUpdate = !1), r.object.levels = []; const i = this.levels; for (let n = 0, a = i.length; n < a; n++) { const o = i[n]; r.object.levels.push({ object: o.object.uuid, distance: o.distance }); } return r; } } const uE = /* @__PURE__ */ new de(), dE = /* @__PURE__ */ new Qt(), hE = /* @__PURE__ */ new Qt(), rde = /* @__PURE__ */ new de(), pE = /* @__PURE__ */ new at(); class Ep extends Fr { constructor(e, r) { super(e, r), this.type = "SkinnedMesh", this.bindMode = "attached", this.bindMatrix = new at(), this.bindMatrixInverse = new at(); } copy(e) { return super.copy(e), this.bindMode = e.bindMode, this.bindMatrix.copy(e.bindMatrix), this.bindMatrixInverse.copy(e.bindMatrixInverse), this.skeleton = e.skeleton, this; } bind(e, r) { this.skeleton = e, r === void 0 && (this.updateMatrixWorld(!0), this.skeleton.calculateInverses(), r = this.matrixWorld), this.bindMatrix.copy(r), this.bindMatrixInverse.copy(r).invert(); } pose() { this.skeleton.pose(); } normalizeSkinWeights() { const e = new Qt(), r = this.geometry.attributes.skinWeight; for (let i = 0, n = r.count; i < n; i++) { e.x = r.getX(i), e.y = r.getY(i), e.z = r.getZ(i), e.w = r.getW(i); const a = 1 / e.manhattanLength(); a !== 1 / 0 ? e.multiplyScalar(a) : e.set(1, 0, 0, 0), r.setXYZW(i, e.x, e.y, e.z, e.w); } } updateMatrixWorld(e) { super.updateMatrixWorld(e), this.bindMode === "attached" ? this.bindMatrixInverse.copy(this.matrixWorld).invert() : this.bindMode === "detached" ? this.bindMatrixInverse.copy(this.bindMatrix).invert() : console.warn("THREE.SkinnedMesh: Unrecognized bindMode: " + this.bindMode); } boneTransform(e, r) { const i = this.skeleton, n = this.geometry; dE.fromBufferAttribute(n.attributes.skinIndex, e), hE.fromBufferAttribute(n.attributes.skinWeight, e), uE.fromBufferAttribute(n.attributes.position, e).applyMatrix4(this.bindMatrix), r.set(0, 0, 0); for (let a = 0; a < 4; a++) { const o = hE.getComponent(a); if (o !== 0) { const s = dE.getComponent(a); pE.multiplyMatrices(i.bones[s].matrixWorld, i.boneInverses[s]), r.addScaledVector(rde.copy(uE).applyMatrix4(pE), o); } } return r.applyMatrix4(this.bindMatrixInverse); } } Ep.prototype.isSkinnedMesh = !0; class Tp extends It { constructor() { super(), this.type = "Bone"; } } Tp.prototype.isBone = !0; class ml extends zr { constructor(e = null, r = 1, i = 1, n, a, o, s, c, l = Dr, u = Dr, d, h) { super(null, o, s, c, l, u, n, a, d, h), this.image = { data: e, width: r, height: i }, this.magFilter = l, this.minFilter = u, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1, this.needsUpdate = !0; } } ml.prototype.isDataTexture = !0; const fE = /* @__PURE__ */ new at(), ide = /* @__PURE__ */ new at(); class Cp { constructor(e = [], r = []) { this.uuid = ln(), this.bones = e.slice(0), this.boneInverses = r, this.boneMatrices = null, this.boneTexture = null, this.boneTextureSize = 0, this.frame = -1, this.init(); } init() { const e = this.bones, r = this.boneInverses; if (this.boneMatrices = new Float32Array(e.length * 16), r.length === 0) this.calculateInverses(); else if (e.length !== r.length) { console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."), this.boneInverses = []; for (let i = 0, n = this.bones.length; i < n; i++) this.boneInverses.push(new at()); } } calculateInverses() { this.boneInverses.length = 0; for (let e = 0, r = this.bones.length; e < r; e++) { const i = new at(); this.bones[e] && i.copy(this.bones[e].matrixWorld).invert(), this.boneInverses.push(i); } } pose() { for (let e = 0, r = this.bones.length; e < r; e++) { const i = this.bones[e]; i && i.matrixWorld.copy(this.boneInverses[e]).invert(); } for (let e = 0, r = this.bones.length; e < r; e++) { const i = this.bones[e]; i && (i.parent && i.parent.isBone ? (i.matrix.copy(i.parent.matrixWorld).invert(), i.matrix.multiply(i.matrixWorld)) : i.matrix.copy(i.matrixWorld), i.matrix.decompose(i.position, i.quaternion, i.scale)); } } update() { const e = this.bones, r = this.boneInverses, i = this.boneMatrices, n = this.boneTexture; for (let a = 0, o = e.length; a < o; a++) { const s = e[a] ? e[a].matrixWorld : ide; fE.multiplyMatrices(s, r[a]), fE.toArray(i, a * 16); } n !== null && (n.needsUpdate = !0); } clone() { return new Cp(this.bones, this.boneInverses); } computeBoneTexture() { let e = Math.sqrt(this.bones.length * 4); e = OR(e), e = Math.max(e, 4); const r = new Float32Array(e * e * 4); r.set(this.boneMatrices); const i = new ml(r, e, e, sn, Wa); return this.boneMatrices = r, this.boneTexture = i, this.boneTextureSize = e, this; } getBoneByName(e) { for (let r = 0, i = this.bones.length; r < i; r++) { const n = this.bones[r]; if (n.name === e) return n; } } dispose() { this.boneTexture !== null && (this.boneTexture.dispose(), this.boneTexture = null); } fromJSON(e, r) { this.uuid = e.uuid; for (let i = 0, n = e.bones.length; i < n; i++) { const a = e.bones[i]; let o = r[a]; o === void 0 && (console.warn("THREE.Skeleton: No bone found with UUID:", a), o = new Tp()), this.bones.push(o), this.boneInverses.push(new at().fromArray(e.boneInverses[i])); } return this.init(), this; } toJSON() { const e = { metadata: { version: 4.5, type: "Skeleton", generator: "Skeleton.toJSON" }, bones: [], boneInverses: [] }; e.uuid = this.uuid; const r = this.bones, i = this.boneInverses; for (let n = 0, a = r.length; n < a; n++) { const o = r[n]; e.bones.push(o.uuid); const s = i[n]; e.boneInverses.push(s.toArray()); } return e; } } const mE = /* @__PURE__ */ new at(), gE = /* @__PURE__ */ new at(), kf = [], Ad = /* @__PURE__ */ new Fr(); class Hx extends Fr { constructor(e, r, i) { super(e, r), this.instanceMatrix = new kt(new Float32Array(i * 16), 16), this.instanceColor = null, this.count = i, this.frustumCulled = !1; } copy(e) { return super.copy(e), this.instanceMatrix.copy(e.instanceMatrix), e.instanceColor !== null && (this.instanceColor = e.instanceColor.clone()), this.count = e.count, this; } getColorAt(e, r) { r.fromArray(this.instanceColor.array, e * 3); } getMatrixAt(e, r) { r.fromArray(this.instanceMatrix.array, e * 16); } raycast(e, r) { const i = this.matrixWorld, n = this.count; if (Ad.geometry = this.geometry, Ad.material = this.material, Ad.material !== void 0) for (let a = 0; a < n; a++) { this.getMatrixAt(a, mE), gE.multiplyMatrices(i, mE), Ad.matrixWorld = gE, Ad.raycast(e, kf); for (let o = 0, s = kf.length; o < s; o++) { const c = kf[o]; c.instanceId = a, c.object = this, r.push(c); } kf.length = 0; } } setColorAt(e, r) { this.instanceColor === null && (this.instanceColor = new kt(new Float32Array(this.count * 3), 3)), r.toArray(this.instanceColor.array, e * 3); } setMatrixAt(e, r) { r.toArray(this.instanceMatrix.array, e * 16); } updateMorphTargets() { } dispose() { this.dispatchEvent({ type: "dispose" }); } } Hx.prototype.isInstancedMesh = !0; class Kr extends jr { constructor(e) { super(), this.type = "LineBasicMaterial", this.color = new Je(16777215), this.linewidth = 1, this.linecap = "round", this.linejoin = "round", this.morphTargets = !1, this.setValues(e); } copy(e) { return super.copy(e), this.color.copy(e.color), this.linewidth = e.linewidth, this.linecap = e.linecap, this.linejoin = e.linejoin, this.morphTargets = e.morphTargets, this; } } Kr.prototype.isLineBasicMaterial = !0; const vE = /* @__PURE__ */ new de(), yE = /* @__PURE__ */ new de(), bE = /* @__PURE__ */ new at(), z0 = /* @__PURE__ */ new Ds(), Pf = /* @__PURE__ */ new _o(); class wa extends It { constructor(e = new ft(), r = new Kr()) { super(), this.type = "Line", this.geometry = e, this.material = r, this.updateMorphTargets(); } copy(e) { return super.copy(e), this.material = e.material, this.geometry = e.geometry, this; } computeLineDistances() { const e = this.geometry; if (e.isBufferGeometry) if (e.index === null) { const r = e.attributes.position, i = [0]; for (let n = 1, a = r.count; n < a; n++) vE.fromBufferAttribute(r, n - 1), yE.fromBufferAttribute(r, n), i[n] = i[n - 1], i[n] += vE.distanceTo(yE); e.setAttribute("lineDistance", new it(i, 1)); } else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry."); else e.isGeometry && console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); return this; } raycast(e, r) { const i = this.geometry, n = this.matrixWorld, a = e.params.Line.threshold, o = i.drawRange; if (i.boundingSphere === null && i.computeBoundingSphere(), Pf.copy(i.boundingSphere), Pf.applyMatrix4(n), Pf.radius += a, e.ray.intersectsSphere(Pf) === !1) return; bE.copy(n).invert(), z0.copy(e.ray).applyMatrix4(bE); const s = a / ((this.scale.x + this.scale.y + this.scale.z) / 3), c = s * s, l = new de(), u = new de(), d = new de(), h = new de(), f = this.isLineSegments ? 2 : 1; if (i.isBufferGeometry) { const p = i.index, m = i.attributes.position; if (p !== null) { const y = Math.max(0, o.start), g = Math.min(p.count, o.start + o.count); for (let v = y, x = g - 1; v < x; v += f) { const w = p.getX(v), S = p.getX(v + 1); if (l.fromBufferAttribute(m, w), u.fromBufferAttribute(m, S), z0.distanceSqToSegment(l, u, h, d) > c) continue; h.applyMatrix4(this.matrixWorld); const _ = e.ray.origin.distanceTo(h); _ < e.near || _ > e.far || r.push({ distance: _, // What do we want? intersection point on the ray or on the segment?? // point: raycaster.ray.at( distance ), point: d.clone().applyMatrix4(this.matrixWorld), index: v, face: null, faceIndex: null, object: this }); } } else { const y = Math.max(0, o.start), g = Math.min(m.count, o.start + o.count); for (let v = y, x = g - 1; v < x; v += f) { if (l.fromBufferAttribute(m, v), u.fromBufferAttribute(m, v + 1), z0.distanceSqToSegment(l, u, h, d) > c) continue; h.applyMatrix4(this.matrixWorld); const w = e.ray.origin.distanceTo(h); w < e.near || w > e.far || r.push({ distance: w, // What do we want? intersection point on the ray or on the segment?? // point: raycaster.ray.at( distance ), point: d.clone().applyMatrix4(this.matrixWorld), index: v, face: null, faceIndex: null, object: this }); } } } else i.isGeometry && console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); } updateMorphTargets() { const e = this.geometry; if (e.isBufferGeometry) { const r = e.morphAttributes, i = Object.keys(r); if (i.length > 0) { const n = r[i[0]]; if (n !== void 0) { this.morphTargetInfluences = [], this.morphTargetDictionary = {}; for (let a = 0, o = n.length; a < o; a++) { const s = n[a].name || String(a); this.morphTargetInfluences.push(0), this.morphTargetDictionary[s] = a; } } } } else { const r = e.morphTargets; r !== void 0 && r.length > 0 && console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead."); } } } wa.prototype.isLine = !0; const xE = /* @__PURE__ */ new de(), wE = /* @__PURE__ */ new de(); class zi extends wa { constructor(e, r) { super(e, r), this.type = "LineSegments"; } computeLineDistances() { const e = this.geometry; if (e.isBufferGeometry) if (e.index === null) { const r = e.attributes.position, i = []; for (let n = 0, a = r.count; n < a; n += 2) xE.fromBufferAttribute(r, n), wE.fromBufferAttribute(r, n + 1), i[n] = n === 0 ? 0 : i[n - 1], i[n + 1] = i[n] + xE.distanceTo(wE); e.setAttribute("lineDistance", new it(i, 1)); } else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry."); else e.isGeometry && console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); return this; } } zi.prototype.isLineSegments = !0; class gv extends wa { constructor(e, r) { super(e, r), this.type = "LineLoop"; } } gv.prototype.isLineLoop = !0; class Ns extends jr { constructor(e) { super(), this.type = "PointsMaterial", this.color = new Je(16777215), this.map = null, this.alphaMap = null, this.size = 1, this.sizeAttenuation = !0, this.morphTargets = !1, this.setValues(e); } copy(e) { return super.copy(e), this.color.copy(e.color), this.map = e.map, this.alphaMap = e.alphaMap, this.size = e.size, this.sizeAttenuation = e.sizeAttenuation, this.morphTargets = e.morphTargets, this; } } Ns.prototype.isPointsMaterial = !0; const _E = /* @__PURE__ */ new at(), _1 = /* @__PURE__ */ new Ds(), Rf = /* @__PURE__ */ new _o(), Of = /* @__PURE__ */ new de(); class id extends It { constructor(e = new ft(), r = new Ns()) { super(), this.type = "Points", this.geometry = e, this.material = r, this.updateMorphTargets(); } copy(e) { return super.copy(e), this.material = e.material, this.geometry = e.geometry, this; } raycast(e, r) { const i = this.geometry, n = this.matrixWorld, a = e.params.Points.threshold, o = i.drawRange; if (i.boundingSphere === null && i.computeBoundingSphere(), Rf.copy(i.boundingSphere), Rf.applyMatrix4(n), Rf.radius += a, e.ray.intersectsSphere(Rf) === !1) return; _E.copy(n).invert(), _1.copy(e.ray).applyMatrix4(_E); const s = a / ((this.scale.x + this.scale.y + this.scale.z) / 3), c = s * s; if (i.isBufferGeometry) { const l = i.index, u = i.attributes.position; if (l !== null) { const d = Math.max(0, o.start), h = Math.min(l.count, o.start + o.count); for (let f = d, p = h; f < p; f++) { const m = l.getX(f); Of.fromBufferAttribute(u, m), SE(Of, m, c, n, e, r, this); } } else { const d = Math.max(0, o.start), h = Math.min(u.count, o.start + o.count); for (let f = d, p = h; f < p; f++) Of.fromBufferAttribute(u, f), SE(Of, f, c, n, e, r, this); } } else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); } updateMorphTargets() { const e = this.geometry; if (e.isBufferGeometry) { const r = e.morphAttributes, i = Object.keys(r); if (i.length > 0) { const n = r[i[0]]; if (n !== void 0) { this.morphTargetInfluences = [], this.morphTargetDictionary = {}; for (let a = 0, o = n.length; a < o; a++) { const s = n[a].name || String(a); this.morphTargetInfluences.push(0), this.morphTargetDictionary[s] = a; } } } } else { const r = e.morphTargets; r !== void 0 && r.length > 0 && console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead."); } } } id.prototype.isPoints = !0; function SE(t, e, r, i, n, a, o) { const s = _1.distanceSqToPoint(t); if (s < r) { const c = new de(); _1.closestPointToPoint(t, c), c.applyMatrix4(i); const l = n.ray.origin.distanceTo(c); if (l < n.near || l > n.far) return; a.push({ distance: l, distanceToRay: Math.sqrt(s), point: c, index: e, face: null, object: o }); } } class aO extends zr { constructor(e, r, i, n, a, o, s, c, l) { super(e, r, i, n, a, o, s, c, l), this.format = s !== void 0 ? s : Qa, this.minFilter = o !== void 0 ? o : Cr, this.magFilter = a !== void 0 ? a : Cr, this.generateMipmaps = !1; const u = this; function d() { u.needsUpdate = !0, e.requestVideoFrameCallback(d); } "requestVideoFrameCallback" in e && e.requestVideoFrameCallback(d); } clone() { return new this.constructor(this.image).copy(this); } update() { const e = this.image; !("requestVideoFrameCallback" in e) && e.readyState >= e.HAVE_CURRENT_DATA && (this.needsUpdate = !0); } } aO.prototype.isVideoTexture = !0; class Gx extends zr { constructor(e, r, i, n, a, o, s, c, l, u, d, h) { super(null, o, s, c, l, u, n, a, d, h), this.image = { width: r, height: i }, this.mipmaps = e, this.flipY = !1, this.generateMipmaps = !1; } } Gx.prototype.isCompressedTexture = !0; class oO extends zr { constructor(e, r, i, n, a, o, s, c, l) { super(e, r, i, n, a, o, s, c, l), this.needsUpdate = !0; } } oO.prototype.isCanvasTexture = !0; class sO extends zr { constructor(e, r, i, n, a, o, s, c, l, u) { if (u = u !== void 0 ? u : pl, u !== pl && u !== fu) throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat"); i === void 0 && u === pl && (i = Rh), i === void 0 && u === fu && (i = Gc), super(null, n, a, o, s, c, u, i, l), this.image = { width: e, height: r }, this.magFilter = s !== void 0 ? s : Dr, this.minFilter = c !== void 0 ? c : Dr, this.flipY = !1, this.generateMipmaps = !1; } } sO.prototype.isDepthTexture = !0; class bu extends ft { constructor(e = 1, r = 8, i = 0, n = Math.PI * 2) { super(), this.type = "CircleGeometry", this.parameters = { radius: e, segments: r, thetaStart: i, thetaLength: n }, r = Math.max(3, r); const a = [], o = [], s = [], c = [], l = new de(), u = new je(); o.push(0, 0, 0), s.push(0, 0, 1), c.push(0.5, 0.5); for (let d = 0, h = 3; d <= r; d++, h += 3) { const f = i + d / r * n; l.x = e * Math.cos(f), l.y = e * Math.sin(f), o.push(l.x, l.y, l.z), s.push(0, 0, 1), u.x = (o[h] / e + 1) / 2, u.y = (o[h + 1] / e + 1) / 2, c.push(u.x, u.y); } for (let d = 1; d <= r; d++) a.push(d, d + 1, 0); this.setIndex(a), this.setAttribute("position", new it(o, 3)), this.setAttribute("normal", new it(s, 3)), this.setAttribute("uv", new it(c, 2)); } static fromJSON(e) { return new bu(e.radius, e.segments, e.thetaStart, e.thetaLength); } } class Ss extends ft { constructor(e = 1, r = 1, i = 1, n = 8, a = 1, o = !1, s = 0, c = Math.PI * 2) { super(), this.type = "CylinderGeometry", this.parameters = { radiusTop: e, radiusBottom: r, height: i, radialSegments: n, heightSegments: a, openEnded: o, thetaStart: s, thetaLength: c }; const l = this; n = Math.floor(n), a = Math.floor(a); const u = [], d = [], h = [], f = []; let p = 0; const m = [], y = i / 2; let g = 0; v(), o === !1 && (e > 0 && x(!0), r > 0 && x(!1)), this.setIndex(u), this.setAttribute("position", new it(d, 3)), this.setAttribute("normal", new it(h, 3)), this.setAttribute("uv", new it(f, 2)); function v() { const w = new de(), S = new de(); let _ = 0; const b = (r - e) / i; for (let T = 0; T <= a; T++) { const E = [], C = T / a, L = C * (r - e) + e; for (let A = 0; A <= n; A++) { const k = A / n, P = k * c + s, R = Math.sin(P), M = Math.cos(P); S.x = L * R, S.y = -C * i + y, S.z = L * M, d.push(S.x, S.y, S.z), w.set(R, b, M).normalize(), h.push(w.x, w.y, w.z), f.push(k, 1 - C), E.push(p++); } m.push(E); } for (let T = 0; T < n; T++) for (let E = 0; E < a; E++) { const C = m[E][T], L = m[E + 1][T], A = m[E + 1][T + 1], k = m[E][T + 1]; u.push(C, L, k), u.push(L, A, k), _ += 6; } l.addGroup(g, _, 0), g += _; } function x(w) { const S = p, _ = new je(), b = new de(); let T = 0; const E = w === !0 ? e : r, C = w === !0 ? 1 : -1; for (let A = 1; A <= n; A++) d.push(0, y * C, 0), h.push(0, C, 0), f.push(0.5, 0.5), p++; const L = p; for (let A = 0; A <= n; A++) { const k = A / n * c + s, P = Math.cos(k), R = Math.sin(k); b.x = E * R, b.y = y * C, b.z = E * P, d.push(b.x, b.y, b.z), h.push(0, C, 0), _.x = P * 0.5 + 0.5, _.y = R * 0.5 * C + 0.5, f.push(_.x, _.y), p++; } for (let A = 0; A < n; A++) { const k = S + A, P = L + A; w === !0 ? u.push(P, P + 1, k) : u.push(P + 1, P, k), T += 3; } l.addGroup(g, T, w === !0 ? 1 : 2), g += T; } } static fromJSON(e) { return new Ss(e.radiusTop, e.radiusBottom, e.height, e.radialSegments, e.heightSegments, e.openEnded, e.thetaStart, e.thetaLength); } } class xu extends Ss { constructor(e = 1, r = 1, i = 8, n = 1, a = !1, o = 0, s = Math.PI * 2) { super(0, e, r, i, n, a, o, s), this.type = "ConeGeometry", this.parameters = { radius: e, height: r, radialSegments: i, heightSegments: n, openEnded: a, thetaStart: o, thetaLength: s }; } static fromJSON(e) { return new xu(e.radius, e.height, e.radialSegments, e.heightSegments, e.openEnded, e.thetaStart, e.thetaLength); } } class _a extends ft { constructor(e, r, i = 1, n = 0) { super(), this.type = "PolyhedronGeometry", this.parameters = { vertices: e, indices: r, radius: i, detail: n }; const a = [], o = []; s(n), l(i), u(), this.setAttribute("position", new it(a, 3)), this.setAttribute("normal", new it(a.slice(), 3)), this.setAttribute("uv", new it(o, 2)), n === 0 ? this.computeVertexNormals() : this.normalizeNormals(); function s(v) { const x = new de(), w = new de(), S = new de(); for (let _ = 0; _ < r.length; _ += 3) f(r[_ + 0], x), f(r[_ + 1], w), f(r[_ + 2], S), c(x, w, S, v); } function c(v, x, w, S) { const _ = S + 1, b = []; for (let T = 0; T <= _; T++) { b[T] = []; const E = v.clone().lerp(w, T / _), C = x.clone().lerp(w, T / _), L = _ - T; for (let A = 0; A <= L; A++) A === 0 && T === _ ? b[T][A] = E : b[T][A] = E.clone().lerp(C, A / L); } for (let T = 0; T < _; T++) for (let E = 0; E < 2 * (_ - T) - 1; E++) { const C = Math.floor(E / 2); E % 2 === 0 ? (h(b[T][C + 1]), h(b[T + 1][C]), h(b[T][C])) : (h(b[T][C + 1]), h(b[T + 1][C + 1]), h(b[T + 1][C])); } } function l(v) { const x = new de(); for (let w = 0; w < a.length; w += 3) x.x = a[w + 0], x.y = a[w + 1], x.z = a[w + 2], x.normalize().multiplyScalar(v), a[w + 0] = x.x, a[w + 1] = x.y, a[w + 2] = x.z; } function u() { const v = new de(); for (let x = 0; x < a.length; x += 3) { v.x = a[x + 0], v.y = a[x + 1], v.z = a[x + 2]; const w = y(v) / 2 / Math.PI + 0.5, S = g(v) / Math.PI + 0.5; o.push(w, 1 - S); } p(), d(); } function d() { for (let v = 0; v < o.length; v += 6) { const x = o[v + 0], w = o[v + 2], S = o[v + 4], _ = Math.max(x, w, S), b = Math.min(x, w, S); _ > 0.9 && b < 0.1 && (x < 0.2 && (o[v + 0] += 1), w < 0.2 && (o[v + 2] += 1), S < 0.2 && (o[v + 4] += 1)); } } function h(v) { a.push(v.x, v.y, v.z); } function f(v, x) { const w = v * 3; x.x = e[w + 0], x.y = e[w + 1], x.z = e[w + 2]; } function p() { const v = new de(), x = new de(), w = new de(), S = new de(), _ = new je(), b = new je(), T = new je(); for (let E = 0, C = 0; E < a.length; E += 9, C += 6) { v.set(a[E + 0], a[E + 1], a[E + 2]), x.set(a[E + 3], a[E + 4], a[E + 5]), w.set(a[E + 6], a[E + 7], a[E + 8]), _.set(o[C + 0], o[C + 1]), b.set(o[C + 2], o[C + 3]), T.set(o[C + 4], o[C + 5]), S.copy(v).add(x).add(w).divideScalar(3); const L = y(S); m(_, C + 0, v, L), m(b, C + 2, x, L), m(T, C + 4, w, L); } } function m(v, x, w, S) { S < 0 && v.x === 1 && (o[x] = v.x - 1), w.x === 0 && w.z === 0 && (o[x] = S / 2 / Math.PI + 0.5); } function y(v) { return Math.atan2(v.z, -v.x); } function g(v) { return Math.atan2(-v.y, Math.sqrt(v.x * v.x + v.z * v.z)); } } static fromJSON(e) { return new _a(e.vertices, e.indices, e.radius, e.details); } } class wu extends _a { constructor(e = 1, r = 0) { const i = (1 + Math.sqrt(5)) / 2, n = 1 / i, a = [ // (±1, ±1, ±1) -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, // (0, ±1/φ, ±φ) 0, -n, -i, 0, -n, i, 0, n, -i, 0, n, i, // (±1/φ, ±φ, 0) -n, -i, 0, -n, i, 0, n, -i, 0, n, i, 0, // (±φ, 0, ±1/φ) -i, 0, -n, i, 0, -n, -i, 0, n, i, 0, n ], o = [ 3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15, 17, 4, 8, 17, 8, 10, 17, 10, 6, 8, 0, 16, 8, 16, 2, 8, 2, 10, 0, 12, 1, 0, 1, 18, 0, 18, 16, 6, 10, 2, 6, 2, 13, 6, 13, 15, 2, 16, 18, 2, 18, 3, 2, 3, 13, 18, 1, 9, 18, 9, 11, 18, 11, 3, 4, 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5, 11, 5, 19, 11, 19, 7, 19, 5, 14, 19, 14, 4, 19, 4, 17, 1, 12, 14, 1, 14, 5, 1, 5, 9 ]; super(a, o, e, r), this.type = "DodecahedronGeometry", this.parameters = { radius: e, detail: r }; } static fromJSON(e) { return new wu(e.radius, e.detail); } } const Df = new de(), If = new de(), $0 = new de(), Nf = new Ir(); class Wx extends ft { constructor(e, r) { if (super(), this.type = "EdgesGeometry", this.parameters = { thresholdAngle: r }, r = r !== void 0 ? r : 1, e.isGeometry === !0) { console.error("THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); return; } const i = Math.pow(10, 4), n = Math.cos(fl * r), a = e.getIndex(), o = e.getAttribute("position"), s = a ? a.count : o.count, c = [0, 0, 0], l = ["a", "b", "c"], u = new Array(3), d = {}, h = []; for (let f = 0; f < s; f += 3) { a ? (c[0] = a.getX(f), c[1] = a.getX(f + 1), c[2] = a.getX(f + 2)) : (c[0] = f, c[1] = f + 1, c[2] = f + 2); const { a: p, b: m, c: y } = Nf; if (p.fromBufferAttribute(o, c[0]), m.fromBufferAttribute(o, c[1]), y.fromBufferAttribute(o, c[2]), Nf.getNormal($0), u[0] = `${Math.round(p.x * i)},${Math.round(p.y * i)},${Math.round(p.z * i)}`, u[1] = `${Math.round(m.x * i)},${Math.round(m.y * i)},${Math.round(m.z * i)}`, u[2] = `${Math.round(y.x * i)},${Math.round(y.y * i)},${Math.round(y.z * i)}`, !(u[0] === u[1] || u[1] === u[2] || u[2] === u[0])) for (let g = 0; g < 3; g++) { const v = (g + 1) % 3, x = u[g], w = u[v], S = Nf[l[g]], _ = Nf[l[v]], b = `${x}_${w}`, T = `${w}_${x}`; T in d && d[T] ? ($0.dot(d[T].normal) <= n && (h.push(S.x, S.y, S.z), h.push(_.x, _.y, _.z)), d[T] = null) : b in d || (d[b] = { index0: c[g], index1: c[v], normal: $0.clone() }); } } for (const f in d) if (d[f]) { const { index0: p, index1: m } = d[f]; Df.fromBufferAttribute(o, p), If.fromBufferAttribute(o, m), h.push(Df.x, Df.y, Df.z), h.push(If.x, If.y, If.z); } this.setAttribute("position", new it(h, 3)); } } class un { constructor() { this.type = "Curve", this.arcLengthDivisions = 200; } // Virtual base class method to overwrite and implement in subclasses // - t [0 .. 1] getPoint() { return console.warn("THREE.Curve: .getPoint() not implemented."), null; } // Get point at relative position in curve according to arc length // - u [0 .. 1] getPointAt(e, r) { const i = this.getUtoTmapping(e); return this.getPoint(i, r); } // Get sequence of points using getPoint( t ) getPoints(e = 5) { const r = []; for (let i = 0; i <= e; i++) r.push(this.getPoint(i / e)); return r; } // Get sequence of points using getPointAt( u ) getSpacedPoints(e = 5) { const r = []; for (let i = 0; i <= e; i++) r.push(this.getPointAt(i / e)); return r; } // Get total curve arc length getLength() { const e = this.getLengths(); return e[e.length - 1]; } // Get list of cumulative segment lengths getLengths(e = this.arcLengthDivisions) { if (this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate) return this.cacheArcLengths; this.needsUpdate = !1; const r = []; let i, n = this.getPoint(0), a = 0; r.push(0); for (let o = 1; o <= e; o++) i = this.getPoint(o / e), a += i.distanceTo(n), r.push(a), n = i; return this.cacheArcLengths = r, r; } updateArcLengths() { this.needsUpdate = !0, this.getLengths(); } // Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant getUtoTmapping(e, r) { const i = this.getLengths(); let n = 0; const a = i.length; let o; r ? o = r : o = e * i[a - 1]; let s = 0, c = a - 1, l; for (; s <= c; ) if (n = Math.floor(s + (c - s) / 2), l = i[n] - o, l < 0) s = n + 1; else if (l > 0) c = n - 1; else { c = n; break; } if (n = c, i[n] === o) return n / (a - 1); const u = i[n], d = i[n + 1] - u, h = (o - u) / d; return (n + h) / (a - 1); } // Returns a unit vector tangent at t // In case any sub curve does not implement its tangent derivation, // 2 points a small delta apart will be used to find its gradient // which seems to give a reasonable approximation getTangent(e, r) { let i = e - 1e-4, n = e + 1e-4; i < 0 && (i = 0), n > 1 && (n = 1); const a = this.getPoint(i), o = this.getPoint(n), s = r || (a.isVector2 ? new je() : new de()); return s.copy(o).sub(a).normalize(), s; } getTangentAt(e, r) { const i = this.getUtoTmapping(e); return this.getTangent(i, r); } computeFrenetFrames(e, r) { const i = new de(), n = [], a = [], o = [], s = new de(), c = new at(); for (let f = 0; f <= e; f++) { const p = f / e; n[f] = this.getTangentAt(p, new de()), n[f].normalize(); } a[0] = new de(), o[0] = new de(); let l = Number.MAX_VALUE; const u = Math.abs(n[0].x), d = Math.abs(n[0].y), h = Math.abs(n[0].z); u <= l && (l = u, i.set(1, 0, 0)), d <= l && (l = d, i.set(0, 1, 0)), h <= l && i.set(0, 0, 1), s.crossVectors(n[0], i).normalize(), a[0].crossVectors(n[0], s), o[0].crossVectors(n[0], a[0]); for (let f = 1; f <= e; f++) { if (a[f] = a[f - 1].clone(), o[f] = o[f - 1].clone(), s.crossVectors(n[f - 1], n[f]), s.length() > Number.EPSILON) { s.normalize(); const p = Math.acos(ci(n[f - 1].dot(n[f]), -1, 1)); a[f].applyMatrix4(c.makeRotationAxis(s, p)); } o[f].crossVectors(n[f], a[f]); } if (r === !0) { let f = Math.acos(ci(a[0].dot(a[e]), -1, 1)); f /= e, n[0].dot(s.crossVectors(a[0], a[e])) > 0 && (f = -f); for (let p = 1; p <= e; p++) a[p].applyMatrix4(c.makeRotationAxis(n[p], f * p)), o[p].crossVectors(n[p], a[p]); } return { tangents: n, normals: a, binormals: o }; } clone() { return new this.constructor().copy(this); } copy(e) { return this.arcLengthDivisions = e.arcLengthDivisions, this; } toJSON() { const e = { metadata: { version: 4.5, type: "Curve", generator: "Curve.toJSON" } }; return e.arcLengthDivisions = this.arcLengthDivisions, e.type = this.type, e; } fromJSON(e) { return this.arcLengthDivisions = e.arcLengthDivisions, this; } } class Ap extends un { constructor(e = 0, r = 0, i = 1, n = 1, a = 0, o = Math.PI * 2, s = !1, c = 0) { super(), this.type = "EllipseCurve", this.aX = e, this.aY = r, this.xRadius = i, this.yRadius = n, this.aStartAngle = a, this.aEndAngle = o, this.aClockwise = s, this.aRotation = c; } getPoint(e, r) { const i = r || new je(), n = Math.PI * 2; let a = this.aEndAngle - this.aStartAngle; const o = Math.abs(a) < Number.EPSILON; for (; a < 0; ) a += n; for (; a > n; ) a -= n; a < Number.EPSILON && (o ? a = 0 : a = n), this.aClockwise === !0 && !o && (a === n ? a = -n : a = a - n); const s = this.aStartAngle + e * a; let c = this.aX + this.xRadius * Math.cos(s), l = this.aY + this.yRadius * Math.sin(s); if (this.aRotation !== 0) { const u = Math.cos(this.aRotation), d = Math.sin(this.aRotation), h = c - this.aX, f = l - this.aY; c = h * u - f * d + this.aX, l = h * d + f * u + this.aY; } return i.set(c, l); } copy(e) { return super.copy(e), this.aX = e.aX, this.aY = e.aY, this.xRadius = e.xRadius, this.yRadius = e.yRadius, this.aStartAngle = e.aStartAngle, this.aEndAngle = e.aEndAngle, this.aClockwise = e.aClockwise, this.aRotation = e.aRotation, this; } toJSON() { const e = super.toJSON(); return e.aX = this.aX, e.aY = this.aY, e.xRadius = this.xRadius, e.yRadius = this.yRadius, e.aStartAngle = this.aStartAngle, e.aEndAngle = this.aEndAngle, e.aClockwise = this.aClockwise, e.aRotation = this.aRotation, e; } fromJSON(e) { return super.fromJSON(e), this.aX = e.aX, this.aY = e.aY, this.xRadius = e.xRadius, this.yRadius = e.yRadius, this.aStartAngle = e.aStartAngle, this.aEndAngle = e.aEndAngle, this.aClockwise = e.aClockwise, this.aRotation = e.aRotation, this; } } Ap.prototype.isEllipseCurve = !0; class qx extends Ap { constructor(e, r, i, n, a, o) { super(e, r, i, i, n, a, o), this.type = "ArcCurve"; } } qx.prototype.isArcCurve = !0; function Xx() { let t = 0, e = 0, r = 0, i = 0; function n(a, o, s, c) { t = a, e = s, r = -3 * a + 3 * o - 2 * s - c, i = 2 * a - 2 * o + s + c; } return { initCatmullRom: function(a, o, s, c, l) { n(o, s, l * (s - a), l * (c - o)); }, initNonuniformCatmullRom: function(a, o, s, c, l, u, d) { let h = (o - a) / l - (s - a) / (l + u) + (s - o) / u, f = (s - o) / u - (c - o) / (u + d) + (c - s) / d; h *= u, f *= u, n(o, s, h, f); }, calc: function(a) { const o = a * a, s = o * a; return t + e * a + r * o + i * s; } }; } const Bf = new de(), V0 = new Xx(), U0 = new Xx(), j0 = new Xx(); class Zx extends un { constructor(e = [], r = !1, i = "centripetal", n = 0.5) { super(), this.type = "CatmullRomCurve3", this.points = e, this.closed = r, this.curveType = i, this.tension = n; } getPoint(e, r = new de()) { const i = r, n = this.points, a = n.length, o = (a - (this.closed ? 0 : 1)) * e; let s = Math.floor(o), c = o - s; this.closed ? s += s > 0 ? 0 : (Math.floor(Math.abs(s) / a) + 1) * a : c === 0 && s === a - 1 && (s = a - 2, c = 1); let l, u; this.closed || s > 0 ? l = n[(s - 1) % a] : (Bf.subVectors(n[0], n[1]).add(n[0]), l = Bf); const d = n[s % a], h = n[(s + 1) % a]; if (this.closed || s + 2 < a ? u = n[(s + 2) % a] : (Bf.subVectors(n[a - 1], n[a - 2]).add(n[a - 1]), u = Bf), this.curveType === "centripetal" || this.curveType === "chordal") { const f = this.curveType === "chordal" ? 0.5 : 0.25; let p = Math.pow(l.distanceToSquared(d), f), m = Math.pow(d.distanceToSquared(h), f), y = Math.pow(h.distanceToSquared(u), f); m < 1e-4 && (m = 1), p < 1e-4 && (p = m), y < 1e-4 && (y = m), V0.initNonuniformCatmullRom(l.x, d.x, h.x, u.x, p, m, y), U0.initNonuniformCatmullRom(l.y, d.y, h.y, u.y, p, m, y), j0.initNonuniformCatmullRom(l.z, d.z, h.z, u.z, p, m, y); } else this.curveType === "catmullrom" && (V0.initCatmullRom(l.x, d.x, h.x, u.x, this.tension), U0.initCatmullRom(l.y, d.y, h.y, u.y, this.tension), j0.initCatmullRom(l.z, d.z, h.z, u.z, this.tension)); return i.set( V0.calc(c), U0.calc(c), j0.calc(c) ), i; } copy(e) { super.copy(e), this.points = []; for (let r = 0, i = e.points.length; r < i; r++) { const n = e.points[r]; this.points.push(n.clone()); } return this.closed = e.closed, this.curveType = e.curveType, this.tension = e.tension, this; } toJSON() { const e = super.toJSON(); e.points = []; for (let r = 0, i = this.points.length; r < i; r++) { const n = this.points[r]; e.points.push(n.toArray()); } return e.closed = this.closed, e.curveType = this.curveType, e.tension = this.tension, e; } fromJSON(e) { super.fromJSON(e), this.points = []; for (let r = 0, i = e.points.length; r < i; r++) { const n = e.points[r]; this.points.push(new de().fromArray(n)); } return this.closed = e.closed, this.curveType = e.curveType, this.tension = e.tension, this; } } Zx.prototype.isCatmullRomCurve3 = !0; function ME(t, e, r, i, n) { const a = (i - e) * 0.5, o = (n - r) * 0.5, s = t * t, c = t * s; return (2 * r - 2 * i + a + o) * c + (-3 * r + 3 * i - 2 * a - o) * s + a * t + r; } function nde(t, e) { const r = 1 - t; return r * r * e; } function ade(t, e) { return 2 * (1 - t) * t * e; } function ode(t, e) { return t * t * e; } function rh(t, e, r, i) { return nde(t, e) + ade(t, r) + ode(t, i); } function sde(t, e) { const r = 1 - t; return r * r * r * e; } function lde(t, e) { const r = 1 - t; return 3 * r * r * t * e; } function cde(t, e) { return 3 * (1 - t) * t * t * e; } function ude(t, e) { return t * t * t * e; } function ih(t, e, r, i, n) { return sde(t, e) + lde(t, r) + cde(t, i) + ude(t, n); } class vv extends un { constructor(e = new je(), r = new je(), i = new je(), n = new je()) { super(), this.type = "CubicBezierCurve", this.v0 = e, this.v1 = r, this.v2 = i, this.v3 = n; } getPoint(e, r = new je()) { const i = r, n = this.v0, a = this.v1, o = this.v2, s = this.v3; return i.set( ih(e, n.x, a.x, o.x, s.x), ih(e, n.y, a.y, o.y, s.y) ), i; } copy(e) { return super.copy(e), this.v0.copy(e.v0), this.v1.copy(e.v1), this.v2.copy(e.v2), this.v3.copy(e.v3), this; } toJSON() { const e = super.toJSON(); return e.v0 = this.v0.toArray(), e.v1 = this.v1.toArray(), e.v2 = this.v2.toArray(), e.v3 = this.v3.toArray(), e; } fromJSON(e) { return super.fromJSON(e), this.v0.fromArray(e.v0), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this.v3.fromArray(e.v3), this; } } vv.prototype.isCubicBezierCurve = !0; class Yx extends un { constructor(e = new de(), r = new de(), i = new de(), n = new de()) { super(), this.type = "CubicBezierCurve3", this.v0 = e, this.v1 = r, this.v2 = i, this.v3 = n; } getPoint(e, r = new de()) { const i = r, n = this.v0, a = this.v1, o = this.v2, s = this.v3; return i.set( ih(e, n.x, a.x, o.x, s.x), ih(e, n.y, a.y, o.y, s.y), ih(e, n.z, a.z, o.z, s.z) ), i; } copy(e) { return super.copy(e), this.v0.copy(e.v0), this.v1.copy(e.v1), this.v2.copy(e.v2), this.v3.copy(e.v3), this; } toJSON() { const e = super.toJSON(); return e.v0 = this.v0.toArray(), e.v1 = this.v1.toArray(), e.v2 = this.v2.toArray(), e.v3 = this.v3.toArray(), e; } fromJSON(e) { return super.fromJSON(e), this.v0.fromArray(e.v0), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this.v3.fromArray(e.v3), this; } } Yx.prototype.isCubicBezierCurve3 = !0; class Lp extends un { constructor(e = new je(), r = new je()) { super(), this.type = "LineCurve", this.v1 = e, this.v2 = r; } getPoint(e, r = new je()) { const i = r; return e === 1 ? i.copy(this.v2) : (i.copy(this.v2).sub(this.v1), i.multiplyScalar(e).add(this.v1)), i; } // Line curve is linear, so we can overwrite default getPointAt getPointAt(e, r) { return this.getPoint(e, r); } getTangent(e, r) { const i = r || new je(); return i.copy(this.v2).sub(this.v1).normalize(), i; } copy(e) { return super.copy(e), this.v1.copy(e.v1), this.v2.copy(e.v2), this; } toJSON() { const e = super.toJSON(); return e.v1 = this.v1.toArray(), e.v2 = this.v2.toArray(), e; } fromJSON(e) { return super.fromJSON(e), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this; } } Lp.prototype.isLineCurve = !0; class lO extends un { constructor(e = new de(), r = new de()) { super(), this.type = "LineCurve3", this.isLineCurve3 = !0, this.v1 = e, this.v2 = r; } getPoint(e, r = new de()) { const i = r; return e === 1 ? i.copy(this.v2) : (i.copy(this.v2).sub(this.v1), i.multiplyScalar(e).add(this.v1)), i; } // Line curve is linear, so we can overwrite default getPointAt getPointAt(e, r) { return this.getPoint(e, r); } copy(e) { return super.copy(e), this.v1.copy(e.v1), this.v2.copy(e.v2), this; } toJSON() { const e = super.toJSON(); return e.v1 = this.v1.toArray(), e.v2 = this.v2.toArray(), e; } fromJSON(e) { return super.fromJSON(e), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this; } } class yv extends un { constructor(e = new je(), r = new je(), i = new je()) { super(), this.type = "QuadraticBezierCurve", this.v0 = e, this.v1 = r, this.v2 = i; } getPoint(e, r = new je()) { const i = r, n = this.v0, a = this.v1, o = this.v2; return i.set( rh(e, n.x, a.x, o.x), rh(e, n.y, a.y, o.y) ), i; } copy(e) { return super.copy(e), this.v0.copy(e.v0), this.v1.copy(e.v1), this.v2.copy(e.v2), this; } toJSON() { const e = super.toJSON(); return e.v0 = this.v0.toArray(), e.v1 = this.v1.toArray(), e.v2 = this.v2.toArray(), e; } fromJSON(e) { return super.fromJSON(e), this.v0.fromArray(e.v0), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this; } } yv.prototype.isQuadraticBezierCurve = !0; class Kx extends un { constructor(e = new de(), r = new de(), i = new de()) { super(), this.type = "QuadraticBezierCurve3", this.v0 = e, this.v1 = r, this.v2 = i; } getPoint(e, r = new de()) { const i = r, n = this.v0, a = this.v1, o = this.v2; return i.set( rh(e, n.x, a.x, o.x), rh(e, n.y, a.y, o.y), rh(e, n.z, a.z, o.z) ), i; } copy(e) { return super.copy(e), this.v0.copy(e.v0), this.v1.copy(e.v1), this.v2.copy(e.v2), this; } toJSON() { const e = super.toJSON(); return e.v0 = this.v0.toArray(), e.v1 = this.v1.toArray(), e.v2 = this.v2.toArray(), e; } fromJSON(e) { return super.fromJSON(e), this.v0.fromArray(e.v0), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this; } } Kx.prototype.isQuadraticBezierCurve3 = !0; class bv extends un { constructor(e = []) { super(), this.type = "SplineCurve", this.points = e; } getPoint(e, r = new je()) { const i = r, n = this.points, a = (n.length - 1) * e, o = Math.floor(a), s = a - o, c = n[o === 0 ? o : o - 1], l = n[o], u = n[o > n.length - 2 ? n.length - 1 : o + 1], d = n[o > n.length - 3 ? n.length - 1 : o + 2]; return i.set( ME(s, c.x, l.x, u.x, d.x), ME(s, c.y, l.y, u.y, d.y) ), i; } copy(e) { super.copy(e), this.points = []; for (let r = 0, i = e.points.length; r < i; r++) { const n = e.points[r]; this.points.push(n.clone()); } return this; } toJSON() { const e = super.toJSON(); e.points = []; for (let r = 0, i = this.points.length; r < i; r++) { const n = this.points[r]; e.points.push(n.toArray()); } return e; } fromJSON(e) { super.fromJSON(e), this.points = []; for (let r = 0, i = e.points.length; r < i; r++) { const n = e.points[r]; this.points.push(new je().fromArray(n)); } return this; } } bv.prototype.isSplineCurve = !0; var Jx = /* @__PURE__ */ Object.freeze({ __proto__: null, ArcCurve: qx, CatmullRomCurve3: Zx, CubicBezierCurve: vv, CubicBezierCurve3: Yx, EllipseCurve: Ap, LineCurve: Lp, LineCurve3: lO, QuadraticBezierCurve: yv, QuadraticBezierCurve3: Kx, SplineCurve: bv }); const dde = { triangulate: function(t, e, r = 2) { const i = e && e.length, n = i ? e[0] * r : t.length; let a = cO(t, 0, n, r, !0); const o = []; if (!a || a.next === a.prev) return o; let s, c, l, u, d, h, f; if (i && (a = gde(t, e, a, r)), t.length > 80 * r) { s = l = t[0], c = u = t[1]; for (let p = r; p < n; p += r) d = t[p], h = t[p + 1], d < s && (s = d), h < c && (c = h), d > l && (l = d), h > u && (u = h); f = Math.max(l - s, u - c), f = f !== 0 ? 1 / f : 0; } return Ih(a, o, r, s, c, f), o; } }; function cO(t, e, r, i, n) { let a, o; if (n === Cde(t, e, r, i) > 0) for (a = e; a < r; a += i) o = EE(a, t[a], t[a + 1], o); else for (a = r - i; a >= e; a -= i) o = EE(a, t[a], t[a + 1], o); return o && xv(o, o.next) && (Bh(o), o = o.next), o; } function Ms(t, e) { if (!t) return t; e || (e = t); let r = t, i; do if (i = !1, !r.steiner && (xv(r, r.next) || br(r.prev, r, r.next) === 0)) { if (Bh(r), r = e = r.prev, r === r.next) break; i = !0; } else r = r.next; while (i || r !== e); return e; } function Ih(t, e, r, i, n, a, o) { if (!t) return; !o && a && wde(t, i, n, a); let s = t, c, l; for (; t.prev !== t.next; ) { if (c = t.prev, l = t.next, a ? pde(t, i, n, a) : hde(t)) { e.push(c.i / r), e.push(t.i / r), e.push(l.i / r), Bh(t), t = l.next, s = l.next; continue; } if (t = l, t === s) { o ? o === 1 ? (t = fde(Ms(t), e, r), Ih(t, e, r, i, n, a, 2)) : o === 2 && mde(t, e, r, i, n, a) : Ih(Ms(t), e, r, i, n, a, 1); break; } } } function hde(t) { const e = t.prev, r = t, i = t.next; if (br(e, r, i) >= 0) return !1; let n = t.next.next; for (; n !== t.prev; ) { if (Bc(e.x, e.y, r.x, r.y, i.x, i.y, n.x, n.y) && br(n.prev, n, n.next) >= 0) return !1; n = n.next; } return !0; } function pde(t, e, r, i) { const n = t.prev, a = t, o = t.next; if (br(n, a, o) >= 0) return !1; const s = n.x < a.x ? n.x < o.x ? n.x : o.x : a.x < o.x ? a.x : o.x, c = n.y < a.y ? n.y < o.y ? n.y : o.y : a.y < o.y ? a.y : o.y, l = n.x > a.x ? n.x > o.x ? n.x : o.x : a.x > o.x ? a.x : o.x, u = n.y > a.y ? n.y > o.y ? n.y : o.y : a.y > o.y ? a.y : o.y, d = S1(s, c, e, r, i), h = S1(l, u, e, r, i); let f = t.prevZ, p = t.nextZ; for (; f && f.z >= d && p && p.z <= h; ) { if (f !== t.prev && f !== t.next && Bc(n.x, n.y, a.x, a.y, o.x, o.y, f.x, f.y) && br(f.prev, f, f.next) >= 0 || (f = f.prevZ, p !== t.prev && p !== t.next && Bc(n.x, n.y, a.x, a.y, o.x, o.y, p.x, p.y) && br(p.prev, p, p.next) >= 0)) return !1; p = p.nextZ; } for (; f && f.z >= d; ) { if (f !== t.prev && f !== t.next && Bc(n.x, n.y, a.x, a.y, o.x, o.y, f.x, f.y) && br(f.prev, f, f.next) >= 0) return !1; f = f.prevZ; } for (; p && p.z <= h; ) { if (p !== t.prev && p !== t.next && Bc(n.x, n.y, a.x, a.y, o.x, o.y, p.x, p.y) && br(p.prev, p, p.next) >= 0) return !1; p = p.nextZ; } return !0; } function fde(t, e, r) { let i = t; do { const n = i.prev, a = i.next.next; !xv(n, a) && uO(n, i, i.next, a) && Nh(n, a) && Nh(a, n) && (e.push(n.i / r), e.push(i.i / r), e.push(a.i / r), Bh(i), Bh(i.next), i = t = a), i = i.next; } while (i !== t); return Ms(i); } function mde(t, e, r, i, n, a) { let o = t; do { let s = o.next.next; for (; s !== o.prev; ) { if (o.i !== s.i && Mde(o, s)) { let c = dO(o, s); o = Ms(o, o.next), c = Ms(c, c.next), Ih(o, e, r, i, n, a), Ih(c, e, r, i, n, a); return; } s = s.next; } o = o.next; } while (o !== t); } function gde(t, e, r, i) { const n = []; let a, o, s, c, l; for (a = 0, o = e.length; a < o; a++) s = e[a] * i, c = a < o - 1 ? e[a + 1] * i : t.length, l = cO(t, s, c, i, !1), l === l.next && (l.steiner = !0), n.push(Sde(l)); for (n.sort(vde), a = 0; a < n.length; a++) yde(n[a], r), r = Ms(r, r.next); return r; } function vde(t, e) { return t.x - e.x; } function yde(t, e) { if (e = bde(t, e), e) { const r = dO(e, t); Ms(e, e.next), Ms(r, r.next); } } function bde(t, e) { let r = e; const i = t.x, n = t.y; let a = -1 / 0, o; do { if (n <= r.y && n >= r.next.y && r.next.y !== r.y) { const h = r.x + (n - r.y) * (r.next.x - r.x) / (r.next.y - r.y); if (h <= i && h > a) { if (a = h, h === i) { if (n === r.y) return r; if (n === r.next.y) return r.next; } o = r.x < r.next.x ? r : r.next; } } r = r.next; } while (r !== e); if (!o) return null; if (i === a) return o; const s = o, c = o.x, l = o.y; let u = 1 / 0, d; r = o; do i >= r.x && r.x >= c && i !== r.x && Bc(n < l ? i : a, n, c, l, n < l ? a : i, n, r.x, r.y) && (d = Math.abs(n - r.y) / (i - r.x), Nh(r, t) && (d < u || d === u && (r.x > o.x || r.x === o.x && xde(o, r))) && (o = r, u = d)), r = r.next; while (r !== s); return o; } function xde(t, e) { return br(t.prev, t, e.prev) < 0 && br(e.next, t, t.next) < 0; } function wde(t, e, r, i) { let n = t; do n.z === null && (n.z = S1(n.x, n.y, e, r, i)), n.prevZ = n.prev, n.nextZ = n.next, n = n.next; while (n !== t); n.prevZ.nextZ = null, n.prevZ = null, _de(n); } function _de(t) { let e, r, i, n, a, o, s, c, l = 1; do { for (r = t, t = null, a = null, o = 0; r; ) { for (o++, i = r, s = 0, e = 0; e < l && (s++, i = i.nextZ, !!i); e++) ; for (c = l; s > 0 || c > 0 && i; ) s !== 0 && (c === 0 || !i || r.z <= i.z) ? (n = r, r = r.nextZ, s--) : (n = i, i = i.nextZ, c--), a ? a.nextZ = n : t = n, n.prevZ = a, a = n; r = i; } a.nextZ = null, l *= 2; } while (o > 1); return t; } function S1(t, e, r, i, n) { return t = 32767 * (t - r) * n, e = 32767 * (e - i) * n, t = (t | t << 8) & 16711935, t = (t | t << 4) & 252645135, t = (t | t << 2) & 858993459, t = (t | t << 1) & 1431655765, e = (e | e << 8) & 16711935, e = (e | e << 4) & 252645135, e = (e | e << 2) & 858993459, e = (e | e << 1) & 1431655765, t | e << 1; } function Sde(t) { let e = t, r = t; do (e.x < r.x || e.x === r.x && e.y < r.y) && (r = e), e = e.next; while (e !== t); return r; } function Bc(t, e, r, i, n, a, o, s) { return (n - o) * (e - s) - (t - o) * (a - s) >= 0 && (t - o) * (i - s) - (r - o) * (e - s) >= 0 && (r - o) * (a - s) - (n - o) * (i - s) >= 0; } function Mde(t, e) { return t.next.i !== e.i && t.prev.i !== e.i && !Ede(t, e) && // dones't intersect other edges (Nh(t, e) && Nh(e, t) && Tde(t, e) && // locally visible (br(t.prev, t, e.prev) || br(t, e.prev, e)) || // does not create opposite-facing sectors xv(t, e) && br(t.prev, t, t.next) > 0 && br(e.prev, e, e.next) > 0); } function br(t, e, r) { return (e.y - t.y) * (r.x - e.x) - (e.x - t.x) * (r.y - e.y); } function xv(t, e) { return t.x === e.x && t.y === e.y; } function uO(t, e, r, i) { const n = zf(br(t, e, r)), a = zf(br(t, e, i)), o = zf(br(r, i, t)), s = zf(br(r, i, e)); return !!(n !== a && o !== s || n === 0 && Ff(t, r, e) || a === 0 && Ff(t, i, e) || o === 0 && Ff(r, t, i) || s === 0 && Ff(r, e, i)); } function Ff(t, e, r) { return e.x <= Math.max(t.x, r.x) && e.x >= Math.min(t.x, r.x) && e.y <= Math.max(t.y, r.y) && e.y >= Math.min(t.y, r.y); } function zf(t) { return t > 0 ? 1 : t < 0 ? -1 : 0; } function Ede(t, e) { let r = t; do { if (r.i !== t.i && r.next.i !== t.i && r.i !== e.i && r.next.i !== e.i && uO(r, r.next, t, e)) return !0; r = r.next; } while (r !== t); return !1; } function Nh(t, e) { return br(t.prev, t, t.next) < 0 ? br(t, e, t.next) >= 0 && br(t, t.prev, e) >= 0 : br(t, e, t.prev) < 0 || br(t, t.next, e) < 0; } function Tde(t, e) { let r = t, i = !1; const n = (t.x + e.x) / 2, a = (t.y + e.y) / 2; do r.y > a != r.next.y > a && r.next.y !== r.y && n < (r.next.x - r.x) * (a - r.y) / (r.next.y - r.y) + r.x && (i = !i), r = r.next; while (r !== t); return i; } function dO(t, e) { const r = new M1(t.i, t.x, t.y), i = new M1(e.i, e.x, e.y), n = t.next, a = e.prev; return t.next = e, e.prev = t, r.next = n, n.prev = r, i.next = r, r.prev = i, a.next = i, i.prev = a, i; } function EE(t, e, r, i) { const n = new M1(t, e, r); return i ? (n.next = i.next, n.prev = i, i.next.prev = n, i.next = n) : (n.prev = n, n.next = n), n; } function Bh(t) { t.next.prev = t.prev, t.prev.next = t.next, t.prevZ && (t.prevZ.nextZ = t.nextZ), t.nextZ && (t.nextZ.prevZ = t.prevZ); } function M1(t, e, r) { this.i = t, this.x = e, this.y = r, this.prev = null, this.next = null, this.z = null, this.prevZ = null, this.nextZ = null, this.steiner = !1; } function Cde(t, e, r, i) { let n = 0; for (let a = e, o = r - i; a < r; a += i) n += (t[o] - t[a]) * (t[a + 1] + t[o + 1]), o = a; return n; } class ma { // calculate area of the contour polygon static area(e) { const r = e.length; let i = 0; for (let n = r - 1, a = 0; a < r; n = a++) i += e[n].x * e[a].y - e[a].x * e[n].y; return i * 0.5; } static isClockWise(e) { return ma.area(e) < 0; } static triangulateShape(e, r) { const i = [], n = [], a = []; TE(e), CE(i, e); let o = e.length; r.forEach(TE); for (let c = 0; c < r.length; c++) n.push(o), o += r[c].length, CE(i, r[c]); const s = dde.triangulate(i, n); for (let c = 0; c < s.length; c += 3) a.push(s.slice(c, c + 3)); return a; } } function TE(t) { const e = t.length; e > 2 && t[e - 1].equals(t[0]) && t.pop(); } function CE(t, e) { for (let r = 0; r < e.length; r++) t.push(e[r].x), t.push(e[r].y); } class qn extends ft { constructor(e, r) { super(), this.type = "ExtrudeGeometry", this.parameters = { shapes: e, options: r }, e = Array.isArray(e) ? e : [e]; const i = this, n = [], a = []; for (let s = 0, c = e.length; s < c; s++) { const l = e[s]; o(l); } this.setAttribute("position", new it(n, 3)), this.setAttribute("uv", new it(a, 2)), this.computeVertexNormals(); function o(s) { const c = [], l = r.curveSegments !== void 0 ? r.curveSegments : 12, u = r.steps !== void 0 ? r.steps : 1; let d = r.depth !== void 0 ? r.depth : 100, h = r.bevelEnabled !== void 0 ? r.bevelEnabled : !0, f = r.bevelThickness !== void 0 ? r.bevelThickness : 6, p = r.bevelSize !== void 0 ? r.bevelSize : f - 2, m = r.bevelOffset !== void 0 ? r.bevelOffset : 0, y = r.bevelSegments !== void 0 ? r.bevelSegments : 3; const g = r.extrudePath, v = r.UVGenerator !== void 0 ? r.UVGenerator : Ade; r.amount !== void 0 && (console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."), d = r.amount); let x, w = !1, S, _, b, T; g && (x = g.getSpacedPoints(u), w = !0, h = !1, S = g.computeFrenetFrames(u, !1), _ = new de(), b = new de(), T = new de()), h || (y = 0, f = 0, p = 0, m = 0); const E = s.extractPoints(l); let C = E.shape; const L = E.holes; if (!ma.isClockWise(C)) { C = C.reverse(); for (let X = 0, ie = L.length; X < ie; X++) { const ue = L[X]; ma.isClockWise(ue) && (L[X] = ue.reverse()); } } const A = ma.triangulateShape(C, L), k = C; for (let X = 0, ie = L.length; X < ie; X++) { const ue = L[X]; C = C.concat(ue); } function P(X, ie, ue) { return ie || console.error("THREE.ExtrudeGeometry: vec does not exist"), ie.clone().multiplyScalar(ue).add(X); } const R = C.length, M = A.length; function O(X, ie, ue) { let $, J, ne; const j = X.x - ie.x, q = X.y - ie.y, ge = ue.x - X.x, ye = ue.y - X.y, _e = j * j + q * q, Me = j * ye - q * ge; if (Math.abs(Me) > Number.EPSILON) { const Ce = Math.sqrt(_e), B = Math.sqrt(ge * ge + ye * ye), ce = ie.x - q / Ce, ve = ie.y + j / Ce, te = ue.x - ye / B, pe = ue.y + ge / B, fe = ((te - ce) * ye - (pe - ve) * ge) / (j * ye - q * ge); $ = ce + j * fe - X.x, J = ve + q * fe - X.y; const he = $ * $ + J * J; if (he <= 2) return new je($, J); ne = Math.sqrt(he / 2); } else { let Ce = !1; j > Number.EPSILON ? ge > Number.EPSILON && (Ce = !0) : j < -Number.EPSILON ? ge < -Number.EPSILON && (Ce = !0) : Math.sign(q) === Math.sign(ye) && (Ce = !0), Ce ? ($ = -q, J = j, ne = Math.sqrt(_e)) : ($ = j, J = q, ne = Math.sqrt(_e / 2)); } return new je($ / ne, J / ne); } const D = []; for (let X = 0, ie = k.length, ue = ie - 1, $ = X + 1; X < ie; X++, ue++, $++) ue === ie && (ue = 0), $ === ie && ($ = 0), D[X] = O(k[X], k[ue], k[$]); const I = []; let F, z = D.concat(); for (let X = 0, ie = L.length; X < ie; X++) { const ue = L[X]; F = []; for (let $ = 0, J = ue.length, ne = J - 1, j = $ + 1; $ < J; $++, ne++, j++) ne === J && (ne = 0), j === J && (j = 0), F[$] = O(ue[$], ue[ne], ue[j]); I.push(F), z = z.concat(F); } for (let X = 0; X < y; X++) { const ie = X / y, ue = f * Math.cos(ie * Math.PI / 2), $ = p * Math.sin(ie * Math.PI / 2) + m; for (let J = 0, ne = k.length; J < ne; J++) { const j = P(k[J], D[J], $); V(j.x, j.y, -ue); } for (let J = 0, ne = L.length; J < ne; J++) { const j = L[J]; F = I[J]; for (let q = 0, ge = j.length; q < ge; q++) { const ye = P(j[q], F[q], $); V(ye.x, ye.y, -ue); } } } const U = p + m; for (let X = 0; X < R; X++) { const ie = h ? P(C[X], z[X], U) : C[X]; w ? (b.copy(S.normals[0]).multiplyScalar(ie.x), _.copy(S.binormals[0]).multiplyScalar(ie.y), T.copy(x[0]).add(b).add(_), V(T.x, T.y, T.z)) : V(ie.x, ie.y, 0); } for (let X = 1; X <= u; X++) for (let ie = 0; ie < R; ie++) { const ue = h ? P(C[ie], z[ie], U) : C[ie]; w ? (b.copy(S.normals[X]).multiplyScalar(ue.x), _.copy(S.binormals[X]).multiplyScalar(ue.y), T.copy(x[X]).add(b).add(_), V(T.x, T.y, T.z)) : V(ue.x, ue.y, d / u * X); } for (let X = y - 1; X >= 0; X--) { const ie = X / y, ue = f * Math.cos(ie * Math.PI / 2), $ = p * Math.sin(ie * Math.PI / 2) + m; for (let J = 0, ne = k.length; J < ne; J++) { const j = P(k[J], D[J], $); V(j.x, j.y, d + ue); } for (let J = 0, ne = L.length; J < ne; J++) { const j = L[J]; F = I[J]; for (let q = 0, ge = j.length; q < ge; q++) { const ye = P(j[q], F[q], $); w ? V(ye.x, ye.y + x[u - 1].y, x[u - 1].x + ue) : V(ye.x, ye.y, d + ue); } } } Z(), re(); function Z() { const X = n.length / 3; if (h) { let ie = 0, ue = R * ie; for (let $ = 0; $ < M; $++) { const J = A[$]; H(J[2] + ue, J[1] + ue, J[0] + ue); } ie = u + y * 2, ue = R * ie; for (let $ = 0; $ < M; $++) { const J = A[$]; H(J[0] + ue, J[1] + ue, J[2] + ue); } } else { for (let ie = 0; ie < M; ie++) { const ue = A[ie]; H(ue[2], ue[1], ue[0]); } for (let ie = 0; ie < M; ie++) { const ue = A[ie]; H(ue[0] + R * u, ue[1] + R * u, ue[2] + R * u); } } i.addGroup(X, n.length / 3 - X, 0); } function re() { const X = n.length / 3; let ie = 0; K(k, ie), ie += k.length; for (let ue = 0, $ = L.length; ue < $; ue++) { const J = L[ue]; K(J, ie), ie += J.length; } i.addGroup(X, n.length / 3 - X, 1); } function K(X, ie) { let ue = X.length; for (; --ue >= 0; ) { const $ = ue; let J = ue - 1; J < 0 && (J = X.length - 1); for (let ne = 0, j = u + y * 2; ne < j; ne++) { const q = R * ne, ge = R * (ne + 1), ye = ie + $ + q, _e = ie + J + q, Me = ie + J + ge, Ce = ie + $ + ge; G(ye, _e, Me, Ce); } } } function V(X, ie, ue) { c.push(X), c.push(ie), c.push(ue); } function H(X, ie, ue) { W(X), W(ie), W(ue); const $ = n.length / 3, J = v.generateTopUV(i, n, $ - 3, $ - 2, $ - 1); Y(J[0]), Y(J[1]), Y(J[2]); } function G(X, ie, ue, $) { W(X), W(ie), W($), W(ie), W(ue), W($); const J = n.length / 3, ne = v.generateSideWallUV(i, n, J - 6, J - 3, J - 2, J - 1); Y(ne[0]), Y(ne[1]), Y(ne[3]), Y(ne[1]), Y(ne[2]), Y(ne[3]); } function W(X) { n.push(c[X * 3 + 0]), n.push(c[X * 3 + 1]), n.push(c[X * 3 + 2]); } function Y(X) { a.push(X.x), a.push(X.y); } } } toJSON() { const e = super.toJSON(), r = this.parameters.shapes, i = this.parameters.options; return Lde(r, i, e); } static fromJSON(e, r) { const i = []; for (let a = 0, o = e.shapes.length; a < o; a++) { const s = r[e.shapes[a]]; i.push(s); } const n = e.options.extrudePath; return n !== void 0 && (e.options.extrudePath = new Jx[n.type]().fromJSON(n)), new qn(i, e.options); } } const Ade = { generateTopUV: function(t, e, r, i, n) { const a = e[r * 3], o = e[r * 3 + 1], s = e[i * 3], c = e[i * 3 + 1], l = e[n * 3], u = e[n * 3 + 1]; return [ new je(a, o), new je(s, c), new je(l, u) ]; }, generateSideWallUV: function(t, e, r, i, n, a) { const o = e[r * 3], s = e[r * 3 + 1], c = e[r * 3 + 2], l = e[i * 3], u = e[i * 3 + 1], d = e[i * 3 + 2], h = e[n * 3], f = e[n * 3 + 1], p = e[n * 3 + 2], m = e[a * 3], y = e[a * 3 + 1], g = e[a * 3 + 2]; return Math.abs(s - u) < Math.abs(o - l) ? [ new je(o, 1 - c), new je(l, 1 - d), new je(h, 1 - p), new je(m, 1 - g) ] : [ new je(s, 1 - c), new je(u, 1 - d), new je(f, 1 - p), new je(y, 1 - g) ]; } }; function Lde(t, e, r) { if (r.shapes = [], Array.isArray(t)) for (let i = 0, n = t.length; i < n; i++) { const a = t[i]; r.shapes.push(a.uuid); } else r.shapes.push(t.uuid); return e.extrudePath !== void 0 && (r.options.extrudePath = e.extrudePath.toJSON()), r; } class _u extends _a { constructor(e = 1, r = 0) { const i = (1 + Math.sqrt(5)) / 2, n = [ -1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, 0, 0, -1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, i, 0, -1, i, 0, 1, -i, 0, -1, -i, 0, 1 ], a = [ 0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1 ]; super(n, a, e, r), this.type = "IcosahedronGeometry", this.parameters = { radius: e, detail: r }; } static fromJSON(e) { return new _u(e.radius, e.detail); } } class Su extends ft { constructor(e, r = 12, i = 0, n = Math.PI * 2) { super(), this.type = "LatheGeometry", this.parameters = { points: e, segments: r, phiStart: i, phiLength: n }, r = Math.floor(r), n = ci(n, 0, Math.PI * 2); const a = [], o = [], s = [], c = 1 / r, l = new de(), u = new je(); for (let d = 0; d <= r; d++) { const h = i + d * c * n, f = Math.sin(h), p = Math.cos(h); for (let m = 0; m <= e.length - 1; m++) l.x = e[m].x * f, l.y = e[m].y, l.z = e[m].x * p, o.push(l.x, l.y, l.z), u.x = d / r, u.y = m / (e.length - 1), s.push(u.x, u.y); } for (let d = 0; d < r; d++) for (let h = 0; h < e.length - 1; h++) { const f = h + d * e.length, p = f, m = f + e.length, y = f + e.length + 1, g = f + 1; a.push(p, m, g), a.push(m, y, g); } if (this.setIndex(a), this.setAttribute("position", new it(o, 3)), this.setAttribute("uv", new it(s, 2)), this.computeVertexNormals(), n === Math.PI * 2) { const d = this.attributes.normal.array, h = new de(), f = new de(), p = new de(), m = r * e.length * 3; for (let y = 0, g = 0; y < e.length; y++, g += 3) h.x = d[g + 0], h.y = d[g + 1], h.z = d[g + 2], f.x = d[m + g + 0], f.y = d[m + g + 1], f.z = d[m + g + 2], p.addVectors(h, f).normalize(), d[g + 0] = d[m + g + 0] = p.x, d[g + 1] = d[m + g + 1] = p.y, d[g + 2] = d[m + g + 2] = p.z; } } static fromJSON(e) { return new Su(e.points, e.segments, e.phiStart, e.phiLength); } } class Rl extends _a { constructor(e = 1, r = 0) { const i = [ 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1 ], n = [ 0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2 ]; super(i, n, e, r), this.type = "OctahedronGeometry", this.parameters = { radius: e, detail: r }; } static fromJSON(e) { return new Rl(e.radius, e.detail); } } class rg extends ft { constructor(e, r, i) { super(), this.type = "ParametricGeometry", this.parameters = { func: e, slices: r, stacks: i }; const n = [], a = [], o = [], s = [], c = 1e-5, l = new de(), u = new de(), d = new de(), h = new de(), f = new de(); e.length < 3 && console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter."); const p = r + 1; for (let m = 0; m <= i; m++) { const y = m / i; for (let g = 0; g <= r; g++) { const v = g / r; e(v, y, u), a.push(u.x, u.y, u.z), v - c >= 0 ? (e(v - c, y, d), h.subVectors(u, d)) : (e(v + c, y, d), h.subVectors(d, u)), y - c >= 0 ? (e(v, y - c, d), f.subVectors(u, d)) : (e(v, y + c, d), f.subVectors(d, u)), l.crossVectors(h, f).normalize(), o.push(l.x, l.y, l.z), s.push(v, y); } } for (let m = 0; m < i; m++) for (let y = 0; y < r; y++) { const g = m * p + y, v = m * p + y + 1, x = (m + 1) * p + y + 1, w = (m + 1) * p + y; n.push(g, v, w), n.push(v, x, w); } this.setIndex(n), this.setAttribute("position", new it(a, 3)), this.setAttribute("normal", new it(o, 3)), this.setAttribute("uv", new it(s, 2)); } } class Mu extends ft { constructor(e = 0.5, r = 1, i = 8, n = 1, a = 0, o = Math.PI * 2) { super(), this.type = "RingGeometry", this.parameters = { innerRadius: e, outerRadius: r, thetaSegments: i, phiSegments: n, thetaStart: a, thetaLength: o }, i = Math.max(3, i), n = Math.max(1, n); const s = [], c = [], l = [], u = []; let d = e; const h = (r - e) / n, f = new de(), p = new je(); for (let m = 0; m <= n; m++) { for (let y = 0; y <= i; y++) { const g = a + y / i * o; f.x = d * Math.cos(g), f.y = d * Math.sin(g), c.push(f.x, f.y, f.z), l.push(0, 0, 1), p.x = (f.x / r + 1) / 2, p.y = (f.y / r + 1) / 2, u.push(p.x, p.y); } d += h; } for (let m = 0; m < n; m++) { const y = m * (i + 1); for (let g = 0; g < i; g++) { const v = g + y, x = v, w = v + i + 1, S = v + i + 2, _ = v + 1; s.push(x, w, _), s.push(w, S, _); } } this.setIndex(s), this.setAttribute("position", new it(c, 3)), this.setAttribute("normal", new it(l, 3)), this.setAttribute("uv", new it(u, 2)); } static fromJSON(e) { return new Mu(e.innerRadius, e.outerRadius, e.thetaSegments, e.phiSegments, e.thetaStart, e.thetaLength); } } class Ol extends ft { constructor(e, r = 12) { super(), this.type = "ShapeGeometry", this.parameters = { shapes: e, curveSegments: r }; const i = [], n = [], a = [], o = []; let s = 0, c = 0; if (Array.isArray(e) === !1) l(e); else for (let u = 0; u < e.length; u++) l(e[u]), this.addGroup(s, c, u), s += c, c = 0; this.setIndex(i), this.setAttribute("position", new it(n, 3)), this.setAttribute("normal", new it(a, 3)), this.setAttribute("uv", new it(o, 2)); function l(u) { const d = n.length / 3, h = u.extractPoints(r); let f = h.shape; const p = h.holes; ma.isClockWise(f) === !1 && (f = f.reverse()); for (let y = 0, g = p.length; y < g; y++) { const v = p[y]; ma.isClockWise(v) === !0 && (p[y] = v.reverse()); } const m = ma.triangulateShape(f, p); for (let y = 0, g = p.length; y < g; y++) { const v = p[y]; f = f.concat(v); } for (let y = 0, g = f.length; y < g; y++) { const v = f[y]; n.push(v.x, v.y, 0), a.push(0, 0, 1), o.push(v.x, v.y); } for (let y = 0, g = m.length; y < g; y++) { const v = m[y], x = v[0] + d, w = v[1] + d, S = v[2] + d; i.push(x, w, S), c += 3; } } } toJSON() { const e = super.toJSON(), r = this.parameters.shapes; return kde(r, e); } static fromJSON(e, r) { const i = []; for (let n = 0, a = e.shapes.length; n < a; n++) { const o = r[e.shapes[n]]; i.push(o); } return new Ol(i, e.curveSegments); } } function kde(t, e) { if (e.shapes = [], Array.isArray(t)) for (let r = 0, i = t.length; r < i; r++) { const n = t[r]; e.shapes.push(n.uuid); } else e.shapes.push(t.uuid); return e; } class Dl extends ft { constructor(e = 1, r = 8, i = 6, n = 0, a = Math.PI * 2, o = 0, s = Math.PI) { super(), this.type = "SphereGeometry", this.parameters = { radius: e, widthSegments: r, heightSegments: i, phiStart: n, phiLength: a, thetaStart: o, thetaLength: s }, r = Math.max(3, Math.floor(r)), i = Math.max(2, Math.floor(i)); const c = Math.min(o + s, Math.PI); let l = 0; const u = [], d = new de(), h = new de(), f = [], p = [], m = [], y = []; for (let g = 0; g <= i; g++) { const v = [], x = g / i; let w = 0; g == 0 && o == 0 ? w = 0.5 / r : g == i && c == Math.PI && (w = -0.5 / r); for (let S = 0; S <= r; S++) { const _ = S / r; d.x = -e * Math.cos(n + _ * a) * Math.sin(o + x * s), d.y = e * Math.cos(o + x * s), d.z = e * Math.sin(n + _ * a) * Math.sin(o + x * s), p.push(d.x, d.y, d.z), h.copy(d).normalize(), m.push(h.x, h.y, h.z), y.push(_ + w, 1 - x), v.push(l++); } u.push(v); } for (let g = 0; g < i; g++) for (let v = 0; v < r; v++) { const x = u[g][v + 1], w = u[g][v], S = u[g + 1][v], _ = u[g + 1][v + 1]; (g !== 0 || o > 0) && f.push(x, w, _), (g !== i - 1 || c < Math.PI) && f.push(w, S, _); } this.setIndex(f), this.setAttribute("position", new it(p, 3)), this.setAttribute("normal", new it(m, 3)), this.setAttribute("uv", new it(y, 2)); } static fromJSON(e) { return new Dl(e.radius, e.widthSegments, e.heightSegments, e.phiStart, e.phiLength, e.thetaStart, e.thetaLength); } } class Eu extends _a { constructor(e = 1, r = 0) { const i = [ 1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1 ], n = [ 2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1 ]; super(i, n, e, r), this.type = "TetrahedronGeometry", this.parameters = { radius: e, detail: r }; } static fromJSON(e) { return new Eu(e.radius, e.detail); } } class ig extends qn { constructor(e, r = {}) { const i = r.font; if (!(i && i.isFont)) return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."), new ft(); const n = i.generateShapes(e, r.size); r.depth = r.height !== void 0 ? r.height : 50, r.bevelThickness === void 0 && (r.bevelThickness = 10), r.bevelSize === void 0 && (r.bevelSize = 8), r.bevelEnabled === void 0 && (r.bevelEnabled = !1), super(n, r), this.type = "TextGeometry"; } } class Tu extends ft { constructor(e = 1, r = 0.4, i = 8, n = 6, a = Math.PI * 2) { super(), this.type = "TorusGeometry", this.parameters = { radius: e, tube: r, radialSegments: i, tubularSegments: n, arc: a }, i = Math.floor(i), n = Math.floor(n); const o = [], s = [], c = [], l = [], u = new de(), d = new de(), h = new de(); for (let f = 0; f <= i; f++) for (let p = 0; p <= n; p++) { const m = p / n * a, y = f / i * Math.PI * 2; d.x = (e + r * Math.cos(y)) * Math.cos(m), d.y = (e + r * Math.cos(y)) * Math.sin(m), d.z = r * Math.sin(y), s.push(d.x, d.y, d.z), u.x = e * Math.cos(m), u.y = e * Math.sin(m), h.subVectors(d, u).normalize(), c.push(h.x, h.y, h.z), l.push(p / n), l.push(f / i); } for (let f = 1; f <= i; f++) for (let p = 1; p <= n; p++) { const m = (n + 1) * f + p - 1, y = (n + 1) * (f - 1) + p - 1, g = (n + 1) * (f - 1) + p, v = (n + 1) * f + p; o.push(m, y, v), o.push(y, g, v); } this.setIndex(o), this.setAttribute("position", new it(s, 3)), this.setAttribute("normal", new it(c, 3)), this.setAttribute("uv", new it(l, 2)); } static fromJSON(e) { return new Tu(e.radius, e.tube, e.radialSegments, e.tubularSegments, e.arc); } } class Cu extends ft { constructor(e = 1, r = 0.4, i = 64, n = 8, a = 2, o = 3) { super(), this.type = "TorusKnotGeometry", this.parameters = { radius: e, tube: r, tubularSegments: i, radialSegments: n, p: a, q: o }, i = Math.floor(i), n = Math.floor(n); const s = [], c = [], l = [], u = [], d = new de(), h = new de(), f = new de(), p = new de(), m = new de(), y = new de(), g = new de(); for (let x = 0; x <= i; ++x) { const w = x / i * a * Math.PI * 2; v(w, a, o, e, f), v(w + 0.01, a, o, e, p), y.subVectors(p, f), g.addVectors(p, f), m.crossVectors(y, g), g.crossVectors(m, y), m.normalize(), g.normalize(); for (let S = 0; S <= n; ++S) { const _ = S / n * Math.PI * 2, b = -r * Math.cos(_), T = r * Math.sin(_); d.x = f.x + (b * g.x + T * m.x), d.y = f.y + (b * g.y + T * m.y), d.z = f.z + (b * g.z + T * m.z), c.push(d.x, d.y, d.z), h.subVectors(d, f).normalize(), l.push(h.x, h.y, h.z), u.push(x / i), u.push(S / n); } } for (let x = 1; x <= i; x++) for (let w = 1; w <= n; w++) { const S = (n + 1) * (x - 1) + (w - 1), _ = (n + 1) * x + (w - 1), b = (n + 1) * x + w, T = (n + 1) * (x - 1) + w; s.push(S, _, T), s.push(_, b, T); } this.setIndex(s), this.setAttribute("position", new it(c, 3)), this.setAttribute("normal", new it(l, 3)), this.setAttribute("uv", new it(u, 2)); function v(x, w, S, _, b) { const T = Math.cos(x), E = Math.sin(x), C = S / w * x, L = Math.cos(C); b.x = _ * (2 + L) * 0.5 * T, b.y = _ * (2 + L) * E * 0.5, b.z = _ * Math.sin(C) * 0.5; } } static fromJSON(e) { return new Cu(e.radius, e.tube, e.tubularSegments, e.radialSegments, e.p, e.q); } } class Au extends ft { constructor(e, r = 64, i = 1, n = 8, a = !1) { super(), this.type = "TubeGeometry", this.parameters = { path: e, tubularSegments: r, radius: i, radialSegments: n, closed: a }; const o = e.computeFrenetFrames(r, a); this.tangents = o.tangents, this.normals = o.normals, this.binormals = o.binormals; const s = new de(), c = new de(), l = new je(); let u = new de(); const d = [], h = [], f = [], p = []; m(), this.setIndex(p), this.setAttribute("position", new it(d, 3)), this.setAttribute("normal", new it(h, 3)), this.setAttribute("uv", new it(f, 2)); function m() { for (let x = 0; x < r; x++) y(x); y(a === !1 ? r : 0), v(), g(); } function y(x) { u = e.getPointAt(x / r, u); const w = o.normals[x], S = o.binormals[x]; for (let _ = 0; _ <= n; _++) { const b = _ / n * Math.PI * 2, T = Math.sin(b), E = -Math.cos(b); c.x = E * w.x + T * S.x, c.y = E * w.y + T * S.y, c.z = E * w.z + T * S.z, c.normalize(), h.push(c.x, c.y, c.z), s.x = u.x + i * c.x, s.y = u.y + i * c.y, s.z = u.z + i * c.z, d.push(s.x, s.y, s.z); } } function g() { for (let x = 1; x <= r; x++) for (let w = 1; w <= n; w++) { const S = (n + 1) * (x - 1) + (w - 1), _ = (n + 1) * x + (w - 1), b = (n + 1) * x + w, T = (n + 1) * (x - 1) + w; p.push(S, _, T), p.push(_, b, T); } } function v() { for (let x = 0; x <= r; x++) for (let w = 0; w <= n; w++) l.x = x / r, l.y = w / n, f.push(l.x, l.y); } } toJSON() { const e = super.toJSON(); return e.path = this.parameters.path.toJSON(), e; } static fromJSON(e) { return new Au( new Jx[e.path.type]().fromJSON(e.path), e.tubularSegments, e.radius, e.radialSegments, e.closed ); } } class Qx extends ft { constructor(e) { if (super(), this.type = "WireframeGeometry", e.isGeometry === !0) { console.error("THREE.WireframeGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); return; } const r = [], i = [0, 0], n = {}, a = new de(); if (e.index !== null) { const o = e.attributes.position, s = e.index; let c = e.groups; c.length === 0 && (c = [{ start: 0, count: s.count, materialIndex: 0 }]); for (let l = 0, u = c.length; l < u; ++l) { const d = c[l], h = d.start, f = d.count; for (let p = h, m = h + f; p < m; p += 3) for (let y = 0; y < 3; y++) { const g = s.getX(p + y), v = s.getX(p + (y + 1) % 3); i[0] = Math.min(g, v), i[1] = Math.max(g, v); const x = i[0] + "," + i[1]; n[x] === void 0 && (n[x] = { index1: i[0], index2: i[1] }); } } for (const l in n) { const u = n[l]; a.fromBufferAttribute(o, u.index1), r.push(a.x, a.y, a.z), a.fromBufferAttribute(o, u.index2), r.push(a.x, a.y, a.z); } } else { const o = e.attributes.position; for (let s = 0, c = o.count / 3; s < c; s++) for (let l = 0; l < 3; l++) { const u = 3 * s + l; a.fromBufferAttribute(o, u), r.push(a.x, a.y, a.z); const d = 3 * s + (l + 1) % 3; a.fromBufferAttribute(o, d), r.push(a.x, a.y, a.z); } } this.setAttribute("position", new it(r, 3)); } } var AE = /* @__PURE__ */ Object.freeze({ __proto__: null, BoxGeometry: oo, BoxBufferGeometry: oo, CircleGeometry: bu, CircleBufferGeometry: bu, ConeGeometry: xu, ConeBufferGeometry: xu, CylinderGeometry: Ss, CylinderBufferGeometry: Ss, DodecahedronGeometry: wu, DodecahedronBufferGeometry: wu, EdgesGeometry: Wx, ExtrudeGeometry: qn, ExtrudeBufferGeometry: qn, IcosahedronGeometry: _u, IcosahedronBufferGeometry: _u, LatheGeometry: Su, LatheBufferGeometry: Su, OctahedronGeometry: Rl, OctahedronBufferGeometry: Rl, ParametricGeometry: rg, ParametricBufferGeometry: rg, PlaneGeometry: Pl, PlaneBufferGeometry: Pl, PolyhedronGeometry: _a, PolyhedronBufferGeometry: _a, RingGeometry: Mu, RingBufferGeometry: Mu, ShapeGeometry: Ol, ShapeBufferGeometry: Ol, SphereGeometry: Dl, SphereBufferGeometry: Dl, TetrahedronGeometry: Eu, TetrahedronBufferGeometry: Eu, TextGeometry: ig, TextBufferGeometry: ig, TorusGeometry: Tu, TorusBufferGeometry: Tu, TorusKnotGeometry: Cu, TorusKnotBufferGeometry: Cu, TubeGeometry: Au, TubeBufferGeometry: Au, WireframeGeometry: Qx }); class ew extends jr { constructor(e) { super(), this.type = "ShadowMaterial", this.color = new Je(0), this.transparent = !0, this.setValues(e); } copy(e) { return super.copy(e), this.color.copy(e.color), this; } } ew.prototype.isShadowMaterial = !0; class nd extends so { constructor(e) { super(e), this.type = "RawShaderMaterial"; } } nd.prototype.isRawShaderMaterial = !0; class Xl extends jr { constructor(e) { super(), this.defines = { STANDARD: "" }, this.type = "MeshStandardMaterial", this.color = new Je(16777215), this.roughness = 1, this.metalness = 0, this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new Je(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Rs, this.normalScale = new je(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.roughnessMap = null, this.metalnessMap = null, this.alphaMap = null, this.envMap = null, this.envMapIntensity = 1, this.refractionRatio = 0.98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.morphTargets = !1, this.morphNormals = !1, this.flatShading = !1, this.vertexTangents = !1, this.setValues(e); } copy(e) { return super.copy(e), this.defines = { STANDARD: "" }, this.color.copy(e.color), this.roughness = e.roughness, this.metalness = e.metalness, this.map = e.map, this.lightMap = e.lightMap, this.lightMapIntensity = e.lightMapIntensity, this.aoMap = e.aoMap, this.aoMapIntensity = e.aoMapIntensity, this.emissive.copy(e.emissive), this.emissiveMap = e.emissiveMap, this.emissiveIntensity = e.emissiveIntensity, this.bumpMap = e.bumpMap, this.bumpScale = e.bumpScale, this.normalMap = e.normalMap, this.normalMapType = e.normalMapType, this.normalScale.copy(e.normalScale), this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this.roughnessMap = e.roughnessMap, this.metalnessMap = e.metalnessMap, this.alphaMap = e.alphaMap, this.envMap = e.envMap, this.envMapIntensity = e.envMapIntensity, this.refractionRatio = e.refractionRatio, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.morphTargets = e.morphTargets, this.morphNormals = e.morphNormals, this.flatShading = e.flatShading, this.vertexTangents = e.vertexTangents, this; } } Xl.prototype.isMeshStandardMaterial = !0; class kp extends Xl { constructor(e) { super(), this.defines = { STANDARD: "", PHYSICAL: "" }, this.type = "MeshPhysicalMaterial", this.clearcoat = 0, this.clearcoatMap = null, this.clearcoatRoughness = 0, this.clearcoatRoughnessMap = null, this.clearcoatNormalScale = new je(1, 1), this.clearcoatNormalMap = null, this.reflectivity = 0.5, Object.defineProperty(this, "ior", { get: function() { return (1 + 0.4 * this.reflectivity) / (1 - 0.4 * this.reflectivity); }, set: function(r) { this.reflectivity = ci(2.5 * (r - 1) / (r + 1), 0, 1); } }), this.sheen = null, this.transmission = 0, this.transmissionMap = null, this.thickness = 0.01, this.thicknessMap = null, this.attenuationDistance = 0, this.attenuationColor = new Je(1, 1, 1), this.setValues(e); } copy(e) { return super.copy(e), this.defines = { STANDARD: "", PHYSICAL: "" }, this.clearcoat = e.clearcoat, this.clearcoatMap = e.clearcoatMap, this.clearcoatRoughness = e.clearcoatRoughness, this.clearcoatRoughnessMap = e.clearcoatRoughnessMap, this.clearcoatNormalMap = e.clearcoatNormalMap, this.clearcoatNormalScale.copy(e.clearcoatNormalScale), this.reflectivity = e.reflectivity, e.sheen ? this.sheen = (this.sheen || new Je()).copy(e.sheen) : this.sheen = null, this.transmission = e.transmission, this.transmissionMap = e.transmissionMap, this.thickness = e.thickness, this.thicknessMap = e.thicknessMap, this.attenuationDistance = e.attenuationDistance, this.attenuationColor.copy(e.attenuationColor), this; } } kp.prototype.isMeshPhysicalMaterial = !0; class tw extends jr { constructor(e) { super(), this.type = "MeshPhongMaterial", this.color = new Je(16777215), this.specular = new Je(1118481), this.shininess = 30, this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new Je(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Rs, this.normalScale = new je(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.combine = mp, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.morphTargets = !1, this.morphNormals = !1, this.flatShading = !1, this.setValues(e); } copy(e) { return super.copy(e), this.color.copy(e.color), this.specular.copy(e.specular), this.shininess = e.shininess, this.map = e.map, this.lightMap = e.lightMap, this.lightMapIntensity = e.lightMapIntensity, this.aoMap = e.aoMap, this.aoMapIntensity = e.aoMapIntensity, this.emissive.copy(e.emissive), this.emissiveMap = e.emissiveMap, this.emissiveIntensity = e.emissiveIntensity, this.bumpMap = e.bumpMap, this.bumpScale = e.bumpScale, this.normalMap = e.normalMap, this.normalMapType = e.normalMapType, this.normalScale.copy(e.normalScale), this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this.specularMap = e.specularMap, this.alphaMap = e.alphaMap, this.envMap = e.envMap, this.combine = e.combine, this.reflectivity = e.reflectivity, this.refractionRatio = e.refractionRatio, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.morphTargets = e.morphTargets, this.morphNormals = e.morphNormals, this.flatShading = e.flatShading, this; } } tw.prototype.isMeshPhongMaterial = !0; class rw extends jr { constructor(e) { super(), this.defines = { TOON: "" }, this.type = "MeshToonMaterial", this.color = new Je(16777215), this.map = null, this.gradientMap = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new Je(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Rs, this.normalScale = new je(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.alphaMap = null, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.morphTargets = !1, this.morphNormals = !1, this.setValues(e); } copy(e) { return super.copy(e), this.color.copy(e.color), this.map = e.map, this.gradientMap = e.gradientMap, this.lightMap = e.lightMap, this.lightMapIntensity = e.lightMapIntensity, this.aoMap = e.aoMap, this.aoMapIntensity = e.aoMapIntensity, this.emissive.copy(e.emissive), this.emissiveMap = e.emissiveMap, this.emissiveIntensity = e.emissiveIntensity, this.bumpMap = e.bumpMap, this.bumpScale = e.bumpScale, this.normalMap = e.normalMap, this.normalMapType = e.normalMapType, this.normalScale.copy(e.normalScale), this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this.alphaMap = e.alphaMap, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.morphTargets = e.morphTargets, this.morphNormals = e.morphNormals, this; } } rw.prototype.isMeshToonMaterial = !0; class iw extends jr { constructor(e) { super(), this.type = "MeshNormalMaterial", this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Rs, this.normalScale = new je(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.wireframe = !1, this.wireframeLinewidth = 1, this.fog = !1, this.morphTargets = !1, this.morphNormals = !1, this.flatShading = !1, this.setValues(e); } copy(e) { return super.copy(e), this.bumpMap = e.bumpMap, this.bumpScale = e.bumpScale, this.normalMap = e.normalMap, this.normalMapType = e.normalMapType, this.normalScale.copy(e.normalScale), this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.morphTargets = e.morphTargets, this.morphNormals = e.morphNormals, this.flatShading = e.flatShading, this; } } iw.prototype.isMeshNormalMaterial = !0; class nw extends jr { constructor(e) { super(), this.type = "MeshLambertMaterial", this.color = new Je(16777215), this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new Je(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.combine = mp, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.morphTargets = !1, this.morphNormals = !1, this.setValues(e); } copy(e) { return super.copy(e), this.color.copy(e.color), this.map = e.map, this.lightMap = e.lightMap, this.lightMapIntensity = e.lightMapIntensity, this.aoMap = e.aoMap, this.aoMapIntensity = e.aoMapIntensity, this.emissive.copy(e.emissive), this.emissiveMap = e.emissiveMap, this.emissiveIntensity = e.emissiveIntensity, this.specularMap = e.specularMap, this.alphaMap = e.alphaMap, this.envMap = e.envMap, this.combine = e.combine, this.reflectivity = e.reflectivity, this.refractionRatio = e.refractionRatio, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.morphTargets = e.morphTargets, this.morphNormals = e.morphNormals, this; } } nw.prototype.isMeshLambertMaterial = !0; class aw extends jr { constructor(e) { super(), this.defines = { MATCAP: "" }, this.type = "MeshMatcapMaterial", this.color = new Je(16777215), this.matcap = null, this.map = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = Rs, this.normalScale = new je(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.alphaMap = null, this.morphTargets = !1, this.morphNormals = !1, this.flatShading = !1, this.setValues(e); } copy(e) { return super.copy(e), this.defines = { MATCAP: "" }, this.color.copy(e.color), this.matcap = e.matcap, this.map = e.map, this.bumpMap = e.bumpMap, this.bumpScale = e.bumpScale, this.normalMap = e.normalMap, this.normalMapType = e.normalMapType, this.normalScale.copy(e.normalScale), this.displacementMap = e.displacementMap, this.displacementScale = e.displacementScale, this.displacementBias = e.displacementBias, this.alphaMap = e.alphaMap, this.morphTargets = e.morphTargets, this.morphNormals = e.morphNormals, this.flatShading = e.flatShading, this; } } aw.prototype.isMeshMatcapMaterial = !0; class ow extends Kr { constructor(e) { super(), this.type = "LineDashedMaterial", this.scale = 1, this.dashSize = 3, this.gapSize = 1, this.setValues(e); } copy(e) { return super.copy(e), this.scale = e.scale, this.dashSize = e.dashSize, this.gapSize = e.gapSize, this; } } ow.prototype.isLineDashedMaterial = !0; var Pde = /* @__PURE__ */ Object.freeze({ __proto__: null, ShadowMaterial: ew, SpriteMaterial: Sp, RawShaderMaterial: nd, ShaderMaterial: so, PointsMaterial: Ns, MeshPhysicalMaterial: kp, MeshStandardMaterial: Xl, MeshPhongMaterial: tw, MeshToonMaterial: rw, MeshNormalMaterial: iw, MeshLambertMaterial: nw, MeshDepthMaterial: pv, MeshDistanceMaterial: fv, MeshBasicMaterial: Hi, MeshMatcapMaterial: aw, LineDashedMaterial: ow, LineBasicMaterial: Kr, Material: jr }); const hr = { // same as Array.prototype.slice, but also works on typed arrays arraySlice: function(t, e, r) { return hr.isTypedArray(t) ? new t.constructor(t.subarray(e, r !== void 0 ? r : t.length)) : t.slice(e, r); }, // converts an array to a specific type convertArray: function(t, e, r) { return !t || // let 'undefined' and 'null' pass !r && t.constructor === e ? t : typeof e.BYTES_PER_ELEMENT == "number" ? new e(t) : Array.prototype.slice.call(t); }, isTypedArray: function(t) { return ArrayBuffer.isView(t) && !(t instanceof DataView); }, // returns an array by which times and values can be sorted getKeyframeOrder: function(t) { function e(n, a) { return t[n] - t[a]; } const r = t.length, i = new Array(r); for (let n = 0; n !== r; ++n) i[n] = n; return i.sort(e), i; }, // uses the array previously returned by 'getKeyframeOrder' to sort data sortedArray: function(t, e, r) { const i = t.length, n = new t.constructor(i); for (let a = 0, o = 0; o !== i; ++a) { const s = r[a] * e; for (let c = 0; c !== e; ++c) n[o++] = t[s + c]; } return n; }, // function for parsing AOS keyframe formats flattenJSON: function(t, e, r, i) { let n = 1, a = t[0]; for (; a !== void 0 && a[i] === void 0; ) a = t[n++]; if (a === void 0) return; let o = a[i]; if (o !== void 0) if (Array.isArray(o)) do o = a[i], o !== void 0 && (e.push(a.time), r.push.apply(r, o)), a = t[n++]; while (a !== void 0); else if (o.toArray !== void 0) do o = a[i], o !== void 0 && (e.push(a.time), o.toArray(r, r.length)), a = t[n++]; while (a !== void 0); else do o = a[i], o !== void 0 && (e.push(a.time), r.push(o)), a = t[n++]; while (a !== void 0); }, subclip: function(t, e, r, i, n = 30) { const a = t.clone(); a.name = e; const o = []; for (let c = 0; c < a.tracks.length; ++c) { const l = a.tracks[c], u = l.getValueSize(), d = [], h = []; for (let f = 0; f < l.times.length; ++f) { const p = l.times[f] * n; if (!(p < r || p >= i)) { d.push(l.times[f]); for (let m = 0; m < u; ++m) h.push(l.values[f * u + m]); } } d.length !== 0 && (l.times = hr.convertArray(d, l.times.constructor), l.values = hr.convertArray(h, l.values.constructor), o.push(l)); } a.tracks = o; let s = 1 / 0; for (let c = 0; c < a.tracks.length; ++c) s > a.tracks[c].times[0] && (s = a.tracks[c].times[0]); for (let c = 0; c < a.tracks.length; ++c) a.tracks[c].shift(-1 * s); return a.resetDuration(), a; }, makeClipAdditive: function(t, e = 0, r = t, i = 30) { i <= 0 && (i = 30); const n = r.tracks.length, a = e / i; for (let o = 0; o < n; ++o) { const s = r.tracks[o], c = s.ValueTypeName; if (c === "bool" || c === "string") continue; const l = t.tracks.find(function(g) { return g.name === s.name && g.ValueTypeName === c; }); if (l === void 0) continue; let u = 0; const d = s.getValueSize(); s.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline && (u = d / 3); let h = 0; const f = l.getValueSize(); l.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline && (h = f / 3); const p = s.times.length - 1; let m; if (a <= s.times[0]) { const g = u, v = d - u; m = hr.arraySlice(s.values, g, v); } else if (a >= s.times[p]) { const g = p * d + u, v = g + d - u; m = hr.arraySlice(s.values, g, v); } else { const g = s.createInterpolant(), v = u, x = d - u; g.evaluate(a), m = hr.arraySlice(g.resultBuffer, v, x); } c === "quaternion" && new vi().fromArray(m).normalize().conjugate().toArray(m); const y = l.times.length; for (let g = 0; g < y; ++g) { const v = g * f + h; if (c === "quaternion") vi.multiplyQuaternionsFlat( l.values, v, m, 0, l.values, v ); else { const x = f - h * 2; for (let w = 0; w < x; ++w) l.values[v + w] -= m[w]; } } } return t.blendMode = Ox, t; } }; class Sa { constructor(e, r, i, n) { this.parameterPositions = e, this._cachedIndex = 0, this.resultBuffer = n !== void 0 ? n : new r.constructor(i), this.sampleValues = r, this.valueSize = i, this.settings = null, this.DefaultSettings_ = {}; } evaluate(e) { const r = this.parameterPositions; let i = this._cachedIndex, n = r[i], a = r[i - 1]; e: { t: { let o; r: { i: if (!(e < n)) { for (let s = i + 2; ; ) { if (n === void 0) { if (e < a) break i; return i = r.length, this._cachedIndex = i, this.afterEnd_(i - 1, e, a); } if (i === s) break; if (a = n, n = r[++i], e < n) break t; } o = r.length; break r; } if (!(e >= a)) { const s = r[1]; e < s && (i = 2, a = s); for (let c = i - 2; ; ) { if (a === void 0) return this._cachedIndex = 0, this.beforeStart_(0, e, n); if (i === c) break; if (n = a, a = r[--i - 1], e >= a) break t; } o = i, i = 0; break r; } break e; } for (; i < o; ) { const s = i + o >>> 1; e < r[s] ? o = s : i = s + 1; } if (n = r[i], a = r[i - 1], a === void 0) return this._cachedIndex = 0, this.beforeStart_(0, e, n); if (n === void 0) return i = r.length, this._cachedIndex = i, this.afterEnd_(i - 1, a, e); } this._cachedIndex = i, this.intervalChanged_(i, a, n); } return this.interpolate_(i, a, e, n); } getSettings_() { return this.settings || this.DefaultSettings_; } copySampleValue_(e) { const r = this.resultBuffer, i = this.sampleValues, n = this.valueSize, a = e * n; for (let o = 0; o !== n; ++o) r[o] = i[a + o]; return r; } // Template methods for derived classes: interpolate_() { throw new Error("call to abstract method"); } intervalChanged_() { } } Sa.prototype.beforeStart_ = Sa.prototype.copySampleValue_; Sa.prototype.afterEnd_ = Sa.prototype.copySampleValue_; class hO extends Sa { constructor(e, r, i, n) { super(e, r, i, n), this._weightPrev = -0, this._offsetPrev = -0, this._weightNext = -0, this._offsetNext = -0, this.DefaultSettings_ = { endingStart: nl, endingEnd: nl }; } intervalChanged_(e, r, i) { const n = this.parameterPositions; let a = e - 2, o = e + 1, s = n[a], c = n[o]; if (s === void 0) switch (this.getSettings_().endingStart) { case al: a = e, s = 2 * r - i; break; case Oh: a = n.length - 2, s = r + n[a] - n[a + 1]; break; default: a = e, s = i; } if (c === void 0) switch (this.getSettings_().endingEnd) { case al: o = e, c = 2 * i - r; break; case Oh: o = 1, c = i + n[1] - n[0]; break; default: o = e - 1, c = r; } const l = (i - r) * 0.5, u = this.valueSize; this._weightPrev = l / (r - s), this._weightNext = l / (c - i), this._offsetPrev = a * u, this._offsetNext = o * u; } interpolate_(e, r, i, n) { const a = this.resultBuffer, o = this.sampleValues, s = this.valueSize, c = e * s, l = c - s, u = this._offsetPrev, d = this._offsetNext, h = this._weightPrev, f = this._weightNext, p = (i - r) / (n - r), m = p * p, y = m * p, g = -h * y + 2 * h * m - h * p, v = (1 + h) * y + (-1.5 - 2 * h) * m + (-0.5 + h) * p + 1, x = (-1 - f) * y + (1.5 + f) * m + 0.5 * p, w = f * y - f * m; for (let S = 0; S !== s; ++S) a[S] = g * o[u + S] + v * o[l + S] + x * o[c + S] + w * o[d + S]; return a; } } class sw extends Sa { constructor(e, r, i, n) { super(e, r, i, n); } interpolate_(e, r, i, n) { const a = this.resultBuffer, o = this.sampleValues, s = this.valueSize, c = e * s, l = c - s, u = (i - r) / (n - r), d = 1 - u; for (let h = 0; h !== s; ++h) a[h] = o[l + h] * d + o[c + h] * u; return a; } } class pO extends Sa { constructor(e, r, i, n) { super(e, r, i, n); } interpolate_(e) { return this.copySampleValue_(e - 1); } } class Qn { constructor(e, r, i, n) { if (e === void 0) throw new Error("THREE.KeyframeTrack: track name is undefined"); if (r === void 0 || r.length === 0) throw new Error("THREE.KeyframeTrack: no keyframes in track named " + e); this.name = e, this.times = hr.convertArray(r, this.TimeBufferType), this.values = hr.convertArray(i, this.ValueBufferType), this.setInterpolation(n || this.DefaultInterpolation); } // Serialization (in static context, because of constructor invocation // and automatic invocation of .toJSON): static toJSON(e) { const r = e.constructor; let i; if (r.toJSON !== this.toJSON) i = r.toJSON(e); else { i = { name: e.name, times: hr.convertArray(e.times, Array), values: hr.convertArray(e.values, Array) }; const n = e.getInterpolation(); n !== e.DefaultInterpolation && (i.interpolation = n); } return i.type = e.ValueTypeName, i; } InterpolantFactoryMethodDiscrete(e) { return new pO(this.times, this.values, this.getValueSize(), e); } InterpolantFactoryMethodLinear(e) { return new sw(this.times, this.values, this.getValueSize(), e); } InterpolantFactoryMethodSmooth(e) { return new hO(this.times, this.values, this.getValueSize(), e); } setInterpolation(e) { let r; switch (e) { case mu: r = this.InterpolantFactoryMethodDiscrete; break; case Ll: r = this.InterpolantFactoryMethodLinear; break; case xm: r = this.InterpolantFactoryMethodSmooth; break; } if (r === void 0) { const i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name; if (this.createInterpolant === void 0) if (e !== this.DefaultInterpolation) this.setInterpolation(this.DefaultInterpolation); else throw new Error(i); return console.warn("THREE.KeyframeTrack:", i), this; } return this.createInterpolant = r, this; } getInterpolation() { switch (this.createInterpolant) { case this.InterpolantFactoryMethodDiscrete: return mu; case this.InterpolantFactoryMethodLinear: return Ll; case this.InterpolantFactoryMethodSmooth: return xm; } } getValueSize() { return this.values.length / this.times.length; } // move all keyframes either forwards or backwards in time shift(e) { if (e !== 0) { const r = this.times; for (let i = 0, n = r.length; i !== n; ++i) r[i] += e; } return this; } // scale all keyframe times by a factor (useful for frame <-> seconds conversions) scale(e) { if (e !== 1) { const r = this.times; for (let i = 0, n = r.length; i !== n; ++i) r[i] *= e; } return this; } // removes keyframes before and after animation without changing any values within the range [startTime, endTime]. // IMPORTANT: We do not shift around keys to the start of the track time, because for interpolated keys this will change their values trim(e, r) { const i = this.times, n = i.length; let a = 0, o = n - 1; for (; a !== n && i[a] < e; ) ++a; for (; o !== -1 && i[o] > r; ) --o; if (++o, a !== 0 || o !== n) { a >= o && (o = Math.max(o, 1), a = o - 1); const s = this.getValueSize(); this.times = hr.arraySlice(i, a, o), this.values = hr.arraySlice(this.values, a * s, o * s); } return this; } // ensure we do not get a GarbageInGarbageOut situation, make sure tracks are at least minimally viable validate() { let e = !0; const r = this.getValueSize(); r - Math.floor(r) !== 0 && (console.error("THREE.KeyframeTrack: Invalid value size in track.", this), e = !1); const i = this.times, n = this.values, a = i.length; a === 0 && (console.error("THREE.KeyframeTrack: Track is empty.", this), e = !1); let o = null; for (let s = 0; s !== a; s++) { const c = i[s]; if (typeof c == "number" && isNaN(c)) { console.error("THREE.KeyframeTrack: Time is not a valid number.", this, s, c), e = !1; break; } if (o !== null && o > c) { console.error("THREE.KeyframeTrack: Out of order keys.", this, s, c, o), e = !1; break; } o = c; } if (n !== void 0 && hr.isTypedArray(n)) for (let s = 0, c = n.length; s !== c; ++s) { const l = n[s]; if (isNaN(l)) { console.error("THREE.KeyframeTrack: Value is not a valid number.", this, s, l), e = !1; break; } } return e; } // removes equivalent sequential keys as common in morph target sequences // (0,0,0,0,1,1,1,0,0,0,0,0,0,0) --> (0,0,1,1,0,0) optimize() { const e = hr.arraySlice(this.times), r = hr.arraySlice(this.values), i = this.getValueSize(), n = this.getInterpolation() === xm, a = e.length - 1; let o = 1; for (let s = 1; s < a; ++s) { let c = !1; const l = e[s], u = e[s + 1]; if (l !== u && (s !== 1 || l !== e[0])) if (n) c = !0; else { const d = s * i, h = d - i, f = d + i; for (let p = 0; p !== i; ++p) { const m = r[d + p]; if (m !== r[h + p] || m !== r[f + p]) { c = !0; break; } } } if (c) { if (s !== o) { e[o] = e[s]; const d = s * i, h = o * i; for (let f = 0; f !== i; ++f) r[h + f] = r[d + f]; } ++o; } } if (a > 0) { e[o] = e[a]; for (let s = a * i, c = o * i, l = 0; l !== i; ++l) r[c + l] = r[s + l]; ++o; } return o !== e.length ? (this.times = hr.arraySlice(e, 0, o), this.values = hr.arraySlice(r, 0, o * i)) : (this.times = e, this.values = r), this; } clone() { const e = hr.arraySlice(this.times, 0), r = hr.arraySlice(this.values, 0), i = this.constructor, n = new i(this.name, e, r); return n.createInterpolant = this.createInterpolant, n; } } Qn.prototype.TimeBufferType = Float32Array; Qn.prototype.ValueBufferType = Float32Array; Qn.prototype.DefaultInterpolation = Ll; class Zl extends Qn { } Zl.prototype.ValueTypeName = "bool"; Zl.prototype.ValueBufferType = Array; Zl.prototype.DefaultInterpolation = mu; Zl.prototype.InterpolantFactoryMethodLinear = void 0; Zl.prototype.InterpolantFactoryMethodSmooth = void 0; class lw extends Qn { } lw.prototype.ValueTypeName = "color"; class Lu extends Qn { } Lu.prototype.ValueTypeName = "number"; class fO extends Sa { constructor(e, r, i, n) { super(e, r, i, n); } interpolate_(e, r, i, n) { const a = this.resultBuffer, o = this.sampleValues, s = this.valueSize, c = (i - r) / (n - r); let l = e * s; for (let u = l + s; l !== u; l += 4) vi.slerpFlat(a, 0, o, l - s, o, l, c); return a; } } class Yl extends Qn { InterpolantFactoryMethodLinear(e) { return new fO(this.times, this.values, this.getValueSize(), e); } } Yl.prototype.ValueTypeName = "quaternion"; Yl.prototype.DefaultInterpolation = Ll; Yl.prototype.InterpolantFactoryMethodSmooth = void 0; class Kl extends Qn { } Kl.prototype.ValueTypeName = "string"; Kl.prototype.ValueBufferType = Array; Kl.prototype.DefaultInterpolation = mu; Kl.prototype.InterpolantFactoryMethodLinear = void 0; Kl.prototype.InterpolantFactoryMethodSmooth = void 0; class ku extends Qn { } ku.prototype.ValueTypeName = "vector"; class Pu { constructor(e, r = -1, i, n = ov) { this.name = e, this.tracks = i, this.duration = r, this.blendMode = n, this.uuid = ln(), this.duration < 0 && this.resetDuration(); } static parse(e) { const r = [], i = e.tracks, n = 1 / (e.fps || 1); for (let o = 0, s = i.length; o !== s; ++o) r.push(Ode(i[o]).scale(n)); const a = new this(e.name, e.duration, r, e.blendMode); return a.uuid = e.uuid, a; } static toJSON(e) { const r = [], i = e.tracks, n = { name: e.name, duration: e.duration, tracks: r, uuid: e.uuid, blendMode: e.blendMode }; for (let a = 0, o = i.length; a !== o; ++a) r.push(Qn.toJSON(i[a])); return n; } static CreateFromMorphTargetSequence(e, r, i, n) { const a = r.length, o = []; for (let s = 0; s < a; s++) { let c = [], l = []; c.push( (s + a - 1) % a, s, (s + 1) % a ), l.push(0, 1, 0); const u = hr.getKeyframeOrder(c); c = hr.sortedArray(c, 1, u), l = hr.sortedArray(l, 1, u), !n && c[0] === 0 && (c.push(a), l.push(l[0])), o.push( new Lu( ".morphTargetInfluences[" + r[s].name + "]", c, l ).scale(1 / i) ); } return new this(e, -1, o); } static findByName(e, r) { let i = e; if (!Array.isArray(e)) { const n = e; i = n.geometry && n.geometry.animations || n.animations; } for (let n = 0; n < i.length; n++) if (i[n].name === r) return i[n]; return null; } static CreateClipsFromMorphTargetSequences(e, r, i) { const n = {}, a = /^([\w-]*?)([\d]+)$/; for (let s = 0, c = e.length; s < c; s++) { const l = e[s], u = l.name.match(a); if (u && u.length > 1) { const d = u[1]; let h = n[d]; h || (n[d] = h = []), h.push(l); } } const o = []; for (const s in n) o.push(this.CreateFromMorphTargetSequence(s, n[s], r, i)); return o; } // parse the animation.hierarchy format static parseAnimation(e, r) { if (!e) return console.error("THREE.AnimationClip: No animation in JSONLoader data."), null; const i = function(u, d, h, f, p) { if (h.length !== 0) { const m = [], y = []; hr.flattenJSON(h, m, y, f), m.length !== 0 && p.push(new u(d, m, y)); } }, n = [], a = e.name || "default", o = e.fps || 30, s = e.blendMode; let c = e.length || -1; const l = e.hierarchy || []; for (let u = 0; u < l.length; u++) { const d = l[u].keys; if (!(!d || d.length === 0)) if (d[0].morphTargets) { const h = {}; let f; for (f = 0; f < d.length; f++) if (d[f].morphTargets) for (let p = 0; p < d[f].morphTargets.length; p++) h[d[f].morphTargets[p]] = -1; for (const p in h) { const m = [], y = []; for (let g = 0; g !== d[f].morphTargets.length; ++g) { const v = d[f]; m.push(v.time), y.push(v.morphTarget === p ? 1 : 0); } n.push(new Lu(".morphTargetInfluence[" + p + "]", m, y)); } c = h.length * (o || 1); } else { const h = ".bones[" + r[u].name + "]"; i( ku, h + ".position", d, "pos", n ), i( Yl, h + ".quaternion", d, "rot", n ), i( ku, h + ".scale", d, "scl", n ); } } return n.length === 0 ? null : new this(a, c, n, s); } resetDuration() { const e = this.tracks; let r = 0; for (let i = 0, n = e.length; i !== n; ++i) { const a = this.tracks[i]; r = Math.max(r, a.times[a.times.length - 1]); } return this.duration = r, this; } trim() { for (let e = 0; e < this.tracks.length; e++) this.tracks[e].trim(0, this.duration); return this; } validate() { let e = !0; for (let r = 0; r < this.tracks.length; r++) e = e && this.tracks[r].validate(); return e; } optimize() { for (let e = 0; e < this.tracks.length; e++) this.tracks[e].optimize(); return this; } clone() { const e = []; for (let r = 0; r < this.tracks.length; r++) e.push(this.tracks[r].clone()); return new this.constructor(this.name, this.duration, e, this.blendMode); } toJSON() { return this.constructor.toJSON(this); } } function Rde(t) { switch (t.toLowerCase()) { case "scalar": case "double": case "float": case "number": case "integer": return Lu; case "vector": case "vector2": case "vector3": case "vector4": return ku; case "color": return lw; case "quaternion": return Yl; case "bool": case "boolean": return Zl; case "string": return Kl; } throw new Error("THREE.KeyframeTrack: Unsupported typeName: " + t); } function Ode(t) { if (t.type === void 0) throw new Error("THREE.KeyframeTrack: track type undefined, can not parse"); const e = Rde(t.type); if (t.times === void 0) { const r = [], i = []; hr.flattenJSON(t.keys, r, i, "value"), t.times = r, t.values = i; } return e.parse !== void 0 ? e.parse(t) : new e(t.name, t.times, t.values, t.interpolation); } const Il = { enabled: !1, files: {}, add: function(t, e) { this.enabled !== !1 && (this.files[t] = e); }, get: function(t) { if (this.enabled !== !1) return this.files[t]; }, remove: function(t) { delete this.files[t]; }, clear: function() { this.files = {}; } }; class cw { constructor(e, r, i) { const n = this; let a = !1, o = 0, s = 0, c; const l = []; this.onStart = void 0, this.onLoad = e, this.onProgress = r, this.onError = i, this.itemStart = function(u) { s++, a === !1 && n.onStart !== void 0 && n.onStart(u, o, s), a = !0; }, this.itemEnd = function(u) { o++, n.onProgress !== void 0 && n.onProgress(u, o, s), o === s && (a = !1, n.onLoad !== void 0 && n.onLoad()); }, this.itemError = function(u) { n.onError !== void 0 && n.onError(u); }, this.resolveURL = function(u) { return c ? c(u) : u; }, this.setURLModifier = function(u) { return c = u, this; }, this.addHandler = function(u, d) { return l.push(u, d), this; }, this.removeHandler = function(u) { const d = l.indexOf(u); return d !== -1 && l.splice(d, 2), this; }, this.getHandler = function(u) { for (let d = 0, h = l.length; d < h; d += 2) { const f = l[d], p = l[d + 1]; if (f.global && (f.lastIndex = 0), f.test(u)) return p; } return null; }; } } const mO = new cw(); class xi { constructor(e) { this.manager = e !== void 0 ? e : mO, this.crossOrigin = "anonymous", this.withCredentials = !1, this.path = "", this.resourcePath = "", this.requestHeader = {}; } load() { } loadAsync(e, r) { const i = this; return new Promise(function(n, a) { i.load(e, n, r, a); }); } parse() { } setCrossOrigin(e) { return this.crossOrigin = e, this; } setWithCredentials(e) { return this.withCredentials = e, this; } setPath(e) { return this.path = e, this; } setResourcePath(e) { return this.resourcePath = e, this; } setRequestHeader(e) { return this.requestHeader = e, this; } } const In = {}; class dn extends xi { constructor(e) { super(e); } load(e, r, i, n) { e === void 0 && (e = ""), this.path !== void 0 && (e = this.path + e), e = this.manager.resolveURL(e); const a = this, o = Il.get(e); if (o !== void 0) return a.manager.itemStart(e), setTimeout(function() { r && r(o), a.manager.itemEnd(e); }, 0), o; if (In[e] !== void 0) { In[e].push({ onLoad: r, onProgress: i, onError: n }); return; } const s = /^data:(.*?)(;base64)?,(.*)$/, c = e.match(s); let l; if (c) { const u = c[1], d = !!c[2]; let h = c[3]; h = decodeURIComponent(h), d && (h = atob(h)); try { let f; const p = (this.responseType || "").toLowerCase(); switch (p) { case "arraybuffer": case "blob": const m = new Uint8Array(h.length); for (let y = 0; y < h.length; y++) m[y] = h.charCodeAt(y); p === "blob" ? f = new Blob([m.buffer], { type: u }) : f = m.buffer; break; case "document": f = new DOMParser().parseFromString(h, u); break; case "json": f = JSON.parse(h); break; default: f = h; break; } setTimeout(function() { r && r(f), a.manager.itemEnd(e); }, 0); } catch (f) { setTimeout(function() { n && n(f), a.manager.itemError(e), a.manager.itemEnd(e); }, 0); } } else { In[e] = [], In[e].push({ onLoad: r, onProgress: i, onError: n }), l = new XMLHttpRequest(), l.open("GET", e, !0), l.addEventListener("load", function(u) { const d = this.response, h = In[e]; if (delete In[e], this.status === 200 || this.status === 0) { this.status === 0 && console.warn("THREE.FileLoader: HTTP Status 0 received."), Il.add(e, d); for (let f = 0, p = h.length; f < p; f++) { const m = h[f]; m.onLoad && m.onLoad(d); } a.manager.itemEnd(e); } else { for (let f = 0, p = h.length; f < p; f++) { const m = h[f]; m.onError && m.onError(u); } a.manager.itemError(e), a.manager.itemEnd(e); } }, !1), l.addEventListener("progress", function(u) { const d = In[e]; for (let h = 0, f = d.length; h < f; h++) { const p = d[h]; p.onProgress && p.onProgress(u); } }, !1), l.addEventListener("error", function(u) { const d = In[e]; delete In[e]; for (let h = 0, f = d.length; h < f; h++) { const p = d[h]; p.onError && p.onError(u); } a.manager.itemError(e), a.manager.itemEnd(e); }, !1), l.addEventListener("abort", function(u) { const d = In[e]; delete In[e]; for (let h = 0, f = d.length; h < f; h++) { const p = d[h]; p.onError && p.onError(u); } a.manager.itemError(e), a.manager.itemEnd(e); }, !1), this.responseType !== void 0 && (l.responseType = this.responseType), this.withCredentials !== void 0 && (l.withCredentials = this.withCredentials), l.overrideMimeType && l.overrideMimeType(this.mimeType !== void 0 ? this.mimeType : "text/plain"); for (const u in this.requestHeader) l.setRequestHeader(u, this.requestHeader[u]); l.send(null); } return a.manager.itemStart(e), l; } setResponseType(e) { return this.responseType = e, this; } setMimeType(e) { return this.mimeType = e, this; } } class Dde extends xi { constructor(e) { super(e); } load(e, r, i, n) { const a = this, o = new dn(this.manager); o.setPath(this.path), o.setRequestHeader(this.requestHeader), o.setWithCredentials(this.withCredentials), o.load(e, function(s) { try { r(a.parse(JSON.parse(s))); } catch (c) { n ? n(c) : console.error(c), a.manager.itemError(e); } }, i, n); } parse(e) { const r = []; for (let i = 0; i < e.length; i++) { const n = Pu.parse(e[i]); r.push(n); } return r; } } class Ide extends xi { constructor(e) { super(e); } load(e, r, i, n) { const a = this, o = [], s = new Gx(), c = new dn(this.manager); c.setPath(this.path), c.setResponseType("arraybuffer"), c.setRequestHeader(this.requestHeader), c.setWithCredentials(a.withCredentials); let l = 0; function u(d) { c.load(e[d], function(h) { const f = a.parse(h, !0); o[d] = { width: f.width, height: f.height, format: f.format, mipmaps: f.mipmaps }, l += 1, l === 6 && (f.mipmapCount === 1 && (s.minFilter = Cr), s.image = o, s.format = f.format, s.needsUpdate = !0, r && r(s)); }, i, n); } if (Array.isArray(e)) for (let d = 0, h = e.length; d < h; ++d) u(d); else c.load(e, function(d) { const h = a.parse(d, !0); if (h.isCubemap) { const f = h.mipmaps.length / h.mipmapCount; for (let p = 0; p < f; p++) { o[p] = { mipmaps: [] }; for (let m = 0; m < h.mipmapCount; m++) o[p].mipmaps.push(h.mipmaps[p * h.mipmapCount + m]), o[p].format = h.format, o[p].width = h.width, o[p].height = h.height; } s.image = o; } else s.image.width = h.width, s.image.height = h.height, s.mipmaps = h.mipmaps; h.mipmapCount === 1 && (s.minFilter = Cr), s.format = h.format, s.needsUpdate = !0, r && r(s); }, i, n); return s; } } class Fh extends xi { constructor(e) { super(e); } load(e, r, i, n) { this.path !== void 0 && (e = this.path + e), e = this.manager.resolveURL(e); const a = this, o = Il.get(e); if (o !== void 0) return a.manager.itemStart(e), setTimeout(function() { r && r(o), a.manager.itemEnd(e); }, 0), o; const s = document.createElementNS("http://www.w3.org/1999/xhtml", "img"); function c() { s.removeEventListener("load", c, !1), s.removeEventListener("error", l, !1), Il.add(e, this), r && r(this), a.manager.itemEnd(e); } function l(u) { s.removeEventListener("load", c, !1), s.removeEventListener("error", l, !1), n && n(u), a.manager.itemError(e), a.manager.itemEnd(e); } return s.addEventListener("load", c, !1), s.addEventListener("error", l, !1), e.substr(0, 5) !== "data:" && this.crossOrigin !== void 0 && (s.crossOrigin = this.crossOrigin), a.manager.itemStart(e), s.src = e, s; } } class gO extends xi { constructor(e) { super(e); } load(e, r, i, n) { const a = new td(), o = new Fh(this.manager); o.setCrossOrigin(this.crossOrigin), o.setPath(this.path); let s = 0; function c(l) { o.load(e[l], function(u) { a.images[l] = u, s++, s === 6 && (a.needsUpdate = !0, r && r(a)); }, void 0, n); } for (let l = 0; l < e.length; ++l) c(l); return a; } } class vO extends xi { constructor(e) { super(e); } load(e, r, i, n) { const a = this, o = new ml(), s = new dn(this.manager); return s.setResponseType("arraybuffer"), s.setRequestHeader(this.requestHeader), s.setPath(this.path), s.setWithCredentials(a.withCredentials), s.load(e, function(c) { const l = a.parse(c); l && (l.image !== void 0 ? o.image = l.image : l.data !== void 0 && (o.image.width = l.width, o.image.height = l.height, o.image.data = l.data), o.wrapS = l.wrapS !== void 0 ? l.wrapS : ii, o.wrapT = l.wrapT !== void 0 ? l.wrapT : ii, o.magFilter = l.magFilter !== void 0 ? l.magFilter : Cr, o.minFilter = l.minFilter !== void 0 ? l.minFilter : Cr, o.anisotropy = l.anisotropy !== void 0 ? l.anisotropy : 1, l.encoding !== void 0 && (o.encoding = l.encoding), l.flipY !== void 0 && (o.flipY = l.flipY), l.format !== void 0 && (o.format = l.format), l.type !== void 0 && (o.type = l.type), l.mipmaps !== void 0 && (o.mipmaps = l.mipmaps, o.minFilter = wo), l.mipmapCount === 1 && (o.minFilter = Cr), l.generateMipmaps !== void 0 && (o.generateMipmaps = l.generateMipmaps), o.needsUpdate = !0, r && r(o, l)); }, i, n), o; } } class uw extends xi { constructor(e) { super(e); } load(e, r, i, n) { const a = new zr(), o = new Fh(this.manager); return o.setCrossOrigin(this.crossOrigin), o.setPath(this.path), o.load(e, function(s) { a.image = s; const c = e.search(/\.jpe?g($|\?)/i) > 0 || e.search(/^data\:image\/jpeg/) === 0; a.format = c ? Qa : sn, a.needsUpdate = !0, r !== void 0 && r(a); }, i, n), a; } } class yO extends un { constructor() { super(), this.type = "CurvePath", this.curves = [], this.autoClose = !1; } add(e) { this.curves.push(e); } closePath() { const e = this.curves[0].getPoint(0), r = this.curves[this.curves.length - 1].getPoint(1); e.equals(r) || this.curves.push(new Lp(r, e)); } // To get accurate point with reference to // entire path distance at time t, // following has to be done: // 1. Length of each sub path have to be known // 2. Locate and identify type of curve // 3. Get t for the curve // 4. Return curve.getPointAt(t') getPoint(e) { const r = e * this.getLength(), i = this.getCurveLengths(); let n = 0; for (; n < i.length; ) { if (i[n] >= r) { const a = i[n] - r, o = this.curves[n], s = o.getLength(), c = s === 0 ? 0 : 1 - a / s; return o.getPointAt(c); } n++; } return null; } // We cannot use the default THREE.Curve getPoint() with getLength() because in // THREE.Curve, getLength() depends on getPoint() but in THREE.CurvePath // getPoint() depends on getLength getLength() { const e = this.getCurveLengths(); return e[e.length - 1]; } // cacheLengths must be recalculated. updateArcLengths() { this.needsUpdate = !0, this.cacheLengths = null, this.getCurveLengths(); } // Compute lengths and cache them // We cannot overwrite getLengths() because UtoT mapping uses it. getCurveLengths() { if (this.cacheLengths && this.cacheLengths.length === this.curves.length) return this.cacheLengths; const e = []; let r = 0; for (let i = 0, n = this.curves.length; i < n; i++) r += this.curves[i].getLength(), e.push(r); return this.cacheLengths = e, e; } getSpacedPoints(e = 40) { const r = []; for (let i = 0; i <= e; i++) r.push(this.getPoint(i / e)); return this.autoClose && r.push(r[0]), r; } getPoints(e = 12) { const r = []; let i; for (let n = 0, a = this.curves; n < a.length; n++) { const o = a[n], s = o && o.isEllipseCurve ? e * 2 : o && (o.isLineCurve || o.isLineCurve3) ? 1 : o && o.isSplineCurve ? e * o.points.length : e, c = o.getPoints(s); for (let l = 0; l < c.length; l++) { const u = c[l]; i && i.equals(u) || (r.push(u), i = u); } } return this.autoClose && r.length > 1 && !r[r.length - 1].equals(r[0]) && r.push(r[0]), r; } copy(e) { super.copy(e), this.curves = []; for (let r = 0, i = e.curves.length; r < i; r++) { const n = e.curves[r]; this.curves.push(n.clone()); } return this.autoClose = e.autoClose, this; } toJSON() { const e = super.toJSON(); e.autoClose = this.autoClose, e.curves = []; for (let r = 0, i = this.curves.length; r < i; r++) { const n = this.curves[r]; e.curves.push(n.toJSON()); } return e; } fromJSON(e) { super.fromJSON(e), this.autoClose = e.autoClose, this.curves = []; for (let r = 0, i = e.curves.length; r < i; r++) { const n = e.curves[r]; this.curves.push(new Jx[n.type]().fromJSON(n)); } return this; } } class zh extends yO { constructor(e) { super(), this.type = "Path", this.currentPoint = new je(), e && this.setFromPoints(e); } setFromPoints(e) { this.moveTo(e[0].x, e[0].y); for (let r = 1, i = e.length; r < i; r++) this.lineTo(e[r].x, e[r].y); return this; } moveTo(e, r) { return this.currentPoint.set(e, r), this; } lineTo(e, r) { const i = new Lp(this.currentPoint.clone(), new je(e, r)); return this.curves.push(i), this.currentPoint.set(e, r), this; } quadraticCurveTo(e, r, i, n) { const a = new yv( this.currentPoint.clone(), new je(e, r), new je(i, n) ); return this.curves.push(a), this.currentPoint.set(i, n), this; } bezierCurveTo(e, r, i, n, a, o) { const s = new vv( this.currentPoint.clone(), new je(e, r), new je(i, n), new je(a, o) ); return this.curves.push(s), this.currentPoint.set(a, o), this; } splineThru(e) { const r = [this.currentPoint.clone()].concat(e), i = new bv(r); return this.curves.push(i), this.currentPoint.copy(e[e.length - 1]), this; } arc(e, r, i, n, a, o) { const s = this.currentPoint.x, c = this.currentPoint.y; return this.absarc( e + s, r + c, i, n, a, o ), this; } absarc(e, r, i, n, a, o) { return this.absellipse(e, r, i, i, n, a, o), this; } ellipse(e, r, i, n, a, o, s, c) { const l = this.currentPoint.x, u = this.currentPoint.y; return this.absellipse(e + l, r + u, i, n, a, o, s, c), this; } absellipse(e, r, i, n, a, o, s, c) { const l = new Ap(e, r, i, n, a, o, s, c); if (this.curves.length > 0) { const d = l.getPoint(0); d.equals(this.currentPoint) || this.lineTo(d.x, d.y); } this.curves.push(l); const u = l.getPoint(1); return this.currentPoint.copy(u), this; } copy(e) { return super.copy(e), this.currentPoint.copy(e.currentPoint), this; } toJSON() { const e = super.toJSON(); return e.currentPoint = this.currentPoint.toArray(), e; } fromJSON(e) { return super.fromJSON(e), this.currentPoint.fromArray(e.currentPoint), this; } } class os extends zh { constructor(e) { super(e), this.uuid = ln(), this.type = "Shape", this.holes = []; } getPointsHoles(e) { const r = []; for (let i = 0, n = this.holes.length; i < n; i++) r[i] = this.holes[i].getPoints(e); return r; } // get points of shape and holes (keypoints based on segments parameter) extractPoints(e) { return { shape: this.getPoints(e), holes: this.getPointsHoles(e) }; } copy(e) { super.copy(e), this.holes = []; for (let r = 0, i = e.holes.length; r < i; r++) { const n = e.holes[r]; this.holes.push(n.clone()); } return this; } toJSON() { const e = super.toJSON(); e.uuid = this.uuid, e.holes = []; for (let r = 0, i = this.holes.length; r < i; r++) { const n = this.holes[r]; e.holes.push(n.toJSON()); } return e; } fromJSON(e) { super.fromJSON(e), this.uuid = e.uuid, this.holes = []; for (let r = 0, i = e.holes.length; r < i; r++) { const n = e.holes[r]; this.holes.push(new zh().fromJSON(n)); } return this; } } class Xn extends It { constructor(e, r = 1) { super(), this.type = "Light", this.color = new Je(e), this.intensity = r; } dispose() { } copy(e) { return super.copy(e), this.color.copy(e.color), this.intensity = e.intensity, this; } toJSON(e) { const r = super.toJSON(e); return r.object.color = this.color.getHex(), r.object.intensity = this.intensity, this.groundColor !== void 0 && (r.object.groundColor = this.groundColor.getHex()), this.distance !== void 0 && (r.object.distance = this.distance), this.angle !== void 0 && (r.object.angle = this.angle), this.decay !== void 0 && (r.object.decay = this.decay), this.penumbra !== void 0 && (r.object.penumbra = this.penumbra), this.shadow !== void 0 && (r.object.shadow = this.shadow.toJSON()), r; } } Xn.prototype.isLight = !0; class dw extends Xn { constructor(e, r, i) { super(e, i), this.type = "HemisphereLight", this.position.copy(It.DefaultUp), this.updateMatrix(), this.groundColor = new Je(r); } copy(e) { return Xn.prototype.copy.call(this, e), this.groundColor.copy(e.groundColor), this; } } dw.prototype.isHemisphereLight = !0; const LE = /* @__PURE__ */ new at(), kE = /* @__PURE__ */ new de(), PE = /* @__PURE__ */ new de(); class hw { constructor(e) { this.camera = e, this.bias = 0, this.normalBias = 0, this.radius = 1, this.mapSize = new je(512, 512), this.map = null, this.mapPass = null, this.matrix = new at(), this.autoUpdate = !0, this.needsUpdate = !1, this._frustum = new xp(), this._frameExtents = new je(1, 1), this._viewportCount = 1, this._viewports = [ new Qt(0, 0, 1, 1) ]; } getViewportCount() { return this._viewportCount; } getFrustum() { return this._frustum; } updateMatrices(e) { const r = this.camera, i = this.matrix; kE.setFromMatrixPosition(e.matrixWorld), r.position.copy(kE), PE.setFromMatrixPosition(e.target.matrixWorld), r.lookAt(PE), r.updateMatrixWorld(), LE.multiplyMatrices(r.projectionMatrix, r.matrixWorldInverse), this._frustum.setFromProjectionMatrix(LE), i.set( 0.5, 0, 0, 0.5, 0, 0.5, 0, 0.5, 0, 0, 0.5, 0.5, 0, 0, 0, 1 ), i.multiply(r.projectionMatrix), i.multiply(r.matrixWorldInverse); } getViewport(e) { return this._viewports[e]; } getFrameExtents() { return this._frameExtents; } dispose() { this.map && this.map.dispose(), this.mapPass && this.mapPass.dispose(); } copy(e) { return this.camera = e.camera.clone(), this.bias = e.bias, this.radius = e.radius, this.mapSize.copy(e.mapSize), this; } clone() { return new this.constructor().copy(this); } toJSON() { const e = {}; return this.bias !== 0 && (e.bias = this.bias), this.normalBias !== 0 && (e.normalBias = this.normalBias), this.radius !== 1 && (e.radius = this.radius), (this.mapSize.x !== 512 || this.mapSize.y !== 512) && (e.mapSize = this.mapSize.toArray()), e.camera = this.camera.toJSON(!1).object, delete e.camera.matrix, e; } } class bO extends hw { constructor() { super(new Wr(50, 1, 0.5, 500)), this.focus = 1; } updateMatrices(e) { const r = this.camera, i = Dh * 2 * e.angle * this.focus, n = this.mapSize.width / this.mapSize.height, a = e.distance || r.far; (i !== r.fov || n !== r.aspect || a !== r.far) && (r.fov = i, r.aspect = n, r.far = a, r.updateProjectionMatrix()), super.updateMatrices(e); } copy(e) { return super.copy(e), this.focus = e.focus, this; } } bO.prototype.isSpotLightShadow = !0; class wv extends Xn { constructor(e, r, i = 0, n = Math.PI / 3, a = 0, o = 1) { super(e, r), this.type = "SpotLight", this.position.copy(It.DefaultUp), this.updateMatrix(), this.target = new It(), this.distance = i, this.angle = n, this.penumbra = a, this.decay = o, this.shadow = new bO(); } get power() { return this.intensity * Math.PI; } set power(e) { this.intensity = e / Math.PI; } dispose() { this.shadow.dispose(); } copy(e) { return super.copy(e), this.distance = e.distance, this.angle = e.angle, this.penumbra = e.penumbra, this.decay = e.decay, this.target = e.target.clone(), this.shadow = e.shadow.clone(), this; } } wv.prototype.isSpotLight = !0; const RE = /* @__PURE__ */ new at(), Ld = /* @__PURE__ */ new de(), H0 = /* @__PURE__ */ new de(); class xO extends hw { constructor() { super(new Wr(90, 1, 0.5, 500)), this._frameExtents = new je(4, 2), this._viewportCount = 6, this._viewports = [ // These viewports map a cube-map onto a 2D texture with the // following orientation: // // xzXZ // y Y // // X - Positive x direction // x - Negative x direction // Y - Positive y direction // y - Negative y direction // Z - Positive z direction // z - Negative z direction // positive X new Qt(2, 1, 1, 1), // negative X new Qt(0, 1, 1, 1), // positive Z new Qt(3, 1, 1, 1), // negative Z new Qt(1, 1, 1, 1), // positive Y new Qt(3, 0, 1, 1), // negative Y new Qt(1, 0, 1, 1) ], this._cubeDirections = [ new de(1, 0, 0), new de(-1, 0, 0), new de(0, 0, 1), new de(0, 0, -1), new de(0, 1, 0), new de(0, -1, 0) ], this._cubeUps = [ new de(0, 1, 0), new de(0, 1, 0), new de(0, 1, 0), new de(0, 1, 0), new de(0, 0, 1), new de(0, 0, -1) ]; } updateMatrices(e, r = 0) { const i = this.camera, n = this.matrix, a = e.distance || i.far; a !== i.far && (i.far = a, i.updateProjectionMatrix()), Ld.setFromMatrixPosition(e.matrixWorld), i.position.copy(Ld), H0.copy(i.position), H0.add(this._cubeDirections[r]), i.up.copy(this._cubeUps[r]), i.lookAt(H0), i.updateMatrixWorld(), n.makeTranslation(-Ld.x, -Ld.y, -Ld.z), RE.multiplyMatrices(i.projectionMatrix, i.matrixWorldInverse), this._frustum.setFromProjectionMatrix(RE); } } xO.prototype.isPointLightShadow = !0; class _v extends Xn { constructor(e, r, i = 0, n = 1) { super(e, r), this.type = "PointLight", this.distance = i, this.decay = n, this.shadow = new xO(); } get power() { return this.intensity * 4 * Math.PI; } set power(e) { this.intensity = e / (4 * Math.PI); } dispose() { this.shadow.dispose(); } copy(e) { return super.copy(e), this.distance = e.distance, this.decay = e.decay, this.shadow = e.shadow.clone(), this; } } _v.prototype.isPointLight = !0; class ad extends bp { constructor(e = -1, r = 1, i = 1, n = -1, a = 0.1, o = 2e3) { super(), this.type = "OrthographicCamera", this.zoom = 1, this.view = null, this.left = e, this.right = r, this.top = i, this.bottom = n, this.near = a, this.far = o, this.updateProjectionMatrix(); } copy(e, r) { return super.copy(e, r), this.left = e.left, this.right = e.right, this.top = e.top, this.bottom = e.bottom, this.near = e.near, this.far = e.far, this.zoom = e.zoom, this.view = e.view === null ? null : Object.assign({}, e.view), this; } setViewOffset(e, r, i, n, a, o) { this.view === null && (this.view = { enabled: !0, fullWidth: 1, fullHeight: 1, offsetX: 0, offsetY: 0, width: 1, height: 1 }), this.view.enabled = !0, this.view.fullWidth = e, this.view.fullHeight = r, this.view.offsetX = i, this.view.offsetY = n, this.view.width = a, this.view.height = o, this.updateProjectionMatrix(); } clearViewOffset() { this.view !== null && (this.view.enabled = !1), this.updateProjectionMatrix(); } updateProjectionMatrix() { const e = (this.right - this.left) / (2 * this.zoom), r = (this.top - this.bottom) / (2 * this.zoom), i = (this.right + this.left) / 2, n = (this.top + this.bottom) / 2; let a = i - e, o = i + e, s = n + r, c = n - r; if (this.view !== null && this.view.enabled) { const l = (this.right - this.left) / this.view.fullWidth / this.zoom, u = (this.top - this.bottom) / this.view.fullHeight / this.zoom; a += l * this.view.offsetX, o = a + l * this.view.width, s -= u * this.view.offsetY, c = s - u * this.view.height; } this.projectionMatrix.makeOrthographic(a, o, s, c, this.near, this.far), this.projectionMatrixInverse.copy(this.projectionMatrix).invert(); } toJSON(e) { const r = super.toJSON(e); return r.object.zoom = this.zoom, r.object.left = this.left, r.object.right = this.right, r.object.top = this.top, r.object.bottom = this.bottom, r.object.near = this.near, r.object.far = this.far, this.view !== null && (r.object.view = Object.assign({}, this.view)), r; } } ad.prototype.isOrthographicCamera = !0; class wO extends hw { constructor() { super(new ad(-5, 5, 5, -5, 0.5, 500)); } } wO.prototype.isDirectionalLightShadow = !0; class Sv extends Xn { constructor(e, r) { super(e, r), this.type = "DirectionalLight", this.position.copy(It.DefaultUp), this.updateMatrix(), this.target = new It(), this.shadow = new wO(); } dispose() { this.shadow.dispose(); } copy(e) { return super.copy(e), this.target = e.target.clone(), this.shadow = e.shadow.clone(), this; } } Sv.prototype.isDirectionalLight = !0; class pw extends Xn { constructor(e, r) { super(e, r), this.type = "AmbientLight"; } } pw.prototype.isAmbientLight = !0; class fw extends Xn { constructor(e, r, i = 10, n = 10) { super(e, r), this.type = "RectAreaLight", this.width = i, this.height = n; } copy(e) { return super.copy(e), this.width = e.width, this.height = e.height, this; } toJSON(e) { const r = super.toJSON(e); return r.object.width = this.width, r.object.height = this.height, r; } } fw.prototype.isRectAreaLight = !0; class mw { constructor() { this.coefficients = []; for (let e = 0; e < 9; e++) this.coefficients.push(new de()); } set(e) { for (let r = 0; r < 9; r++) this.coefficients[r].copy(e[r]); return this; } zero() { for (let e = 0; e < 9; e++) this.coefficients[e].set(0, 0, 0); return this; } // get the radiance in the direction of the normal // target is a Vector3 getAt(e, r) { const i = e.x, n = e.y, a = e.z, o = this.coefficients; return r.copy(o[0]).multiplyScalar(0.282095), r.addScaledVector(o[1], 0.488603 * n), r.addScaledVector(o[2], 0.488603 * a), r.addScaledVector(o[3], 0.488603 * i), r.addScaledVector(o[4], 1.092548 * (i * n)), r.addScaledVector(o[5], 1.092548 * (n * a)), r.addScaledVector(o[6], 0.315392 * (3 * a * a - 1)), r.addScaledVector(o[7], 1.092548 * (i * a)), r.addScaledVector(o[8], 0.546274 * (i * i - n * n)), r; } // get the irradiance (radiance convolved with cosine lobe) in the direction of the normal // target is a Vector3 // https://graphics.stanford.edu/papers/envmap/envmap.pdf getIrradianceAt(e, r) { const i = e.x, n = e.y, a = e.z, o = this.coefficients; return r.copy(o[0]).multiplyScalar(0.886227), r.addScaledVector(o[1], 2 * 0.511664 * n), r.addScaledVector(o[2], 2 * 0.511664 * a), r.addScaledVector(o[3], 2 * 0.511664 * i), r.addScaledVector(o[4], 2 * 0.429043 * i * n), r.addScaledVector(o[5], 2 * 0.429043 * n * a), r.addScaledVector(o[6], 0.743125 * a * a - 0.247708), r.addScaledVector(o[7], 2 * 0.429043 * i * a), r.addScaledVector(o[8], 0.429043 * (i * i - n * n)), r; } add(e) { for (let r = 0; r < 9; r++) this.coefficients[r].add(e.coefficients[r]); return this; } addScaledSH(e, r) { for (let i = 0; i < 9; i++) this.coefficients[i].addScaledVector(e.coefficients[i], r); return this; } scale(e) { for (let r = 0; r < 9; r++) this.coefficients[r].multiplyScalar(e); return this; } lerp(e, r) { for (let i = 0; i < 9; i++) this.coefficients[i].lerp(e.coefficients[i], r); return this; } equals(e) { for (let r = 0; r < 9; r++) if (!this.coefficients[r].equals(e.coefficients[r])) return !1; return !0; } copy(e) { return this.set(e.coefficients); } clone() { return new this.constructor().copy(this); } fromArray(e, r = 0) { const i = this.coefficients; for (let n = 0; n < 9; n++) i[n].fromArray(e, r + n * 3); return this; } toArray(e = [], r = 0) { const i = this.coefficients; for (let n = 0; n < 9; n++) i[n].toArray(e, r + n * 3); return e; } // evaluate the basis functions // shBasis is an Array[ 9 ] static getBasisAt(e, r) { const i = e.x, n = e.y, a = e.z; r[0] = 0.282095, r[1] = 0.488603 * n, r[2] = 0.488603 * a, r[3] = 0.488603 * i, r[4] = 1.092548 * i * n, r[5] = 1.092548 * n * a, r[6] = 0.315392 * (3 * a * a - 1), r[7] = 1.092548 * i * a, r[8] = 0.546274 * (i * i - n * n); } } mw.prototype.isSphericalHarmonics3 = !0; class Pp extends Xn { constructor(e = new mw(), r = 1) { super(void 0, r), this.sh = e; } copy(e) { return super.copy(e), this.sh.copy(e.sh), this; } fromJSON(e) { return this.intensity = e.intensity, this.sh.fromArray(e.sh), this; } toJSON(e) { const r = super.toJSON(e); return r.object.sh = this.sh.toArray(), r; } } Pp.prototype.isLightProbe = !0; class _O extends xi { constructor(e) { super(e), this.textures = {}; } load(e, r, i, n) { const a = this, o = new dn(a.manager); o.setPath(a.path), o.setRequestHeader(a.requestHeader), o.setWithCredentials(a.withCredentials), o.load(e, function(s) { try { r(a.parse(JSON.parse(s))); } catch (c) { n ? n(c) : console.error(c), a.manager.itemError(e); } }, i, n); } parse(e) { const r = this.textures; function i(a) { return r[a] === void 0 && console.warn("THREE.MaterialLoader: Undefined texture", a), r[a]; } const n = new Pde[e.type](); if (e.uuid !== void 0 && (n.uuid = e.uuid), e.name !== void 0 && (n.name = e.name), e.color !== void 0 && n.color !== void 0 && n.color.setHex(e.color), e.roughness !== void 0 && (n.roughness = e.roughness), e.metalness !== void 0 && (n.metalness = e.metalness), e.sheen !== void 0 && (n.sheen = new Je().setHex(e.sheen)), e.emissive !== void 0 && n.emissive !== void 0 && n.emissive.setHex(e.emissive), e.specular !== void 0 && n.specular !== void 0 && n.specular.setHex(e.specular), e.shininess !== void 0 && (n.shininess = e.shininess), e.clearcoat !== void 0 && (n.clearcoat = e.clearcoat), e.clearcoatRoughness !== void 0 && (n.clearcoatRoughness = e.clearcoatRoughness), e.transmission !== void 0 && (n.transmission = e.transmission), e.thickness !== void 0 && (n.thickness = e.thickness), e.attenuationDistance !== void 0 && (n.attenuationDistance = e.attenuationDistance), e.attenuationColor !== void 0 && n.attenuationColor !== void 0 && n.attenuationColor.setHex(e.attenuationColor), e.fog !== void 0 && (n.fog = e.fog), e.flatShading !== void 0 && (n.flatShading = e.flatShading), e.blending !== void 0 && (n.blending = e.blending), e.combine !== void 0 && (n.combine = e.combine), e.side !== void 0 && (n.side = e.side), e.shadowSide !== void 0 && (n.shadowSide = e.shadowSide), e.opacity !== void 0 && (n.opacity = e.opacity), e.transparent !== void 0 && (n.transparent = e.transparent), e.alphaTest !== void 0 && (n.alphaTest = e.alphaTest), e.depthTest !== void 0 && (n.depthTest = e.depthTest), e.depthWrite !== void 0 && (n.depthWrite = e.depthWrite), e.colorWrite !== void 0 && (n.colorWrite = e.colorWrite), e.stencilWrite !== void 0 && (n.stencilWrite = e.stencilWrite), e.stencilWriteMask !== void 0 && (n.stencilWriteMask = e.stencilWriteMask), e.stencilFunc !== void 0 && (n.stencilFunc = e.stencilFunc), e.stencilRef !== void 0 && (n.stencilRef = e.stencilRef), e.stencilFuncMask !== void 0 && (n.stencilFuncMask = e.stencilFuncMask), e.stencilFail !== void 0 && (n.stencilFail = e.stencilFail), e.stencilZFail !== void 0 && (n.stencilZFail = e.stencilZFail), e.stencilZPass !== void 0 && (n.stencilZPass = e.stencilZPass), e.wireframe !== void 0 && (n.wireframe = e.wireframe), e.wireframeLinewidth !== void 0 && (n.wireframeLinewidth = e.wireframeLinewidth), e.wireframeLinecap !== void 0 && (n.wireframeLinecap = e.wireframeLinecap), e.wireframeLinejoin !== void 0 && (n.wireframeLinejoin = e.wireframeLinejoin), e.rotation !== void 0 && (n.rotation = e.rotation), e.linewidth !== 1 && (n.linewidth = e.linewidth), e.dashSize !== void 0 && (n.dashSize = e.dashSize), e.gapSize !== void 0 && (n.gapSize = e.gapSize), e.scale !== void 0 && (n.scale = e.scale), e.polygonOffset !== void 0 && (n.polygonOffset = e.polygonOffset), e.polygonOffsetFactor !== void 0 && (n.polygonOffsetFactor = e.polygonOffsetFactor), e.polygonOffsetUnits !== void 0 && (n.polygonOffsetUnits = e.polygonOffsetUnits), e.morphTargets !== void 0 && (n.morphTargets = e.morphTargets), e.morphNormals !== void 0 && (n.morphNormals = e.morphNormals), e.dithering !== void 0 && (n.dithering = e.dithering), e.alphaToCoverage !== void 0 && (n.alphaToCoverage = e.alphaToCoverage), e.premultipliedAlpha !== void 0 && (n.premultipliedAlpha = e.premultipliedAlpha), e.vertexTangents !== void 0 && (n.vertexTangents = e.vertexTangents), e.visible !== void 0 && (n.visible = e.visible), e.toneMapped !== void 0 && (n.toneMapped = e.toneMapped), e.userData !== void 0 && (n.userData = e.userData), e.vertexColors !== void 0 && (typeof e.vertexColors == "number" ? n.vertexColors = e.vertexColors > 0 : n.vertexColors = e.vertexColors), e.uniforms !== void 0) for (const a in e.uniforms) { const o = e.uniforms[a]; switch (n.uniforms[a] = {}, o.type) { case "t": n.uniforms[a].value = i(o.value); break; case "c": n.uniforms[a].value = new Je().setHex(o.value); break; case "v2": n.uniforms[a].value = new je().fromArray(o.value); break; case "v3": n.uniforms[a].value = new de().fromArray(o.value); break; case "v4": n.uniforms[a].value = new Qt().fromArray(o.value); break; case "m3": n.uniforms[a].value = new Xr().fromArray(o.value); break; case "m4": n.uniforms[a].value = new at().fromArray(o.value); break; default: n.uniforms[a].value = o.value; } } if (e.defines !== void 0 && (n.defines = e.defines), e.vertexShader !== void 0 && (n.vertexShader = e.vertexShader), e.fragmentShader !== void 0 && (n.fragmentShader = e.fragmentShader), e.extensions !== void 0) for (const a in e.extensions) n.extensions[a] = e.extensions[a]; if (e.shading !== void 0 && (n.flatShading = e.shading === 1), e.size !== void 0 && (n.size = e.size), e.sizeAttenuation !== void 0 && (n.sizeAttenuation = e.sizeAttenuation), e.map !== void 0 && (n.map = i(e.map)), e.matcap !== void 0 && (n.matcap = i(e.matcap)), e.alphaMap !== void 0 && (n.alphaMap = i(e.alphaMap)), e.bumpMap !== void 0 && (n.bumpMap = i(e.bumpMap)), e.bumpScale !== void 0 && (n.bumpScale = e.bumpScale), e.normalMap !== void 0 && (n.normalMap = i(e.normalMap)), e.normalMapType !== void 0 && (n.normalMapType = e.normalMapType), e.normalScale !== void 0) { let a = e.normalScale; Array.isArray(a) === !1 && (a = [a, a]), n.normalScale = new je().fromArray(a); } return e.displacementMap !== void 0 && (n.displacementMap = i(e.displacementMap)), e.displacementScale !== void 0 && (n.displacementScale = e.displacementScale), e.displacementBias !== void 0 && (n.displacementBias = e.displacementBias), e.roughnessMap !== void 0 && (n.roughnessMap = i(e.roughnessMap)), e.metalnessMap !== void 0 && (n.metalnessMap = i(e.metalnessMap)), e.emissiveMap !== void 0 && (n.emissiveMap = i(e.emissiveMap)), e.emissiveIntensity !== void 0 && (n.emissiveIntensity = e.emissiveIntensity), e.specularMap !== void 0 && (n.specularMap = i(e.specularMap)), e.envMap !== void 0 && (n.envMap = i(e.envMap)), e.envMapIntensity !== void 0 && (n.envMapIntensity = e.envMapIntensity), e.reflectivity !== void 0 && (n.reflectivity = e.reflectivity), e.refractionRatio !== void 0 && (n.refractionRatio = e.refractionRatio), e.lightMap !== void 0 && (n.lightMap = i(e.lightMap)), e.lightMapIntensity !== void 0 && (n.lightMapIntensity = e.lightMapIntensity), e.aoMap !== void 0 && (n.aoMap = i(e.aoMap)), e.aoMapIntensity !== void 0 && (n.aoMapIntensity = e.aoMapIntensity), e.gradientMap !== void 0 && (n.gradientMap = i(e.gradientMap)), e.clearcoatMap !== void 0 && (n.clearcoatMap = i(e.clearcoatMap)), e.clearcoatRoughnessMap !== void 0 && (n.clearcoatRoughnessMap = i(e.clearcoatRoughnessMap)), e.clearcoatNormalMap !== void 0 && (n.clearcoatNormalMap = i(e.clearcoatNormalMap)), e.clearcoatNormalScale !== void 0 && (n.clearcoatNormalScale = new je().fromArray(e.clearcoatNormalScale)), e.transmissionMap !== void 0 && (n.transmissionMap = i(e.transmissionMap)), e.thicknessMap !== void 0 && (n.thicknessMap = i(e.thicknessMap)), n; } setTextures(e) { return this.textures = e, this; } } class eo { static decodeText(e) { if (typeof TextDecoder < "u") return new TextDecoder().decode(e); let r = ""; for (let i = 0, n = e.length; i < n; i++) r += String.fromCharCode(e[i]); try { return decodeURIComponent(escape(r)); } catch { return r; } } static extractUrlBase(e) { const r = e.lastIndexOf("/"); return r === -1 ? "./" : e.substr(0, r + 1); } } class gw extends ft { constructor() { super(), this.type = "InstancedBufferGeometry", this.instanceCount = 1 / 0; } copy(e) { return super.copy(e), this.instanceCount = e.instanceCount, this; } clone() { return new this.constructor().copy(this); } toJSON() { const e = super.toJSON(this); return e.instanceCount = this.instanceCount, e.isInstancedBufferGeometry = !0, e; } } gw.prototype.isInstancedBufferGeometry = !0; class vw extends kt { constructor(e, r, i, n = 1) { typeof i == "number" && (n = i, i = !1, console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")), super(e, r, i), this.meshPerAttribute = n; } copy(e) { return super.copy(e), this.meshPerAttribute = e.meshPerAttribute, this; } toJSON() { const e = super.toJSON(); return e.meshPerAttribute = this.meshPerAttribute, e.isInstancedBufferAttribute = !0, e; } } vw.prototype.isInstancedBufferAttribute = !0; class SO extends xi { constructor(e) { super(e); } load(e, r, i, n) { const a = this, o = new dn(a.manager); o.setPath(a.path), o.setRequestHeader(a.requestHeader), o.setWithCredentials(a.withCredentials), o.load(e, function(s) { try { r(a.parse(JSON.parse(s))); } catch (c) { n ? n(c) : console.error(c), a.manager.itemError(e); } }, i, n); } parse(e) { const r = {}, i = {}; function n(h, f) { if (r[f] !== void 0) return r[f]; const p = h.interleavedBuffers[f], m = a(h, p.buffer), y = Nc(p.type, m), g = new Is(y, p.stride); return g.uuid = p.uuid, r[f] = g, g; } function a(h, f) { if (i[f] !== void 0) return i[f]; const p = h.arrayBuffers[f], m = new Uint32Array(p).buffer; return i[f] = m, m; } const o = e.isInstancedBufferGeometry ? new gw() : new ft(), s = e.data.index; if (s !== void 0) { const h = Nc(s.type, s.array); o.setIndex(new kt(h, 1)); } const c = e.data.attributes; for (const h in c) { const f = c[h]; let p; if (f.isInterleavedBufferAttribute) { const m = n(e.data, f.data); p = new lo(m, f.itemSize, f.offset, f.normalized); } else { const m = Nc(f.type, f.array), y = f.isInstancedBufferAttribute ? vw : kt; p = new y(m, f.itemSize, f.normalized); } f.name !== void 0 && (p.name = f.name), f.usage !== void 0 && p.setUsage(f.usage), f.updateRange !== void 0 && (p.updateRange.offset = f.updateRange.offset, p.updateRange.count = f.updateRange.count), o.setAttribute(h, p); } const l = e.data.morphAttributes; if (l) for (const h in l) { const f = l[h], p = []; for (let m = 0, y = f.length; m < y; m++) { const g = f[m]; let v; if (g.isInterleavedBufferAttribute) { const x = n(e.data, g.data); v = new lo(x, g.itemSize, g.offset, g.normalized); } else { const x = Nc(g.type, g.array); v = new kt(x, g.itemSize, g.normalized); } g.name !== void 0 && (v.name = g.name), p.push(v); } o.morphAttributes[h] = p; } e.data.morphTargetsRelative && (o.morphTargetsRelative = !0); const u = e.data.groups || e.data.drawcalls || e.data.offsets; if (u !== void 0) for (let h = 0, f = u.length; h !== f; ++h) { const p = u[h]; o.addGroup(p.start, p.count, p.materialIndex); } const d = e.data.boundingSphere; if (d !== void 0) { const h = new de(); d.center !== void 0 && h.fromArray(d.center), o.boundingSphere = new _o(h, d.radius); } return e.name && (o.name = e.name), e.userData && (o.userData = e.userData), o; } } class Nde extends xi { constructor(e) { super(e); } load(e, r, i, n) { const a = this, o = this.path === "" ? eo.extractUrlBase(e) : this.path; this.resourcePath = this.resourcePath || o; const s = new dn(this.manager); s.setPath(this.path), s.setRequestHeader(this.requestHeader), s.setWithCredentials(this.withCredentials), s.load(e, function(c) { let l = null; try { l = JSON.parse(c); } catch (d) { n !== void 0 && n(d), console.error("THREE:ObjectLoader: Can't parse " + e + ".", d.message); return; } const u = l.metadata; if (u === void 0 || u.type === void 0 || u.type.toLowerCase() === "geometry") { console.error("THREE.ObjectLoader: Can't load " + e); return; } a.parse(l, r); }, i, n); } async loadAsync(e, r) { const i = this, n = this.path === "" ? eo.extractUrlBase(e) : this.path; this.resourcePath = this.resourcePath || n; const a = new dn(this.manager); a.setPath(this.path), a.setRequestHeader(this.requestHeader), a.setWithCredentials(this.withCredentials); const o = await a.loadAsync(e, r), s = JSON.parse(o), c = s.metadata; if (c === void 0 || c.type === void 0 || c.type.toLowerCase() === "geometry") throw new Error("THREE.ObjectLoader: Can't load " + e); return await i.parseAsync(s); } parse(e, r) { const i = this.parseAnimations(e.animations), n = this.parseShapes(e.shapes), a = this.parseGeometries(e.geometries, n), o = this.parseImages(e.images, function() { r !== void 0 && r(l); }), s = this.parseTextures(e.textures, o), c = this.parseMaterials(e.materials, s), l = this.parseObject(e.object, a, c, s, i), u = this.parseSkeletons(e.skeletons, l); if (this.bindSkeletons(l, u), r !== void 0) { let d = !1; for (const h in o) if (o[h] instanceof HTMLImageElement) { d = !0; break; } d === !1 && r(l); } return l; } async parseAsync(e) { const r = this.parseAnimations(e.animations), i = this.parseShapes(e.shapes), n = this.parseGeometries(e.geometries, i), a = await this.parseImagesAsync(e.images), o = this.parseTextures(e.textures, a), s = this.parseMaterials(e.materials, o), c = this.parseObject(e.object, n, s, o, r), l = this.parseSkeletons(e.skeletons, c); return this.bindSkeletons(c, l), c; } parseShapes(e) { const r = {}; if (e !== void 0) for (let i = 0, n = e.length; i < n; i++) { const a = new os().fromJSON(e[i]); r[a.uuid] = a; } return r; } parseSkeletons(e, r) { const i = {}, n = {}; if (r.traverse(function(a) { a.isBone && (n[a.uuid] = a); }), e !== void 0) for (let a = 0, o = e.length; a < o; a++) { const s = new Cp().fromJSON(e[a], n); i[s.uuid] = s; } return i; } parseGeometries(e, r) { const i = {}; if (e !== void 0) { const n = new SO(); for (let a = 0, o = e.length; a < o; a++) { let s; const c = e[a]; switch (c.type) { case "BufferGeometry": case "InstancedBufferGeometry": s = n.parse(c); break; case "Geometry": console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported."); break; default: c.type in AE ? s = AE[c.type].fromJSON(c, r) : console.warn(`THREE.ObjectLoader: Unsupported geometry type "${c.type}"`); } s.uuid = c.uuid, c.name !== void 0 && (s.name = c.name), s.isBufferGeometry === !0 && c.userData !== void 0 && (s.userData = c.userData), i[c.uuid] = s; } } return i; } parseMaterials(e, r) { const i = {}, n = {}; if (e !== void 0) { const a = new _O(); a.setTextures(r); for (let o = 0, s = e.length; o < s; o++) { const c = e[o]; if (c.type === "MultiMaterial") { const l = []; for (let u = 0; u < c.materials.length; u++) { const d = c.materials[u]; i[d.uuid] === void 0 && (i[d.uuid] = a.parse(d)), l.push(i[d.uuid]); } n[c.uuid] = l; } else i[c.uuid] === void 0 && (i[c.uuid] = a.parse(c)), n[c.uuid] = i[c.uuid]; } } return n; } parseAnimations(e) { const r = {}; if (e !== void 0) for (let i = 0; i < e.length; i++) { const n = e[i], a = Pu.parse(n); r[a.uuid] = a; } return r; } parseImages(e, r) { const i = this, n = {}; let a; function o(c) { return i.manager.itemStart(c), a.load(c, function() { i.manager.itemEnd(c); }, void 0, function() { i.manager.itemError(c), i.manager.itemEnd(c); }); } function s(c) { if (typeof c == "string") { const l = c, u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(l) ? l : i.resourcePath + l; return o(u); } else return c.data ? { data: Nc(c.type, c.data), width: c.width, height: c.height } : null; } if (e !== void 0 && e.length > 0) { const c = new cw(r); a = new Fh(c), a.setCrossOrigin(this.crossOrigin); for (let l = 0, u = e.length; l < u; l++) { const d = e[l], h = d.url; if (Array.isArray(h)) { n[d.uuid] = []; for (let f = 0, p = h.length; f < p; f++) { const m = h[f], y = s(m); y !== null && (y instanceof HTMLImageElement ? n[d.uuid].push(y) : n[d.uuid].push(new ml(y.data, y.width, y.height))); } } else { const f = s(d.url); f !== null && (n[d.uuid] = f); } } } return n; } async parseImagesAsync(e) { const r = this, i = {}; let n; async function a(o) { if (typeof o == "string") { const s = o, c = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(s) ? s : r.resourcePath + s; return await n.loadAsync(c); } else return o.data ? { data: Nc(o.type, o.data), width: o.width, height: o.height } : null; } if (e !== void 0 && e.length > 0) { n = new Fh(this.manager), n.setCrossOrigin(this.crossOrigin); for (let o = 0, s = e.length; o < s; o++) { const c = e[o], l = c.url; if (Array.isArray(l)) { i[c.uuid] = []; for (let u = 0, d = l.length; u < d; u++) { const h = l[u], f = await a(h); f !== null && (f instanceof HTMLImageElement ? i[c.uuid].push(f) : i[c.uuid].push(new ml(f.data, f.width, f.height))); } } else { const u = await a(c.url); u !== null && (i[c.uuid] = u); } } } return i; } parseTextures(e, r) { function i(a, o) { return typeof a == "number" ? a : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", a), o[a]); } const n = {}; if (e !== void 0) for (let a = 0, o = e.length; a < o; a++) { const s = e[a]; s.image === void 0 && console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid), r[s.image] === void 0 && console.warn("THREE.ObjectLoader: Undefined image", s.image); let c; const l = r[s.image]; Array.isArray(l) ? (c = new td(l), l.length === 6 && (c.needsUpdate = !0)) : (l && l.data ? c = new ml(l.data, l.width, l.height) : c = new zr(l), l && (c.needsUpdate = !0)), c.uuid = s.uuid, s.name !== void 0 && (c.name = s.name), s.mapping !== void 0 && (c.mapping = i(s.mapping, Bde)), s.offset !== void 0 && c.offset.fromArray(s.offset), s.repeat !== void 0 && c.repeat.fromArray(s.repeat), s.center !== void 0 && c.center.fromArray(s.center), s.rotation !== void 0 && (c.rotation = s.rotation), s.wrap !== void 0 && (c.wrapS = i(s.wrap[0], OE), c.wrapT = i(s.wrap[1], OE)), s.format !== void 0 && (c.format = s.format), s.type !== void 0 && (c.type = s.type), s.encoding !== void 0 && (c.encoding = s.encoding), s.minFilter !== void 0 && (c.minFilter = i(s.minFilter, DE)), s.magFilter !== void 0 && (c.magFilter = i(s.magFilter, DE)), s.anisotropy !== void 0 && (c.anisotropy = s.anisotropy), s.flipY !== void 0 && (c.flipY = s.flipY), s.premultiplyAlpha !== void 0 && (c.premultiplyAlpha = s.premultiplyAlpha), s.unpackAlignment !== void 0 && (c.unpackAlignment = s.unpackAlignment), n[s.uuid] = c; } return n; } parseObject(e, r, i, n, a) { let o; function s(h) { return r[h] === void 0 && console.warn("THREE.ObjectLoader: Undefined geometry", h), r[h]; } function c(h) { if (h !== void 0) { if (Array.isArray(h)) { const f = []; for (let p = 0, m = h.length; p < m; p++) { const y = h[p]; i[y] === void 0 && console.warn("THREE.ObjectLoader: Undefined material", y), f.push(i[y]); } return f; } return i[h] === void 0 && console.warn("THREE.ObjectLoader: Undefined material", h), i[h]; } } function l(h) { return n[h] === void 0 && console.warn("THREE.ObjectLoader: Undefined texture", h), n[h]; } let u, d; switch (e.type) { case "Scene": o = new mv(), e.background !== void 0 && (Number.isInteger(e.background) ? o.background = new Je(e.background) : o.background = l(e.background)), e.environment !== void 0 && (o.environment = l(e.environment)), e.fog !== void 0 && (e.fog.type === "Fog" ? o.fog = new _p(e.fog.color, e.fog.near, e.fog.far) : e.fog.type === "FogExp2" && (o.fog = new wp(e.fog.color, e.fog.density))); break; case "PerspectiveCamera": o = new Wr(e.fov, e.aspect, e.near, e.far), e.focus !== void 0 && (o.focus = e.focus), e.zoom !== void 0 && (o.zoom = e.zoom), e.filmGauge !== void 0 && (o.filmGauge = e.filmGauge), e.filmOffset !== void 0 && (o.filmOffset = e.filmOffset), e.view !== void 0 && (o.view = Object.assign({}, e.view)); break; case "OrthographicCamera": o = new ad(e.left, e.right, e.top, e.bottom, e.near, e.far), e.zoom !== void 0 && (o.zoom = e.zoom), e.view !== void 0 && (o.view = Object.assign({}, e.view)); break; case "AmbientLight": o = new pw(e.color, e.intensity); break; case "DirectionalLight": o = new Sv(e.color, e.intensity); break; case "PointLight": o = new _v(e.color, e.intensity, e.distance, e.decay); break; case "RectAreaLight": o = new fw(e.color, e.intensity, e.width, e.height); break; case "SpotLight": o = new wv(e.color, e.intensity, e.distance, e.angle, e.penumbra, e.decay); break; case "HemisphereLight": o = new dw(e.color, e.groundColor, e.intensity); break; case "LightProbe": o = new Pp().fromJSON(e); break; case "SkinnedMesh": u = s(e.geometry), d = c(e.material), o = new Ep(u, d), e.bindMode !== void 0 && (o.bindMode = e.bindMode), e.bindMatrix !== void 0 && o.bindMatrix.fromArray(e.bindMatrix), e.skeleton !== void 0 && (o.skeleton = e.skeleton); break; case "Mesh": u = s(e.geometry), d = c(e.material), o = new Fr(u, d); break; case "InstancedMesh": u = s(e.geometry), d = c(e.material); const h = e.count, f = e.instanceMatrix, p = e.instanceColor; o = new Hx(u, d, h), o.instanceMatrix = new kt(new Float32Array(f.array), 16), p !== void 0 && (o.instanceColor = new kt(new Float32Array(p.array), p.itemSize)); break; case "LOD": o = new nO(); break; case "Line": o = new wa(s(e.geometry), c(e.material)); break; case "LineLoop": o = new gv(s(e.geometry), c(e.material)); break; case "LineSegments": o = new zi(s(e.geometry), c(e.material)); break; case "PointCloud": case "Points": o = new id(s(e.geometry), c(e.material)); break; case "Sprite": o = new Mp(c(e.material)); break; case "Group": o = new ua(); break; case "Bone": o = new Tp(); break; default: o = new It(); } if (o.uuid = e.uuid, e.name !== void 0 && (o.name = e.name), e.matrix !== void 0 ? (o.matrix.fromArray(e.matrix), e.matrixAutoUpdate !== void 0 && (o.matrixAutoUpdate = e.matrixAutoUpdate), o.matrixAutoUpdate && o.matrix.decompose(o.position, o.quaternion, o.scale)) : (e.position !== void 0 && o.position.fromArray(e.position), e.rotation !== void 0 && o.rotation.fromArray(e.rotation), e.quaternion !== void 0 && o.quaternion.fromArray(e.quaternion), e.scale !== void 0 && o.scale.fromArray(e.scale)), e.castShadow !== void 0 && (o.castShadow = e.castShadow), e.receiveShadow !== void 0 && (o.receiveShadow = e.receiveShadow), e.shadow && (e.shadow.bias !== void 0 && (o.shadow.bias = e.shadow.bias), e.shadow.normalBias !== void 0 && (o.shadow.normalBias = e.shadow.normalBias), e.shadow.radius !== void 0 && (o.shadow.radius = e.shadow.radius), e.shadow.mapSize !== void 0 && o.shadow.mapSize.fromArray(e.shadow.mapSize), e.shadow.camera !== void 0 && (o.shadow.camera = this.parseObject(e.shadow.camera))), e.visible !== void 0 && (o.visible = e.visible), e.frustumCulled !== void 0 && (o.frustumCulled = e.frustumCulled), e.renderOrder !== void 0 && (o.renderOrder = e.renderOrder), e.userData !== void 0 && (o.userData = e.userData), e.layers !== void 0 && (o.layers.mask = e.layers), e.children !== void 0) { const h = e.children; for (let f = 0; f < h.length; f++) o.add(this.parseObject(h[f], r, i, n, a)); } if (e.animations !== void 0) { const h = e.animations; for (let f = 0; f < h.length; f++) { const p = h[f]; o.animations.push(a[p]); } } if (e.type === "LOD") { e.autoUpdate !== void 0 && (o.autoUpdate = e.autoUpdate); const h = e.levels; for (let f = 0; f < h.length; f++) { const p = h[f], m = o.getObjectByProperty("uuid", p.object); m !== void 0 && o.addLevel(m, p.distance); } } return o; } bindSkeletons(e, r) { Object.keys(r).length !== 0 && e.traverse(function(i) { if (i.isSkinnedMesh === !0 && i.skeleton !== void 0) { const n = r[i.skeleton]; n === void 0 ? console.warn("THREE.ObjectLoader: No skeleton found with UUID:", i.skeleton) : i.bind(n, i.bindMatrix); } }); } /* DEPRECATED */ setTexturePath(e) { return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."), this.setResourcePath(e); } } const Bde = { UVMapping: nv, CubeReflectionMapping: gp, CubeRefractionMapping: vp, EquirectangularReflectionMapping: eg, EquirectangularRefractionMapping: tg, CubeUVReflectionMapping: ed, CubeUVRefractionMapping: yp }, OE = { RepeatWrapping: _s, ClampToEdgeWrapping: ii, MirroredRepeatWrapping: pu }, DE = { NearestFilter: Dr, NearestMipmapNearestFilter: kh, NearestMipmapLinearFilter: Ph, LinearFilter: Cr, LinearMipmapNearestFilter: av, LinearMipmapLinearFilter: wo }; class yw extends xi { constructor(e) { super(e), typeof createImageBitmap > "u" && console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."), typeof fetch > "u" && console.warn("THREE.ImageBitmapLoader: fetch() not supported."), this.options = { premultiplyAlpha: "none" }; } setOptions(e) { return this.options = e, this; } load(e, r, i, n) { e === void 0 && (e = ""), this.path !== void 0 && (e = this.path + e), e = this.manager.resolveURL(e); const a = this, o = Il.get(e); if (o !== void 0) return a.manager.itemStart(e), setTimeout(function() { r && r(o), a.manager.itemEnd(e); }, 0), o; const s = {}; s.credentials = this.crossOrigin === "anonymous" ? "same-origin" : "include", s.headers = this.requestHeader, fetch(e, s).then(function(c) { return c.blob(); }).then(function(c) { return createImageBitmap(c, Object.assign(a.options, { colorSpaceConversion: "none" })); }).then(function(c) { Il.add(e, c), r && r(c), a.manager.itemEnd(e); }).catch(function(c) { n && n(c), a.manager.itemError(e), a.manager.itemEnd(e); }), a.manager.itemStart(e); } } yw.prototype.isImageBitmapLoader = !0; class MO { constructor() { this.type = "ShapePath", this.color = new Je(), this.subPaths = [], this.currentPath = null; } moveTo(e, r) { return this.currentPath = new zh(), this.subPaths.push(this.currentPath), this.currentPath.moveTo(e, r), this; } lineTo(e, r) { return this.currentPath.lineTo(e, r), this; } quadraticCurveTo(e, r, i, n) { return this.currentPath.quadraticCurveTo(e, r, i, n), this; } bezierCurveTo(e, r, i, n, a, o) { return this.currentPath.bezierCurveTo(e, r, i, n, a, o), this; } splineThru(e) { return this.currentPath.splineThru(e), this; } toShapes(e, r) { function i(v) { const x = []; for (let w = 0, S = v.length; w < S; w++) { const _ = v[w], b = new os(); b.curves = _.curves, x.push(b); } return x; } function n(v, x) { const w = x.length; let S = !1; for (let _ = w - 1, b = 0; b < w; _ = b++) { let T = x[_], E = x[b], C = E.x - T.x, L = E.y - T.y; if (Math.abs(L) > Number.EPSILON) { if (L < 0 && (T = x[b], C = -C, E = x[_], L = -L), v.y < T.y || v.y > E.y) continue; if (v.y === T.y) { if (v.x === T.x) return !0; } else { const A = L * (v.x - T.x) - C * (v.y - T.y); if (A === 0) return !0; if (A < 0) continue; S = !S; } } else { if (v.y !== T.y) continue; if (E.x <= v.x && v.x <= T.x || T.x <= v.x && v.x <= E.x) return !0; } } return S; } const a = ma.isClockWise, o = this.subPaths; if (o.length === 0) return []; if (r === !0) return i(o); let s, c, l; const u = []; if (o.length === 1) return c = o[0], l = new os(), l.curves = c.curves, u.push(l), u; let d = !a(o[0].getPoints()); d = e ? !d : d; const h = [], f = []; let p = [], m = 0, y; f[m] = void 0, p[m] = []; for (let v = 0, x = o.length; v < x; v++) c = o[v], y = c.getPoints(), s = a(y), s = e ? !s : s, s ? (!d && f[m] && m++, f[m] = { s: new os(), p: y }, f[m].s.curves = c.curves, d && m++, p[m] = []) : p[m].push({ h: c, p: y[0] }); if (!f[0]) return i(o); if (f.length > 1) { let v = !1; const x = []; for (let w = 0, S = f.length; w < S; w++) h[w] = []; for (let w = 0, S = f.length; w < S; w++) { const _ = p[w]; for (let b = 0; b < _.length; b++) { const T = _[b]; let E = !0; for (let C = 0; C < f.length; C++) n(T.p, f[C].p) && (w !== C && x.push({ froms: w, tos: C, hole: b }), E ? (E = !1, h[C].push(T)) : v = !0); E && h[w].push(T); } } x.length > 0 && (v || (p = h)); } let g; for (let v = 0, x = f.length; v < x; v++) { l = f[v].s, u.push(l), g = p[v]; for (let w = 0, S = g.length; w < S; w++) l.holes.push(g[w].h); } return u; } } class bw { constructor(e) { this.type = "Font", this.data = e; } generateShapes(e, r = 100) { const i = [], n = Fde(e, r, this.data); for (let a = 0, o = n.length; a < o; a++) Array.prototype.push.apply(i, n[a].toShapes()); return i; } } function Fde(t, e, r) { const i = Array.from(t), n = e / r.resolution, a = (r.boundingBox.yMax - r.boundingBox.yMin + r.underlineThickness) * n, o = []; let s = 0, c = 0; for (let l = 0; l < i.length; l++) { const u = i[l]; if (u === ` `) s = 0, c -= a; else { const d = zde(u, n, s, c, r); s += d.offsetX, o.push(d.path); } } return o; } function zde(t, e, r, i, n) { const a = n.glyphs[t] || n.glyphs["?"]; if (!a) { console.error('THREE.Font: character "' + t + '" does not exists in font family ' + n.familyName + "."); return; } const o = new MO(); let s, c, l, u, d, h, f, p; if (a.o) { const m = a._cachedOutline || (a._cachedOutline = a.o.split(" ")); for (let y = 0, g = m.length; y < g; ) switch (m[y++]) { case "m": s = m[y++] * e + r, c = m[y++] * e + i, o.moveTo(s, c); break; case "l": s = m[y++] * e + r, c = m[y++] * e + i, o.lineTo(s, c); break; case "q": l = m[y++] * e + r, u = m[y++] * e + i, d = m[y++] * e + r, h = m[y++] * e + i, o.quadraticCurveTo(d, h, l, u); break; case "b": l = m[y++] * e + r, u = m[y++] * e + i, d = m[y++] * e + r, h = m[y++] * e + i, f = m[y++] * e + r, p = m[y++] * e + i, o.bezierCurveTo(d, h, f, p, l, u); break; } } return { offsetX: a.ha * e, path: o }; } bw.prototype.isFont = !0; class $de extends xi { constructor(e) { super(e); } load(e, r, i, n) { const a = this, o = new dn(this.manager); o.setPath(this.path), o.setRequestHeader(this.requestHeader), o.setWithCredentials(a.withCredentials), o.load(e, function(s) { let c; try { c = JSON.parse(s); } catch { console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."), c = JSON.parse(s.substring(65, s.length - 2)); } const l = a.parse(c); r && r(l); }, i, n); } parse(e) { return new bw(e); } } let $f; const xw = { getContext: function() { return $f === void 0 && ($f = new (window.AudioContext || window.webkitAudioContext)()), $f; }, setContext: function(t) { $f = t; } }; class EO extends xi { constructor(e) { super(e); } load(e, r, i, n) { const a = this, o = new dn(this.manager); o.setResponseType("arraybuffer"), o.setPath(this.path), o.setRequestHeader(this.requestHeader), o.setWithCredentials(this.withCredentials), o.load(e, function(s) { try { const c = s.slice(0); xw.getContext().decodeAudioData(c, function(l) { r(l); }); } catch (c) { n ? n(c) : console.error(c), a.manager.itemError(e); } }, i, n); } } class TO extends Pp { constructor(e, r, i = 1) { super(void 0, i); const n = new Je().set(e), a = new Je().set(r), o = new de(n.r, n.g, n.b), s = new de(a.r, a.g, a.b), c = Math.sqrt(Math.PI), l = c * Math.sqrt(0.75); this.sh.coefficients[0].copy(o).add(s).multiplyScalar(c), this.sh.coefficients[1].copy(o).sub(s).multiplyScalar(l); } } TO.prototype.isHemisphereLightProbe = !0; class CO extends Pp { constructor(e, r = 1) { super(void 0, r); const i = new Je().set(e); this.sh.coefficients[0].set(i.r, i.g, i.b).multiplyScalar(2 * Math.sqrt(Math.PI)); } } CO.prototype.isAmbientLightProbe = !0; const IE = /* @__PURE__ */ new at(), NE = /* @__PURE__ */ new at(); class Vde { constructor() { this.type = "StereoCamera", this.aspect = 1, this.eyeSep = 0.064, this.cameraL = new Wr(), this.cameraL.layers.enable(1), this.cameraL.matrixAutoUpdate = !1, this.cameraR = new Wr(), this.cameraR.layers.enable(2), this.cameraR.matrixAutoUpdate = !1, this._cache = { focus: null, fov: null, aspect: null, near: null, far: null, zoom: null, eyeSep: null }; } update(e) { const r = this._cache; if (r.focus !== e.focus || r.fov !== e.fov || r.aspect !== e.aspect * this.aspect || r.near !== e.near || r.far !== e.far || r.zoom !== e.zoom || r.eyeSep !== this.eyeSep) { r.focus = e.focus, r.fov = e.fov, r.aspect = e.aspect * this.aspect, r.near = e.near, r.far = e.far, r.zoom = e.zoom, r.eyeSep = this.eyeSep; const i = e.projectionMatrix.clone(), n = r.eyeSep / 2, a = n * r.near / r.focus, o = r.near * Math.tan(fl * r.fov * 0.5) / r.zoom; let s, c; NE.elements[12] = -n, IE.elements[12] = n, s = -o * r.aspect + a, c = o * r.aspect + a, i.elements[0] = 2 * r.near / (c - s), i.elements[8] = (c + s) / (c - s), this.cameraL.projectionMatrix.copy(i), s = -o * r.aspect - a, c = o * r.aspect - a, i.elements[0] = 2 * r.near / (c - s), i.elements[8] = (c + s) / (c - s), this.cameraR.projectionMatrix.copy(i); } this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(NE), this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(IE); } } class AO { constructor(e = !0) { this.autoStart = e, this.startTime = 0, this.oldTime = 0, this.elapsedTime = 0, this.running = !1; } start() { this.startTime = BE(), this.oldTime = this.startTime, this.elapsedTime = 0, this.running = !0; } stop() { this.getElapsedTime(), this.running = !1, this.autoStart = !1; } getElapsedTime() { return this.getDelta(), this.elapsedTime; } getDelta() { let e = 0; if (this.autoStart && !this.running) return this.start(), 0; if (this.running) { const r = BE(); e = (r - this.oldTime) / 1e3, this.oldTime = r, this.elapsedTime += e; } return e; } } function BE() { return (typeof performance > "u" ? Date : performance).now(); } const js = /* @__PURE__ */ new de(), FE = /* @__PURE__ */ new vi(), Ude = /* @__PURE__ */ new de(), Hs = /* @__PURE__ */ new de(); class jde extends It { constructor() { super(), this.type = "AudioListener", this.context = xw.getContext(), this.gain = this.context.createGain(), this.gain.connect(this.context.destination), this.filter = null, this.timeDelta = 0, this._clock = new AO(); } getInput() { return this.gain; } removeFilter() { return this.filter !== null && (this.gain.disconnect(this.filter), this.filter.disconnect(this.context.destination), this.gain.connect(this.context.destination), this.filter = null), this; } getFilter() { return this.filter; } setFilter(e) { return this.filter !== null ? (this.gain.disconnect(this.filter), this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination), this.filter = e, this.gain.connect(this.filter), this.filter.connect(this.context.destination), this; } getMasterVolume() { return this.gain.gain.value; } setMasterVolume(e) { return this.gain.gain.setTargetAtTime(e, this.context.currentTime, 0.01), this; } updateMatrixWorld(e) { super.updateMatrixWorld(e); const r = this.context.listener, i = this.up; if (this.timeDelta = this._clock.getDelta(), this.matrixWorld.decompose(js, FE, Ude), Hs.set(0, 0, -1).applyQuaternion(FE), r.positionX) { const n = this.context.currentTime + this.timeDelta; r.positionX.linearRampToValueAtTime(js.x, n), r.positionY.linearRampToValueAtTime(js.y, n), r.positionZ.linearRampToValueAtTime(js.z, n), r.forwardX.linearRampToValueAtTime(Hs.x, n), r.forwardY.linearRampToValueAtTime(Hs.y, n), r.forwardZ.linearRampToValueAtTime(Hs.z, n), r.upX.linearRampToValueAtTime(i.x, n), r.upY.linearRampToValueAtTime(i.y, n), r.upZ.linearRampToValueAtTime(i.z, n); } else r.setPosition(js.x, js.y, js.z), r.setOrientation(Hs.x, Hs.y, Hs.z, i.x, i.y, i.z); } } class ww extends It { constructor(e) { super(), this.type = "Audio", this.listener = e, this.context = e.context, this.gain = this.context.createGain(), this.gain.connect(e.getInput()), this.autoplay = !1, this.buffer = null, this.detune = 0, this.loop = !1, this.loopStart = 0, this.loopEnd = 0, this.offset = 0, this.duration = void 0, this.playbackRate = 1, this.isPlaying = !1, this.hasPlaybackControl = !0, this.source = null, this.sourceType = "empty", this._startedAt = 0, this._progress = 0, this._connected = !1, this.filters = []; } getOutput() { return this.gain; } setNodeSource(e) { return this.hasPlaybackControl = !1, this.sourceType = "audioNode", this.source = e, this.connect(), this; } setMediaElementSource(e) { return this.hasPlaybackControl = !1, this.sourceType = "mediaNode", this.source = this.context.createMediaElementSource(e), this.connect(), this; } setMediaStreamSource(e) { return this.hasPlaybackControl = !1, this.sourceType = "mediaStreamNode", this.source = this.context.createMediaStreamSource(e), this.connect(), this; } setBuffer(e) { return this.buffer = e, this.sourceType = "buffer", this.autoplay && this.play(), this; } play(e = 0) { if (this.isPlaying === !0) { console.warn("THREE.Audio: Audio is already playing."); return; } if (this.hasPlaybackControl === !1) { console.warn("THREE.Audio: this Audio has no playback control."); return; } this._startedAt = this.context.currentTime + e; const r = this.context.createBufferSource(); return r.buffer = this.buffer, r.loop = this.loop, r.loopStart = this.loopStart, r.loopEnd = this.loopEnd, r.onended = this.onEnded.bind(this), r.start(this._startedAt, this._progress + this.offset, this.duration), this.isPlaying = !0, this.source = r, this.setDetune(this.detune), this.setPlaybackRate(this.playbackRate), this.connect(); } pause() { if (this.hasPlaybackControl === !1) { console.warn("THREE.Audio: this Audio has no playback control."); return; } return this.isPlaying === !0 && (this._progress += Math.max(this.context.currentTime - this._startedAt, 0) * this.playbackRate, this.loop === !0 && (this._progress = this._progress % (this.duration || this.buffer.duration)), this.source.stop(), this.source.onended = null, this.isPlaying = !1), this; } stop() { if (this.hasPlaybackControl === !1) { console.warn("THREE.Audio: this Audio has no playback control."); return; } return this._progress = 0, this.source.stop(), this.source.onended = null, this.isPlaying = !1, this; } connect() { if (this.filters.length > 0) { this.source.connect(this.filters[0]); for (let e = 1, r = this.filters.length; e < r; e++) this.filters[e - 1].connect(this.filters[e]); this.filters[this.filters.length - 1].connect(this.getOutput()); } else this.source.connect(this.getOutput()); return this._connected = !0, this; } disconnect() { if (this.filters.length > 0) { this.source.disconnect(this.filters[0]); for (let e = 1, r = this.filters.length; e < r; e++) this.filters[e - 1].disconnect(this.filters[e]); this.filters[this.filters.length - 1].disconnect(this.getOutput()); } else this.source.disconnect(this.getOutput()); return this._connected = !1, this; } getFilters() { return this.filters; } setFilters(e) { return e || (e = []), this._connected === !0 ? (this.disconnect(), this.filters = e.slice(), this.connect()) : this.filters = e.slice(), this; } setDetune(e) { if (this.detune = e, this.source.detune !== void 0) return this.isPlaying === !0 && this.source.detune.setTargetAtTime(this.detune, this.context.currentTime, 0.01), this; } getDetune() { return this.detune; } getFilter() { return this.getFilters()[0]; } setFilter(e) { return this.setFilters(e ? [e] : []); } setPlaybackRate(e) { if (this.hasPlaybackControl === !1) { console.warn("THREE.Audio: this Audio has no playback control."); return; } return this.playbackRate = e, this.isPlaying === !0 && this.source.playbackRate.setTargetAtTime(this.playbackRate, this.context.currentTime, 0.01), this; } getPlaybackRate() { return this.playbackRate; } onEnded() { this.isPlaying = !1; } getLoop() { return this.hasPlaybackControl === !1 ? (console.warn("THREE.Audio: this Audio has no playback control."), !1) : this.loop; } setLoop(e) { if (this.hasPlaybackControl === !1) { console.warn("THREE.Audio: this Audio has no playback control."); return; } return this.loop = e, this.isPlaying === !0 && (this.source.loop = this.loop), this; } setLoopStart(e) { return this.loopStart = e, this; } setLoopEnd(e) { return this.loopEnd = e, this; } getVolume() { return this.gain.gain.value; } setVolume(e) { return this.gain.gain.setTargetAtTime(e, this.context.currentTime, 0.01), this; } } const Gs = /* @__PURE__ */ new de(), zE = /* @__PURE__ */ new vi(), Hde = /* @__PURE__ */ new de(), Ws = /* @__PURE__ */ new de(); class Gde extends ww { constructor(e) { super(e), this.panner = this.context.createPanner(), this.panner.panningModel = "HRTF", this.panner.connect(this.gain); } getOutput() { return this.panner; } getRefDistance() { return this.panner.refDistance; } setRefDistance(e) { return this.panner.refDistance = e, this; } getRolloffFactor() { return this.panner.rolloffFactor; } setRolloffFactor(e) { return this.panner.rolloffFactor = e, this; } getDistanceModel() { return this.panner.distanceModel; } setDistanceModel(e) { return this.panner.distanceModel = e, this; } getMaxDistance() { return this.panner.maxDistance; } setMaxDistance(e) { return this.panner.maxDistance = e, this; } setDirectionalCone(e, r, i) { return this.panner.coneInnerAngle = e, this.panner.coneOuterAngle = r, this.panner.coneOuterGain = i, this; } updateMatrixWorld(e) { if (super.updateMatrixWorld(e), this.hasPlaybackControl === !0 && this.isPlaying === !1) return; this.matrixWorld.decompose(Gs, zE, Hde), Ws.set(0, 0, 1).applyQuaternion(zE); const r = this.panner; if (r.positionX) { const i = this.context.currentTime + this.listener.timeDelta; r.positionX.linearRampToValueAtTime(Gs.x, i), r.positionY.linearRampToValueAtTime(Gs.y, i), r.positionZ.linearRampToValueAtTime(Gs.z, i), r.orientationX.linearRampToValueAtTime(Ws.x, i), r.orientationY.linearRampToValueAtTime(Ws.y, i), r.orientationZ.linearRampToValueAtTime(Ws.z, i); } else r.setPosition(Gs.x, Gs.y, Gs.z), r.setOrientation(Ws.x, Ws.y, Ws.z); } } class LO { constructor(e, r = 2048) { this.analyser = e.context.createAnalyser(), this.analyser.fftSize = r, this.data = new Uint8Array(this.analyser.frequencyBinCount), e.getOutput().connect(this.analyser); } getFrequencyData() { return this.analyser.getByteFrequencyData(this.data), this.data; } getAverageFrequency() { let e = 0; const r = this.getFrequencyData(); for (let i = 0; i < r.length; i++) e += r[i]; return e / r.length; } } class kO { constructor(e, r, i) { this.binding = e, this.valueSize = i; let n, a, o; switch (r) { case "quaternion": n = this._slerp, a = this._slerpAdditive, o = this._setAdditiveIdentityQuaternion, this.buffer = new Float64Array(i * 6), this._workIndex = 5; break; case "string": case "bool": n = this._select, a = this._select, o = this._setAdditiveIdentityOther, this.buffer = new Array(i * 5); break; default: n = this._lerp, a = this._lerpAdditive, o = this._setAdditiveIdentityNumeric, this.buffer = new Float64Array(i * 5); } this._mixBufferRegion = n, this._mixBufferRegionAdditive = a, this._setIdentity = o, this._origIndex = 3, this._addIndex = 4, this.cumulativeWeight = 0, this.cumulativeWeightAdditive = 0, this.useCount = 0, this.referenceCount = 0; } // accumulate data in the 'incoming' region into 'accu' accumulate(e, r) { const i = this.buffer, n = this.valueSize, a = e * n + n; let o = this.cumulativeWeight; if (o === 0) { for (let s = 0; s !== n; ++s) i[a + s] = i[s]; o = r; } else { o += r; const s = r / o; this._mixBufferRegion(i, a, 0, s, n); } this.cumulativeWeight = o; } // accumulate data in the 'incoming' region into 'add' accumulateAdditive(e) { const r = this.buffer, i = this.valueSize, n = i * this._addIndex; this.cumulativeWeightAdditive === 0 && this._setIdentity(), this._mixBufferRegionAdditive(r, n, 0, e, i), this.cumulativeWeightAdditive += e; } // apply the state of 'accu' to the binding when accus differ apply(e) { const r = this.valueSize, i = this.buffer, n = e * r + r, a = this.cumulativeWeight, o = this.cumulativeWeightAdditive, s = this.binding; if (this.cumulativeWeight = 0, this.cumulativeWeightAdditive = 0, a < 1) { const c = r * this._origIndex; this._mixBufferRegion( i, n, c, 1 - a, r ); } o > 0 && this._mixBufferRegionAdditive(i, n, this._addIndex * r, 1, r); for (let c = r, l = r + r; c !== l; ++c) if (i[c] !== i[c + r]) { s.setValue(i, n); break; } } // remember the state of the bound property and copy it to both accus saveOriginalState() { const e = this.binding, r = this.buffer, i = this.valueSize, n = i * this._origIndex; e.getValue(r, n); for (let a = i, o = n; a !== o; ++a) r[a] = r[n + a % i]; this._setIdentity(), this.cumulativeWeight = 0, this.cumulativeWeightAdditive = 0; } // apply the state previously taken via 'saveOriginalState' to the binding restoreOriginalState() { const e = this.valueSize * 3; this.binding.setValue(this.buffer, e); } _setAdditiveIdentityNumeric() { const e = this._addIndex * this.valueSize, r = e + this.valueSize; for (let i = e; i < r; i++) this.buffer[i] = 0; } _setAdditiveIdentityQuaternion() { this._setAdditiveIdentityNumeric(), this.buffer[this._addIndex * this.valueSize + 3] = 1; } _setAdditiveIdentityOther() { const e = this._origIndex * this.valueSize, r = this._addIndex * this.valueSize; for (let i = 0; i < this.valueSize; i++) this.buffer[r + i] = this.buffer[e + i]; } // mix functions _select(e, r, i, n, a) { if (n >= 0.5) for (let o = 0; o !== a; ++o) e[r + o] = e[i + o]; } _slerp(e, r, i, n) { vi.slerpFlat(e, r, e, r, e, i, n); } _slerpAdditive(e, r, i, n, a) { const o = this._workIndex * a; vi.multiplyQuaternionsFlat(e, o, e, r, e, i), vi.slerpFlat(e, r, e, r, e, o, n); } _lerp(e, r, i, n, a) { const o = 1 - n; for (let s = 0; s !== a; ++s) { const c = r + s; e[c] = e[c] * o + e[i + s] * n; } } _lerpAdditive(e, r, i, n, a) { for (let o = 0; o !== a; ++o) { const s = r + o; e[s] = e[s] + e[i + o] * n; } } } const _w = "\\[\\]\\.:\\/", Wde = new RegExp("[" + _w + "]", "g"), Sw = "[^" + _w + "]", qde = "[^" + _w.replace("\\.", "") + "]", Xde = /((?:WC+[\/:])*)/.source.replace("WC", Sw), Zde = /(WCOD+)?/.source.replace("WCOD", qde), Yde = /(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC", Sw), Kde = /\.(WC+)(?:\[(.+)\])?/.source.replace("WC", Sw), Jde = new RegExp( "^" + Xde + Zde + Yde + Kde + "$" ), Qde = ["material", "materials", "bones"]; class ehe { constructor(e, r, i) { const n = i || Vt.parseTrackName(r); this._targetGroup = e, this._bindings = e.subscribe_(r, n); } getValue(e, r) { this.bind(); const i = this._targetGroup.nCachedObjects_, n = this._bindings[i]; n !== void 0 && n.getValue(e, r); } setValue(e, r) { const i = this._bindings; for (let n = this._targetGroup.nCachedObjects_, a = i.length; n !== a; ++n) i[n].setValue(e, r); } bind() { const e = this._bindings; for (let r = this._targetGroup.nCachedObjects_, i = e.length; r !== i; ++r) e[r].bind(); } unbind() { const e = this._bindings; for (let r = this._targetGroup.nCachedObjects_, i = e.length; r !== i; ++r) e[r].unbind(); } } class Vt { constructor(e, r, i) { this.path = r, this.parsedPath = i || Vt.parseTrackName(r), this.node = Vt.findNode(e, this.parsedPath.nodeName) || e, this.rootNode = e, this.getValue = this._getValue_unbound, this.setValue = this._setValue_unbound; } static create(e, r, i) { return e && e.isAnimationObjectGroup ? new Vt.Composite(e, r, i) : new Vt(e, r, i); } /** * Replaces spaces with underscores and removes unsupported characters from * node names, to ensure compatibility with parseTrackName(). * * @param {string} name Node name to be sanitized. * @return {string} */ static sanitizeNodeName(e) { return e.replace(/\s/g, "_").replace(Wde, ""); } static parseTrackName(e) { const r = Jde.exec(e); if (!r) throw new Error("PropertyBinding: Cannot parse trackName: " + e); const i = { // directoryName: matches[ 1 ], // (tschw) currently unused nodeName: r[2], objectName: r[3], objectIndex: r[4], propertyName: r[5], // required propertyIndex: r[6] }, n = i.nodeName && i.nodeName.lastIndexOf("."); if (n !== void 0 && n !== -1) { const a = i.nodeName.substring(n + 1); Qde.indexOf(a) !== -1 && (i.nodeName = i.nodeName.substring(0, n), i.objectName = a); } if (i.propertyName === null || i.propertyName.length === 0) throw new Error("PropertyBinding: can not parse propertyName from trackName: " + e); return i; } static findNode(e, r) { if (!r || r === "" || r === "." || r === -1 || r === e.name || r === e.uuid) return e; if (e.skeleton) { const i = e.skeleton.getBoneByName(r); if (i !== void 0) return i; } if (e.children) { const i = function(a) { for (let o = 0; o < a.length; o++) { const s = a[o]; if (s.name === r || s.uuid === r) return s; const c = i(s.children); if (c) return c; } return null; }, n = i(e.children); if (n) return n; } return null; } // these are used to "bind" a nonexistent property _getValue_unavailable() { } _setValue_unavailable() { } // Getters _getValue_direct(e, r) { e[r] = this.node[this.propertyName]; } _getValue_array(e, r) { const i = this.resolvedProperty; for (let n = 0, a = i.length; n !== a; ++n) e[r++] = i[n]; } _getValue_arrayElement(e, r) { e[r] = this.resolvedProperty[this.propertyIndex]; } _getValue_toArray(e, r) { this.resolvedProperty.toArray(e, r); } // Direct _setValue_direct(e, r) { this.targetObject[this.propertyName] = e[r]; } _setValue_direct_setNeedsUpdate(e, r) { this.targetObject[this.propertyName] = e[r], this.targetObject.needsUpdate = !0; } _setValue_direct_setMatrixWorldNeedsUpdate(e, r) { this.targetObject[this.propertyName] = e[r], this.targetObject.matrixWorldNeedsUpdate = !0; } // EntireArray _setValue_array(e, r) { const i = this.resolvedProperty; for (let n = 0, a = i.length; n !== a; ++n) i[n] = e[r++]; } _setValue_array_setNeedsUpdate(e, r) { const i = this.resolvedProperty; for (let n = 0, a = i.length; n !== a; ++n) i[n] = e[r++]; this.targetObject.needsUpdate = !0; } _setValue_array_setMatrixWorldNeedsUpdate(e, r) { const i = this.resolvedProperty; for (let n = 0, a = i.length; n !== a; ++n) i[n] = e[r++]; this.targetObject.matrixWorldNeedsUpdate = !0; } // ArrayElement _setValue_arrayElement(e, r) { this.resolvedProperty[this.propertyIndex] = e[r]; } _setValue_arrayElement_setNeedsUpdate(e, r) { this.resolvedProperty[this.propertyIndex] = e[r], this.targetObject.needsUpdate = !0; } _setValue_arrayElement_setMatrixWorldNeedsUpdate(e, r) { this.resolvedProperty[this.propertyIndex] = e[r], this.targetObject.matrixWorldNeedsUpdate = !0; } // HasToFromArray _setValue_fromArray(e, r) { this.resolvedProperty.fromArray(e, r); } _setValue_fromArray_setNeedsUpdate(e, r) { this.resolvedProperty.fromArray(e, r), this.targetObject.needsUpdate = !0; } _setValue_fromArray_setMatrixWorldNeedsUpdate(e, r) { this.resolvedProperty.fromArray(e, r), this.targetObject.matrixWorldNeedsUpdate = !0; } _getValue_unbound(e, r) { this.bind(), this.getValue(e, r); } _setValue_unbound(e, r) { this.bind(), this.setValue(e, r); } // create getter / setter pair for a property in the scene graph bind() { let e = this.node; const r = this.parsedPath, i = r.objectName, n = r.propertyName; let a = r.propertyIndex; if (e || (e = Vt.findNode(this.rootNode, r.nodeName) || this.rootNode, this.node = e), this.getValue = this._getValue_unavailable, this.setValue = this._setValue_unavailable, !e) { console.error("THREE.PropertyBinding: Trying to update node for track: " + this.path + " but it wasn't found."); return; } if (i) { let l = r.objectIndex; switch (i) { case "materials": if (!e.material) { console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.", this); return; } if (!e.material.materials) { console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.", this); return; } e = e.material.materials; break; case "bones": if (!e.skeleton) { console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.", this); return; } e = e.skeleton.bones; for (let u = 0; u < e.length; u++) if (e[u].name === l) { l = u; break; } break; default: if (e[i] === void 0) { console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.", this); return; } e = e[i]; } if (l !== void 0) { if (e[l] === void 0) { console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.", this, e); return; } e = e[l]; } } const o = e[n]; if (o === void 0) { const l = r.nodeName; console.error("THREE.PropertyBinding: Trying to update property for track: " + l + "." + n + " but it wasn't found.", e); return; } let s = this.Versioning.None; this.targetObject = e, e.needsUpdate !== void 0 ? s = this.Versioning.NeedsUpdate : e.matrixWorldNeedsUpdate !== void 0 && (s = this.Versioning.MatrixWorldNeedsUpdate); let c = this.BindingType.Direct; if (a !== void 0) { if (n === "morphTargetInfluences") { if (!e.geometry) { console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.", this); return; } if (e.geometry.isBufferGeometry) { if (!e.geometry.morphAttributes) { console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.", this); return; } e.morphTargetDictionary[a] !== void 0 && (a = e.morphTargetDictionary[a]); } else { console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.", this); return; } } c = this.BindingType.ArrayElement, this.resolvedProperty = o, this.propertyIndex = a; } else o.fromArray !== void 0 && o.toArray !== void 0 ? (c = this.BindingType.HasFromToArray, this.resolvedProperty = o) : Array.isArray(o) ? (c = this.BindingType.EntireArray, this.resolvedProperty = o) : this.propertyName = n; this.getValue = this.GetterByBindingType[c], this.setValue = this.SetterByBindingTypeAndVersioning[c][s]; } unbind() { this.node = null, this.getValue = this._getValue_unbound, this.setValue = this._setValue_unbound; } } Vt.Composite = ehe; Vt.prototype.BindingType = { Direct: 0, EntireArray: 1, ArrayElement: 2, HasFromToArray: 3 }; Vt.prototype.Versioning = { None: 0, NeedsUpdate: 1, MatrixWorldNeedsUpdate: 2 }; Vt.prototype.GetterByBindingType = [ Vt.prototype._getValue_direct, Vt.prototype._getValue_array, Vt.prototype._getValue_arrayElement, Vt.prototype._getValue_toArray ]; Vt.prototype.SetterByBindingTypeAndVersioning = [ [ // Direct Vt.prototype._setValue_direct, Vt.prototype._setValue_direct_setNeedsUpdate, Vt.prototype._setValue_direct_setMatrixWorldNeedsUpdate ], [ // EntireArray Vt.prototype._setValue_array, Vt.prototype._setValue_array_setNeedsUpdate, Vt.prototype._setValue_array_setMatrixWorldNeedsUpdate ], [ // ArrayElement Vt.prototype._setValue_arrayElement, Vt.prototype._setValue_arrayElement_setNeedsUpdate, Vt.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate ], [ // HasToFromArray Vt.prototype._setValue_fromArray, Vt.prototype._setValue_fromArray_setNeedsUpdate, Vt.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate ] ]; class PO { constructor() { this.uuid = ln(), this._objects = Array.prototype.slice.call(arguments), this.nCachedObjects_ = 0; const e = {}; this._indicesByUUID = e; for (let i = 0, n = arguments.length; i !== n; ++i) e[arguments[i].uuid] = i; this._paths = [], this._parsedPaths = [], this._bindings = [], this._bindingsIndicesByPath = {}; const r = this; this.stats = { objects: { get total() { return r._objects.length; }, get inUse() { return this.total - r.nCachedObjects_; } }, get bindingsPerObject() { return r._bindings.length; } }; } add() { const e = this._objects, r = this._indicesByUUID, i = this._paths, n = this._parsedPaths, a = this._bindings, o = a.length; let s, c = e.length, l = this.nCachedObjects_; for (let u = 0, d = arguments.length; u !== d; ++u) { const h = arguments[u], f = h.uuid; let p = r[f]; if (p === void 0) { p = c++, r[f] = p, e.push(h); for (let m = 0, y = o; m !== y; ++m) a[m].push(new Vt(h, i[m], n[m])); } else if (p < l) { s = e[p]; const m = --l, y = e[m]; r[y.uuid] = p, e[p] = y, r[f] = m, e[m] = h; for (let g = 0, v = o; g !== v; ++g) { const x = a[g], w = x[m]; let S = x[p]; x[p] = w, S === void 0 && (S = new Vt(h, i[g], n[g])), x[m] = S; } } else e[p] !== s && console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes."); } this.nCachedObjects_ = l; } remove() { const e = this._objects, r = this._indicesByUUID, i = this._bindings, n = i.length; let a = this.nCachedObjects_; for (let o = 0, s = arguments.length; o !== s; ++o) { const c = arguments[o], l = c.uuid, u = r[l]; if (u !== void 0 && u >= a) { const d = a++, h = e[d]; r[h.uuid] = u, e[u] = h, r[l] = d, e[d] = c; for (let f = 0, p = n; f !== p; ++f) { const m = i[f], y = m[d], g = m[u]; m[u] = y, m[d] = g; } } } this.nCachedObjects_ = a; } // remove & forget uncache() { const e = this._objects, r = this._indicesByUUID, i = this._bindings, n = i.length; let a = this.nCachedObjects_, o = e.length; for (let s = 0, c = arguments.length; s !== c; ++s) { const l = arguments[s], u = l.uuid, d = r[u]; if (d !== void 0) if (delete r[u], d < a) { const h = --a, f = e[h], p = --o, m = e[p]; r[f.uuid] = d, e[d] = f, r[m.uuid] = h, e[h] = m, e.pop(); for (let y = 0, g = n; y !== g; ++y) { const v = i[y], x = v[h], w = v[p]; v[d] = x, v[h] = w, v.pop(); } } else { const h = --o, f = e[h]; h > 0 && (r[f.uuid] = d), e[d] = f, e.pop(); for (let p = 0, m = n; p !== m; ++p) { const y = i[p]; y[d] = y[h], y.pop(); } } } this.nCachedObjects_ = a; } // Internal interface used by befriended PropertyBinding.Composite: subscribe_(e, r) { const i = this._bindingsIndicesByPath; let n = i[e]; const a = this._bindings; if (n !== void 0) return a[n]; const o = this._paths, s = this._parsedPaths, c = this._objects, l = c.length, u = this.nCachedObjects_, d = new Array(l); n = a.length, i[e] = n, o.push(e), s.push(r), a.push(d); for (let h = u, f = c.length; h !== f; ++h) { const p = c[h]; d[h] = new Vt(p, e, r); } return d; } unsubscribe_(e) { const r = this._bindingsIndicesByPath, i = r[e]; if (i !== void 0) { const n = this._paths, a = this._parsedPaths, o = this._bindings, s = o.length - 1, c = o[s], l = e[s]; r[l] = i, o[i] = c, o.pop(), a[i] = a[s], a.pop(), n[i] = n[s], n.pop(); } } } PO.prototype.isAnimationObjectGroup = !0; class the { constructor(e, r, i = null, n = r.blendMode) { this._mixer = e, this._clip = r, this._localRoot = i, this.blendMode = n; const a = r.tracks, o = a.length, s = new Array(o), c = { endingStart: nl, endingEnd: nl }; for (let l = 0; l !== o; ++l) { const u = a[l].createInterpolant(null); s[l] = u, u.settings = c; } this._interpolantSettings = c, this._interpolants = s, this._propertyBindings = new Array(o), this._cacheIndex = null, this._byClipCacheIndex = null, this._timeScaleInterpolant = null, this._weightInterpolant = null, this.loop = MR, this._loopCount = -1, this._startTime = null, this.time = 0, this.timeScale = 1, this._effectiveTimeScale = 1, this.weight = 1, this._effectiveWeight = 1, this.repetitions = 1 / 0, this.paused = !1, this.enabled = !0, this.clampWhenFinished = !1, this.zeroSlopeAtStart = !0, this.zeroSlopeAtEnd = !0; } // State & Scheduling play() { return this._mixer._activateAction(this), this; } stop() { return this._mixer._deactivateAction(this), this.reset(); } reset() { return this.paused = !1, this.enabled = !0, this.time = 0, this._loopCount = -1, this._startTime = null, this.stopFading().stopWarping(); } isRunning() { return this.enabled && !this.paused && this.timeScale !== 0 && this._startTime === null && this._mixer._isActiveAction(this); } // return true when play has been called isScheduled() { return this._mixer._isActiveAction(this); } startAt(e) { return this._startTime = e, this; } setLoop(e, r) { return this.loop = e, this.repetitions = r, this; } // Weight // set the weight stopping any scheduled fading // although .enabled = false yields an effective weight of zero, this // method does *not* change .enabled, because it would be confusing setEffectiveWeight(e) { return this.weight = e, this._effectiveWeight = this.enabled ? e : 0, this.stopFading(); } // return the weight considering fading and .enabled getEffectiveWeight() { return this._effectiveWeight; } fadeIn(e) { return this._scheduleFading(e, 0, 1); } fadeOut(e) { return this._scheduleFading(e, 1, 0); } crossFadeFrom(e, r, i) { if (e.fadeOut(r), this.fadeIn(r), i) { const n = this._clip.duration, a = e._clip.duration, o = a / n, s = n / a; e.warp(1, o, r), this.warp(s, 1, r); } return this; } crossFadeTo(e, r, i) { return e.crossFadeFrom(this, r, i); } stopFading() { const e = this._weightInterpolant; return e !== null && (this._weightInterpolant = null, this._mixer._takeBackControlInterpolant(e)), this; } // Time Scale Control // set the time scale stopping any scheduled warping // although .paused = true yields an effective time scale of zero, this // method does *not* change .paused, because it would be confusing setEffectiveTimeScale(e) { return this.timeScale = e, this._effectiveTimeScale = this.paused ? 0 : e, this.stopWarping(); } // return the time scale considering warping and .paused getEffectiveTimeScale() { return this._effectiveTimeScale; } setDuration(e) { return this.timeScale = this._clip.duration / e, this.stopWarping(); } syncWith(e) { return this.time = e.time, this.timeScale = e.timeScale, this.stopWarping(); } halt(e) { return this.warp(this._effectiveTimeScale, 0, e); } warp(e, r, i) { const n = this._mixer, a = n.time, o = this.timeScale; let s = this._timeScaleInterpolant; s === null && (s = n._lendControlInterpolant(), this._timeScaleInterpolant = s); const c = s.parameterPositions, l = s.sampleValues; return c[0] = a, c[1] = a + i, l[0] = e / o, l[1] = r / o, this; } stopWarping() { const e = this._timeScaleInterpolant; return e !== null && (this._timeScaleInterpolant = null, this._mixer._takeBackControlInterpolant(e)), this; } // Object Accessors getMixer() { return this._mixer; } getClip() { return this._clip; } getRoot() { return this._localRoot || this._mixer._root; } // Interna _update(e, r, i, n) { if (!this.enabled) { this._updateWeight(e); return; } const a = this._startTime; if (a !== null) { const c = (e - a) * i; if (c < 0 || i === 0) return; this._startTime = null, r = i * c; } r *= this._updateTimeScale(e); const o = this._updateTime(r), s = this._updateWeight(e); if (s > 0) { const c = this._interpolants, l = this._propertyBindings; switch (this.blendMode) { case Ox: for (let u = 0, d = c.length; u !== d; ++u) c[u].evaluate(o), l[u].accumulateAdditive(s); break; case ov: default: for (let u = 0, d = c.length; u !== d; ++u) c[u].evaluate(o), l[u].accumulate(n, s); } } } _updateWeight(e) { let r = 0; if (this.enabled) { r = this.weight; const i = this._weightInterpolant; if (i !== null) { const n = i.evaluate(e)[0]; r *= n, e > i.parameterPositions[1] && (this.stopFading(), n === 0 && (this.enabled = !1)); } } return this._effectiveWeight = r, r; } _updateTimeScale(e) { let r = 0; if (!this.paused) { r = this.timeScale; const i = this._timeScaleInterpolant; if (i !== null) { const n = i.evaluate(e)[0]; r *= n, e > i.parameterPositions[1] && (this.stopWarping(), r === 0 ? this.paused = !0 : this.timeScale = r); } } return this._effectiveTimeScale = r, r; } _updateTime(e) { const r = this._clip.duration, i = this.loop; let n = this.time + e, a = this._loopCount; const o = i === ER; if (e === 0) return a === -1 ? n : o && (a & 1) === 1 ? r - n : n; if (i === SR) { a === -1 && (this._loopCount = 0, this._setEndings(!0, !0, !1)); e: { if (n >= r) n = r; else if (n < 0) n = 0; else { this.time = n; break e; } this.clampWhenFinished ? this.paused = !0 : this.enabled = !1, this.time = n, this._mixer.dispatchEvent({ type: "finished", action: this, direction: e < 0 ? -1 : 1 }); } } else { if (a === -1 && (e >= 0 ? (a = 0, this._setEndings(!0, this.repetitions === 0, o)) : this._setEndings(this.repetitions === 0, !0, o)), n >= r || n < 0) { const s = Math.floor(n / r); n -= r * s, a += Math.abs(s); const c = this.repetitions - a; if (c <= 0) this.clampWhenFinished ? this.paused = !0 : this.enabled = !1, n = e > 0 ? r : 0, this.time = n, this._mixer.dispatchEvent({ type: "finished", action: this, direction: e > 0 ? 1 : -1 }); else { if (c === 1) { const l = e < 0; this._setEndings(l, !l, o); } else this._setEndings(!1, !1, o); this._loopCount = a, this.time = n, this._mixer.dispatchEvent({ type: "loop", action: this, loopDelta: s }); } } else this.time = n; if (o && (a & 1) === 1) return r - n; } return n; } _setEndings(e, r, i) { const n = this._interpolantSettings; i ? (n.endingStart = al, n.endingEnd = al) : (e ? n.endingStart = this.zeroSlopeAtStart ? al : nl : n.endingStart = Oh, r ? n.endingEnd = this.zeroSlopeAtEnd ? al : nl : n.endingEnd = Oh); } _scheduleFading(e, r, i) { const n = this._mixer, a = n.time; let o = this._weightInterpolant; o === null && (o = n._lendControlInterpolant(), this._weightInterpolant = o); const s = o.parameterPositions, c = o.sampleValues; return s[0] = a, c[0] = r, s[1] = a + e, c[1] = i, this; } } class RO extends Os { constructor(e) { super(), this._root = e, this._initMemoryManager(), this._accuIndex = 0, this.time = 0, this.timeScale = 1; } _bindAction(e, r) { const i = e._localRoot || this._root, n = e._clip.tracks, a = n.length, o = e._propertyBindings, s = e._interpolants, c = i.uuid, l = this._bindingsByRootAndName; let u = l[c]; u === void 0 && (u = {}, l[c] = u); for (let d = 0; d !== a; ++d) { const h = n[d], f = h.name; let p = u[f]; if (p !== void 0) o[d] = p; else { if (p = o[d], p !== void 0) { p._cacheIndex === null && (++p.referenceCount, this._addInactiveBinding(p, c, f)); continue; } const m = r && r._propertyBindings[d].binding.parsedPath; p = new kO( Vt.create(i, f, m), h.ValueTypeName, h.getValueSize() ), ++p.referenceCount, this._addInactiveBinding(p, c, f), o[d] = p; } s[d].resultBuffer = p.buffer; } } _activateAction(e) { if (!this._isActiveAction(e)) { if (e._cacheIndex === null) { const i = (e._localRoot || this._root).uuid, n = e._clip.uuid, a = this._actionsByClip[n]; this._bindAction( e, a && a.knownActions[0] ), this._addInactiveAction(e, n, i); } const r = e._propertyBindings; for (let i = 0, n = r.length; i !== n; ++i) { const a = r[i]; a.useCount++ === 0 && (this._lendBinding(a), a.saveOriginalState()); } this._lendAction(e); } } _deactivateAction(e) { if (this._isActiveAction(e)) { const r = e._propertyBindings; for (let i = 0, n = r.length; i !== n; ++i) { const a = r[i]; --a.useCount === 0 && (a.restoreOriginalState(), this._takeBackBinding(a)); } this._takeBackAction(e); } } // Memory manager _initMemoryManager() { this._actions = [], this._nActiveActions = 0, this._actionsByClip = {}, this._bindings = [], this._nActiveBindings = 0, this._bindingsByRootAndName = {}, this._controlInterpolants = [], this._nActiveControlInterpolants = 0; const e = this; this.stats = { actions: { get total() { return e._actions.length; }, get inUse() { return e._nActiveActions; } }, bindings: { get total() { return e._bindings.length; }, get inUse() { return e._nActiveBindings; } }, controlInterpolants: { get total() { return e._controlInterpolants.length; }, get inUse() { return e._nActiveControlInterpolants; } } }; } // Memory management for AnimationAction objects _isActiveAction(e) { const r = e._cacheIndex; return r !== null && r < this._nActiveActions; } _addInactiveAction(e, r, i) { const n = this._actions, a = this._actionsByClip; let o = a[r]; if (o === void 0) o = { knownActions: [e], actionByRoot: {} }, e._byClipCacheIndex = 0, a[r] = o; else { const s = o.knownActions; e._byClipCacheIndex = s.length, s.push(e); } e._cacheIndex = n.length, n.push(e), o.actionByRoot[i] = e; } _removeInactiveAction(e) { const r = this._actions, i = r[r.length - 1], n = e._cacheIndex; i._cacheIndex = n, r[n] = i, r.pop(), e._cacheIndex = null; const a = e._clip.uuid, o = this._actionsByClip, s = o[a], c = s.knownActions, l = c[c.length - 1], u = e._byClipCacheIndex; l._byClipCacheIndex = u, c[u] = l, c.pop(), e._byClipCacheIndex = null; const d = s.actionByRoot, h = (e._localRoot || this._root).uuid; delete d[h], c.length === 0 && delete o[a], this._removeInactiveBindingsForAction(e); } _removeInactiveBindingsForAction(e) { const r = e._propertyBindings; for (let i = 0, n = r.length; i !== n; ++i) { const a = r[i]; --a.referenceCount === 0 && this._removeInactiveBinding(a); } } _lendAction(e) { const r = this._actions, i = e._cacheIndex, n = this._nActiveActions++, a = r[n]; e._cacheIndex = n, r[n] = e, a._cacheIndex = i, r[i] = a; } _takeBackAction(e) { const r = this._actions, i = e._cacheIndex, n = --this._nActiveActions, a = r[n]; e._cacheIndex = n, r[n] = e, a._cacheIndex = i, r[i] = a; } // Memory management for PropertyMixer objects _addInactiveBinding(e, r, i) { const n = this._bindingsByRootAndName, a = this._bindings; let o = n[r]; o === void 0 && (o = {}, n[r] = o), o[i] = e, e._cacheIndex = a.length, a.push(e); } _removeInactiveBinding(e) { const r = this._bindings, i = e.binding, n = i.rootNode.uuid, a = i.path, o = this._bindingsByRootAndName, s = o[n], c = r[r.length - 1], l = e._cacheIndex; c._cacheIndex = l, r[l] = c, r.pop(), delete s[a], Object.keys(s).length === 0 && delete o[n]; } _lendBinding(e) { const r = this._bindings, i = e._cacheIndex, n = this._nActiveBindings++, a = r[n]; e._cacheIndex = n, r[n] = e, a._cacheIndex = i, r[i] = a; } _takeBackBinding(e) { const r = this._bindings, i = e._cacheIndex, n = --this._nActiveBindings, a = r[n]; e._cacheIndex = n, r[n] = e, a._cacheIndex = i, r[i] = a; } // Memory management of Interpolants for weight and time scale _lendControlInterpolant() { const e = this._controlInterpolants, r = this._nActiveControlInterpolants++; let i = e[r]; return i === void 0 && (i = new sw( new Float32Array(2), new Float32Array(2), 1, this._controlInterpolantsResultBuffer ), i.__cacheIndex = r, e[r] = i), i; } _takeBackControlInterpolant(e) { const r = this._controlInterpolants, i = e.__cacheIndex, n = --this._nActiveControlInterpolants, a = r[n]; e.__cacheIndex = n, r[n] = e, a.__cacheIndex = i, r[i] = a; } // return an action for a clip optionally using a custom root target // object (this method allocates a lot of dynamic memory in case a // previously unknown clip/root combination is specified) clipAction(e, r, i) { const n = r || this._root, a = n.uuid; let o = typeof e == "string" ? Pu.findByName(n, e) : e; const s = o !== null ? o.uuid : e, c = this._actionsByClip[s]; let l = null; if (i === void 0 && (o !== null ? i = o.blendMode : i = ov), c !== void 0) { const d = c.actionByRoot[a]; if (d !== void 0 && d.blendMode === i) return d; l = c.knownActions[0], o === null && (o = l._clip); } if (o === null) return null; const u = new the(this, o, r, i); return this._bindAction(u, l), this._addInactiveAction(u, s, a), u; } // get an existing action existingAction(e, r) { const i = r || this._root, n = i.uuid, a = typeof e == "string" ? Pu.findByName(i, e) : e, o = a ? a.uuid : e, s = this._actionsByClip[o]; return s !== void 0 && s.actionByRoot[n] || null; } // deactivates all previously scheduled actions stopAllAction() { const e = this._actions, r = this._nActiveActions; for (let i = r - 1; i >= 0; --i) e[i].stop(); return this; } // advance the time and update apply the animation update(e) { e *= this.timeScale; const r = this._actions, i = this._nActiveActions, n = this.time += e, a = Math.sign(e), o = this._accuIndex ^= 1; for (let l = 0; l !== i; ++l) r[l]._update(n, e, a, o); const s = this._bindings, c = this._nActiveBindings; for (let l = 0; l !== c; ++l) s[l].apply(o); return this; } // Allows you to seek to a specific time in an animation. setTime(e) { this.time = 0; for (let r = 0; r < this._actions.length; r++) this._actions[r].time = 0; return this.update(e); } // return this mixer's root target object getRoot() { return this._root; } // free all resources specific to a particular clip uncacheClip(e) { const r = this._actions, i = e.uuid, n = this._actionsByClip, a = n[i]; if (a !== void 0) { const o = a.knownActions; for (let s = 0, c = o.length; s !== c; ++s) { const l = o[s]; this._deactivateAction(l); const u = l._cacheIndex, d = r[r.length - 1]; l._cacheIndex = null, l._byClipCacheIndex = null, d._cacheIndex = u, r[u] = d, r.pop(), this._removeInactiveBindingsForAction(l); } delete n[i]; } } // free all resources specific to a particular root target object uncacheRoot(e) { const r = e.uuid, i = this._actionsByClip; for (const o in i) { const s = i[o].actionByRoot, c = s[r]; c !== void 0 && (this._deactivateAction(c), this._removeInactiveAction(c)); } const n = this._bindingsByRootAndName, a = n[r]; if (a !== void 0) for (const o in a) { const s = a[o]; s.restoreOriginalState(), this._removeInactiveBinding(s); } } // remove a targeted clip from the cache uncacheAction(e, r) { const i = this.existingAction(e, r); i !== null && (this._deactivateAction(i), this._removeInactiveAction(i)); } } RO.prototype._controlInterpolantsResultBuffer = new Float32Array(1); class Mv { constructor(e) { typeof e == "string" && (console.warn("THREE.Uniform: Type parameter is no longer needed."), e = arguments[1]), this.value = e; } clone() { return new Mv(this.value.clone === void 0 ? this.value : this.value.clone()); } } class OO extends Is { constructor(e, r, i = 1) { super(e, r), this.meshPerAttribute = i; } copy(e) { return super.copy(e), this.meshPerAttribute = e.meshPerAttribute, this; } clone(e) { const r = super.clone(e); return r.meshPerAttribute = this.meshPerAttribute, r; } toJSON(e) { const r = super.toJSON(e); return r.isInstancedInterleavedBuffer = !0, r.meshPerAttribute = this.meshPerAttribute, r; } } OO.prototype.isInstancedInterleavedBuffer = !0; class DO { constructor(e, r, i, n, a) { this.buffer = e, this.type = r, this.itemSize = i, this.elementSize = n, this.count = a, this.version = 0; } set needsUpdate(e) { e === !0 && this.version++; } setBuffer(e) { return this.buffer = e, this; } setType(e, r) { return this.type = e, this.elementSize = r, this; } setItemSize(e) { return this.itemSize = e, this; } setCount(e) { return this.count = e, this; } } DO.prototype.isGLBufferAttribute = !0; class rhe { constructor(e, r, i = 0, n = 1 / 0) { this.ray = new Ds(e, r), this.near = i, this.far = n, this.camera = null, this.layers = new $x(), this.params = { Mesh: {}, Line: { threshold: 1 }, LOD: {}, Points: { threshold: 1 }, Sprite: {} }; } set(e, r) { this.ray.set(e, r); } setFromCamera(e, r) { r && r.isPerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(r.matrixWorld), this.ray.direction.set(e.x, e.y, 0.5).unproject(r).sub(this.ray.origin).normalize(), this.camera = r) : r && r.isOrthographicCamera ? (this.ray.origin.set(e.x, e.y, (r.near + r.far) / (r.near - r.far)).unproject(r), this.ray.direction.set(0, 0, -1).transformDirection(r.matrixWorld), this.camera = r) : console.error("THREE.Raycaster: Unsupported camera type: " + r.type); } intersectObject(e, r = !1, i = []) { return E1(e, this, i, r), i.sort($E), i; } intersectObjects(e, r = !1, i = []) { for (let n = 0, a = e.length; n < a; n++) E1(e[n], this, i, r); return i.sort($E), i; } } function $E(t, e) { return t.distance - e.distance; } function E1(t, e, r, i) { if (t.layers.test(e.layers) && t.raycast(e, r), i === !0) { const n = t.children; for (let a = 0, o = n.length; a < o; a++) E1(n[a], e, r, !0); } } class ihe { constructor(e = 1, r = 0, i = 0) { return this.radius = e, this.phi = r, this.theta = i, this; } set(e, r, i) { return this.radius = e, this.phi = r, this.theta = i, this; } copy(e) { return this.radius = e.radius, this.phi = e.phi, this.theta = e.theta, this; } // restrict phi to be betwee EPS and PI-EPS makeSafe() { return this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi)), this; } setFromVector3(e) { return this.setFromCartesianCoords(e.x, e.y, e.z); } setFromCartesianCoords(e, r, i) { return this.radius = Math.sqrt(e * e + r * r + i * i), this.radius === 0 ? (this.theta = 0, this.phi = 0) : (this.theta = Math.atan2(e, i), this.phi = Math.acos(ci(r / this.radius, -1, 1))), this; } clone() { return new this.constructor().copy(this); } } class nhe { constructor(e = 1, r = 0, i = 0) { return this.radius = e, this.theta = r, this.y = i, this; } set(e, r, i) { return this.radius = e, this.theta = r, this.y = i, this; } copy(e) { return this.radius = e.radius, this.theta = e.theta, this.y = e.y, this; } setFromVector3(e) { return this.setFromCartesianCoords(e.x, e.y, e.z); } setFromCartesianCoords(e, r, i) { return this.radius = Math.sqrt(e * e + i * i), this.theta = Math.atan2(e, i), this.y = r, this; } clone() { return new this.constructor().copy(this); } } const VE = /* @__PURE__ */ new je(); class od { constructor(e = new je(1 / 0, 1 / 0), r = new je(-1 / 0, -1 / 0)) { this.min = e, this.max = r; } set(e, r) { return this.min.copy(e), this.max.copy(r), this; } setFromPoints(e) { this.makeEmpty(); for (let r = 0, i = e.length; r < i; r++) this.expandByPoint(e[r]); return this; } setFromCenterAndSize(e, r) { const i = VE.copy(r).multiplyScalar(0.5); return this.min.copy(e).sub(i), this.max.copy(e).add(i), this; } clone() { return new this.constructor().copy(this); } copy(e) { return this.min.copy(e.min), this.max.copy(e.max), this; } makeEmpty() { return this.min.x = this.min.y = 1 / 0, this.max.x = this.max.y = -1 / 0, this; } isEmpty() { return this.max.x < this.min.x || this.max.y < this.min.y; } getCenter(e) { return this.isEmpty() ? e.set(0, 0) : e.addVectors(this.min, this.max).multiplyScalar(0.5); } getSize(e) { return this.isEmpty() ? e.set(0, 0) : e.subVectors(this.max, this.min); } expandByPoint(e) { return this.min.min(e), this.max.max(e), this; } expandByVector(e) { return this.min.sub(e), this.max.add(e), this; } expandByScalar(e) { return this.min.addScalar(-e), this.max.addScalar(e), this; } containsPoint(e) { return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y); } containsBox(e) { return this.min.x <= e.min.x && e.max.x <= this.max.x && this.min.y <= e.min.y && e.max.y <= this.max.y; } getParameter(e, r) { return r.set( (e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y) ); } intersectsBox(e) { return !(e.max.x < this.min.x || e.min.x > this.max.x || e.max.y < this.min.y || e.min.y > this.max.y); } clampPoint(e, r) { return r.copy(e).clamp(this.min, this.max); } distanceToPoint(e) { return VE.copy(e).clamp(this.min, this.max).sub(e).length(); } intersect(e) { return this.min.max(e.min), this.max.min(e.max), this; } union(e) { return this.min.min(e.min), this.max.max(e.max), this; } translate(e) { return this.min.add(e), this.max.add(e), this; } equals(e) { return e.min.equals(this.min) && e.max.equals(this.max); } } od.prototype.isBox2 = !0; const UE = /* @__PURE__ */ new de(), Vf = /* @__PURE__ */ new de(); class IO { constructor(e = new de(), r = new de()) { this.start = e, this.end = r; } set(e, r) { return this.start.copy(e), this.end.copy(r), this; } copy(e) { return this.start.copy(e.start), this.end.copy(e.end), this; } getCenter(e) { return e.addVectors(this.start, this.end).multiplyScalar(0.5); } delta(e) { return e.subVectors(this.end, this.start); } distanceSq() { return this.start.distanceToSquared(this.end); } distance() { return this.start.distanceTo(this.end); } at(e, r) { return this.delta(r).multiplyScalar(e).add(this.start); } closestPointToPointParameter(e, r) { UE.subVectors(e, this.start), Vf.subVectors(this.end, this.start); const i = Vf.dot(Vf); let n = Vf.dot(UE) / i; return r && (n = ci(n, 0, 1)), n; } closestPointToPoint(e, r, i) { const n = this.closestPointToPointParameter(e, r); return this.delta(i).multiplyScalar(n).add(this.start); } applyMatrix4(e) { return this.start.applyMatrix4(e), this.end.applyMatrix4(e), this; } equals(e) { return e.start.equals(this.start) && e.end.equals(this.end); } clone() { return new this.constructor().copy(this); } } class NO extends It { constructor(e) { super(), this.material = e, this.render = function() { }, this.hasPositions = !1, this.hasNormals = !1, this.hasColors = !1, this.hasUvs = !1, this.positionArray = null, this.normalArray = null, this.colorArray = null, this.uvArray = null, this.count = 0; } } NO.prototype.isImmediateRenderObject = !0; const jE = /* @__PURE__ */ new de(); class ahe extends It { constructor(e, r) { super(), this.light = e, this.light.updateMatrixWorld(), this.matrix = e.matrixWorld, this.matrixAutoUpdate = !1, this.color = r; const i = new ft(), n = [ 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, -1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, -1, 1 ]; for (let o = 0, s = 1, c = 32; o < c; o++, s++) { const l = o / c * Math.PI * 2, u = s / c * Math.PI * 2; n.push( Math.cos(l), Math.sin(l), 1, Math.cos(u), Math.sin(u), 1 ); } i.setAttribute("position", new it(n, 3)); const a = new Kr({ fog: !1, toneMapped: !1 }); this.cone = new zi(i, a), this.add(this.cone), this.update(); } dispose() { this.cone.geometry.dispose(), this.cone.material.dispose(); } update() { this.light.updateMatrixWorld(); const e = this.light.distance ? this.light.distance : 1e3, r = e * Math.tan(this.light.angle); this.cone.scale.set(r, r, e), jE.setFromMatrixPosition(this.light.target.matrixWorld), this.cone.lookAt(jE), this.color !== void 0 ? this.cone.material.color.set(this.color) : this.cone.material.color.copy(this.light.color); } } const Bo = /* @__PURE__ */ new de(), Uf = /* @__PURE__ */ new at(), G0 = /* @__PURE__ */ new at(); class BO extends zi { constructor(e) { const r = FO(e), i = new ft(), n = [], a = [], o = new Je(0, 0, 1), s = new Je(0, 1, 0); for (let l = 0; l < r.length; l++) { const u = r[l]; u.parent && u.parent.isBone && (n.push(0, 0, 0), n.push(0, 0, 0), a.push(o.r, o.g, o.b), a.push(s.r, s.g, s.b)); } i.setAttribute("position", new it(n, 3)), i.setAttribute("color", new it(a, 3)); const c = new Kr({ vertexColors: !0, depthTest: !1, depthWrite: !1, toneMapped: !1, transparent: !0 }); super(i, c), this.type = "SkeletonHelper", this.isSkeletonHelper = !0, this.root = e, this.bones = r, this.matrix = e.matrixWorld, this.matrixAutoUpdate = !1; } updateMatrixWorld(e) { const r = this.bones, i = this.geometry, n = i.getAttribute("position"); G0.copy(this.root.matrixWorld).invert(); for (let a = 0, o = 0; a < r.length; a++) { const s = r[a]; s.parent && s.parent.isBone && (Uf.multiplyMatrices(G0, s.matrixWorld), Bo.setFromMatrixPosition(Uf), n.setXYZ(o, Bo.x, Bo.y, Bo.z), Uf.multiplyMatrices(G0, s.parent.matrixWorld), Bo.setFromMatrixPosition(Uf), n.setXYZ(o + 1, Bo.x, Bo.y, Bo.z), o += 2); } i.getAttribute("position").needsUpdate = !0, super.updateMatrixWorld(e); } } function FO(t) { const e = []; t && t.isBone && e.push(t); for (let r = 0; r < t.children.length; r++) e.push.apply(e, FO(t.children[r])); return e; } class ohe extends Fr { constructor(e, r, i) { const n = new Dl(r, 4, 2), a = new Hi({ wireframe: !0, fog: !1, toneMapped: !1 }); super(n, a), this.light = e, this.light.updateMatrixWorld(), this.color = i, this.type = "PointLightHelper", this.matrix = this.light.matrixWorld, this.matrixAutoUpdate = !1, this.update(); } dispose() { this.geometry.dispose(), this.material.dispose(); } update() { this.color !== void 0 ? this.material.color.set(this.color) : this.material.color.copy(this.light.color); } } const she = /* @__PURE__ */ new de(), HE = /* @__PURE__ */ new Je(), GE = /* @__PURE__ */ new Je(); class lhe extends It { constructor(e, r, i) { super(), this.light = e, this.light.updateMatrixWorld(), this.matrix = e.matrixWorld, this.matrixAutoUpdate = !1, this.color = i; const n = new Rl(r); n.rotateY(Math.PI * 0.5), this.material = new Hi({ wireframe: !0, fog: !1, toneMapped: !1 }), this.color === void 0 && (this.material.vertexColors = !0); const a = n.getAttribute("position"), o = new Float32Array(a.count * 3); n.setAttribute("color", new kt(o, 3)), this.add(new Fr(n, this.material)), this.update(); } dispose() { this.children[0].geometry.dispose(), this.children[0].material.dispose(); } update() { const e = this.children[0]; if (this.color !== void 0) this.material.color.set(this.color); else { const r = e.geometry.getAttribute("color"); HE.copy(this.light.color), GE.copy(this.light.groundColor); for (let i = 0, n = r.count; i < n; i++) { const a = i < n / 2 ? HE : GE; r.setXYZ(i, a.r, a.g, a.b); } r.needsUpdate = !0; } e.lookAt(she.setFromMatrixPosition(this.light.matrixWorld).negate()); } } class zO extends zi { constructor(e = 10, r = 10, i = 4473924, n = 8947848) { i = new Je(i), n = new Je(n); const a = r / 2, o = e / r, s = e / 2, c = [], l = []; for (let h = 0, f = 0, p = -s; h <= r; h++, p += o) { c.push(-s, 0, p, s, 0, p), c.push(p, 0, -s, p, 0, s); const m = h === a ? i : n; m.toArray(l, f), f += 3, m.toArray(l, f), f += 3, m.toArray(l, f), f += 3, m.toArray(l, f), f += 3; } const u = new ft(); u.setAttribute("position", new it(c, 3)), u.setAttribute("color", new it(l, 3)); const d = new Kr({ vertexColors: !0, toneMapped: !1 }); super(u, d), this.type = "GridHelper"; } } class che extends zi { constructor(e = 10, r = 16, i = 8, n = 64, a = 4473924, o = 8947848) { a = new Je(a), o = new Je(o); const s = [], c = []; for (let d = 0; d <= r; d++) { const h = d / r * (Math.PI * 2), f = Math.sin(h) * e, p = Math.cos(h) * e; s.push(0, 0, 0), s.push(f, 0, p); const m = d & 1 ? a : o; c.push(m.r, m.g, m.b), c.push(m.r, m.g, m.b); } for (let d = 0; d <= i; d++) { const h = d & 1 ? a : o, f = e - e / i * d; for (let p = 0; p < n; p++) { let m = p / n * (Math.PI * 2), y = Math.sin(m) * f, g = Math.cos(m) * f; s.push(y, 0, g), c.push(h.r, h.g, h.b), m = (p + 1) / n * (Math.PI * 2), y = Math.sin(m) * f, g = Math.cos(m) * f, s.push(y, 0, g), c.push(h.r, h.g, h.b); } } const l = new ft(); l.setAttribute("position", new it(s, 3)), l.setAttribute("color", new it(c, 3)); const u = new Kr({ vertexColors: !0, toneMapped: !1 }); super(l, u), this.type = "PolarGridHelper"; } } const WE = /* @__PURE__ */ new de(), jf = /* @__PURE__ */ new de(), qE = /* @__PURE__ */ new de(); class uhe extends It { constructor(e, r, i) { super(), this.light = e, this.light.updateMatrixWorld(), this.matrix = e.matrixWorld, this.matrixAutoUpdate = !1, this.color = i, r === void 0 && (r = 1); let n = new ft(); n.setAttribute("position", new it([ -r, r, 0, r, r, 0, r, -r, 0, -r, -r, 0, -r, r, 0 ], 3)); const a = new Kr({ fog: !1, toneMapped: !1 }); this.lightPlane = new wa(n, a), this.add(this.lightPlane), n = new ft(), n.setAttribute("position", new it([0, 0, 0, 0, 0, 1], 3)), this.targetLine = new wa(n, a), this.add(this.targetLine), this.update(); } dispose() { this.lightPlane.geometry.dispose(), this.lightPlane.material.dispose(), this.targetLine.geometry.dispose(), this.targetLine.material.dispose(); } update() { WE.setFromMatrixPosition(this.light.matrixWorld), jf.setFromMatrixPosition(this.light.target.matrixWorld), qE.subVectors(jf, WE), this.lightPlane.lookAt(jf), this.color !== void 0 ? (this.lightPlane.material.color.set(this.color), this.targetLine.material.color.set(this.color)) : (this.lightPlane.material.color.copy(this.light.color), this.targetLine.material.color.copy(this.light.color)), this.targetLine.lookAt(jf), this.targetLine.scale.z = qE.length(); } } const Hf = /* @__PURE__ */ new de(), Mr = /* @__PURE__ */ new bp(); class dhe extends zi { constructor(e) { const r = new ft(), i = new Kr({ color: 16777215, vertexColors: !0, toneMapped: !1 }), n = [], a = [], o = {}, s = new Je(16755200), c = new Je(16711680), l = new Je(43775), u = new Je(16777215), d = new Je(3355443); h("n1", "n2", s), h("n2", "n4", s), h("n4", "n3", s), h("n3", "n1", s), h("f1", "f2", s), h("f2", "f4", s), h("f4", "f3", s), h("f3", "f1", s), h("n1", "f1", s), h("n2", "f2", s), h("n3", "f3", s), h("n4", "f4", s), h("p", "n1", c), h("p", "n2", c), h("p", "n3", c), h("p", "n4", c), h("u1", "u2", l), h("u2", "u3", l), h("u3", "u1", l), h("c", "t", u), h("p", "c", d), h("cn1", "cn2", d), h("cn3", "cn4", d), h("cf1", "cf2", d), h("cf3", "cf4", d); function h(p, m, y) { f(p, y), f(m, y); } function f(p, m) { n.push(0, 0, 0), a.push(m.r, m.g, m.b), o[p] === void 0 && (o[p] = []), o[p].push(n.length / 3 - 1); } r.setAttribute("position", new it(n, 3)), r.setAttribute("color", new it(a, 3)), super(r, i), this.type = "CameraHelper", this.camera = e, this.camera.updateProjectionMatrix && this.camera.updateProjectionMatrix(), this.matrix = e.matrixWorld, this.matrixAutoUpdate = !1, this.pointMap = o, this.update(); } update() { const e = this.geometry, r = this.pointMap, i = 1, n = 1; Mr.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse), Pr("c", r, e, Mr, 0, 0, -1), Pr("t", r, e, Mr, 0, 0, 1), Pr("n1", r, e, Mr, -i, -n, -1), Pr("n2", r, e, Mr, i, -n, -1), Pr("n3", r, e, Mr, -i, n, -1), Pr("n4", r, e, Mr, i, n, -1), Pr("f1", r, e, Mr, -i, -n, 1), Pr("f2", r, e, Mr, i, -n, 1), Pr("f3", r, e, Mr, -i, n, 1), Pr("f4", r, e, Mr, i, n, 1), Pr("u1", r, e, Mr, i * 0.7, n * 1.1, -1), Pr("u2", r, e, Mr, -i * 0.7, n * 1.1, -1), Pr("u3", r, e, Mr, 0, n * 2, -1), Pr("cf1", r, e, Mr, -i, 0, 1), Pr("cf2", r, e, Mr, i, 0, 1), Pr("cf3", r, e, Mr, 0, -n, 1), Pr("cf4", r, e, Mr, 0, n, 1), Pr("cn1", r, e, Mr, -i, 0, -1), Pr("cn2", r, e, Mr, i, 0, -1), Pr("cn3", r, e, Mr, 0, -n, -1), Pr("cn4", r, e, Mr, 0, n, -1), e.getAttribute("position").needsUpdate = !0; } dispose() { this.geometry.dispose(), this.material.dispose(); } } function Pr(t, e, r, i, n, a, o) { Hf.set(n, a, o).unproject(i); const s = e[t]; if (s !== void 0) { const c = r.getAttribute("position"); for (let l = 0, u = s.length; l < u; l++) c.setXYZ(s[l], Hf.x, Hf.y, Hf.z); } } const Gf = /* @__PURE__ */ new Ki(); class $O extends zi { constructor(e, r = 16776960) { const i = new Uint16Array([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7]), n = new Float32Array(8 * 3), a = new ft(); a.setIndex(new kt(i, 1)), a.setAttribute("position", new kt(n, 3)), super(a, new Kr({ color: r, toneMapped: !1 })), this.object = e, this.type = "BoxHelper", this.matrixAutoUpdate = !1, this.update(); } update(e) { if (e !== void 0 && console.warn("THREE.BoxHelper: .update() has no longer arguments."), this.object !== void 0 && Gf.setFromObject(this.object), Gf.isEmpty()) return; const r = Gf.min, i = Gf.max, n = this.geometry.attributes.position, a = n.array; a[0] = i.x, a[1] = i.y, a[2] = i.z, a[3] = r.x, a[4] = i.y, a[5] = i.z, a[6] = r.x, a[7] = r.y, a[8] = i.z, a[9] = i.x, a[10] = r.y, a[11] = i.z, a[12] = i.x, a[13] = i.y, a[14] = r.z, a[15] = r.x, a[16] = i.y, a[17] = r.z, a[18] = r.x, a[19] = r.y, a[20] = r.z, a[21] = i.x, a[22] = r.y, a[23] = r.z, n.needsUpdate = !0, this.geometry.computeBoundingSphere(); } setFromObject(e) { return this.object = e, this.update(), this; } copy(e) { return zi.prototype.copy.call(this, e), this.object = e.object, this; } } class hhe extends zi { constructor(e, r = 16776960) { const i = new Uint16Array([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7]), n = [1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1], a = new ft(); a.setIndex(new kt(i, 1)), a.setAttribute("position", new it(n, 3)), super(a, new Kr({ color: r, toneMapped: !1 })), this.box = e, this.type = "Box3Helper", this.geometry.computeBoundingSphere(); } updateMatrixWorld(e) { const r = this.box; r.isEmpty() || (r.getCenter(this.position), r.getSize(this.scale), this.scale.multiplyScalar(0.5), super.updateMatrixWorld(e)); } } class phe extends wa { constructor(e, r = 1, i = 16776960) { const n = i, a = [1, -1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0], o = new ft(); o.setAttribute("position", new it(a, 3)), o.computeBoundingSphere(), super(o, new Kr({ color: n, toneMapped: !1 })), this.type = "PlaneHelper", this.plane = e, this.size = r; const s = [1, 1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1], c = new ft(); c.setAttribute("position", new it(s, 3)), c.computeBoundingSphere(), this.add(new Fr(c, new Hi({ color: n, opacity: 0.2, transparent: !0, depthWrite: !1, toneMapped: !1 }))); } updateMatrixWorld(e) { let r = -this.plane.constant; Math.abs(r) < 1e-8 && (r = 1e-8), this.scale.set(0.5 * this.size, 0.5 * this.size, r), this.children[0].material.side = r < 0 ? Or : xs, this.lookAt(this.plane.normal), super.updateMatrixWorld(e); } } const XE = /* @__PURE__ */ new de(); let Wf, W0; class fhe extends It { // dir is assumed to be normalized constructor(e = new de(0, 0, 1), r = new de(0, 0, 0), i = 1, n = 16776960, a = i * 0.2, o = a * 0.2) { super(), this.type = "ArrowHelper", Wf === void 0 && (Wf = new ft(), Wf.setAttribute("position", new it([0, 0, 0, 0, 1, 0], 3)), W0 = new Ss(0, 0.5, 1, 5, 1), W0.translate(0, -0.5, 0)), this.position.copy(r), this.line = new wa(Wf, new Kr({ color: n, toneMapped: !1 })), this.line.matrixAutoUpdate = !1, this.add(this.line), this.cone = new Fr(W0, new Hi({ color: n, toneMapped: !1 })), this.cone.matrixAutoUpdate = !1, this.add(this.cone), this.setDirection(e), this.setLength(i, a, o); } setDirection(e) { if (e.y > 0.99999) this.quaternion.set(0, 0, 0, 1); else if (e.y < -0.99999) this.quaternion.set(1, 0, 0, 0); else { XE.set(e.z, 0, -e.x).normalize(); const r = Math.acos(e.y); this.quaternion.setFromAxisAngle(XE, r); } } setLength(e, r = e * 0.2, i = r * 0.2) { this.line.scale.set(1, Math.max(1e-4, e - r), 1), this.line.updateMatrix(), this.cone.scale.set(i, r, i), this.cone.position.y = e, this.cone.updateMatrix(); } setColor(e) { this.line.material.color.set(e), this.cone.material.color.set(e); } copy(e) { return super.copy(e, !1), this.line.copy(e.line), this.cone.copy(e.cone), this; } } class VO extends zi { constructor(e = 1) { const r = [ 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e ], i = [ 1, 0, 0, 1, 0.6, 0, 0, 1, 0, 0.6, 1, 0, 0, 0, 1, 0, 0.6, 1 ], n = new ft(); n.setAttribute("position", new it(r, 3)), n.setAttribute("color", new it(i, 3)); const a = new Kr({ vertexColors: !0, toneMapped: !1 }); super(n, a), this.type = "AxesHelper"; } setColors(e, r, i) { const n = new Je(), a = this.geometry.attributes.color.array; return n.set(e), n.toArray(a, 0), n.toArray(a, 3), n.set(r), n.toArray(a, 6), n.toArray(a, 9), n.set(i), n.toArray(a, 12), n.toArray(a, 15), this.geometry.attributes.color.needsUpdate = !0, this; } dispose() { this.geometry.dispose(), this.material.dispose(); } } const UO = new Float32Array(1), mhe = new Int32Array(UO.buffer); class ghe { // Converts float32 to float16 (stored as uint16 value). static toHalfFloat(e) { UO[0] = e; const r = mhe[0]; let i = r >> 16 & 32768, n = r >> 12 & 2047; const a = r >> 23 & 255; return a < 103 ? i : a > 142 ? (i |= 31744, i |= (a == 255 ? 0 : 1) && r & 8388607, i) : a < 113 ? (n |= 2048, i |= (n >> 114 - a) + (n >> 113 - a & 1), i) : (i |= a - 112 << 10 | n >> 1, i += n & 1, i); } } const Wc = 4, ss = 8, aa = Math.pow(2, ss), jO = [0.125, 0.215, 0.35, 0.446, 0.526, 0.582], HO = ss - Wc + 1 + jO.length, Ec = 20, da = { [Bi]: 0, [kl]: 1, [lv]: 2, [Ix]: 3, [Nx]: 4, [Bx]: 5, [sv]: 6 }, Ys = new Hi({ side: Or, depthWrite: !1, depthTest: !1 }), vhe = new Fr(new oo(), Ys), q0 = /* @__PURE__ */ new ad(), { _lodPlanes: kd, _sizeLods: ZE, _sigmas: qf } = /* @__PURE__ */ xhe(), YE = /* @__PURE__ */ new Je(); let X0 = null; const Ks = (1 + Math.sqrt(5)) / 2, Tc = 1 / Ks, KE = [ /* @__PURE__ */ new de(1, 1, 1), /* @__PURE__ */ new de(-1, 1, 1), /* @__PURE__ */ new de(1, 1, -1), /* @__PURE__ */ new de(-1, 1, -1), /* @__PURE__ */ new de(0, Ks, Tc), /* @__PURE__ */ new de(0, Ks, -Tc), /* @__PURE__ */ new de(Tc, 0, Ks), /* @__PURE__ */ new de(-Tc, 0, Ks), /* @__PURE__ */ new de(Ks, Tc, 0), /* @__PURE__ */ new de(-Ks, Tc, 0) ]; function JE(t) { const e = Math.max(t.r, t.g, t.b), r = Math.min(Math.max(Math.ceil(Math.log2(e)), -128), 127); return t.multiplyScalar(Math.pow(2, -r)), (r + 128) / 255; } class yhe { constructor(e) { this._renderer = e, this._pingPongRenderTarget = null, this._blurMaterial = whe(Ec), this._equirectShader = null, this._cubemapShader = null, this._compileMaterial(this._blurMaterial); } /** * Generates a PMREM from a supplied Scene, which can be faster than using an * image if networking bandwidth is low. Optional sigma specifies a blur radius * in radians to be applied to the scene before PMREM generation. Optional near * and far planes ensure the scene is rendered in its entirety (the cubeCamera * is placed at the origin). */ fromScene(e, r = 0, i = 0.1, n = 100) { X0 = this._renderer.getRenderTarget(); const a = this._allocateTargets(); return this._sceneToCubeUV(e, i, n, a), r > 0 && this._blur(a, 0, 0, r), this._applyPMREM(a), this._cleanup(a), a; } /** * Generates a PMREM from an equirectangular texture, which can be either LDR * (RGBFormat) or HDR (RGBEFormat). The ideal input image size is 1k (1024 x 512), * as this matches best with the 256 x 256 cubemap output. */ fromEquirectangular(e) { return this._fromTexture(e); } /** * Generates a PMREM from an cubemap texture, which can be either LDR * (RGBFormat) or HDR (RGBEFormat). The ideal input cube size is 256 x 256, * as this matches best with the 256 x 256 cubemap output. */ fromCubemap(e) { return this._fromTexture(e); } /** * Pre-compiles the cubemap shader. You can get faster start-up by invoking this method during * your texture's network fetch for increased concurrency. */ compileCubemapShader() { this._cubemapShader === null && (this._cubemapShader = tT(), this._compileMaterial(this._cubemapShader)); } /** * Pre-compiles the equirectangular shader. You can get faster start-up by invoking this method during * your texture's network fetch for increased concurrency. */ compileEquirectangularShader() { this._equirectShader === null && (this._equirectShader = eT(), this._compileMaterial(this._equirectShader)); } /** * Disposes of the PMREMGenerator's internal memory. Note that PMREMGenerator is a static class, * so you should not need more than one PMREMGenerator object. If you do, calling dispose() on * one of them will cause any others to also become unusable. */ dispose() { this._blurMaterial.dispose(), this._cubemapShader !== null && this._cubemapShader.dispose(), this._equirectShader !== null && this._equirectShader.dispose(); for (let e = 0; e < kd.length; e++) kd[e].dispose(); } // private interface _cleanup(e) { this._pingPongRenderTarget.dispose(), this._renderer.setRenderTarget(X0), e.scissorTest = !1, Xf(e, 0, 0, e.width, e.height); } _fromTexture(e) { X0 = this._renderer.getRenderTarget(); const r = this._allocateTargets(e); return this._textureToCubeUV(e, r), this._applyPMREM(r), this._cleanup(r), r; } _allocateTargets(e) { const r = { magFilter: Dr, minFilter: Dr, generateMipmaps: !1, type: Al, format: $P, encoding: bhe(e) ? e.encoding : lv, depthBuffer: !1 }, i = QE(r); return i.depthBuffer = !e, this._pingPongRenderTarget = QE(r), i; } _compileMaterial(e) { const r = new Fr(kd[0], e); this._renderer.compile(r, q0); } _sceneToCubeUV(e, r, i, n) { const a = new Wr(90, 1, r, i), o = [1, -1, 1, 1, 1, 1], s = [1, 1, 1, -1, -1, -1], c = this._renderer, l = c.autoClear, u = c.outputEncoding, d = c.toneMapping; c.getClearColor(YE), c.toneMapping = ns, c.outputEncoding = Bi, c.autoClear = !1; let h = !1; const f = e.background; if (f) { if (f.isColor) { Ys.color.copy(f).convertSRGBToLinear(), e.background = null; const p = JE(Ys.color); Ys.opacity = p, h = !0; } } else { Ys.color.copy(YE).convertSRGBToLinear(); const p = JE(Ys.color); Ys.opacity = p, h = !0; } for (let p = 0; p < 6; p++) { const m = p % 3; m == 0 ? (a.up.set(0, o[p], 0), a.lookAt(s[p], 0, 0)) : m == 1 ? (a.up.set(0, 0, o[p]), a.lookAt(0, s[p], 0)) : (a.up.set(0, o[p], 0), a.lookAt(0, 0, s[p])), Xf( n, m * aa, p > 2 ? aa : 0, aa, aa ), c.setRenderTarget(n), h && c.render(vhe, a), c.render(e, a); } c.toneMapping = d, c.outputEncoding = u, c.autoClear = l; } _textureToCubeUV(e, r) { const i = this._renderer; e.isCubeTexture ? this._cubemapShader == null && (this._cubemapShader = tT()) : this._equirectShader == null && (this._equirectShader = eT()); const n = e.isCubeTexture ? this._cubemapShader : this._equirectShader, a = new Fr(kd[0], n), o = n.uniforms; o.envMap.value = e, e.isCubeTexture || o.texelSize.value.set(1 / e.image.width, 1 / e.image.height), o.inputEncoding.value = da[e.encoding], o.outputEncoding.value = da[r.texture.encoding], Xf(r, 0, 0, 3 * aa, 2 * aa), i.setRenderTarget(r), i.render(a, q0); } _applyPMREM(e) { const r = this._renderer, i = r.autoClear; r.autoClear = !1; for (let n = 1; n < HO; n++) { const a = Math.sqrt(qf[n] * qf[n] - qf[n - 1] * qf[n - 1]), o = KE[(n - 1) % KE.length]; this._blur(e, n - 1, n, a, o); } r.autoClear = i; } /** * This is a two-pass Gaussian blur for a cubemap. Normally this is done * vertically and horizontally, but this breaks down on a cube. Here we apply * the blur latitudinally (around the poles), and then longitudinally (towards * the poles) to approximate the orthogonally-separable blur. It is least * accurate at the poles, but still does a decent job. */ _blur(e, r, i, n, a) { const o = this._pingPongRenderTarget; this._halfBlur( e, o, r, i, n, "latitudinal", a ), this._halfBlur( o, e, i, i, n, "longitudinal", a ); } _halfBlur(e, r, i, n, a, o, s) { const c = this._renderer, l = this._blurMaterial; o !== "latitudinal" && o !== "longitudinal" && console.error( "blur direction must be either latitudinal or longitudinal!" ); const u = 3, d = new Fr(kd[n], l), h = l.uniforms, f = ZE[i] - 1, p = isFinite(a) ? Math.PI / (2 * f) : 2 * Math.PI / (2 * Ec - 1), m = a / p, y = isFinite(a) ? 1 + Math.floor(u * m) : Ec; y > Ec && console.warn(`sigmaRadians, ${a}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${Ec}`); const g = []; let v = 0; for (let _ = 0; _ < Ec; ++_) { const b = _ / m, T = Math.exp(-b * b / 2); g.push(T), _ == 0 ? v += T : _ < y && (v += 2 * T); } for (let _ = 0; _ < g.length; _++) g[_] = g[_] / v; h.envMap.value = e.texture, h.samples.value = y, h.weights.value = g, h.latitudinal.value = o === "latitudinal", s && (h.poleAxis.value = s), h.dTheta.value = p, h.mipInt.value = ss - i, h.inputEncoding.value = da[e.texture.encoding], h.outputEncoding.value = da[e.texture.encoding]; const x = ZE[n], w = 3 * Math.max(0, aa - 2 * x), S = (n === 0 ? 0 : 2 * aa) + 2 * x * (n > ss - Wc ? n - ss + Wc : 0); Xf(r, w, S, 3 * x, 2 * x), c.setRenderTarget(r), c.render(d, q0); } } function bhe(t) { return t === void 0 || t.type !== Al ? !1 : t.encoding === Bi || t.encoding === kl || t.encoding === sv; } function xhe() { const t = [], e = [], r = []; let i = ss; for (let n = 0; n < HO; n++) { const a = Math.pow(2, i); e.push(a); let o = 1 / a; n > ss - Wc ? o = jO[n - ss + Wc - 1] : n == 0 && (o = 0), r.push(o); const s = 1 / (a - 1), c = -s / 2, l = 1 + s / 2, u = [c, c, l, c, l, l, c, c, l, l, c, l], d = 6, h = 6, f = 3, p = 2, m = 1, y = new Float32Array(f * h * d), g = new Float32Array(p * h * d), v = new Float32Array(m * h * d); for (let w = 0; w < d; w++) { const S = w % 3 * 2 / 3 - 1, _ = w > 2 ? 0 : -1, b = [ S, _, 0, S + 2 / 3, _, 0, S + 2 / 3, _ + 1, 0, S, _, 0, S + 2 / 3, _ + 1, 0, S, _ + 1, 0 ]; y.set(b, f * h * w), g.set(u, p * h * w); const T = [w, w, w, w, w, w]; v.set(T, m * h * w); } const x = new ft(); x.setAttribute("position", new kt(y, f)), x.setAttribute("uv", new kt(g, p)), x.setAttribute("faceIndex", new kt(v, m)), t.push(x), i > Wc && i--; } return { _lodPlanes: t, _sizeLods: e, _sigmas: r }; } function QE(t) { const e = new Hn(3 * aa, 3 * aa, t); return e.texture.mapping = ed, e.texture.name = "PMREM.cubeUv", e.scissorTest = !0, e; } function Xf(t, e, r, i, n) { t.viewport.set(e, r, i, n), t.scissor.set(e, r, i, n); } function whe(t) { const e = new Float32Array(t), r = new de(0, 1, 0); return new nd({ name: "SphericalGaussianBlur", defines: { n: t }, uniforms: { envMap: { value: null }, samples: { value: 1 }, weights: { value: e }, latitudinal: { value: !1 }, dTheta: { value: 0 }, mipInt: { value: 0 }, poleAxis: { value: r }, inputEncoding: { value: da[Bi] }, outputEncoding: { value: da[Bi] } }, vertexShader: Mw(), fragmentShader: ( /* glsl */ ` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform sampler2D envMap; uniform int samples; uniform float weights[ n ]; uniform bool latitudinal; uniform float dTheta; uniform float mipInt; uniform vec3 poleAxis; ${Ew()} #define ENVMAP_TYPE_CUBE_UV #include vec3 getSample( float theta, vec3 axis ) { float cosTheta = cos( theta ); // Rodrigues' axis-angle rotation vec3 sampleDirection = vOutputDirection * cosTheta + cross( axis, vOutputDirection ) * sin( theta ) + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); return bilinearCubeUV( envMap, sampleDirection, mipInt ); } void main() { vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); if ( all( equal( axis, vec3( 0.0 ) ) ) ) { axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); } axis = normalize( axis ); gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); for ( int i = 1; i < n; i++ ) { if ( i >= samples ) { break; } float theta = dTheta * float( i ); gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); } gl_FragColor = linearToOutputTexel( gl_FragColor ); } ` ), blending: Ja, depthTest: !1, depthWrite: !1 }); } function eT() { const t = new je(1, 1); return new nd({ name: "EquirectangularToCubeUV", uniforms: { envMap: { value: null }, texelSize: { value: t }, inputEncoding: { value: da[Bi] }, outputEncoding: { value: da[Bi] } }, vertexShader: Mw(), fragmentShader: ( /* glsl */ ` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform sampler2D envMap; uniform vec2 texelSize; ${Ew()} #include void main() { gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); vec3 outputDirection = normalize( vOutputDirection ); vec2 uv = equirectUv( outputDirection ); vec2 f = fract( uv / texelSize - 0.5 ); uv -= f * texelSize; vec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; uv.x += texelSize.x; vec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; uv.y += texelSize.y; vec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; uv.x -= texelSize.x; vec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; vec3 tm = mix( tl, tr, f.x ); vec3 bm = mix( bl, br, f.x ); gl_FragColor.rgb = mix( tm, bm, f.y ); gl_FragColor = linearToOutputTexel( gl_FragColor ); } ` ), blending: Ja, depthTest: !1, depthWrite: !1 }); } function tT() { return new nd({ name: "CubemapToCubeUV", uniforms: { envMap: { value: null }, inputEncoding: { value: da[Bi] }, outputEncoding: { value: da[Bi] } }, vertexShader: Mw(), fragmentShader: ( /* glsl */ ` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform samplerCube envMap; ${Ew()} void main() { gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); gl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb; gl_FragColor = linearToOutputTexel( gl_FragColor ); } ` ), blending: Ja, depthTest: !1, depthWrite: !1 }); } function Mw() { return ( /* glsl */ ` precision mediump float; precision mediump int; attribute vec3 position; attribute vec2 uv; attribute float faceIndex; varying vec3 vOutputDirection; // RH coordinate system; PMREM face-indexing convention vec3 getDirection( vec2 uv, float face ) { uv = 2.0 * uv - 1.0; vec3 direction = vec3( uv, 1.0 ); if ( face == 0.0 ) { direction = direction.zyx; // ( 1, v, u ) pos x } else if ( face == 1.0 ) { direction = direction.xzy; direction.xz *= -1.0; // ( -u, 1, -v ) pos y } else if ( face == 2.0 ) { direction.x *= -1.0; // ( -u, v, 1 ) pos z } else if ( face == 3.0 ) { direction = direction.zyx; direction.xz *= -1.0; // ( -1, v, -u ) neg x } else if ( face == 4.0 ) { direction = direction.xzy; direction.xy *= -1.0; // ( -u, -1, v ) neg y } else if ( face == 5.0 ) { direction.z *= -1.0; // ( u, v, -1 ) neg z } return direction; } void main() { vOutputDirection = getDirection( uv, faceIndex ); gl_Position = vec4( position, 1.0 ); } ` ); } function Ew() { return ( /* glsl */ ` uniform int inputEncoding; uniform int outputEncoding; #include vec4 inputTexelToLinear( vec4 value ) { if ( inputEncoding == 0 ) { return value; } else if ( inputEncoding == 1 ) { return sRGBToLinear( value ); } else if ( inputEncoding == 2 ) { return RGBEToLinear( value ); } else if ( inputEncoding == 3 ) { return RGBMToLinear( value, 7.0 ); } else if ( inputEncoding == 4 ) { return RGBMToLinear( value, 16.0 ); } else if ( inputEncoding == 5 ) { return RGBDToLinear( value, 256.0 ); } else { return GammaToLinear( value, 2.2 ); } } vec4 linearToOutputTexel( vec4 value ) { if ( outputEncoding == 0 ) { return value; } else if ( outputEncoding == 1 ) { return LinearTosRGB( value ); } else if ( outputEncoding == 2 ) { return LinearToRGBE( value ); } else if ( outputEncoding == 3 ) { return LinearToRGBM( value, 7.0 ); } else if ( outputEncoding == 4 ) { return LinearToRGBM( value, 16.0 ); } else if ( outputEncoding == 5 ) { return LinearToRGBD( value, 256.0 ); } else { return LinearToGamma( value, 2.2 ); } } vec4 envMapTexelToLinear( vec4 color ) { return inputTexelToLinear( color ); } ` ); } const _he = 0, She = 1, Mhe = 0, Ehe = 1, The = 2; function Che(t) { return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."), t; } function Ahe(t = []) { return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."), t.isMultiMaterial = !0, t.materials = t, t.clone = function() { return t.slice(); }, t; } function Lhe(t, e) { return console.warn("THREE.PointCloud has been renamed to THREE.Points."), new id(t, e); } function khe(t) { return console.warn("THREE.Particle has been renamed to THREE.Sprite."), new Mp(t); } function Phe(t, e) { return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."), new id(t, e); } function Rhe(t) { return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."), new Ns(t); } function Ohe(t) { return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."), new Ns(t); } function Dhe(t) { return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."), new Ns(t); } function Ihe(t, e, r) { return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."), new de(t, e, r); } function Nhe(t, e) { return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."), new kt(t, e).setUsage(vu); } function Bhe(t, e) { return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."), new BR(t, e); } function Fhe(t, e) { return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."), new FR(t, e); } function zhe(t, e) { return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."), new zR(t, e); } function $he(t, e) { return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."), new $R(t, e); } function Vhe(t, e) { return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."), new cv(t, e); } function Uhe(t, e) { return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."), new VR(t, e); } function jhe(t, e) { return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."), new uv(t, e); } function Hhe(t, e) { return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."), new it(t, e); } function Ghe(t, e) { return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."), new jR(t, e); } un.create = function(t, e) { return console.log("THREE.Curve.create() has been deprecated"), t.prototype = Object.create(un.prototype), t.prototype.constructor = t, t.prototype.getPoint = e, t; }; zh.prototype.fromPoints = function(t) { return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."), this.setFromPoints(t); }; function Whe(t) { return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."), new VO(t); } function qhe(t, e) { return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."), new $O(t, e); } function Xhe(t, e) { return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."), new zi(new Wx(t.geometry), new Kr({ color: e !== void 0 ? e : 16777215 })); } zO.prototype.setColors = function() { console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead."); }; BO.prototype.update = function() { console.error("THREE.SkeletonHelper: update() no longer needs to be called."); }; function Zhe(t, e) { return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."), new zi(new Qx(t.geometry), new Kr({ color: e !== void 0 ? e : 16777215 })); } xi.prototype.extractUrlBase = function(t) { return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."), eo.extractUrlBase(t); }; xi.Handlers = { add: function() { console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead."); }, get: function() { console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead."); } }; function Yhe(t) { return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."), new dn(t); } function Khe(t) { return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."), new vO(t); } od.prototype.center = function(t) { return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."), this.getCenter(t); }; od.prototype.empty = function() { return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."), this.isEmpty(); }; od.prototype.isIntersectionBox = function(t) { return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."), this.intersectsBox(t); }; od.prototype.size = function(t) { return console.warn("THREE.Box2: .size() has been renamed to .getSize()."), this.getSize(t); }; Ki.prototype.center = function(t) { return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."), this.getCenter(t); }; Ki.prototype.empty = function() { return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."), this.isEmpty(); }; Ki.prototype.isIntersectionBox = function(t) { return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."), this.intersectsBox(t); }; Ki.prototype.isIntersectionSphere = function(t) { return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."), this.intersectsSphere(t); }; Ki.prototype.size = function(t) { return console.warn("THREE.Box3: .size() has been renamed to .getSize()."), this.getSize(t); }; _o.prototype.empty = function() { return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."), this.isEmpty(); }; xp.prototype.setFromMatrix = function(t) { return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."), this.setFromProjectionMatrix(t); }; IO.prototype.center = function(t) { return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."), this.getCenter(t); }; Xr.prototype.flattenToArrayOffset = function(t, e) { return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."), this.toArray(t, e); }; Xr.prototype.multiplyVector3 = function(t) { return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."), t.applyMatrix3(this); }; Xr.prototype.multiplyVector3Array = function() { console.error("THREE.Matrix3: .multiplyVector3Array() has been removed."); }; Xr.prototype.applyToBufferAttribute = function(t) { return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."), t.applyMatrix3(this); }; Xr.prototype.applyToVector3Array = function() { console.error("THREE.Matrix3: .applyToVector3Array() has been removed."); }; Xr.prototype.getInverse = function(t) { return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."), this.copy(t).invert(); }; at.prototype.extractPosition = function(t) { return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."), this.copyPosition(t); }; at.prototype.flattenToArrayOffset = function(t, e) { return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."), this.toArray(t, e); }; at.prototype.getPosition = function() { return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."), new de().setFromMatrixColumn(this, 3); }; at.prototype.setRotationFromQuaternion = function(t) { return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."), this.makeRotationFromQuaternion(t); }; at.prototype.multiplyToArray = function() { console.warn("THREE.Matrix4: .multiplyToArray() has been removed."); }; at.prototype.multiplyVector3 = function(t) { return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."), t.applyMatrix4(this); }; at.prototype.multiplyVector4 = function(t) { return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."), t.applyMatrix4(this); }; at.prototype.multiplyVector3Array = function() { console.error("THREE.Matrix4: .multiplyVector3Array() has been removed."); }; at.prototype.rotateAxis = function(t) { console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."), t.transformDirection(this); }; at.prototype.crossVector = function(t) { return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."), t.applyMatrix4(this); }; at.prototype.translate = function() { console.error("THREE.Matrix4: .translate() has been removed."); }; at.prototype.rotateX = function() { console.error("THREE.Matrix4: .rotateX() has been removed."); }; at.prototype.rotateY = function() { console.error("THREE.Matrix4: .rotateY() has been removed."); }; at.prototype.rotateZ = function() { console.error("THREE.Matrix4: .rotateZ() has been removed."); }; at.prototype.rotateByAxis = function() { console.error("THREE.Matrix4: .rotateByAxis() has been removed."); }; at.prototype.applyToBufferAttribute = function(t) { return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."), t.applyMatrix4(this); }; at.prototype.applyToVector3Array = function() { console.error("THREE.Matrix4: .applyToVector3Array() has been removed."); }; at.prototype.makeFrustum = function(t, e, r, i, n, a) { return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."), this.makePerspective(t, e, i, r, n, a); }; at.prototype.getInverse = function(t) { return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."), this.copy(t).invert(); }; oa.prototype.isIntersectionLine = function(t) { return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."), this.intersectsLine(t); }; vi.prototype.multiplyVector3 = function(t) { return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."), t.applyQuaternion(this); }; vi.prototype.inverse = function() { return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."), this.invert(); }; Ds.prototype.isIntersectionBox = function(t) { return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."), this.intersectsBox(t); }; Ds.prototype.isIntersectionPlane = function(t) { return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."), this.intersectsPlane(t); }; Ds.prototype.isIntersectionSphere = function(t) { return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."), this.intersectsSphere(t); }; Ir.prototype.area = function() { return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."), this.getArea(); }; Ir.prototype.barycoordFromPoint = function(t, e) { return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."), this.getBarycoord(t, e); }; Ir.prototype.midpoint = function(t) { return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."), this.getMidpoint(t); }; Ir.prototypenormal = function(t) { return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."), this.getNormal(t); }; Ir.prototype.plane = function(t) { return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."), this.getPlane(t); }; Ir.barycoordFromPoint = function(t, e, r, i, n) { return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."), Ir.getBarycoord(t, e, r, i, n); }; Ir.normal = function(t, e, r, i) { return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."), Ir.getNormal(t, e, r, i); }; os.prototype.extractAllPoints = function(t) { return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."), this.extractPoints(t); }; os.prototype.extrude = function(t) { return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."), new qn(this, t); }; os.prototype.makeGeometry = function(t) { return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."), new Ol(this, t); }; je.prototype.fromAttribute = function(t, e, r) { return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."), this.fromBufferAttribute(t, e, r); }; je.prototype.distanceToManhattan = function(t) { return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."), this.manhattanDistanceTo(t); }; je.prototype.lengthManhattan = function() { return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."), this.manhattanLength(); }; de.prototype.setEulerFromRotationMatrix = function() { console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead."); }; de.prototype.setEulerFromQuaternion = function() { console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead."); }; de.prototype.getPositionFromMatrix = function(t) { return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."), this.setFromMatrixPosition(t); }; de.prototype.getScaleFromMatrix = function(t) { return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."), this.setFromMatrixScale(t); }; de.prototype.getColumnFromMatrix = function(t, e) { return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."), this.setFromMatrixColumn(e, t); }; de.prototype.applyProjection = function(t) { return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."), this.applyMatrix4(t); }; de.prototype.fromAttribute = function(t, e, r) { return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."), this.fromBufferAttribute(t, e, r); }; de.prototype.distanceToManhattan = function(t) { return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."), this.manhattanDistanceTo(t); }; de.prototype.lengthManhattan = function() { return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."), this.manhattanLength(); }; Qt.prototype.fromAttribute = function(t, e, r) { return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."), this.fromBufferAttribute(t, e, r); }; Qt.prototype.lengthManhattan = function() { return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."), this.manhattanLength(); }; It.prototype.getChildByName = function(t) { return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."), this.getObjectByName(t); }; It.prototype.renderDepth = function() { console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead."); }; It.prototype.translate = function(t, e) { return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."), this.translateOnAxis(e, t); }; It.prototype.getWorldRotation = function() { console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead."); }; It.prototype.applyMatrix = function(t) { return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."), this.applyMatrix4(t); }; Object.defineProperties(It.prototype, { eulerOrder: { get: function() { return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."), this.rotation.order; }, set: function(t) { console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."), this.rotation.order = t; } }, useQuaternion: { get: function() { console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default."); }, set: function() { console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default."); } } }); Fr.prototype.setDrawMode = function() { console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary."); }; Object.defineProperties(Fr.prototype, { drawMode: { get: function() { return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."), TR; }, set: function() { console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary."); } } }); Ep.prototype.initBones = function() { console.error("THREE.SkinnedMesh: initBones() has been removed."); }; Wr.prototype.setLens = function(t, e) { console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."), e !== void 0 && (this.filmGauge = e), this.setFocalLength(t); }; Object.defineProperties(Xn.prototype, { onlyShadow: { set: function() { console.warn("THREE.Light: .onlyShadow has been removed."); } }, shadowCameraFov: { set: function(t) { console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."), this.shadow.camera.fov = t; } }, shadowCameraLeft: { set: function(t) { console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."), this.shadow.camera.left = t; } }, shadowCameraRight: { set: function(t) { console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."), this.shadow.camera.right = t; } }, shadowCameraTop: { set: function(t) { console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."), this.shadow.camera.top = t; } }, shadowCameraBottom: { set: function(t) { console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."), this.shadow.camera.bottom = t; } }, shadowCameraNear: { set: function(t) { console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."), this.shadow.camera.near = t; } }, shadowCameraFar: { set: function(t) { console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."), this.shadow.camera.far = t; } }, shadowCameraVisible: { set: function() { console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead."); } }, shadowBias: { set: function(t) { console.warn("THREE.Light: .shadowBias is now .shadow.bias."), this.shadow.bias = t; } }, shadowDarkness: { set: function() { console.warn("THREE.Light: .shadowDarkness has been removed."); } }, shadowMapWidth: { set: function(t) { console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."), this.shadow.mapSize.width = t; } }, shadowMapHeight: { set: function(t) { console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."), this.shadow.mapSize.height = t; } } }); Object.defineProperties(kt.prototype, { length: { get: function() { return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."), this.array.length; } }, dynamic: { get: function() { return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."), this.usage === vu; }, set: function() { console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."), this.setUsage(vu); } } }); kt.prototype.setDynamic = function(t) { return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."), this.setUsage(t === !0 ? vu : gu), this; }; kt.prototype.copyIndicesArray = function() { console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed."); }, kt.prototype.setArray = function() { console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers"); }; ft.prototype.addIndex = function(t) { console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."), this.setIndex(t); }; ft.prototype.addAttribute = function(t, e) { return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."), !(e && e.isBufferAttribute) && !(e && e.isInterleavedBufferAttribute) ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."), this.setAttribute(t, new kt(arguments[1], arguments[2]))) : t === "index" ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."), this.setIndex(e), this) : this.setAttribute(t, e); }; ft.prototype.addDrawCall = function(t, e, r) { r !== void 0 && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."), console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."), this.addGroup(t, e); }; ft.prototype.clearDrawCalls = function() { console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."), this.clearGroups(); }; ft.prototype.computeOffsets = function() { console.warn("THREE.BufferGeometry: .computeOffsets() has been removed."); }; ft.prototype.removeAttribute = function(t) { return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."), this.deleteAttribute(t); }; ft.prototype.applyMatrix = function(t) { return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."), this.applyMatrix4(t); }; Object.defineProperties(ft.prototype, { drawcalls: { get: function() { return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."), this.groups; } }, offsets: { get: function() { return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."), this.groups; } } }); Is.prototype.setDynamic = function(t) { return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."), this.setUsage(t === !0 ? vu : gu), this; }; Is.prototype.setArray = function() { console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers"); }; qn.prototype.getArrays = function() { console.error("THREE.ExtrudeGeometry: .getArrays() has been removed."); }; qn.prototype.addShapeList = function() { console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed."); }; qn.prototype.addShape = function() { console.error("THREE.ExtrudeGeometry: .addShape() has been removed."); }; mv.prototype.dispose = function() { console.error("THREE.Scene: .dispose() has been removed."); }; Mv.prototype.onUpdate = function() { return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."), this; }; Object.defineProperties(jr.prototype, { wrapAround: { get: function() { console.warn("THREE.Material: .wrapAround has been removed."); }, set: function() { console.warn("THREE.Material: .wrapAround has been removed."); } }, overdraw: { get: function() { console.warn("THREE.Material: .overdraw has been removed."); }, set: function() { console.warn("THREE.Material: .overdraw has been removed."); } }, wrapRGB: { get: function() { return console.warn("THREE.Material: .wrapRGB has been removed."), new Je(); } }, shading: { get: function() { console.error("THREE." + this.type + ": .shading has been removed. Use the boolean .flatShading instead."); }, set: function(t) { console.warn("THREE." + this.type + ": .shading has been removed. Use the boolean .flatShading instead."), this.flatShading = t === kx; } }, stencilMask: { get: function() { return console.warn("THREE." + this.type + ": .stencilMask has been removed. Use .stencilFuncMask instead."), this.stencilFuncMask; }, set: function(t) { console.warn("THREE." + this.type + ": .stencilMask has been removed. Use .stencilFuncMask instead."), this.stencilFuncMask = t; } } }); Object.defineProperties(so.prototype, { derivatives: { get: function() { return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."), this.extensions.derivatives; }, set: function(t) { console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."), this.extensions.derivatives = t; } } }); nr.prototype.clearTarget = function(t, e, r, i) { console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."), this.setRenderTarget(t), this.clear(e, r, i); }; nr.prototype.animate = function(t) { console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."), this.setAnimationLoop(t); }; nr.prototype.getCurrentRenderTarget = function() { return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."), this.getRenderTarget(); }; nr.prototype.getMaxAnisotropy = function() { return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."), this.capabilities.getMaxAnisotropy(); }; nr.prototype.getPrecision = function() { return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."), this.capabilities.precision; }; nr.prototype.resetGLState = function() { return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."), this.state.reset(); }; nr.prototype.supportsFloatTextures = function() { return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."), this.extensions.get("OES_texture_float"); }; nr.prototype.supportsHalfFloatTextures = function() { return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."), this.extensions.get("OES_texture_half_float"); }; nr.prototype.supportsStandardDerivatives = function() { return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."), this.extensions.get("OES_standard_derivatives"); }; nr.prototype.supportsCompressedTextureS3TC = function() { return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."), this.extensions.get("WEBGL_compressed_texture_s3tc"); }; nr.prototype.supportsCompressedTexturePVRTC = function() { return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."), this.extensions.get("WEBGL_compressed_texture_pvrtc"); }; nr.prototype.supportsBlendMinMax = function() { return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."), this.extensions.get("EXT_blend_minmax"); }; nr.prototype.supportsVertexTextures = function() { return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."), this.capabilities.vertexTextures; }; nr.prototype.supportsInstancedArrays = function() { return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."), this.extensions.get("ANGLE_instanced_arrays"); }; nr.prototype.enableScissorTest = function(t) { console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."), this.setScissorTest(t); }; nr.prototype.initMaterial = function() { console.warn("THREE.WebGLRenderer: .initMaterial() has been removed."); }; nr.prototype.addPrePlugin = function() { console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed."); }; nr.prototype.addPostPlugin = function() { console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed."); }; nr.prototype.updateShadowMap = function() { console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed."); }; nr.prototype.setFaceCulling = function() { console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed."); }; nr.prototype.allocTextureUnit = function() { console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed."); }; nr.prototype.setTexture = function() { console.warn("THREE.WebGLRenderer: .setTexture() has been removed."); }; nr.prototype.setTexture2D = function() { console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed."); }; nr.prototype.setTextureCube = function() { console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed."); }; nr.prototype.getActiveMipMapLevel = function() { return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."), this.getActiveMipmapLevel(); }; Object.defineProperties(nr.prototype, { shadowMapEnabled: { get: function() { return this.shadowMap.enabled; }, set: function(t) { console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."), this.shadowMap.enabled = t; } }, shadowMapType: { get: function() { return this.shadowMap.type; }, set: function(t) { console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."), this.shadowMap.type = t; } }, shadowMapCullFace: { get: function() { console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead."); }, set: function() { console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead."); } }, context: { get: function() { return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."), this.getContext(); } }, vr: { get: function() { return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"), this.xr; } }, gammaInput: { get: function() { return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."), !1; }, set: function() { console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."); } }, gammaOutput: { get: function() { return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."), !1; }, set: function(t) { console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."), this.outputEncoding = t === !0 ? kl : Bi; } }, toneMappingWhitePoint: { get: function() { return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."), 1; }, set: function() { console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."); } } }); Object.defineProperties(eO.prototype, { cullFace: { get: function() { console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead."); }, set: function() { console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead."); } }, renderReverseSided: { get: function() { console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead."); }, set: function() { console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead."); } }, renderSingleSided: { get: function() { console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead."); }, set: function() { console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead."); } } }); function Jhe(t, e, r) { return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."), new hv(t, r); } Object.defineProperties(Hn.prototype, { wrapS: { get: function() { return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."), this.texture.wrapS; }, set: function(t) { console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."), this.texture.wrapS = t; } }, wrapT: { get: function() { return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."), this.texture.wrapT; }, set: function(t) { console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."), this.texture.wrapT = t; } }, magFilter: { get: function() { return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."), this.texture.magFilter; }, set: function(t) { console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."), this.texture.magFilter = t; } }, minFilter: { get: function() { return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."), this.texture.minFilter; }, set: function(t) { console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."), this.texture.minFilter = t; } }, anisotropy: { get: function() { return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."), this.texture.anisotropy; }, set: function(t) { console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."), this.texture.anisotropy = t; } }, offset: { get: function() { return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."), this.texture.offset; }, set: function(t) { console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."), this.texture.offset = t; } }, repeat: { get: function() { return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."), this.texture.repeat; }, set: function(t) { console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."), this.texture.repeat = t; } }, format: { get: function() { return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."), this.texture.format; }, set: function(t) { console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."), this.texture.format = t; } }, type: { get: function() { return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."), this.texture.type; }, set: function(t) { console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."), this.texture.type = t; } }, generateMipmaps: { get: function() { return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."), this.texture.generateMipmaps; }, set: function(t) { console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."), this.texture.generateMipmaps = t; } } }); ww.prototype.load = function(t) { console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead."); const e = this; return new EO().load(t, function(r) { e.setBuffer(r); }), this; }; LO.prototype.getData = function() { return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."), this.getFrequencyData(); }; dv.prototype.updateCubeMap = function(t, e) { return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."), this.update(t, e); }; dv.prototype.clear = function(t, e, r, i) { return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."), this.renderTarget.clear(t, e, r, i); }; Wl.crossOrigin = void 0; Wl.loadTexture = function(t, e, r, i) { console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead."); const n = new uw(); n.setCrossOrigin(this.crossOrigin); const a = n.load(t, r, void 0, i); return e && (a.mapping = e), a; }; Wl.loadTextureCube = function(t, e, r, i) { console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead."); const n = new gO(); n.setCrossOrigin(this.crossOrigin); const a = n.load(t, r, void 0, i); return e && (a.mapping = e), a; }; Wl.loadCompressedTexture = function() { console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead."); }; Wl.loadCompressedTextureCube = function() { console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead."); }; function Qhe() { console.error("THREE.CanvasRenderer has been removed"); } function epe() { console.error("THREE.JSONLoader has been removed."); } const tpe = { createMultiMaterialObject: function() { console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js"); }, detach: function() { console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js"); }, attach: function() { console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js"); } }; function rpe() { console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js"); } typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register", { detail: { revision: Ax } })); typeof window < "u" && (window.__THREE__ ? console.warn("WARNING: Multiple instances of Three.js being imported.") : window.__THREE__ = Ax); const ipe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, ACESFilmicToneMapping: LP, AddEquation: el, AddOperation: EP, AdditiveAnimationBlendMode: Ox, AdditiveBlending: i1, AlphaFormat: BP, AlwaysDepth: yP, AlwaysStencilFunc: RR, AmbientLight: pw, AmbientLightProbe: CO, AnimationClip: Pu, AnimationLoader: Dde, AnimationMixer: RO, AnimationObjectGroup: PO, AnimationUtils: hr, ArcCurve: qx, ArrayCamera: jx, ArrowHelper: fhe, Audio: ww, AudioAnalyser: LO, AudioContext: xw, AudioListener: jde, AudioLoader: EO, AxesHelper: VO, AxisHelper: Whe, BackSide: Or, BasicDepthPacking: LR, BasicShadowMap: Xae, BinaryTextureLoader: Khe, Bone: Tp, BooleanKeyframeTrack: Zl, BoundingBoxHelper: qhe, Box2: od, Box3: Ki, Box3Helper: hhe, BoxBufferGeometry: oo, BoxGeometry: oo, BoxHelper: $O, BufferAttribute: kt, BufferGeometry: ft, BufferGeometryLoader: SO, ByteType: PP, Cache: Il, Camera: bp, CameraHelper: dhe, CanvasRenderer: Qhe, CanvasTexture: oO, CatmullRomCurve3: Zx, CineonToneMapping: AP, CircleBufferGeometry: bu, CircleGeometry: bu, ClampToEdgeWrapping: ii, Clock: AO, Color: Je, ColorKeyframeTrack: lw, CompressedTexture: Gx, CompressedTextureLoader: Ide, ConeBufferGeometry: xu, ConeGeometry: xu, CubeCamera: dv, CubeReflectionMapping: gp, CubeRefractionMapping: vp, CubeTexture: td, CubeTextureLoader: gO, CubeUVReflectionMapping: ed, CubeUVRefractionMapping: yp, CubicBezierCurve: vv, CubicBezierCurve3: Yx, CubicInterpolant: hO, CullFaceBack: r1, CullFaceFront: iP, CullFaceFrontBack: qae, CullFaceNone: rP, Curve: un, CurvePath: yO, CustomBlending: aP, CustomToneMapping: kP, CylinderBufferGeometry: Ss, CylinderGeometry: Ss, Cylindrical: nhe, DataTexture: ml, DataTexture2DArray: Vx, DataTexture3D: Ux, DataTextureLoader: vO, DataUtils: ghe, DecrementStencilOp: ioe, DecrementWrapStencilOp: aoe, DefaultLoadingManager: mO, DepthFormat: pl, DepthStencilFormat: fu, DepthTexture: sO, DirectionalLight: Sv, DirectionalLightHelper: uhe, DiscreteInterpolant: pO, DodecahedronBufferGeometry: wu, DodecahedronGeometry: wu, DoubleSide: ws, DstAlphaFactor: hP, DstColorFactor: fP, DynamicBufferAttribute: Nhe, DynamicCopyUsage: boe, DynamicDrawUsage: vu, DynamicReadUsage: goe, EdgesGeometry: Wx, EdgesHelper: Xhe, EllipseCurve: Ap, EqualDepth: xP, EqualStencilFunc: coe, EquirectangularReflectionMapping: eg, EquirectangularRefractionMapping: tg, Euler: ql, EventDispatcher: Os, ExtrudeBufferGeometry: qn, ExtrudeGeometry: qn, FaceColors: Ehe, FileLoader: dn, FlatShading: kx, Float16BufferAttribute: UR, Float32Attribute: Hhe, Float32BufferAttribute: it, Float64Attribute: Ghe, Float64BufferAttribute: jR, FloatType: Wa, Fog: _p, FogExp2: wp, Font: bw, FontLoader: $de, FrontSide: xs, Frustum: xp, GLBufferAttribute: DO, GLSL1: woe, GLSL3: y1, GammaEncoding: sv, GreaterDepth: _P, GreaterEqualDepth: wP, GreaterEqualStencilFunc: poe, GreaterStencilFunc: doe, GridHelper: zO, Group: ua, HalfFloatType: hl, HemisphereLight: dw, HemisphereLightHelper: lhe, HemisphereLightProbe: TO, IcosahedronBufferGeometry: _u, IcosahedronGeometry: _u, ImageBitmapLoader: yw, ImageLoader: Fh, ImageUtils: Wl, ImmediateRenderObject: NO, IncrementStencilOp: roe, IncrementWrapStencilOp: noe, InstancedBufferAttribute: vw, InstancedBufferGeometry: gw, InstancedInterleavedBuffer: OO, InstancedMesh: Hx, Int16Attribute: $he, Int16BufferAttribute: $R, Int32Attribute: Uhe, Int32BufferAttribute: VR, Int8Attribute: Bhe, Int8BufferAttribute: BR, IntType: OP, InterleavedBuffer: Is, InterleavedBufferAttribute: lo, Interpolant: Sa, InterpolateDiscrete: mu, InterpolateLinear: Ll, InterpolateSmooth: xm, InvertStencilOp: ooe, JSONLoader: epe, KeepStencilOp: wm, KeyframeTrack: Qn, LOD: nO, LatheBufferGeometry: Su, LatheGeometry: Su, Layers: $x, LensFlare: rpe, LessDepth: bP, LessEqualDepth: Qm, LessEqualStencilFunc: uoe, LessStencilFunc: loe, Light: Xn, LightProbe: Pp, Line: wa, Line3: IO, LineBasicMaterial: Kr, LineCurve: Lp, LineCurve3: lO, LineDashedMaterial: ow, LineLoop: gv, LinePieces: She, LineSegments: zi, LineStrip: _he, LinearEncoding: Bi, LinearFilter: Cr, LinearInterpolant: sw, LinearMipMapLinearFilter: Qae, LinearMipMapNearestFilter: Jae, LinearMipmapLinearFilter: wo, LinearMipmapNearestFilter: av, LinearToneMapping: TP, Loader: xi, LoaderUtils: eo, LoadingManager: cw, LogLuvEncoding: AR, LoopOnce: SR, LoopPingPong: ER, LoopRepeat: MR, LuminanceAlphaFormat: zP, LuminanceFormat: FP, MOUSE: Gae, Material: jr, MaterialLoader: _O, Math: x1, MathUtils: x1, Matrix3: Xr, Matrix4: at, MaxEquation: s1, Mesh: Fr, MeshBasicMaterial: Hi, MeshDepthMaterial: pv, MeshDistanceMaterial: fv, MeshFaceMaterial: Che, MeshLambertMaterial: nw, MeshMatcapMaterial: aw, MeshNormalMaterial: iw, MeshPhongMaterial: tw, MeshPhysicalMaterial: kp, MeshStandardMaterial: Xl, MeshToonMaterial: rw, MinEquation: o1, MirroredRepeatWrapping: pu, MixOperation: MP, MultiMaterial: Ahe, MultiplyBlending: a1, MultiplyOperation: mp, NearestFilter: Dr, NearestMipMapLinearFilter: Kae, NearestMipMapNearestFilter: Yae, NearestMipmapLinearFilter: Ph, NearestMipmapNearestFilter: kh, NeverDepth: vP, NeverStencilFunc: soe, NoBlending: Ja, NoColors: Mhe, NoToneMapping: ns, NormalAnimationBlendMode: ov, NormalBlending: Hc, NotEqualDepth: SP, NotEqualStencilFunc: hoe, NumberKeyframeTrack: Lu, Object3D: It, ObjectLoader: Nde, ObjectSpaceNormalMap: PR, OctahedronBufferGeometry: Rl, OctahedronGeometry: Rl, OneFactor: cP, OneMinusDstAlphaFactor: pP, OneMinusDstColorFactor: mP, OneMinusSrcAlphaFactor: Rx, OneMinusSrcColorFactor: dP, OrthographicCamera: ad, PCFShadowMap: Lx, PCFSoftShadowMap: nP, PMREMGenerator: yhe, ParametricBufferGeometry: rg, ParametricGeometry: rg, Particle: khe, ParticleBasicMaterial: Ohe, ParticleSystem: Phe, ParticleSystemMaterial: Dhe, Path: zh, PerspectiveCamera: Wr, Plane: oa, PlaneBufferGeometry: Pl, PlaneGeometry: Pl, PlaneHelper: phe, PointCloud: Lhe, PointCloudMaterial: Rhe, PointLight: _v, PointLightHelper: ohe, Points: id, PointsMaterial: Ns, PolarGridHelper: che, PolyhedronBufferGeometry: _a, PolyhedronGeometry: _a, PositionalAudio: Gde, PropertyBinding: Vt, PropertyMixer: kO, QuadraticBezierCurve: yv, QuadraticBezierCurve3: Kx, Quaternion: vi, QuaternionKeyframeTrack: Yl, QuaternionLinearInterpolant: fO, REVISION: Ax, RGBADepthPacking: kR, RGBAFormat: sn, RGBAIntegerFormat: WP, RGBA_ASTC_10x10_Format: aR, RGBA_ASTC_10x5_Format: rR, RGBA_ASTC_10x6_Format: iR, RGBA_ASTC_10x8_Format: nR, RGBA_ASTC_12x10_Format: oR, RGBA_ASTC_12x12_Format: sR, RGBA_ASTC_4x4_Format: XP, RGBA_ASTC_5x4_Format: ZP, RGBA_ASTC_5x5_Format: YP, RGBA_ASTC_6x5_Format: KP, RGBA_ASTC_6x6_Format: JP, RGBA_ASTC_8x5_Format: QP, RGBA_ASTC_8x6_Format: eR, RGBA_ASTC_8x8_Format: tR, RGBA_BPTC_Format: lR, RGBA_ETC2_EAC_Format: v1, RGBA_PVRTC_2BPPV1_Format: m1, RGBA_PVRTC_4BPPV1_Format: f1, RGBA_S3TC_DXT1_Format: c1, RGBA_S3TC_DXT3_Format: u1, RGBA_S3TC_DXT5_Format: d1, RGBDEncoding: Bx, RGBEEncoding: lv, RGBEFormat: $P, RGBFormat: Qa, RGBIntegerFormat: GP, RGBM16Encoding: Nx, RGBM7Encoding: Ix, RGB_ETC1_Format: qP, RGB_ETC2_Format: g1, RGB_PVRTC_2BPPV1_Format: p1, RGB_PVRTC_4BPPV1_Format: h1, RGB_S3TC_DXT1_Format: l1, RGFormat: jP, RGIntegerFormat: HP, RawShaderMaterial: nd, Ray: Ds, Raycaster: rhe, RectAreaLight: fw, RedFormat: VP, RedIntegerFormat: UP, ReinhardToneMapping: CP, RepeatWrapping: _s, ReplaceStencilOp: toe, ReverseSubtractEquation: sP, RingBufferGeometry: Mu, RingGeometry: Mu, SRGB8_ALPHA8_ASTC_10x10_Format: xR, SRGB8_ALPHA8_ASTC_10x5_Format: vR, SRGB8_ALPHA8_ASTC_10x6_Format: yR, SRGB8_ALPHA8_ASTC_10x8_Format: bR, SRGB8_ALPHA8_ASTC_12x10_Format: wR, SRGB8_ALPHA8_ASTC_12x12_Format: _R, SRGB8_ALPHA8_ASTC_4x4_Format: cR, SRGB8_ALPHA8_ASTC_5x4_Format: uR, SRGB8_ALPHA8_ASTC_5x5_Format: dR, SRGB8_ALPHA8_ASTC_6x5_Format: hR, SRGB8_ALPHA8_ASTC_6x6_Format: pR, SRGB8_ALPHA8_ASTC_8x5_Format: fR, SRGB8_ALPHA8_ASTC_8x6_Format: mR, SRGB8_ALPHA8_ASTC_8x8_Format: gR, Scene: mv, SceneUtils: tpe, ShaderChunk: Bt, ShaderLib: Vn, ShaderMaterial: so, ShadowMaterial: ew, Shape: os, ShapeBufferGeometry: Ol, ShapeGeometry: Ol, ShapePath: MO, ShapeUtils: ma, ShortType: RP, Skeleton: Cp, SkeletonHelper: BO, SkinnedMesh: Ep, SmoothShading: Zae, Sphere: _o, SphereBufferGeometry: Dl, SphereGeometry: Dl, Spherical: ihe, SphericalHarmonics3: mw, SplineCurve: bv, SpotLight: wv, SpotLightHelper: ahe, Sprite: Mp, SpriteMaterial: Sp, SrcAlphaFactor: Px, SrcAlphaSaturateFactor: gP, SrcColorFactor: uP, StaticCopyUsage: yoe, StaticDrawUsage: gu, StaticReadUsage: moe, StereoCamera: Vde, StreamCopyUsage: xoe, StreamDrawUsage: foe, StreamReadUsage: voe, StringKeyframeTrack: Kl, SubtractEquation: oP, SubtractiveBlending: n1, TOUCH: Wae, TangentSpaceNormalMap: Rs, TetrahedronBufferGeometry: Eu, TetrahedronGeometry: Eu, TextBufferGeometry: ig, TextGeometry: ig, Texture: zr, TextureLoader: uw, TorusBufferGeometry: Tu, TorusGeometry: Tu, TorusKnotBufferGeometry: Cu, TorusKnotGeometry: Cu, Triangle: Ir, TriangleFanDrawMode: Dx, TriangleStripDrawMode: CR, TrianglesDrawMode: TR, TubeBufferGeometry: Au, TubeGeometry: Au, UVMapping: nv, Uint16Attribute: Vhe, Uint16BufferAttribute: cv, Uint32Attribute: jhe, Uint32BufferAttribute: uv, Uint8Attribute: Fhe, Uint8BufferAttribute: FR, Uint8ClampedAttribute: zhe, Uint8ClampedBufferAttribute: zR, Uniform: Mv, UniformsLib: Qe, UniformsUtils: GR, UnsignedByteType: Al, UnsignedInt248Type: Gc, UnsignedIntType: eh, UnsignedShort4444Type: DP, UnsignedShort5551Type: IP, UnsignedShort565Type: NP, UnsignedShortType: Rh, VSMShadowMap: Ic, Vector2: je, Vector3: de, Vector4: Qt, VectorKeyframeTrack: ku, Vertex: Ihe, VertexColors: The, VideoTexture: aO, WebGL1Renderer: rO, WebGLCubeRenderTarget: hv, WebGLMultipleRenderTargets: IR, WebGLMultisampleRenderTarget: zx, WebGLRenderTarget: Hn, WebGLRenderTargetCube: Jhe, WebGLRenderer: nr, WebGLUtils: tO, WireframeGeometry: Qx, WireframeHelper: Zhe, WrapAroundEnding: Oh, XHRLoader: Yhe, ZeroCurvatureEnding: nl, ZeroFactor: lP, ZeroSlopeEnding: al, ZeroStencilOp: eoe, sRGBEncoding: kl }, Symbol.toStringTag, { value: "Module" })), npe = /* @__PURE__ */ ev(ipe); function ape(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function ope(t, e) { for (var r = 0; r < e.length; r++) { var i = e[r]; i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(t, i.key, i); } } function spe(t, e, r) { return e && ope(t.prototype, e), t; } function lpe(t, e) { if (typeof e != "function" && e !== null) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), e && T1(t, e); } function ng(t) { return ng = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) { return e.__proto__ || Object.getPrototypeOf(e); }, ng(t); } function T1(t, e) { return T1 = Object.setPrototypeOf || function(r, i) { return r.__proto__ = i, r; }, T1(t, e); } function cpe() { if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1; if (typeof Proxy == "function") return !0; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), !0; } catch { return !1; } } function upe(t) { if (t === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return t; } function dpe(t, e) { return e && (typeof e == "object" || typeof e == "function") ? e : upe(t); } function hpe(t) { var e = cpe(); return function() { var r = ng(t), i; if (e) { var n = ng(this).constructor; i = Reflect.construct(r, arguments, n); } else i = r.apply(this, arguments); return dpe(this, i); }; } function rT(t, e) { return fpe(t) || gpe(t, e) || GO(t, e) || ype(); } function Zf(t) { return ppe(t) || mpe(t) || GO(t) || vpe(); } function ppe(t) { if (Array.isArray(t)) return C1(t); } function fpe(t) { if (Array.isArray(t)) return t; } function mpe(t) { if (typeof Symbol < "u" && t[Symbol.iterator] != null || t["@@iterator"] != null) return Array.from(t); } function gpe(t, e) { var r = t && (typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"]); if (r != null) { var i = [], n = !0, a = !1, o, s; try { for (r = r.call(t); !(n = (o = r.next()).done) && (i.push(o.value), !(e && i.length === e)); n = !0) ; } catch (c) { a = !0, s = c; } finally { try { !n && r.return != null && r.return(); } finally { if (a) throw s; } } return i; } } function GO(t, e) { if (t) { if (typeof t == "string") return C1(t, e); var r = Object.prototype.toString.call(t).slice(8, -1); if (r === "Object" && t.constructor && (r = t.constructor.name), r === "Map" || r === "Set") return Array.from(t); if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return C1(t, e); } } function C1(t, e) { (e == null || e > t.length) && (e = t.length); for (var r = 0, i = new Array(e); r < e; r++) i[r] = t[r]; return i; } function vpe() { throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`); } function ype() { throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`); } var Pd = typeof window < "u" && window.THREE ? window.THREE : { LinearFilter: Cr, Sprite: Mp, SpriteMaterial: Sp, Texture: zr }, bpe = /* @__PURE__ */ function(t) { lpe(r, t); var e = hpe(r); function r() { var i, n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 10, o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "rgba(255, 255, 255, 1)"; return ape(this, r), i = e.call(this, new Pd.SpriteMaterial({ map: new Pd.Texture() })), i._text = "".concat(n), i._textHeight = a, i._color = o, i._backgroundColor = !1, i._padding = 0, i._borderWidth = 0, i._borderRadius = 0, i._borderColor = "white", i._strokeWidth = 0, i._strokeColor = "white", i._fontFace = "Arial", i._fontSize = 90, i._fontWeight = "normal", i._canvas = document.createElement("canvas"), i._texture = i.material.map, i._texture.minFilter = Pd.LinearFilter, i._genCanvas(), i; } return spe(r, [{ key: "text", get: function() { return this._text; }, set: function(i) { this._text = i, this._genCanvas(); } }, { key: "textHeight", get: function() { return this._textHeight; }, set: function(i) { this._textHeight = i, this._genCanvas(); } }, { key: "color", get: function() { return this._color; }, set: function(i) { this._color = i, this._genCanvas(); } }, { key: "backgroundColor", get: function() { return this._backgroundColor; }, set: function(i) { this._backgroundColor = i, this._genCanvas(); } }, { key: "padding", get: function() { return this._padding; }, set: function(i) { this._padding = i, this._genCanvas(); } }, { key: "borderWidth", get: function() { return this._borderWidth; }, set: function(i) { this._borderWidth = i, this._genCanvas(); } }, { key: "borderRadius", get: function() { return this._borderRadius; }, set: function(i) { this._borderRadius = i, this._genCanvas(); } }, { key: "borderColor", get: function() { return this._borderColor; }, set: function(i) { this._borderColor = i, this._genCanvas(); } }, { key: "fontFace", get: function() { return this._fontFace; }, set: function(i) { this._fontFace = i, this._genCanvas(); } }, { key: "fontSize", get: function() { return this._fontSize; }, set: function(i) { this._fontSize = i, this._genCanvas(); } }, { key: "fontWeight", get: function() { return this._fontWeight; }, set: function(i) { this._fontWeight = i, this._genCanvas(); } }, { key: "strokeWidth", get: function() { return this._strokeWidth; }, set: function(i) { this._strokeWidth = i, this._genCanvas(); } }, { key: "strokeColor", get: function() { return this._strokeColor; }, set: function(i) { this._strokeColor = i, this._genCanvas(); } }, { key: "_genCanvas", value: function() { var i = this, n = this._canvas, a = n.getContext("2d"), o = Array.isArray(this.borderWidth) ? this.borderWidth : [this.borderWidth, this.borderWidth], s = o.map(function(_) { return _ * i.fontSize * 0.1; }), c = Array.isArray(this.borderRadius) ? this.borderRadius : [this.borderRadius, this.borderRadius, this.borderRadius, this.borderRadius], l = c.map(function(_) { return _ * i.fontSize * 0.1; }), u = Array.isArray(this.padding) ? this.padding : [this.padding, this.padding], d = u.map(function(_) { return _ * i.fontSize * 0.1; }), h = this.text.split(` `), f = "".concat(this.fontWeight, " ").concat(this.fontSize, "px ").concat(this.fontFace); a.font = f; var p = Math.max.apply(Math, Zf(h.map(function(_) { return a.measureText(_).width; }))), m = this.fontSize * h.length; if (n.width = p + s[0] * 2 + d[0] * 2, n.height = m + s[1] * 2 + d[1] * 2, this.borderWidth) { if (a.strokeStyle = this.borderColor, s[0]) { var y = s[0] / 2; a.lineWidth = s[0], a.beginPath(), a.moveTo(y, l[0]), a.lineTo(y, n.height - l[3]), a.moveTo(n.width - y, l[1]), a.lineTo(n.width - y, n.height - l[2]), a.stroke(); } if (s[1]) { var g = s[1] / 2; a.lineWidth = s[1], a.beginPath(), a.moveTo(Math.max(s[0], l[0]), g), a.lineTo(n.width - Math.max(s[0], l[1]), g), a.moveTo(Math.max(s[0], l[3]), n.height - g), a.lineTo(n.width - Math.max(s[0], l[2]), n.height - g), a.stroke(); } if (this.borderRadius) { var v = Math.max.apply(Math, Zf(s)), x = v / 2; a.lineWidth = v, a.beginPath(), [!!l[0] && [l[0], x, x, l[0]], !!l[1] && [n.width - l[1], n.width - x, x, l[1]], !!l[2] && [n.width - l[2], n.width - x, n.height - x, n.height - l[2]], !!l[3] && [l[3], x, n.height - x, n.height - l[3]]].filter(function(_) { return _; }).forEach(function(_) { var b = rT(_, 4), T = b[0], E = b[1], C = b[2], L = b[3]; a.moveTo(T, C), a.quadraticCurveTo(E, C, E, L); }), a.stroke(); } } this.backgroundColor && (a.fillStyle = this.backgroundColor, this.borderRadius ? (a.beginPath(), a.moveTo(s[0], l[0]), [ [s[0], l[0], n.width - l[1], s[1], s[1], s[1]], // t [n.width - s[0], n.width - s[0], n.width - s[0], s[1], l[1], n.height - l[2]], // r [n.width - s[0], n.width - l[2], l[3], n.height - s[1], n.height - s[1], n.height - s[1]], // b [s[0], s[0], s[0], n.height - s[1], n.height - l[3], l[0]] // t ].forEach(function(_) { var b = rT(_, 6), T = b[0], E = b[1], C = b[2], L = b[3], A = b[4], k = b[5]; a.quadraticCurveTo(T, L, E, A), a.lineTo(C, k); }), a.closePath(), a.fill()) : a.fillRect(s[0], s[1], n.width - s[0] * 2, n.height - s[1] * 2)), a.translate.apply(a, Zf(s)), a.translate.apply(a, Zf(d)), a.font = f, a.fillStyle = this.color, a.textBaseline = "bottom"; var w = this.strokeWidth > 0; w && (a.lineWidth = this.strokeWidth * this.fontSize / 10, a.strokeStyle = this.strokeColor), h.forEach(function(_, b) { var T = (p - a.measureText(_).width) / 2, E = (b + 1) * i.fontSize; w && a.strokeText(_, T, E), a.fillText(_, T, E); }), this._texture.image = n, this._texture.needsUpdate = !0; var S = this.textHeight * h.length + o[1] * 2 + u[1] * 2; this.scale.set(S * n.width / n.height, S, 0); } }, { key: "clone", value: function() { return new this.constructor(this.text, this.textHeight, this.color).copy(this); } }, { key: "copy", value: function(i) { return Pd.Sprite.prototype.copy.call(this, i), this.color = i.color, this.backgroundColor = i.backgroundColor, this.padding = i.padding, this.borderWidth = i.borderWidth, this.borderColor = i.borderColor, this.fontFace = i.fontFace, this.fontSize = i.fontSize, this.fontWeight = i.fontWeight, this.strokeWidth = i.strokeWidth, this.strokeColor = i.strokeColor, this; } }]), r; }(Pd.Sprite); const xpe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: bpe }, Symbol.toStringTag, { value: "Module" })), wpe = /* @__PURE__ */ ev(xpe); var iT = { exports: {} }, nT; function _pe() { return nT || (nT = 1, function(t, e) { (function(r, i) { t.exports = i(); })(typeof window < "u" ? window : Wo, function() { if (typeof window > "u") return null; var r = typeof window < "u" && window.Math == Math ? window : typeof self < "u" && self.Math == Math ? self : Function("return this")(), i = r.requestAnimationFrame || r.mozRequestAnimationFrame || r.webkitRequestAnimationFrame || function(u) { return r.setTimeout(u, 20); }, n = r.cancelAnimationFrame || r.mozCancelAnimationFrame || r.webkitCancelAnimationFrame || function(u) { r.clearTimeout(u); }; function a(u, d) { var h = Object.prototype.toString.call(u), f = h === "[object Array]" || h === "[object NodeList]" || h === "[object HTMLCollection]" || h === "[object Object]" || typeof jQuery < "u" && u instanceof jQuery || typeof Elements < "u" && u instanceof Elements, p = 0, m = u.length; if (f) for (; p < m; p++) d(u[p]); else d(u); } function o(u) { if (!u.getBoundingClientRect) return { width: u.offsetWidth, height: u.offsetHeight }; var d = u.getBoundingClientRect(); return { width: Math.round(d.width), height: Math.round(d.height) }; } function s(u, d) { Object.keys(d).forEach(function(h) { u.style[h] = d[h]; }); } var c = function(u, d) { var h = 0; function f() { var m = []; this.add = function(v) { m.push(v); }; var y, g; this.call = function(v) { for (y = 0, g = m.length; y < g; y++) m[y].call(this, v); }, this.remove = function(v) { var x = []; for (y = 0, g = m.length; y < g; y++) m[y] !== v && x.push(m[y]); m = x; }, this.length = function() { return m.length; }; } function p(m, y) { if (m) { if (m.resizedAttached) { m.resizedAttached.add(y); return; } m.resizedAttached = new f(), m.resizedAttached.add(y), m.resizeSensor = document.createElement("div"), m.resizeSensor.dir = "ltr", m.resizeSensor.className = "resize-sensor"; var g = { pointerEvents: "none", position: "absolute", left: "0px", top: "0px", right: "0px", bottom: "0px", overflow: "hidden", zIndex: "-1", visibility: "hidden", maxWidth: "100%" }, v = { position: "absolute", left: "0px", top: "0px", transition: "0s" }; s(m.resizeSensor, g); var x = document.createElement("div"); x.className = "resize-sensor-expand", s(x, g); var w = document.createElement("div"); s(w, v), x.appendChild(w); var S = document.createElement("div"); S.className = "resize-sensor-shrink", s(S, g); var _ = document.createElement("div"); s(_, v), s(_, { width: "200%", height: "200%" }), S.appendChild(_), m.resizeSensor.appendChild(x), m.resizeSensor.appendChild(S), m.appendChild(m.resizeSensor); var b = window.getComputedStyle(m), T = b ? b.getPropertyValue("position") : null; T !== "absolute" && T !== "relative" && T !== "fixed" && T !== "sticky" && (m.style.position = "relative"); var E = !1, C = 0, L = o(m), A = 0, k = 0, P = !0; h = 0; var R = function() { var F = m.offsetWidth, z = m.offsetHeight; w.style.width = F + 10 + "px", w.style.height = z + 10 + "px", x.scrollLeft = F + 10, x.scrollTop = z + 10, S.scrollLeft = F + 10, S.scrollTop = z + 10; }, M = function() { if (P) { var F = m.offsetWidth === 0 && m.offsetHeight === 0; if (F) { h || (h = i(function() { h = 0, M(); })); return; } else P = !1; } R(); }; m.resizeSensor.resetSensor = M; var O = function() { C = 0, E && (A = L.width, k = L.height, m.resizedAttached && m.resizedAttached.call(L)); }, D = function() { L = o(m), E = L.width !== A || L.height !== k, E && !C && (C = i(O)), M(); }, I = function(F, z, U) { F.attachEvent ? F.attachEvent("on" + z, U) : F.addEventListener(z, U); }; I(x, "scroll", D), I(S, "scroll", D), h = i(function() { h = 0, M(); }); } } a(u, function(m) { p(m, d); }), this.detach = function(m) { h || (n(h), h = 0), c.detach(u, m); }, this.reset = function() { u.resizeSensor.resetSensor(); }; }; if (c.reset = function(u) { a(u, function(d) { d.resizeSensor.resetSensor(); }); }, c.detach = function(u, d) { a(u, function(h) { h && (h.resizedAttached && typeof d == "function" && (h.resizedAttached.remove(d), h.resizedAttached.length()) || h.resizeSensor && (h.contains(h.resizeSensor) && h.removeChild(h.resizeSensor), delete h.resizeSensor, delete h.resizedAttached)); }); }, typeof MutationObserver < "u") { var l = new MutationObserver(function(u) { for (var d in u) if (u.hasOwnProperty(d)) for (var h = u[d].addedNodes, f = 0; f < h.length; f++) h[f].resizeSensor && c.reset(h[f]); }); document.addEventListener("DOMContentLoaded", function(u) { l.observe(document.body, { childList: !0, subtree: !0 }); }); } return c; }); }(iT)), iT.exports; } class Spe extends xi { constructor(e) { super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(r) { return new Cpe(r); }), this.register(function(r) { return new Lpe(r); }), this.register(function(r) { return new kpe(r); }), this.register(function(r) { return new Ape(r); }), this.register(function(r) { return new Epe(r); }), this.register(function(r) { return new Ppe(r); }); } load(e, r, i, n) { const a = this; let o; this.resourcePath !== "" ? o = this.resourcePath : this.path !== "" ? o = this.path : o = eo.extractUrlBase(e), this.manager.itemStart(e); const s = function(l) { n ? n(l) : console.error(l), a.manager.itemError(e), a.manager.itemEnd(e); }, c = new dn(this.manager); c.setPath(this.path), c.setResponseType("arraybuffer"), c.setRequestHeader(this.requestHeader), c.setWithCredentials(this.withCredentials), c.load(e, function(l) { try { a.parse(l, o, function(u) { r(u), a.manager.itemEnd(e); }, s); } catch (u) { s(u); } }, i, s); } setDRACOLoader(e) { return this.dracoLoader = e, this; } setDDSLoader() { throw new Error( 'THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".' ); } setKTX2Loader(e) { return this.ktx2Loader = e, this; } setMeshoptDecoder(e) { return this.meshoptDecoder = e, this; } register(e) { return this.pluginCallbacks.indexOf(e) === -1 && this.pluginCallbacks.push(e), this; } unregister(e) { return this.pluginCallbacks.indexOf(e) !== -1 && this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e), 1), this; } parse(e, r, i, n) { let a; const o = {}, s = {}; if (typeof e == "string") a = e; else if (eo.decodeText(new Uint8Array(e, 0, 4)) === WO) { try { o[Wt.KHR_BINARY_GLTF] = new Rpe(e); } catch (u) { n && n(u); return; } a = o[Wt.KHR_BINARY_GLTF].content; } else a = eo.decodeText(new Uint8Array(e)); const c = JSON.parse(a); if (c.asset === void 0 || c.asset.version[0] < 2) { n && n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")); return; } const l = new Upe(c, { path: r || this.resourcePath || "", crossOrigin: this.crossOrigin, requestHeader: this.requestHeader, manager: this.manager, ktx2Loader: this.ktx2Loader, meshoptDecoder: this.meshoptDecoder }); l.fileLoader.setRequestHeader(this.requestHeader); for (let u = 0; u < this.pluginCallbacks.length; u++) { const d = this.pluginCallbacks[u](l); s[d.name] = d, o[d.name] = !0; } if (c.extensionsUsed) for (let u = 0; u < c.extensionsUsed.length; ++u) { const d = c.extensionsUsed[u], h = c.extensionsRequired || []; switch (d) { case Wt.KHR_MATERIALS_UNLIT: o[d] = new Tpe(); break; case Wt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS: o[d] = new Ipe(); break; case Wt.KHR_DRACO_MESH_COMPRESSION: o[d] = new Ope(c, this.dracoLoader); break; case Wt.KHR_TEXTURE_TRANSFORM: o[d] = new Dpe(); break; case Wt.KHR_MESH_QUANTIZATION: o[d] = new Npe(); break; default: h.indexOf(d) >= 0 && s[d] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + d + '".'); } } l.setExtensions(o), l.setPlugins(s), l.parse(i, n); } } function Mpe() { let t = {}; return { get: function(e) { return t[e]; }, add: function(e, r) { t[e] = r; }, remove: function(e) { delete t[e]; }, removeAll: function() { t = {}; } }; } const Wt = { KHR_BINARY_GLTF: "KHR_binary_glTF", KHR_DRACO_MESH_COMPRESSION: "KHR_draco_mesh_compression", KHR_LIGHTS_PUNCTUAL: "KHR_lights_punctual", KHR_MATERIALS_CLEARCOAT: "KHR_materials_clearcoat", KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS: "KHR_materials_pbrSpecularGlossiness", KHR_MATERIALS_TRANSMISSION: "KHR_materials_transmission", KHR_MATERIALS_UNLIT: "KHR_materials_unlit", KHR_TEXTURE_BASISU: "KHR_texture_basisu", KHR_TEXTURE_TRANSFORM: "KHR_texture_transform", KHR_MESH_QUANTIZATION: "KHR_mesh_quantization", EXT_TEXTURE_WEBP: "EXT_texture_webp", EXT_MESHOPT_COMPRESSION: "EXT_meshopt_compression" }; class Epe { constructor(e) { this.parser = e, this.name = Wt.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} }; } _markDefs() { const e = this.parser, r = this.parser.json.nodes || []; for (let i = 0, n = r.length; i < n; i++) { const a = r[i]; a.extensions && a.extensions[this.name] && a.extensions[this.name].light !== void 0 && e._addNodeRef(this.cache, a.extensions[this.name].light); } } _loadLight(e) { const r = this.parser, i = "light:" + e; let n = r.cache.get(i); if (n) return n; const a = r.json, o = ((a.extensions && a.extensions[this.name] || {}).lights || [])[e]; let s; const c = new Je(16777215); o.color !== void 0 && c.fromArray(o.color); const l = o.range !== void 0 ? o.range : 0; switch (o.type) { case "directional": s = new Sv(c), s.target.position.set(0, 0, -1), s.add(s.target); break; case "point": s = new _v(c), s.distance = l; break; case "spot": s = new wv(c), s.distance = l, o.spot = o.spot || {}, o.spot.innerConeAngle = o.spot.innerConeAngle !== void 0 ? o.spot.innerConeAngle : 0, o.spot.outerConeAngle = o.spot.outerConeAngle !== void 0 ? o.spot.outerConeAngle : Math.PI / 4, s.angle = o.spot.outerConeAngle, s.penumbra = 1 - o.spot.innerConeAngle / o.spot.outerConeAngle, s.target.position.set(0, 0, -1), s.add(s.target); break; default: throw new Error("THREE.GLTFLoader: Unexpected light type: " + o.type); } return s.position.set(0, 0, 0), s.decay = 2, o.intensity !== void 0 && (s.intensity = o.intensity), s.name = r.createUniqueName(o.name || "light_" + e), n = Promise.resolve(s), r.cache.add(i, n), n; } createNodeAttachment(e) { const r = this, i = this.parser, n = i.json.nodes[e], a = (n.extensions && n.extensions[this.name] || {}).light; return a === void 0 ? null : this._loadLight(a).then(function(o) { return i._getNodeRef(r.cache, a, o); }); } } class Tpe { constructor() { this.name = Wt.KHR_MATERIALS_UNLIT; } getMaterialType() { return Hi; } extendParams(e, r, i) { const n = []; e.color = new Je(1, 1, 1), e.opacity = 1; const a = r.pbrMetallicRoughness; if (a) { if (Array.isArray(a.baseColorFactor)) { const o = a.baseColorFactor; e.color.fromArray(o), e.opacity = o[3]; } a.baseColorTexture !== void 0 && n.push(i.assignTexture(e, "map", a.baseColorTexture)); } return Promise.all(n); } } class Cpe { constructor(e) { this.parser = e, this.name = Wt.KHR_MATERIALS_CLEARCOAT; } getMaterialType(e) { const r = this.parser.json.materials[e]; return !r.extensions || !r.extensions[this.name] ? null : kp; } extendMaterialParams(e, r) { const i = this.parser, n = i.json.materials[e]; if (!n.extensions || !n.extensions[this.name]) return Promise.resolve(); const a = [], o = n.extensions[this.name]; if (o.clearcoatFactor !== void 0 && (r.clearcoat = o.clearcoatFactor), o.clearcoatTexture !== void 0 && a.push(i.assignTexture(r, "clearcoatMap", o.clearcoatTexture)), o.clearcoatRoughnessFactor !== void 0 && (r.clearcoatRoughness = o.clearcoatRoughnessFactor), o.clearcoatRoughnessTexture !== void 0 && a.push(i.assignTexture(r, "clearcoatRoughnessMap", o.clearcoatRoughnessTexture)), o.clearcoatNormalTexture !== void 0 && (a.push(i.assignTexture(r, "clearcoatNormalMap", o.clearcoatNormalTexture)), o.clearcoatNormalTexture.scale !== void 0)) { const s = o.clearcoatNormalTexture.scale; r.clearcoatNormalScale = new je(s, -s); } return Promise.all(a); } } class Ape { constructor(e) { this.parser = e, this.name = Wt.KHR_MATERIALS_TRANSMISSION; } getMaterialType(e) { const r = this.parser.json.materials[e]; return !r.extensions || !r.extensions[this.name] ? null : kp; } extendMaterialParams(e, r) { const i = this.parser, n = i.json.materials[e]; if (!n.extensions || !n.extensions[this.name]) return Promise.resolve(); const a = [], o = n.extensions[this.name]; return o.transmissionFactor !== void 0 && (r.transmission = o.transmissionFactor), o.transmissionTexture !== void 0 && a.push(i.assignTexture(r, "transmissionMap", o.transmissionTexture)), Promise.all(a); } } class Lpe { constructor(e) { this.parser = e, this.name = Wt.KHR_TEXTURE_BASISU; } loadTexture(e) { const r = this.parser, i = r.json, n = i.textures[e]; if (!n.extensions || !n.extensions[this.name]) return null; const a = n.extensions[this.name], o = i.images[a.source], s = r.options.ktx2Loader; if (!s) { if (i.extensionsRequired && i.extensionsRequired.indexOf(this.name) >= 0) throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures"); return null; } return r.loadTextureImage(e, o, s); } } class kpe { constructor(e) { this.parser = e, this.name = Wt.EXT_TEXTURE_WEBP, this.isSupported = null; } loadTexture(e) { const r = this.name, i = this.parser, n = i.json, a = n.textures[e]; if (!a.extensions || !a.extensions[r]) return null; const o = a.extensions[r], s = n.images[o.source]; let c = i.textureLoader; if (s.uri) { const l = i.options.manager.getHandler(s.uri); l !== null && (c = l); } return this.detectSupport().then(function(l) { if (l) return i.loadTextureImage(e, s, c); if (n.extensionsRequired && n.extensionsRequired.indexOf(r) >= 0) throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported."); return i.loadTexture(e); }); } detectSupport() { return this.isSupported || (this.isSupported = new Promise(function(e) { const r = new Image(); r.src = "data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA", r.onload = r.onerror = function() { e(r.height === 1); }; })), this.isSupported; } } class Ppe { constructor(e) { this.name = Wt.EXT_MESHOPT_COMPRESSION, this.parser = e; } loadBufferView(e) { const r = this.parser.json, i = r.bufferViews[e]; if (i.extensions && i.extensions[this.name]) { const n = i.extensions[this.name], a = this.parser.getDependency("buffer", n.buffer), o = this.parser.options.meshoptDecoder; if (!o || !o.supported) { if (r.extensionsRequired && r.extensionsRequired.indexOf(this.name) >= 0) throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files"); return null; } return Promise.all([a, o.ready]).then(function(s) { const c = n.byteOffset || 0, l = n.byteLength || 0, u = n.count, d = n.byteStride, h = new ArrayBuffer(u * d), f = new Uint8Array(s[0], c, l); return o.decodeGltfBuffer(new Uint8Array(h), u, d, f, n.mode, n.filter), h; }); } else return null; } } const WO = "glTF", Rd = 12, aT = { JSON: 1313821514, BIN: 5130562 }; class Rpe { constructor(e) { this.name = Wt.KHR_BINARY_GLTF, this.content = null, this.body = null; const r = new DataView(e, 0, Rd); if (this.header = { magic: eo.decodeText(new Uint8Array(e.slice(0, 4))), version: r.getUint32(4, !0), length: r.getUint32(8, !0) }, this.header.magic !== WO) throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header."); if (this.header.version < 2) throw new Error("THREE.GLTFLoader: Legacy binary file detected."); const i = this.header.length - Rd, n = new DataView(e, Rd); let a = 0; for (; a < i; ) { const o = n.getUint32(a, !0); a += 4; const s = n.getUint32(a, !0); if (a += 4, s === aT.JSON) { const c = new Uint8Array(e, Rd + a, o); this.content = eo.decodeText(c); } else if (s === aT.BIN) { const c = Rd + a; this.body = e.slice(c, c + o); } a += o; } if (this.content === null) throw new Error("THREE.GLTFLoader: JSON content not found."); } } class Ope { constructor(e, r) { if (!r) throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided."); this.name = Wt.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = r, this.dracoLoader.preload(); } decodePrimitive(e, r) { const i = this.json, n = this.dracoLoader, a = e.extensions[this.name].bufferView, o = e.extensions[this.name].attributes, s = {}, c = {}, l = {}; for (const u in o) { const d = L1[u] || u.toLowerCase(); s[d] = o[u]; } for (const u in e.attributes) { const d = L1[u] || u.toLowerCase(); if (o[u] !== void 0) { const h = i.accessors[e.attributes[u]], f = $h[h.componentType]; l[d] = f, c[d] = h.normalized === !0; } } return r.getDependency("bufferView", a).then(function(u) { return new Promise(function(d) { n.decodeDracoFile(u, function(h) { for (const f in h.attributes) { const p = h.attributes[f], m = c[f]; m !== void 0 && (p.normalized = m); } d(h); }, s, l); }); }); } } class Dpe { constructor() { this.name = Wt.KHR_TEXTURE_TRANSFORM; } extendTexture(e, r) { return r.texCoord !== void 0 && console.warn('THREE.GLTFLoader: Custom UV sets in "' + this.name + '" extension not yet supported.'), r.offset === void 0 && r.rotation === void 0 && r.scale === void 0 || (e = e.clone(), r.offset !== void 0 && e.offset.fromArray(r.offset), r.rotation !== void 0 && (e.rotation = r.rotation), r.scale !== void 0 && e.repeat.fromArray(r.scale), e.needsUpdate = !0), e; } } class A1 extends Xl { constructor(e) { super(), this.isGLTFSpecularGlossinessMaterial = !0; const r = [ "#ifdef USE_SPECULARMAP", " uniform sampler2D specularMap;", "#endif" ].join(` `), i = [ "#ifdef USE_GLOSSINESSMAP", " uniform sampler2D glossinessMap;", "#endif" ].join(` `), n = [ "vec3 specularFactor = specular;", "#ifdef USE_SPECULARMAP", " vec4 texelSpecular = texture2D( specularMap, vUv );", " texelSpecular = sRGBToLinear( texelSpecular );", " // reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture", " specularFactor *= texelSpecular.rgb;", "#endif" ].join(` `), a = [ "float glossinessFactor = glossiness;", "#ifdef USE_GLOSSINESSMAP", " vec4 texelGlossiness = texture2D( glossinessMap, vUv );", " // reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture", " glossinessFactor *= texelGlossiness.a;", "#endif" ].join(` `), o = [ "PhysicalMaterial material;", "material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );", "vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );", "float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );", "material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.", "material.specularRoughness += geometryRoughness;", "material.specularRoughness = min( material.specularRoughness, 1.0 );", "material.specularColor = specularFactor;" ].join(` `), s = { specular: { value: new Je().setHex(16777215) }, glossiness: { value: 1 }, specularMap: { value: null }, glossinessMap: { value: null } }; this._extraUniforms = s, this.onBeforeCompile = function(c) { for (const l in s) c.uniforms[l] = s[l]; c.fragmentShader = c.fragmentShader.replace("uniform float roughness;", "uniform vec3 specular;").replace("uniform float metalness;", "uniform float glossiness;").replace("#include ", r).replace("#include ", i).replace("#include ", n).replace("#include ", a).replace("#include ", o); }, Object.defineProperties(this, { specular: { get: function() { return s.specular.value; }, set: function(c) { s.specular.value = c; } }, specularMap: { get: function() { return s.specularMap.value; }, set: function(c) { s.specularMap.value = c, c ? this.defines.USE_SPECULARMAP = "" : delete this.defines.USE_SPECULARMAP; } }, glossiness: { get: function() { return s.glossiness.value; }, set: function(c) { s.glossiness.value = c; } }, glossinessMap: { get: function() { return s.glossinessMap.value; }, set: function(c) { s.glossinessMap.value = c, c ? (this.defines.USE_GLOSSINESSMAP = "", this.defines.USE_UV = "") : (delete this.defines.USE_GLOSSINESSMAP, delete this.defines.USE_UV); } } }), delete this.metalness, delete this.roughness, delete this.metalnessMap, delete this.roughnessMap, this.setValues(e); } copy(e) { return super.copy(e), this.specularMap = e.specularMap, this.specular.copy(e.specular), this.glossinessMap = e.glossinessMap, this.glossiness = e.glossiness, delete this.metalness, delete this.roughness, delete this.metalnessMap, delete this.roughnessMap, this; } } class Ipe { constructor() { this.name = Wt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS, this.specularGlossinessParams = [ "color", "map", "lightMap", "lightMapIntensity", "aoMap", "aoMapIntensity", "emissive", "emissiveIntensity", "emissiveMap", "bumpMap", "bumpScale", "normalMap", "normalMapType", "displacementMap", "displacementScale", "displacementBias", "specularMap", "specular", "glossinessMap", "glossiness", "alphaMap", "envMap", "envMapIntensity", "refractionRatio" ]; } getMaterialType() { return A1; } extendParams(e, r, i) { const n = r.extensions[this.name]; e.color = new Je(1, 1, 1), e.opacity = 1; const a = []; if (Array.isArray(n.diffuseFactor)) { const o = n.diffuseFactor; e.color.fromArray(o), e.opacity = o[3]; } if (n.diffuseTexture !== void 0 && a.push(i.assignTexture(e, "map", n.diffuseTexture)), e.emissive = new Je(0, 0, 0), e.glossiness = n.glossinessFactor !== void 0 ? n.glossinessFactor : 1, e.specular = new Je(1, 1, 1), Array.isArray(n.specularFactor) && e.specular.fromArray(n.specularFactor), n.specularGlossinessTexture !== void 0) { const o = n.specularGlossinessTexture; a.push(i.assignTexture(e, "glossinessMap", o)), a.push(i.assignTexture(e, "specularMap", o)); } return Promise.all(a); } createMaterial(e) { const r = new A1(e); return r.fog = !0, r.color = e.color, r.map = e.map === void 0 ? null : e.map, r.lightMap = null, r.lightMapIntensity = 1, r.aoMap = e.aoMap === void 0 ? null : e.aoMap, r.aoMapIntensity = 1, r.emissive = e.emissive, r.emissiveIntensity = 1, r.emissiveMap = e.emissiveMap === void 0 ? null : e.emissiveMap, r.bumpMap = e.bumpMap === void 0 ? null : e.bumpMap, r.bumpScale = 1, r.normalMap = e.normalMap === void 0 ? null : e.normalMap, r.normalMapType = Rs, e.normalScale && (r.normalScale = e.normalScale), r.displacementMap = null, r.displacementScale = 1, r.displacementBias = 0, r.specularMap = e.specularMap === void 0 ? null : e.specularMap, r.specular = e.specular, r.glossinessMap = e.glossinessMap === void 0 ? null : e.glossinessMap, r.glossiness = e.glossiness, r.alphaMap = null, r.envMap = e.envMap === void 0 ? null : e.envMap, r.envMapIntensity = 1, r.refractionRatio = 0.98, r; } } class Npe { constructor() { this.name = Wt.KHR_MESH_QUANTIZATION; } } class Ru extends Sa { constructor(e, r, i, n) { super(e, r, i, n); } copySampleValue_(e) { const r = this.resultBuffer, i = this.sampleValues, n = this.valueSize, a = e * n * 3 + n; for (let o = 0; o !== n; o++) r[o] = i[a + o]; return r; } } Ru.prototype.beforeStart_ = Ru.prototype.copySampleValue_; Ru.prototype.afterEnd_ = Ru.prototype.copySampleValue_; Ru.prototype.interpolate_ = function(t, e, r, i) { const n = this.resultBuffer, a = this.sampleValues, o = this.valueSize, s = o * 2, c = o * 3, l = i - e, u = (r - e) / l, d = u * u, h = d * u, f = t * c, p = f - c, m = -2 * h + 3 * d, y = h - d, g = 1 - m, v = y - d + u; for (let x = 0; x !== o; x++) { const w = a[p + x + o], S = a[p + x + s] * l, _ = a[f + x + o], b = a[f + x] * l; n[x] = g * w + v * S + m * _ + y * b; } return n; }; const Fa = { FLOAT: 5126, //FLOAT_MAT2: 35674, FLOAT_MAT3: 35675, FLOAT_MAT4: 35676, FLOAT_VEC2: 35664, FLOAT_VEC3: 35665, FLOAT_VEC4: 35666, LINEAR: 9729, REPEAT: 10497, SAMPLER_2D: 35678, POINTS: 0, LINES: 1, LINE_LOOP: 2, LINE_STRIP: 3, TRIANGLES: 4, TRIANGLE_STRIP: 5, TRIANGLE_FAN: 6, UNSIGNED_BYTE: 5121, UNSIGNED_SHORT: 5123 }, $h = { 5120: Int8Array, 5121: Uint8Array, 5122: Int16Array, 5123: Uint16Array, 5125: Uint32Array, 5126: Float32Array }, oT = { 9728: Dr, 9729: Cr, 9984: kh, 9985: av, 9986: Ph, 9987: wo }, sT = { 33071: ii, 33648: pu, 10497: _s }, lT = { SCALAR: 1, VEC2: 2, VEC3: 3, VEC4: 4, MAT2: 4, MAT3: 9, MAT4: 16 }, L1 = { POSITION: "position", NORMAL: "normal", TANGENT: "tangent", TEXCOORD_0: "uv", TEXCOORD_1: "uv2", COLOR_0: "color", WEIGHTS_0: "skinWeight", JOINTS_0: "skinIndex" }, Fo = { scale: "scale", translation: "position", rotation: "quaternion", weights: "morphTargetInfluences" }, Bpe = { CUBICSPLINE: void 0, // We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each // keyframe track will be initialized with a default interpolation type, then modified. LINEAR: Ll, STEP: mu }, Z0 = { OPAQUE: "OPAQUE", MASK: "MASK", BLEND: "BLEND" }; function cT(t, e) { return typeof t != "string" || t === "" ? "" : (/^https?:\/\//i.test(e) && /^\//.test(t) && (e = e.replace(/(^https?:\/\/[^\/]+).*/i, "$1")), /^(https?:)?\/\//i.test(t) || /^data:.*,.*$/i.test(t) || /^blob:.*$/i.test(t) ? t : e + t); } function Fpe(t) { return t.DefaultMaterial === void 0 && (t.DefaultMaterial = new Xl({ color: 16777215, emissive: 0, metalness: 1, roughness: 1, transparent: !1, depthTest: !0, side: xs })), t.DefaultMaterial; } function Od(t, e, r) { for (const i in r.extensions) t[i] === void 0 && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[i] = r.extensions[i]); } function Js(t, e) { e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(t.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras)); } function zpe(t, e, r) { let i = !1, n = !1; for (let s = 0, c = e.length; s < c; s++) { const l = e[s]; if (l.POSITION !== void 0 && (i = !0), l.NORMAL !== void 0 && (n = !0), i && n) break; } if (!i && !n) return Promise.resolve(t); const a = [], o = []; for (let s = 0, c = e.length; s < c; s++) { const l = e[s]; if (i) { const u = l.POSITION !== void 0 ? r.getDependency("accessor", l.POSITION) : t.attributes.position; a.push(u); } if (n) { const u = l.NORMAL !== void 0 ? r.getDependency("accessor", l.NORMAL) : t.attributes.normal; o.push(u); } } return Promise.all([ Promise.all(a), Promise.all(o) ]).then(function(s) { const c = s[0], l = s[1]; return i && (t.morphAttributes.position = c), n && (t.morphAttributes.normal = l), t.morphTargetsRelative = !0, t; }); } function $pe(t, e) { if (t.updateMorphTargets(), e.weights !== void 0) for (let r = 0, i = e.weights.length; r < i; r++) t.morphTargetInfluences[r] = e.weights[r]; if (e.extras && Array.isArray(e.extras.targetNames)) { const r = e.extras.targetNames; if (t.morphTargetInfluences.length === r.length) { t.morphTargetDictionary = {}; for (let i = 0, n = r.length; i < n; i++) t.morphTargetDictionary[r[i]] = i; } else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names."); } } function Vpe(t) { const e = t.extensions && t.extensions[Wt.KHR_DRACO_MESH_COMPRESSION]; let r; return e ? r = "draco:" + e.bufferView + ":" + e.indices + ":" + uT(e.attributes) : r = t.indices + ":" + uT(t.attributes) + ":" + t.mode, r; } function uT(t) { let e = ""; const r = Object.keys(t).sort(); for (let i = 0, n = r.length; i < n; i++) e += r[i] + ":" + t[r[i]] + ";"; return e; } function k1(t) { switch (t) { case Int8Array: return 1 / 127; case Uint8Array: return 1 / 255; case Int16Array: return 1 / 32767; case Uint16Array: return 1 / 65535; default: throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type."); } } class Upe { constructor(e = {}, r = {}) { this.json = e, this.extensions = {}, this.plugins = {}, this.options = r, this.cache = new Mpe(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.textureCache = {}, this.nodeNamesUsed = {}, typeof createImageBitmap < "u" && /Firefox/.test(navigator.userAgent) === !1 ? this.textureLoader = new yw(this.options.manager) : this.textureLoader = new uw(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new dn(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0); } setExtensions(e) { this.extensions = e; } setPlugins(e) { this.plugins = e; } parse(e, r) { const i = this, n = this.json, a = this.extensions; this.cache.removeAll(), this._invokeAll(function(o) { return o._markDefs && o._markDefs(); }), Promise.all(this._invokeAll(function(o) { return o.beforeRoot && o.beforeRoot(); })).then(function() { return Promise.all([ i.getDependencies("scene"), i.getDependencies("animation"), i.getDependencies("camera") ]); }).then(function(o) { const s = { scene: o[0][n.scene || 0], scenes: o[0], animations: o[1], cameras: o[2], asset: n.asset, parser: i, userData: {} }; Od(a, s, n), Js(s, n), Promise.all(i._invokeAll(function(c) { return c.afterRoot && c.afterRoot(s); })).then(function() { e(s); }); }).catch(r); } /** * Marks the special nodes/meshes in json for efficient parse. */ _markDefs() { const e = this.json.nodes || [], r = this.json.skins || [], i = this.json.meshes || []; for (let n = 0, a = r.length; n < a; n++) { const o = r[n].joints; for (let s = 0, c = o.length; s < c; s++) e[o[s]].isBone = !0; } for (let n = 0, a = e.length; n < a; n++) { const o = e[n]; o.mesh !== void 0 && (this._addNodeRef(this.meshCache, o.mesh), o.skin !== void 0 && (i[o.mesh].isSkinnedMesh = !0)), o.camera !== void 0 && this._addNodeRef(this.cameraCache, o.camera); } } /** * Counts references to shared node / Object3D resources. These resources * can be reused, or "instantiated", at multiple nodes in the scene * hierarchy. Mesh, Camera, and Light instances are instantiated and must * be marked. Non-scenegraph resources (like Materials, Geometries, and * Textures) can be reused directly and are not marked here. * * Example: CesiumMilkTruck sample model reuses "Wheel" meshes. */ _addNodeRef(e, r) { r !== void 0 && (e.refs[r] === void 0 && (e.refs[r] = e.uses[r] = 0), e.refs[r]++); } /** Returns a reference to a shared resource, cloning it if necessary. */ _getNodeRef(e, r, i) { if (e.refs[r] <= 1) return i; const n = i.clone(); return n.name += "_instance_" + e.uses[r]++, n; } _invokeOne(e) { const r = Object.values(this.plugins); r.push(this); for (let i = 0; i < r.length; i++) { const n = e(r[i]); if (n) return n; } return null; } _invokeAll(e) { const r = Object.values(this.plugins); r.unshift(this); const i = []; for (let n = 0; n < r.length; n++) { const a = e(r[n]); a && i.push(a); } return i; } /** * Requests the specified dependency asynchronously, with caching. * @param {string} type * @param {number} index * @return {Promise} */ getDependency(e, r) { const i = e + ":" + r; let n = this.cache.get(i); if (!n) { switch (e) { case "scene": n = this.loadScene(r); break; case "node": n = this.loadNode(r); break; case "mesh": n = this._invokeOne(function(a) { return a.loadMesh && a.loadMesh(r); }); break; case "accessor": n = this.loadAccessor(r); break; case "bufferView": n = this._invokeOne(function(a) { return a.loadBufferView && a.loadBufferView(r); }); break; case "buffer": n = this.loadBuffer(r); break; case "material": n = this._invokeOne(function(a) { return a.loadMaterial && a.loadMaterial(r); }); break; case "texture": n = this._invokeOne(function(a) { return a.loadTexture && a.loadTexture(r); }); break; case "skin": n = this.loadSkin(r); break; case "animation": n = this.loadAnimation(r); break; case "camera": n = this.loadCamera(r); break; default: throw new Error("Unknown type: " + e); } this.cache.add(i, n); } return n; } /** * Requests all dependencies of the specified type asynchronously, with caching. * @param {string} type * @return {Promise>} */ getDependencies(e) { let r = this.cache.get(e); if (!r) { const i = this, n = this.json[e + (e === "mesh" ? "es" : "s")] || []; r = Promise.all(n.map(function(a, o) { return i.getDependency(e, o); })), this.cache.add(e, r); } return r; } /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views * @param {number} bufferIndex * @return {Promise} */ loadBuffer(e) { const r = this.json.buffers[e], i = this.fileLoader; if (r.type && r.type !== "arraybuffer") throw new Error("THREE.GLTFLoader: " + r.type + " buffer type is not supported."); if (r.uri === void 0 && e === 0) return Promise.resolve(this.extensions[Wt.KHR_BINARY_GLTF].body); const n = this.options; return new Promise(function(a, o) { i.load(cT(r.uri, n.path), a, void 0, function() { o(new Error('THREE.GLTFLoader: Failed to load buffer "' + r.uri + '".')); }); }); } /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views * @param {number} bufferViewIndex * @return {Promise} */ loadBufferView(e) { const r = this.json.bufferViews[e]; return this.getDependency("buffer", r.buffer).then(function(i) { const n = r.byteLength || 0, a = r.byteOffset || 0; return i.slice(a, a + n); }); } /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#accessors * @param {number} accessorIndex * @return {Promise} */ loadAccessor(e) { const r = this, i = this.json, n = this.json.accessors[e]; if (n.bufferView === void 0 && n.sparse === void 0) return Promise.resolve(null); const a = []; return n.bufferView !== void 0 ? a.push(this.getDependency("bufferView", n.bufferView)) : a.push(null), n.sparse !== void 0 && (a.push(this.getDependency("bufferView", n.sparse.indices.bufferView)), a.push(this.getDependency("bufferView", n.sparse.values.bufferView))), Promise.all(a).then(function(o) { const s = o[0], c = lT[n.type], l = $h[n.componentType], u = l.BYTES_PER_ELEMENT, d = u * c, h = n.byteOffset || 0, f = n.bufferView !== void 0 ? i.bufferViews[n.bufferView].byteStride : void 0, p = n.normalized === !0; let m, y; if (f && f !== d) { const g = Math.floor(h / f), v = "InterleavedBuffer:" + n.bufferView + ":" + n.componentType + ":" + g + ":" + n.count; let x = r.cache.get(v); x || (m = new l(s, g * f, n.count * f / u), x = new Is(m, f / u), r.cache.add(v, x)), y = new lo(x, c, h % f / u, p); } else s === null ? m = new l(n.count * c) : m = new l(s, h, n.count * c), y = new kt(m, c, p); if (n.sparse !== void 0) { const g = lT.SCALAR, v = $h[n.sparse.indices.componentType], x = n.sparse.indices.byteOffset || 0, w = n.sparse.values.byteOffset || 0, S = new v(o[1], x, n.sparse.count * g), _ = new l(o[2], w, n.sparse.count * c); s !== null && (y = new kt(y.array.slice(), y.itemSize, y.normalized)); for (let b = 0, T = S.length; b < T; b++) { const E = S[b]; if (y.setX(E, _[b * c]), c >= 2 && y.setY(E, _[b * c + 1]), c >= 3 && y.setZ(E, _[b * c + 2]), c >= 4 && y.setW(E, _[b * c + 3]), c >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute."); } } return y; }); } /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#textures * @param {number} textureIndex * @return {Promise} */ loadTexture(e) { const r = this.json, i = this.options, n = r.textures[e], a = r.images[n.source]; let o = this.textureLoader; if (a.uri) { const s = i.manager.getHandler(a.uri); s !== null && (o = s); } return this.loadTextureImage(e, a, o); } loadTextureImage(e, r, i) { const n = this, a = this.json, o = this.options, s = a.textures[e], c = (r.uri || r.bufferView) + ":" + s.sampler; if (this.textureCache[c]) return this.textureCache[c]; const l = self.URL || self.webkitURL; let u = r.uri || "", d = !1, h = !0; const f = u.search(/\.jpe?g($|\?)/i) > 0 || u.search(/^data\:image\/jpeg/) === 0; if ((r.mimeType === "image/jpeg" || f) && (h = !1), r.bufferView !== void 0) u = n.getDependency("bufferView", r.bufferView).then(function(m) { if (r.mimeType === "image/png") { const g = new DataView(m, 25, 1).getUint8(0, !1); h = g === 6 || g === 4 || g === 3; } d = !0; const y = new Blob([m], { type: r.mimeType }); return u = l.createObjectURL(y), u; }); else if (r.uri === void 0) throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView"); const p = Promise.resolve(u).then(function(m) { return new Promise(function(y, g) { let v = y; i.isImageBitmapLoader === !0 && (v = function(x) { const w = new zr(x); w.needsUpdate = !0, y(w); }), i.load(cT(m, o.path), v, void 0, g); }); }).then(function(m) { d === !0 && l.revokeObjectURL(u), m.flipY = !1, s.name && (m.name = s.name), h || (m.format = Qa); const y = (a.samplers || {})[s.sampler] || {}; return m.magFilter = oT[y.magFilter] || Cr, m.minFilter = oT[y.minFilter] || wo, m.wrapS = sT[y.wrapS] || _s, m.wrapT = sT[y.wrapT] || _s, n.associations.set(m, { type: "textures", index: e }), m; }).catch(function() { return console.error("THREE.GLTFLoader: Couldn't load texture", u), null; }); return this.textureCache[c] = p, p; } /** * Asynchronously assigns a texture to the given material parameters. * @param {Object} materialParams * @param {string} mapName * @param {Object} mapDef * @return {Promise} */ assignTexture(e, r, i) { const n = this; return this.getDependency("texture", i.index).then(function(a) { if (i.texCoord !== void 0 && i.texCoord != 0 && !(r === "aoMap" && i.texCoord == 1) && console.warn("THREE.GLTFLoader: Custom UV set " + i.texCoord + " for texture " + r + " not yet supported."), n.extensions[Wt.KHR_TEXTURE_TRANSFORM]) { const o = i.extensions !== void 0 ? i.extensions[Wt.KHR_TEXTURE_TRANSFORM] : void 0; if (o) { const s = n.associations.get(a); a = n.extensions[Wt.KHR_TEXTURE_TRANSFORM].extendTexture(a, o), n.associations.set(a, s); } } e[r] = a; }); } /** * Assigns final material to a Mesh, Line, or Points instance. The instance * already has a material (generated from the glTF material options alone) * but reuse of the same glTF material may require multiple threejs materials * to accommodate different primitive types, defines, etc. New materials will * be created if necessary, and reused from a cache. * @param {Object3D} mesh Mesh, Line, or Points instance. */ assignFinalMaterial(e) { const r = e.geometry; let i = e.material; const n = r.attributes.tangent !== void 0, a = r.attributes.color !== void 0, o = r.attributes.normal === void 0, s = Object.keys(r.morphAttributes).length > 0, c = s && r.morphAttributes.normal !== void 0; if (e.isPoints) { const l = "PointsMaterial:" + i.uuid; let u = this.cache.get(l); u || (u = new Ns(), jr.prototype.copy.call(u, i), u.color.copy(i.color), u.map = i.map, u.sizeAttenuation = !1, this.cache.add(l, u)), i = u; } else if (e.isLine) { const l = "LineBasicMaterial:" + i.uuid; let u = this.cache.get(l); u || (u = new Kr(), jr.prototype.copy.call(u, i), u.color.copy(i.color), this.cache.add(l, u)), i = u; } if (n || a || o || s) { let l = "ClonedMaterial:" + i.uuid + ":"; i.isGLTFSpecularGlossinessMaterial && (l += "specular-glossiness:"), n && (l += "vertex-tangents:"), a && (l += "vertex-colors:"), o && (l += "flat-shading:"), s && (l += "morph-targets:"), c && (l += "morph-normals:"); let u = this.cache.get(l); u || (u = i.clone(), a && (u.vertexColors = !0), o && (u.flatShading = !0), s && (u.morphTargets = !0), c && (u.morphNormals = !0), n && (u.vertexTangents = !0, u.normalScale && (u.normalScale.y *= -1), u.clearcoatNormalScale && (u.clearcoatNormalScale.y *= -1)), this.cache.add(l, u), this.associations.set(u, this.associations.get(i))), i = u; } i.aoMap && r.attributes.uv2 === void 0 && r.attributes.uv !== void 0 && r.setAttribute("uv2", r.attributes.uv), e.material = i; } getMaterialType() { return Xl; } /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials * @param {number} materialIndex * @return {Promise} */ loadMaterial(e) { const r = this, i = this.json, n = this.extensions, a = i.materials[e]; let o; const s = {}, c = a.extensions || {}, l = []; if (c[Wt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]) { const d = n[Wt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]; o = d.getMaterialType(), l.push(d.extendParams(s, a, r)); } else if (c[Wt.KHR_MATERIALS_UNLIT]) { const d = n[Wt.KHR_MATERIALS_UNLIT]; o = d.getMaterialType(), l.push(d.extendParams(s, a, r)); } else { const d = a.pbrMetallicRoughness || {}; if (s.color = new Je(1, 1, 1), s.opacity = 1, Array.isArray(d.baseColorFactor)) { const h = d.baseColorFactor; s.color.fromArray(h), s.opacity = h[3]; } d.baseColorTexture !== void 0 && l.push(r.assignTexture(s, "map", d.baseColorTexture)), s.metalness = d.metallicFactor !== void 0 ? d.metallicFactor : 1, s.roughness = d.roughnessFactor !== void 0 ? d.roughnessFactor : 1, d.metallicRoughnessTexture !== void 0 && (l.push(r.assignTexture(s, "metalnessMap", d.metallicRoughnessTexture)), l.push(r.assignTexture(s, "roughnessMap", d.metallicRoughnessTexture))), o = this._invokeOne(function(h) { return h.getMaterialType && h.getMaterialType(e); }), l.push(Promise.all(this._invokeAll(function(h) { return h.extendMaterialParams && h.extendMaterialParams(e, s); }))); } a.doubleSided === !0 && (s.side = ws); const u = a.alphaMode || Z0.OPAQUE; return u === Z0.BLEND ? (s.transparent = !0, s.depthWrite = !1) : (s.transparent = !1, u === Z0.MASK && (s.alphaTest = a.alphaCutoff !== void 0 ? a.alphaCutoff : 0.5)), a.normalTexture !== void 0 && o !== Hi && (l.push(r.assignTexture(s, "normalMap", a.normalTexture)), s.normalScale = new je(1, -1), a.normalTexture.scale !== void 0 && s.normalScale.set(a.normalTexture.scale, -a.normalTexture.scale)), a.occlusionTexture !== void 0 && o !== Hi && (l.push(r.assignTexture(s, "aoMap", a.occlusionTexture)), a.occlusionTexture.strength !== void 0 && (s.aoMapIntensity = a.occlusionTexture.strength)), a.emissiveFactor !== void 0 && o !== Hi && (s.emissive = new Je().fromArray(a.emissiveFactor)), a.emissiveTexture !== void 0 && o !== Hi && l.push(r.assignTexture(s, "emissiveMap", a.emissiveTexture)), Promise.all(l).then(function() { let d; return o === A1 ? d = n[Wt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(s) : d = new o(s), a.name && (d.name = a.name), d.map && (d.map.encoding = kl), d.emissiveMap && (d.emissiveMap.encoding = kl), Js(d, a), r.associations.set(d, { type: "materials", index: e }), a.extensions && Od(n, d, a), d; }); } /** When Object3D instances are targeted by animation, they need unique names. */ createUniqueName(e) { const r = Vt.sanitizeNodeName(e || ""); let i = r; for (let n = 1; this.nodeNamesUsed[i]; ++n) i = r + "_" + n; return this.nodeNamesUsed[i] = !0, i; } /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#geometry * * Creates BufferGeometries from primitives. * * @param {Array} primitives * @return {Promise>} */ loadGeometries(e) { const r = this, i = this.extensions, n = this.primitiveCache; function a(s) { return i[Wt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(s, r).then(function(c) { return dT(c, s, r); }); } const o = []; for (let s = 0, c = e.length; s < c; s++) { const l = e[s], u = Vpe(l), d = n[u]; if (d) o.push(d.promise); else { let h; l.extensions && l.extensions[Wt.KHR_DRACO_MESH_COMPRESSION] ? h = a(l) : h = dT(new ft(), l, r), n[u] = { primitive: l, promise: h }, o.push(h); } } return Promise.all(o); } /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#meshes * @param {number} meshIndex * @return {Promise} */ loadMesh(e) { const r = this, i = this.json, n = this.extensions, a = i.meshes[e], o = a.primitives, s = []; for (let c = 0, l = o.length; c < l; c++) { const u = o[c].material === void 0 ? Fpe(this.cache) : this.getDependency("material", o[c].material); s.push(u); } return s.push(r.loadGeometries(o)), Promise.all(s).then(function(c) { const l = c.slice(0, c.length - 1), u = c[c.length - 1], d = []; for (let f = 0, p = u.length; f < p; f++) { const m = u[f], y = o[f]; let g; const v = l[f]; if (y.mode === Fa.TRIANGLES || y.mode === Fa.TRIANGLE_STRIP || y.mode === Fa.TRIANGLE_FAN || y.mode === void 0) g = a.isSkinnedMesh === !0 ? new Ep(m, v) : new Fr(m, v), g.isSkinnedMesh === !0 && !g.geometry.attributes.skinWeight.normalized && g.normalizeSkinWeights(), y.mode === Fa.TRIANGLE_STRIP ? g.geometry = hT(g.geometry, CR) : y.mode === Fa.TRIANGLE_FAN && (g.geometry = hT(g.geometry, Dx)); else if (y.mode === Fa.LINES) g = new zi(m, v); else if (y.mode === Fa.LINE_STRIP) g = new wa(m, v); else if (y.mode === Fa.LINE_LOOP) g = new gv(m, v); else if (y.mode === Fa.POINTS) g = new id(m, v); else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + y.mode); Object.keys(g.geometry.morphAttributes).length > 0 && $pe(g, a), g.name = r.createUniqueName(a.name || "mesh_" + e), Js(g, a), y.extensions && Od(n, g, y), r.assignFinalMaterial(g), d.push(g); } if (d.length === 1) return d[0]; const h = new ua(); for (let f = 0, p = d.length; f < p; f++) h.add(d[f]); return h; }); } /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#cameras * @param {number} cameraIndex * @return {Promise} */ loadCamera(e) { let r; const i = this.json.cameras[e], n = i[i.type]; if (!n) { console.warn("THREE.GLTFLoader: Missing camera parameters."); return; } return i.type === "perspective" ? r = new Wr(x1.radToDeg(n.yfov), n.aspectRatio || 1, n.znear || 1, n.zfar || 2e6) : i.type === "orthographic" && (r = new ad(-n.xmag, n.xmag, n.ymag, -n.ymag, n.znear, n.zfar)), i.name && (r.name = this.createUniqueName(i.name)), Js(r, i), Promise.resolve(r); } /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins * @param {number} skinIndex * @return {Promise} */ loadSkin(e) { const r = this.json.skins[e], i = { joints: r.joints }; return r.inverseBindMatrices === void 0 ? Promise.resolve(i) : this.getDependency("accessor", r.inverseBindMatrices).then(function(n) { return i.inverseBindMatrices = n, i; }); } /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#animations * @param {number} animationIndex * @return {Promise} */ loadAnimation(e) { const r = this.json.animations[e], i = [], n = [], a = [], o = [], s = []; for (let c = 0, l = r.channels.length; c < l; c++) { const u = r.channels[c], d = r.samplers[u.sampler], h = u.target, f = h.node !== void 0 ? h.node : h.id, p = r.parameters !== void 0 ? r.parameters[d.input] : d.input, m = r.parameters !== void 0 ? r.parameters[d.output] : d.output; i.push(this.getDependency("node", f)), n.push(this.getDependency("accessor", p)), a.push(this.getDependency("accessor", m)), o.push(d), s.push(h); } return Promise.all([ Promise.all(i), Promise.all(n), Promise.all(a), Promise.all(o), Promise.all(s) ]).then(function(c) { const l = c[0], u = c[1], d = c[2], h = c[3], f = c[4], p = []; for (let y = 0, g = l.length; y < g; y++) { const v = l[y], x = u[y], w = d[y], S = h[y], _ = f[y]; if (v === void 0) continue; v.updateMatrix(), v.matrixAutoUpdate = !0; let b; switch (Fo[_.path]) { case Fo.weights: b = Lu; break; case Fo.rotation: b = Yl; break; case Fo.position: case Fo.scale: default: b = ku; break; } const T = v.name ? v.name : v.uuid, E = S.interpolation !== void 0 ? Bpe[S.interpolation] : Ll, C = []; Fo[_.path] === Fo.weights ? v.traverse(function(A) { A.isMesh === !0 && A.morphTargetInfluences && C.push(A.name ? A.name : A.uuid); }) : C.push(T); let L = w.array; if (w.normalized) { const A = k1(L.constructor), k = new Float32Array(L.length); for (let P = 0, R = L.length; P < R; P++) k[P] = L[P] * A; L = k; } for (let A = 0, k = C.length; A < k; A++) { const P = new b( C[A] + "." + Fo[_.path], x.array, L, E ); S.interpolation === "CUBICSPLINE" && (P.createInterpolant = function(R) { return new Ru(this.times, this.values, this.getValueSize() / 3, R); }, P.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0), p.push(P); } } const m = r.name ? r.name : "animation_" + e; return new Pu(m, void 0, p); }); } createNodeMesh(e) { const r = this.json, i = this, n = r.nodes[e]; return n.mesh === void 0 ? null : i.getDependency("mesh", n.mesh).then(function(a) { const o = i._getNodeRef(i.meshCache, n.mesh, a); return n.weights !== void 0 && o.traverse(function(s) { if (s.isMesh) for (let c = 0, l = n.weights.length; c < l; c++) s.morphTargetInfluences[c] = n.weights[c]; }), o; }); } /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#nodes-and-hierarchy * @param {number} nodeIndex * @return {Promise} */ loadNode(e) { const r = this.json, i = this.extensions, n = this, a = r.nodes[e], o = a.name ? n.createUniqueName(a.name) : ""; return function() { const s = [], c = n._invokeOne(function(l) { return l.createNodeMesh && l.createNodeMesh(e); }); return c && s.push(c), a.camera !== void 0 && s.push(n.getDependency("camera", a.camera).then(function(l) { return n._getNodeRef(n.cameraCache, a.camera, l); })), n._invokeAll(function(l) { return l.createNodeAttachment && l.createNodeAttachment(e); }).forEach(function(l) { s.push(l); }), Promise.all(s); }().then(function(s) { let c; if (a.isBone === !0 ? c = new Tp() : s.length > 1 ? c = new ua() : s.length === 1 ? c = s[0] : c = new It(), c !== s[0]) for (let l = 0, u = s.length; l < u; l++) c.add(s[l]); if (a.name && (c.userData.name = a.name, c.name = o), Js(c, a), a.extensions && Od(i, c, a), a.matrix !== void 0) { const l = new at(); l.fromArray(a.matrix), c.applyMatrix4(l); } else a.translation !== void 0 && c.position.fromArray(a.translation), a.rotation !== void 0 && c.quaternion.fromArray(a.rotation), a.scale !== void 0 && c.scale.fromArray(a.scale); return n.associations.set(c, { type: "nodes", index: e }), c; }); } /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#scenes * @param {number} sceneIndex * @return {Promise} */ loadScene(e) { const r = this.json, i = this.extensions, n = this.json.scenes[e], a = this, o = new ua(); n.name && (o.name = a.createUniqueName(n.name)), Js(o, n), n.extensions && Od(i, o, n); const s = n.nodes || [], c = []; for (let l = 0, u = s.length; l < u; l++) c.push(qO(s[l], o, r, a)); return Promise.all(c).then(function() { return o; }); } } function qO(t, e, r, i) { const n = r.nodes[t]; return i.getDependency("node", t).then(function(a) { if (n.skin === void 0) return a; let o; return i.getDependency("skin", n.skin).then(function(s) { o = s; const c = []; for (let l = 0, u = o.joints.length; l < u; l++) c.push(i.getDependency("node", o.joints[l])); return Promise.all(c); }).then(function(s) { return a.traverse(function(c) { if (!c.isMesh) return; const l = [], u = []; for (let d = 0, h = s.length; d < h; d++) { const f = s[d]; if (f) { l.push(f); const p = new at(); o.inverseBindMatrices !== void 0 && p.fromArray(o.inverseBindMatrices.array, d * 16), u.push(p); } else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', o.joints[d]); } c.bind(new Cp(l, u), c.matrixWorld); }), a; }); }).then(function(a) { e.add(a); const o = []; if (n.children) { const s = n.children; for (let c = 0, l = s.length; c < l; c++) { const u = s[c]; o.push(qO(u, a, r, i)); } } return Promise.all(o); }); } function jpe(t, e, r) { const i = e.attributes, n = new Ki(); if (i.POSITION !== void 0) { const s = r.json.accessors[i.POSITION], c = s.min, l = s.max; if (c !== void 0 && l !== void 0) { if (n.set( new de(c[0], c[1], c[2]), new de(l[0], l[1], l[2]) ), s.normalized) { const u = k1($h[s.componentType]); n.min.multiplyScalar(u), n.max.multiplyScalar(u); } } else { console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION."); return; } } else return; const a = e.targets; if (a !== void 0) { const s = new de(), c = new de(); for (let l = 0, u = a.length; l < u; l++) { const d = a[l]; if (d.POSITION !== void 0) { const h = r.json.accessors[d.POSITION], f = h.min, p = h.max; if (f !== void 0 && p !== void 0) { if (c.setX(Math.max(Math.abs(f[0]), Math.abs(p[0]))), c.setY(Math.max(Math.abs(f[1]), Math.abs(p[1]))), c.setZ(Math.max(Math.abs(f[2]), Math.abs(p[2]))), h.normalized) { const m = k1($h[h.componentType]); c.multiplyScalar(m); } s.max(c); } else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION."); } } n.expandByVector(s); } t.boundingBox = n; const o = new _o(); n.getCenter(o.center), o.radius = n.min.distanceTo(n.max) / 2, t.boundingSphere = o; } function dT(t, e, r) { const i = e.attributes, n = []; function a(o, s) { return r.getDependency("accessor", o).then(function(c) { t.setAttribute(s, c); }); } for (const o in i) { const s = L1[o] || o.toLowerCase(); s in t.attributes || n.push(a(i[o], s)); } if (e.indices !== void 0 && !t.index) { const o = r.getDependency("accessor", e.indices).then(function(s) { t.setIndex(s); }); n.push(o); } return Js(t, e), jpe(t, e, r), Promise.all(n).then(function() { return e.targets !== void 0 ? zpe(t, e.targets, r) : t; }); } function hT(t, e) { let r = t.getIndex(); if (r === null) { const o = [], s = t.getAttribute("position"); if (s !== void 0) { for (let c = 0; c < s.count; c++) o.push(c); t.setIndex(o), r = t.getIndex(); } else return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), t; } const i = r.count - 2, n = []; if (e === Dx) for (let o = 1; o <= i; o++) n.push(r.getX(0)), n.push(r.getX(o)), n.push(r.getX(o + 1)); else for (let o = 0; o < i; o++) o % 2 === 0 ? (n.push(r.getX(o)), n.push(r.getX(o + 1)), n.push(r.getX(o + 2))) : (n.push(r.getX(o + 2)), n.push(r.getX(o + 1)), n.push(r.getX(o))); n.length / 3 !== i && console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles."); const a = t.clone(); return a.setIndex(n), a; } const Hpe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, GLTFLoader: Spe }, Symbol.toStringTag, { value: "Module" })), Gpe = /* @__PURE__ */ ev(Hpe); var pT = { exports: {} }, fT; function Wpe() { return fT || (fT = 1, function(t) { function e(l) { var u = {}; function d(f) { if (u[f]) return u[f].exports; var p = u[f] = { /******/ i: f, /******/ l: !1, /******/ exports: {} /******/ }; return l[f].call(p.exports, p, p.exports, d), p.l = !0, p.exports; } d.m = l, d.c = u, d.i = function(f) { return f; }, d.d = function(f, p, m) { d.o(f, p) || Object.defineProperty(f, p, { /******/ configurable: !1, /******/ enumerable: !0, /******/ get: m /******/ }); }, d.r = function(f) { Object.defineProperty(f, "__esModule", { value: !0 }); }, d.n = function(f) { var p = f && f.__esModule ? ( /******/ function() { return f.default; } ) : ( /******/ function() { return f; } ); return d.d(p, "a", p), p; }, d.o = function(f, p) { return Object.prototype.hasOwnProperty.call(f, p); }, d.p = "/", d.oe = function(f) { throw console.error(f), f; }; var h = d(d.s = ENTRY_MODULE); return h.default || h; } var r = "[\\.|\\-|\\+|\\w|/|@]+", i = "\\(\\s*(/\\*.*?\\*/)?\\s*.*?(" + r + ").*?\\)"; function n(l) { return (l + "").replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&"); } function a(l) { return !isNaN(1 * l); } function o(l, u, d) { var h = {}; h[d] = []; var f = u.toString(), p = f.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/); if (!p) return h; for (var m = p[1], y = new RegExp("(\\\\n|\\W)" + n(m) + i, "g"), g; g = y.exec(f); ) g[3] !== "dll-reference" && h[d].push(g[3]); for (y = new RegExp("\\(" + n(m) + '\\("(dll-reference\\s(' + r + '))"\\)\\)' + i, "g"); g = y.exec(f); ) l[g[2]] || (h[d].push(g[1]), l[g[2]] = __webpack_require__(g[1]).m), h[g[2]] = h[g[2]] || [], h[g[2]].push(g[4]); for (var v = Object.keys(h), x = 0; x < v.length; x++) for (var w = 0; w < h[v[x]].length; w++) a(h[v[x]][w]) && (h[v[x]][w] = 1 * h[v[x]][w]); return h; } function s(l) { var u = Object.keys(l); return u.reduce(function(d, h) { return d || l[h].length > 0; }, !1); } function c(l, u) { for (var d = { main: [u] }, h = { main: [] }, f = { main: {} }; s(d); ) for (var p = Object.keys(d), m = 0; m < p.length; m++) { var y = p[m], g = d[y], v = g.pop(); if (f[y] = f[y] || {}, !(f[y][v] || !l[y][v])) { f[y][v] = !0, h[y] = h[y] || [], h[y].push(v); for (var x = o(l, l[y][v], y), w = Object.keys(x), S = 0; S < w.length; S++) d[w[S]] = d[w[S]] || [], d[w[S]] = d[w[S]].concat(x[w[S]]); } } return h; } t.exports = function(l, u) { u = u || {}; var d = { main: __webpack_modules__ }, h = u.all ? { main: Object.keys(d.main) } : c(d, l), f = ""; Object.keys(h).filter(function(v) { return v !== "main"; }).forEach(function(v) { for (var x = 0; h[v][x]; ) x++; h[v].push(x), d[v][x] = "(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })", f = f + "var " + v + " = (" + e.toString().replace("ENTRY_MODULE", JSON.stringify(x)) + ")({" + h[v].map(function(w) { return "" + JSON.stringify(w) + ": " + d[v][w].toString(); }).join(",") + `}); `; }), f = f + "new ((" + e.toString().replace("ENTRY_MODULE", JSON.stringify(l)) + ")({" + h.main.map(function(v) { return "" + JSON.stringify(v) + ": " + d.main[v].toString(); }).join(",") + "}))(self);"; var p = new window.Blob([f], { type: "text/javascript" }); if (u.bare) return p; var m = window.URL || window.webkitURL || window.mozURL || window.msURL, y = m.createObjectURL(p), g = new window.Worker(y); return g.objectURL = y, g; }; }(pT)), pT.exports; } function qpe(t) { var e = this.constructor; return this.then( function(r) { return e.resolve(t()).then(function() { return r; }); }, function(r) { return e.resolve(t()).then(function() { return e.reject(r); }); } ); } function Xpe(t) { var e = this; return new e(function(r, i) { if (!(t && typeof t.length < "u")) return i( new TypeError( typeof t + " " + t + " is not iterable(cannot read property Symbol(Symbol.iterator))" ) ); var n = Array.prototype.slice.call(t); if (n.length === 0) return r([]); var a = n.length; function o(c, l) { if (l && (typeof l == "object" || typeof l == "function")) { var u = l.then; if (typeof u == "function") { u.call( l, function(d) { o(c, d); }, function(d) { n[c] = { status: "rejected", reason: d }, --a === 0 && r(n); } ); return; } } n[c] = { status: "fulfilled", value: l }, --a === 0 && r(n); } for (var s = 0; s < n.length; s++) o(s, n[s]); }); } function XO(t, e) { this.name = "AggregateError", this.errors = t, this.message = e || ""; } XO.prototype = Error.prototype; function Zpe(t) { var e = this; return new e(function(r, i) { if (!(t && typeof t.length < "u")) return i(new TypeError("Promise.any accepts an array")); var n = Array.prototype.slice.call(t); if (n.length === 0) return i(); for (var a = [], o = 0; o < n.length; o++) try { e.resolve(n[o]).then(r).catch(function(s) { a.push(s), a.length === n.length && i( new XO( a, "All promises were rejected" ) ); }); } catch (s) { i(s); } }); } var Ype = setTimeout; function ZO(t) { return !!(t && typeof t.length < "u"); } function Kpe() { } function Jpe(t, e) { return function() { t.apply(e, arguments); }; } function wr(t) { if (!(this instanceof wr)) throw new TypeError("Promises must be constructed via new"); if (typeof t != "function") throw new TypeError("not a function"); this._state = 0, this._handled = !1, this._value = void 0, this._deferreds = [], KO(t, this); } function YO(t, e) { for (; t._state === 3; ) t = t._value; if (t._state === 0) { t._deferreds.push(e); return; } t._handled = !0, wr._immediateFn(function() { var r = t._state === 1 ? e.onFulfilled : e.onRejected; if (r === null) { (t._state === 1 ? P1 : Vh)(e.promise, t._value); return; } var i; try { i = r(t._value); } catch (n) { Vh(e.promise, n); return; } P1(e.promise, i); }); } function P1(t, e) { try { if (e === t) throw new TypeError("A promise cannot be resolved with itself."); if (e && (typeof e == "object" || typeof e == "function")) { var r = e.then; if (e instanceof wr) { t._state = 3, t._value = e, R1(t); return; } else if (typeof r == "function") { KO(Jpe(r, e), t); return; } } t._state = 1, t._value = e, R1(t); } catch (i) { Vh(t, i); } } function Vh(t, e) { t._state = 2, t._value = e, R1(t); } function R1(t) { t._state === 2 && t._deferreds.length === 0 && wr._immediateFn(function() { t._handled || wr._unhandledRejectionFn(t._value); }); for (var e = 0, r = t._deferreds.length; e < r; e++) YO(t, t._deferreds[e]); t._deferreds = null; } function Qpe(t, e, r) { this.onFulfilled = typeof t == "function" ? t : null, this.onRejected = typeof e == "function" ? e : null, this.promise = r; } function KO(t, e) { var r = !1; try { t( function(i) { r || (r = !0, P1(e, i)); }, function(i) { r || (r = !0, Vh(e, i)); } ); } catch (i) { if (r) return; r = !0, Vh(e, i); } } wr.prototype.catch = function(t) { return this.then(null, t); }; wr.prototype.then = function(t, e) { var r = new this.constructor(Kpe); return YO(this, new Qpe(t, e, r)), r; }; wr.prototype.finally = qpe; wr.all = function(t) { return new wr(function(e, r) { if (!ZO(t)) return r(new TypeError("Promise.all accepts an array")); var i = Array.prototype.slice.call(t); if (i.length === 0) return e([]); var n = i.length; function a(s, c) { try { if (c && (typeof c == "object" || typeof c == "function")) { var l = c.then; if (typeof l == "function") { l.call( c, function(u) { a(s, u); }, r ); return; } } i[s] = c, --n === 0 && e(i); } catch (u) { r(u); } } for (var o = 0; o < i.length; o++) a(o, i[o]); }); }; wr.any = Zpe; wr.allSettled = Xpe; wr.resolve = function(t) { return t && typeof t == "object" && t.constructor === wr ? t : new wr(function(e) { e(t); }); }; wr.reject = function(t) { return new wr(function(e, r) { r(t); }); }; wr.race = function(t) { return new wr(function(e, r) { if (!ZO(t)) return r(new TypeError("Promise.race accepts an array")); for (var i = 0, n = t.length; i < n; i++) wr.resolve(t[i]).then(e, r); }); }; wr._immediateFn = // @ts-ignore typeof setImmediate == "function" && function(t) { setImmediate(t); } || function(t) { Ype(t, 0); }; wr._unhandledRejectionFn = function(t) { typeof console < "u" && console && console.warn("Possible Unhandled Promise Rejection:", t); }; const efe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: wr }, Symbol.toStringTag, { value: "Module" })), tfe = /* @__PURE__ */ ev(efe); (function(t, e) { (function(r, i) { t.exports = i(); })(Wo, () => ( /******/ (() => { var r = [ /* 0 */ /***/ (o, s, c) => { c(1); var l = c(2), u = l.version, d = function() { this.Revision = u, this.defaultMaterialColor = 16777215, this.defaultOpacity = 1, this.modelPrefix = void 0, this.Geometry = c(3).Geometry, this.Glyph = c(16).Glyph, this.Glyphset = c(18).Glyphset, this.Pointset = c(22).Pointset, this.Label = c(17).Label, this.Lines = c(24).Lines, this.TextureArray = c(25).TextureArray, this.TextureSlides = c(27).TextureSlides, this.Renderer = c(30).Renderer, this.Scene = c(32).Scene, this.GeometryCSG = c(50).GeometryCSG, this.GlyphsetCSG = c(56).GlyphsetCSG, this.Viewport = c(43).Viewport, this.CameraControls = c(43).CameraControls, this.SmoothCameraTransition = c(43).SmoothCameraTransition, this.RayCaster = c(43).RayCaster, this.CameraAutoTumble = c(43).CameraAutoTumble, this.StereoEffect = c(43).StereoEffect, this.loadExternalFile = c(5).loadExternalFile, this.loadExternalFiles = c(5).loadExternalFiles, this.THREE = c(4); }; o.exports = new d(); }, /* 1 */ /***/ (o) => { o.exports = Hae(); }, /* 2 */ /***/ (o) => { o.exports = /* @__PURE__ */ JSON.parse('{"name":"zincjs","version":"1.11.4","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu ","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}'); }, /* 3 */ /***/ function(o, s, c) { var l = c(4), u = c(5).toBufferGeometry, d = (f, p, m) => { var y = u(f, m), g = !1; 1 > m.opacity && (g = !0); var v; if (y._video === void 0) { var x = m.localTimeEnabled || m.localMorphColour; p ? (v = p, v.morphTargets = x, v.morphNormals = m.localTimeEnabled) : y instanceof l.BufferGeometry && y.attributes.color === void 0 ? v = new l.MeshPhongMaterial({ color: m.colour, morphTargets: x, morphNormals: m.localTimeEnabled, transparent: g, opacity: m.opacity, side: l.DoubleSide }) : v = new l.MeshPhongMaterial({ color: m.colour, morphTargets: x, morphNormals: m.localTimeEnabled, vertexColors: l.VertexColors, transparent: g, opacity: m.opacity, side: l.DoubleSide }), m.localMorphColour && y.morphAttributes.color && (v.onBeforeCompile = c(9).augmentMorphColor()); } else { var w = y._video.createCanvasVideoTexture(); v = new l.MeshBasicMaterial({ morphTargets: m.localTimeEnabled, color: new l.Color(1, 1, 1), transparent: g, opacity: m.opacity, map: w, side: l.DoubleSide }), this.videoHandler = y._video; } return new l.Mesh(y, v); }, h = function() { c(10).ZincObject.call(this), this.videoHandler = void 0, this.isGeometry = !0, this.createMesh = (f, p, m) => { if (!(this.morph && this.morph.geometry && f != null)) { var y = d(f, p, m); this.setMesh(y, m.localTimeEnabled, m.localMorphColour); } }, this.calculateUVs = () => { this.geometry.computeBoundingBox(); var f = this.geometry.boundingBox.max, p = this.geometry.boundingBox.min, m = new l.Vector2(0 - p.x, 0 - p.y), y = new l.Vector2(f.x - p.x, f.y - p.y); this.geometry.faceVertexUvs[0] = []; for (var g = 0; g < this.geometry.faces.length; g++) { var v = this.geometry.vertices[this.geometry.faces[g].a], x = this.geometry.vertices[this.geometry.faces[g].b], w = this.geometry.vertices[this.geometry.faces[g].c]; geometry.faceVertexUvs[0].push([new l.Vector2((v.x + m.x) / y.x, (v.y + m.y) / y.y), new l.Vector2((x.x + m.x) / y.x, (x.y + m.y) / y.y), new l.Vector2((w.x + m.x) / y.x, (w.y + m.y) / y.y)]); } geometry.uvsNeedUpdate = !0; }, this.checkTransparentMesh = function() { this._lod.checkTransparentMesh(); }, this.setWireframe = (f) => { this.morph.material.wireframe = f; }, this.editVertices = function(f, p) { if (f && f.length) { var m = this.getMorph(), y = m.geometry.getAttribute("position"); if (!m || 0 > p) return; var g = 3 * p; f.forEach((v) => { y.array[g++] = v[0], y.array[g++] = v[1], y.array[g++] = v[2]; }), y.needsUpdate = !0, m.geometry.computeBoundingBox(), m.geometry.computeBoundingSphere(), this.boundingBoxUpdateRequired = !0; } }; }; h.prototype = Object.create(c(10).ZincObject.prototype), s.Geometry = h; }, /* 4 */ /***/ (o) => { o.exports = npe; }, /* 5 */ /***/ (o, s, c) => { function l(b) { throw new TypeError('"' + b + '" is read-only'); } var u = c(4), d = c(6).Geometry, h = c(7).default; function f(b) { var T = b, E = c(0).modelPrefix; return E && (E[E.length - 1] != "/" && l("prefix"), /^(?:[a-z]+:)?\/\//i.test(b) || (T = E + b)), T; } function p(b, T) { var E = (L, A) => { try { var k = new URL(L, A).href; if (L && 2 > L.split("?").length) { var P = A.split("?"); P.length === 2 && (k = k + "?" + P[1]); } return k; } catch { console.error("There is an issue creting the url link with: ".concat(L, ".")); } }; if (!Array.isArray(b)) return E(b, T); var C = []; return b.forEach((L) => { C.push(E(L, T)); }), C; } function m(b, T, E, C, L) { var A = b.morphTargetInfluences, k = void 0; b.geometry && (k = b.geometry.morphAttributes); var P = !1; if (A && k && k.position) { C.set(0, 0, 0), L.set(0, 0, 0); for (var R = 0; R < A.length; R++) 0 < A[R] && (P = !0, E.setFromArray(k.position[R].array), C.add(E.min.multiplyScalar(A[R])), L.add(E.max.multiplyScalar(A[R]))); P && T.set(C, L); } P || T.setFromBufferAttribute(b.geometry.attributes.position), b.updateWorldMatrix(!0, !0), T.applyMatrix4(b.matrixWorld); } function y(b, T, E, C) { var L = new XMLHttpRequest(); L.open("GET", f(b), !0), L.onreadystatechange = () => { L.readyState == 4 && (L.status == 200 ? E(L.responseText, T) : C(b)); }, L.send(null); } function g(b, T, E) { function C(R, M) { k[M] = R, A++, A == L && T(k); } for (var L = b.length, A = 0, k = [], P = 0; P < L; P++) y(b[P], P, C, E); } s.getColorsRGB = (b, T) => { var E = Math.floor(T / 3), C = T % 3, L = 0; C == 0 ? L = b[E].r : C == 1 ? L = b[E].g : C == 2 && (L = b[E].b); var A = new u.Color(L); return [A.r, A.g, A.b]; }, s.updateMorphColorAttribute = function(b, T) { if (T && b && b.morphAttributes && b.morphAttributes.color) { var E = b.morphAttributes.color, C = T.morphTargetInfluences, L = C.length; b.deleteAttribute("morphColor0"), b.deleteAttribute("morphColor1"); for (var A = 0, k = [], P = 0; 1 > A || P < L; P++) 0 < C[P] && (A++, k.push([P, C[P]])); k.length == 2 ? (b.setAttribute("morphColor0", E[k[0][0]]), b.setAttribute("morphColor1", E[k[1][0]])) : k.length == 1 && (b.setAttribute("morphColor0", E[k[0][0]]), b.setAttribute("morphColor1", E[k[0][0]])); } }, s.toBufferGeometry = (b, T) => { var E; return b instanceof d ? (T.localTimeEnabled && !b.morphNormalsReady && (b.morphNormals == null || b.morphNormals.length == 0) && b.computeMorphNormals(), E = b.toIndexedBufferGeometry(), T.localMorphColour && v(b, E)) : b instanceof u.BufferGeometry && (E = b.clone()), E.colorsNeedUpdate = !0, E.computeBoundingBox(), E.computeBoundingSphere(), b._video && (E._video = b._video), E; }, s.copyMorphColorsToBufferGeometry = (b, T) => { if (b && b.morphColors && 0 < b.morphColors.length) { for (var E = [], C = b.morphColors, L = c(5).getColorsRGB, A = 0, k = C.length; A < k; A++) { for (var P = C[A], R = [], M = 0; M < b.faces.length; M++) { var O = b.faces[M], D = L(P.colors, O.a); R.push(D[0], D[1], D[2]), D = L(P.colors, O.b), R.push(D[0], D[1], D[2]), D = L(P.colors, O.c), R.push(D[0], D[1], D[2]); } var I = new u.Float32BufferAttribute(3 * (3 * b.faces.length), 3); I.name = P.name, E.push(I.copyArray(R)); } T.morphAttributes.color = E; } }; var v = (b, T) => { if (b && b.morphColors && 0 < b.morphColors.length) { for (var E = [], C = b.morphColors, L = c(5).getColorsRGB, A = 0, k = C.length; A < k; A++) { for (var P, R = C[A], M = [], O = 0; O < 3 * R.colors.length; O++) P = L(R.colors, O), M.push(P[0], P[1], P[2]); var D = new u.Float32BufferAttribute(M, 3); D.name = R.name, E.push(D); } T.morphAttributes.color = E; } }; s.mergeVertices = function(b) { var T = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : 1e-4; T = Math.max(T, Number.EPSILON); for (var E, C = {}, L = b.getIndex(), A = b.getAttribute("position"), k = L ? L.count : A.count, P = 0, R = Object.keys(b.attributes), M = {}, O = {}, _e = [], D = ["getX", "getY", "getZ", "getW"], I = 0, F = R.length; I < F; I++) { E = R[I], M[E] = []; var z = b.morphAttributes[E]; z && (O[E] = Array(z.length).fill().map(() => [])); } for (var U = Math.log10(1 / T), Z = Math.pow(10, U), I = 0; I < k; I++) { for (var re = L ? L.getX(I) : I, K = "", V = 0, F = R.length; V < F; V++) for (var E = R[V], H = b.getAttribute(E), G = H.itemSize, W = 0; W < G; W++) K += "".concat(~~(H[D[W]](re) * Z), ","); if (K in C) _e.push(C[K]); else { for (var V = 0, F = R.length; V < F; V++) for (var Y, E = R[V], H = b.getAttribute(E), z = b.morphAttributes[E], G = H.itemSize, X = M[E], ie = O[E], W = 0; W < G; W++) if (Y = D[W], X.push(H[Y](re)), z) for (var ue = 0, $ = z.length; ue < $; ue++) ie[ue].push(z[ue][Y](re)); C[K] = P, _e.push(P), P++; } } for (var J = b.clone(), I = 0, F = R.length; I < F; I++) { var H, E = R[I], ne = b.getAttribute(E), j = new ne.array.constructor(M[E]); if (ne.isInterleavedBufferAttribute ? H = new u.BufferAttribute(j, ne.itemSize, ne.itemSize) : (H = b.getAttribute(E).clone(), H.setArray(j)), J.setAttribute(E, H), E in O) for (var q, V = 0; V < O[E].length; V++) q = b.morphAttributes[E][V].clone(), q.setArray(new q.array.constructor(O[E][V])), J.morphAttributes[E][V] = q; } var ge = Uint8Array; _e.length >= Math.pow(2, 8) && (ge = Uint16Array), _e.length >= Math.pow(2, 16) && (ge = Uint32Array); var ye = new ge(_e), _e = null; return L === null ? _e = new u.BufferAttribute(ye, 1) : (_e = b.getIndex().clone(), _e.setArray(ye)), J.setIndex(_e), J; }; function x(b) { if (b.isMeshPhongMaterial) { var T = new u.MeshToonMaterial({ color: b.color.clone(), morphTargets: b.morphTargets, morphNormals: b.morphNormals, vertexColors: b.vertexColors, transparent: b.transparent, opacity: b.opacity, side: b.side }); return b.map && (T.map = b.map), T; } return b; } function w(b, T) { if (T && b >= T.length) { var E = new u.BufferGeometry(), C = new Float32Array(3 * b), L = 0; return T.forEach((A) => { C[L++] = A[0], C[L++] = A[1], C[L++] = A[2]; }), E.setAttribute("position", new u.BufferAttribute(C, 3)), E.setDrawRange(0, T.length), E; } } function S() { var b = new Image(); b.src = c(8); var T = new u.Texture(); return T.image = b, T.needsUpdate = !0, T; } function _(b, T, E, C, L, A) { var k = new h(b, T, E, C, L, A); return k.fontFace = C, k.fontSize = L, k.fontWeight = A, k.material.map.generateMipmaps = !1, k.material.map.anisotropy = 4, k.material.sizeAttenuation = !1, k.material.alphaTest = 0.5, k.material.transparent = !0, k.material.depthWrite = !1, k.material.depthTest = !1, k.center.set(0.5, -1.2), k.renderOrder = 1e4, k; } s.getBoundingBox = m, s.createNewURL = p, s.createBufferGeometry = w, s.getCircularTexture = S, s.resolveURL = f, s.loadExternalFile = y, s.loadExternalFiles = g, s.PhongToToon = x, s.createNewSpriteText = _; }, /* 6 */ /***/ (o, s, c) => { c.r(s), c.d(s, { /* harmony export */ Face3: () => ( /* binding */ y ), /* harmony export */ Geometry: () => ( /* binding */ p ) /* harmony export */ }); var l = c(4), u = new l.Matrix4(), d = new l.Object3D(), h = new l.Vector3(), f = new l.Vector3(); function p() { this.uuid = l.MathUtils.generateUUID(), this.name = "", this.type = "Geometry", this.vertices = [], this.colors = [], this.faces = [], this.faceVertexUvs = [[]], this.normals = [], this.uvs = [], this.morphTargets = [], this.morphNormals = [], this.skinWeights = [], this.skinIndices = [], this.lineDistances = [], this.boundingBox = null, this.boundingSphere = null, this.elementsNeedUpdate = !1, this.verticesNeedUpdate = !1, this.uvsNeedUpdate = !1, this.normalsNeedUpdate = !1, this.colorsNeedUpdate = !1, this.lineDistancesNeedUpdate = !1, this.groupsNeedUpdate = !1, this.morphNormalsReady = !1; } p.prototype = Object.assign(Object.create(l.EventDispatcher.prototype), { constructor: p, isGeometry: !0, applyMatrix4: function(g) { for (var v, x = new l.Matrix3().getNormalMatrix(g), w = 0, S = this.vertices.length; w < S; w++) v = this.vertices[w], v.applyMatrix4(g); for (var _, b = 0, T = this.faces.length; b < T; b++) { _ = this.faces[b], _.normal.applyMatrix3(x).normalize(); for (var E = 0, C = _.vertexNormals.length; E < C; E++) _.vertexNormals[E].applyMatrix3(x).normalize(); } return this.boundingBox !== null && this.computeBoundingBox(), this.boundingSphere !== null && this.computeBoundingSphere(), this.verticesNeedUpdate = !0, this.normalsNeedUpdate = !0, this; }, rotateX: function(g) { return u.makeRotationX(g), this.applyMatrix4(u), this; }, rotateY: function(g) { return u.makeRotationY(g), this.applyMatrix4(u), this; }, rotateZ: function(g) { return u.makeRotationZ(g), this.applyMatrix4(u), this; }, translate: function(g, v, x) { return u.makeTranslation(g, v, x), this.applyMatrix4(u), this; }, scale: function(g, v, x) { return u.makeScale(g, v, x), this.applyMatrix4(u), this; }, lookAt: function(g) { return d.lookAt(g), d.updateMatrix(), this.applyMatrix4(d.matrix), this; }, fromBufferGeometry: function(g) { function v(z, U, Z, re) { var K = T === void 0 ? [] : [x.colors[z].clone(), x.colors[U].clone(), x.colors[Z].clone()], V = b === void 0 ? [] : [new l.Vector3().fromBufferAttribute(b, z), new l.Vector3().fromBufferAttribute(b, U), new l.Vector3().fromBufferAttribute(b, Z)], H = new y(z, U, Z, V, K, re); x.faces.push(H), E !== void 0 && x.faceVertexUvs[0].push([new l.Vector2().fromBufferAttribute(E, z), new l.Vector2().fromBufferAttribute(E, U), new l.Vector2().fromBufferAttribute(E, Z)]), C !== void 0 && x.faceVertexUvs[1].push([new l.Vector2().fromBufferAttribute(C, z), new l.Vector2().fromBufferAttribute(C, U), new l.Vector2().fromBufferAttribute(C, Z)]); } var x = this, w = g.index === null ? void 0 : g.index, S = g.attributes; if (S.position === void 0) return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."), this; var _ = S.position, b = S.normal, T = S.color, E = S.uv, C = S.uv2; C !== void 0 && (this.faceVertexUvs[1] = []); for (var L = 0; L < _.count; L++) x.vertices.push(new l.Vector3().fromBufferAttribute(_, L)), T !== void 0 && x.colors.push(new l.Color().fromBufferAttribute(T, L)); var A = g.groups; if (0 < A.length) for (var k = 0; k < A.length; k++) for (var P = A[k], R = P.start, M = P.count, O = R, D = R + M; O < D; O += 3) w === void 0 ? v(O, O + 1, O + 2, P.materialIndex) : v(w.getX(O), w.getX(O + 1), w.getX(O + 2), P.materialIndex); else if (w !== void 0) for (var I = 0; I < w.count; I += 3) v(w.getX(I), w.getX(I + 1), w.getX(I + 2)); else for (var F = 0; F < _.count; F += 3) v(F, F + 1, F + 2); return this.computeFaceNormals(), g.boundingBox !== null && (this.boundingBox = g.boundingBox.clone()), g.boundingSphere !== null && (this.boundingSphere = g.boundingSphere.clone()), this; }, center: function() { return this.computeBoundingBox(), this.boundingBox.getCenter(h).negate(), this.translate(h.x, h.y, h.z), this; }, normalize: function() { this.computeBoundingSphere(); var g = this.boundingSphere.center, v = this.boundingSphere.radius, x = v === 0 ? 1 : 1 / v, w = new l.Matrix4(); return w.set(x, 0, 0, -x * g.x, 0, x, 0, -x * g.y, 0, 0, x, -x * g.z, 0, 0, 0, 1), this.applyMatrix4(w), this; }, computeFaceNormals: function() { for (var g = new l.Vector3(), v = new l.Vector3(), x = 0, w = this.faces.length; x < w; x++) { var S = this.faces[x], _ = this.vertices[S.a], b = this.vertices[S.b], T = this.vertices[S.c]; g.subVectors(T, b), v.subVectors(_, b), g.cross(v), g.normalize(), S.normal.copy(g); } }, computeVertexNormals: function() { for (var g = !(0 < arguments.length && arguments[0] !== void 0) || arguments[0], v = Array(this.vertices.length), x = 0, w = this.vertices.length; x < w; x++) v[x] = new l.Vector3(); if (g) for (var S = new l.Vector3(), _ = new l.Vector3(), b = 0, T = this.faces.length; b < T; b++) { var E = this.faces[b], C = this.vertices[E.a], L = this.vertices[E.b], A = this.vertices[E.c]; S.subVectors(A, L), _.subVectors(C, L), S.cross(_), v[E.a].add(S), v[E.b].add(S), v[E.c].add(S); } else { this.computeFaceNormals(); for (var k, P = 0, R = this.faces.length; P < R; P++) k = this.faces[P], v[k.a].add(k.normal), v[k.b].add(k.normal), v[k.c].add(k.normal); } for (var M = 0, O = this.vertices.length; M < O; M++) v[M].normalize(); for (var D = 0, I = this.faces.length; D < I; D++) { var F = this.faces[D], z = F.vertexNormals; z.length === 3 ? (z[0].copy(v[F.a]), z[1].copy(v[F.b]), z[2].copy(v[F.c])) : (z[0] = v[F.a].clone(), z[1] = v[F.b].clone(), z[2] = v[F.c].clone()); } return 0 < this.faces.length && (this.normalsNeedUpdate = !0), v; }, computeFlatVertexNormals: function() { this.computeFaceNormals(); for (var g = 0, v = this.faces.length; g < v; g++) { var x = this.faces[g], w = x.vertexNormals; w.length === 3 ? (w[0].copy(x.normal), w[1].copy(x.normal), w[2].copy(x.normal)) : (w[0] = x.normal.clone(), w[1] = x.normal.clone(), w[2] = x.normal.clone()); } 0 < this.faces.length && (this.normalsNeedUpdate = !0); }, computeMorphNormals: function() { for (var g, v = 0, x = this.faces.length; v < x; v++) { g = this.faces[v], g.__originalFaceNormal ? g.__originalFaceNormal.copy(g.normal) : g.__originalFaceNormal = g.normal.clone(), g.__originalVertexNormals || (g.__originalVertexNormals = []); for (var w = 0, S = g.vertexNormals.length; w < S; w++) g.__originalVertexNormals[w] ? g.__originalVertexNormals[w].copy(g.vertexNormals[w]) : g.__originalVertexNormals[w] = g.vertexNormals[w].clone(); } var _ = new p(); _.faces = this.faces; for (var b = 0, T = this.morphTargets.length; b < T; b++) { if (!this.morphNormals[b]) { this.morphNormals[b] = {}, this.morphNormals[b].faceNormals = [], this.morphNormals[b].vertexNormals = []; for (var E = this.morphNormals[b].faceNormals, C = this.morphNormals[b].vertexNormals, L = 0, A = this.faces.length; L < A; L++) { var k = new l.Vector3(), P = { a: new l.Vector3(), b: new l.Vector3(), c: new l.Vector3() }; E.push(k), C.push(P); } } var R = this.morphNormals[b]; _.vertices = this.morphTargets[b].vertices, _.computeFaceNormals(); var M = _.computeVertexNormals(); if (M && 0 < M.length) { this.morphTargets[b].normals = Array(this.vertices.length); for (var O = 0; O < M.length; O++) this.morphTargets[b].normals[O] = M[O].clone(); } for (var D = 0, I = this.faces.length; D < I; D++) { var F = this.faces[D], z = R.faceNormals[D], U = R.vertexNormals[D]; z.copy(F.normal), U.a.copy(F.vertexNormals[0]), U.b.copy(F.vertexNormals[1]), U.c.copy(F.vertexNormals[2]); } } for (var Z, re = 0, K = this.faces.length; re < K; re++) Z = this.faces[re], Z.normal = Z.__originalFaceNormal, Z.vertexNormals = Z.__originalVertexNormals; this.morphNormalsReady = !0; }, computeBoundingBox: function() { this.boundingBox === null && (this.boundingBox = new l.Box3()), this.boundingBox.setFromPoints(this.vertices); }, computeBoundingSphere: function() { this.boundingSphere === null && (this.boundingSphere = new l.Sphere()), this.boundingSphere.setFromPoints(this.vertices); }, mergeMorph: function(g, v) { var x = this.morphTargets.length, w = this.morphTargets, S = g.morphTargets, _ = this.morphColors.length, b = this.morphColors, T = g.morphColors; if (0 < x && x == S.length) for (var E = 0, C = w.length; E < C; E++) { for (var L = w[E], A = S[E], k = 0, P = A.vertices.length; k < P; k++) { var R = A.vertices[k], M = R.clone(); v !== void 0 && M.applyMatrix4(v), L.vertices.push(M); } if (L.normals && A.normals) for (var O = 0; O < A.normals.length; O += 3) f.set(A.normals2[O], A.normals2[O + 1], A.normals2[O + 2]), v !== void 0 && f.applyMatrix4(v), L.normals.push(f.x, f.y, f.z); } if (0 < _ && _ == T.length) for (var D = 0, I = b.length; D < I; D++) for (var F = b[D], z = T[D], U = 0, Z = z.colors; U < Z; U++) F.colors.push(z.colors[U].clone()); }, merge: function(g, v) { var x = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : 0; if (!(g && g.isGeometry)) return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", g); var w, S = this.vertices.length, _ = this.vertices, b = g.vertices, T = g.normals, E = this.faces, C = g.faces, L = this.colors, A = g.colors; v !== void 0 && (w = new l.Matrix3().getNormalMatrix(v)); for (var k = 0, P = b.length; k < P; k++) { var R = b[k], M = R.clone(); v !== void 0 && M.applyMatrix4(v), _.push(M); } for (var O = 0; O < T.length; O += 3) f.set(T[O], T[O + 1], T[O + 2]), v !== void 0 && f.applyMatrix4(v), this.normals.push(f.x, f.y, f.z); for (var D = 0, I = A.length; D < I; D++) typeof A[D] == "number" ? L.push(A[D]) : L.push(A[D].clone()); for (var F = 0, z = C.length; F < z; F++) { var U = C[F], Z = void 0, re = void 0, K = U.vertexNormals, V = U.vertexColors, H = new y(U.a + S, U.b + S, U.c + S); H.normal.copy(U.normal), w !== void 0 && H.normal.applyMatrix3(w).normalize(); for (var G = 0, W = K.length; G < W; G++) Z = K[G].clone(), w !== void 0 && Z.applyMatrix3(w).normalize(), H.vertexNormals.push(Z); H.color.copy(U.color); for (var Y = 0, X = V.length; Y < X; Y++) re = V[Y], H.vertexColors.push(re.clone()); H.materialIndex = U.materialIndex + x, E.push(H); } for (var ie, ue = 0, $ = g.faceVertexUvs.length; ue < $; ue++) { ie = g.faceVertexUvs[ue], this.faceVertexUvs[ue] === void 0 && (this.faceVertexUvs[ue] = []); for (var J = 0, ne = ie.length; J < ne; J++) { for (var j = ie[J], q = [], ge = 0, ye = j.length; ge < ye; ge++) q.push(j[ge].clone()); this.faceVertexUvs[ue].push(q); } } this.mergeMorph(g, v); }, mergeMesh: function(g) { return g && g.isMesh ? (g.matrixAutoUpdate && g.updateMatrix(), void this.merge(g.geometry, g.matrix)) : void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", g); }, /* * Checks for duplicate vertices with hashmap. * Duplicated vertices are removed * and faces' vertices are updated. */ mergeVertices: function() { for (var g = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : 4, v = {}, x = [], w = [], S = Math.pow(10, g), _ = 0, b = this.vertices.length; _ < b; _++) { var T = this.vertices[_], E = Math.round(T.x * S) + "_" + Math.round(T.y * S) + "_" + Math.round(T.z * S); v[E] === void 0 ? (v[E] = _, x.push(this.vertices[_]), w[_] = x.length - 1) : w[_] = w[v[E]]; } for (var C, L = [], A = 0, k = this.faces.length; A < k; A++) { C = this.faces[A], C.a = w[C.a], C.b = w[C.b], C.c = w[C.c]; for (var P = [C.a, C.b, C.c], R = 0; 3 > R; R++) if (P[R] === P[(R + 1) % 3]) { L.push(A); break; } } for (var M, O = L.length - 1; 0 <= O; O--) { M = L[O], this.faces.splice(M, 1); for (var D = 0, I = this.faceVertexUvs.length; D < I; D++) this.faceVertexUvs[D].splice(M, 1); } var F = this.vertices.length - x.length; return this.vertices = x, F; }, setFromPoints: function(g) { this.vertices = []; for (var v, x = 0, w = g.length; x < w; x++) v = g[x], this.vertices.push(new l.Vector3(v.x, v.y, v.z || 0)); return this; }, sortFacesByMaterialIndex: function() { for (var g = this.faces, v = g.length, x = 0; x < v; x++) g[x]._id = x; g.sort(function(C, L) { return C.materialIndex - L.materialIndex; }); var w, S, _ = this.faceVertexUvs[0], b = this.faceVertexUvs[1]; _ && _.length === v && (w = []), b && b.length === v && (S = []); for (var T, E = 0; E < v; E++) T = g[E]._id, w && w.push(_[T]), S && S.push(b[T]); w && (this.faceVertexUvs[0] = w), S && (this.faceVertexUvs[1] = S); }, toJSON: function() { function g(X, ie, ue) { return ue ? X | 1 << ie : X & ~(1 << ie); } function v(X) { var ie = X.x.toString() + X.y.toString() + X.z.toString(); return k[ie] === void 0 && (k[ie] = A.length / 3, A.push(X.x, X.y, X.z)), k[ie]; } function x(X) { var ie = X.r.toString() + X.g.toString() + X.b.toString(); return R[ie] === void 0 && (R[ie] = P.length, P.push(X.getHex())), R[ie]; } function w(X) { var ie = X.x.toString() + X.y.toString(); return O[ie] === void 0 && (O[ie] = M.length / 2, M.push(X.x, X.y)), O[ie]; } var S = { metadata: { version: 4.5, type: "Geometry", generator: "Geometry.toJSON" } }; if (S.uuid = this.uuid, S.type = this.type, this.name !== "" && (S.name = this.name), this.parameters !== void 0) { var _ = this.parameters; for (var b in _) _[b] !== void 0 && (S[b] = _[b]); return S; } for (var T, E = [], C = 0; C < this.vertices.length; C++) T = this.vertices[C], E.push(T.x, T.y, T.z); for (var L = [], A = [], k = {}, P = [], R = {}, M = [], O = {}, D = 0; D < this.faces.length; D++) { var I = this.faces[D], F = !0, z = !1, U = this.faceVertexUvs[0][D] !== void 0, Z = 0 < I.normal.length(), re = 0 < I.vertexNormals.length, K = I.color.r !== 1 || I.color.g !== 1 || I.color.b !== 1, V = 0 < I.vertexColors.length, H = 0; if (H = g(H, 0, 0), H = g(H, 1, F), H = g(H, 2, z), H = g(H, 3, U), H = g(H, 4, Z), H = g(H, 5, re), H = g(H, 6, K), H = g(H, 7, V), L.push(H), L.push(I.a, I.b, I.c), L.push(I.materialIndex), U) { var G = this.faceVertexUvs[0][D]; L.push(w(G[0]), w(G[1]), w(G[2])); } if (Z && L.push(v(I.normal)), re) { var W = I.vertexNormals; L.push(v(W[0]), v(W[1]), v(W[2])); } if (K && L.push(x(I.color)), V) { var Y = I.vertexColors; L.push(x(Y[0]), x(Y[1]), x(Y[2])); } } return S.data = {}, S.data.vertices = E, S.data.normals = A, 0 < P.length && (S.data.colors = P), 0 < M.length && (S.data.uvs = [M]), S.data.faces = L, S; }, clone: function() { return new p().copy(this); }, copy: function(g) { this.vertices = [], this.colors = [], this.faces = [], this.faceVertexUvs = [[]], this.morphTargets = [], this.morphNormals = [], this.skinWeights = [], this.skinIndices = [], this.lineDistances = [], this.boundingBox = null, this.boundingSphere = null, this.name = g.name; for (var v = g.vertices, x = 0, w = v.length; x < w; x++) this.vertices.push(v[x].clone()); for (var S = g.colors, _ = 0, b = S.length; _ < b; _++) this.colors.push(S[_].clone()); for (var T = g.faces, E = 0, C = T.length; E < C; E++) this.faces.push(T[E].clone()); for (var L, A = 0, k = g.faceVertexUvs.length; A < k; A++) { L = g.faceVertexUvs[A], this.faceVertexUvs[A] === void 0 && (this.faceVertexUvs[A] = []); for (var P = 0, R = L.length; P < R; P++) { for (var M, O = L[P], D = [], I = 0, F = O.length; I < F; I++) M = O[I], D.push(M.clone()); this.faceVertexUvs[A].push(D); } } for (var z, U = g.morphTargets, Z = 0, re = U.length; Z < re; Z++) { if (z = {}, z.name = U[Z].name, U[Z].vertices !== void 0) { z.vertices = []; for (var K = 0, V = U[Z].vertices.length; K < V; K++) z.vertices.push(U[Z].vertices[K].clone()); } if (U[Z].normals !== void 0) { z.normals = []; for (var H = 0, G = U[Z].normals.length; H < G; H++) z.normals.push(U[Z].normals[H].clone()); } this.morphTargets.push(z); } for (var W, Y = g.morphNormals, X = 0, ie = Y.length; X < ie; X++) { if (W = {}, Y[X].vertexNormals !== void 0) { W.vertexNormals = []; for (var ue = 0, $ = Y[X].vertexNormals.length; ue < $; ue++) { var J = Y[X].vertexNormals[ue], ne = {}; ne.a = J.a.clone(), ne.b = J.b.clone(), ne.c = J.c.clone(), W.vertexNormals.push(ne); } } if (Y[X].faceNormals !== void 0) { W.faceNormals = []; for (var j = 0, q = Y[X].faceNormals.length; j < q; j++) W.faceNormals.push(Y[X].faceNormals[j].clone()); } this.morphNormals.push(W); } for (var ge = g.skinWeights, ye = 0, _e = ge.length; ye < _e; ye++) this.skinWeights.push(ge[ye].clone()); for (var Me = g.skinIndices, Ce = 0, B = Me.length; Ce < B; Ce++) this.skinIndices.push(Me[Ce].clone()); for (var ce = g.lineDistances, ve = 0, te = ce.length; ve < te; ve++) this.lineDistances.push(ce[ve]); var pe = g.boundingBox; pe !== null && (this.boundingBox = pe.clone()); var fe = g.boundingSphere; return fe !== null && (this.boundingSphere = fe.clone()), this.elementsNeedUpdate = g.elementsNeedUpdate, this.verticesNeedUpdate = g.verticesNeedUpdate, this.uvsNeedUpdate = g.uvsNeedUpdate, this.normalsNeedUpdate = g.normalsNeedUpdate, this.colorsNeedUpdate = g.colorsNeedUpdate, this.lineDistancesNeedUpdate = g.lineDistancesNeedUpdate, this.groupsNeedUpdate = g.groupsNeedUpdate, this; }, computeGroups() { var g, v, x = [], w = void 0, S = this.faces; for (v = 0; v < S.length; v++) { var _ = S[v]; _.materialIndex !== w && (w = _.materialIndex, g !== void 0 && (g.count = 3 * v - g.start, x.push(g)), g = { start: 3 * v, materialIndex: w }); } return g !== void 0 && (g.count = 3 * v - g.start, x.push(g)), x; }, toBufferGeometry: function() { var g = new m().fromGeometry(this), v = new l.BufferGeometry(), x = new Float32Array(3 * g.vertices.length); if (v.setAttribute("position", new l.BufferAttribute(x, 3).copyVector3sArray(g.vertices)), 0 < g.normals.length) { var w = new Float32Array(3 * g.normals.length); v.setAttribute("normal", new l.BufferAttribute(w, 3).copyVector3sArray(g.normals)); } if (0 < g.colors.length) { var S = new Float32Array(3 * g.colors.length); v.setAttribute("color", new l.BufferAttribute(S, 3).copyColorsArray(g.colors)); } if (0 < g.uvs.length) { var _ = new Float32Array(2 * g.uvs.length); v.setAttribute("uv", new l.BufferAttribute(_, 2).copyVector2sArray(g.uvs)); } if (0 < g.uvs2.length) { var b = new Float32Array(2 * g.uvs2.length); v.setAttribute("uv2", new l.BufferAttribute(b, 2).copyVector2sArray(g.uvs2)); } for (var T in v.groups = g.groups, g.morphTargets) { for (var E = [], C = g.morphTargets[T], L = 0, A = C.length; L < A; L++) { var k = C[L], P = new l.Float32BufferAttribute(3 * k.data.length, 3); P.name = k.name, E.push(P.copyVector3sArray(k.data)); } v.morphAttributes[T] = E; } if (0 < g.skinIndices.length) { var R = new l.Float32BufferAttribute(4 * g.skinIndices.length, 4); v.setAttribute("skinIndex", R.copyVector4sArray(g.skinIndices)); } if (0 < g.skinWeights.length) { var M = new l.Float32BufferAttribute(4 * g.skinWeights.length, 4); v.setAttribute("skinWeight", M.copyVector4sArray(g.skinWeights)); } return g.boundingSphere !== null && (v.boundingSphere = g.boundingSphere.clone()), g.boundingBox !== null && (v.boundingBox = g.boundingBox.clone()), v; }, toIndexedBufferGeometry: function() { var g = new l.BufferGeometry(), v = new Float32Array(3 * this.vertices.length); if (g.setAttribute("position", new l.BufferAttribute(v, 3).copyVector3sArray(this.vertices)), 0 < this.normals.length) { var x = new Float32Array(this.normals.length), w = new l.BufferAttribute(x, 3).copyArray(this.normals); g.setAttribute("normal", w); } if (0 < this.uvs.length && 0 < this.uvs[0].length) { var S = new Float32Array(2 * this.uvs[0].length); g.setAttribute("uv", new l.BufferAttribute(S, 2).copyArray(this.uvs[0])); } if (1 < this.uvs.length && 0 < this.uvs[1].length) { var _ = new Float32Array(2 * this.uvs[1].length); g.setAttribute("uv2", new l.BufferAttribute(_, 2).copyArray(this.uvs[1])); } if (0 < this.colors.length) { for (var b = [], T = 0; T < this.colors.length; T++) b.push(new l.Color(this.colors[T])); var E = new Float32Array(3 * b.length); g.setAttribute("color", new l.BufferAttribute(E, 3).copyColorsArray(b)); } else { for (var C = new Float32Array(3 * this.vertices.length), L = 0; L < 3 * this.vertices.length; L++) C[L] = 1; g.setAttribute("color", new l.BufferAttribute(C, 3)); } if (0 < this.faces.length) { for (var A = [], k = [], P = 0; P < this.faces.length; P++) { k.push(this.faces[P].a, this.faces[P].b, this.faces[P].c); var R = this.faces[P].vertexColors; if (R.length === 3) A.push(R[0], R[1], R[2]); else { var M = this.faces[P].color; A.push(M, M, M); } } g.setIndex(k), g.groups = this.computeGroups(); } if (0 < this.morphTargets.length) { for (var O = [], D = [], I = 0, F = this.morphTargets.length; I < F; I++) { var z = this.morphTargets[I], U = new l.Float32BufferAttribute(3 * z.vertices.length, 3); if (U.name = z.name, O.push(U.copyVector3sArray(z.vertices)), z.normals) { var Z = new l.Float32BufferAttribute(3 * z.normals.length, 3); Z.name = z.name, D.push(Z.copyVector3sArray(z.normals)); } } g.morphAttributes.position = O, g.morphAttributes.normal = D; } if (0 < this.skinIndices.length) { var re = new l.Float32BufferAttribute(4 * this.skinIndices.length, 4); g.setAttribute("skinIndex", re.copyVector4sArray(this.skinIndices)); } if (0 < this.skinWeights.length) { var K = new l.Float32BufferAttribute(4 * this.skinWeights.length, 4); g.setAttribute("skinWeight", K.copyVector4sArray(this.skinWeights)); } return this.boundingSphere !== null && (g.boundingSphere = this.boundingSphere.clone()), this.boundingBox !== null && (g.boundingBox = this.boundingBox.clone()), g; }, computeTangents: function() { console.error("THREE.Geometry: .computeTangents() has been removed."); }, computeLineDistances: function() { console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead."); }, applyMatrix: function(g) { return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."), this.applyMatrix4(g); }, dispose: function() { this.dispatchEvent({ type: "dispose" }); } }), p.createBufferGeometryFromObject = function(g) { var v = new l.BufferGeometry(), x = g.geometry; if (g.isPoints || g.isLine) { var w = new l.Float32BufferAttribute(3 * x.vertices.length, 3), S = new l.Float32BufferAttribute(3 * x.colors.length, 3); if (v.setAttribute("position", w.copyVector3sArray(x.vertices)), v.setAttribute("color", S.copyColorsArray(x.colors)), x.lineDistances && x.lineDistances.length === x.vertices.length) { var _ = new l.Float32BufferAttribute(x.lineDistances.length, 1); v.setAttribute("lineDistance", _.copyArray(x.lineDistances)); } x.boundingSphere !== null && (v.boundingSphere = x.boundingSphere.clone()), x.boundingBox !== null && (v.boundingBox = x.boundingBox.clone()); } else g.isMesh && (v = x.toBufferGeometry()); return v; }; class m { constructor() { this.vertices = [], this.normals = [], this.colors = [], this.uvs = [], this.uvs2 = [], this.groups = [], this.morphTargets = {}, this.skinWeights = [], this.skinIndices = [], this.boundingBox = null, this.boundingSphere = null, this.verticesNeedUpdate = !1, this.normalsNeedUpdate = !1, this.colorsNeedUpdate = !1, this.uvsNeedUpdate = !1, this.groupsNeedUpdate = !1; } computeGroups(v) { var x, w, S = [], _ = void 0, b = v.faces; for (w = 0; w < b.length; w++) { var T = b[w]; T.materialIndex !== _ && (_ = T.materialIndex, x !== void 0 && (x.count = 3 * w - x.start, S.push(x)), x = { start: 3 * w, materialIndex: _ }); } x !== void 0 && (x.count = 3 * w - x.start, S.push(x)), this.groups = S; } fromGeometry(v) { var x, w = v.faces, S = v.vertices, _ = v.faceVertexUvs, b = _[0] && 0 < _[0].length, T = _[1] && 0 < _[1].length, E = v.morphTargets, C = E.length; if (0 < C) { x = []; for (var L = 0; L < C; L++) x[L] = { name: E[L].name, data: [] }; this.morphTargets.position = x; } var A, k = v.morphNormals, P = k.length; if (0 < P) { A = []; for (var R = 0; R < P; R++) A[R] = { name: k[R].name, data: [] }; this.morphTargets.normal = A; } var M = v.skinIndices, O = v.skinWeights, D = M.length === S.length, I = O.length === S.length; 0 < S.length && w.length === 0 && console.error("THREE.DirectGeometry: Faceless geometries are not supported."); for (var F, z = 0; z < w.length; z++) { F = w[z], this.vertices.push(S[F.a], S[F.b], S[F.c]); var U = F.vertexNormals; if (U.length === 3) this.normals.push(U[0], U[1], U[2]); else { var Z = F.normal; this.normals.push(Z, Z, Z); } var re = F.vertexColors; if (re.length === 3) this.colors.push(re[0], re[1], re[2]); else { var K = F.color; this.colors.push(K, K, K); } if (b === !0) { var V = _[0][z]; V === void 0 ? (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", z), this.uvs.push(new l.Vector2(), new l.Vector2(), new l.Vector2())) : this.uvs.push(V[0], V[1], V[2]); } if (T === !0) { var H = _[1][z]; H === void 0 ? (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", z), this.uvs2.push(new l.Vector2(), new l.Vector2(), new l.Vector2())) : this.uvs2.push(H[0], H[1], H[2]); } for (var G, W = 0; W < C; W++) G = E[W].vertices, x[W].data.push(G[F.a], G[F.b], G[F.c]); for (var Y, X = 0; X < P; X++) Y = k[X].vertexNormals[z], A[X].data.push(Y.a, Y.b, Y.c); D && this.skinIndices.push(M[F.a], M[F.b], M[F.c]), I && this.skinWeights.push(O[F.a], O[F.b], O[F.c]); } return this.computeGroups(v), this.verticesNeedUpdate = v.verticesNeedUpdate, this.normalsNeedUpdate = v.normalsNeedUpdate, this.colorsNeedUpdate = v.colorsNeedUpdate, this.uvsNeedUpdate = v.uvsNeedUpdate, this.groupsNeedUpdate = v.groupsNeedUpdate, v.boundingSphere !== null && (this.boundingSphere = v.boundingSphere.clone()), v.boundingBox !== null && (this.boundingBox = v.boundingBox.clone()), this; } } class y { constructor(v, x, w, S, _) { var b = 5 < arguments.length && arguments[5] !== void 0 ? arguments[5] : 0; this.a = v, this.b = x, this.c = w, this.normal = S && S.isVector3 ? S : new l.Vector3(), this.vertexNormals = Array.isArray(S) ? S : [], this.color = _ && _.isColor ? _ : new l.Color(), this.vertexColors = Array.isArray(_) ? _ : [], this.materialIndex = b; } clone() { return new this.constructor().copy(this); } copy(v) { this.a = v.a, this.b = v.b, this.c = v.c, this.normal.copy(v.normal), this.color.copy(v.color), this.materialIndex = v.materialIndex; for (var x = 0, w = v.vertexNormals.length; x < w; x++) this.vertexNormals[x] = v.vertexNormals[x].clone(); for (var S = 0, _ = v.vertexColors.length; S < _; S++) this.vertexColors[S] = v.vertexColors[S].clone(); return this; } } }, /* 7 */ /***/ (o) => { o.exports = wpe; }, /* 8 */ /***/ (o) => { o.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg=="; }, /* 9 */ /***/ (o, s) => { s.augmentMorphColor = function() { return function(c) { c.vertexShader = c.vertexShader.replace("#include ", ["varying vec3 vColor;", "attribute vec3 morphColor0;", "attribute vec3 morphColor1;"].join(` `)), c.vertexShader = c.vertexShader.replace("#include ", ["vColor.xyz = color.xyz;", "#ifdef USE_MORPHTARGETS", "vColor = morphColor0 * morphTargetInfluences[ 0 ];", "vColor += morphColor1 * morphTargetInfluences[ 1 ];", "#endif"].join(` `)); }; }; }, /* 10 */ /***/ (o, s, c) => { var l = c(4), u = c(5).createBufferGeometry, d = c(5).resolveURL, h = 0, f = function() { return "pr" + h++; }, p = function() { this.isZincObject = !0, this.geometry = void 0, this.morph = void 0, this.group = new l.Group(), this._lod = new (c(11)).LOD(this), this.groupName = void 0, this.timeEnabled = !1, this.morphColour = !1, this.inbuildTime = 0, this.mixer = void 0, this.animationGroup = void 0, this.duration = 6e3, this.clipAction = void 0, this.userData = {}, this.videoHandler = void 0, this.marker = void 0, this.markerNumber = void 0, this.markerUpdateRequired = !0, this.closestVertexIndex = -1, this.boundingBoxUpdateRequired = !0, this.cachedBoundingBox = new l.Box3(), this.anatomicalId = void 0, this.region = void 0, this.animationClip = void 0, this.markerMode = "inherited", this.uuid = f(), this._v1 = new l.Vector3(), this._v2 = new l.Vector3(), this._b1 = new l.Box3(), this.center = new l.Vector3(), this.radius = 0, this.visible = !0, this.drawRange = -1; }; p.prototype.setDuration = function(m) { this.duration = m, this.clipAction && this.clipAction.setDuration(this.duration); }, p.prototype.getDuration = function() { return this.duration; }, p.prototype.setRegion = function(m) { this.region = m; }, p.prototype.getRegion = function() { return this.region; }, p.prototype.getMorph = function() { var m = this._lod.getCurrentMorph(); return m || this.morph; }, p.prototype.getGroup = function() { return this.group; }, p.prototype.setMorph = function(m) { this.morph = m, this.group.add(this.morph); var y = this._lod.calculateDistance("far"); this._lod.addLevel(m, y), this._lod.setMaterial(m.material); }, p.prototype.checkTransparentMesh = function() { }, p.prototype.setMesh = function(m, y, g) { this.animationGroup = new l.AnimationObjectGroup(m), this.mixer = new l.AnimationMixer(this.animationGroup); var v = m.geometry; if (this.geometry = m.geometry, this.clipAction = void 0, v && v.morphAttributes) { var x = v.morphAttributes.position; x || (x = v.morphAttributes.color ? v.morphAttributes.color : v.morphAttributes.normal), x && (this.animationClip = l.AnimationClip.CreateClipsFromMorphTargetSequences(x, 10, !0), this.animationClip && this.animationClip[0] != null && (this.clipAction = this.mixer.clipAction(this.animationClip[0]).setDuration(this.duration), this.clipAction.loop = l.loopOnce, this.clipAction.clampWhenFinished = !0, this.clipAction.play())); } this.timeEnabled = y, this.morphColour = g, m.userData = this, m.matrixAutoUpdate = !1, this.setMorph(m), this.checkTransparentMesh(), this.timeEnabled ? this.setFrustumCulled(!1) : this.morphColour && (v.setAttribute("morphTarget0", v.getAttribute("position")), v.setAttribute("morphTarget1", v.getAttribute("position"))), this.boundingBoxUpdateRequired = !0; }, p.prototype.setName = function(m) { this.groupName = m, this._lod.setName(m); }, p.prototype.getCurrentTime = function() { if (this.clipAction) { var m = this.clipAction.time / this.clipAction._clip.duration; return this.duration * m; } return this.inbuildTime; }, p.prototype.setMorphTime = function(m) { var y = !1; if (this.clipAction) { var g = m / this.duration, v = this.clipAction._clip.duration, x = g * v; x != this.clipAction.time && (this.clipAction.time = x, y = !0), y && this.isTimeVarying() && this.mixer.update(0); } else { var w = m; w = m > this.duration ? this.duration : 0 > m ? 0 : m, w != this.inbuildTime && (this.inbuildTime = w, y = !0); } y && (this.boundingBoxUpdateRequired = !0, this._lod.updateMorphColorAttribute(!0), this.timeEnabled && (this.markerUpdateRequired = !0)); }, p.prototype.isTimeVarying = function() { return !!(this.timeEnabled || this.morphColour); }, p.prototype.getVisibility = function() { return this.visible; }, p.prototype.setVisibility = function(m) { m !== this.visible && (this.visible = m, this.group.visible = m, this.region && (this.region.pickableUpdateRequired = !0)); }, p.prototype.setAlpha = function(m) { var y = this._lod._material, g = !1; 1 > m && (g = !0), y.opacity = m, y.transparent = g, this.checkTransparentMesh(); }, p.prototype.setFrustumCulled = function(m) { this._lod.setFrustumCulled(m); }, p.prototype.setVertexColors = function(m) { this._lod.setVertexColors(m); }, p.prototype.getColour = function() { return this._lod._material ? this._lod._material.color : void 0; }, p.prototype.setColour = function(m) { this._lod.setColour(m); }, p.prototype.getColourHex = function() { return !this.morphColour && this._lod._material && this._lod._material.color ? this._lod._material.color.getHexString() : void 0; }, p.prototype.setColourHex = function(m) { this._lod._material.color.setHex(m), this._lod._secondaryMaterial && this._lod._secondaryMaterial.color.setHex(m); }, p.prototype.setEmissiveRGB = function(m) { this._lod._material && this._lod._material.emissive && this._lod._material.emissive.setRGB(...m), this._lod._secondaryMaterial && this._lod._secondaryMaterial.emissive.setRGB(...m); }, p.prototype.setMaterial = function(m) { this._lod.setMaterial(m); }, p.prototype.getClosestVertexIndex = function() { var m = -1, y = this.getMorph(); if (y && y.geoemtry) { var g = y.geometry.attributes.position; if (this._b1.setFromBufferAttribute(g), this._b1.getCenter(this._v1), g) for (var v = -1, x = 0, w = 0; w < g.count; w++) this._v2.fromArray(g.array, 3 * w), x = this._v2.distanceTo(this._v1), v == -1 ? v = x : v > x && (v = x, m = w); } return m; }, p.prototype.getClosestVertex = function(m) { var y = new l.Vector3(); this.closestVertexIndex == -1 && (this.closestVertexIndex = this.getClosestVertexIndex()); var g = this.getMorph(); if (g && g.geometry && 0 <= this.closestVertexIndex) { var v = g.morphTargetInfluences, x = g.geometry.morphAttributes; if (v && x && x.position) { for (var w = !1, S = 0; S < v.length; S++) 0 < v[S] && (w = !0, this._v1.fromArray(x.position[S].array, 3 * this.closestVertexIndex), y.add(this._v1.multiplyScalar(v[S]))); if (w) return m ? y.applyMatrix4(g.matrixWorld) : y; } else return y.fromArray(g.geometry.attributes.position.array, 3 * this.closestVertexIndex), m ? y.applyMatrix4(g.matrixWorld) : y; } return this.getBoundingBox(), y.copy(this.center), m ? y.applyMatrix4(this.morph.matrixWorld) : y; }, p.prototype.getBoundingBox = function() { if (this.visible) { var m = this._lod.getCurrentMorph(); if (m && m.visible) return this.boundingBoxUpdateRequired && (c(5).getBoundingBox(m, this.cachedBoundingBox, this._b1, this._v1, this._v2), this.cachedBoundingBox.getCenter(this.center), this.radius = this.center.distanceTo(this.cachedBoundingBox.max), this.boundingBoxUpdateRequired = !1), this.cachedBoundingBox; } }, p.prototype.dispose = function() { this._lod.dispose(), this.animationGroup = void 0, this.mixer = void 0, this.morph = void 0, this.group = void 0, this.clipAction = void 0, this.groupName = void 0; }, p.prototype.markerIsRequired = function(m) { return !!(this.visible && (this.markerMode === "on" || m && m.displayMarkers && this.markerMode === "inherited")); }, p.prototype.updateMarker = function(m, y) { if (m == !1 && this.markerIsRequired(y)) { var g = y.ndcToBeUpdated; if (this.groupName) { if (this.marker || (this.marker = new (c(14)).Marker(this), this.markerUpdateRequired = !0), this.markerUpdateRequired) { var v = this.getClosestVertex(!1); v && (this.marker.setPosition(v.x, v.y, v.z), this.markerUpdateRequired = !1); } this.marker.isEnabled() || (y.markersList && !(this.marker.uuid in y.markersList) && (g = !0, y.markersList[this.marker.uuid] = this.marker), this.marker.enable(), this.group.add(this.marker.morph)), this.marker.setNumber(this.markerNumber), this.markerImgURL ? this.marker.loadUserSprite(this.markerImgURL) : this.marker.setDefaultSprite(), y && y.camera && (g || y.markerCluster.markerUpdateRequired) && (this.marker.updateNDC(y.camera.cameraObject), y.markerCluster.markerUpdateRequired = !0); } } else this.marker && this.marker.isEnabled() && (this.marker.disable(), this.group.remove(this.marker.morph), y.markersList && this.marker.uuid in y.markersList && (y.markerCluster.markerUpdateRequired = !0, delete y.markersList[this.marker.uuid])), this.markerUpdateRequired = !0; }, p.prototype.processMarkerVisual = function(m, y) { this.marker && this.marker.isEnabled() && this.marker.updateVisual(m, y); }, p.prototype.initiateMorphColor = function() { this.morphColour == 1 && this._lod.updateMorphColorAttribute(!1); }, p.prototype.setRenderOrder = function(m) { this._lod.setRenderOrder(m); }, p.prototype.getClosestVertexDOMElementCoords = function(m) { if (m && m.camera) { var y = !0, g = this.getClosestVertex(!0); return g.project(m.camera), g.z = Math.min(Math.max(g.z, 0), 1), (1 < g.x || -1 > g.x || 1 < g.y || -1 > g.y) && (y = !1), m.getZincCameraControls().getRelativeCoordsFromNDC(g.x, g.y, g), { position: g, inView: y }; } }, p.prototype.setMarkerMode = function(m, y) { m !== this.markerMode && (this.markerMode = m === "on" || m === "off" ? m : "inherited", this.region && (this.region.pickableUpdateRequired = !0)), y && (this.markerNumber = y.number, this.markerImgURL = y.imgURL); }, p.prototype.render = function(m, y, g, v) { if (this.visible && !(this.timeEnabled && y) && this._lod.update(g, this.center), y == !0) { if (this.clipAction && this.isTimeVarying()) this.mixer.update(m); else { var x = this.inbuildTime + m; x > this.duration && (x -= this.duration), this.inbuildTime = x; } this.visible && m != 0 && (this.boundingBoxUpdateRequired = !0, this.morphColour == 1 && this._lod.updateMorphColorAttribute(!0)); } this.updateMarker(y, v); }, p.prototype.addLOD = function(m, y, g, v, x) { this._lod.addLevelFromURL(m, y, g, v, x); }, p.prototype.addVertices = function(m) { var y = this.getMorph(), g = void 0; if (!y) g = u(500, m), this.drawRange = m.length; else if (-1 < this.drawRange) { var v = y.geometry.getAttribute("position"); m.forEach((x) => { v.setXYZ(this.drawRange, x[0], x[1], x[2]), ++this.drawRange; }), v.needsUpdate = !0, y.geometry.setDrawRange(0, this.drawRange), y.geometry.computeBoundingBox(), y.geometry.computeBoundingSphere(), g = y.geoemtry, this.boundingBoxUpdateRequired = !0; } return g; }, p.prototype.setPosition = function(m, y, g) { var v = this.getGroup(); v && (v.position.set(m, y, g), v.updateMatrix(), this.boundingBoxUpdateRequired = !0); }, p.prototype.loadAdditionalSources = function(m) { m.load(d(filename), meshloader(region, colour, opacity, localTimeEnabled, localMorphColour, void 0, void 0, void 0, void 0, finishCallback), this.onProgress(filename), this.onError(finishCallback)); }, p.prototype.setScaleAll = function(m) { var y = this.getGroup(); y && (y.scale.set(m, m, m), y.updateMatrix(), this.boundingBoxUpdateRequired = !0); }, s.ZincObject = p; }, /* 11 */ /***/ (o, s, c) => { var l = c(4), u = c(5).updateMorphColorAttribute, d = c(5).toBufferGeometry, h = function(f) { this.levels = [], this._currentLevel = 0, this._renderOrder = 1, this._material = void 0, this._secondaryMaterial = void 0, this._loader = void 0, this._parent = f, this.addLevel = (m, y) => { if (m) { var g, v = Math.abs(y); for (g = 0; g < this.levels.length && !(v < this.levels[g].distance); g++) ; this.levels.splice(g, 0, { distance: v, morph: m, loaded: !0, loading: !1, url: "" }), m.renderOrder = this._renderOrder; } }, this.levelLoaded = (m, y) => { if (m) { for (var g = Math.abs(y), v = 0; v < this.levels.length; v++) if (g === this.levels[v].distance) { this._parent.group.add(m), this.levels[v].morph = m, this.levels[v].loaded = !0, this.levels[v].loading = !1; break; } this.checkTransparentMesh(); } }, this.addLevelFromURL = (m, y, g, v, x) => { this._loader = m; var w, S = this.calculateDistance(y); for (w = 0; w < this.levels.length && !(S < this.levels[w].distance); w++) ; this.levels.splice(w, 0, { distance: S, morph: void 0, loaded: !1, loading: !1, url: g, index: v }), x && this.loadLevel(w); }, this.loadLevel = (m) => { var y = this.levels[m]; return y.morph || y.loaded || y.loading || (y.loading = !0, this._loader.load(y.url, this.lodLoader(y.distance), void 0, void 0, { index: y.index })), y.morph === void 0; }, this.calculateDistance = function(m) { this._parent.getBoundingBox(); var y = this._parent.radius, g = 0; return m === "far" ? g = 4.5 * y : m === "medium" ? g = 2.5 * y : m == "close" && (g = 0), g; }, this.containsLevels = () => !!(this.levels && 1 < this.levels.length), this.checkTransparentMesh = () => { var m = this.levels[this._currentLevel]; this._material && (this._material.transparent ? (!this._secondaryMaterial && (this._secondaryMaterial = this._material.clone(), this._secondaryMaterial.side = l.FrontSide), this._secondaryMaterial.opacity = this._material.opacity, this._secondaryMaterial.emissive && this._secondaryMaterial.emissive.copy(this._material.emissive), this._secondaryMaterial.needsUpdate = !0, !m.secondaryMesh && (m.secondaryMesh = new l.Mesh(m.morph.geometry, this._secondaryMaterial), m.secondaryMesh.renderOrder = m.morph.renderOrder + 1, m.secondaryMesh.userData = m.morph.userData, m.secondaryMesh.name = m.morph.name), this._material.side = l.BackSide, this._material.needsUpdate = !0, !m.secondaryMesh.parent && (m.morph.add(m.secondaryMesh), this._parent.animationGroup && this._parent.animationGroup.add(m.secondaryMesh))) : (m.secondaryMesh && (m.morph.remove(m.secondaryMesh), this._parent.animationGroup && (this._parent.animationGroup.uncache(m.secondaryMesh), this._parent.animationGroup.remove(m.secondaryMesh))), this._material.side = l.DoubleSide, this._material.needsUpdate = !0)); }, this.dispose = () => { this.levels.forEach((m) => { m.morph && m.morph.geometry && m.morph.geometry.dispose(); }), this._material && this._material.dispose(), this._secondaryMaterial && this._secondaryMaterial.dispose(); }, this.getCurrentLevel = () => this._currentLevel, this.getCurrentMorph = () => { var m = this.levels[this._currentLevel]; return m && m.morph ? m.morph : this._parent.morph; }, this.lodLoader = function(m) { return (y) => { var g = this._material, v = { localTimeEnabled: this._parent.timeEnabled, localMorphColour: this._parent.morphColour }, x = d(y, v), w = void 0; this._parent.isGeometry ? w = new l.Mesh(x, g) : this._parent.isLines && (w = new (c(12)).LineSegments(x, g)), w.userData = this._parent, w.renderOrder = this._renderOrder, y.dispose(), this.levelLoaded(w, m); }; }, this.updateMorphColorAttribute = (m) => { if (this._material && (this._material.vertexColors == l.VertexColors || this._material.vertexColors == !0)) if (m) { var y = this.getCurrentMorph(); u(y.geometry, y); } else this.levels.forEach((g) => { g.morph && g.morph.geometry && u(g.morph.geometry, g.morph); }); }, this.setColour = (m) => { this._material.color = m, this._secondaryMaterial && (this._secondaryMaterial.color = m), p(); }, this.setFrustumCulled = (m) => { this.levels.forEach((y) => { y.morph && (y.morph.frustumCulled = m), y.secondaryMesh && (y.secondaryMesh.frustumCulled = m); }); }, this.setMaterial = (m) => { m && (!this._material || this._material.id !== m.id) && (this._material = m, this._secondaryMaterial && this._secondaryMaterial.dispose(), this._secondaryMaterial = m.clone(), this._secondaryMaterial.side = l.FrontSide, this._secondaryMaterial.transparent = !0, this.levels.forEach((y) => { y.morph && (y.morph.material = this._material, y.morph.geometry && (y.morph.geometry.colorsNeedUpdate = !0)), y.secondaryMesh && (y.secondaryMesh.material = this._secondaryMaterial); })); }, this.setName = (m) => { this.levels.forEach((y) => { y.morph && (y.morph.name = m), y.secondaryMesh && (y.secondaryMesh.name = m); }); }, this.setRenderOrder = (m) => { this._renderOrder = m, this.levels.forEach((y) => { y.morph && (y.morph.renderOrder = m), y.secondaryMesh && (y.secondaryMesh.renderOrder = m); }); }, this.setVertexColors = (m) => { this._material.vertexColors = m, p(), this._secondaryMaterial && (this._secondaryMaterial.vertexColors = m); }, this.update = (m, y) => { var g = this.levels; if (1 < g.length) { var v, x, w = m.cameraObject.position.distanceTo(y), S = -1, _ = -1; for (v = 0, x = g.length; v < x && w >= g[v].distance; v++) g[v].morph ? (-1 < S && g[S].morph && (g[S].morph.visible = !1), S = v, g[v].morph.visible = !0, _ = -1) : _ = v; for (-1 < _ && this.loadLevel(_); v < x; v++) g[v].morph && (-1 < S ? g[v].morph.visible = !1 : (g[v].morph.visible = !0, S = v)); this._currentLevel != S && (this._currentLevel = S, this.checkTransparentMesh()); } }, this.toggleMarker = (m, y) => { this.levels.forEach((g) => { g.morph && (y ? g.morph.add(m) : g.morph.remove(m)); }); }; var p = () => { this.levels.forEach((m) => { m.morph && m.morph.geometry && (m.morph.geometry.colorsNeedUpdate = !0); }); }; }; s.LOD = h; }, /* 12 */ /***/ (o, s, c) => { c.r(s), c.d(s, { /* harmony export */ LineSegments: () => ( /* binding */ f ) /* harmony export */ }); var l = c(13), u = c(4), d = /* @__PURE__ */ new u.Vector3(), h = /* @__PURE__ */ new u.Vector3(); class f extends l.Line { constructor(m, y) { super(m, y), this.type = "LineSegments"; } computeLineDistances() { var m = this.geometry; if (!m.isBufferGeometry) m.isGeometry && console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); else if (m.index === null) { for (var y = m.attributes.position, g = [], v = 0, x = y.count; v < x; v += 2) d.fromBufferAttribute(y, v), h.fromBufferAttribute(y, v + 1), g[v] = v == 0 ? 0 : g[v - 1], g[v + 1] = g[v] + d.distanceTo(h); m.setAttribute("lineDistance", new u.Float32BufferAttribute(g, 1)); } else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry."); return this; } } f.prototype.isLineSegments = !0; }, /* 13 */ /***/ (o, s, c) => { c.r(s), c.d(s, { /* harmony export */ Line: () => ( /* binding */ x ) /* harmony export */ }); var l = c(4), u = /* @__PURE__ */ new l.Vector3(), d = /* @__PURE__ */ new l.Vector3(), h = /* @__PURE__ */ new l.Matrix4(), f = /* @__PURE__ */ new l.Ray(), p = /* @__PURE__ */ new l.Sphere(), m = /* @__PURE__ */ new l.Vector3(), y = /* @__PURE__ */ new l.Vector3(), g = /* @__PURE__ */ new l.Vector3(), v = /* @__PURE__ */ new l.Vector3(); class x extends l.Object3D { constructor() { var _ = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : new l.BufferGeometry(), b = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : new l.LineBasicMaterial(); super(), this.type = "Line", this.geometry = _, this.material = b, this.updateMorphTargets(); } copy(_) { return super.copy(_), this.material = _.material, this.geometry = _.geometry, this; } computeLineDistances() { var _ = this.geometry; if (!_.isBufferGeometry) _.isGeometry && console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); else if (_.index === null) { for (var b = _.attributes.position, T = [0], E = 1, C = b.count; E < C; E++) u.fromBufferAttribute(b, E - 1), d.fromBufferAttribute(b, E), T[E] = T[E - 1], T[E] += u.distanceTo(d); _.setAttribute("lineDistance", new l.Float32BufferAttribute(T, 1)); } else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry."); return this; } raycast(_, b) { var T = this.geometry, E = this.matrixWorld, C = _.params.Line.threshold, L = T.drawRange, A = T.morphAttributes.position; if (T.boundingSphere === null && T.computeBoundingSphere(), p.copy(T.boundingSphere), p.applyMatrix4(E), p.radius += C, _.ray.intersectsSphere(p) !== !1) { h.copy(E).invert(), f.copy(_.ray).applyMatrix4(h); var k = C / ((this.scale.x + this.scale.y + this.scale.z) / 3), P = k * k, R = new l.Vector3(), M = new l.Vector3(), O = new l.Vector3(), D = new l.Vector3(), I = this.isLineSegments ? 2 : 1; if (T.isBufferGeometry) { var F = T.index, z = T.attributes, U = z.position; if (F !== null) for (var Z = Math.max(0, L.start), re = Math.min(F.count, L.start + L.count), K = Z; K < re - 1; K += I) { var V = F.getX(K), H = F.getX(K + 1); w(R, M, this, U, A, V, H); var G = f.distanceSqToSegment(R, M, D, O); if (!(G > P)) { D.applyMatrix4(this.matrixWorld); var W = _.ray.origin.distanceTo(D); W < _.near || W > _.far || b.push({ distance: W, // What do we want? intersection point on the ray or on the segment?? // point: raycaster.ray.at( distance ), point: O.clone().applyMatrix4(this.matrixWorld), index: K, face: null, faceIndex: null, object: this }); } } else for (var Y = Math.max(0, L.start), X = Math.min(U.count, L.start + L.count), ie = Y; ie < X - 1; ie += I) { w(R, M, this, U, A, ie, ie + 1); var ue = f.distanceSqToSegment(R, M, D, O); if (!(ue > P)) { D.applyMatrix4(this.matrixWorld); var $ = _.ray.origin.distanceTo(D); $ < _.near || $ > _.far || b.push({ distance: $, // What do we want? intersection point on the ray or on the segment?? // point: raycaster.ray.at( distance ), point: O.clone().applyMatrix4(this.matrixWorld), index: ie, face: null, faceIndex: null, object: this }); } } } else T.isGeometry && console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); } } updateMorphTargets() { var _ = this.geometry; if (_.isBufferGeometry) { var b = _.morphAttributes, T = Object.keys(b); if (0 < T.length) { var E = b[T[0]]; if (E !== void 0) { this.morphTargetInfluences = [], this.morphTargetDictionary = {}; for (var C, L = 0, A = E.length; L < A; L++) C = E[L].name || L + "", this.morphTargetInfluences.push(0), this.morphTargetDictionary[C] = L; } } } else { var k = _.morphTargets; k !== void 0 && 0 < k.length && console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead."); } } } function w(S, _, b, T, E, C, L) { S.fromBufferAttribute(T, C), _.fromBufferAttribute(T, L); var A = b.morphTargetInfluences; if (b.material.morphTargets && E && A) { m.set(0, 0, 0), y.set(0, 0, 0); for (var k = 0, P = E.length; k < P; k++) { var R = A[k], M = E[k]; R !== 0 && (g.fromBufferAttribute(M, C), v.fromBufferAttribute(M, L), m.addScaledVector(g.sub(S), R), y.addScaledVector(v.sub(_), R)); } S.add(m), _.add(y); } } x.prototype.isLine = !0; }, /* 14 */ /***/ (o, s, c) => { var l = c(4), u = new Image(128, 128); u.src = c(15); var d = new l.Texture(); d.image = u, d.needsUpdate = !0; var h = [0.02, 0.03, 1], f = new l.SpriteMaterial({ map: d, alphaTest: 0.5, transparent: !0, depthTest: !1, depthWrite: !1, sizeAttenuation: !1 }), p = c(5).createNewSpriteText, m = function(y) { c(10).ZincObject.call(this), this.texture = d; var g = void 0, v = void 0, x = void 0, w = void 0, S = void 0, _ = !0; this.morph = new l.Group(), this.group = this.morph, this.parent = y, this.isMarker = !0; var b = !1; this.ndc = new l.Vector3(); var T = void 0, E = void 0, C = () => { g = new l.Sprite(f), g.center.set(0.5, 0), this.morph.add(g), this.morph.position.set(0, 0, 0), this.morph.renderOrder = 1e4, g.scale.set(h[0], h[1], h[2]), g.userData = this; }; this.updateVisual = (L, A) => { var k = 1, P = 0; L !== A && (P = 1 - (this.ndc.z - L) / (A - L), k = 0.6 + 0.4 * P), this.setSpriteSize(k); }, this.updateNDC = (L) => (this.ndc.copy(this.morph.position), this.ndc.project(L), this.ndc.z = Math.min(Math.max(this.ndc.z, 0), 1), this.ndc), this.setPosition = (L, A, k) => { this.morph.position.set(L, A, k); }, this.setSpriteSize = (L) => { g.scale.set(0.015, 0.02, 1), g.scale.multiplyScalar(L); }, this.setUserSprite = () => { w && (this.morph.add(w), _ && (this.morph.remove(g), E && this.morph.remove(E), _ = !1)); }, this.setImageForUserSprite = (L, A) => { w && (this.morph.remove(w), w = void 0), v && v.dispose(), x && x.dispose(), v = new l.Texture(), v.image = L, v.needsUpdate = !0, x = new l.SpriteMaterial({ map: v, alphaTest: 0.5, transparent: !0, depthTest: !1, depthWrite: !1, sizeAttenuation: !1 }), A || (A = [0.05, 0.05, 1]), w = new l.Sprite(x), w.center.set(0.5, 0), w.scale.set(A[0], A[1], A[2]), w.userData = this, this.setUserSprite(); }, this.setDefaultSprite = () => { _ || (_ = !0, this.morph.add(g), w && this.morph.remove(w), E && this.morph.add(E)); }, this.loadUserSprite = (L, A) => { if (L) if (L !== S) { S = L; var k = new Image(128, 128); k.crossOrigin = "anonymous", k.onload = () => { this.setImageForUserSprite(k, A); }, k.src = L; } else this.setUserSprite(); }, this.dispose = () => { this.morph && this.morph.clear(), g && (g.clear(), g = void 0), E && (E.material.map.dispose(), E.material.dispose(), E = void 0); }, this.isEnabled = () => b, this.setNumber = (L) => { (!L || T != L) && E && (this.morph.remove(E), E.material.map.dispose(), E.material.dispose(), E = void 0), !E && L && (E = p(L, 0.012, "black", "Asap", 120, 700), this.morph.add(E)), T = L; }, this.getNumber = () => T || 1, this.setVisibility = function(L) { L !== this.visible && (this.visible = L, this.group.visible = L, this.parent.region && (this.parent.region.pickableUpdateRequired = !0)); }, this.enable = () => { b = !0, this.morph.visible = !0, this.visible = !0; }, this.disable = () => { b = !1, this.morph.visible = !1, this.visible = !1; }, C(); }; m.prototype = Object.create(c(10).ZincObject.prototype), s.Marker = m; }, /* 15 */ /***/ (o) => { o.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgdmlld0JveD0iMCAwIDM2NSA1NjAiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4NCjxkZWZzPg0KPC9kZWZzPg0KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCAwKSIgaWQ9IjgwOGVkMjgzLTI1MjQtNDQwZi04OGFlLTNiZGI0N2JiNTc0OSIgID4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4NCjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItMTgyLjUiIHk9Ii0yODAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIC8+DQo8L2c+DQo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+DQo8ZyBzdHlsZT0iIiAgID4NCjwvZz4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCA5Ny41KSIgID4NCjxnIHN0eWxlPSIiICAgPg0KPC9nPg0KPC9nPg0KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMC45OSAwIDAgMC45OSAxODIuNSAyODApIiAgPg0KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii01NDAiIHk9Ii01NDAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjEwODAiIGhlaWdodD0iMTA4MCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHBhdGggc3R5bGU9InN0cm9rZTogcmdiKDAsMCwwKTsgc3Ryb2tlLXdpZHRoOiAwOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMCw4OSwxMTYpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB0cmFuc2Zvcm09IiB0cmFuc2xhdGUoLTE4Mi45LCAtMjc5Ljg1KSIgZD0iTSAxODIuOSA1NTEuNyBDIDE4Mi45IDU1MS44MDAwMDAwMDAwMDAxIDE4My4xIDU1MiAxODMuMSA1NTIgQyAxODMuMSA1NTIgMzU4LjMgMjgzIDM1OC4zIDE5NC42IEMgMzU4LjMgNjQuNSAyNjkuNSA3LjkwMDAwMDAwMDAwMDAwNiAxODIuOSA3LjY5OTk5OTk5OTk5OTk4OSBDIDk2LjMgNy45IDcuNSA2NC41IDcuNSAxOTQuNiBDIDcuNSAyODMgMTgyLjggNTUyIDE4Mi44IDU1MiBDIDE4Mi44IDU1MiAxODIuOSA1NTEuNyAxODIuOSA1NTEuNyB6IE0gMTIyLjIgMTg3LjIgQyAxMjIuMiAxNTMuNiAxNDkuNCAxMjYuMzk5OTk5OTk5OTk5OTkgMTgzIDEyNi4zOTk5OTk5OTk5OTk5OSBDIDIxNi42IDEyNi4zOTk5OTk5OTk5OTk5OSAyNDMuOCAxNTMuNiAyNDMuOCAxODcuMiBDIDI0My44IDIyMC43OTk5OTk5OTk5OTk5OCAyMTYuNSAyNDggMTgyLjkgMjQ4IEMgMTQ5LjQgMjQ4IDEyMi4yIDIyMC44IDEyMi4yIDE4Ny4yIHoiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPg0KPGNpcmNsZSBzdHlsZT0ic3Ryb2tlOiByZ2IoMCwwLDApOyBzdHJva2Utd2lkdGg6IDA7IHN0cm9rZS1kYXNoYXJyYXk6IG5vbmU7IHN0cm9rZS1saW5lY2FwOiBidXR0OyBzdHJva2UtZGFzaG9mZnNldDogMDsgc3Ryb2tlLWxpbmVqb2luOiBtaXRlcjsgc3Ryb2tlLW1pdGVybGltaXQ6IDQ7IGZpbGw6IHJnYigyNTUsMjU1LDI1NSk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIGN4PSIwIiBjeT0iMCIgcj0iMzUiIC8+DQo8L2c+DQo8L2c+DQo8L2c+DQo8L3N2Zz4="; }, /* 16 */ /***/ (o, s, c) => { var l = c(4), u = function(d, h, f, p) { c(10).ZincObject.call(this); var m; h && (m = h.clone(), m.vertexColors = l.FaceColors), this.id = f; var y = void 0, g = void 0; this.isGlyph = !0, this.fromMesh = (v) => !!(v && v.isMesh) && (this.morph = v.clone(), this.morph.userData = this, this.group.add(this.morph), !0), d && m && this.fromMesh(new l.Mesh(d, m)), this.getGlyphset = function() { return p; }, this.setLabel = (v) => { v && (typeof v == "string" || v instanceof String) && (g = v, this.morph && (this.morph.name = v)), y && this.showLabel(); }, this.showLabel = (v) => { if (y && (position = y.getPosition(), this.group.remove(y.getSprite()), y.dispose(), y = void 0), g && (typeof g == "string" || g instanceof String)) { var x = [0, 0, 0]; y = new (c(17)).Label(g, v), y.setPosition(x[0], x[1], x[2]), this.group.add(y.getSprite()); } }, this.getLabel = () => g, this.getMesh = () => this.morph, this.setTransformation = (v, x, w, S) => { this.morph && (this.morph.matrix.elements[0] = x[0], this.morph.matrix.elements[1] = x[1], this.morph.matrix.elements[2] = x[2], this.morph.matrix.elements[3] = 0, this.morph.matrix.elements[4] = w[0], this.morph.matrix.elements[5] = w[1], this.morph.matrix.elements[6] = w[2], this.morph.matrix.elements[7] = 0, this.morph.matrix.elements[8] = S[0], this.morph.matrix.elements[9] = S[1], this.morph.matrix.elements[10] = S[2], this.morph.matrix.elements[11] = 0, this.morph.matrix.elements[12] = v[0], this.morph.matrix.elements[13] = v[1], this.morph.matrix.elements[14] = v[2], this.morph.matrix.elements[15] = 1, this.morph.matrixAutoUpdate = !1), y && y.setPosition(v[0], v[1], v[2]); }, this.setColour = (v) => { y && y.setColour(v), this.secondaryMesh && this.secondaryMesh.material && (this.secondaryMesh.material.color = colour), this.geometry.colorsNeedUpdate = !0; }, this.dispose = () => { this.material && this.material.dispose(), this.morph = void 0; }; }; u.prototype = Object.create(c(10).ZincObject.prototype), s.Glyph = u; }, /* 17 */ /***/ (o, s, c) => { var l = c(7).default; s.Label = function(u, d) { var h = u, f = void 0; f = d ? new l(h, 0.015, d.getStyle()) : new l(h, 0.015), f.fontFace = "Asap", f.fontWeight = 700, f.material.map.generateMipmaps = !1, f.material.sizeAttenuation = !1, f.center.x = -0.05, f.center.y = 0, this.getPosition = () => f ? [f.position.x, f.position.y, f.position.z] : [0, 0, 0], this.setPosition = (p, m, y) => { f && f.position.set(p, m, y); }, this.setColour = (p) => { f.color = p.getStyle(); }, this.setScale = (p) => { f && 0 < p && f.scale.set(p, p, 1); }, this.dispose = () => { f.dispose(); }, this.getSprite = () => f, this.getString = () => h; }; }, /* 18 */ /***/ (o, s, c) => { function l(f) { throw new TypeError('"' + f + '" is read-only'); } var u = c(4), d = c(19).JSONLoader, h = function() { c(10).ZincObject.call(this); var f = [], p = void 0, m = void 0, y = void 0, g = void 0, v = void 0, x = void 0, w = void 0, S = 0, _ = 0, b = [0, 0, 0], T = [0, 0, 0], E = [0, 0, 0], C = "NONE"; this.ready = !1; var L = !1, A = !1; this.isGlyphset = !0; for (var k = new u.Matrix4(), P = new u.Color(), R = new u.Color(), M = new u.Box3(), O = new u.Box3(), D = new u.Box3(), I = [], F = [], z = [], U = [], Z = [], re = [], K = [], V = [], H = 0; 8 > H; H++) I[H] = new u.Vector3(); this.load = ($, J, ne, j, q) => { p = $.axis1, m = $.axis2, y = $.axis3, g = $.positions, v = $.scale, x = $.colors, w = $.label, L = $.metadata.MorphColours, A = $.metadata.MorphVertices, S = $.metadata.number_of_time_steps, C = $.metadata.repeat_mode, _ = $.metadata.number_of_vertices, C == "AXES_2D" || C == "MIRROR" ? _ *= 2 : C == "AXES_3D" && (_ *= 3), b = $.metadata.base_size, T = $.metadata.offset, E = $.metadata.scale_factors; var ge = new d(); this.geometry = new u.BufferGeometry(); var ye = new u.InstancedMesh(this.geometry, void 0, _); if (this.setMorph(ye), j) { var _e = ge.parse(J); ue(ne, q)(_e.geometry, _e.materials), _e.geometry.dispose(); } else ge.crossOrigin = "Anonymous", ge.load(J, ue(ne, q)); }; var G = ($, J, ne, j, q, ge) => { if (C == "NONE" || C == "MIRROR") { for (var ye, _e = [0, 0, 0], Me = [0, 0, 0], Ce = [0, 0, 0], B = [0, 0, 0], ce = [0, 0, 0], ve = [0, 0, 0], te = [0, 0, 0], pe = [0, 0, 0], fe = [0, 0, 0], he = 0; 3 > he; he++) ye = 0 > q[he] ? -1 : 1, _e[he] = ye * b[he] + q[he] * E[he]; for (var he = 0; 3 > he; he++) Me[he] = J[he] * _e[0], Ce[he] = ne[he] * _e[1], B[he] = j[he] * _e[2], ce[he] = $[he] + T[0] * Me[he] + T[1] * Ce[he] + T[2] * B[he], C == "MIRROR" && (ve[he] = -Me[he], te[he] = -Ce[he], pe[he] = -B[he], fe[he] = ce[he], 0 > q[0] && (ce[he] -= Me[he], fe[he] -= ve[he])); 0 > B[0] * (Me[1] * Ce[2] - Me[2] * Ce[1]) + B[1] * (Me[2] * Ce[0] - Me[0] * Ce[2]) + B[2] * (Me[0] * Ce[1] - Me[1] * Ce[0]) && (B[0] = -B[0], B[1] = -B[1], B[2] = -B[2]), ge[0] = [ce, Me, Ce, B], C == "MIRROR" && (0 > pe[0] * (ve[1] * te[2] - ve[2] * te[1]) + pe[1] * (ve[2] * te[0] - ve[0] * te[2]) + pe[2] * (ve[0] * te[1] - ve[1] * te[0]) && (pe[0] = -pe[0], pe[1] = -pe[1], pe[2] = -pe[2]), ge[1] = [fe, ve, te, pe]); } else if (C == "AXES_2D" || C == "AXES_3D") { for (var ye, Te = [0, 0, 0], He = [0, 0, 0], he = 0; 3 > he; he++) ye = 0 > q[he] ? -1 : 1, Te[he] = ye * b[0] + q[he] * E[0]; for (var he = 0; 3 > he; he++) He[he] = $[he] + T[0] * Te[0] * J[he] + T[1] * Te[1] * ne[he] + T[2] * Te[2] * j[he]; for (var We = glyph_repeat_mode == "AXES_2D" ? 2 : 3, Ie = 0; Ie < We; Ie++) { var qe = void 0, De = void 0, $e = q[Ie], nt = [0, 0, 0], lt = [0, 0, 0], mt = [0, 0, 0]; Ie == 0 ? (qe = J, De = ne) : Ie == 1 ? (qe = ne, De = glyph_repeat_mode == "AXES_2D" ? J : j) : (qe = j, De = J); var _t = b[0] + $e * E[0]; nt[0] = qe[0] * _t, nt[1] = qe[1] * _t, nt[2] = qe[2] * _t, mt[0] = nt[1] * De[2] - De[1] * nt[2], mt[1] = nt[2] * De[0] - De[2] * nt[0], mt[2] = nt[0] * De[1] - nt[1] * De[0]; var wt = Math.sqrt(mt[0] * mt[0] + mt[1] * mt[1] + mt[2] * mt[2]); if (0 < wt) { var me = (b[2] + $e * E[2]) / wt; C == "AXES_2D" && 0 < Ie && (me *= -1), mt[0] *= me, mt[1] *= me, mt[2] *= me; } if (lt[0] = mt[1] * nt[2] - nt[1] * mt[2], lt[1] = mt[2] * nt[0] - nt[2] * mt[0], lt[2] = mt[0] * nt[1] - mt[1] * nt[0], wt = Math.sqrt(lt[0] * lt[0] + lt[1] * lt[1] + lt[2] * lt[2]), 0 < wt) { var Ne = (b[1] + $e * E[1]) / wt; lt[0] *= Ne, lt[1] *= Ne, lt[2] *= Ne; } ge[Ie] = [He, nt, lt, mt]; } } return ge; }, W = ($, J, ne, j, q) => { var ge = 1; C == "AXES_2D" || C == "MIRROR" ? ge = 2 : C == "AXES_3D" && (ge = 3); var ye = $.length / 3, _e = 0; V.length = ge; for (var Me = 0; Me < ye; Me++) { var Ce = 3 * Me, B = [$[Ce], $[Ce + 1], $[Ce + 2]], ce = [J[Ce], J[Ce + 1], J[Ce + 2]], ve = [ne[Ce], ne[Ce + 1], ne[Ce + 2]], te = [j[Ce], j[Ce + 1], j[Ce + 2]], pe = [q[Ce], q[Ce + 1], q[Ce + 2]], fe = G(B, ce, ve, te, pe, V); if (fe.length == ge) for (var he = 0; he < ge; he++) { k.elements[0] = fe[he][1][0], k.elements[1] = fe[he][1][1], k.elements[2] = fe[he][1][2], k.elements[3] = 0, k.elements[4] = fe[he][2][0], k.elements[5] = fe[he][2][1], k.elements[6] = fe[he][2][2], k.elements[7] = 0, k.elements[8] = fe[he][3][0], k.elements[9] = fe[he][3][1], k.elements[10] = fe[he][3][2], k.elements[11] = 0, k.elements[12] = fe[he][0][0], k.elements[13] = fe[he][0][1], k.elements[14] = fe[he][0][2], k.elements[15] = 1, this.morph.setMatrixAt(_e, k); var Te = f[_e]; Te && Te.setTransformation(fe[he][0], fe[he][1], fe[he][2], fe[he][3]), _e++; } } this.morph.instanceMatrix.needsUpdate = !0; }, Y = ($) => { var J = 1; C == "AXES_2D" || C == "MIRROR" ? J = 2 : C == "AXES_3D" && (J = 3); for (var ne, j = $.length, q = 0, ge = 0; ge < j; ge++) { ne = $[ge]; for (var ye = 0; ye < J; ye++) { P.setHex(ne), this.morph.setColorAt(q, P); var _e = f[q]; _e && _e.setColour(P), q++; } } this.morph.instanceColor.needsUpdate = !0; }, X = () => { var $ = F, J = z, ne = U, j = Z, q = re, ge = K, ye = this.inbuildTime / this.duration * (S - 1), _e = Math.floor(ye), Me = 1 - (ye - _e), Ce = Math.ceil(ye); if (A) { var B = g[_e.toString()], ce = g[Ce.toString()], ve = p[_e.toString()], te = p[Ce.toString()], pe = m[_e.toString()], fe = m[Ce.toString()], he = y[_e.toString()], Te = y[Ce.toString()], He = v[_e.toString()], We = v[Ce.toString()]; F.length = B.length, z.length = B.length, U.length = B.length, Z.length = B.length, re.length = B.length; for (var Ie = 0; Ie < B.length; Ie++) $[Ie] = Me * B[Ie] + (1 - Me) * ce[Ie], J[Ie] = Me * ve[Ie] + (1 - Me) * te[Ie], ne[Ie] = Me * pe[Ie] + (1 - Me) * fe[Ie], j[Ie] = Me * he[Ie] + (1 - Me) * Te[Ie], q[Ie] = Me * He[Ie] + (1 - Me) * We[Ie]; } else g[0], l("current_positions"), p[0], l("current_axis1s"), m[0], l("current_axis2s"), y[0], l("current_axis3s"), v[0], l("current_scales"); if (W($, J, ne, j, q), this.boundingBoxUpdateRequired = !0, x != null) { if (L) { var qe = x[_e.toString()], De = x[Ce.toString()]; ge.length = qe.length; for (var $e = 0; $e < qe.length; $e++) P.setHex(qe[$e]), R.setHex(De[$e]), P.setRGB(P.r * Me + R.r * (1 - Me), P.g * Me + R.g * (1 - Me), P.b * Me + R.b * (1 - Me)), ge[$e] = P.getHex(); } else x[0], l("current_colors"); Y(ge); } }; this.showLabel = () => { for (var $ = 0; $ < f.length; $++) f[$].showLabel(this.morph.material ? this.morph.material.color : void 0); }; var ie = ($) => { if (w != null && $) for (var J, ne = 0; ne < _; ne++) J = new (c(16)).Glyph(void 0, void 0, ne, this), w != null && w[ne] != null && J.setLabel(w[ne]), 0 < S && J.setFrustumCulled(!1), f[ne] = J, this.morph.add(J.getGroup()); w != null && $ && this.showLabel(this.morph.material ? this.morph.material.color : void 0), W(g[0], p[0], m[0], y[0], v[0]), x != null && Y(x[0]), this.ready = !0, this.boundingBoxUpdateRequired = !0; }; this.addCustomGlyph = ($) => { $.isGlyph && f.push($), this.ready = !0, this.boundingBoxUpdateRequired = !0; }, this.addMeshAsGlyph = ($, J) => { if ($.isMesh) { var ne = new (c(16)).Glyph(void 0, void 0, J, this); return ne.fromMesh($), f.push(ne), this.morph.add(ne.getGroup()), this.ready = !0, this.boundingBoxUpdateRequired = !0, ne; } }, this.forEachGlyph = ($) => { for (var J = 0; J < f.length; J++) $(f[J]); }; var ue = ($, J) => (ne, j) => { var q = ne.toBufferGeometry(); this.geometry.copy(q), this.geometry.computeBoundingSphere(), this.geometry.computeBoundingBox(), q.dispose(), j && j[0] && (this.morph.material = j[0]), ie(J), this.morph.name = this.groupName, this.morph.userData = this, this.setMorph(this.morph), ne.dispose(), $ != null && typeof $ == "function" && $(this); }; this.getClosestVertexIndex = function() { var $ = -1; if (this.morph && this.ready) { this.getBoundingBox().getCenter(this._v1); for (var J, ne = g[0], j = ne.length / 3, q = -1, ge = 0, ye = 0; ye < j; ye++) J = 3 * ye, this._v2.set(ne[J], ne[J + 1], ne[J + 2]), ge = this._v1.distanceTo(this._v2), (q == -1 || q > ge) && (q = ge, $ = ye); } return $; }, this.getClosestVertex = function() { if (this.closestVertexIndex == -1 && (this.closestVertexIndex = this.getClosestVertexIndex()), 0 <= this.closestVertexIndex && this.morph) { var $ = new u.Vector3(); return this.morph.getMatrixAt(this.closestVertexIndex, k), $.setFromMatrixPosition(k), $; } }, this.getBoundingBox = () => { if (this.morph && this.ready && this.morph.visible) { if (this.boundingBoxUpdateRequired) { M.setFromBufferAttribute(this.morph.geometry.attributes.position); for (var $ = 0; $ < _; $++) this.morph.getMatrixAt($, k), O.copy(M).applyMatrix4(k), $ == 0 ? D.copy(O) : D.union(O); if (D) this.cachedBoundingBox.copy(D), this.morph.updateWorldMatrix(!0, !0), this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld), this.boundingBoxUpdateRequired = !1; else return; } return this.cachedBoundingBox; } }, this.setMorphTime = ($) => { this.inbuildTime = $ > this.duration ? this.duration : 0 > $ ? 0 : $, (L || A) && (X(), A && (this.markerUpdateRequired = !0)); }, this.isTimeVarying = () => !!((this.ready === !1 || 0 < S) && (L || A)), this.getCurrentTime = () => this.inbuildTime, this.dispose = () => { for (var $ = f.length - 1; 0 <= $; $--) f[$].dispose(); this.geometry && this.geometry.dispose(), this.morph && this.morph.material.dispose(), p = void 0, m = void 0, y = void 0, g = void 0, v = void 0, x = void 0, this.ready = !1, this.groupName = void 0; }, this.render = ($, J, ne) => { if (J == !0) { var j = this.inbuildTime + $; j > this.duration && (j -= this.duration), this.inbuildTime = j, (L || A) && X(); } this.updateMarker(J, ne); }; }; h.prototype = Object.create(c(10).ZincObject.prototype), s.Glyphset = h; }, /* 19 */ /***/ (o, s, c) => { c.r(s), c.d(s, { /* harmony export */ JSONLoader: () => ( /* binding */ _ ) /* harmony export */ }); var l = c(4), u = c(20).Loader, d = l.LoaderUtils, h = l.AnimationClip, f = l.Vector3, p = l.Vector4, m = l.Color, y = l.Vector2, g = c(6).Face3, v = c(6).Geometry, x = l.FileLoader, w = l.DefaultLoadingManager, S = c(21).VideoHandler; function _(b) { typeof b == "boolean" && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."), b = void 0), this.manager = b === void 0 ? w : b, this.withCredentials = !1, this.paramsString = ""; } Object.assign(_.prototype, { load: function(b, T, E, C) { var L = this, A = this.texturePath && typeof this.texturePath == "string" ? this.texturePath : d.extractUrlBase(b), k = new x(this.manager); b.split("?"), this.paramsString = b.length === 2 ? paramsStrings[1] : "", k.setWithCredentials(this.withCredentials), k.load(b, function(P) { var R = JSON.parse(P), M = R.metadata; if (M !== void 0) { var O = M.type; if (O !== void 0 && O.toLowerCase() === "object") return void console.error("THREE.JSONLoader: " + b + " should be loaded with THREE.ObjectLoader instead."); } if (L && L.parse) { var D = L.parse(R, A); T(D.geometry, D.materials); } }, E, C); }, setTexturePath: function(b) { this.texturePath = b; }, parse: /* @__PURE__ */ function() { function b(L, A) { function k(pe, fe) { return pe & 1 << fe; } var P, R, M, O, D, I, F, z, U, Z, re, K, V, H, G, W, Y, X, ie, ue, $, J, ne, j, q, ge, ye, _e = L.faces, Me = L.vertices, Ce = L.normals, B = L.colors, ce = L.scale, ve = 0; if (L.uvs !== void 0) { for (P = 0; P < L.uvs.length; P++) L.uvs[P].length && ve++; for (P = 0; P < ve; P++) A.faceVertexUvs[P] = []; } for (O = 0, D = Me.length; O < D; ) X = new f(), X.x = Me[O++] * ce, X.y = Me[O++] * ce, X.z = Me[O++] * ce, A.vertices.push(X); if (O = 0, D = _e.length, L.uvs) for (P = 0; P < L.uvs.length; P++) { A.uvs[P] = []; for (var te = 0; te < L.uvs[P].length; te++) A.uvs[P][te] = L.uvs[P][te]; } if (Ce) for (P = 0; P < Ce.length; P++) A.normals[P] = Ce[P]; if (B) for (P = 0; P < B.length; P++) A.colors[P] = B[P]; for (; O < D; ) if (Z = _e[O++], re = k(Z, 0), K = k(Z, 1), V = k(Z, 3), H = k(Z, 4), G = k(Z, 5), W = k(Z, 6), Y = k(Z, 7), re) { if (ue = new g(), ue.a = _e[O], ue.b = _e[O + 1], ue.c = _e[O + 3], $ = new g(), $.a = _e[O + 1], $.b = _e[O + 2], $.c = _e[O + 3], O += 4, K && (U = _e[O++], ue.materialIndex = U, $.materialIndex = U), M = A.faces.length, V) for (P = 0; P < ve; P++) for (j = L.uvs[P], A.faceVertexUvs[P][M] = [], A.faceVertexUvs[P][M + 1] = [], R = 0; 4 > R; R++) z = _e[O++], ge = j[2 * z], ye = j[2 * z + 1], q = new y(ge, ye), R !== 2 && A.faceVertexUvs[P][M].push(q), R !== 0 && A.faceVertexUvs[P][M + 1].push(q); if (H && (F = 3 * _e[O++], ue.normal.set(Ce[F++], Ce[F++], Ce[F]), $.normal.copy(ue.normal)), G) for (P = 0; 4 > P; P++) F = 3 * _e[O++], ne = new f(Ce[F++], Ce[F++], Ce[F]), P !== 2 && ue.vertexNormals.push(ne), P !== 0 && $.vertexNormals.push(ne); if (W && (I = _e[O++], J = B[I], ue.color.setHex(J), $.color.setHex(J)), Y) for (P = 0; 4 > P; P++) I = _e[O++], J = B[I], P !== 2 && ue.vertexColors.push(new m(J)), P !== 0 && $.vertexColors.push(new m(J)); A.faces.push(ue), A.faces.push($); } else { if (ie = new g(), ie.a = _e[O++], ie.b = _e[O++], ie.c = _e[O++], K && (U = _e[O++], ie.materialIndex = U), M = A.faces.length, V) for (P = 0; P < ve; P++) for (j = L.uvs[P], A.faceVertexUvs[P][M] = [], R = 0; 3 > R; R++) z = _e[O++], ge = j[2 * z], ye = j[2 * z + 1], q = new y(ge, ye), A.faceVertexUvs[P][M].push(q); if (H && (F = 3 * _e[O++], ie.normal.set(Ce[F++], Ce[F++], Ce[F])), G) for (P = 0; 3 > P; P++) F = 3 * _e[O++], ne = new f(Ce[F++], Ce[F++], Ce[F]), ie.vertexNormals.push(ne); if (W && (I = _e[O++], ie.color.setHex(B[I])), Y) for (P = 0; 3 > P; P++) I = _e[O++], ie.vertexColors.push(new m(B[I])); A.faces.push(ie); } } function T(L, A) { var k = L.influencesPerVertex === void 0 ? 2 : L.influencesPerVertex; if (L.skinWeights) for (var P = 0, R = L.skinWeights.length; P < R; P += k) { var M = L.skinWeights[P], O = 1 < k ? L.skinWeights[P + 1] : 0, D = 2 < k ? L.skinWeights[P + 2] : 0, I = 3 < k ? L.skinWeights[P + 3] : 0; A.skinWeights.push(new p(M, O, D, I)); } if (L.skinIndices) for (var P = 0, R = L.skinIndices.length; P < R; P += k) { var F = L.skinIndices[P], z = 1 < k ? L.skinIndices[P + 1] : 0, U = 2 < k ? L.skinIndices[P + 2] : 0, Z = 3 < k ? L.skinIndices[P + 3] : 0; A.skinIndices.push(new p(F, z, U, Z)); } A.bones = L.bones, A.bones && 0 < A.bones.length && (A.skinWeights.length !== A.skinIndices.length || A.skinIndices.length !== A.vertices.length) && console.warn("When skinning, number of vertices (" + A.vertices.length + "), skinIndices (" + A.skinIndices.length + "), and skinWeights (" + A.skinWeights.length + ") should match."); } function E(L, A) { var k = L.scale; if (L.morphTargets !== void 0) for (var P = 0, R = L.morphTargets.length; P < R; P++) { A.morphTargets[P] = {}, A.morphTargets[P].name = L.morphTargets[P].name, A.morphTargets[P].vertices = []; for (var M, O = A.morphTargets[P].vertices, D = L.morphTargets[P].vertices, I = 0, F = D.length; I < F; I += 3) M = new f(), M.x = D[I] * k, M.y = D[I + 1] * k, M.z = D[I + 2] * k, O.push(M); } if (L.morphNormals !== void 0) { for (var P = 0, R = L.morphNormals.length; P < R; P++) if (A.morphTargets[P]) { A.morphTargets[P].normals = []; for (var z, U = A.morphTargets[P].normals, Z = L.morphNormals[P].normals, I = 0, F = Z.length; I < F; I += 3) z = new f(), z.x = Z[I], z.y = Z[I + 1], z.z = Z[I + 2], U.push(z); A.morphNormalsReady = !0; } } if (L.morphColors !== void 0) { var P, R, re, K, V, H, G; for (P = 0, R = L.morphColors.length; P < R; P++) for (A.morphColors[P] = {}, A.morphColors[P].name = L.morphColors[P].name, A.morphColors[P].colors = [], V = A.morphColors[P].colors, H = L.morphColors[P].colors, re = 0, K = H.length; re < K; re += 3) G = new l.Color(16755200), G.setRGB(H[re], H[re + 1], H[re + 2]), V.push(G); } } function C(L, A) { var k = [], P = []; L.animation !== void 0 && P.push(L.animation), L.animations !== void 0 && (L.animations.length ? P = P.concat(L.animations) : P.push(L.animations)); for (var R, M = 0; M < P.length; M++) R = h.parseAnimation(P[M], A.bones), R && k.push(R); if (A.morphTargets) { var O = h.CreateClipsFromMorphTargetSequences(A.morphTargets, 10); k = k.concat(O); } 0 < k.length && (A.animations = k); } return function(L, A) { L.data !== void 0 && (L = L.data), L.scale = L.scale === void 0 ? 1 : 1 / L.scale; var k = new v(); if (k.morphColors = [], b(L, k), T(L, k), E(L, k), C(L, k), k.computeFaceNormals(), k.computeBoundingSphere(), L.materials === void 0 || L.materials.length === 0) return { geometry: k }; var P = u.prototype.initMaterials(L.materials, A, "Anonymous"); if (L.materials[0].video) { var R = A + L.materials[0].video; this.paramsString && (R += "?".concat(this.paramsString)); var M = new S(R); k._video = M; } return P && 0 < P.length && (P[0].side = L.materials[0].singleSided ? l.FrontSide : L.materials[0].flipSided ? l.BackSide : l.DoubleSide, L.materials[0].specularCoef && (P[0].shininess = Math.floor(L.materials[0].specularCoef / 3))), { geometry: k, materials: P }; }; }() }); }, /* 20 */ /***/ (o, s, c) => { c.r(s), c.d(s, { /* harmony export */ Loader: () => ( /* binding */ u ) /* harmony export */ }); var l = c(4); c(4); function u() { } u.Handlers = { handlers: [], add: function(d, h) { this.handlers.push(d, h); }, get: function(d) { for (var h = this.handlers, f = 0, p = h.length; f < p; f += 2) { var m = h[f], y = h[f + 1]; if (m.test(d)) return y; } return null; } }, Object.assign(u.prototype, { crossOrigin: "anonymous", onLoadStart: function() { }, onLoadProgress: function() { }, onLoadComplete: function() { }, initMaterials: function(d, h, f) { for (var p = [], m = 0; m < d.length; ++m) p[m] = this.createMaterial(d[m], h, f); return p; }, createMaterial: function() { var d = { NoBlending: l.NoBlending, NormalBlending: l.NormalBlending, AdditiveBlending: l.AdditiveBlending, SubtractiveBlending: l.SubtractiveBlending, MultiplyBlending: l.MultiplyBlending, CustomBlending: l.CustomBlending }, h = new l.Color(), f = new l.TextureLoader(), p = new l.MaterialLoader(); return function(m, y, g) { function v(b, T, E, C, L) { var A, k = y + b, P = u.Handlers.get(k); P === null ? (f.setCrossOrigin(g), A = f.load(k)) : A = P.load(k), T !== void 0 && (A.repeat.fromArray(T), T[0] !== 1 && (A.wrapS = l.RepeatWrapping), T[1] !== 1 && (A.wrapT = l.RepeatWrapping)), E !== void 0 && A.offset.fromArray(E), C !== void 0 && (C[0] === "repeat" && (A.wrapS = l.RepeatWrapping), C[0] === "mirror" && (A.wrapS = l.MirroredRepeatWrapping), C[1] === "repeat" && (A.wrapT = l.RepeatWrapping), C[1] === "mirror" && (A.wrapT = l.MirroredRepeatWrapping)), L !== void 0 && (A.anisotropy = L); var R = l.MathUtils.generateUUID(); return x[R] = A, R; } var x = {}, w = { uuid: l.MathUtils.generateUUID(), type: "MeshLambertMaterial" }; for (var S in m) { var _ = m[S]; switch (S) { case "DbgColor": case "DbgIndex": case "opticalDensity": case "illumination": break; case "DbgName": w.name = _; break; case "blending": w.blending = d[_]; break; case "colorAmbient": case "mapAmbient": console.warn("THREE.Loader.createMaterial:", S, "is no longer supported."); break; case "colorDiffuse": w.color = h.fromArray(_).getHex(); break; case "colorSpecular": w.specular = h.fromArray(_).getHex(); break; case "colorEmissive": w.emissive = h.fromArray(_).getHex(); break; case "specularCoef": w.shininess = _; break; case "shading": _.toLowerCase() === "basic" && (w.type = "MeshBasicMaterial"), _.toLowerCase() === "phong" && (w.type = "MeshPhongMaterial"), _.toLowerCase() === "standard" && (w.type = "MeshStandardMaterial"); break; case "mapDiffuse": w.map = v(_, m.mapDiffuseRepeat, m.mapDiffuseOffset, m.mapDiffuseWrap, m.mapDiffuseAnisotropy); break; case "mapDiffuseRepeat": case "mapDiffuseOffset": case "mapDiffuseWrap": case "mapDiffuseAnisotropy": break; case "mapEmissive": w.emissiveMap = v(_, m.mapEmissiveRepeat, m.mapEmissiveOffset, m.mapEmissiveWrap, m.mapEmissiveAnisotropy); break; case "mapEmissiveRepeat": case "mapEmissiveOffset": case "mapEmissiveWrap": case "mapEmissiveAnisotropy": break; case "mapLight": w.lightMap = v(_, m.mapLightRepeat, m.mapLightOffset, m.mapLightWrap, m.mapLightAnisotropy); break; case "mapLightRepeat": case "mapLightOffset": case "mapLightWrap": case "mapLightAnisotropy": break; case "mapAO": w.aoMap = v(_, m.mapAORepeat, m.mapAOOffset, m.mapAOWrap, m.mapAOAnisotropy); break; case "mapAORepeat": case "mapAOOffset": case "mapAOWrap": case "mapAOAnisotropy": break; case "mapBump": w.bumpMap = v(_, m.mapBumpRepeat, m.mapBumpOffset, m.mapBumpWrap, m.mapBumpAnisotropy); break; case "mapBumpScale": w.bumpScale = _; break; case "mapBumpRepeat": case "mapBumpOffset": case "mapBumpWrap": case "mapBumpAnisotropy": break; case "mapNormal": w.normalMap = v(_, m.mapNormalRepeat, m.mapNormalOffset, m.mapNormalWrap, m.mapNormalAnisotropy); break; case "mapNormalFactor": w.normalScale = _; break; case "mapNormalRepeat": case "mapNormalOffset": case "mapNormalWrap": case "mapNormalAnisotropy": break; case "mapSpecular": w.specularMap = v(_, m.mapSpecularRepeat, m.mapSpecularOffset, m.mapSpecularWrap, m.mapSpecularAnisotropy); break; case "mapSpecularRepeat": case "mapSpecularOffset": case "mapSpecularWrap": case "mapSpecularAnisotropy": break; case "mapMetalness": w.metalnessMap = v(_, m.mapMetalnessRepeat, m.mapMetalnessOffset, m.mapMetalnessWrap, m.mapMetalnessAnisotropy); break; case "mapMetalnessRepeat": case "mapMetalnessOffset": case "mapMetalnessWrap": case "mapMetalnessAnisotropy": break; case "mapRoughness": w.roughnessMap = v(_, m.mapRoughnessRepeat, m.mapRoughnessOffset, m.mapRoughnessWrap, m.mapRoughnessAnisotropy); break; case "mapRoughnessRepeat": case "mapRoughnessOffset": case "mapRoughnessWrap": case "mapRoughnessAnisotropy": break; case "mapAlpha": w.alphaMap = v(_, m.mapAlphaRepeat, m.mapAlphaOffset, m.mapAlphaWrap, m.mapAlphaAnisotropy); break; case "mapAlphaRepeat": case "mapAlphaOffset": case "mapAlphaWrap": case "mapAlphaAnisotropy": break; case "flipSided": w.side = l.BackSide; break; case "doubleSided": w.side = l.DoubleSide; break; case "transparency": console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"), w.opacity = _; break; case "depthTest": case "depthWrite": case "colorWrite": case "opacity": case "reflectivity": case "transparent": case "visible": case "wireframe": w[S] = _; break; case "vertexColors": _ === !0 && (w.vertexColors = l.VertexColors), _ === "face" && (w.vertexColors = l.FaceColors); break; default: console.error("THREE.Loader.createMaterial: Unsupported", S, _); } } return w.type === "MeshBasicMaterial" && delete w.emissive, w.type !== "MeshPhongMaterial" && delete w.specular, 1 > w.opacity && (w.transparent = !0), p.setTextures(x), p.parse(w); }; }() }); }, /* 21 */ /***/ (o, s, c) => { var l = c(4); s.VideoHandler = function(u) { var d = this; this.video = void 0, this.videoTexture = void 0, this.setMorphTime = function(h, f) { var p = h / f * d.video.duration; d.video.currentTime = p; }, this.getVideoDuration = function() { return d.video.duration; }, this.createCanvasVideoTexture = function() { return d.videoTexture = new l.VideoTexture(d.video), d.videoTexture.minFilter = l.LinearFilter, d.videoTexture.magFilter = l.LinearFilter, d.videoTexture.format = l.RGBFormat, d.video.currentTime = 0, d.videoTexture; }, this.getCurrentTime = function(h) { return d.video ? h * (d.video.currentTime / d.video.duration) : 0; }, this.isReadyToPlay = function() { return !!(d.video && 3 <= d.video.readyState); }, function() { document && (d.video = document.createElement("video"), d.video.crossOrigin = "anonymous", d.video.src = u, d.video.load(), d.video.loop = !0); }(); }; }, /* 22 */ /***/ (o, s, c) => { var l = c(4), u = c(23).Points, d = c(5).toBufferGeometry, h = c(5).getCircularTexture, f = c(17).Label, p = function() { c(10).ZincObject.call(this), this.isPointset = !0; var m = []; this.createMesh = (g, v, x) => { if (g && v) { var w = d(g, x), S = h(); v.map = S; var _ = new u(w, v); this.setMesh(_, x.localTimeEnabled, x.localMorphColour); } }; var y = (g, v, x, w) => { if (x) { var S = new l.Color(w), _ = new f(x, S); _.setPosition(v[0], v[1], v[2]); var b = _.getSprite(); b.material.sizeAttenuation = !1, b.material.alphaTest = 0.5, b.material.transparent = !0, b.material.depthWrite = !1, b.material.depthTest = !1, this.group.add(b), m[g] = _; } }; this.addPoints = (g, v, x) => { if (g && 0 < g.length) { var w = this.drawRange - 1, S = this.addVertices(g), _ = this.getMorph(); if (!_) { var b = new l.PointsMaterial({ alphaTest: 0.5, size: 10, color: x, sizeAttenuation: !1 }); S.colorsNeedUpdate = !0, this.createMesh(S, b, { localTimeEnabled: !1, localMorphColour: !1 }); } var T = w + g.length, E = 0; if (Array.isArray(v) && v.length === g.length || typeof v == "string") for (w; w + E < T; ) { var C = typeof v == "string" ? v : v[E]; y(E, g[E], C, x), E++; } this.region && (this.region.pickableUpdateRequired = !0); } }, this.setSize = (g) => { this.morph && this.morph.material && (this.morph.material.size = g, this.morph.material.needsUpdate = !0); }, this.setSizeAttenuation = (g) => { this.morph && this.morph.material && (this.morph.material.sizeAttenuation = g, this.morph.material.needsUpdate = !0); }, this.getVerticesByIndex = function(g) { if (0 <= g && this.drawRange > g) { var v = this.getMorph().geometry.getAttribute("position"); return [v.getX(g), v.getY(g), v.getZ(g)]; } }, this.editVertices = function(g, v) { if (g && g.length) { var x = this.getMorph(), w = v + g.length - 1; if (!x || 0 > v || w >= this.drawRange) return; var S = x.geometry.getAttribute("position"), _ = v; g.forEach((b) => { var T = m[_]; T && T.setPosition(b[0], b[1], b[2]), S.setXYZ(_++, b[0], b[1], b[2]); }), S.needsUpdate = !0, this.boundingBoxUpdateRequired = !0; } }, this.render = (g, v, x, w) => { this.morph && x && (this.morph.sizePerPixel = x.pixelHeight), p.prototype.render.call(this, g, v, x, w); }; }; p.prototype = Object.create(c(10).ZincObject.prototype), s.Pointset = p; }, /* 23 */ /***/ (o, s, c) => { c.r(s), c.d(s, { /* harmony export */ Points: () => ( /* binding */ y ) /* harmony export */ }); var l = c(4), u = /* @__PURE__ */ new l.Matrix4(), d = /* @__PURE__ */ new l.Ray(), h = /* @__PURE__ */ new l.Sphere(), f = /* @__PURE__ */ new l.Vector3(), p = /* @__PURE__ */ new l.Vector3(), m = /* @__PURE__ */ new l.Vector3(); class y extends l.Object3D { constructor() { var w = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : new l.BufferGeometry(), S = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : new l.PointsMaterial(); super(), this.type = "Points", this.geometry = w, this.material = S, this.sizePerPixel = 1, this.updateMorphTargets(); } copy(w) { return super.copy(w), this.material = w.material, this.geometry = w.geometry, this; } raycast(w, S) { var _ = this.geometry, b = this.matrixWorld, T = w.params.Points.threshold, E = _.drawRange; if (_.boundingSphere === null && _.computeBoundingSphere(), h.copy(_.boundingSphere), h.applyMatrix4(b), h.radius += T, w.ray.intersectsSphere(h) !== !1) { u.copy(b).invert(), d.copy(w.ray).applyMatrix4(u); var C = T / ((this.scale.x + this.scale.y + this.scale.z) / 3) * this.material.size * this.sizePerPixel, L = C * C; if (_.isBufferGeometry) { var A = _.index, k = _.attributes, P = k.position, R = _.morphAttributes.position; if (A !== null) for (var M, O = Math.max(0, E.start), D = Math.min(A.count, E.start + E.count), I = O; I < D; I++) M = A.getX(I), v(this, P, R, M), g(f, M, L, b, w, S, this); else for (var F = Math.max(0, E.start), z = Math.min(P.count, E.start + E.count), U = F; U < z; U++) v(this, P, R, U), g(f, U, L, b, w, S, this); } else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); } } updateMorphTargets() { var w = this.geometry; if (w.isBufferGeometry) { var S = w.morphAttributes, _ = Object.keys(S); if (0 < _.length) { var b = S[_[0]]; if (b !== void 0) { this.morphTargetInfluences = [], this.morphTargetDictionary = {}; for (var T, E = 0, C = b.length; E < C; E++) T = b[E].name || E + "", this.morphTargetInfluences.push(0), this.morphTargetDictionary[T] = E; } } } else { var L = w.morphTargets; L !== void 0 && 0 < L.length && console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead."); } } } y.prototype.isPoints = !0; function g(x, w, S, _, b, T, E) { var C = d.distanceSqToPoint(x); if (C < S) { var L = new l.Vector3(); d.closestPointToPoint(x, L), L.applyMatrix4(_); var A = b.ray.origin.distanceTo(L); if (A < b.near || A > b.far) return; T.push({ distance: A, distanceToRay: Math.sqrt(C), point: L, index: w, face: null, object: E }); } } function v(x, w, S, _) { f.fromBufferAttribute(w, _); var b = x.morphTargetInfluences; if (x.material.morphTargets && S && b) { p.set(0, 0, 0); for (var T = 0, E = S.length; T < E; T++) { var C = b[T], L = S[T]; C !== 0 && (m.fromBufferAttribute(L, _), p.addScaledVector(m.sub(f), C)); } f.add(p); } } }, /* 24 */ /***/ (o, s, c) => { var l = c(4), u = c(5).toBufferGeometry, d = function() { c(10).ZincObject.call(this), this.isLines = !0, this.createLineSegment = (h, f, p) => { if (h && f) { var m = u(h, p); p.localMorphColour && m.morphAttributes.color && (f.onBeforeCompile = c(9).augmentMorphColor()); var y = new (c(12)).LineSegments(m, f); this.setMesh(y, p.localTimeEnabled, p.localMorphColour); } }, this.setWidth = (h) => { this.morph && this.morph.material && (this.morph.material.linewidth = h, this.morph.material.needsUpdate = !0); }, this.addLines = (h, f) => { if (h && 0 < h.length) { var p = this.addVertices(h), m = this.getMorph(); if (!m) { var y = new l.LineBasicMaterial({ color: f }); p.colorsNeedUpdate = !0, this.createLineSegment(p, y, { localTimeEnabled: !1, localMorphColour: !1 }); } this.region && (this.region.pickableUpdateRequired = !0); } }; }; d.prototype = Object.create(c(10).ZincObject.prototype), s.Lines = d; }, /* 25 */ /***/ (o, s, c) => { function l(f, p, m, y, g, v, x) { try { var w = f[v](x), S = w.value; } catch (_) { return void m(_); } w.done ? p(S) : Promise.resolve(S).then(y, g); } function u(f) { return function() { var p = this, m = arguments; return new Promise(function(y, g) { function v(S) { l(w, y, g, v, x, "next", S); } function x(S) { l(w, y, g, v, x, "throw", S); } var w = f.apply(p, m); v(void 0); }); }; } var d = c(4), h = function() { var f = this; c(26).Texture.call(this), this.isTextureArray = !0, this.loadFromImages = /* @__PURE__ */ function() { var p = u(function* (m) { var y = 1, g = 1, v = 0; if (m && m.length) { f.isLoading = !0; var x = new Image(); x.crossOrigin = "Anonymous"; for (var w, S = document.createElement("canvas"), _ = 0, b = Array(m.length), T = 0; T < m.length; T++) w = yield f.imageToUint8Array(f, x, m[T], S), w && w.array && (y = w.width, g = w.height, b[v] = w.array, _ += b[v].length, v++); var E = new Uint8Array(_); _ = 0, b.forEach((C) => { E.set(C, _), _ += C.length; }), f.impl = new d.DataTexture2DArray(E, y, g, v), f.size = { width: y, height: g, depth: v }, f.isLoading = !1, f.impl.needsUpdate = !0; } }); return function() { return p.apply(this, arguments); }; }(), this.getMaterial = (p) => { if (this.impl) { var m; if (!p) m = new d.MeshBasicMaterial({ color: new d.Color(1, 1, 1), transparent: !1, opacity: 1, map: this.impl, side: d.DoubleSide }); else if (p.vs && p.fs) { var y = !0; p.transparent && (y = p.transparent); var g = d.FrontSide; p.side && (g = p.side), m = new d.ShaderMaterial({ transparent: y, uniforms: p.uniforms, vertexShader: p.vs, fragmentShader: p.fs, side: g }), p.glslVersion && (m.glslVersion = p.glslVersion); } if (m) return m.needsUpdate = !0, m; } }; }; h.prototype = Object.create(c(26).Texture.prototype), s.TextureArray = h; }, /* 26 */ /***/ (o, s, c) => { function l(f, p, m, y, g, v, x) { try { var w = f[v](x), S = w.value; } catch (_) { return void m(_); } w.done ? p(S) : Promise.resolve(S).then(y, g); } function u(f) { return function() { var p = this, m = arguments; return new Promise(function(y, g) { function v(S) { l(w, y, g, v, x, "next", S); } function x(S) { l(w, y, g, v, x, "throw", S); } var w = f.apply(p, m); v(void 0); }); }; } var d = c(4), h = function() { this.isTexture = !0, this.impl = void 0, this.isLoading = !1, this.size = { width: 1, height: 1, depth: 0 }; }; h.prototype.loadImage = function(f, p) { return new Promise((m, y) => { f.onload = () => m(f), f.onerror = y, f.src = p; }); }, h.prototype.imageToUint8Array = /* @__PURE__ */ function() { var f = u(function* (p, m, y, g) { yield p.loadImage(m, y), g.width = m.width, g.height = m.height; var v = g.getContext("2d"); return v.drawImage(m, 0, 0), { array: new Uint8Array(v.getImageData(0, 0, g.width, g.height).data.buffer), width: g.width, height: g.height }; }); return function() { return f.apply(this, arguments); }; }(), h.prototype.loadFromImages = /* @__PURE__ */ function() { var f = u(function* () { }); return function() { return f.apply(this, arguments); }; }(), h.prototype.isReady = function() { return !(!this.impl || this.isLoading); }, h.prototype.getMaterial = function() { if (this.impl) return new d.MeshBasicMaterial({ color: new d.Color(1, 1, 1), transparent: !1, opacity: 1, map: this.impl, side: d.DoubleSide }); }, s.Texture = h; }, /* 27 */ /***/ (o, s, c) => { function l(g, v) { var x = Object.keys(g); if (Object.getOwnPropertySymbols) { var w = Object.getOwnPropertySymbols(g); v && (w = w.filter(function(S) { return Object.getOwnPropertyDescriptor(g, S).enumerable; })), x.push.apply(x, w); } return x; } function u(g) { for (var v, x = 1; x < arguments.length; x++) v = arguments[x] == null ? {} : arguments[x], x % 2 ? l(Object(v), !0).forEach(function(w) { d(g, w, v[w]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(g, Object.getOwnPropertyDescriptors(v)) : l(Object(v)).forEach(function(w) { Object.defineProperty(g, w, Object.getOwnPropertyDescriptor(v, w)); }); return g; } function d(g, v, x) { return v = h(v), v in g ? Object.defineProperty(g, v, { value: x, enumerable: !0, configurable: !0, writable: !0 }) : g[v] = x, g; } function h(g) { var v = f(g, "string"); return typeof v == "symbol" ? v : v + ""; } function f(g, v) { if (typeof g != "object" || !g) return g; var x = g[Symbol.toPrimitive]; if (x !== void 0) { var w = x.call(g, v || "default"); if (typeof w != "object") return w; throw new TypeError("@@toPrimitive must return a primitive value."); } return (v === "string" ? String : Number)(g); } var p = c(4), m = c(28), y = function(g) { c(29).TexturePrimitive.call(this, g), this.isTextureSlides = !0; var v = [], x = {}; this.morph = new p.Group(), this.group = this.morph, this.morph.userData = this; var w = !0; this.createSlides = (b) => { b.forEach((T) => this.createSlide(T)); }; var S = (b, T) => { var E = b.material, C = E.uniforms; switch (b.rotation.x = 0, b.rotation.y = 0, b.rotation.z = 0, b.position.x = 0, b.position.y = 0, b.position.z = 0, T.direction) { case "x": var L = w ? -Math.PI / 2 : Math.PI / 2; b.rotation.y = L, C.direction.value = 1, C.slide.value.set(T.value, 0, 0), b.position.x = T.value; break; case "y": b.rotation.x = Math.PI / 2, C.direction.value = 2, C.slide.value.set(0, T.value, 0), b.position.y = T.value; break; case "z": C.direction.value = 3, C.slide.value.set(0, 0, T.value), b.position.z = T.value; break; } E.needsUpdate = !0, this.boundingBoxUpdateRequired = !0; }; this.modifySlideSettings = (b) => { b && b.id && b.id in x && x[b.id] && S(x[b.id], b); }, this.createSlide = (b) => { if (this.texture && this.texture.isTextureArray && this.texture.isReady() && b && b.direction && b.value !== void 0) { var T = new p.PlaneGeometry(1, 1); T.translate(0.5, 0.5, 0); var E = m.getUniforms(); E.diffuse.value = this.texture.impl, E.depth.value = this.texture.size.depth, E.flipY.value = w; var C = { fs: m.fs, vs: m.vs, uniforms: E, glslVersion: m.glslVersion, side: p.DoubleSide, transparent: !1 }, L = this.texture.getMaterial(C); L.needsUpdate = !0; var A = new p.Mesh(T, L); A.name = this.groupName, A.userData = this; var k = { value: b.value, direction: b.direction, id: A.id }; return v.push(k), S(A, k), x[A.id] = A, this.morph.add(A), this.boundingBoxUpdateRequired = !0, k; } }, this.getTextureSettings = () => [...v], this.getTextureSettingsWithId = (b) => { for (var T = 0; T < v.length; T++) if (b === v[T].id) return u({}, v[T]); }, this.getSlides = () => this.morph ? [...this.morph.children] : [], this.removeSlide = (b) => { b && this.removeSlideWithId(b.id); }, this.removeSlideWithId = (b) => { if (this.morph && b in x && x[b]) { if (this.morph.getObjectById(b)) { var T = x[b]; this.morph.remove(T), T.clear(), T.geometry && T.geometry.dispose(), T.material && T.material.dispose(), this.boundingBoxUpdateRequired = !0; } var E = v.findIndex((C) => C.id === b); -1 < E && v.splice(E, 1); } }, this.dispose = () => { this.morph.children.forEach((b) => { b.geometry && b.geometry.dispose(), b.material && b.material.dispose(); }), c(29).TexturePrimitive.prototype.dispose.call(this), this.boundingBoxUpdateRequired = !0; }; var _ = (b, T, E) => { switch (T.direction.value) { case 1: E.copy(T.slide.value), b.expandByPoint(E), E.setY(1), E.setZ(1), b.expandByPoint(E); break; case 2: E.copy(T.slide.value), b.expandByPoint(E), E.setX(1), E.setZ(1), b.expandByPoint(E); break; case 3: E.copy(T.slide.value), b.expandByPoint(E), E.setX(1), E.setY(1), b.expandByPoint(E); break; } }; this.getBoundingBox = () => { if (this.morph && this.morph.children && this.morph.visible && this.boundingBoxUpdateRequired) { this.cachedBoundingBox.makeEmpty(); var b = new p.Vector3(0, 0, 0); this.morph.children.forEach((T) => { _(this.cachedBoundingBox, T.material.uniforms, b); }), this.morph.updateMatrixWorld(!0, !0), this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld), this.boundingBoxUpdateRequired = !1; } return this.cachedBoundingBox; }, this.applyTransformation = (b, T, E) => { var C = new p.Matrix4(); C.set(b[0], b[1], b[2], 0, b[3], b[4], b[5], 0, b[6], b[7], b[8], 0, 0, 0, 0, 0); var L = new p.Quaternion().setFromRotationMatrix(C); this.morph.position.set(...T), this.morph.quaternion.copy(L), this.morph.scale.set(...E), this.morph.updateMatrix(), this.boundingBoxUpdateRequired = !0; }, this.initialise = (b, T) => { if (b) { var E = b.locations; E && 0 < E.length && (this.applyTransformation(E[0].orientation, E[0].position, E[0].scale), "flipY" in E[0] && (w = E[0].flipY)), this.createSlides(b.settings.slides), T != null && typeof T == "function" && T(this); } }; }; y.prototype = Object.create(c(29).TexturePrimitive.prototype), y.prototype.constructor = y, s.TextureSlides = y; }, /* 28 */ /***/ (o, s, c) => { var l = c(4), u = l.GLSL3, d = ` precision highp float; precision highp int; precision highp sampler2DArray; uniform sampler2DArray diffuse; in vec3 vUw; out vec4 outColor; void main() { vec4 color = texture( diffuse, vUw ); // lighten a bit outColor = vec4( color.rgb + .2, 1.0 ); } `, h = ` out vec3 vUw; uniform float depth; uniform vec3 slide; uniform int direction; uniform bool flipY; void main() { vec3 slidePos = position.xyz; gl_Position = projectionMatrix * modelViewMatrix * vec4( position.xyz, 1.0 ); if (direction == 1) slidePos = vec3(slide.x, position.y, position.x); if (direction == 2) slidePos = vec3(position.x, slide.y, position.y); if (direction == 3) slidePos = vec3(position.x, position.y, slide.z); if (flipY) slidePos.y = 1.0 - slidePos.y; vUw.xyz = vec3(slidePos.x, slidePos.y, slidePos.z * depth); } `, f = function() { return { diffuse: { value: void 0 }, depth: { value: 1 }, slide: { value: new l.Vector3(0, 0, 1) }, direction: { value: 1 }, flipY: { value: !0 } }; }; s.fs = d, s.vs = h, s.glslVersion = u, s.getUniforms = f; }, /* 29 */ /***/ (o, s, c) => { c(4); var l = c(5).resolveURL, u = function(d) { c(10).ZincObject.call(this), this.isTexturePrimitive = !0, this.texture = d, this.load = (h, f) => { if (h && h.images && h.images.source) { var p = new (c(25)).TextureArray(), m = []; h.images.source.forEach((g) => { m.push(l(g)); }); var y = this; p.loadFromImages(m).then(() => { y.texture = p, y.initialise(h, f); }); } }, this.initialise = (h, f) => { f != null && typeof f == "function" && f(this); }; }; u.prototype = Object.create(c(10).ZincObject.prototype), u.prototype.constructor = u, s.TexturePrimitive = u; }, /* 30 */ /***/ (o, s, c) => { var l = c(4), u = c(31); s.Renderer = function(d, h) { var f = d, p = h, m = void 0, y = new l.Clock(!1); this.playAnimation = !0; var g = 1e3, v = [], x = 0, w = [], S = 0, _ = void 0, b = void 0, T = void 0, E = void 0, C = [], L = [], A = new l.Group(), k = void 0, P = void 0, R = !1; this.getDrawingWidth = () => f ? f.clientWidth : k ? typeof k.clientWidth > "u" ? Math.round(k.width) : Math.round(k.clientWidth) : 0, this.getDrawingHeight = () => f ? f.clientHeight : k ? typeof k.clientHeight > "u" ? Math.round(k.height) : Math.round(k.clientHeight) : 0, this.onWindowResize = () => { m.onWindowResize(); var D = this.getDrawingWidth(), I = this.getDrawingHeight(); if (p != null) { var F; f ? (F = f.getBoundingClientRect(), p.setSize(D, I)) : k && (typeof k.getBoundingClientRect > "u" || (F = k.getBoundingClientRect(), k.width = D, k.height = I), p.setSize(D, I, !1)), F && (F.left, F.top); var z = new l.Vector2(); p.getSize(z), z.x, z.y, console.log("onWindowResize"); } }, this.initialiseVisualisation = (D) => { if (D = D || {}, D.antialias === void 0) { var I = !1; try { /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) && (I = !0); } catch { I = !1; } D.antialias = !I; } D.canvas && (f = void 0, k = D.canvas), p = new l.WebGLRenderer(D), f !== void 0 && f.appendChild(p.domElement), p.setClearColor(16777215, 1), k && k.style && (k.style.height = "100%", k.style.width = "100%"), p.autoClear = !1; var F = this.createScene("default"); this.setCurrentScene(F); }, this.getCurrentScene = () => m, this.setCurrentScene = (D) => { if (D) { this.removeActiveScene(D); var I = m; m = D, I && I.setInteractiveControlEnable(!1), m.setInteractiveControlEnable(!0), m.setAdditionalScenesGroup(A), this.onWindowResize(); } }, this.getSceneByName = (D) => C[D], this.createScene = (D) => { if (C[D] == null) { var I; return I = k ? new (c(32)).Scene(k, p) : new (c(32)).Scene(f, p), C[D] = I, I.sceneName = D, I; } }, this.resetView = () => { m.resetView(); }, this.viewAll = () => { if (m) { var D = m.getBoundingBox(); if (D) { for (var I, F = 0; F < L.length; F++) I = L[F].getBoundingBox(), I && D.union(I); m.viewAllWithBoundingBox(D); } } }, this.loadModelsURL = (D, I, F, z, U, Z) => { m.loadModelsURL(D, I, F, z, U, Z); }, this.loadViewURL = (D) => { m.loadViewURL(D); }, this.loadFromViewURL = (D, I) => { m.loadFromViewURL(D, I); }, this.updateDirectionalLight = () => { m.updateDirectionalLight(); }; var M = () => { R ? (_ = requestAnimationFrame(M), this.render()) : (cancelAnimationFrame(_), _ = void 0); }; this.stopAnimate = () => { R && (y.stop(), R = !1); }, this.animate = () => { R || (y.start(), R = !0, M()); }, this.addPreRenderCallbackFunction = (D) => (++x, v[x] = D, x), this.removePreRenderCallbackFunction = (D) => { D in v && delete v[D]; }, this.addPostRenderCallbackFunction = (D) => (++S, w[S] = D, S), this.removePostRenderCallbackFunction = (D) => { D in w && delete w[D]; }, this.getPlayRate = () => g, this.setPlayRate = (D) => { g = D; }, this.getCurrentTime = () => m.getCurrentTime(), this.setMorphsTime = (D) => { m.setMorphsTime(D); }, this.getZincGeometryByID = (D) => m.getZincGeometryByID(D), this.addToScene = (D) => { m.addObject(D); }, this.addToOrthoScene = (D) => { if (T == null && (T = new l.Scene()), b == null) { var I = this.getDrawingWidth(), F = this.getDrawingHeight(); b = new l.OrthographicCamera(-I / 2, I / 2, F / 2, -F / 2, 1, 10), b.position.z = 10; } T.add(D); }; var O = (D) => (I) => { I.needsUpdate = !0; var F = new l.SpriteMaterial({ map: I }), z = F.map.image.width, U = F.map.image.height; D.material = F, D.scale.set(z, U, 1); var Z = this.getDrawingWidth(), re = this.getDrawingHeight(); D.position.set((Z - z) / 2, (-re + U) / 2, 1), this.addToOrthoScene(D); }; this.addLogo = () => { E = new l.Sprite(), l.ImageUtils.loadTexture("images/abi_big_logo_transparent_small.png", void 0, O(E)); }, this.render = () => { P || (f ? 0 < f.clientWidth && 0 < f.clientHeight && (P = new u(f, this.onWindowResize)) : k && 0 < k.width && 0 < k.height && (P = new u(k, this.onWindowResize))); var D = y.getDelta(); m.renderGeometries(g, D, this.playAnimation); for (var I, F = 0; F < L.length; F++) I = L[F], I.renderGeometries(g, D, this.playAnimation); for (var z in b != null && T != null && (p.clearDepth(), p.render(T, b)), v) v.hasOwnProperty(z) && v[z].call(); for (var U in m.render(p), w) w.hasOwnProperty(U) && w[U].call(); }, this.getThreeJSRenderer = () => p, this.isSceneActive = (D) => { if (m === D) return !0; for (var I, F = 0; F < L.length; F++) if (I = L[F], I === D) return !0; return !1; }, this.addActiveScene = (D) => { this.isSceneActive(D) || (L.push(D), A.add(D.getThreeJSScene())); }, this.removeActiveScene = (D) => { for (var I, F = 0; F < L.length; F++) if (I = L[F], I === D) return L.splice(F, 1), void A.remove(D.getThreeJSScene()); }, this.clearAllActiveScene = () => { for (var D = 0; D < L.length; D++) A.remove(L[D].getThreeJSScene()); L.splice(0, L.length); }, this.dispose = () => { for (var D in R && cancelAnimationFrame(_), C) C.hasOwnProperty(D) && C[D].clearAll(); C = [], L = [], A = new l.Group(), this.stopAnimate(), v = [], x = 0, b = void 0, T = void 0, E = void 0; var I = this.createScene("default"); this.setCurrentScene(I), P = void 0; }, this.transitionScene = (D, I) => { if (m) { var F = m.getZincCameraControls(), z = D.getBoundingBox(); if (z) { var U = z.min.distanceTo(z.max) / 2, Z = (z.min.x + z.max.x) / 2, re = (z.min.y + z.max.y) / 2, K = (z.min.z + z.max.z) / 2, V = F.getViewportFromCentreAndRadius(Z, re, K, U, 40, U * 4), H = F.getCurrentViewport(); F.cameraTransition(H, V, I), F.enableCameraTransition(); } } }, this.isWebGL2 = () => !!p && p.capabilities.isWebGL2; }; }, /* 31 */ /***/ (o) => { o.exports = _pe(); }, /* 32 */ /***/ (o, s, c) => { var l = c(4), u = c(33).MarkerCluster, d = c(35).SceneLoader, h = c(41).SceneExporter, f = c(43).Viewport, p = c(5).createBufferGeometry, m = c(5).getCircularTexture, y = 0, g = function() { return "sc" + y++; }, v = function() { return { Duration: "6 secs", OriginalDuration: "-", TimeStamps: {} }; }, x = 6e3; s.Scene = function(w, S) { var _ = this, b = w, T = void 0, E = new d(this), C = void 0, L = {}, A = 0, k = {}, P = 0, R = new l.Scene(), M = new (c(44)).Region(void 0, this); R.add(M.getGroup()); var O = new l.Group(); R.add(O), this.directionalLight = void 0, this.ambient = void 0, this.camera = void 0; var D = 6e3, I = void 0; this.sceneName = void 0; var F = !1, z = void 0; this.autoClearFlag = !0, this.displayMarkers = !1, this.displayMinimap = !1, this.minimapScissor = { x_offset: 16, y_offset: 16, width: 128, height: 128, align: "top-left", updateRequired: !0 }; var U = { x: 0, y: 0 }, Z = v(), re = new l.Vector2(), K = []; this.forcePickableObjectsUpdate = !1, this.uuid = g(); var V = new u(this); V.disable(), R.add(V.group); var H = () => b ? typeof b.clientWidth > "u" ? b.width : b.clientWidth : 0, G = () => b ? typeof b.clientHeight > "u" ? b.height : b.clientHeight : 0; this.getDownloadProgress = () => E.getDownloadProgress(), this.onWindowResize = () => { var $ = G(); this.camera.aspect = H() / $, this.camera.updateProjectionMatrix(), this.minimapScissor.updateRequired = !0, I.onResize(), I.calculateHeightPerPixelAtZeroDepth($); }, this.resetView = () => { this.onWindowResize(), I.resetView(); }, this.changeZoomByScrollRateUnit = ($) => { I.changeZoomByScrollRateUnit($); }; var W = () => { this.camera = new l.PerspectiveCamera(40, H() / G(), 0, 10), this.ambient = new l.AmbientLight(16777215, 0.2), R.add(this.ambient), this.directionalLight = new l.DirectionalLight(16777215, 0.8), R.add(this.directionalLight), I = new (c(43)).CameraControls(this.camera, S.domElement, S, this), I.setDirectionalLight(this.directionalLight), I.resetView(), C = new (c(49)).Minimap(this); }; W(), this.loadView = ($) => { var J = new f(); return J.setFromObject($), I.setCurrentCameraSettings(J), !0; }, this.setupMultipleViews = ($, J) => { for (var [ne, j] of Object.entries(J)) { var q = new f(); q.setFromObject(j), I.addViewport(ne, q); } I.setDefaultViewport($); }, this.getBoundingBox = () => M.getBoundingBox(!0), this.viewAllWithBoundingBox = ($) => { if ($) { var J = I.getViewportFromBoundingBox($, 1); I.setCurrentCameraSettings(J), I.calculateHeightPerPixelAtZeroDepth(G()), V.markerUpdateRequired = !0; } }, this.viewAll = () => { var $ = this.getBoundingBox(); this.viewAllWithBoundingBox($), V.markerUpdateRequired = !0; }, this.forEachGeometry = ($) => { M.forEachGeometry($, !0); }, this.forEachGlyphset = ($) => { M.forEachGlyphset($, !0); }, this.forEachPointset = ($) => { M.forEachPointset($, !0); }, this.forEachLine = ($) => { M.forEachLine($, !0); }, this.findGeometriesWithGroupName = ($) => M.findGeometriesWithGroupName($, !0), this.findPointsetsWithGroupName = ($) => M.findPointsetsWithGroupName($, !0), this.findGlyphsetsWithGroupName = ($) => M.findGlyphsetsWithGroupName($, !0), this.findLinesWithGroupName = ($) => M.findLinesWithGroupName($, !0), this.findObjectsWithGroupName = ($) => M.findObjectsWithGroupName($, !0), this.findObjectsWithAnatomicalId = ($) => M.findObjectsWithAnatomicalId($, !0), this.getBoundingBoxOfZincObjects = ($) => { for (var J, ne = void 0, j = 0; j < $.length; j++) J = $[j].getBoundingBox(), J && (ne ? ne.union(J) : ne = J); return ne; }, this.vectorToScreenXY = ($) => { $.project(this.camera); var J = H(), ne = G(), j = J / 2, q = ne / 2; return $.x = $.x * j + j, $.y = -($.y * q) + q, $; }, this.getObjectsScreenXY = ($) => { if ($ && 0 < $.length) { var J = this.getBoundingBoxOfZincObjects($), ne = new l.Vector3(); return J.getCenter(ne), this.vectorToScreenXY(ne); } }, this.getNamedObjectsScreenXY = ($) => { var J = this.findObjectsWithGroupName($); return this.getObjectsScreenXY(J); }, this.addZincObject = ($) => { $ && (M.addZincObject($), I && I.calculateMaxAllowedDistance(this)); }, this.loadGlyphsetURL = ($, J, ne, j) => { E.loadGlyphsetURL(M, $, J, ne, j); }, this.loadPointsetURL = ($, J, ne, j, q) => { E.loadPointsetURL(M, $, J, ne, j, q); }, this.loadLinesURL = ($, J, ne, j, q) => { E.loadLinesURL(M, $, J, ne, j, q); }, this.loadSTL = ($, J, ne) => { E.loadSTL(M, $, J, ne); }, this.loadOBJ = ($, J, ne) => { E.loadOBJ(M, $, J, ne); }, this.loadMetadataURL = ($, J, ne) => { E.loadMetadataURL(M, $, J, ne); }, this.loadModelsURL = ($, J, ne, j, q, ge) => { E.loadModelsURL(M.urls, J, ne, j, q, ge); }, this.loadViewURL = ($) => { E.loadViewURL($); }, this.loadFromViewURL = ($, J) => { E.loadFromViewURL($, J); }, this.loadGLTF = ($, J, ne, j) => { E.loadGLTF(M, $, J, ne, j); }, this.updateDirectionalLight = () => { I.updateDirectionalLight(); }, this.addObject = ($) => { R.add($); }, this.removeObject = ($) => { R.remove($); }, this.getCurrentTime = () => { if (T != null) return T.getCurrentTime(D); var $ = M.getCurrentTime(); return $ === -1 ? 0 : $; }, this.setMorphsTime = ($) => { T != null && T.setMorphTime($, D), M.setMorphTime($, !0); }, this.isTimeVarying = () => !!(T && T.video && !T.video.error) || M.isTimeVarying(), this.renderGeometries = ($, J, ne) => { var j = {}; if (j.camera = I, j.displayMarkers = this.displayMarkers, j.markerCluster = V, j.markersList = V.markers, j.ndcToBeUpdated = !1, ne && (j.markerCluster.markerUpdateRequired = !0), !T) E.toBeDownloaded == 0 ? (j.ndcToBeUpdated = I.update(J), j.ndcToBeUpdated && I.calculateHeightPerPixelAtZeroDepth(G()), M.renderGeometries($, J, ne, I, j, !0)) : I.update(0); else if (T.isReadyToPlay()) { ne ? T.video.play() : T.video.pause(); var q = T.video.currentTime / T.getVideoDuration() * D; E.toBeDownloaded == 0 ? (I.setTime(q), j.ndcToBeUpdated = I.update(0), j.ndcToBeUpdated && I.calculateHeightPerPixelAtZeroDepth(G()), M.setMorphTime(q, !0), M.renderGeometries(0, 0, ne, I, j, !0)) : I.update(0); } else myPlayRate = 0; }, this.getThreeJSScene = () => R, this.setVideoHandler = ($) => { T || (T = $); }, this.setAdditionalScenesGroup = ($) => { R.add($); }; var Y = ($, J, ne, j, q, ge, ye) => { var _e = 0, Me = 0; return Me = $.includes("top") ? ye - q - ne : $.includes("bottom") ? ne : Math.floor((ye - q) / 2), _e = $.includes("left") ? J : $.includes("right") ? ge - J - j : Math.floor((ge - j) / 2), { x: _e, y: Me }; }, X = ($) => { this.displayMinimap === !0 && ($.setScissorTest(!0), $.getSize(re), this.minimapScissor.updateRequired && (U = Y(this.minimapScissor.align, this.minimapScissor.x_offset, this.minimapScissor.y_offset, this.minimapScissor.width, this.minimapScissor.height, re.x, re.y), this.minimapScissor.updateRequired = !1), $.setScissor(U.x, U.y, this.minimapScissor.width, this.minimapScissor.height), $.setViewport(U.x, U.y, this.minimapScissor.width, this.minimapScissor.height), C.updateCamera(), R.add(C.mask), $.render(R, C.camera), R.remove(C.mask), $.setScissorTest(!1), $.setViewport(0, 0, re.x, re.y)); }; this.render = ($) => { this.autoClearFlag && $.clear(), F && z ? z.render(R, this.camera) : ($.render(R, this.camera), X($)); }, this.setInteractiveControlEnable = ($) => { $ == !0 ? I.enable() : I.disable(); }, this.getZincCameraControls = () => I, this.getThreeJSScene = () => R, this.setDuration = ($) => { M.setDuration($), D = $, I.setPathDuration($), E.duration = $; }, this.getDuration = () => D, this.setStereoEffectEnable = ($) => { $ != !0 || z || (z = new c(43).StereoEffect(S)), S.setSize(H(), G()), this.camera.updateProjectionMatrix(), F = $; }, this.objectIsInScene = ($) => M.objectIsInRegion($, !0), this.alignBoundingBoxToCameraView = ($, J) => { if ($) { var ne = new l.Vector3(); $.getCenter(ne); var j = this.getZincCameraControls().getCurrentViewport(), q = new l.Vector3(j.targetPosition[0], j.targetPosition[1], j.targetPosition[2]), ge = new l.Vector3(j.eyePosition[0], j.eyePosition[1], j.eyePosition[2]), ye = new l.Vector3(), _e = new l.Vector3(); ye.subVectors(q, ge).normalize(), _e.subVectors(q, ne).normalize(); var Me = new l.Vector3(); Me.crossVectors(ye, _e); var Ce = ye.angleTo(_e); 0 < J ? (this.getZincCameraControls().rotateCameraTransition(Me, Ce, J), this.getZincCameraControls().enableCameraTransition()) : this.getZincCameraControls().rotateAboutLookAtpoint(Me, Ce), V.markerUpdateRequired = !0; } }, this.translateBoundingBoxToCameraView = ($, J, ne) => { if ($) { var j = this.getZincCameraControls().getCurrentViewport(), q = this.getZincCameraControls().getViewportFromBoundingBox($, J); 0 < ne && (this.getZincCameraControls().cameraTransition(j, q, ne), this.getZincCameraControls().enableCameraTransition()), V.markerUpdateRequired = !0; } }, this.alignObjectToCameraView = ($, J) => { if (this.objectIsInScene($)) { var ne = $.getBoundingBox(); this.alignBoundingBoxToCameraView(ne, J); } }, this.setCameraTargetToObject = ($) => { if (this.objectIsInScene($)) { var J = new l.Vector3(), ne = $.getBoundingBox(), j = this.getZincCameraControls().getCurrentViewport(); ne.getCenter(J); var q = new l.Vector3(j.targetPosition[0], j.targetPosition[1], j.targetPosition[2]), ge = new l.Vector3(j.eyePosition[0], j.eyePosition[1], j.eyePosition[2]), ye = new l.Vector3(), _e = new l.Vector3(); ye.subVectors(ge, q), _e.addVectors(J, ye), j.eyePosition[0] = _e.x, j.eyePosition[1] = _e.y, j.eyePosition[2] = _e.z, j.targetPosition[0] = J.x, j.targetPosition[1] = J.y, j.targetPosition[2] = J.z, this.getZincCameraControls().setCurrentCameraSettings(j), V.markerUpdateRequired = !0; } }, this.isStereoEffectEnable = () => F, this.removeZincObject = ($) => { M.removeZincObject($), I && I.calculateMaxAllowedDistance(this), V.markerUpdateRequired = !0; }, this.updatePickableThreeJSObjects = () => { K.length = 0, V.isEnabled && K.push(V.group), M.getPickableThreeJSObjects(K, !0), this.forcePickableObjectsUpdate = !1; }, this.getPickableThreeJSObjects = () => ((this.forcePickableObjectsUpdate || M.checkPickableUpdateRequred(!0)) && this.updatePickableThreeJSObjects(), K), this.getNormalisedMinimapCoordinates = ($, J) => { if (this.displayMinimap) { var ne = new l.Vector2(); $.getSize(ne); var j = ne.y - J.clientY; if (U.x + this.minimapScissor.width > J.clientX && J.clientX > U.x && U.y + this.minimapScissor.height > j && j > U.y) { var q = 2 * ((J.clientX - U.x) / this.minimapScissor.width) - 1, ge = 2 * ((j - U.y) / this.minimapScissor.height) - 1; return { x: q, y: ge }; } } }, this.getMinimapDiffFromNormalised = ($, J) => C ? C.getDiffFromNormalised($, J) : void 0, this.isWebGL2 = () => S.isWebGL2(), this.clearAll = () => { V.clear(), M.clear(!0), this.clearZincObjectAddedCallbacks(), this.clearZincObjectRemovedCallbacks(), E.toBeDwonloaded = 0, I && I.calculateMaxAllowedDistance(this), V.markerUpdateRequired = !0; }, this.addMetadataTimeStamp = ($, J) => { Z.TimeStamps[$] = ue(J); }, this.getMetadataTag = ($) => Z[$], this.getMetadata = () => Z, this.setMetadataTag = ($, J) => { Z[$] = J; }, this.removeMetadataTag = ($) => { delete Z[$]; }, this.resetMetadata = () => { Z = v(); }, this.resetDuration = () => { this.setDuration(x); }; var ie = ($) => [...$.years ? ["".concat($.years, "years")] : [], ...$.months ? ["".concat($.months, "months")] : [], ...$.weeks ? ["".concat($.weeks, "weeks")] : [], ...$.days ? ["".concat($.days, "days")] : [], ...$.hours ? ["".concat($.hours, "hours")] : [], ...$.mins ? ["".concat($.mins, "mins")] : [], ...$.secs ? ["".concat($.secs, "secs")] : []].join(" "), ue = ($) => $.years ? 31536e6 * $.years : 0 + $.months ? 2592e6 * $.months : 0 + $.weeks ? 6048e5 * $.weeks : 0 + $.days ? 864e5 * $.days : 0 + $.hours ? 36e5 * $.hours : 0 + $.mins ? 6e4 * $.mins : 0 + $.secs ? 1e3 * $.secs : 0; this.setDurationFromObject = ($) => { var J = ie($), ne = ue($); this.setMetadataTag("Duration", J), this.setDuration(ne); }, this.setOriginalDurationFromObject = ($) => { var J = ie($); this.setMetadataTag("OriginalDuration", J); }, this.exportGLTF = ($) => { var J = new h(this); return J.exportGLTF($); }, this.getRootRegion = () => M, this.createLines = ($, J, ne, j) => { var q = M.findChildFromPath($); return q === void 0 && (q = M.createChildFromPath($)), q.createLines(J, ne, j); }, this.createPoints = ($, J, ne, j, q) => { var ge = M.findChildFromPath($); return ge === void 0 && (ge = M.createChildFromPath($)), ge.createPoints(J, ne, j, q); }, this.addZincObjectAddedCallbacks = ($) => (++A, L[A] = $, A), this.addZincObjectRemovedCallbacks = ($) => (++P, k[P] = $, P), this.removeZincObjectAddedCallbacks = ($) => { $ in A && delete L[$]; }, this.removeZincObjectRemovedCallbacks = ($) => { $ in P && delete k[$]; }, this.clearZincObjectAddedCallbacks = () => { L = {}, A = 0; }, this.clearZincObjectRemovedCallbacks = () => { k = {}, P = 0; }, this.triggerObjectAddedCallback = ($) => { for (var J in L) L.hasOwnProperty(J) && L[J]($); }, this.triggerObjectRemovedCallback = ($) => { for (var J in k) k.hasOwnProperty(J) && k[J]($); }, this.addTemporaryPoints = ($, J) => { var ne = p($.length, $), j = new l.PointsMaterial({ alphaTest: 0.5, size: 15, color: J, sizeAttenuation: !1 }), q = m(); j.map = q; var ge = new (c(23)).Points(ne, j); return O.add(ge), ge; }, this.addTemporaryLines = ($, J) => { var ne = p($.length, $), j = new l.LineBasicMaterial({ color: J }), q = new (c(12)).LineSegments(ne, j); return O.add(q), q; }, this.removeTemporaryPrimitive = ($) => { O.remove($), $.geometry.dispose(), $.material.dispose(); }, this.clearTemporaryPrimitives = () => { var $ = 0, J = O.children; return J.forEach((ne) => { ne.geometry.dispose(), ne.material.dispose(), $++; }), O.clear(), $; }, this.addBoundingBoxPrimitive = function($, J, ne, j, q) { var ge = 5 < arguments.length && arguments[5] !== void 0 ? arguments[5] : void 0, ye = M.findChildFromPath($); ye === void 0 && (ye = M.createChildFromPath($)); var _e = ge || _.getBoundingBox(), Me = new l.Vector3().subVectors(_e.max, _e.min), Ce = new l.BoxGeometry(Me.x, Me.y, Me.z), B = ye.createGeometryFromThreeJSGeometry(J, Ce, ne, j, q, 1e4); return Me.addVectors(_e.min, _e.max).multiplyScalar(0.5), B.setPosition(Me.x, Me.y, Me.z), B; }, this.addSlicesPrimitive = function($, J, ne, j, q) { var ge = 5 < arguments.length && arguments[5] !== void 0 ? arguments[5] : void 0; if (J && 3 <= J.length && ne && 3 <= ne.length) { var ye = M.findChildFromPath($); ye === void 0 && (ye = M.createChildFromPath($)); var _e = ge || _.getBoundingBox(), Me = new l.Vector3().subVectors(_e.max, _e.min), Ce = [], B = 0; return ["x", "y", "z"].forEach((ce) => { var ve; switch (ce) { case "x": ve = new l.PlaneGeometry(Me.z, Me.y), ve.rotateY(Math.PI / 2); break; case "y": ve = new l.PlaneGeometry(Me.x, Me.z), ve.rotateX(Math.PI / 2); break; case "z": ve = new l.PlaneGeometry(Me.x, Me.y); break; } var te = ye.createGeometryFromThreeJSGeometry(J[B], ve, ne[B], j, q, 10001); Ce.push(te), B++; }), Me.addVectors(_e.min, _e.max).multiplyScalar(0.5), Ce.forEach((ce) => { ce.setPosition(Me.x, Me.y, Me.z); }), Ce; } }, this.enableMarkerCluster = ($) => { $ ? (V.markerUpdateRequired = !0, V.enable()) : (V.markerUpdateRequired = !1, V.disable()), this.forcePickableObjectsUpdate = !0; }; }; }, /* 33 */ /***/ (o, s, c) => { function l(S, _) { var b = Object.keys(S); if (Object.getOwnPropertySymbols) { var T = Object.getOwnPropertySymbols(S); _ && (T = T.filter(function(E) { return Object.getOwnPropertyDescriptor(S, E).enumerable; })), b.push.apply(b, T); } return b; } function u(S) { for (var _, b = 1; b < arguments.length; b++) _ = arguments[b] == null ? {} : arguments[b], b % 2 ? l(Object(_), !0).forEach(function(T) { d(S, T, _[T]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(S, Object.getOwnPropertyDescriptors(_)) : l(Object(_)).forEach(function(T) { Object.defineProperty(S, T, Object.getOwnPropertyDescriptor(_, T)); }); return S; } function d(S, _, b) { return _ = h(_), _ in S ? Object.defineProperty(S, _, { value: b, enumerable: !0, configurable: !0, writable: !0 }) : S[_] = b, S; } function h(S) { var _ = f(S, "string"); return typeof _ == "symbol" ? _ : _ + ""; } function f(S, _) { if (typeof S != "object" || !S) return S; var b = S[Symbol.toPrimitive]; if (b !== void 0) { var T = b.call(S, _ || "default"); if (typeof T != "object") return T; throw new TypeError("@@toPrimitive must return a primitive value."); } return (_ === "string" ? String : Number)(S); } var p = c(4), m = new Image(128, 128); m.src = c(34); var y = new p.Texture(); y.image = m, y.needsUpdate = !0; var g = [0.02, 0.03, 1], v = new p.SpriteMaterial({ map: y, alphaTest: 0.5, transparent: !0, depthTest: !1, depthWrite: !1, sizeAttenuation: !1 }), x = c(5).createNewSpriteText, w = function(S) { c(10).ZincObject.call(this), this.texture = y; var _ = void 0; this.morph = new p.Group(), this.group = this.morph, this.isMarkerCluster = !0; var b = !0, T = []; this.markers = {}; var E = new p.Vector2(), C = new p.Vector2(), L = Date.now(); this.setSpriteSize = (M) => { _.scale.set(0.015, 0.02, 1), _.scale.multiplyScalar(M); }, this.clear = () => { this.group.clear(), this.markers = {}; }, this.dispose = () => { this.clear(), this.morph && this.morph.clear(); }; var A = (M) => { var O = new p.Group(), D = new p.Sprite(v); return D.clusterIndex = M, D.center.set(0.5, 0), D.position.set(0, 0, 0), D.renderOrder = 1e4, D.scale.set(g[0], g[1], g[2]), D.userData = this, O.add(D), this.group.add(O), { group: O, marker: D, label: void 0, number: 0, min: [0, 0, 0], max: [1, 1, 1] }; }, k = (M, O, D) => { M.group.visible = !0, M.group.position.set(O.coords[0], O.coords[1], O.coords[2]), (M.label === void 0 || D !== M.number) && (M.label && (M.group.remove(M.label), M.label.material.map.dispose(), M.label.material.dispose()), M.label = x(D, 0.012, "black", "Asap", 120, 700), M.number = D, M.group.add(M.label)), M.min = O.min, M.max = O.max; }, P = (M) => { var O = 0; for (M.forEach((D) => { var I = D.members.length, F = 0; I === 1 ? D.members[0].setVisibility(!0) : (D.members.forEach((z) => { F += z.getNumber(), z.setVisibility(!1); }), !T[O] && T.push(A(O)), k(T[O], D, F), O++); }), O; O < T.length; O++) T[O].group.visible = !1; }, R = (M, O) => { var D = !0, I = { members: [], coords: [0, 0, 0], min: [0, 0, 0], max: [1, 1, 1] }, F = 0; for (var z in M) D ? (E.set(M[z].ndc.x, M[z].ndc.y), this._b1.setFromPoints([M[z].morph.position]), D = !1, I.members.push(M[z]), I.coords = [M[z].morph.position.x, M[z].morph.position.y, M[z].morph.position.z], O.push(I), delete M[z]) : (C.set(M[z].ndc.x, M[z].ndc.y), F = E.distanceTo(C), 0.1 > F && (I.members.push(M[z]), this._b1.expandByPoint(M[z].morph.position), delete M[z])); I.min = [this._b1.min.x, this._b1.min.y, this._b1.min.z], I.max = [this._b1.max.x, this._b1.max.y, this._b1.max.z], D != !0 && R(M, O); }; this.calculate = () => { if (b) { var M = Date.now(); if (500 < M - L) { var O = []; R(u({}, this.markers), O), P(O), L = Date.now(), this.markerUpdateRequired = !1; } } }, this.isEnabled = () => b, this.enable = () => { b = !0, this.morph.visible = !0; }, this.disable = () => { for (var M in b = !1, this.morph.visible = !1, this.markers) { var O; (O = this.markers[M]) !== null && O !== void 0 && O.isMarker && this.markers[M].isEnabled() && this.markers[M].setVisibility(!0); } }, this.zoomToCluster = (M) => !!(M !== void 0 && -1 < M && (this._v1.set(...T[M].min), this._v2.set(...T[M].max), Math.abs(0 < this._v1.distanceTo(this._v2)))) && (this._b1.set(this._v1, this._v2), S.translateBoundingBoxToCameraView(this._b1, 3, 300), this.markerUpdateRequired = !0, !0), this.clusterIsVisible = (M) => { if (M !== void 0 && -1 < M && T[M]) { var O; return (O = T[M].group) === null || O === void 0 ? void 0 : O.visible; } return !1; }; }; w.prototype = Object.create(c(10).ZincObject.prototype), s.MarkerCluster = w; }, /* 34 */ /***/ (o) => { o.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZlcnNpb249IjEuMSIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIHZpZXdCb3g9IjAgMCAzNjUgNTYwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4KPGRlZnM+CjwvZGVmcz4KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDApIiBpZD0iODA4ZWQyODMtMjUyNC00NDBmLTg4YWUtM2JkYjQ3YmI1NzQ5IiAgPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii0xODIuNSIgeT0iLTI4MCIgcng9IjAiIHJ5PSIwIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgLz4KPC9nPgo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+CjxnIHN0eWxlPSIiICAgPgo8L2c+CjwvZz4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDk3LjUpIiAgPgo8ZyBzdHlsZT0iIiAgID4KPC9nPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDAuOTkgMCAwIDAuOTkgMTgyLjUgMjgwKSIgID4KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItNTQwIiB5PSItNTQwIiByeD0iMCIgcnk9IjAiIHdpZHRoPSIxMDgwIiBoZWlnaHQ9IjEwODAiIC8+CjwvZz4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxwYXRoIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwxNjUsMCk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHRyYW5zZm9ybT0iIHRyYW5zbGF0ZSgtMTgyLjksIC0yNzkuODUpIiBkPSJNIDE4Mi45IDU1MS43IEMgMTgyLjkgNTUxLjgwMDAwMDAwMDAwMDEgMTgzLjEgNTUyIDE4My4xIDU1MiBDIDE4My4xIDU1MiAzNTguMyAyODMgMzU4LjMgMTk0LjYgQyAzNTguMyA2NC41IDI2OS41IDcuOTAwMDAwMDAwMDAwMDA2IDE4Mi45IDcuNjk5OTk5OTk5OTk5OTg5IEMgOTYuMyA3LjkgNy41IDY0LjUgNy41IDE5NC42IEMgNy41IDI4MyAxODIuOCA1NTIgMTgyLjggNTUyIEMgMTgyLjggNTUyIDE4Mi45IDU1MS43IDE4Mi45IDU1MS43IHogTSAxMjIuMiAxODcuMiBDIDEyMi4yIDE1My42IDE0OS40IDEyNi4zOTk5OTk5OTk5OTk5OSAxODMgMTI2LjM5OTk5OTk5OTk5OTk5IEMgMjE2LjYgMTI2LjM5OTk5OTk5OTk5OTk5IDI0My44IDE1My42IDI0My44IDE4Ny4yIEMgMjQzLjggMjIwLjc5OTk5OTk5OTk5OTk4IDIxNi41IDI0OCAxODIuOSAyNDggQyAxNDkuNCAyNDggMTIyLjIgMjIwLjggMTIyLjIgMTg3LjIgeiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiAvPgo8L2c+CgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPgo8Y2lyY2xlIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgY3g9IjAiIGN5PSIwIiByPSIzNSIgLz4KPC9nPgo8L2c+CjwvZz4KPC9zdmc+"; }, /* 35 */ /***/ (o, s, c) => { var l = c(4), u = c(5).resolveURL, d = c(5).createNewURL, h = c(36).STLLoader, f = c(37).OBJLoader, p = c(38).PrimitivesLoader; s.SceneLoader = function(m) { var y = m; this.toBeDownloaded = 0, this.progressMap = {}; var g = !1, v = !1, x = new p(); this.getDownloadProgress = () => { var K = 0, V = 0, H = !1; for (var G in this.progressMap) { var W = this.progressMap[G]; K += W[1], V += W[0], W[1] == 0 && (H = !0); } return H && (K = 0), [K, V, v]; }, this.onProgress = (K) => (V) => { this.progressMap[K] = [V.loaded, V.total]; }, this.onError = (K) => (V) => { --this.toBeDownloaded, v = !0, console.error("There is an issue with one of the external resource: ".concat(V == null ? void 0 : V.responseURL, ".")), K && K(); }; var w = (K, V) => { var H = V.Default; if (V.Inline) y.setupMultipleViews(H, V.Entries); else { var G = [], W = function(ie) { K && (newURL = d(X, K), G.push(new Promise((ue, $) => { fetch(newURL).then((J) => J.json()).then((J) => ue({ key: ie, data: J })).catch((J) => $(J)); }))); }; for (var [Y, X] of Object.entries(V.Entries)) W(Y); Promise.all(G).then((ie) => { var ue = {}; ie.forEach((J) => { ue[J.key] = J.data; }), y.setupMultipleViews(H, ue); var $ = y.getZincCameraControls(); $ && $.setCurrentViewport(H), g = !0; }); } }; this.loadViewURL = (K, V) => { this.toBeDownloaded += 1; var H = new XMLHttpRequest(); H.onreadystatechange = () => { if (H.readyState == 4) if (H.status == 200) { var W = JSON.parse(H.responseText); y.setupMultipleViews("default", { default: W }), y.resetView(), g = !0, --this.toBeDownloaded, V != null && typeof V == "function" && V(); } else this.onError(); }; var G = u(K); H.open("GET", G, !0), H.send(); }, this.loadModelsURL = (K, V, H, G, W, Y, X) => { var ie = V.length; this.toBeDownloaded += ie; for (var ue = 0; ue < ie; ue++) { var $ = V[ue], J = c(0).defaultMaterialColor, ne = c(0).defaultOpacity; H != null && H[ue] != null && (J = !!H[ue]), G != null && G[ue] != null && (ne = G[ue]); var j = 0; W != null && W[ue] != null && (j = !!W[ue]); var q = 0; Y != null && Y[ue] != null && (q = !!Y[ue]), x.load(u($), P(K, J, ne, j, q, void 0, void 0, void 0, void 0, X), this.onProgress($), this.onError(X)); } }, this.loadFromViewURL = (K, V, H) => { var G = new XMLHttpRequest(); G.onreadystatechange = () => { if (G.readyState == 4 && G.status == 200) { var Y = JSON.parse(G.responseText); y.loadView(Y); for (var X, ie = [], ue = V + "_", $ = 0; $ < Y.numberOfResources; $++) X = ue + ($ + 1) + ".json", ie.push(X); this.loadModelsURL(K, ie, Y.colour, Y.opacity, Y.timeEnabled, Y.morphColour, H); } }; var W = u(V + "_view.json"); G.open("GET", W, !0), G.send(); }; var S = (K, V, H, G, W, Y, X, ie) => (ue, $) => { var J = new (c(24)).Lines(), ne = void 0; $ && $[0] && (ne = new l.LineBasicMaterial({ color: $[0].color.clone() }), 1 > $[0].opacity && (ne.transparent = !0), ne.opacity = $[0].opacity, ne.morphTargets = V, ne.vertexColors = $[0].vertexColors); var j = { localTimeEnabled: V, localMorphColour: H }; if (J && (J.createLineSegment(ue, ne, j), J.setName(G), J.anatomicalId = W, J.setRenderOrder(Y), K.addZincObject(J), J.setDuration(y.getDuration()), console.log(X), X && X.levels)) for (var [q, ge] of Object.entries(X.levels)) J.addLOD(x, q, ge.URL, ge.Index, X.preload); --this.toBeDownloaded, ue.dispose(), ie != null && typeof ie == "function" && ie(J); }; this.loadLinesURL = (K, V, H, G, W, Y, X) => { var ie = 0; this.toBeDownloaded += 1; var ue = !!(X && X.isInline) && X.isInline, $ = X && X.anatomicalId ? X.anatomicalId : void 0, J = X && X.renderOrder ? X.renderOrder : void 0; H != null && (ie = !!H); var ne = 0; if (G != null && (ne = !!G), ue) { var j = x.parse(V); S(K, ie, ne, W, $, J, X.lod, Y)(j.geometry, j.materials); } else x.load(V, S(K, ie, ne, W, $, J, X.lod, Y), this.onProgress(V), this.onError(Y), X.loaderOptions); }; var _ = (K, V, H, G, W, Y) => { var X = Y && Y.isInline ? Y.isInline : void 0, ie = Y && Y.anatomicalId ? Y.anatomicalId : void 0, ue = Y && Y.displayLabels ? Y.displayLabels : void 0, $ = Y && Y.renderOrder ? Y.renderOrder : void 0, J = new (c(18)).Glyphset(); J.setDuration(y.getDuration()), J.groupName = G; var ne = () => { --this.toBeDownloaded, W != null && typeof W == "function" && W(J); }; ++this.toBeDownloaded, X ? J.load(V, H, ne, X, ue) : J.load(V, u(H), ne, X, ue), J.anatomicalId = ie, J.setRenderOrder($), K.addZincObject(J); }, b = (K, V, H, G, W, Y) => () => { if (V.readyState == 4 && V.status == 200) { var X = JSON.parse(V.responseText); _(K, X, H, G, W, Y); } }, T = (K, V, H, G, W, Y, X) => (ie, ue) => { var $ = new (c(22)).Pointset(), J = new l.PointsMaterial({ alphaTest: 0.5, size: 10, sizeAttenuation: !1 }); ue && ue[0] && (1 > ue[0].opacity && (J.transparent = !0), J.opacity = ue[0].opacity, J.color = ue[0].color, J.morphTargets = V, J.vertexColors = ue[0].vertexColors); var ne = {}; ne.localTimeEnabled = V, ne.localMorphColour = H, $ && ($.createMesh(ie, J, ne), $.setName(G), $.anatomicalId = W, K.addZincObject($), $.setDuration(y.getDuration()), $.setRenderOrder(Y)), ie.dispose(), --this.toBeDownloaded, X != null && typeof X == "function" && X($); }; this.loadSTL = (K, V, H, G) => { this.toBeDownloaded += 1; var W = c(0).defaultMaterialColor, Y = c(0).defaultOpacity, X = new h(); X.crossOrigin = "Anonymous", X.load(u(V), P(K, W, Y, !1, !1, H, void 0, void 0, void 0, G)); }, this.loadOBJ = (K, V, H, G) => { this.toBeDownloaded += 1; var W = c(0).defaultMaterialColor, Y = c(0).defaultOpacity, X = new f(); X.crossOrigin = "Anonymous", X.load(u(V), P(K, W, Y, !1, !1, H, void 0, void 0, void 0, G)); }; var E = (K, V, H, G, W, Y, X) => { this.toBeDownloaded += 1; var ie = c(0).defaultMaterialColor, ue = c(0).defaultOpacity, $ = 0, J = !!(X && X.isInline) && X.isInline, ne = X && X.fileFormat ? X.fileFormat : void 0, j = X && X.anatomicalId ? X.anatomicalId : void 0, q = X && X.renderOrder ? X.renderOrder : void 0; H != null && ($ = !!H); var ge = 0; G != null && (ge = !!G); var ye = x; if (ne !== void 0) { if (ne == "STL") ye = new h(); else if (ne == "OBJ") return ye = new f(), ye.crossOrigin = "Anonymous", void ye.load(V, objloader(K, ie, ue, $, ge, W, j, Y), this.onProgress(V), this.onError, X.loaderOptions); } if (J) { var _e = x.parse(V); P(K, ie, ue, $, ge, W, j, q, X, Y)(_e.geometry, _e.materials); } else ye.crossOrigin = "Anonymous", x.load(V, P(K, ie, ue, $, ge, W, j, q, X, Y), this.onProgress(V), this.onError(Y), X.loaderOptions); }, C = function(K, V, H) { var G = 0; return (W) => { if (++G, W && V != null && typeof V == "function") { V(W); var Y = y.getZincCameraControls(); Y && Y.calculateMaxAllowedDistance(y); } G == K && (g == !1 && y.viewAll(), H != null && typeof H == "function" && H()); }; }; this.loadPointsetURL = (K, V, H, G, W, Y, X) => { var ie = 0; this.toBeDownloaded += 1, H != null && (ie = !!H); var ue = 0; G != null && (ue = !!G); var $ = !!(X && X.isInline) && X.isInline, J = X && X.anatomicalId ? X.anatomicalId : void 0, ne = X && X.renderOrder ? X.renderOrder : void 0; if ($) { var j = x.parse(V); T(K, ie, ue, W, J, ne, Y)(j.geometry, j.materials); } else x.load(V, T(K, ie, ue, W, J, ne, Y), this.onProgress(V), this.onError(Y), X.loaderOptions); }; var L = (K, V, H, G, W, Y) => { var X = Y && Y.isInline ? Y.isInline : void 0, ie = Y && Y.anatomicalId ? Y.anatomicalId : void 0, ue = Y && Y.renderOrder ? Y.renderOrder : void 0, $ = void 0; if (H) { if (V && H.images && H.images.source) for (var J, ne = H.images.source, j = 0; j < ne.length; j++) J = d(ne[j], V), H.images.source[j] = J; if (H.type === "slides" && ($ = new (c(27)).TextureSlides()), $) { $.groupName = G; var q = () => { --this.toBeDownloaded, W != null && typeof W == "function" && W($); }; ++this.toBeDownloaded, $.load(H, q, X), $.anatomicalId = ie, $.setRenderOrder(ue), K.addZincObject($); } } }, A = (K, V, H, G, W) => () => { if (V.readyState == 4 && V.status == 200) { var Y = JSON.parse(V.responseText); L(K, V.responseURL, Y, H, G, W); } }; this.loadTextureURL = (K, V, H, G, W) => { var Y = !!(W && W.isInline) && W.isInline; if (Y) L(K, void 0, V, H, G, W); else { var X = new XMLHttpRequest(); X.onreadystatechange = A(K, X, H, G, W), X.open("GET", u(V), !0), X.send(); } }, this.loadGlyphsetURL = (K, V, H, G, W, Y) => { var X = !!(Y && Y.isInline) && Y.isInline; if (X) _(K, V, H, G, W, Y); else { var ie = new XMLHttpRequest(); ie.onreadystatechange = b(K, ie, H, G, W, Y), ie.open("GET", u(V), !0), ie.send(); } }; var k = (K, V, H, G, W, Y, X, ie, ue) => { var $ = { colour: H, opacity: G, localTimeEnabled: W, localMorphColour: Y }, J = new (c(3)).Geometry(); return J.createMesh(V, ie, $), J.getMorph() ? (J.setName(ue), K && K.addZincObject(J), J.setDuration(y.getDuration()), J.videoHandler && y.setVideoHandler(J.videoHandler), J) : void 0; }, P = (K, V, H, G, W, Y, X, ie, ue, $) => (J, ne) => { var j; ne && ne[0] && (j = ne[0]); var q = k(K, J, V, H, G, W, void 0, j, Y); if (q.anatomicalId = X, q.setRenderOrder(ie), ue.lod && ue.lod.levels) for (var [ge, ye] of Object.entries(ue.lod.levels)) q.addLOD(x, ge, ye.URL, ye.Index, ue.lod.preload); --this.toBeDownloaded, J.dispose(), $ != null && typeof $ == "function" && $(q); }, R = (K) => { var V = /P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/, [, H, G, W, Y, X, ie, ue] = K.match(V); return { years: H, months: G, weeks: W, days: Y, hours: X, mins: ie, secs: ue }; }; this.loadSettings = (K) => { if (K) { if (K.Duration) { var V = R(K.Duration); y.setDurationFromObject(V); } if (K.OriginalDuration) { var H = R(K.OriginalDuration); y.setOriginalDurationFromObject(H); } if (K.TimeStamps) for (var G in K.TimeStamps) { var W = R(K.TimeStamps[G]); y.addMetadataTimeStamp(G, W); } } }; var M = (K, V, H, G, W) => { if (H) { var Y = void 0, X = !1; H.URL ? (Y = H.URL, V && (Y = d(Y, V))) : H.Inline && (Y = H.Inline.URL, X = !0); var ie = {}; if (H.LOD && H.LOD.Levels) { ie.preload = !!H.LOD.Preload, ie.levels = {}; for (var [ue, $] of Object.entries(H.LOD.Levels)) ie.levels[ue] = {}, ie.levels[ue].URL = d($.URL, V), ie.levels[ue].Index = $.Index; } var J = H.GroupName; (J === void 0 || J === "") && (J = "_Unnamed"); var ne = { loaderOptions: { index: H.Index }, isInline: X, fileFormat: H.FileFormat, anatomicalId: H.AnatomicalId, compression: H.compression, lod: ie, renderOrder: G }; switch (H.Type) { case "Surfaces": E(K, Y, H.MorphVertices, H.MorphColours, J, W, ne); break; case "Glyph": var j; X ? j = H.Inline.GlyphGeometriesURL : (j = H.GlyphGeometriesURL, j = d(H.GlyphGeometriesURL, V)), H.DisplayLabels && (ne.displayLabels = !0), this.loadGlyphsetURL(K, Y, j, J, W, ne); break; case "Points": this.loadPointsetURL(K, Y, H.MorphVertices, H.MorphColours, J, W, ne); break; case "Lines": this.loadLinesURL(K, Y, H.MorphVertices, H.MorphColours, J, W, ne); break; case "Texture": this.loadTextureURL(K, Y, J, W, ne); break; } } }, O = (K, V, H) => { if (V) { var G = void 0, W = !1; switch (V.URL ? (G = V.URL, K && (G = d(V.URL, K))) : V.Inline && (G = V.Inline.URL, W = !0), V.Type) { case "View": W ? (y.setupMultipleViews("default", { default: G }), g = !0, H != null && typeof H == "function" && H()) : this.loadViewURL(G, H); break; case "Settings": this.loadSettings(V); break; } } }; this.loadGLTF = (K, V, H, G, W) => { var Y = new (c(39)).GLTFToZincJSLoader(); Y.load(y, K, V, H, G, W); }; var D = (K, V, H, G) => { if (H.Primitives && H.Primitives.forEach((ie) => { var ue = 1; ie.Order && (ue = ie.Order), M(K, V, ie, ue, G); }), H.Transformation && K.setTransformation(H.Transformation), H.Children) for (var [W, Y] of Object.entries(H.Children)) { var X = K.findOrCreateChildFromPath(W); X && D(X, V, Y, G); } }, I = (K, V) => { if (Array.isArray(K)) { for (var H = 0, G = 0; G < K.length; G++) K[G].Type && (V && K[G].Type === "View" || K[G].Type === "Surfaces" || K[G].Type === "Glyph" || K[G].Type === "Points" || K[G].Type === "Lines" || K[G].Type === "Texture") && H++; return H; } return 0; }, F = (K) => { var V = K.Primitives ? I(K.Primitives, !1) : 0; return K.Children && Object.values(K.Children).forEach((H) => { V += F(H); }), V; }, z = (K) => Array.isArray(K) ? I(K, !0) : typeof K == "object" && K !== null && K.Version === "2.0" ? F(K.Regions) : void 0, U = (K, V, H, G, W) => { var Y = K; H.RegionPath && H.RegionPath !== "" && (Y = K.findOrCreateChildFromPath(H.RegionPath)), M(Y, V, H, 2 * G, W); }, Z = (K, V, H, G, W) => { for (var Y = z(V), X = new C(Y, G, W), ie = 0; ie < V.length; ie++) O(H, V[ie], X); for (var ue = 0; ue < V.length; ue++) U(K, H, V[ue], ue, X); }, re = (K, V, H, G, W) => { var Y = z(V), X = new C(Y, G, W); V.Settings && this.loadSettings(V.Settings), V.Views && w(H, V.Views), V.Regions && D(K, H, V.Regions, X); }; this.loadMetadataURL = (K, V, H, G) => { var W = new XMLHttpRequest(), Y = u(V); W.onreadystatechange = () => { if (W.readyState == 4 && W.status == 200) { y.resetMetadata(), y.resetDuration(), g = !1; var X = W.responseURL; X === void 0 && (X = new URL(Y).href); var ie = JSON.parse(W.responseText); Array.isArray(ie) ? Z(K, ie, X, H, G) : typeof ie == "object" && ie !== null && ie.Version == "2.0" && re(K, ie, X, H, G); } }, W.open("GET", Y, !0), W.send(); }; }; }, /* 36 */ /***/ (o, s, c) => { c.r(s), c.d(s, { /* harmony export */ STLLoader: () => ( /* binding */ u ) /* harmony export */ }); var l = c(4); class u extends l.Loader { constructor(h) { super(h); } load(h, f, p, m) { var y = this, g = new l.FileLoader(this.manager); g.setPath(this.path), g.setResponseType("arraybuffer"), g.setRequestHeader(this.requestHeader), g.setWithCredentials(this.withCredentials), g.load(h, function(v) { try { f(y.parse(v)); } catch (x) { m ? m(x) : console.error(x), y.manager.itemError(h); } }, p, m); } parse(h) { function f(m, y, g) { for (var v = 0, x = m.length; v < x; v++) if (m[v] !== y.getUint8(g + v, !1)) return !1; return !0; } var p = function(m) { if (typeof m == "string") { for (var y = new Uint8Array(m.length), g = 0; g < m.length; g++) y[g] = 255 & m.charCodeAt(g); return y.buffer || y; } return m; }(h); return function(m) { var y = new DataView(m), g = y.getUint32(80, !0); if (84 + g * 50 === y.byteLength) return !0; for (var v = [115, 111, 108, 105, 100], x = 0; 5 > x; x++) if (f(v, y, x)) return !1; return !0; }(p) ? function(m) { for (var y, g, v, x, w, S, _, b, T = new DataView(m), E = T.getUint32(80, !0), C = !1, L = 0; L < 70; L++) T.getUint32(L, !1) == 1129270351 && T.getUint8(L + 4) == 82 && T.getUint8(L + 5) == 61 && (C = !0, x = new Float32Array(3 * (3 * E)), w = T.getUint8(L + 6) / 255, S = T.getUint8(L + 7) / 255, _ = T.getUint8(L + 8) / 255, b = T.getUint8(L + 9) / 255); for (var A = new l.BufferGeometry(), k = new Float32Array(3 * (3 * E)), P = new Float32Array(3 * (3 * E)), R = 0; R < E; R++) { var M = 84 + R * 50, O = T.getFloat32(M, !0), D = T.getFloat32(M + 4, !0), I = T.getFloat32(M + 8, !0); if (C) { var F = T.getUint16(M + 48, !0); 32768 & F ? (y = w, g = S, v = _) : (y = (31 & F) / 31, g = (31 & F >> 5) / 31, v = (31 & F >> 10) / 31); } for (var z = 1; 3 >= z; z++) { var U = M + 12 * z, Z = 3 * (3 * R) + 3 * (z - 1); k[Z] = T.getFloat32(U, !0), k[Z + 1] = T.getFloat32(U + 4, !0), k[Z + 2] = T.getFloat32(U + 8, !0), P[Z] = O, P[Z + 1] = D, P[Z + 2] = I, C && (x[Z] = y, x[Z + 1] = g, x[Z + 2] = v); } } return A.setAttribute("position", new l.BufferAttribute(k, 3)), A.setAttribute("normal", new l.BufferAttribute(P, 3)), C && (A.setAttribute("color", new l.BufferAttribute(x, 3)), A.hasColors = !0, A.alpha = b), A; }(p) : function(m) { for (var y, g = new l.BufferGeometry(), v = /solid([\s\S]*?)endsolid/g, x = /facet([\s\S]*?)endfacet/g, w = 0, S = /[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source, _ = new RegExp("vertex" + S + S + S, "g"), b = new RegExp("normal" + S + S + S, "g"), T = [], E = [], C = new l.Vector3(), L = 0, A = 0, k = 0; (y = v.exec(m)) !== null; ) { A = k; for (var P = y[0]; (y = x.exec(P)) !== null; ) { for (var R = 0, M = 0, O = y[0]; (y = b.exec(O)) !== null; ) C.x = parseFloat(y[1]), C.y = parseFloat(y[2]), C.z = parseFloat(y[3]), M++; for (; (y = _.exec(O)) !== null; ) T.push(parseFloat(y[1]), parseFloat(y[2]), parseFloat(y[3])), E.push(C.x, C.y, C.z), R++, k++; M !== 1 && console.error("THREE.STLLoader: Something isn't right with the normal of face number " + w), R !== 3 && console.error("THREE.STLLoader: Something isn't right with the vertices of face number " + w), w++; } var D = A, I = k - A; g.addGroup(D, I, L), L++; } return g.setAttribute("position", new l.Float32BufferAttribute(T, 3)), g.setAttribute("normal", new l.Float32BufferAttribute(E, 3)), g; }(function(m) { return typeof m == "string" ? m : l.LoaderUtils.decodeText(new Uint8Array(m)); }(h)); } } }, /* 37 */ /***/ (o, s, c) => { c.r(s), c.d(s, { /* harmony export */ OBJLoader: () => ( /* binding */ w ) /* harmony export */ }); var l = c(4), u = /^[og]\s*(.+)?/, d = /^mtllib /, h = /^usemtl /, f = /^usemap /, p = new l.Vector3(), m = new l.Vector3(), y = new l.Vector3(), g = new l.Vector3(), v = new l.Vector3(); function x() { var S = { objects: [], object: {}, vertices: [], normals: [], colors: [], uvs: [], materials: {}, materialLibraries: [], startObject: function(_, b) { if (this.object && this.object.fromDeclaration === !1) return this.object.name = _, void (this.object.fromDeclaration = b !== !1); var T = this.object && typeof this.object.currentMaterial == "function" ? this.object.currentMaterial() : void 0; if (this.object && typeof this.object._finalize == "function" && this.object._finalize(!0), this.object = { name: _ || "", fromDeclaration: b !== !1, geometry: { vertices: [], normals: [], colors: [], uvs: [], hasUVIndices: !1 }, materials: [], smooth: !0, startMaterial: function(C, L) { var A = this._finalize(!1); A && (A.inherited || 0 >= A.groupCount) && this.materials.splice(A.index, 1); var k = { index: this.materials.length, name: C || "", mtllib: Array.isArray(L) && 0 < L.length ? L[L.length - 1] : "", smooth: A === void 0 ? this.smooth : A.smooth, groupStart: A === void 0 ? 0 : A.groupEnd, groupEnd: -1, groupCount: -1, inherited: !1, clone: function(P) { var R = { index: typeof P == "number" ? P : this.index, name: this.name, mtllib: this.mtllib, smooth: this.smooth, groupStart: 0, groupEnd: -1, groupCount: -1, inherited: !1 }; return R.clone = this.clone.bind(R), R; } }; return this.materials.push(k), k; }, currentMaterial: function() { return 0 < this.materials.length ? this.materials[this.materials.length - 1] : void 0; }, _finalize: function(C) { var L = this.currentMaterial(); if (L && L.groupEnd === -1 && (L.groupEnd = this.geometry.vertices.length / 3, L.groupCount = L.groupEnd - L.groupStart, L.inherited = !1), C && 1 < this.materials.length) for (var A = this.materials.length - 1; 0 <= A; A--) 0 >= this.materials[A].groupCount && this.materials.splice(A, 1); return C && this.materials.length === 0 && this.materials.push({ name: "", smooth: this.smooth }), L; } }, T && T.name && typeof T.clone == "function") { var E = T.clone(0); E.inherited = !0, this.object.materials.push(E); } this.objects.push(this.object); }, finalize: function() { this.object && typeof this.object._finalize == "function" && this.object._finalize(!0); }, parseVertexIndex: function(_, b) { var T = parseInt(_, 10); return 3 * (0 <= T ? T - 1 : T + b / 3); }, parseNormalIndex: function(_, b) { var T = parseInt(_, 10); return 3 * (0 <= T ? T - 1 : T + b / 3); }, parseUVIndex: function(_, b) { var T = parseInt(_, 10); return 2 * (0 <= T ? T - 1 : T + b / 2); }, addVertex: function(_, b, T) { var E = this.vertices, C = this.object.geometry.vertices; C.push(E[_ + 0], E[_ + 1], E[_ + 2]), C.push(E[b + 0], E[b + 1], E[b + 2]), C.push(E[T + 0], E[T + 1], E[T + 2]); }, addVertexPoint: function(_) { var b = this.vertices, T = this.object.geometry.vertices; T.push(b[_ + 0], b[_ + 1], b[_ + 2]); }, addVertexLine: function(_) { var b = this.vertices, T = this.object.geometry.vertices; T.push(b[_ + 0], b[_ + 1], b[_ + 2]); }, addNormal: function(_, b, T) { var E = this.normals, C = this.object.geometry.normals; C.push(E[_ + 0], E[_ + 1], E[_ + 2]), C.push(E[b + 0], E[b + 1], E[b + 2]), C.push(E[T + 0], E[T + 1], E[T + 2]); }, addFaceNormal: function(_, b, T) { var E = this.vertices, C = this.object.geometry.normals; p.fromArray(E, _), m.fromArray(E, b), y.fromArray(E, T), v.subVectors(y, m), g.subVectors(p, m), v.cross(g), v.normalize(), C.push(v.x, v.y, v.z), C.push(v.x, v.y, v.z), C.push(v.x, v.y, v.z); }, addColor: function(_, b, T) { var E = this.colors, C = this.object.geometry.colors; E[_] !== void 0 && C.push(E[_ + 0], E[_ + 1], E[_ + 2]), E[b] !== void 0 && C.push(E[b + 0], E[b + 1], E[b + 2]), E[T] !== void 0 && C.push(E[T + 0], E[T + 1], E[T + 2]); }, addUV: function(_, b, T) { var E = this.uvs, C = this.object.geometry.uvs; C.push(E[_ + 0], E[_ + 1]), C.push(E[b + 0], E[b + 1]), C.push(E[T + 0], E[T + 1]); }, addDefaultUV: function() { var _ = this.object.geometry.uvs; _.push(0, 0), _.push(0, 0), _.push(0, 0); }, addUVLine: function(_) { var b = this.uvs, T = this.object.geometry.uvs; T.push(b[_ + 0], b[_ + 1]); }, addFace: function(_, b, T, E, C, L, A, k, P) { var R = this.vertices.length, M = this.parseVertexIndex(_, R), O = this.parseVertexIndex(b, R), D = this.parseVertexIndex(T, R); if (this.addVertex(M, O, D), this.addColor(M, O, D), A !== void 0 && A !== "") { var I = this.normals.length; M = this.parseNormalIndex(A, I), O = this.parseNormalIndex(k, I), D = this.parseNormalIndex(P, I), this.addNormal(M, O, D); } else this.addFaceNormal(M, O, D); if (E !== void 0 && E !== "") { var F = this.uvs.length; M = this.parseUVIndex(E, F), O = this.parseUVIndex(C, F), D = this.parseUVIndex(L, F), this.addUV(M, O, D), this.object.geometry.hasUVIndices = !0; } else this.addDefaultUV(); }, addPointGeometry: function(_) { this.object.geometry.type = "Points"; for (var b, T = this.vertices.length, E = 0, C = _.length; E < C; E++) b = this.parseVertexIndex(_[E], T), this.addVertexPoint(b), this.addColor(b); }, addLineGeometry: function(_, b) { this.object.geometry.type = "Line"; for (var T = this.vertices.length, E = this.uvs.length, C = 0, L = _.length; C < L; C++) this.addVertexLine(this.parseVertexIndex(_[C], T)); for (var A = 0, k = b.length; A < k; A++) this.addUVLine(this.parseUVIndex(b[A], E)); } }; return S.startObject("", !1), S; } class w extends l.Loader { constructor(_) { super(_), this.materials = null; } load(_, b, T, E) { var C = this, L = new l.FileLoader(this.manager); L.setPath(this.path), L.setRequestHeader(this.requestHeader), L.setWithCredentials(this.withCredentials), L.load(_, function(A) { try { b(C.parse(A)); } catch (k) { E ? E(k) : console.error(k), C.manager.itemError(_); } }, T, E); } setMaterials(_) { return this.materials = _, this; } parse(_) { var b = new x(); _.indexOf(`\r `) !== -1 && (_ = _.replace(/\r\n/g, ` `)), _.indexOf(`\\ `) !== -1 && (_ = _.replace(/\\\n/g, "")); for (var T = _.split(` `), E = "", C = "", L = 0, A = [], k = typeof "".trimLeft == "function", P = 0, R = T.length; P < R; P++) if (E = T[P], E = k ? E.trimLeft() : E.trim(), L = E.length, L !== 0 && (C = E.charAt(0), C !== "#")) if (C === "v") { var M = E.split(/\s+/); switch (M[0]) { case "v": b.vertices.push(parseFloat(M[1]), parseFloat(M[2]), parseFloat(M[3])), 7 <= M.length ? b.colors.push(parseFloat(M[4]), parseFloat(M[5]), parseFloat(M[6])) : b.colors.push(void 0, void 0, void 0); break; case "vn": b.normals.push(parseFloat(M[1]), parseFloat(M[2]), parseFloat(M[3])); break; case "vt": b.uvs.push(parseFloat(M[1]), parseFloat(M[2])); } } else if (C === "f") { for (var O, D = E.substr(1).trim(), I = D.split(/\s+/), F = [], z = 0, U = I.length; z < U; z++) if (O = I[z], 0 < O.length) { var Z = O.split("/"); F.push(Z); } for (var re = F[0], K = 1, V = F.length - 1; K < V; K++) { var H = F[K], G = F[K + 1]; b.addFace(re[0], H[0], G[0], re[1], H[1], G[1], re[2], H[2], G[2]); } } else if (C === "l") { var W = E.substring(1).trim().split(" "), Y = [], X = []; if (E.indexOf("/") === -1) Y = W; else for (var ie, ue = 0, $ = W.length; ue < $; ue++) ie = W[ue].split("/"), ie[0] !== "" && Y.push(ie[0]), ie[1] !== "" && X.push(ie[1]); b.addLineGeometry(Y, X); } else if (C === "p") { var J = E.substr(1).trim(), ne = J.split(" "); b.addPointGeometry(ne); } else if ((A = u.exec(E)) !== null) { var j = (" " + A[0].substr(1).trim()).substr(1); b.startObject(j); } else if (h.test(E)) b.object.startMaterial(E.substring(7).trim(), b.materialLibraries); else if (d.test(E)) b.materialLibraries.push(E.substring(7).trim()); else if (f.test(E)) console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.'); else if (C === "s") { if (A = E.split(" "), 1 < A.length) { var q = A[1].trim().toLowerCase(); b.object.smooth = q !== "0" && q !== "off"; } else b.object.smooth = !0; var ge = b.object.currentMaterial(); ge && (ge.smooth = b.object.smooth); } else { if (E === "\0") continue; console.warn('THREE.OBJLoader: Unexpected line: "' + E + '"'); } b.finalize(); var ye = new l.Group(); ye.materialLibraries = [].concat(b.materialLibraries); var _e = b.objects.length !== 1 || b.objects[0].geometry.vertices.length !== 0; if (_e == !0) for (var Me = 0, Ce = b.objects.length; Me < Ce; Me++) { var B = b.objects[Me], ce = B.geometry, ve = B.materials, te = ce.type === "Line", pe = ce.type === "Points", fe = !1; if (ce.vertices.length !== 0) { var he = new l.BufferGeometry(); he.setAttribute("position", new l.Float32BufferAttribute(ce.vertices, 3)), 0 < ce.normals.length && he.setAttribute("normal", new l.Float32BufferAttribute(ce.normals, 3)), 0 < ce.colors.length && (fe = !0, he.setAttribute("color", new l.Float32BufferAttribute(ce.colors, 3))), ce.hasUVIndices === !0 && he.setAttribute("uv", new l.Float32BufferAttribute(ce.uvs, 2)); for (var Te = [], He = 0, We = ve.length; He < We; He++) { var Ie = ve[He], qe = Ie.name + "_" + Ie.smooth + "_" + fe, De = b.materials[qe]; if (this.materials !== null) { if (De = this.materials.create(Ie.name), te && De && !(De instanceof l.LineBasicMaterial)) { var $e = new l.LineBasicMaterial(); l.Material.prototype.copy.call($e, De), $e.color.copy(De.color), De = $e; } else if (pe && De && !(De instanceof l.PointsMaterial)) { var nt = new l.PointsMaterial({ size: 10, sizeAttenuation: !1 }); l.Material.prototype.copy.call(nt, De), nt.color.copy(De.color), nt.map = De.map, De = nt; } } De === void 0 && (De = te ? new l.LineBasicMaterial() : pe ? new l.PointsMaterial({ size: 1, sizeAttenuation: !1 }) : new l.MeshPhongMaterial(), De.name = Ie.name, De.flatShading = !Ie.smooth, De.vertexColors = fe, b.materials[qe] = De), Te.push(De); } var lt = void 0; if (1 < Te.length) { for (var mt, _t = 0, wt = ve.length; _t < wt; _t++) mt = ve[_t], he.addGroup(mt.groupStart, mt.groupCount, _t); lt = te ? new l.LineSegments(he, Te) : pe ? new l.Points(he, Te) : new l.Mesh(he, Te); } else lt = te ? new l.LineSegments(he, Te[0]) : pe ? new l.Points(he, Te[0]) : new l.Mesh(he, Te[0]); lt.name = B.name, ye.add(lt); } } else if (0 < b.vertices.length) { var me = new l.PointsMaterial({ size: 1, sizeAttenuation: !1 }), Ne = new l.BufferGeometry(); Ne.setAttribute("position", new l.Float32BufferAttribute(b.vertices, 3)), 0 < b.colors.length && b.colors[0] !== void 0 && (Ne.setAttribute("color", new l.Float32BufferAttribute(b.colors, 3)), me.vertexColors = !0); var Ue = new l.Points(Ne, me); ye.add(Ue); } return ye; } } }, /* 38 */ /***/ (o, s, c) => { function l(w, S) { var _ = Object.keys(w); if (Object.getOwnPropertySymbols) { var b = Object.getOwnPropertySymbols(w); S && (b = b.filter(function(T) { return Object.getOwnPropertyDescriptor(w, T).enumerable; })), _.push.apply(_, b); } return _; } function u(w) { for (var S, _ = 1; _ < arguments.length; _++) S = arguments[_] == null ? {} : arguments[_], _ % 2 ? l(Object(S), !0).forEach(function(b) { d(w, b, S[b]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(w, Object.getOwnPropertyDescriptors(S)) : l(Object(S)).forEach(function(b) { Object.defineProperty(w, b, Object.getOwnPropertyDescriptor(S, b)); }); return w; } function d(w, S, _) { return S = h(S), S in w ? Object.defineProperty(w, S, { value: _, enumerable: !0, configurable: !0, writable: !0 }) : w[S] = _, w; } function h(w) { var S = f(w, "string"); return typeof S == "symbol" ? S : S + ""; } function f(w, S) { if (typeof w != "object" || !w) return w; var _ = w[Symbol.toPrimitive]; if (_ !== void 0) { var b = _.call(w, S || "default"); if (typeof b != "object") return b; throw new TypeError("@@toPrimitive must return a primitive value."); } return (S === "string" ? String : Number)(w); } var p = c(19).JSONLoader, m = c(4), y = m.FileLoader, g = (w) => { var S = (b, T) => { b.merge(T); }; if (w && 0 < w.length) { for (; 1 < w.length; ) { var _ = w.splice(1, 1); S(w[0], _[0]); } return w[0]; } }, v = function(w, S, _) { var b = new y(), T = new p(); b.crossOrigin = S; var E = w, C = _, L = void 0, A = !1, k = !1, P = void 0, R = [], M = (F) => { var z = L[F.index]; if (z) { var U = T.parse(z); F.onLoad(U.geometry, U.materials); } else O(F); }, O = (F) => { F.onError && (!P && (P = { responseURL: E }), F.onError(P)); }; this.downloadCompleted = (F) => { try { L = JSON.parse(F[0]), A = !1, k = !0, Array.isArray(L) ? R.forEach((z) => M(z)) : R.forEach((z) => O(z)); } catch { R.forEach((z) => O(z)); } }; var D = () => (F) => { P = F, k = !0, A = !1, R.forEach((z) => { O(z); }); }, I = () => (F) => { R.forEach((z) => { z.onProgress && z.onProgress(F); }); }; this.load = (F, z, U, Z) => { var re = { index: F, onLoad: z, onProgress: U, onError: Z }; k ? L ? M(re) : O(P) : A ? R.push(re) : (R.push(re), A = !0, b.load(E, C, I, D)); }; }, x = function(w, S) { var _ = [], b = w, T = S, E = 0; this.itemDownloaded = (C, L) => { if (_[C] = L, E++, E == b) { for (var A = _[0][1], k = _.map((M) => M[0]), P = g(k), R = 1; R < b; R++) _[C][0].dispose(), _[C][1].forEach((M) => M.dispose()); T(P, A); } }; }; s.PrimitivesLoader = function() { var w = 0, S = 20; this.crossOrigin = "Anonymous"; var _ = new p(), b = [], T = {}, E = (k, P, R, M, O) => { var D = k.length, I = new x(D, P), F = 0; k.forEach((z) => { var U = O ? u({}, O) : {}; U.msHandler = I, U.order = F, F++, L(z, P, R, M, U); }); }, C = (k, P, R, M, O) => { var D = O ? u({}, O) : {}, I = T[k]; if (!I) if (S > w) { var F = new A(void 0, this, D); ++w, I = new v(k, this.crossOrigin, F), T[k] = I; } else b.push({ url: k, onLoad: P, onProgress: R, onError: M, options: O }); I && (D.isHandler = I, I.load(O.index, P, R, M)); }, L = (k, P, R, M, O) => { if (O && O.index !== void 0) C(k, P, R, M, O); else if (S > w) { ++w; var D = new A(P, this, O), I = new A(M, this, O); _.crossOrigin = this.crossOrigin, _.load(k, D, R, I); } else b.push({ url: k, onLoad: P, onProgress: R, onError: M, options: O }); }; this.load = (k, P, R, M, O) => { Array.isArray(k) ? E(k, P, R, M, O) : L(k, P, R, M, O); }, this.loadFromWaitingList = () => { for (; S > w; ) { var k = b.shift(); if (k) this.load(k.url, k.onLoad, k.onProgress, k.onError, k.options); else return; } }, this.itemRemainingCheck = () => { if (b.length === 0 && w == 0) for (var k in T) T.hasOwnProperty(k) && delete T[k]; }; var A = function(k, P, R) { return function() { --w; for (var M = arguments.length, O = Array(M), D = 0; D < M; D++) O[D] = arguments[D]; R != null && R.msHandler ? R.msHandler.itemDownloaded(R.order, O) : R != null && R.isHandler ? R.isHandler.downloadCompleted(O) : k && k(...O), P.loadFromWaitingList(), P.itemRemainingCheck(); }; }; this.parse = (k) => _.parse(k); }; }, /* 39 */ /***/ (o, s, c) => { c(4); var l = c(40).GLTFLoader, u = function() { var d = this; this.parseGLTFObjects = (h, f, p, m) => { var y = f; if (p !== 0) { if (h.type !== "Object3D") { var g; if (h.type === "Mesh" ? g = new (c(3)).Geometry() : h.type === "LineSegments" ? g = new (c(24)).Lines() : h.type === "Points" && (g = new (c(22)).Pointset()), g) { var v = !1, x = !1; h.geometry && h.geometry.morphAttributes && (v = !!h.geometry.morphAttributes.position, x = !!h.geometry.morphAttributes.color), g.setMesh(h.clone(), v, x); var w = g.getMorph(); g.groupName = w.name, w.matrixAutoUpdate = !0, f.addZincObject(g), m != null && typeof m == "function" && m(g); } } else if (h.name !== "" && (f && (y = f.findOrCreateChildFromPath(h.name)), y)) { var S = y.getGroup(); S.position.copy(h.position), S.rotation.copy(h.rotation), S.quaternion.copy(h.quaternion), S.matrixAutoUpdate = !0; } } p++, h.children.forEach((_) => { d.parseGLTFObjects(_, y, p, m); }); }, this.setCamera = (h) => { h.viewAll(); var f = h.getZincCameraControls(), p = f.getCurrentViewport(); f.addViewport("default", p), f.setDefaultViewport("default"); }, this.load = (h, f, p, m, y) => { var g = p.substring(0, p.lastIndexOf("/") + 1), v = p.substring(p.lastIndexOf("/") + 1, p.length), x = new l().setPath(g); x.load(v, function(w) { console.log(w), d.parseGLTFObjects(w.scene, f, 0, m), d.setCamera(h), y != null && typeof y == "function" && y(); }); }; }; s.GLTFToZincJSLoader = u; }, /* 40 */ /***/ (o) => { o.exports = Gpe; }, /* 41 */ /***/ (o, s, c) => { var l = c(42).GLTFExporter, u = function(d) { var h = d; this.exportGLTF = (f) => { var p = h.getRootRegion(), m = p.getAllObjects(!0), y = []; m.forEach((x) => { x.animationClip && y.push({ clip: x.animationClip[0], mesh: x.getMorph() }); }); var g = new l(), v = { binary: f, animations: y }; return new Promise((x) => { g.parse(h.getThreeJSScene(), function(w) { x(w); }, v); }); }; }; s.SceneExporter = u; }, /* 42 */ /***/ (o, s, c) => { c.r(s), c.d(s, { /* harmony export */ GLTFExporter: () => ( /* binding */ u ) /* harmony export */ }); var l = c(4); class u { constructor() { this.pluginCallbacks = [], this.register(function(M) { return new A(M); }), this.register(function(M) { return new k(M); }), this.register(function(M) { return new P(M); }); } register(M) { return this.pluginCallbacks.indexOf(M) === -1 && this.pluginCallbacks.push(M), this; } unregister(M) { return this.pluginCallbacks.indexOf(M) !== -1 && this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(M), 1), this; } /** * Parse scenes and generate GLTF output * @param {Scene or [THREE.Scenes]} input Scene or Array of THREE.Scenes * @param {Function} onDone Callback on completed * @param {Object} options options */ parse(M, O, D) { for (var I = new L(), F = [], z = 0, U = this.pluginCallbacks.length; z < U; z++) F.push(this.pluginCallbacks[z](I)); I.setPlugins(F), I.write(M, O, D); } } var d = { POINTS: 0, LINES: 1, LINE_LOOP: 2, LINE_STRIP: 3, TRIANGLES: 4, TRIANGLE_STRIP: 5, TRIANGLE_FAN: 6, UNSIGNED_BYTE: 5121, UNSIGNED_SHORT: 5123, FLOAT: 5126, UNSIGNED_INT: 5125, ARRAY_BUFFER: 34962, ELEMENT_ARRAY_BUFFER: 34963, NEAREST: 9728, LINEAR: 9729, NEAREST_MIPMAP_NEAREST: 9984, LINEAR_MIPMAP_NEAREST: 9985, NEAREST_MIPMAP_LINEAR: 9986, LINEAR_MIPMAP_LINEAR: 9987, CLAMP_TO_EDGE: 33071, MIRRORED_REPEAT: 33648, REPEAT: 10497 }, h = {}; h[l.NearestFilter] = d.NEAREST, h[l.NearestMipmapNearestFilter] = d.NEAREST_MIPMAP_NEAREST, h[l.NearestMipmapLinearFilter] = d.NEAREST_MIPMAP_LINEAR, h[l.LinearFilter] = d.LINEAR, h[l.LinearMipmapNearestFilter] = d.LINEAR_MIPMAP_NEAREST, h[l.LinearMipmapLinearFilter] = d.LINEAR_MIPMAP_LINEAR, h[l.ClampToEdgeWrapping] = d.CLAMP_TO_EDGE, h[l.RepeatWrapping] = d.REPEAT, h[l.MirroredRepeatWrapping] = d.MIRRORED_REPEAT; var f = { scale: "scale", position: "translation", quaternion: "rotation", morphTargetInfluences: "weights" }, p = 12, m = 1179937895, y = 2, g = 8, v = 1313821514, x = 5130562; function w(R, M) { return R.length === M.length && R.every(function(O, D) { return O === M[D]; }); } function S(R) { if (window.TextEncoder !== void 0) return new TextEncoder().encode(R).buffer; for (var M, O = new Uint8Array(new ArrayBuffer(R.length)), D = 0, I = R.length; D < I; D++) M = R.charCodeAt(D), O[D] = 255 < M ? 32 : M; return O.buffer; } function _(R) { return w(R.elements, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]); } function b(R, M, O) { for (var D = { min: Array(R.itemSize).fill(Number.POSITIVE_INFINITY), max: Array(R.itemSize).fill(Number.NEGATIVE_INFINITY) }, I = M; I < M + O; I++) for (var F, z = 0; z < R.itemSize; z++) F = void 0, 4 < R.itemSize ? F = R.array[I * R.itemSize + z] : z === 0 ? F = R.getX(I) : z === 1 ? F = R.getY(I) : z === 2 ? F = R.getZ(I) : z == 3 && (F = R.getW(I)), D.min[z] = Math.min(D.min[z], F), D.max[z] = Math.max(D.max[z], F); return D; } function T(R) { return 4 * Math.ceil(R / 4); } function E(R) { var M = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : 0, O = T(R.byteLength); if (O !== R.byteLength) { var D = new Uint8Array(O); if (D.set(new Uint8Array(R)), M !== 0) for (var I = R.byteLength; I < O; I++) D[I] = M; return D.buffer; } return R; } var C = null; class L { constructor() { this.plugins = [], this.options = {}, this.pending = [], this.buffers = [], this.byteOffset = 0, this.buffers = [], this.nodeMap = /* @__PURE__ */ new Map(), this.skins = [], this.extensionsUsed = {}, this.uids = /* @__PURE__ */ new Map(), this.uid = 0, this.json = { asset: { version: "2.0", generator: "THREE.GLTFExporter" } }, this.cache = { meshes: /* @__PURE__ */ new Map(), attributes: /* @__PURE__ */ new Map(), attributesNormalized: /* @__PURE__ */ new Map(), materials: /* @__PURE__ */ new Map(), textures: /* @__PURE__ */ new Map(), images: /* @__PURE__ */ new Map() }; } setPlugins(M) { this.plugins = M; } /** * Parse scenes and generate GLTF output * @param {Scene or [THREE.Scenes]} input Scene or Array of THREE.Scenes * @param {Function} onDone Callback on completed * @param {Object} options options */ write(M, O, D) { this.options = Object.assign({}, { // default options binary: !1, trs: !1, onlyVisible: !0, truncateDrawRange: !0, embedImages: !0, maxTextureSize: 1 / 0, animations: [], includeCustomExtensions: !1 }, D), 0 < this.options.animations.length && (this.options.trs = !0), this.processInput(M); var I = this; Promise.all(this.pending).then(function() { var F = I.buffers, z = I.json, U = I.options, Z = I.extensionsUsed, re = new Blob(F, { type: "application/octet-stream" }), K = Object.keys(Z); if (0 < K.length && (z.extensionsUsed = K), z.buffers && 0 < z.buffers.length && (z.buffers[0].byteLength = re.size), U.binary === !0) { var V = new window.FileReader(); V.readAsArrayBuffer(re), V.onloadend = function() { var G = E(V.result), W = new DataView(new ArrayBuffer(g)); W.setUint32(0, G.byteLength, !0), W.setUint32(4, x, !0); var Y = E(S(JSON.stringify(z)), 32), X = new DataView(new ArrayBuffer(g)); X.setUint32(0, Y.byteLength, !0), X.setUint32(4, v, !0); var ie = new ArrayBuffer(p), ue = new DataView(ie); ue.setUint32(0, m, !0), ue.setUint32(4, y, !0); var $ = p + X.byteLength + Y.byteLength + W.byteLength + G.byteLength; ue.setUint32(8, $, !0); var J = new Blob([ie, X, Y, W, G], { type: "application/octet-stream" }), ne = new window.FileReader(); ne.readAsArrayBuffer(J), ne.onloadend = function() { O(ne.result); }; }; } else if (z.buffers && 0 < z.buffers.length) { var H = new window.FileReader(); H.readAsDataURL(re), H.onloadend = function() { var G = H.result; z.buffers[0].uri = G, O(z); }; } else O(z); }); } /** * Serializes a userData. * * @param {THREE.Object3D|THREE.Material} object * @param {Object} objectDef */ serializeUserData(M, O) { if (!(M.userData && M.userData.isZincObject) && Object.keys(M.userData).length !== 0) { var D = this.options, I = this.extensionsUsed; try { var F = JSON.parse(JSON.stringify(M.userData)); if (D.includeCustomExtensions && F.gltfExtensions) { for (var z in O.extensions === void 0 && (O.extensions = {}), F.gltfExtensions) O.extensions[z] = F.gltfExtensions[z], I[z] = !0; delete F.gltfExtensions; } 0 < Object.keys(F).length && (O.extras = F); } catch (U) { console.warn("THREE.GLTFExporter: userData of '" + M.name + "' won't be serialized because of JSON.stringify error - " + U.message); } } } /** * Assign and return a temporal unique id for an object * especially which doesn't have .uuid * @param {Object} object * @return {Integer} */ getUID(M) { return this.uids.has(M) || this.uids.set(M, this.uid++), this.uids.get(M); } /** * Checks if normal attribute values are normalized. * * @param {BufferAttribute} normal * @returns {Boolean} */ isNormalizedNormalAttribute(M) { var O = this.cache; if (O.attributesNormalized.has(M)) return !1; for (var D = new l.Vector3(), I = 0, F = M.count; I < F; I++) if (5e-4 < Math.abs(D.fromBufferAttribute(M, I).length() - 1)) return !1; return !0; } /** * Creates normalized normal buffer attribute. * * @param {BufferAttribute} normal * @returns {BufferAttribute} * */ createNormalizedNormalAttribute(M) { var O = this.cache; if (O.attributesNormalized.has(M)) return O.attributesNormalized.get(M); for (var D = M.clone(), I = new l.Vector3(), F = 0, z = D.count; F < z; F++) I.fromBufferAttribute(D, F), I.x === 0 && I.y === 0 && I.z === 0 ? I.setX(1) : I.normalize(), D.setXYZ(F, I.x, I.y, I.z); return O.attributesNormalized.set(M, D), D; } /** * Applies a texture transform, if present, to the map definition. Requires * the KHR_texture_transform extension. * * @param {Object} mapDef * @param {THREE.Texture} texture */ applyTextureTransform(M, O) { var D = !1, I = {}; (O.offset.x !== 0 || O.offset.y !== 0) && (I.offset = O.offset.toArray(), D = !0), O.rotation !== 0 && (I.rotation = O.rotation, D = !0), (O.repeat.x !== 1 || O.repeat.y !== 1) && (I.scale = O.repeat.toArray(), D = !0), D && (M.extensions = M.extensions || {}, M.extensions.KHR_texture_transform = I, this.extensionsUsed.KHR_texture_transform = !0); } /** * Process a buffer to append to the default one. * @param {ArrayBuffer} buffer * @return {Integer} */ processBuffer(M) { var O = this.json, D = this.buffers; return O.buffers || (O.buffers = [{ byteLength: 0 }]), D.push(M), 0; } /** * Process and generate a BufferView * @param {BufferAttribute} attribute * @param {number} componentType * @param {number} start * @param {number} count * @param {number} target (Optional) Target usage of the BufferView * @return {Object} */ processBufferView(M, O, D, I, F) { var z = this.json; z.bufferViews || (z.bufferViews = []); for (var U = O === d.UNSIGNED_BYTE ? 1 : O === d.UNSIGNED_SHORT ? 2 : 4, Z = T(I * M.itemSize * U), re = new DataView(new ArrayBuffer(Z)), K = 0, V = D; V < D + I; V++) for (var H, G = 0; G < M.itemSize; G++) H = void 0, 4 < M.itemSize ? H = M.array[V * M.itemSize + G] : G === 0 ? H = M.getX(V) : G === 1 ? H = M.getY(V) : G === 2 ? H = M.getZ(V) : G == 3 && (H = M.getW(V)), O === d.FLOAT ? re.setFloat32(K, H, !0) : O === d.UNSIGNED_INT ? re.setUint32(K, H, !0) : O === d.UNSIGNED_SHORT ? re.setUint16(K, H, !0) : O === d.UNSIGNED_BYTE && re.setUint8(K, H), K += U; var W = { buffer: this.processBuffer(re.buffer), byteOffset: this.byteOffset, byteLength: Z }; F !== void 0 && (W.target = F), F === d.ARRAY_BUFFER && (W.byteStride = M.itemSize * U), this.byteOffset += Z, z.bufferViews.push(W); var Y = { id: z.bufferViews.length - 1, byteLength: 0 }; return Y; } /** * Process and generate a BufferView from an image Blob. * @param {Blob} blob * @return {Promise} */ processBufferViewImage(M) { var O = this, D = O.json; return D.bufferViews || (D.bufferViews = []), new Promise(function(I) { var F = new window.FileReader(); F.readAsArrayBuffer(M), F.onloadend = function() { var z = E(F.result), U = { buffer: O.processBuffer(z), byteOffset: O.byteOffset, byteLength: z.byteLength }; O.byteOffset += z.byteLength, I(D.bufferViews.push(U) - 1); }; }); } /** * Process attribute to generate an accessor * @param {BufferAttribute} attribute Attribute to process * @param {THREE.BufferGeometry} geometry (Optional) Geometry used for truncated draw range * @param {Integer} start (Optional) * @param {Integer} count (Optional) * @return {Integer|null} Index of the processed accessor on the "accessors" array */ processAccessor(M, O, D, I) { var F, z = this.options, U = this.json; if (M.array.constructor === Float32Array) F = d.FLOAT; else if (M.array.constructor === Uint32Array) F = d.UNSIGNED_INT; else if (M.array.constructor === Uint16Array) F = d.UNSIGNED_SHORT; else if (M.array.constructor === Uint8Array) F = d.UNSIGNED_BYTE; else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type."); if (D === void 0 && (D = 0), I === void 0 && (I = M.count), z.truncateDrawRange && O !== void 0 && O.index === null) { var Z = D + I, re = O.drawRange.count === 1 / 0 ? M.count : O.drawRange.start + O.drawRange.count; D = Math.max(D, O.drawRange.start), I = Math.min(Z, re) - D, 0 > I && (I = 0); } if (I === 0) return null; var K, V = b(M, D, I); O !== void 0 && (K = M === O.index ? d.ELEMENT_ARRAY_BUFFER : d.ARRAY_BUFFER); var H = this.processBufferView(M, F, D, I, K), G = { bufferView: H.id, byteOffset: H.byteOffset, componentType: F, count: I, max: V.max, min: V.min, type: { 1: "SCALAR", 2: "VEC2", 3: "VEC3", 4: "VEC4", 16: "MAT4" }[M.itemSize] }; return M.normalized === !0 && (G.normalized = !0), U.accessors || (U.accessors = []), U.accessors.push(G) - 1; } /** * Process image * @param {Image} image to process * @param {Integer} format of the image (e.g. RGBFormat, RGBAFormat etc) * @param {Boolean} flipY before writing out the image * @return {Integer} Index of the processed texture in the "images" array */ processImage(M, O, D) { var I = this, F = I.cache, z = I.json, U = I.options, Z = I.pending; F.images.has(M) || F.images.set(M, {}); var re = F.images.get(M), K = O === l.RGBAFormat ? "image/png" : "image/jpeg", V = K + ":flipY/" + D.toString(); if (re[V] !== void 0) return re[V]; z.images || (z.images = []); var H = { mimeType: K }; if (U.embedImages) { var G = C = C || document.createElement("canvas"); G.width = Math.min(M.width, U.maxTextureSize), G.height = Math.min(M.height, U.maxTextureSize); var W = G.getContext("2d"); if (D === !0 && (W.translate(0, G.height), W.scale(1, -1)), typeof HTMLImageElement < "u" && M instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && M instanceof HTMLCanvasElement || typeof OffscreenCanvas < "u" && M instanceof OffscreenCanvas || typeof ImageBitmap < "u" && M instanceof ImageBitmap) W.drawImage(M, 0, 0, G.width, G.height); else { O !== l.RGBAFormat && O !== l.RGBFormat && console.error("GLTFExporter: Only RGB and RGBA formats are supported."), (M.width > U.maxTextureSize || M.height > U.maxTextureSize) && console.warn("GLTFExporter: Image size is bigger than maxTextureSize", M); var Y = new Uint8ClampedArray(4 * (M.height * M.width)); if (O === l.RGBAFormat) for (var X = 0; X < Y.length; X += 4) Y[X + 0] = M.data[X + 0], Y[X + 1] = M.data[X + 1], Y[X + 2] = M.data[X + 2], Y[X + 3] = M.data[X + 3]; else for (var ie = 0, ue = 0; ie < Y.length; ie += 4, ue += 3) Y[ie + 0] = M.data[ue + 0], Y[ie + 1] = M.data[ue + 1], Y[ie + 2] = M.data[ue + 2], Y[ie + 3] = 255; W.putImageData(new ImageData(Y, M.width, M.height), 0, 0); } U.binary === !0 ? Z.push(new Promise(function(J) { G.toBlob(function(ne) { I.processBufferViewImage(ne).then(function(j) { H.bufferView = j, J(); }); }, K); })) : H.uri = G.toDataURL(K); } else H.uri = M.src; var $ = z.images.push(H) - 1; return re[V] = $, $; } /** * Process sampler * @param {Texture} map Texture to process * @return {Integer} Index of the processed texture in the "samplers" array */ processSampler(M) { var O = this.json; O.samplers || (O.samplers = []); var D = { magFilter: h[M.magFilter], minFilter: h[M.minFilter], wrapS: h[M.wrapS], wrapT: h[M.wrapT] }; return O.samplers.push(D) - 1; } /** * Process texture * @param {Texture} map Map to process * @return {Integer} Index of the processed texture in the "textures" array */ processTexture(M) { var O = this.cache, D = this.json; if (O.textures.has(M)) return O.textures.get(M); D.textures || (D.textures = []); var I = { sampler: this.processSampler(M), source: this.processImage(M.image, M.format, M.flipY) }; M.name && (I.name = M.name), this._invokeAll(function(z) { z.writeTexture && z.writeTexture(M, I); }); var F = D.textures.push(I) - 1; return O.textures.set(M, F), F; } /** * Process material * @param {THREE.Material} material Material to process * @return {Integer|null} Index of the processed material in the "materials" array */ processMaterial(M) { var O = this.cache, D = this.json; if (O.materials.has(M)) return O.materials.get(M); if (M.isShaderMaterial) return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."), null; D.materials || (D.materials = []); var I = { pbrMetallicRoughness: {} }; M.isMeshStandardMaterial !== !0 && M.isMeshBasicMaterial !== !0 && console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results."); var F = M.color.toArray().concat([M.opacity]); if (w(F, [1, 1, 1, 1]) || (I.pbrMetallicRoughness.baseColorFactor = F), M.isMeshStandardMaterial ? (I.pbrMetallicRoughness.metallicFactor = M.metalness, I.pbrMetallicRoughness.roughnessFactor = M.roughness) : (I.pbrMetallicRoughness.metallicFactor = 0.5, I.pbrMetallicRoughness.roughnessFactor = 0.5), M.metalnessMap || M.roughnessMap) if (M.metalnessMap === M.roughnessMap) { var z = { index: this.processTexture(M.metalnessMap) }; this.applyTextureTransform(z, M.metalnessMap), I.pbrMetallicRoughness.metallicRoughnessTexture = z; } else console.warn("THREE.GLTFExporter: Ignoring metalnessMap and roughnessMap because they are not the same Texture."); if (M.map) { var U = { index: this.processTexture(M.map) }; this.applyTextureTransform(U, M.map), I.pbrMetallicRoughness.baseColorTexture = U; } if (M.emissive) { var Z = M.emissive.clone().multiplyScalar(M.emissiveIntensity), re = Math.max(Z.r, Z.g, Z.b); if (1 < re && (Z.multiplyScalar(1 / re), console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")), 0 < re && (I.emissiveFactor = Z.toArray()), M.emissiveMap) { var K = { index: this.processTexture(M.emissiveMap) }; this.applyTextureTransform(K, M.emissiveMap), I.emissiveTexture = K; } } if (M.normalMap) { var V = { index: this.processTexture(M.normalMap) }; M.normalScale && M.normalScale.x !== -1 && (M.normalScale.x !== M.normalScale.y && console.warn("THREE.GLTFExporter: Normal scale components are different, ignoring Y and exporting X."), V.scale = M.normalScale.x), this.applyTextureTransform(V, M.normalMap), I.normalTexture = V; } if (M.aoMap) { var H = { index: this.processTexture(M.aoMap), texCoord: 1 }; M.aoMapIntensity !== 1 && (H.strength = M.aoMapIntensity), this.applyTextureTransform(H, M.aoMap), I.occlusionTexture = H; } M.transparent ? I.alphaMode = "BLEND" : 0 < M.alphaTest && (I.alphaMode = "MASK", I.alphaCutoff = M.alphaTest), M.side === l.DoubleSide && (I.doubleSided = !0), M.name !== "" && (I.name = M.name), this.serializeUserData(M, I), this._invokeAll(function(W) { W.writeMaterial && W.writeMaterial(M, I); }); var G = D.materials.push(I) - 1; return O.materials.set(M, G), G; } /** * Process mesh * @param {THREE.Mesh} mesh Mesh to process * @return {Integer|null} Index of the processed mesh in the "meshes" array */ processMesh(M) { var O = this.cache, D = this.json, I = [M.geometry.uuid]; if (Array.isArray(M.material)) for (var F = 0, z = M.material.length; F < z; F++) I.push(M.material[F].uuid); else I.push(M.material.uuid); var U = I.join(":"); if (O.meshes.has(U)) return O.meshes.get(U); var Z, re = M.geometry; if (Z = M.isLineSegments ? d.LINES : M.isLineLoop ? d.LINE_LOOP : M.isLine ? d.LINE_STRIP : M.isPoints ? d.POINTS : M.material.wireframe ? d.LINES : d.TRIANGLES, re.isBufferGeometry !== !0) throw new Error("THREE.GLTFExporter: Geometry is not of type THREE.BufferGeometry."); var K = {}, V = {}, H = [], G = [], W = { uv: "TEXCOORD_0", uv2: "TEXCOORD_1", color: "COLOR_0", skinWeight: "WEIGHTS_0", skinIndex: "JOINTS_0" }, Y = re.getAttribute("normal"); Y === void 0 || this.isNormalizedNormalAttribute(Y) || (console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."), re.setAttribute("normal", this.createNormalizedNormalAttribute(Y))); var X = null; for (var ie in re.attributes) if (ie.substr(0, 5) !== "morph") { var ue = re.attributes[ie]; ie = W[ie] || ie.toUpperCase(); var $ = /^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/; if ($.test(ie) || (ie = "_" + ie), O.attributes.has(this.getUID(ue))) { V[ie] = O.attributes.get(this.getUID(ue)); continue; } X = null; var J = ue.array; ie !== "JOINTS_0" || J instanceof Uint16Array || J instanceof Uint8Array || (console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'), X = new l.BufferAttribute(new Uint16Array(J), ue.itemSize, ue.normalized)); var ne = this.processAccessor(X || ue, re); ne !== null && (V[ie] = ne, O.attributes.set(this.getUID(ue), ne)); } if (Y !== void 0 && re.setAttribute("normal", Y), Object.keys(V).length === 0) return null; if (M.morphTargetInfluences !== void 0 && 0 < M.morphTargetInfluences.length) { var j = [], q = [], ge = {}; if (M.morphTargetDictionary !== void 0) for (var ye in M.morphTargetDictionary) ge[M.morphTargetDictionary[ye]] = ye; for (var _e = 0; _e < M.morphTargetInfluences.length; ++_e) { var Me = {}, Ce = !1; for (var B in re.morphAttributes) { if (B != "position" && B !== "normal" && B !== "color") { Ce || (console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."), Ce = !0); continue; } var ce = re.morphAttributes[B][_e], ve = B.toUpperCase(); W[B] && (ve = W[B]); var te = re.attributes[B]; if (O.attributes.has(this.getUID(ce))) { Me[ve] = O.attributes.get(this.getUID(ce)); continue; } var pe = te.clone(); if (!re.morphTargetsRelative) if (te) for (var fe = 0, he = ce.count; fe < he; fe++) te.count > fe && pe.setXYZ(fe, ce.getX(fe) - te.getX(fe), ce.getY(fe) - te.getY(fe), ce.getZ(fe) - te.getZ(fe)); else for (var Te = 0, He = ce.count; Te < He; Te++) pe.setXYZ(Te, 0, 0, 0); Me[ve] = this.processAccessor(pe, re), O.attributes.set(this.getUID(te), Me[ve]); } G.push(Me), j.push(M.morphTargetInfluences[_e]), M.morphTargetDictionary !== void 0 && q.push(ge[_e]); } K.weights = j, 0 < q.length && (K.extras = {}, K.extras.targetNames = q); } var We = Array.isArray(M.material); if (We && re.groups.length === 0) return null; for (var Ie, qe = We ? M.material : [M.material], De = We ? re.groups : [{ materialIndex: 0, start: void 0, count: void 0 }], $e = 0, nt = De.length; $e < nt; $e++) { if (Ie = { mode: Z, attributes: V }, this.serializeUserData(re, Ie), 0 < G.length && (Ie.targets = G), re.index !== null) { var lt = this.getUID(re.index); (De[$e].start !== void 0 || De[$e].count !== void 0) && (lt += ":" + De[$e].start + ":" + De[$e].count), O.attributes.has(lt) ? Ie.indices = O.attributes.get(lt) : (Ie.indices = this.processAccessor(re.index, re, De[$e].start, De[$e].count), O.attributes.set(lt, Ie.indices)), Ie.indices === null && delete Ie.indices; } var mt = this.processMaterial(qe[De[$e].materialIndex]); mt !== null && (Ie.material = mt), H.push(Ie); } K.primitives = H, D.meshes || (D.meshes = []), this._invokeAll(function(wt) { wt.writeMesh && wt.writeMesh(M, K); }); var _t = D.meshes.push(K) - 1; return O.meshes.set(U, _t), _t; } /** * Process camera * @param {THREE.Camera} camera Camera to process * @return {Integer} Index of the processed mesh in the "camera" array */ processCamera(M) { var O = this.json; O.cameras || (O.cameras = []); var D = M.isOrthographicCamera, I = { type: D ? "orthographic" : "perspective" }; return D ? I.orthographic = { xmag: 2 * M.right, ymag: 2 * M.top, zfar: 0 >= M.far ? 1e-3 : M.far, znear: 0 > M.near ? 0 : M.near } : I.perspective = { aspectRatio: M.aspect, yfov: l.MathUtils.degToRad(M.fov), zfar: 0 >= M.far ? 1e-3 : M.far, znear: 0 > M.near ? 0 : M.near }, M.name !== "" && (I.name = M.type), O.cameras.push(I) - 1; } /** * Creates glTF animation entry from AnimationClip object. * * Status: * - Only properties listed in PATH_PROPERTIES may be animated. * * @param {THREE.AnimationClip} clip * @param {THREE.Object3D} root * @return {number|null} */ processAnimation(M, O) { var D = this.json, I = this.nodeMap; D.animations || (D.animations = []), M = u.Utils.mergeMorphTargetTracks(M.clone(), O); for (var F = M.tracks, z = [], U = [], Z = 0; Z < F.length; ++Z) { var re = F[Z], K = l.PropertyBinding.parseTrackName(re.name), V = l.PropertyBinding.findNode(O, K.nodeName), H = f[K.propertyName]; if (K.objectName === "bones" && (V.isSkinnedMesh === !0 ? V = V.skeleton.getBoneByName(K.objectIndex) : V = void 0), !V || !H) return console.warn('THREE.GLTFExporter: Could not export animation track "%s".', re.name), null; var G = 1, W = re.values.length / re.times.length; H === f.morphTargetInfluences && (W /= V.morphTargetInfluences.length); var Y = void 0; re.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline === !0 ? (Y = "CUBICSPLINE", W /= 3) : re.getInterpolation() === l.InterpolateDiscrete ? Y = "STEP" : Y = "LINEAR", U.push({ input: this.processAccessor(new l.BufferAttribute(re.times, G)), output: this.processAccessor(new l.BufferAttribute(re.values, W)), interpolation: Y }), z.push({ sampler: U.length - 1, target: { node: I.get(V), path: H } }); } return D.animations.push({ name: M.name || "clip_" + D.animations.length, samplers: U, channels: z }), D.animations.length - 1; } /** * @param {THREE.Object3D} object * @return {number|null} */ processSkin(M) { var O = this.json, D = this.nodeMap, I = O.nodes[D.get(M)], F = M.skeleton; if (F === void 0) return null; var z = M.skeleton.bones[0]; if (z === void 0) return null; for (var U = [], Z = new Float32Array(16 * F.bones.length), re = new l.Matrix4(), K = 0; K < F.bones.length; ++K) U.push(D.get(F.bones[K])), re.copy(F.boneInverses[K]), re.multiply(M.bindMatrix).toArray(Z, 16 * K); O.skins === void 0 && (O.skins = []), O.skins.push({ inverseBindMatrices: this.processAccessor(new l.BufferAttribute(Z, 16)), joints: U, skeleton: D.get(z) }); var V = I.skin = O.skins.length - 1; return V; } /** * Process Object3D node * @param {THREE.Object3D} node Object3D to processNode * @return {Integer} Index of the node in the nodes list */ processNode(M) { var O = this.json, D = this.options, I = this.nodeMap; O.nodes || (O.nodes = []); var F = {}; if (D.trs) { var z = M.quaternion.toArray(), U = M.position.toArray(), Z = M.scale.toArray(); w(z, [0, 0, 0, 1]) || (F.rotation = z), w(U, [0, 0, 0]) || (F.translation = U), w(Z, [1, 1, 1]) || (F.scale = Z); } else M.matrixAutoUpdate && M.updateMatrix(), _(M.matrix) === !1 && (F.matrix = M.matrix.elements); if (M.name !== "" && (F.name = M.name + ""), this.serializeUserData(M, F), M.isMesh || M.isLine || M.isPoints) { var re = this.processMesh(M); re !== null && (F.mesh = re); } else M.isCamera && (F.camera = this.processCamera(M)); if (M.isSkinnedMesh && this.skins.push(M), 0 < M.children.length) { for (var K, V = [], H = 0, G = M.children.length; H < G; H++) if (K = M.children[H], K.visible || D.onlyVisible === !1) { var W = this.processNode(K); W !== null && V.push(W); } 0 < V.length && (F.children = V); } this._invokeAll(function(X) { X.writeNode && X.writeNode(M, F); }); var Y = O.nodes.push(F) - 1; return I.set(M, Y), Y; } /** * Process Scene * @param {Scene} node Scene to process */ processScene(M) { var O = this.json, D = this.options; O.scenes || (O.scenes = [], O.scene = 0); var I = {}; M.name !== "" && (I.name = M.name), O.scenes.push(I); for (var F, z = [], U = 0, Z = M.children.length; U < Z; U++) if (F = M.children[U], F.visible || D.onlyVisible === !1) { var re = this.processNode(F); re !== null && z.push(re); } 0 < z.length && (I.nodes = z), this.serializeUserData(M, I); } /** * Creates a Scene to hold a list of objects and parse it * @param {Array} objects List of objects to process */ processObjects(M) { var O = new l.Scene(); O.name = "AuxScene"; for (var D = 0; D < M.length; D++) O.children.push(M[D]); this.processScene(O); } /** * @param {THREE.Object3D|Array} input */ processInput(M) { var O = this.options; M = M instanceof Array ? M : [M], this._invokeAll(function(U) { U.beforeParse && U.beforeParse(M); }); for (var D = [], I = 0; I < M.length; I++) M[I] instanceof l.Scene ? this.processScene(M[I]) : D.push(M[I]); 0 < D.length && this.processObjects(D); for (var F = 0; F < this.skins.length; ++F) this.processSkin(this.skins[F]); for (var z = 0; z < O.animations.length; ++z) this.processAnimation(O.animations[z].clip, O.animations[z].mesh); this._invokeAll(function(U) { U.afterParse && U.afterParse(M); }); } _invokeAll(M) { for (var O = 0, D = this.plugins.length; O < D; O++) M(this.plugins[O]); } } class A { constructor(M) { this.writer = M, this.name = "KHR_lights_punctual"; } writeNode(M, O) { if (M.isLight) { if (!M.isDirectionalLight && !M.isPointLight && !M.isSpotLight) return void console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.", M); var D = this.writer, I = D.json, F = D.extensionsUsed, z = {}; M.name && (z.name = M.name), z.color = M.color.toArray(), z.intensity = M.intensity, M.isDirectionalLight ? z.type = "directional" : M.isPointLight ? (z.type = "point", 0 < M.distance && (z.range = M.distance)) : M.isSpotLight && (z.type = "spot", 0 < M.distance && (z.range = M.distance), z.spot = {}, z.spot.innerConeAngle = -1 * ((M.penumbra - 1) * M.angle), z.spot.outerConeAngle = M.angle), M.decay !== void 0 && M.decay !== 2 && console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."), M.target && (M.target.parent !== M || M.target.position.x !== 0 || M.target.position.y !== 0 || M.target.position.z !== -1) && console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."), F[this.name] || (I.extensions = I.extensions || {}, I.extensions[this.name] = { lights: [] }, F[this.name] = !0); var U = I.extensions[this.name].lights; U.push(z), O.extensions = O.extensions || {}, O.extensions[this.name] = { light: U.length - 1 }; } } } class k { constructor(M) { this.writer = M, this.name = "KHR_materials_unlit"; } writeMaterial(M, O) { if (M.isMeshBasicMaterial) { var D = this.writer, I = D.extensionsUsed; O.extensions = O.extensions || {}, O.extensions[this.name] = {}, I[this.name] = !0, O.pbrMetallicRoughness.metallicFactor = 0, O.pbrMetallicRoughness.roughnessFactor = 0.9; } } } class P { constructor(M) { this.writer = M, this.name = "KHR_materials_pbrSpecularGlossiness"; } writeMaterial(M, O) { if (M.isGLTFSpecularGlossinessMaterial) { var D = this.writer, I = D.extensionsUsed, F = {}; O.pbrMetallicRoughness.baseColorFactor && (F.diffuseFactor = O.pbrMetallicRoughness.baseColorFactor); var z = [1, 1, 1]; if (M.specular.toArray(z, 0), F.specularFactor = z, F.glossinessFactor = M.glossiness, O.pbrMetallicRoughness.baseColorTexture && (F.diffuseTexture = O.pbrMetallicRoughness.baseColorTexture), M.specularMap) { var U = { index: D.processTexture(M.specularMap) }; D.applyTextureTransform(U, M.specularMap), F.specularGlossinessTexture = U; } O.extensions = O.extensions || {}, O.extensions[this.name] = F, I[this.name] = !0; } } } u.Utils = { insertKeyframe: function(R, M) { var O, D = 1e-3, I = R.getValueSize(), F = new R.TimeBufferType(R.times.length + 1), z = new R.ValueBufferType(R.values.length + I), U = R.createInterpolant(new R.ValueBufferType(I)); if (R.times.length === 0) { F[0] = M; for (var Z = 0; Z < I; Z++) z[Z] = 0; O = 0; } else if (M < R.times[0]) { if (Math.abs(R.times[0] - M) < D) return 0; F[0] = M, F.set(R.times, 1), z.set(U.evaluate(M), 0), z.set(R.values, I), O = 0; } else if (M > R.times[R.times.length - 1]) { if (Math.abs(R.times[R.times.length - 1] - M) < D) return R.times.length - 1; F[F.length - 1] = M, F.set(R.times, 0), z.set(R.values, 0), z.set(U.evaluate(M), R.values.length), O = F.length - 1; } else for (var re = 0; re < R.times.length; re++) { if (Math.abs(R.times[re] - M) < D) return re; if (R.times[re] < M && R.times[re + 1] > M) { F.set(R.times.slice(0, re + 1), 0), F[re + 1] = M, F.set(R.times.slice(re + 1), re + 2), z.set(R.values.slice(0, (re + 1) * I), 0), z.set(U.evaluate(M), (re + 1) * I), z.set(R.values.slice((re + 1) * I), (re + 2) * I), O = re + 1; break; } } return R.times = F, R.values = z, O; }, mergeMorphTargetTracks: function(R, M) { for (var O = [], D = {}, I = R.tracks, F = 0; F < I.length; ++F) { var z = I[F], U = l.PropertyBinding.parseTrackName(z.name), Z = l.PropertyBinding.findNode(M, U.nodeName); if (U.propertyName !== "morphTargetInfluences" || U.propertyIndex === void 0) { O.push(z); continue; } if (z.createInterpolant !== z.InterpolantFactoryMethodDiscrete && z.createInterpolant !== z.InterpolantFactoryMethodLinear) { if (z.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline) throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation."); console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."), z = z.clone(), z.setInterpolation(l.InterpolateLinear); } var re = Z.morphTargetInfluences.length, K = Z.morphTargetDictionary[U.propertyIndex]; if (K === void 0) throw new Error("THREE.GLTFExporter: Morph target name not found: " + U.propertyIndex); var V = void 0; if (D[Z.uuid] === void 0) { V = z.clone(); for (var H = new V.ValueBufferType(re * V.times.length), G = 0; G < V.times.length; G++) H[G * re + K] = V.values[G]; V.name = (U.nodeName || "") + ".morphTargetInfluences", V.values = H, D[Z.uuid] = V, O.push(V); continue; } var W = z.createInterpolant(new z.ValueBufferType(1)); V = D[Z.uuid]; for (var Y = 0; Y < V.times.length; Y++) V.values[Y * re + K] = W.evaluate(V.times[Y]); for (var X, ie = 0; ie < z.times.length; ie++) X = this.insertKeyframe(V, z.times[ie]), V.values[X * re + K] = z.values[ie]; } return R.tracks = O, R; } }; }, /* 43 */ /***/ (o, s, c) => { var l = c(4), u = c(5).resolveURL, d = function() { this.nearPlane = 0.168248, this.farPlane = 6.82906, this.eyePosition = [0.5, -2.86496, 0.5], this.targetPosition = [0.5, 0.5, 0.5], this.upVector = [0, 0, 1]; var S = this; this.setFromObject = (_) => { var { nearPlane: b, farPlane: T, eyePosition: E, targetPosition: C, upVector: L } = _; S.nearPlane = b, S.farPlane = T, S.eyePosition = E, S.targetPosition = C, S.upVector = L; }; }, h = function(S, _, b, T) { var E = { NONE: -1, DEFAULT: 0, PATH: 1, SMOOTH_CAMERA_TRANSITION: 2, AUTO_TUMBLE: 3, ROTATE_TRANSITION: 4, MINIMAP: 5, SYNC_CONTROL: 6 }, C = { NONE: -1, ROTATE: 0, ZOOM: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_ZOOM: 4, TOUCH_PAN: 5, SCROLL: 6 }, L = { NONE: -1, FREE: 1, HORIZONTAL: 2, VERTICAL: 3 }, A = {}; A.MAIN = C.ROTATE, A.AUXILIARY = C.ZOOM, A.SECONDARY = C.PAN, this.cameraObject = S, this.domElement = _ === void 0 ? document : _, this.renderer = b, this.scene = T, this.tumble_rate = 1.5, this.pointer_x = 0, this.pointer_y = 0, this.pointer_x_start = 0, this.pointer_y_start = 0, this.previous_pointer_x = 0, this.previous_pointer_y = 0, this.near_plane_fly_debt = 0, this.touchZoomDistanceStart = 0, this.touchZoomDistanceEnd = 0, this.directionalLight = 0, this.scrollRate = 50, this.pixelHeight = 1; var k = 6e3, P = !0, R = 0, M = void 0, O = void 0, D = !1, I = 500, F = void 0, z = "default", U = E.DEFAULT, Z = void 0, re = void 0, K = void 0, V = 0, H = L.FREE; this._state = C.NONE; var G; this.targetTouchId = -1; var W = void 0, Y = new l.Vector3(), X = new l.Vector3(), ie = new l.Vector3(), ue = new l.Vector3(), $ = new l.Vector3(), J = new l.Vector3(), ne = new l.Vector3(), j = new l.Vector3(), q = new l.Sphere(), ge = new l.Vector3(), ye = !1, _e = void 0, Me = 0, Ce = { default: new d() }; Ce.default.nearPlane = 0.1, Ce.default.farPlane = 2e3, Ce.default.eyePosition = [0, 0, 0], Ce.default.targetPosition = [0, 0, -1], Ce.default.upVector = [0, 1, 0], this.cameraObject.target === void 0 && (this.cameraObject.target = new l.Vector3(...Ce.default.targetPosition)), this.calculateMaxAllowedDistance = (me) => { var Ne = me.getBoundingBox(); if (Ne) { Ne.getBoundingSphere(q), Me = 6 * q.radius; var Ue = 0; this.cameraObject && (Ue = this.cameraObject.position.distanceTo(q.center)), Me = Ue > Me ? Ue : Me; } else Me = 0; }, this.addViewport = (me, Ne) => { me && Ne && (Ce[me] = Ne); }, this.setDefaultViewport = (me) => !!(me && me in Ce) && (z = me, !0), this.getDefaultViewport = () => z, this.getViewportOfName = (me) => Ce[me], this.setCurrentViewport = (me) => me in Ce && (this.setCurrentCameraSettings(Ce[me]), !0), this.setRotationMode = (me) => { switch (me) { case "none": H = L.NONE; break; case "horizontal": H = L.HORIZONTAL; break; case "vertical": H = L.VERTICAL; break; case "free": default: H = L.FREE; } }, this.onResize = () => { W && (W = void 0), _e && _e.setCurrentCameraSettings(this.cameraObject, Ce[z]); }, this.getVisibleHeightAtZDepth = (me) => { var Ne = this.cameraObject.position.distanceTo(this.cameraObject.target); me < Ne ? me -= Ne : me += Ne; var Ue = this.cameraObject.fov * Math.PI / 180; return 2 * Math.tan(Ue / 2) * Math.abs(me); }, this.calculateHeightPerPixelAtZeroDepth = (me) => { var Ne = this.getVisibleHeightAtZDepth(0); return this.pixelHeight = Ne / me, this.pixelHeight; }, this.getNDCFromDocumentCoords = (me, Ne, Ue) => { Ie(!1); var Ke = Ue || new l.Vector2(), ct = 2 * ((me - W.left) / W.width) - 1, xt = 2 * -((Ne - W.top) / W.height) + 1; return Ke.set(ct, xt); }, this.getRelativeCoordsFromNDC = (me, Ne, Ue) => { Ie(!1); var Ke = Ue || new l.Vector2(); return Ke.x = (me + 1) * W.width / 2, Ke.y = (1 - Ne) * W.height / 2, Ke; }, this.setMouseButtonAction = (me, Ne) => { A[me] = C[Ne]; }; var B = () => { if (0 < Me) { var me = ge.distanceTo(q.center); return Me > me || this.cameraObject.position.distanceTo(q.center) > me; } return !0; }, ce = (me) => { ge.copy(this.cameraObject.position).add(me), B() && (this.cameraObject.target.add(me), this.cameraObject.position.add(me), this.updateDirectionalLight()); }, ve = (me) => { Ie(!1); var Ne; if (U === E.DEFAULT && (Ne = this.scene.getNormalisedMinimapCoordinates(this.renderer, me)), !Ne) me.button == 0 ? me.ctrlKey ? this._state = A.AUXILIARY : me.shiftKey ? this._state = A.SECONDARY : this._state = A.MAIN : me.button == 1 ? (me.preventDefault(), this._state = A.AUXILIARY) : me.button == 2 && (this._state = A.SECONDARY), this.pointer_x = me.clientX - W.left, this.pointer_y = me.clientY - W.top, this.pointer_x_start = this.pointer_x, this.pointer_y_start = this.pointer_y, this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y; else { U = E.MINIMAP; var Ue = this.scene.getMinimapDiffFromNormalised(Ne.x, Ne.y); ce(Ue); } }, te = (me) => { if (Ie(!1), W) if (this.pointer_x = me.clientX - W.left, this.pointer_y = me.clientY - W.top, U === E.MINIMAP) { var Ne = this.scene.getNormalisedMinimapCoordinates(this.renderer, me); if (Ne) { var Ue = this.scene.getMinimapDiffFromNormalised(Ne.x, Ne.y); ce(Ue); } } else this._state === C.NONE && G !== void 0 && G.move(this, me.clientX, me.clientY, this.renderer); }, pe = (me) => { this._state = C.NONE, U == E.MINIMAP && (U = E.DEFAULT), G !== void 0 && this.pointer_x_start == me.clientX - W.left && this.pointer_y_start == me.clientY - W.top && G.pick(this, me.clientX, me.clientY, this.renderer); }, fe = (me) => { this._state = C.NONE; }, he = (me) => { Ie(!1); var Ne = me.touches.length; if (Ne == 1) this._state = C.TOUCH_ROTATE, this.pointer_x = me.touches[0].clientX - W.left, this.pointer_y = me.touches[0].clientY - W.top, this.pointer_x_start = this.pointer_x, this.pointer_y_start = this.pointer_y, this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y; else if (Ne == 2) { this._state = C.TOUCH_ZOOM; var Ue = me.touches[0].clientX - me.touches[1].clientX, Ke = me.touches[0].clientY - me.touches[1].clientY; this.touchZoomDistanceEnd = this.touchZoomDistanceStart = Math.sqrt(Ue * Ue + Ke * Ke); } else Ne == 3 && (this._state = C.TOUCH_PAN, this.targetTouchId = me.touches[0].identifier, this.pointer_x = me.touches[0].clientX - W.left, this.pointer_y = me.touches[0].clientY - W.top, this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y); }, Te = (me) => { me.preventDefault(), me.stopPropagation(); var Ne = me.touches.length; if (Ne == 1) this.pointer_x = me.touches[0].clientX - W.left, this.pointer_y = me.touches[0].clientY - W.top; else if (Ne == 2) { if (this._state === C.TOUCH_ZOOM) { var Ue = me.touches[0].clientX - me.touches[1].clientX, Ke = me.touches[0].clientY - me.touches[1].clientY; this.touchZoomDistanceEnd = Math.sqrt(Ue * Ue + Ke * Ke); } } else if (Ne == 3 && this._state === C.TOUCH_PAN) for (var ct = 0; 3 > ct; ct++) me.touches[ct].identifier == this.targetTouchId && (this.pointer_x = me.touches[0].clientX - W.left, this.pointer_y = me.touches[0].clientY - W.top); }, He = (me) => { var Ne = me.touches.length; this.touchZoomDistanceStart = this.touchZoomDistanceEnd = 0, this.targetTouchId = -1, this._state = C.NONE, Ne == 1 && G !== void 0 && this.pointer_x_start == me.touches[0].clientX - W.left && this.pointer_y_start == me.touches[0].clientY - W.top && G.pick(this.cameraObject, me.touches[0].clientX, me.touches[0].clientY, this.renderer); }, We = () => { Ie(!0); }, Ie = (me) => { if (me || W === void 0) { var Ne = new IntersectionObserver((Ue) => { for (var Ke of Ue) W = Ke.boundingClientRect; Ne.disconnect(); }); Ne.observe(this.domElement); } }, qe = (me) => { Ie(!1), this._state = C.SCROLL; var Ne = 0; 0 < me.deltaY ? Ne = this.scrollRate : 0 > me.deltaY && (Ne = -1 * this.scrollRate), V += Ne, me.preventDefault(), me.stopImmediatePropagation(); }, De = () => { if (typeof this.cameraObject < "u") { var me = W.height, Ne = this.cameraObject.position.distanceTo(this.cameraObject.target), Ue = 0; this.cameraObject.far > this.cameraObject.near && Ne >= this.cameraObject.near && Ne <= this.cameraObject.far && (Ue = (Ne - this.cameraObject.near) / (this.cameraObject.far - this.cameraObject.near)), X.set(this.previous_pointer_x, me - this.previous_pointer_y, 0), ie.set(this.previous_pointer_x, me - this.previous_pointer_y, 1), ue.set(this.pointer_x, me - this.pointer_y, 0), $.set(this.pointer_x, me - this.pointer_y, 1), X.unproject(this.cameraObject), ie.unproject(this.cameraObject), ue.unproject(this.cameraObject), $.unproject(this.cameraObject); var Ke = -2e-3; ue.sub(X).multiplyScalar(1 - Ue), $.sub(ie).multiplyScalar(Ue), ue.add($).multiplyScalar(Ke), ce(ue); } this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y; }; this.getVectorsFromRotateAboutLookAtPoints = (me, Ne) => { me.normalize(), ne.copy(this.cameraObject.position).sub(this.cameraObject.target), j.copy(ne), ne.normalize(), 0.8 < Math.abs(ne.dot(me)) && ne.copy(this.cameraObject.up), X.crossVectors(me, ne).normalize(), ie.crossVectors(me, X); var Ue = me.dot(j), Ke = X.dot(j), ct = ie.dot(j), xt = me.dot(this.cameraObject.up), At = X.dot(this.cameraObject.up), Ft = ie.dot(this.cameraObject.up), zt = Math.cos(Ne), se = Math.sin(Ne); return ue.set(zt * X.x + se * ie.x, zt * X.y + se * ie.y, zt * X.z + se * ie.z), $.set(zt * ie.x - se * X.x, zt * ie.y - se * X.y, zt * ie.z - se * X.z), ne.copy(this.cameraObject.target), ne.x = ne.x + me.x * Ue + ue.x * Ke + $.x * ct, ne.y = ne.y + me.y * Ue + ue.y * Ke + $.y * ct, ne.z = ne.z + me.z * Ue + ue.z * Ke + $.z * ct, Y.set(me.x * xt + ue.x * At + $.x * Ft, me.y * xt + ue.y * At + $.y * Ft, me.z * xt + ue.z * At + $.z * Ft), { position: ne, up: Y }; }, this.rotateAboutLookAtpoint = (me, Ne) => { var Ue = this.getVectorsFromRotateAboutLookAtPoints(me, Ne); this.cameraObject.position.copy(Ue.position), this.updateDirectionalLight(), this.cameraObject.up.copy(Ue.up); }; var $e = () => { if (typeof this.cameraObject < "u") { var me = W.width, Ne = W.height; if (0 < me && 0 < Ne) { var Ue = 0.25 * (me + Ne), Ke = 0, ct = 0; (H === L.FREE || H === L.HORIZONTAL) && (Ke = this.pointer_x - this.previous_pointer_x), (H === L.FREE || H === L.VERTICAL) && (ct = this.previous_pointer_y - this.pointer_y); var xt = Math.sqrt(Ke * Ke + ct * ct); if (0 < xt) { var At = 1 * -ct / xt, Ft = 1 * Ke / xt, zt = 0; H === L.FREE && At * (this.pointer_x - 0.5 * (me - 1)) + Ft * (0.5 * (Ne - 1) - this.pointer_y); var se = Math.acos(zt / Ue) - 0.5 * Math.PI, ke = this.tumble_rate * xt / Ue; Y.copy(this.cameraObject.position).sub(this.cameraObject.target).normalize(), X.copy(this.cameraObject.up).normalize(), ie.copy(X).cross(Y).normalize().multiplyScalar(At), X.multiplyScalar(Ft), J.addVectors(ie, X).multiplyScalar(Math.cos(se)), Y.multiplyScalar(Math.sin(se)), J.add(Y), this.rotateAboutLookAtpoint(J, -ke); } } } this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y; }, nt = () => { var me = 0; return this._state === C.ZOOM ? me = this.previous_pointer_y - this.pointer_y : this._state === C.SCROLL ? me = V : (me = -1 * (this.touchZoomDistanceEnd - this.touchZoomDistanceStart), this.touchZoomDistanceStart = this.touchZoomDistanceEnd), me; }; this.changeZoomByScrollRateUnit = (me) => { var Ne = me * this.scrollRate; this.changeZoomByValue(Ne); }, this.changeZoomByValue = (me) => { if (typeof this.cameraObject < "u") { var Ne = W.height, Ue = this.cameraObject.position.clone(); Ue.sub(this.cameraObject.target); var Ke = Ue.length(), ct = 1.5 * me / Ne; if (0.01 < Ke + ct * Ke && (Ue.normalize(), ge.copy(this.cameraObject.position), ge.x += Ue.x * ct * Ke, ge.y += Ue.y * ct * Ke, ge.z += Ue.z * ct * Ke, B())) { this.cameraObject.position.copy(ge), this.updateDirectionalLight(); var xt = 1e-5; if (xt * this.cameraObject.far < this.cameraObject.near + ct * Ke + this.near_plane_fly_debt) this.near_plane_fly_debt != 0 && (this.near_plane_fly_debt += ct * Ke, 0 < this.near_plane_fly_debt ? (this.cameraObject.near += this.near_plane_fly_debt, this.cameraObject.far += this.near_plane_fly_debt, this.near_plane_fly_debt = 0) : (this.cameraObject.near += ct * Ke, this.cameraObject.far += ct * Ke)); else { if (this.near_plane_fly_debt == 0) { var At = this.cameraObject.near - xt * this.cameraObject.far; this.cameraObject.near = xt * this.cameraObject.far, this.cameraObject.far -= At, this.near_plane_fly_debt -= xt * this.cameraObject.far; } this.near_plane_fly_debt += ct * Ke; } ye = !0; } } }; var lt = () => { var me = nt(); this.changeZoomByValue(me), this._state === C.ZOOM && (this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y), this._state === C.SCROLL && (V = 0, this._state = C.NONE); }; this.setDirectionalLight = (me) => { this.directionalLight = me; }, this.updateDirectionalLight = () => { this.directionalLight != 0 && this.directionalLight.position.set(this.cameraObject.position.x, this.cameraObject.position.y, this.cameraObject.position.z); }, this.enable = function() { P = !0, this.domElement && this.domElement.addEventListener && (this.domElement.addEventListener("mousedown", ve, !1), this.domElement.addEventListener("mousemove", te, !1), this.domElement.addEventListener("mouseup", pe, !1), this.domElement.addEventListener("mouseleave", fe, !1), this.domElement.addEventListener("touchstart", he, !1), this.domElement.addEventListener("touchmove", Te, !1), this.domElement.addEventListener("touchend", He, !1), this.domElement.addEventListener("wheel", qe, !1), this.domElement.addEventListener("contextmenu", (me) => { me.preventDefault(); }, !1), this.domElement.addEventListener("mouseenter", We, !1)); }, this.disable = function() { P = !1, this.domElement && this.domElement.removeEventListener && (this.domElement.removeEventListener("mousedown", ve, !1), this.domElement.removeEventListener("mousemove", te, !1), this.domElement.removeEventListener("mouseup", pe, !1), this.domElement.removeEventListener("mouseleave", fe, !1), this.domElement.removeEventListener("touchstart", he, !1), this.domElement.removeEventListener("touchmove", Te, !1), this.domElement.removeEventListener("touchend", He, !1), this.domElement.removeEventListener("wheel", qe, !1), this.domElement.removeEventListener("mouseenter", We, !1), this.domElement.removeEventListener("contextmenu", (me) => { me.preventDefault(); }, !1)); }, this.loadPath = (me) => { M = me.CameraPath, O = me.NumberOfPoints; }, this.loadPathURL = (me, Ne) => { var Ue = new XMLHttpRequest(); Ue.onreadystatechange = () => { if (Ue.readyState == 4 && Ue.status == 200) { var ct = JSON.parse(Ue.responseText); this.loadPath(ct), Ne != null && typeof Ne == "function" && Ne(); } }; var Ke = u(me); Ue.open("GET", Ke, !0), Ue.send(); }, this.setPathDuration = (me) => { k = me, Z && Z.setDuration(k), re && re.setDuration(k); }, this.getPlayRate = () => I, this.setPlayRate = (me) => { I = me; }; var mt = (me) => { var Ne = R + me; Ne > k && (Ne -= k), R = Ne; }; this.getTime = () => R, this.setTime = (me) => { R = me > k ? k : 0 > me ? 0 : me; }, this.getNumberOfTimeFrame = () => O, this.getCurrentTimeFrame = () => { if (2 < O) { var me = R / k * (O - 1), Ne = Math.floor(me), Ue = 1 - (me - Ne), Ke = Math.ceil(me); return Ne == Ke ? Ne == O - 1 ? [Ne - 1, Ke, 0] : [Ne, Ke + 1, 1] : [Ne, Ke, Ue]; } return O == 1 ? [0, 0, 0] : void 0; }, this.setCurrentTimeFrame = (me) => { 2 < O && (R = k * me / (O - 1), 0 > R && (R = 0), R > k && (R = k)); }; var _t = (me) => { if (U === E.PATH && (mt(me), M)) { for (var Ne = this.getCurrentTimeFrame(), Ue = Ne[0], Ke = Ne[1], ct = Ne[2], xt = [M[3 * Ue], M[3 * Ue + 1], M[3 * Ue + 2]], At = [M[3 * Ke], M[3 * Ke + 1], M[3 * Ke + 2]], Ft = [], zt = 0; zt < xt.length; zt++) Ft.push(ct * xt[zt] + (1 - ct) * At[zt]); this.cameraObject.position.set(Ft[0], Ft[1], Ft[2]), this.cameraObject.target.set(At[0], At[1], At[2]), F && this.cameraObject.lookAt(this.cameraObject.target), D && (this.directionalLight.position.set(Ft[0], Ft[1], Ft[2]), this.directionalLight.target.position.set(At[0], At[1], At[2])); } }; this.calculatePathNow = () => { _t(0); }; var wt = () => { this._state === C.ROTATE || this._state === C.TOUCH_ROTATE ? $e() : this._state === C.PAN || this._state === C.TOUCH_PAN ? (De(), _e.triggerCallback()) : (this._state === C.ZOOM || this._state === C.TOUCH_ZOOM || this._state === C.SCROLL) && (_e.zoom(nt()), this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y, this._state === C.SCROLL && (this._state = C.NONE), V = 0, _e.triggerCallback()); }; this.update = (me) => { var Ne = me * I, Ue = P, Ke = !0; return U === E.PATH ? _t(Ne) : U === E.SMOOTH_CAMERA_TRANSITION && Z ? (Z.update(Ne), Z.isTransitionCompleted() && (U = E.DEFAULT), Ue = !1) : U === E.ROTATE_CAMERA_TRANSITION && re ? (re.update(Ne), re.isTransitionCompleted() && (U = E.DEFAULT), Ue = !1) : U === E.AUTO_TUMBLE && K ? K.update(Ne) : U === E.SYNC_CONTROL && _e ? (wt(), Ue = !1) : Ke = !1, Ue && (this._state !== C.NONE && (Ke = !0), this._state === C.ROTATE || this._state === C.TOUCH_ROTATE ? $e() : this._state === C.PAN || this._state === C.TOUCH_PAN ? De() : (this._state === C.ZOOM || this._state === C.TOUCH_ZOOM || this._state === C.SCROLL) && lt(), this._state !== C.NONE && U === E.AUTO_TUMBLE && K && K.stopOnCameraInput, this._state === C.SCROLL && (this._state = C.NONE)), F ? (Ke = !0, F.update()) : this.cameraObject.lookAt(this.cameraObject.target), Ke = Ke || ye, ye = !1, Ke; }, this.playPath = () => { U = E.PATH; }, this.stopPath = () => { U = E.DEFAULT; }, this.isPlayingPath = () => U === E.PATH, this.enableDirectionalLightUpdateWithPath = (me) => { D = me; }, this.enableDeviceOrientation = () => { F || (F = new x(this.cameraObject)); }, this.disableDeviceOrientation = () => { F && (F.dispose(), F = void 0); }, this.isDeviceOrientationEnabled = () => !!F, this.resetView = () => { var me = Ce[z]; this.cameraObject.near = me.nearPlane, this.cameraObject.far = me.farPlane, this.cameraObject.position.set(me.eyePosition[0], me.eyePosition[1], me.eyePosition[2]), this.cameraObject.target.set(me.targetPosition[0], me.targetPosition[1], me.targetPosition[2]), this.cameraObject.up.set(me.upVector[0], me.upVector[1], me.upVector[2]), this.cameraObject.updateProjectionMatrix(), this.updateDirectionalLight(); }, this.setCurrentCameraSettings = (me) => { me.nearPlane && (this.cameraObject.near = me.nearPlane), me.farPlane && (this.cameraObject.far = me.farPlane), me.eyePosition && this.cameraObject.position.set(me.eyePosition[0], me.eyePosition[1], me.eyePosition[2]), me.targetPosition && this.cameraObject.target.set(me.targetPosition[0], me.targetPosition[1], me.targetPosition[2]), me.upVector && this.cameraObject.up.set(me.upVector[0], me.upVector[1], me.upVector[2]), this.cameraObject.updateProjectionMatrix(), this.updateDirectionalLight(), ye = !0; }, this.getViewportFromCentreAndRadius = (me, Ne, Ue, Ke, ct, xt) => { var At = this.cameraObject.position.x - this.cameraObject.target.x, Ft = this.cameraObject.position.y - this.cameraObject.target.y, zt = this.cameraObject.position.z - this.cameraObject.target.z, se = 1 / Math.sqrt(At * At + Ft * Ft + zt * zt); At *= se, Ft *= se, zt *= se; var ke = [me, Ne, Ue], Ae = Ke / Math.tan(ct * Math.PI / 360), Oe = [me + At * Ae, Ne + Ft * Ae, Ue + zt * Ae], Ve = Ae + xt, ae = 0, Se = 0.95; ae = xt > Se * Ae ? (1 - Se) * Ae : Ae - xt; var Be = new d(); return Be.nearPlane = ae, Be.farPlane = Ve, Be.eyePosition = Oe, Be.targetPosition = ke, Be.upVector = [this.cameraObject.up.x, this.cameraObject.up.y, this.cameraObject.up.z], Be; }, this.getViewportFromBoundingBox = (me, Ne) => { var Ue = me.min.distanceTo(me.max) / 2 * Ne, Ke = (me.min.x + me.max.x) / 2, ct = (me.min.y + me.max.y) / 2, xt = (me.min.z + me.max.z) / 2, At = 4, Ft = this.getViewportFromCentreAndRadius(Ke, ct, xt, Ue, 40, Ue * At); return Ft; }, this.getCurrentViewport = () => { var me = new d(); return me.nearPlane = this.cameraObject.near, me.farPlane = this.cameraObject.far, me.eyePosition[0] = this.cameraObject.position.x, me.eyePosition[1] = this.cameraObject.position.y, me.eyePosition[2] = this.cameraObject.position.z, me.targetPosition[0] = this.cameraObject.target.x, me.targetPosition[1] = this.cameraObject.target.y, me.targetPosition[2] = this.cameraObject.target.z, me.upVector[0] = this.cameraObject.up.x, me.upVector[1] = this.cameraObject.up.y, me.upVector[2] = this.cameraObject.up.z, me; }, this.getDefaultEyePosition = () => eyePosition, this.getDefaultTargetPosition = () => targetPosition, this.cameraTransition = (me, Ne, Ue) => { re == null && (Z = new f(me, Ne, this, Ue)); }, this.rotateCameraTransition = (me, Ne, Ue) => { Z == null && (re = new p(me, Ne, this, Ue)); }, this.enableCameraTransition = () => { Z && (U = E.SMOOTH_CAMERA_TRANSITION), re && (U = E.ROTATE_CAMERA_TRANSITION); }, this.pauseCameraTransition = () => { U = E.DEFAULT; }, this.stopCameraTransition = () => { U = E.DEFAULT, Z = void 0, re = void 0; }, this.isTransitioningCamera = () => U === E.SMOOTH_CAMERA_TRANSITION || U === E.ROTATE_CAMERA_TRANSITION, this.autoTumble = (me, Ne, Ue) => { K = new y(me, Ne, Ue, this); }, this.enableAutoTumble = () => { U = E.AUTO_TUMBLE; }, this.stopAutoTumble = () => { U = E.DEFAULT, K = void 0; }, this.updateAutoTumble = () => { K && (K.requireUpdate = !0); }, this.isAutoTumble = () => U === E.AUTO_TUMBLE, this.enableRaycaster = (me, Ne, Ue) => { G == null && (G = new m(me, this.scene, Ne, Ue, this.renderer)); }, this.disableRaycaster = () => { G.disable(), G = void 0; }, this.isSyncControl = () => currentMpde === E.SYNC_CONTROL, this.enableSyncControl = () => (U = E.SYNC_CONTROL, _e || (_e = new w()), _e.setCurrentCameraSettings(this.cameraObject, Ce[z]), _e), this.disableSyncControl = () => { U = E.DEFAULT, this.cameraObject.zoom = 1, this.cameraObject.updateProjectionMatrix(); }, this.enable(); }, f = function(S, _, b, T) { var E = S.eyePosition, C = S.targetPosition, L = S.upVector, A = _.eyePosition, k = _.targetPosition, P = _.upVector, R = b, M = T, O = 0, D = !1; R.near = Math.min(S.nearPlane, _.nearPlane), R.far = Math.max(S.farPlane, _.farPlane), R.cameraObject.up.set(_.upVector[0], _.upVector[1], _.upVector[2]), this.setDuration = (z) => { M = z; }; var I = (z) => { var U = O + z; U > M && (U = M), O = U; }, F = () => { var z = O / M, U = [E[0] * (1 - z) + A[0] * z, E[1] * (1 - z) + A[1] * z, E[2] * (1 - z) + A[2] * z], Z = [C[0] * (1 - z) + k[0] * z, C[1] * (1 - z) + k[1] * z, C[2] * (1 - z) + k[2] * z]; L[0] * (1 - z) + P[0] * z, L[1] * (1 - z) + P[1] * z, L[2] * (1 - z) + P[2] * z, R.cameraObject.position.set(U[0], U[1], U[2]), R.cameraObject.target.set(Z[0], Z[1], Z[2]); }; this.update = (z) => { this.enabled === !1 || (I(z), F(), O == M && (D = !0)); }, this.isTransitionCompleted = () => D; }, p = function(S, _, b, T) { var E = S, C = _, L = b, A = T, k = 0, P = !1; this.setDuration = (M) => { A = M; }; var R = (M) => { var O = k, D = k + M; D > A && (D = A), k = D; var I = k - O, F = I / A, z = F * C; L.rotateAboutLookAtpoint(E, z); }; this.update = (M) => { this.enabled === !1 || (R(M), k == A && (P = !0)); }, this.isTransitionCompleted = () => P; }, m = function(S, _, b, T, E) { var C = S, L = _, A = E, k = b, P = T, R = new l.Raycaster(); R.params.Line.threshold = 0.1, R.params.Points.threshold = 1; var M = new l.Vector2(), O = !1, D = /* @__PURE__ */ new Date(), I = !1, F = 0, z = [], U = { zincCamera: void 0, x: -1, y: -1 }, Z = void 0; this.enable = () => { enable = !0; }, this.disable = () => { enable = !1; }, this.getIntersectsObject = (V) => { if (L !== C) { var H = C.getThreeJSScene(); A.render(H, V.cameraObject); } var G = Z || C.getPickableThreeJSObjects(); return z.length = 0, R.intersectObjects(G, !0, z); }, this.setPickableObjects = (V) => { V === void 0 ? Z = void 0 : (Z = [], V.forEach((H) => { H.getGroup() && H.getGroup().visible && Z.push(H.getGroup()); })); }, this.getIntersectsObjectWithOrigin = (V, H, G) => (R.set(H, G), this.getIntersectsObject(V)), this.getIntersectsObjectWithCamera = (V, H, G) => (V.getNDCFromDocumentCoords(H, G, M), R.setFromCamera(M, V.cameraObject), this.getIntersectsObject(V)), this.pick = (V, H, G) => { if (A && C && V && k) { this.getIntersectsObjectWithCamera(V, H, G); for (var W, Y = z.length, X = 0; X < Y; X++) if (W = z[X].object ? z[X].object.userData : void 0, W && W.isMarkerCluster && W.visible && W.clusterIsVisible(z[X].object.clusterIndex) && W.zoomToCluster(z[X].object.clusterIndex)) return; k(z, H, G); } }; var re = (V, H, G) => { if (A && C && V && P) { if (this.getIntersectsObjectWithCamera(V, H, G), D.setTime(Date.now()), z.length === 0) { if (I) return; I = !0; } else I = !1; P(z, H, G); } }; this.move = (V, H, G) => { A && C && V && P && (C.displayMarkers ? re(V, H, G) : (U.zincCamera = V, U.x = H, U.y = G, !O && (F = D ? Date.now() - D.getTime() : 250, 250 <= F ? re(V, H, G) : (O = !0, setTimeout(K(U), F))))); }; var K = (V) => function() { O = !1, re(V.zincCamera, V.x, V.y); }; }, y = function(S, _, b, T) { var E = new l.Vector3(), C = -_, L = T, A = S; this.stopOnCameraInput = b, this.requireUpdate = !0; var k = new l.Vector3(), P = new l.Vector3(), R = (M) => { var O = Math.sqrt(M[0] * M[0] + M[1] * M[1]), D = 4 * Math.abs(M[0]), I = 4 * Math.abs(M[1]), F = 0.25 * (D + I), z = -M[1] / O, U = M[0] / O, Z = z * M[0] + U * -M[1]; Z > F ? Z = F : Z < -F && (Z = -F); var re = Math.acos(Z / F) - 0.5 * Math.PI; E.copy(L.cameraObject.position).sub(L.cameraObject.target).normalize(), k.copy(L.cameraObject.up).normalize(), P.crossVectors(k, E).normalize().multiplyScalar(z), k.multiplyScalar(U), k.add(P).multiplyScalar(Math.cos(re)), E.multiplyScalar(Math.sin(re)).add(k); }; this.update = (M) => { this.enabled === !1 || (this.requireUpdate && (R(A), this.requireUpdate = !1), L.rotateAboutLookAtpoint(E, C * M / 1e3)); }; }, g = function() { this.type = "StereoCamera", this.aspect = 1, this.cameraL = new l.PerspectiveCamera(), this.cameraL.layers.enable(1), this.cameraL.matrixAutoUpdate = !1, this.cameraR = new l.PerspectiveCamera(), this.cameraR.layers.enable(2), this.cameraR.matrixAutoUpdate = !1; }; Object.assign(g.prototype, { update: (() => { var S, _, b, T, E, C, L = new l.Matrix4(), A = new l.Matrix4(); return function(k) { var P = S !== k.focus || _ !== k.fov || b !== k.aspect * this.aspect || T !== k.near || E !== k.far || C !== k.zoom; if (P) { S = k.focus, _ = k.fov, b = k.aspect * this.aspect, T = k.near, E = k.far, C = k.zoom; var R, M, O = k.projectionMatrix.clone(), D = 0.064 / 2, I = D * T / S, F = T * Math.tan(0.5 * (l.Math.DEG2RAD * _)) / k.zoom; A.elements[12] = -D, L.elements[12] = D, R = -F * b + I, M = F * b + I, O.elements[0] = 2 * T / (M - R), O.elements[8] = (M + R) / (M - R), this.cameraL.projectionMatrix.copy(O), R = -F * b - I, M = F * b - I, O.elements[0] = 2 * T / (M - R), O.elements[8] = (M + R) / (M - R), this.cameraR.projectionMatrix.copy(O); } this.cameraL.matrixWorld.copy(k.matrixWorld).multiply(A), this.cameraR.matrixWorld.copy(k.matrixWorld).multiply(L); }; })() }); var v = function(S) { var _ = new g(); _.aspect = 0.5, this.setSize = (b, T) => { S.setSize(b, T); }, this.render = (b, T) => { b.updateMatrixWorld(), T.parent === null && T.updateMatrixWorld(), _.update(T); var E = S.getSize(); S.setScissorTest(!0), S.clear(), S.setScissor(0, 0, E.width / 2, E.height), S.setViewport(0, 0, E.width / 2, E.height), S.render(b, _.cameraL), S.setScissor(E.width / 2, 0, E.width / 2, E.height), S.setViewport(E.width / 2, 0, E.width / 2, E.height), S.render(b, _.cameraR), S.setScissorTest(!1); }; }, x = function(S) { var _ = this; this.object = S, this.object.rotation.reorder("YXZ"), this.enabled = !0, this.deviceOrientation = {}, this.screenOrientation = 0; var b = (C) => { _.deviceOrientation = C; }, T = () => { typeof window < "u" && (_.screenOrientation = window.orientation || 0); }, E = (() => { var C = new l.Vector3(0, 0, 1), L = new l.Euler(), A = new l.Quaternion(), k = new l.Quaternion(-Math.sqrt(0.5), 0, 0, Math.sqrt(0.5)); return (P, R, M, O, D) => { var I = new l.Vector3(0, 0, 1); I.subVectors(P.target, P.position), L.set(M, R, -O, "YXZ"); var F = new l.Quaternion(); F.setFromEuler(L), F.multiply(k), F.multiply(A.setFromAxisAngle(C, -D)), I.applyQuaternion(F), I.addVectors(P.position, I), P.lookAt(I); }; })(); this.connect = () => { T(), typeof window < "u" && (window.addEventListener("orientationchange", T, !1), window.addEventListener("deviceorientation", b, !1)), _.enabled = !0; }, this.disconnect = () => { typeof window < "u" && (window.removeEventListener("orientationchange", T, !1), window.removeEventListener("deviceorientation", b, !1)), _.enabled = !1; }, this.update = () => { if (_.enabled !== !1) { var C = _.deviceOrientation.alpha ? l.Math.degToRad(_.deviceOrientation.alpha) : 0, L = _.deviceOrientation.beta ? l.Math.degToRad(_.deviceOrientation.beta) : 0, A = _.deviceOrientation.gamma ? l.Math.degToRad(_.deviceOrientation.gamma) : 0, k = _.screenOrientation ? l.Math.degToRad(_.screenOrientation) : 0; E(_.object, C, L, A, k); } }, this.dispose = function() { this.disconnect(); }, this.connect(); }, w = function() { var S = void 0, _ = void 0, b = void 0, T = new l.Vector3(), E = new l.Vector3(), C = new l.Vector3(), L = new l.Vector3(), A = void 0; this.setCurrentCameraSettings = (k, P) => { S = k.clone(), _ = k, b = P, S.near = b.nearPlane, b.farPlane && (S.far = b.farPlane), b.eyePosition && S.position.set(b.eyePosition[0], b.eyePosition[1], b.eyePosition[2]), b.upVector && S.up.set(b.upVector[0], b.upVector[1], b.upVector[2]), b.targetPosition && (S.target = new l.Vector3(b.targetPosition[0], b.targetPosition[1], b.targetPosition[2]), S.lookAt(S.target)), S.updateProjectionMatrix(), T.copy(S.position).project(S), E.copy(S.target).project(S); }, this.getCurrentPosition = () => (E.copy(_.target).project(S), [E.x, E.y]), this.zoom = (k) => { var P = 2e-3 * k, R = Math.max(_.zoom - P, 1); _.zoom = R, _.updateProjectionMatrix(); }, this.zoomToBox = (k, P) => { k.getCenter(C), C.project(S), this.setCenterZoom([C.x, C.y], P); }, this.getPanZoom = () => ({ target: this.getCurrentPosition(), zoom: _.zoom }), this.setCenterZoom = (k, P) => { C.set(k[0], k[1], E.z).unproject(S), L.copy(C).sub(_.target), _.target.copy(C), _.lookAt(_.target), _.position.add(L), _.zoom = P, _.updateProjectionMatrix(); }, this.setEventCallback = (k) => { (k === void 0 || typeof k == "function") && (A = k); }, this.triggerCallback = () => { A !== void 0 && typeof A == "function" && A(); }; }; s.Viewport = d, s.CameraControls = h, s.SmoothCameraTransition = f, s.RotateCameraTransition = p, s.RayCaster = m, s.CameraAutoTumble = y, s.StereoEffect = v, s.NDCCameraControl = w; }, /* 44 */ /***/ (o, s, c) => { var { Group: l, Matrix4: u } = c(4), d = c(22).Pointset; c(24).Lines; var h = c(45).Lines2, f = c(3).Geometry, p = c(4), m = 0, y = function() { return "re" + m++; }, g = function(v, x) { var w = v, S = new l(); S.matrixAutoUpdate = !1, S.userData = this; var _ = [], b = "", T = [], E = x, C = new u(), L = 3e3; C.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this.pickableUpdateRequired = !0, this.isRegion = !0, this.uuid = y(), this.hideAllPrimitives = () => { _.forEach((A) => A.hideAllPrimitives()), T.forEach((A) => A.setVisibility(!1)); }, this.showAllPrimitives = () => { _.forEach((A) => A.showAllPrimitives()), T.forEach((A) => A.setVisibility(!0)); }, this.setVisibility = (A) => { A != S.visible && (S.visible = A, this.pickableUpdateRequired = !0); }, this.getVisibility = () => S.visible, this.getGroup = () => S, this.setTransformation = (A) => { C.set(...A), S.matrix.copy(C), S.updateMatrixWorld(); }, this.setName = (A) => { A && A !== "" && (b = A); }, this.getName = () => b, this.getParent = () => w, this.getFullSeparatedPath = () => { var A = []; if (b !== "") { A.push(b); for (var k, P = w; P !== void 0; ) k = P.getName(), k !== "" && A.unshift(k), P = P.getParent(); } return A; }, this.getFullPath = () => { var A = this.getFullSeparatedPath(); if (0 < A.length) { var k = A.shift(); return A.forEach((P) => { k = k.concat("/", P); }), k; } return ""; }, this.createChild = (A) => { var k = new g(this, E); return k.setName(A), _.push(k), S.add(k.getGroup()), k; }, this.getChildWithName = (A) => { if (A) { for (var k = A.toLowerCase(), P = 0; P < _.length; P++) if (_[P].getName().toLowerCase() === k) return _[P]; } }, this.findChildFromSeparatedPath = (A) => { if (A && 0 < A.length && A[0] === "" && A.shift(), A && 0 < A.length) { var k = this.getChildWithName(A[0]); return k ? (A.shift(), k.findChildFromSeparatedPath(A)) : void 0; } return this; }, this.findChildFromPath = (A) => { var k = A.split("/"); return this.findChildFromSeparatedPath(k); }, this.createChildFromSeparatedPath = (A) => { if (0 < A.length && A[0] === "" && A.shift(), 0 < A.length) { var k = this.getChildWithName(A[0]); return k || (k = this.createChild(A[0])), A.shift(), k.createChildFromSeparatedPath(A); } return this; }, this.createChildFromPath = (A) => { var k = A.split("/"); return this.createChildFromSeparatedPath(k); }, this.findOrCreateChildFromPath = (A) => { var k = this.findChildFromPath(A); return k || (k = this.createChildFromPath(A)), k; }, this.addZincObject = (A) => { A && (A.setRegion(this), S.add(A.getGroup()), T.push(A), this.pickableUpdateRequired = !0, E && E.triggerObjectAddedCallback(A)); }, this.removeZincObject = (A) => { for (var k = 0; k < T.length; k++) if (A === T[k]) return S.remove(A.getGroup()), T.splice(k, 1), E && E.triggerObjectRemovedCallback(A), A.dispose(), void (this.pickableUpdateRequired = !0); }, this.checkPickableUpdateRequred = (A) => { if (this.pickableUpdateRequired) return !0; if (A) { for (var k = !1, P = 0; P < _.length; P++) if (k = _[P].checkPickableUpdateRequred(A), k) return !0; } return !1; }, this.getPickableThreeJSObjects = (A, k) => (S.visible && (T.forEach((P) => { if (P.getGroup() && P.getGroup().visible) { var R = P.marker; R && R.isEnabled() && A.push(R.getMorph()), A.push(P.getGroup()); } }), k && _.forEach((P) => { P.getPickableThreeJSObjects(A, k); }), this.pickableUpdateRequired = !1), A), this.setDuration = (A) => { L = A, T.forEach((k) => k.setDuration(A)), _.forEach((k) => k.setDuration(A)); }, this.getDuration = () => L, this.getBoundingBox = (A) => { var k, P; return T.forEach((R) => { P = R.getBoundingBox(), P && (k == null ? k = P.clone() : k.union(P)); }), A && _.forEach((R) => { P = R.getBoundingBox(A), P && (k == null ? k = P.clone() : k.union(P)); }), k; }, this.clear = (A) => { A && _.forEach((k) => k.clear(A)), T.forEach((k) => { S.remove(k.getGroup()), k.dispose(); }), _ = [], T = []; }, this.objectIsInRegion = (A, k) => { for (var P = 0; P < T.length; P++) if (A === T[P]) return !0; if (k) { for (var R = 0; R < _.length; R++) if (_[R].objectIsInRegion(A, k)) return !0; } return !1; }, this.forEachGeometry = (A, k) => { T.forEach((P) => { P.isGeometry && A(P); }), k && _.forEach((P) => P.forEachGeometry(A, k)); }, this.forEachGlyphset = (A, k) => { T.forEach((P) => { P.isGlyphset && A(P); }), k && _.forEach((P) => P.forEachGlyphset(A, k)); }, this.forEachPointset = (A, k) => { T.forEach((P) => { P.isPointset && A(P); }), k && _.forEach((P) => P.forEachPointset(A, k)); }, this.forEachLine = (A, k) => { T.forEach((P) => { P.isLines && A(P); }), k && _.forEach((P) => P.forEachLine(A, k)); }, this.findObjectsWithAnatomicalId = (A, k) => (T.forEach((P) => { P.anatomicalId === A && objectsArray.push(P); }), k && _.forEach((P) => { var R = P.findObjectsWithAnatomicalId(A, k); objectsArray.push(...R); }), objectsArray), this.findObjectsWithGroupName = (A, k) => { var P = []; return T.forEach((R) => { var M = R.groupName ? R.groupName.toLowerCase() : R.groupName, O = A && A.toLowerCase(); M === O && P.push(R); }), k && _.forEach((R) => { var M = R.findObjectsWithGroupName(A, k); P.push(...M); }), P; }, this.findGeometriesWithGroupName = (A, k) => { var P = this.findObjectsWithGroupName(A, k), R = P.filter((M) => M.isGeometry); return R; }, this.findPointsetsWithGroupName = (A, k) => { var P = this.findObjectsWithGroupName(A, k), R = P.filter((M) => M.isPointset); return R; }, this.findGlyphsetsWithGroupName = (A, k) => { var P = this.findObjectsWithGroupName(A, k), R = P.filter((M) => M.isGlyphset); return R; }, this.findLinesWithGroupName = (A, k) => { var P = this.findObjectsWithGroupName(A, k), R = P.filter((M) => M.isLines); return R; }, this.getAllObjects = (A) => { var k = [...T]; return A && _.forEach((P) => { var R = P.getAllObjects(A); k.push(...R); }), k; }, this.getChildRegions = (A) => { var k = [..._]; return A && _.forEach((P) => { var R = P.getChildRegions(A); k.push(...R); }), k; }, this.getCurrentTime = () => { if (T[0] != null) return T[0].getCurrentTime(); for (var A, k = 0; k < _.length; k++) if (A = _[k].getCurrentTime(), A !== -1) return A; return -1; }, this.setMorphTime = (A, k) => { T.forEach((P) => { P.setMorphTime(A); }), k && _.forEach((P) => { P.setMorphTime(A); }); }, this.isTimeVarying = () => { for (var A = 0; A < T.length; A++) if (T[A].isTimeVarying()) return !0; for (var k = 0; k < _.length; k++) if (_[k].isTimeVarying()) return !0; return !1; }, this.renderGeometries = (A, k, P, R, M, O) => { var D, I = this.getAllObjects(O); I.forEach((F) => { F.render(A * k, P, R, M); }), M && P === !1 && (D = M.markerCluster) !== null && D !== void 0 && D.markerUpdateRequired && M.markerCluster.calculate(); }, this.createPoints = (A, k, P, R) => { var M = !1, O = this.findObjectsWithGroupName(A, !1), D = O.findIndex((F) => F.isPointset), I = -1 < D ? O[D] : new d(); return I.addPoints(k, P, R), D === -1 ? (I.setName(A), this.addZincObject(I), M = !0) : this.pickableUpdateRequired = !0, { zincObject: I, isNew: M }; }, this.createLines = (A, k, P) => { var R = !1, M = this.findObjectsWithGroupName(A, !1), O = M.findIndex((I) => I.isLines), D = -1 < O ? M[O] : new h(); return D.addLines(k, P), O === -1 ? (D.setName(A), this.addZincObject(D), R = !0) : this.pickableUpdateRequired = !0, { zincObject: D, isNew: R }; }, this.createGeometryFromThreeJSGeometry = (A, k, P, R, M, O) => { var D = new f(), I = new p.MeshPhongMaterial({ color: P, morphTargets: !1, morphNormals: !1, transparent: !0, opacity: R, side: p.DoubleSide }); return D.createMesh(k, I, { localTimeEnabled: !1, localMorphColour: !1 }), D.getMorph() ? (D.setVisibility(!1), D.setName(A), D.setRenderOrder(O), this.addZincObject(D), D) : void 0; }; }; s.Region = g; }, /* 45 */ /***/ (o, s, c) => { c(4), c(5).toBufferGeometry; var l = c(46).LineSegments2, u = c(48).LineMaterial, d = c(47).LineSegmentsGeometry, h = function() { c(24).Lines.call(this), this.isLines2 = !0; var f = Array(300); this.createLineSegment = (p, m, y) => { if (p && m) { var g = new d(); g.setPositions(p), g.colorsNeedUpdate = !0; var v = new l(g, m); v.scale.set(1, 1, 1), v.computeLineDistances(), this.setMesh(v, y.localTimeEnabled, y.localMorphColour); } }, this.setWidth = (p) => { this.morph && this.morph.material && (this.morph.material.linewidth = p, this.morph.material.needsUpdate = !0); }, this.addVertices = function(p) { if (p && p.length) { var m = this.getMorph(); m || (this.drawRange = 0); var y = 3 * this.drawRange; if (p.forEach((g) => { f[y++] = g[0], f[y++] = g[1], f[y++] = g[2], this.drawRange++; }), !m) for (; 300 > y; ) f[y++] = p[0][0], f[y++] = p[0][1], f[y++] = p[0][2]; m && (m.geometry.setPositions(f), m.computeLineDistances(), this.boundingBoxUpdateRequired = !0); } return f; }, this.getVerticesByFaceIndex = function(p) { var m = 3 * (2 * p), y = this.getMorph(); if (y && 3 * this.drawRange > m) { var g = y.geometry.getAttribute("instanceStart"); return [[g.data.array[m], g.data.array[++m], g.data.array[++m]], [g.data.array[++m], g.data.array[++m], g.data.array[++m]]]; } return []; }, this.editVertices = function(p, m) { if (p && p.length) { var y = this.getMorph(), g = m + p.length - 1; if (!y || 0 > m || g >= this.drawRange) return; var v = 3 * m; for (p.forEach((x) => { f[v++] = x[0], f[v++] = x[1], f[v++] = x[2]; }), v = 3 * this.drawRange; 300 > v; ) f[v++] = p[0][0], f[v++] = p[0][1], f[v++] = p[0][2]; y.geometry.setPositions(f), y.computeLineDistances(), this.boundingBoxUpdateRequired = !0; } return f; }, this.addLines = (p, m) => { if (p && 0 < p.length) { this.addVertices(p); var y = this.getMorph(); if (!y) { var g = new u({ color: m, linewidth: 1, vertexColors: !1, worldUnits: !1 }); g.resolution.set(window.innerWidth, window.innerHeight), this.createLineSegment(f, g, { localTimeEnabled: !1, localMorphColour: !1 }); } this.region && (this.region.pickableUpdateRequired = !0); } }, this.render = () => { var p = this.getMorph().material; p.resolution.set(window.innerWidth, window.innerHeight); }; }; h.prototype = Object.create(c(24).Lines.prototype), h.prototype.constructor = h, s.Lines2 = h; }, /* 46 */ /***/ (o, s, c) => { c.r(s), c.d(s, { /* harmony export */ LineSegments2: () => ( /* binding */ T ) /* harmony export */ }); var l = c(4), u = c(47), d = c(48), h = new l.Vector3(), f = new l.Vector3(), p = new l.Vector4(), m = new l.Vector4(), y = new l.Vector4(), g = new l.Vector3(), v = new l.Matrix4(), x = new l.Line3(), w = new l.Vector3(), S = new l.Box3(), _ = new l.Sphere(), b = new l.Vector4(); class T extends l.Mesh { constructor() { var C = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : new u.LineSegmentsGeometry(), L = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : new d.LineMaterial({ color: 16777215 * Math.random() }); super(C, L), this.type = "LineSegments2"; } // for backwards-compatability, but could be a method of LineSegmentsGeometry... computeLineDistances() { for (var C = this.geometry, L = C.attributes.instanceStart, A = C.attributes.instanceEnd, k = new Float32Array(2 * L.count), P = 0, R = 0, M = L.count; P < M; P++, R += 2) h.fromBufferAttribute(L, P), f.fromBufferAttribute(A, P), k[R] = R == 0 ? 0 : k[R - 1], k[R + 1] = k[R] + h.distanceTo(f); var O = new l.InstancedInterleavedBuffer(k, 2, 1); return C.setAttribute("instanceDistanceStart", new l.InterleavedBufferAttribute(O, 1, 0)), C.setAttribute("instanceDistanceEnd", new l.InterleavedBufferAttribute(O, 1, 1)), this; } raycast(C, L) { C.camera === null && console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.'); var A = C.params.Line2 === void 0 ? 0 : C.params.Line2.threshold || 0, k = C.ray, P = C.camera, R = P.projectionMatrix, M = this.matrixWorld, O = this.geometry, D = this.material, I = D.resolution, F = D.linewidth + A, z = O.attributes.instanceStart, U = O.attributes.instanceEnd, Z = -P.near, re = 2 * Math.max(F / I.width, F / I.height); O.boundingSphere === null && O.computeBoundingSphere(), _.copy(O.boundingSphere).applyMatrix4(M); var K = Math.max(P.near, _.distanceToPoint(k.origin)); b.set(0, 0, -K, 1).applyMatrix4(P.projectionMatrix), b.multiplyScalar(1 / b.w), b.applyMatrix4(P.projectionMatrixInverse); var V = 0.5 * Math.abs(re / b.w); if (_.radius += V, C.ray.intersectsSphere(_) !== !1) { O.boundingBox === null && O.computeBoundingBox(), S.copy(O.boundingBox).applyMatrix4(M); var H = Math.max(P.near, S.distanceToPoint(k.origin)); b.set(0, 0, -H, 1).applyMatrix4(P.projectionMatrix), b.multiplyScalar(1 / b.w), b.applyMatrix4(P.projectionMatrixInverse); var G = 0.5 * Math.abs(re / b.w); if (S.max.x += G, S.max.y += G, S.max.z += G, S.min.x -= G, S.min.y -= G, S.min.z -= G, C.ray.intersectsBox(S) !== !1) { k.at(1, y), y.w = 1, y.applyMatrix4(P.matrixWorldInverse), y.applyMatrix4(R), y.multiplyScalar(1 / y.w), y.x *= I.x / 2, y.y *= I.y / 2, y.z = 0, g.copy(y), v.multiplyMatrices(P.matrixWorldInverse, M); for (var W = 0, Y = z.count; W < Y; W++) { p.fromBufferAttribute(z, W), m.fromBufferAttribute(U, W), p.w = 1, m.w = 1, p.applyMatrix4(v), m.applyMatrix4(v); var X = p.z > Z && m.z > Z; if (!X) { if (p.z > Z) { var ie = p.z - m.z, ue = (p.z - Z) / ie; p.lerp(m, ue); } else if (m.z > Z) { var $ = m.z - p.z, J = (m.z - Z) / $; m.lerp(p, J); } p.applyMatrix4(R), m.applyMatrix4(R), p.multiplyScalar(1 / p.w), m.multiplyScalar(1 / m.w), p.x *= I.x / 2, p.y *= I.y / 2, m.x *= I.x / 2, m.y *= I.y / 2, x.start.copy(p), x.start.z = 0, x.end.copy(m), x.end.z = 0; var ne = x.closestPointToPointParameter(g, !0); x.at(ne, w); var j = l.MathUtils.lerp(p.z, m.z, ne), q = -1 <= j && 1 >= j, ge = g.distanceTo(w) < 0.5 * F; if (q && ge) { x.start.fromBufferAttribute(z, W), x.end.fromBufferAttribute(U, W), x.start.applyMatrix4(M), x.end.applyMatrix4(M); var ye = new l.Vector3(), _e = new l.Vector3(); k.distanceSqToSegment(x.start, x.end, _e, ye), L.push({ point: _e, pointOnLine: ye, distance: k.origin.distanceTo(_e), object: this, face: null, faceIndex: W, uv: null, uv2: null }); } } } } } } } T.prototype.LineSegments2 = !0; }, /* 47 */ /***/ (o, s, c) => { c.r(s), c.d(s, { /* harmony export */ LineSegmentsGeometry: () => ( /* binding */ h ) /* harmony export */ }); var l = c(4), u = new l.Box3(), d = new l.Vector3(); class h extends l.InstancedBufferGeometry { constructor() { super(), this.type = "LineSegmentsGeometry", this.setIndex([0, 2, 1, 2, 3, 1, 2, 4, 3, 4, 5, 3, 4, 6, 5, 6, 7, 5]), this.setAttribute("position", new l.Float32BufferAttribute([-1, 2, 0, 1, 2, 0, -1, 1, 0, 1, 1, 0, -1, 0, 0, 1, 0, 0, -1, -1, 0, 1, -1, 0], 3)), this.setAttribute("uv", new l.Float32BufferAttribute([-1, 2, 1, 2, -1, 1, 1, 1, -1, -1, 1, -1, -1, -2, 1, -2], 2)); } applyMatrix4(p) { var m = this.attributes.instanceStart, y = this.attributes.instanceEnd; return m !== void 0 && (m.applyMatrix4(p), y.applyMatrix4(p), m.needsUpdate = !0), this.boundingBox !== null && this.computeBoundingBox(), this.boundingSphere !== null && this.computeBoundingSphere(), this; } setPositions(p) { var m; p instanceof Float32Array ? m = p : Array.isArray(p) && (m = new Float32Array(p)); var y = new l.InstancedInterleavedBuffer(m, 6, 1); return this.setAttribute("instanceStart", new l.InterleavedBufferAttribute(y, 3, 0)), this.setAttribute("instanceEnd", new l.InterleavedBufferAttribute(y, 3, 3)), this.computeBoundingBox(), this.computeBoundingSphere(), this; } setColors(p) { var m; p instanceof Float32Array ? m = p : Array.isArray(p) && (m = new Float32Array(p)); var y = new l.InstancedInterleavedBuffer(m, 6, 1); return this.setAttribute("instanceColorStart", new l.InterleavedBufferAttribute(y, 3, 0)), this.setAttribute("instanceColorEnd", new l.InterleavedBufferAttribute(y, 3, 3)), this; } fromWireframeGeometry(p) { return this.setPositions(p.attributes.position.array), this; } fromEdgesGeometry(p) { return this.setPositions(p.attributes.position.array), this; } fromMesh(p) { return this.fromWireframeGeometry(new l.WireframeGeometry(p.geometry)), this; } fromLineSegments(p) { var m = p.geometry; return m.isGeometry ? void console.error("THREE.LineSegmentsGeometry no longer supports Geometry. Use THREE.BufferGeometry instead.") : (m.isBufferGeometry && this.setPositions(m.attributes.position.array), this); } computeBoundingBox() { this.boundingBox === null && (this.boundingBox = new l.Box3()); var p = this.attributes.instanceStart, m = this.attributes.instanceEnd; p !== void 0 && m !== void 0 && (this.boundingBox.setFromBufferAttribute(p), u.setFromBufferAttribute(m), this.boundingBox.union(u)); } computeBoundingSphere() { this.boundingSphere === null && (this.boundingSphere = new l.Sphere()), this.boundingBox === null && this.computeBoundingBox(); var p = this.attributes.instanceStart, m = this.attributes.instanceEnd; if (p !== void 0 && m !== void 0) { var y = this.boundingSphere.center; this.boundingBox.getCenter(y); for (var g = 0, v = 0, x = p.count; v < x; v++) d.fromBufferAttribute(p, v), g = Math.max(g, y.distanceToSquared(d)), d.fromBufferAttribute(m, v), g = Math.max(g, y.distanceToSquared(d)); this.boundingSphere.radius = Math.sqrt(g), isNaN(this.boundingSphere.radius) && console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.", this); } } toJSON() { } applyMatrix(p) { return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."), this.applyMatrix4(p); } } h.prototype.isLineSegmentsGeometry = !0; }, /* 48 */ /***/ (o, s, c) => { c.r(s), c.d(s, { /* harmony export */ LineMaterial: () => ( /* binding */ u ) /* harmony export */ }); var l = c(4); l.UniformsLib.line = { linewidth: { value: 1 }, resolution: { value: new l.Vector2(1, 1) }, dashScale: { value: 1 }, dashSize: { value: 1 }, dashOffset: { value: 0 }, gapSize: { value: 1 }, // todo FIX - maybe change to totalSize opacity: { value: 1 } }, l.ShaderLib.line = { uniforms: l.UniformsUtils.merge([l.UniformsLib.common, l.UniformsLib.fog, l.UniformsLib.line]), vertexShader: ( /* glsl */ ` #include #include #include #include #include uniform float linewidth; uniform vec2 resolution; attribute vec3 instanceStart; attribute vec3 instanceEnd; attribute vec3 instanceColorStart; attribute vec3 instanceColorEnd; varying vec2 vUv; #ifdef USE_DASH uniform float dashScale; attribute float instanceDistanceStart; attribute float instanceDistanceEnd; varying float vLineDistance; #endif void trimSegment( const in vec4 start, inout vec4 end ) { // trim end segment so it terminates between the camera plane and the near plane // conservative estimate of the near plane float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column float nearEstimate = - 0.5 * b / a; float alpha = ( nearEstimate - start.z ) / ( end.z - start.z ); end.xyz = mix( start.xyz, end.xyz, alpha ); } void main() { #ifdef USE_COLOR vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd; #endif #ifdef USE_DASH vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd; #endif float aspect = resolution.x / resolution.y; vUv = uv; // camera space vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 ); vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 ); // special case for perspective projection, and segments that terminate either in, or behind, the camera plane // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space // but we need to perform ndc-space calculations in the shader, so we must address this issue directly // perhaps there is a more elegant solution -- WestLangley bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column if ( perspective ) { if ( start.z < 0.0 && end.z >= 0.0 ) { trimSegment( start, end ); } else if ( end.z < 0.0 && start.z >= 0.0 ) { trimSegment( end, start ); } } // clip space vec4 clipStart = projectionMatrix * start; vec4 clipEnd = projectionMatrix * end; // ndc space vec2 ndcStart = clipStart.xy / clipStart.w; vec2 ndcEnd = clipEnd.xy / clipEnd.w; // direction vec2 dir = ndcEnd - ndcStart; // account for clip-space aspect ratio dir.x *= aspect; dir = normalize( dir ); // perpendicular to dir vec2 offset = vec2( dir.y, - dir.x ); // undo aspect ratio adjustment dir.x /= aspect; offset.x /= aspect; // sign flip if ( position.x < 0.0 ) offset *= - 1.0; // endcaps if ( position.y < 0.0 ) { offset += - dir; } else if ( position.y > 1.0 ) { offset += dir; } // adjust for linewidth offset *= linewidth; // adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ... offset /= resolution.y; // select end vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd; // back to clip space offset *= clip.w; clip.xy += offset; gl_Position = clip; vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation #include #include #include }` ), fragmentShader: ( /* glsl */ ` uniform vec3 diffuse; uniform float opacity; #ifdef USE_DASH uniform float dashSize; uniform float dashOffset; uniform float gapSize; #endif varying float vLineDistance; #include #include #include #include #include varying vec2 vUv; void main() { #include #ifdef USE_DASH if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX #endif float alpha = opacity; #ifdef ALPHA_TO_COVERAGE // artifacts appear on some hardware if a derivative is taken within a conditional float a = vUv.x; float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; float len2 = a * a + b * b; float dlen = fwidth( len2 ); if ( abs( vUv.y ) > 1.0 ) { alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 ); } #else if ( abs( vUv.y ) > 1.0 ) { float a = vUv.x; float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; float len2 = a * a + b * b; if ( len2 > 1.0 ) discard; } #endif vec4 diffuseColor = vec4( diffuse, alpha ); #include #include gl_FragColor = vec4( diffuseColor.rgb, alpha ); #include #include #include #include }` ) }; class u extends l.ShaderMaterial { constructor(h) { super({ type: "LineMaterial", uniforms: l.UniformsUtils.clone(l.ShaderLib.line.uniforms), vertexShader: l.ShaderLib.line.vertexShader, fragmentShader: l.ShaderLib.line.fragmentShader, clipping: !0 // required for clipping support }), Object.defineProperties(this, { color: { enumerable: !0, get: function() { return this.uniforms.diffuse.value; }, set: function(f) { this.uniforms.diffuse.value = f; } }, linewidth: { enumerable: !0, get: function() { return this.uniforms.linewidth.value; }, set: function(f) { this.uniforms.linewidth.value = f; } }, dashed: { enumerable: !0, get: function() { return "USE_DASH" in this.defines; }, set(f) { !!f != "USE_DASH" in this.defines && (this.needsUpdate = !0), f === !0 ? this.defines.USE_DASH = "" : delete this.defines.USE_DASH; } }, dashScale: { enumerable: !0, get: function() { return this.uniforms.dashScale.value; }, set: function(f) { this.uniforms.dashScale.value = f; } }, dashSize: { enumerable: !0, get: function() { return this.uniforms.dashSize.value; }, set: function(f) { this.uniforms.dashSize.value = f; } }, dashOffset: { enumerable: !0, get: function() { return this.uniforms.dashOffset.value; }, set: function(f) { this.uniforms.dashOffset.value = f; } }, gapSize: { enumerable: !0, get: function() { return this.uniforms.gapSize.value; }, set: function(f) { this.uniforms.gapSize.value = f; } }, opacity: { enumerable: !0, get: function() { return this.uniforms.opacity.value; }, set: function(f) { this.uniforms.opacity.value = f; } }, resolution: { enumerable: !0, get: function() { return this.uniforms.resolution.value; }, set: function(f) { this.uniforms.resolution.value.copy(f); } }, alphaToCoverage: { enumerable: !0, get: function() { return "ALPHA_TO_COVERAGE" in this.defines; }, set: function(f) { !!f != "ALPHA_TO_COVERAGE" in this.defines && (this.needsUpdate = !0), f === !0 ? (this.defines.ALPHA_TO_COVERAGE = "", this.extensions.derivatives = !0) : (delete this.defines.ALPHA_TO_COVERAGE, this.extensions.derivatives = !1); } } }), this.setValues(h); } } u.prototype.isLineMaterial = !0; }, /* 49 */ /***/ (o, s, c) => { var l = c(4); s.Minimap = function(u) { var d = u; this.camera = new l.OrthographicCamera(-0.5, 0.5, 0.5, -0.5, 0.01, 10), this.helper = void 0; var h = new l.BufferGeometry(), f = new Float32Array([-1, -1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1]), p = new l.BufferAttribute(f, 3); h.setAttribute("position", p); var m = new l.MeshBasicMaterial({ color: 3355443, depthTest: !1, depthWrite: !1, opacity: 0.5, transparent: !0 }); this.mask = new l.Mesh(h, m); var y = new l.Box3(), g = new l.Vector3(); this.getDiffFromNormalised = (x, w) => { y.setFromBufferAttribute(p).getCenter(g); var S = g.clone().project(this.camera), _ = new l.Vector3(x, w, S.z).unproject(this.camera); return _.sub(g); }; var v = (x, w) => { d.camera.near && (this.camera.near = d.camera.near), w.farPlane && (this.camera.far = w.farPlane), w.eyePosition && this.camera.position.set(w.eyePosition[0], w.eyePosition[1], w.eyePosition[2]), w.upVector && this.camera.up.set(w.upVector[0], w.upVector[1], w.upVector[2]), w.targetPosition && this.camera.lookAt(new l.Vector3(w.targetPosition[0], w.targetPosition[1], w.targetPosition[2])), this.camera.zoom = 1 / x, this.camera.updateProjectionMatrix(); }; this.getBoundary = () => { var x = new l.Vector3().copy(d.camera.target).project(d.camera), w = new l.Vector3(-1, -1, x.z).unproject(d.camera), S = new l.Vector3(1, -1, x.z).unproject(d.camera), _ = new l.Vector3(1, 1, x.z).unproject(d.camera), b = new l.Vector3(-1, 1, x.z).unproject(d.camera); p.copyVector3sArray([w, S, _, _, b, w]), p.needsUpdate = !0; }, this.updateCamera = () => { this.getBoundary(); var x = d.getZincCameraControls(), w = d.getBoundingBox(); if (w) { var S = w.min.distanceTo(w.max), _ = S / 2, b = (w.min.x + w.max.x) / 2, T = (w.min.y + w.max.y) / 2, E = (w.min.z + w.max.z) / 2, C = x.getViewportFromCentreAndRadius(b, T, E, _, 40, _ * 4); v(S, C); } }; }; }, /* 50 */ /***/ (o, s, c) => { var l = c(4), u = c(51)(l), d = c(3).Geometry, h = c(52), f = c(53).default, p = l.BufferGeometryLoader, m = function(y) { var g; y && y.isGeometry && (g = y); var v = void 0, x = void 0, w = !1, S = void 0, _ = (L) => { var A = g.getMorph().material.clone(); A.morphTargets = !1; var k = new d(), P = new p(), R = P.parse(L), M = new l.Mesh(R.geometry, A); return k.geometry = M.geometry, M.userData = k, k.setMorph(M), k; }, b = (L) => { switch (L.data.action) { case "message": console.log(L.data.message); break; case "result": var A = new m(_(L.data.object)); S && S(A), S = void 0, w = !1; break; default: throw "Cannot handle specified action."; } }, T = (L) => { if (h !== void 0 && (x = h( /*require.resolve*/ 54 )), !x) v = new (c(55)).GeometryCSGInternal(L); else if (L && L.isGeometry) { var A = L.getMorph(), k = A.geometry.clone().applyMatrix(A.matrix).toJSON(); x.addEventListener("message", function(P) { b(P); }), x.postMessage({ action: "initialise", object: k }); } }; this.getHostGeometry = () => { var L = new u(g.getMorph()); return new E(L); }, this.getGeometry = () => g; var E = (L) => { var A = g.getMorph().material.clone(); A.morphTargets = !1; var k = L.toMesh(A), P = new d(); return P.geometry = k.geometry, k.userData = P, P.setMorph(k), P; }; this.setCSG = (L) => { v.setCSG(L); }; var C = (L, A, k, P) => { if (w) P("On progress"); else { var R = L.getMorph(), M = R.geometry.clone().applyMatrix(R.matrix).toJSON(); S = k, w = !0, x.postMessage({ action: A, object: M }); } }; this.intersect = (L) => new f((A, k) => { if (x) C(L, "intersect", A, k); else { var P = v.intersect(L), R = new m(E(P)); R.setCSG(P), A(R); } }), this.subtract = (L) => new f((A, k) => { if (x) C(L, "intersect", A, k); else { var P = v.subtract(L), R = new m(E(P)); R.setCSG(P), A(R); } }), this.union = (L) => new f((A, k) => { if (x) C(L, "intersect", A, k); else { var P = v.union(L), R = new m(E(P)); R.setCSG(P), A(R); } }), this.terminateWorker = () => { x && x.terminate(); }, T(y); }; s.GeometryCSG = m; }, /* 51 */ /***/ (o) => { var s = 1e-5, c = 0, l = 1, u = 2, d = 3; o.exports = function(h) { var f = function(p) { var m, y, g, v, x, w, S, _ = []; if (p.isBufferGeometry && (p = new h.Geometry().fromBufferGeometry(p)), p instanceof h.Geometry) this.matrix = new h.Matrix4(); else if (p.isMesh) p.updateMatrix(), this.matrix = p.matrix.clone(), p = p.geometry, p.isBufferGeometry && (p = new h.Geometry().fromBufferGeometry(p)), p.mergeVertices(), p.computeVertexNormals(!1); else { if (p instanceof f.Node) return this.tree = p, this.matrix = new h.Matrix4(), this; throw "ThreeBSP: Given geometry is unsupported"; } for (m = 0, y = p.faces.length; m < y; m++) g = p.faces[m], x = p.faceVertexUvs[0][m], S = new f.Polygon(), g instanceof h.Face3 ? (v = p.vertices[g.a], w = x ? new h.Vector2(x[0].x, x[0].y) : null, v = new f.Vertex(v.x, v.y, v.z, g.vertexNormals[0], w), v.applyMatrix4(this.matrix), S.vertices.push(v), v = p.vertices[g.b], w = x ? new h.Vector2(x[1].x, x[1].y) : null, v = new f.Vertex(v.x, v.y, v.z, g.vertexNormals[2], w), v.applyMatrix4(this.matrix), S.vertices.push(v), v = p.vertices[g.c], w = x ? new h.Vector2(x[2].x, x[2].y) : null, v = new f.Vertex(v.x, v.y, v.z, g.vertexNormals[2], w), v.applyMatrix4(this.matrix), S.vertices.push(v)) : (h.Face4, v = p.vertices[g.a], w = x ? new h.Vector2(x[0].x, x[0].y) : null, v = new f.Vertex(v.x, v.y, v.z, g.vertexNormals[0], w), v.applyMatrix4(this.matrix), S.vertices.push(v), v = p.vertices[g.b], w = x ? new h.Vector2(x[1].x, x[1].y) : null, v = new f.Vertex(v.x, v.y, v.z, g.vertexNormals[1], w), v.applyMatrix4(this.matrix), S.vertices.push(v), v = p.vertices[g.c], w = x ? new h.Vector2(x[2].x, x[2].y) : null, v = new f.Vertex(v.x, v.y, v.z, g.vertexNormals[2], w), v.applyMatrix4(this.matrix), S.vertices.push(v), v = p.vertices[g.d], w = x ? new h.Vector2(x[3].x, x[3].y) : null, v = new f.Vertex(v.x, v.y, v.z, g.vertexNormals[3], w), v.applyMatrix4(this.matrix), S.vertices.push(v)), S.calculateProperties(), _.push(S); this.tree = new f.Node(_); }; return f.prototype.subtract = function(p) { var m = this.tree.clone(), y = p.tree.clone(); return m.invert(), m.clipTo(y), y.clipTo(m), y.invert(), y.clipTo(m), y.invert(), m.build(y.allPolygons()), m.invert(), m = new f(m), m.matrix = this.matrix, m; }, f.prototype.union = function(p) { var m = this.tree.clone(), y = p.tree.clone(); return m.clipTo(y), y.clipTo(m), y.invert(), y.clipTo(m), y.invert(), m.build(y.allPolygons()), m = new f(m), m.matrix = this.matrix, m; }, f.prototype.intersect = function(p) { var m = this.tree.clone(), y = p.tree.clone(); return m.invert(), y.clipTo(m), y.invert(), m.clipTo(y), y.clipTo(m), m.build(y.allPolygons()), m.invert(), m = new f(m), m.matrix = this.matrix, m; }, f.prototype.toGeometry = function() { var p, m, y, g, v, x, w, S, _, b, T = new h.Matrix4().getInverse(this.matrix), E = new h.Geometry(), C = this.tree.allPolygons(), L = C.length, A = {}; for (p = 0; p < L; p++) for (y = C[p], g = y.vertices.length, m = 2; m < g; m++) b = [], S = y.vertices[0], b.push(new h.Vector2(S.uv.x, S.uv.y)), S = new h.Vector3(S.x, S.y, S.z), S.applyMatrix4(T), typeof A[S.x + "," + S.y + "," + S.z] > "u" ? (E.vertices.push(S), v = A[S.x + "," + S.y + "," + S.z] = E.vertices.length - 1) : v = A[S.x + "," + S.y + "," + S.z], S = y.vertices[m - 1], b.push(new h.Vector2(S.uv.x, S.uv.y)), S = new h.Vector3(S.x, S.y, S.z), S.applyMatrix4(T), typeof A[S.x + "," + S.y + "," + S.z] > "u" ? (E.vertices.push(S), x = A[S.x + "," + S.y + "," + S.z] = E.vertices.length - 1) : x = A[S.x + "," + S.y + "," + S.z], S = y.vertices[m], b.push(new h.Vector2(S.uv.x, S.uv.y)), S = new h.Vector3(S.x, S.y, S.z), S.applyMatrix4(T), typeof A[S.x + "," + S.y + "," + S.z] > "u" ? (E.vertices.push(S), w = A[S.x + "," + S.y + "," + S.z] = E.vertices.length - 1) : w = A[S.x + "," + S.y + "," + S.z], _ = new h.Face3(v, x, w, new h.Vector3(y.normal.x, y.normal.y, y.normal.z)), E.faces.push(_), E.faceVertexUvs[0].push(b); return E; }, f.prototype.toBufferGeometry = function() { var p = this.toGeometry(), m = new h.BufferGeometry().fromGeometry(p); return m; }, f.prototype.toMesh = function(p) { var m = this.toBufferGeometry(), y = new h.Mesh(m, p); return y.position.setFromMatrixPosition(this.matrix), y.rotation.setFromRotationMatrix(this.matrix), y; }, f.Polygon = function(p) { p instanceof Array || (p = []), this.vertices = p, 0 < p.length ? this.calculateProperties() : this.normal = this.w = void 0; }, f.Polygon.prototype.calculateProperties = function() { var p = this.vertices[0], m = this.vertices[1], y = this.vertices[2]; return this.normal = m.clone().subtract(p).cross(y.clone().subtract(p)).normalize(), this.w = this.normal.clone().dot(p), this; }, f.Polygon.prototype.clone = function() { var p, m, y = new f.Polygon(); for (p = 0, m = this.vertices.length; p < m; p++) y.vertices.push(this.vertices[p].clone()); return y.calculateProperties(), y; }, f.Polygon.prototype.flip = function() { var p, m = []; for (this.normal.multiplyScalar(-1), this.w *= -1, p = this.vertices.length - 1; 0 <= p; p--) m.push(this.vertices[p]); return this.vertices = m, this; }, f.Polygon.prototype.classifyVertex = function(p) { var m = this.normal.dot(p) - this.w; return m < -s ? u : m > s ? l : c; }, f.Polygon.prototype.classifySide = function(p) { var m, y, g, v = 0, x = 0, w = p.vertices.length; for (m = 0; m < w; m++) y = p.vertices[m], g = this.classifyVertex(y), g === l ? v++ : g === u && x++; return 0 < v && x === 0 ? l : v === 0 && 0 < x ? u : v === 0 && x === 0 ? c : d; }, f.Polygon.prototype.splitPolygon = function(p, m, y, g, v) { var x = this.classifySide(p); if (x === c) (0 < this.normal.dot(p.normal) ? m : y).push(p); else if (x === l) g.push(p); else if (x === u) v.push(p); else { var w, S, _, b, T, E, C, L, A, k = [], P = []; for (S = 0, w = p.vertices.length; S < w; S++) _ = (S + 1) % w, E = p.vertices[S], C = p.vertices[_], b = this.classifyVertex(E), T = this.classifyVertex(C), b != u && k.push(E), b != l && P.push(E), (b | T) == d && (L = (this.w - this.normal.dot(E)) / this.normal.dot(C.clone().subtract(E)), A = E.interpolate(C, L), k.push(A), P.push(A)); 3 <= k.length && g.push(new f.Polygon(k).calculateProperties()), 3 <= P.length && v.push(new f.Polygon(P).calculateProperties()); } }, f.Vertex = function(p, m, y, g, v) { this.x = p, this.y = m, this.z = y, this.normal = g || new h.Vector3(), this.uv = v || new h.Vector2(); }, f.Vertex.prototype.clone = function() { return new f.Vertex(this.x, this.y, this.z, this.normal.clone(), this.uv.clone()); }, f.Vertex.prototype.add = function(p) { return this.x += p.x, this.y += p.y, this.z += p.z, this; }, f.Vertex.prototype.subtract = function(p) { return this.x -= p.x, this.y -= p.y, this.z -= p.z, this; }, f.Vertex.prototype.multiplyScalar = function(p) { return this.x *= p, this.y *= p, this.z *= p, this; }, f.Vertex.prototype.cross = function(p) { var m = this.x, y = this.y, g = this.z; return this.x = y * p.z - g * p.y, this.y = g * p.x - m * p.z, this.z = m * p.y - y * p.x, this; }, f.Vertex.prototype.normalize = function() { var p = Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); return this.x /= p, this.y /= p, this.z /= p, this; }, f.Vertex.prototype.dot = function(p) { return this.x * p.x + this.y * p.y + this.z * p.z; }, f.Vertex.prototype.lerp = function(p, m) { return this.add(p.clone().subtract(this).multiplyScalar(m)), this.normal.add(p.normal.clone().sub(this.normal).multiplyScalar(m)), this.uv.add(p.uv.clone().sub(this.uv).multiplyScalar(m)), this; }, f.Vertex.prototype.interpolate = function(p, m) { return this.clone().lerp(p, m); }, f.Vertex.prototype.applyMatrix4 = function(p) { var m = this.x, y = this.y, g = this.z, v = p.elements; return this.x = v[0] * m + v[4] * y + v[8] * g + v[12], this.y = v[1] * m + v[5] * y + v[9] * g + v[13], this.z = v[2] * m + v[6] * y + v[10] * g + v[14], this; }, f.Node = function(p) { var m, y, g = [], v = []; if (this.polygons = [], this.front = this.back = void 0, p instanceof Array && p.length !== 0) { for (this.divider = p[0].clone(), m = 0, y = p.length; m < y; m++) this.divider.splitPolygon(p[m], this.polygons, this.polygons, g, v); 0 < g.length && (this.front = new f.Node(g)), 0 < v.length && (this.back = new f.Node(v)); } }, f.Node.isConvex = function(p) { var m, y; for (m = 0; m < p.length; m++) for (y = 0; y < p.length; y++) if (m !== y && p[m].classifySide(p[y]) !== u) return !1; return !0; }, f.Node.prototype.build = function(p) { var m, y, g = [], v = []; for (this.divider || (this.divider = p[0].clone()), m = 0, y = p.length; m < y; m++) this.divider.splitPolygon(p[m], this.polygons, this.polygons, g, v); 0 < g.length && (!this.front && (this.front = new f.Node()), this.front.build(g)), 0 < v.length && (!this.back && (this.back = new f.Node()), this.back.build(v)); }, f.Node.prototype.allPolygons = function() { var p = this.polygons.slice(); return this.front && (p = p.concat(this.front.allPolygons())), this.back && (p = p.concat(this.back.allPolygons())), p; }, f.Node.prototype.clone = function() { var p = new f.Node(); return p.divider = this.divider.clone(), p.polygons = this.polygons.map(function(m) { return m.clone(); }), p.front = this.front && this.front.clone(), p.back = this.back && this.back.clone(), p; }, f.Node.prototype.invert = function() { var p, m, y; for (p = 0, m = this.polygons.length; p < m; p++) this.polygons[p].flip(); return this.divider.flip(), this.front && this.front.invert(), this.back && this.back.invert(), y = this.front, this.front = this.back, this.back = y, this; }, f.Node.prototype.clipPolygons = function(p) { var m, y, g, v; if (!this.divider) return p.slice(); for (g = [], v = [], m = 0, y = p.length; m < y; m++) this.divider.splitPolygon(p[m], g, v, g, v); return this.front && (g = this.front.clipPolygons(g)), v = this.back ? this.back.clipPolygons(v) : [], g.concat(v); }, f.Node.prototype.clipTo = function(p) { this.polygons = p.clipPolygons(this.polygons), this.front && this.front.clipTo(p), this.back && this.back.clipTo(p); }, f; }; }, /* 52 */ /***/ (o) => { o.exports = Wpe(); }, /* 53 */ /***/ (o) => { o.exports = tfe; }, /* 54 */ /***/ (o, s, c) => { var l = c(3).Geometry, u = c(4), d = u.BufferGeometryLoader; o.exports = function(h) { var f = void 0, p = function(x) { var w = new d(), S = w.parse(x), _ = new u.MeshPhongMaterial(), b = new u.Mesh(S.geometry, _), T = new l(); return T.setMorph(b), T; }, m = function(x) { var w = p(x); f = new (c(55)).GeometryCSGInternal(w), h.postMessage({ action: "message", message: "Initialised" }); }, y = function(x) { if (f) { var w = p(x), S = f.intersect(w), _ = S.toBufferGeometry().toJSON(); h.postMessage({ action: "result", object: _ }); } }, g = function(x) { if (f) { var w = p(x), S = f.subtract(w), _ = S.toBufferGeometry().toJSON(); h.postMessage({ action: "result", object: _ }); } }, v = function(x) { if (f) { var w = p(x), S = f.union(w), _ = S.toBufferGeometry().toJSON(); h.postMessage({ action: "result", object: _ }); } }; h.addEventListener("message", function(x) { switch (x.data.action) { case "initialise": m(x.data.object); break; case "intersect": y(x.data.object); break; case "subtract": g(x.data.object); break; case "union": v(x.data.object); break; default: throw "Cannot handle specified action."; } }); }; }, /* 55 */ /***/ (o, s, c) => { var l = c(4), u = c(51)(l); c(3).Geometry, c(50).GeometryCSG; var d = function(h) { var f; h && h.isGeometry && (f = h); var p; this.setGeometry = (y) => { y && y.isGeometry && (f = y), p = void 0; }, this.setCSG = (y) => { p = y; }; var m = (y) => { if (f && f.morph && y && y.morph) { p === void 0 && (p = new u(f.morph)); var g = new u(y.morph); return g; } }; this.intersect = (y) => { var g = m(y); return p && g ? p.intersect(g) : void 0; }, this.subtract = (y) => { var g = m(y); return p && g ? p.subtract(g) : void 0; }, this.union = (y) => { var g = m(y); return p && g ? p.union(g) : void 0; }; }; s.GeometryCSGInternal = d; }, /* 56 */ /***/ (o, s, c) => { var l = c(4), u = c(51)(l); c(18).Glyphset; var d = function(h) { var f; h && h.isGlyphset && (f = h); var p = []; this.setGlyphset = (g) => { g && g.isGlyphset && (f = g), hostCSG = void 0; }, this.getGlyphset = () => f; var m = () => (g) => { var v = g.getMesh(), x = g.getLabel(); if (v) { var w = new u(v.geometry.clone().applyMatrix(v.matrix)), S = []; S.csg = w, S.label = x, v.material && (S.material = v.material.clone()), p.push(S); } }, y = (g) => { if (f && g && g.getMorph()) { p.length == 0 && f.forEachGlyph(m()); var v = new u(g.getMorph()); return v; } }; this.intersect = (g) => { var v = y(g); if (0 < p.length && v) { for (var x = new (c(18)).Glyphset(), w = 0; w < p.length; w++) { var S = p[w], _ = S.csg.intersect(v), b = _.toMesh(); if (b && b.geometry && 0 < b.geometry.vertices.length) { S.material && (b.material = S.material, b.material.side = l.DoubleSide, b.material.clippingPlanes = null); var T = x.addMeshAsGlyph(b, w + 1); T.setLabel(S.label); } } var E = new d(x); return E; } }; }; s.GlyphsetCSG = d; } /******/ ], i = {}; function n(o) { var s = i[o]; if (s !== void 0) return s.exports; var c = i[o] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; return r[o].call(c.exports, c, c.exports, n), c.exports; } n.n = (o) => { var s = o && o.__esModule ? ( /******/ () => o.default ) : ( /******/ () => o ); return n.d(s, { a: s }), s; }, n.d = (o, s) => { for (var c in s) n.o(s, c) && !n.o(o, c) && Object.defineProperty(o, c, { enumerable: !0, get: s[c] }); }, n.o = (o, s) => Object.prototype.hasOwnProperty.call(o, s), n.r = (o) => { typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(o, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(o, "__esModule", { value: !0 }); }; var a = n(0); return a; })() )); })(tP); var es = tP.exports; const _m = /* @__PURE__ */ Sie(es), mT = (t, e) => { if (t) { let r = ""; t.forEach((i) => { r = i.uuid, i.region && (r = i.region.uuid + "/" + r), i && i.getVisibility() && e.push(r); }); } return e; }, O1 = (t, e) => { const r = t[0] - e[0], i = t[1] - e[1], n = t[2] - e[2]; return Math.sqrt(r * r + i * i + n * n); }, rfe = (t) => { const e = t.zincObjects; if (e.length > 0 && e[0]) { const r = e[0]; if (r.isEditable && r.isLines2) { const i = t.identifiers[0].extraData.intersected; if (i && i.faceIndex > -1) { const n = r.getVerticesByFaceIndex(i.faceIndex), a = t.identifiers[0].extraData.intersected.pointOnLine; if (n.length > 1) { const o = O1(n[0], [a.x, a.y, a.z]), s = O1(n[1], [a.x, a.y, a.z]); return o > s ? { zincObject: r, faceIndex: i.faceIndex, vertexIndex: i.faceIndex * 2 + 1, point: n[0] } : { zincObject: r, faceIndex: i.faceIndex, vertexIndex: i.faceIndex * 2, point: n[1] }; } } } } }, ife = (t) => { const e = t.zincObjects; if (e.length > 0 && e[0]) { const r = e[0]; if (r.isEditable) return r; } }, nfe = (t, e, r) => { if (t != null && t.isEditable && t != null && t.isPointset) { let i = !1; for (let n = 0; n < 3 && !i; n++) r[n] !== 0 && (i = !0); if (i && e > -1) { const n = t.getVerticesByIndex(e); return n && (n[0] = n[0] + r[0], n[1] = n[1] + r[1], n[2] = n[2] + r[2]), t.editVertices([n], e), t.boundingBoxUpdateRequired = !0, !0; } } return !1; }, Yf = (t, e) => { if (t != null && t.isEditable && t != null && t.isLines2 && e > -1) { const r = t.getVerticesByFaceIndex(e); if (r && r.length > 1) return O1(r[1], r[0]); } return 0; }, Y0 = (t, e, r, i) => { if (t && r !== 0 && t.isEditable && t.isLines2 && e > -1) { const n = t.getVerticesByFaceIndex(e); let a = [n[1][0] - n[0][0], n[1][1] - n[0][1], n[1][2] - n[0][2]]; const o = Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2]); for (let s = 0; s < 3; s++) a[s] = a[s] / o * r, i ? n[1][s] = n[0][s] + a[s] : (n[0][s] = n[0][s] + a[s], n[1][s] = n[1][s] + a[s]); return t.editVertices(n, e * 2), t.boundingBoxUpdateRequired = !0, !0; } return !1; }, afe = (t, e) => { const r = e.getBoundingBox(), i = new es.THREE.Vector3().subVectors(r.max, r.min), n = new es.THREE.BoxGeometry(i.x, i.y, i.z); i.addVectors(r.min, r.max).multiplyScalar(0.5); const a = n.getAttribute("position"), o = a.count, s = []; for (let c = 0; c < o; c++) s[c] = [ a.array[c * 3], a.array[c * 3 + 1], a.array[c * 3 + 2] ]; t.editVertices(s, 0), t.setPosition(i.x, i.y, i.z), n.dispose(); }, JO = (t, e) => { let r = ""; t.isRegion && (r = `__r${t.regionPath}`), t.isPrimitives && (r = `${t.regionPath}/${t.label}`), e.push(r), t.children && t.children.forEach((i) => JO(i, e)); }, qc = (t, e, r, i) => { let n = t; const a = []; if (r && (n = t.findChildFromPath(r)), n) { const o = Array.isArray(e); let s = e; o || (s = [s]), s.forEach((c) => { const l = n.findObjectsWithGroupName(c, i); a.push(...l); }); } return a; }, D1 = (t, e, r) => { const i = t.findIndex((a) => a.uuid === e); let n; return i > -1 && (n = t[i], r && t.splice(i, 1)), n; }, ofe = (t, e) => { const r = []; if (t && e && e.length > 0) { const i = {}, n = {}, a = [t, ...t.getChildRegions(!0)]; let o, s, c; e.forEach((l) => { const u = l.split("/"); c = u[0], o = D1(a, c, !1), o && (n[c] || (n[c] = o.getFullPath()), u[1] ? (i[c] || (i[c] = o.getAllObjects(!1)), s = D1(i[c], u[1], !0), s && r.push(`${n[c]}/${s.groupName}`)) : r.push(`__r/${n[c]}`)); }); } return r; }, sfe = (t) => { if (t) { const e = []; return t.forEach((r) => { r.isZincObject ? e.push(r) : r.isRegion && e.push(...r.getAllObjects(!0)); }), Object.values( e.reduce((r, i) => ({ ...r, [i.uuid]: i }), {}) ); } return []; }, gT = (t, e) => { const r = { label: "Multiple selections", regionPath: "", objects: [] }; if (e && t) { const i = {}, n = t.getRootRegion(); e.length > 0 && (r.regionPath = e[0].data.region, r.label = e[0].data.group), e.forEach((a) => { a.data.region.includes(r.regionPath) || (r.regionPath = ""), r.label !== a.data.group && (r.label = "Multiple selections"); const o = n.findChildFromPath(a.data.region); i[o.uuid] || (i[o.uuid] = o.getAllObjects(!1)); const s = D1(i[o.uuid], a.data.uuid); s && r.objects.push(s); }); } return r; }, lfe = (t) => { const e = t.getMorph(); let r = "position"; t.isLines2 && (r = "instanceStart"); const i = []; let n = 0; const a = e.geometry.getAttribute(r); for (let o = 0; o < t.drawRange; o++) i.push([ a.array[n++], a.array[n++], a.array[n++] ]); return i; }, cfe = (t, e, r, i, n) => { let a; if (t.isPointset ? a = "MultiPoint" : t.isLines2 && (a = "MultiLineString"), a) { const o = lfe(t); let s = e.slice(-1) === "/" ? e : e + "/"; s = s + r; const c = s, l = { resource: i, item: { id: c }, body: { evidence: [], comment: n }, feature: { id: c, properties: { drawn: !0, label: "Drawn annotation" }, geometry: { coordinates: o, type: a } } }; return n === "Deleted" && (l.feature = void 0), l; } }, vT = (t, e, r, i, n, a, o) => { const s = cfe(r, i, n, a, o); if (s) return t && t.currentUser && (s.creator = { ...t.currentUser }, s.creator.orcid || (s.creator.orcid = "0000-0000-0000-0000"), t.addAnnotation(e, s).then((c) => { c.annotationId || console.log("There is a problem with the submission, please try again later"); }).catch(() => { console.log("There is a problem with the submission, please try again later"); })), s; }, yT = async (t, e, r) => { const i = r; return await t.drawnFeatures(e, i); }, K0 = (t, e) => { t && e.forEach((r) => { const i = r.geometry, n = decodeURIComponent(r.id), a = n.lastIndexOf("/"), o = n.substring(0, a), s = n.substring(a + 1); let c; i.type === "MultiPoint" ? c = t.createPoints( o, s, i.coordinates, s, 8942 ) : i.type === "MultiLineString" && (c = t.createLines( o, s, i.coordinates, 60962 )), c && (c.zincObject.isEditable = !0); }); }, So = (t, e) => { const r = t.__vccOpts || t; for (const [i, n] of e) r[i] = n; return r; }, ufe = { name: "LinesControls", components: { Button: Ku, Col: Jn, Container: La, InputNumber: xo, Main: bo, Slider: An, ElIconArrowLeft: vs, ElIconArrowRight: ys }, props: { createData: { type: Object } }, data: function() { return { adjust: 0, pAdjust: 0, lengthScale: 0, distance: 0, newDistance: 0, width: 1, currentIndex: 0, ElIconArrowLeft: mr(vs), ElIconArrowRight: mr(ys), edited: !1, zincObject: void 0 }; }, watch: { "createData.faceIndex": { handler: function(t) { var e; (e = this.zincObject) != null && e.isLines2 && (this.currentIndex = t, this.distance = Yf(this.zincObject, this.currentIndex)); }, immediate: !0 } }, methods: { changeIndex: function(t) { t ? Yf(this.zincObject, this.currentIndex + 1) > 0 && (this.currentIndex++, this.reset()) : (this.currentIndex--, this.reset()); }, onLengthInput: function() { this.newDistance !== 0 ? (this.distance = this.newDistance, this.edited = Y0( this.zincObject, this.currentIndex, this.newDistance, !0 ) || this.edited) : this.newDistance = this.distance; }, onLengthSliding: function() { this.newDistance = Math.pow(10, this.lengthScale) * this.distance, this.edited = Y0( this.zincObject, this.currentIndex, this.newDistance, !0 ) || this.edited; }, onMoveSliding: function() { const t = (this.adjust - this.pAdjust) * this.distance; this.edited = Y0( this.zincObject, this.currentIndex, t, !1 ) || this.edited, this.pAdjust = this.adjust; }, reset: function() { this.adjust = 0, this.pAdjust = 0, this.lengthScale = 0, this.distance = Yf(this.zincObject, this.currentIndex), this.newDistance = this.distance, this.edited && (this.$emit("primitivesUpdated", this.zincObject), this.edited = !1); }, setObject: function(t) { this.currentIndex = -1, this.distance = 0, t.isLines2 ? (this.zincObject = Si(t), this.width = this.zincObject.getMorph().material.linewidth, t.isEditable && (this.currentIndex = 0, this.distance = Yf(t, this.currentIndex))) : (this.zincObject = void 0, this.width = 10); }, modifyWidth: function() { this.zincObject.setWidth(this.width); } } }; function dfe(t, e, r, i, n, a) { const o = Jn, s = An, c = xo, l = Aa, u = Ku, d = bo, h = La; return Q(), Re(h, { class: "lines-container" }, { default: le(() => [ oe(d, { class: "slides-block" }, { default: le(() => [ oe(l, null, { default: le(() => [ oe(o, { offset: 0, span: 6 }, { default: le(() => [ et(" Width: ") ]), _: 1 }), oe(o, { offset: 0, span: 12 }, { default: le(() => [ oe(s, { modelValue: t.width, "onUpdate:modelValue": e[0] || (e[0] = (f) => t.width = f), class: "my-slider", step: 1, min: 1, max: 100, "show-tooltip": !1, onInput: a.modifyWidth }, null, 8, ["modelValue", "onInput"]) ]), _: 1 }), oe(o, { offset: 0, span: 4 }, { default: le(() => [ oe(c, { modelValue: t.width, "onUpdate:modelValue": e[1] || (e[1] = (f) => t.width = f), step: 1, min: 1, max: 100, controls: !1, class: "input-box number-input" }, null, 8, ["modelValue"]) ]), _: 1 }) ]), _: 1 }), t.currentIndex > -1 && t.distance > 0 ? (Q(), be(pt, { key: 0 }, [ oe(l, null, { default: le(() => [ oe(o, { offset: 0, span: 4 }, { default: le(() => [ oe(u, { size: "small", disabled: t.currentIndex === 0, icon: t.ElIconArrowLeft, onClick: e[2] || (e[2] = (f) => a.changeIndex(!1)) }, null, 8, ["disabled", "icon"]) ]), _: 1 }), oe(o, { offset: 4, span: 9 }, { default: le(() => [ et(" Editing Line " + Ze(t.currentIndex + 1), 1) ]), _: 1 }), oe(o, { offset: 2, span: 2 }, { default: le(() => [ oe(u, { size: "small", icon: t.ElIconArrowRight, onClick: e[3] || (e[3] = (f) => a.changeIndex(!0)) }, null, 8, ["icon"]) ]), _: 1 }) ]), _: 1 }), oe(l, null, { default: le(() => [ oe(o, { offset: 0, span: 6 }, { default: le(() => [ et(" Move: ") ]), _: 1 }), oe(o, { offset: 0, span: 16 }, { default: le(() => [ oe(s, { modelValue: t.adjust, "onUpdate:modelValue": e[4] || (e[4] = (f) => t.adjust = f), step: 0.01, min: -3, max: 3, "show-tooltip": !1, onInput: e[5] || (e[5] = (f) => a.onMoveSliding()), onChange: e[6] || (e[6] = (f) => a.reset()) }, null, 8, ["modelValue"]) ]), _: 1 }) ]), _: 1 }), oe(l, null, { default: le(() => [ oe(o, { offset: 0, span: 6 }, { default: le(() => [ et(" Length: ") ]), _: 1 }), oe(o, { offset: 0, span: 10 }, { default: le(() => [ oe(s, { modelValue: t.lengthScale, "onUpdate:modelValue": e[7] || (e[7] = (f) => t.lengthScale = f), step: 0.01, min: -1, max: 1, "show-tooltip": !1, onInput: e[8] || (e[8] = (f) => a.onLengthSliding()), onChange: e[9] || (e[9] = (f) => a.reset()) }, null, 8, ["modelValue"]) ]), _: 1 }), oe(o, { offset: 0, span: 6 }, { default: le(() => [ oe(c, { modelValue: t.newDistance, "onUpdate:modelValue": e[10] || (e[10] = (f) => t.newDistance = f), controls: !1, class: "input-box number-input", onChange: a.onLengthInput }, null, 8, ["modelValue", "onChange"]) ]), _: 1 }) ]), _: 1 }) ], 64)) : Pe("", !0) ]), _: 1 }) ]), _: 1 }); } const QO = /* @__PURE__ */ So(ufe, [["render", dfe], ["__scopeId", "data-v-6581aa67"]]), hfe = { name: "PointsControls", components: { Col: Jn, Container: La, InputNumber: xo, Main: bo, Select: Ju, Slider: An, Row: Aa, Option: Qu, ElIconArrowLeft: vs, ElIconArrowRight: ys }, inject: ["boundingDims"], data: function() { return { attenuation: !1, size: 10, choices: [ { value: !0, label: "On" }, { value: !1, label: "off" } ], min: [0, 0, 0], max: [1, 1, 1], translation: [0, 0, 0], pTranslation: [0, 0, 0], currentIndex: -1, ElIconArrowLeft: mr(vs), ElIconArrowRight: mr(ys), edited: !1, zincObject: void 0 }; }, watch: { boundingDims: { handler: function(t) { const e = t.size; this.min = [ -e[0] / 2, -e[1] / 2, -e[2] / 2 ], this.max = [ e[0] / 2, e[1] / 2, e[2] / 2 ]; }, immediate: !0, deep: !0 } }, methods: { changeIndex: function(t) { t ? this.zincObject.drawRange > this.currentIndex + 1 && (this.currentIndex++, this.reset()) : (this.currentIndex--, this.reset()); }, onMoveSliding: function() { const t = [ this.translation[0] - this.pTranslation[0], this.translation[1] - this.pTranslation[1], this.translation[2] - this.pTranslation[2] ]; this.edited = nfe(this.zincObject, this.currentIndex, t) || this.edited; for (let e = 0; e < 3; e++) this.pTranslation[e] = this.translation[e]; }, reset: function() { this.translation = [0, 0, 0], this.pTranslation = [0, 0, 0], this.edited && (this.$emit("primitivesUpdated", this.zincObject), this.edited = !1); }, setObject: function(t) { this.currentIndex = -1, t.isPointset ? (this.zincObject = Si(t), this.size = this.zincObject.morph.material.size, this.attenuation = this.zincObject.morph.material.sizeAttenuation, t.isEditable && this.zincObject.drawRange > 0 && (this.currentIndex = 0)) : (this.zincObject = void 0, this.size = 10, this.attenuation = !1); }, modifyAttenuation: function(t) { this.attenuation = t, this.zincObject.setSizeAttenuation(t); }, modifySize: function() { this.zincObject.setSize(this.size); } } }; function pfe(t, e, r, i, n, a) { const o = Jn, s = An, c = xo, l = Aa, u = Qu, d = Ju, h = Ku, f = bo, p = La; return Q(), Re(p, { class: "pointset-container" }, { default: le(() => [ oe(f, { class: "slides-block" }, { default: le(() => [ oe(l, null, { default: le(() => [ oe(o, { offset: 0, span: 6 }, { default: le(() => [ et(" Size: ") ]), _: 1 }), oe(o, { offset: 0, span: 10 }, { default: le(() => [ oe(s, { modelValue: t.size, "onUpdate:modelValue": e[0] || (e[0] = (m) => t.size = m), class: "my-slider", step: 1, min: 0, max: 100, "show-tooltip": !1, onInput: e[1] || (e[1] = (m) => a.modifySize()) }, null, 8, ["modelValue"]) ]), _: 1 }), oe(o, { offset: 0, span: 6 }, { default: le(() => [ oe(c, { modelValue: t.size, "onUpdate:modelValue": e[2] || (e[2] = (m) => t.size = m), step: 1, min: 0, max: 100, controls: !1, class: "input-box number-input" }, null, 8, ["modelValue"]) ]), _: 1 }) ]), _: 1 }), oe(l, null, { default: le(() => [ oe(o, { offset: 0, span: 16 }, { default: le(() => [ et(" Size attenuation: ") ]), _: 1 }), oe(o, { offset: 0, span: 5 }, { default: le(() => [ oe(d, { teleported: !1, "model-value": t.attenuation, placeholder: "Select", class: "input-box", "popper-class": "viewer_dropdown", onChange: e[3] || (e[3] = (m) => a.modifyAttenuation(m, t.slide)) }, { default: le(() => [ (Q(!0), be(pt, null, ir(t.choices, (m) => (Q(), Re(u, { key: m.value, label: m.label, value: m.value }, null, 8, ["label", "value"]))), 128)) ]), _: 1 }, 8, ["model-value"]) ]), _: 1 }) ]), _: 1 }), t.currentIndex > -1 ? (Q(), be(pt, { key: 0 }, [ oe(l, null, { default: le(() => [ oe(o, { offset: 0, span: 4 }, { default: le(() => [ oe(h, { size: "small", disabled: t.currentIndex === 0, icon: t.ElIconArrowLeft, onClick: e[4] || (e[4] = (m) => a.changeIndex(!1)) }, null, 8, ["disabled", "icon"]) ]), _: 1 }), oe(o, { offset: 4, span: 9 }, { default: le(() => [ et(" Editing Point " + Ze(t.currentIndex + 1), 1) ]), _: 1 }), oe(o, { offset: 2, span: 2 }, { default: le(() => [ oe(h, { size: "small", icon: t.ElIconArrowRight, onClick: e[5] || (e[5] = (m) => a.changeIndex(!0)) }, null, 8, ["icon"]) ]), _: 1 }) ]), _: 1 }), oe(l, null, { default: le(() => [ oe(o, { offset: 0, span: 6 }, { default: le(() => [ et(" x: ") ]), _: 1 }), oe(o, { offset: 0, span: 16 }, { default: le(() => [ oe(s, { modelValue: t.translation[0], "onUpdate:modelValue": e[6] || (e[6] = (m) => t.translation[0] = m), step: 0.01, min: t.min[0], max: t.max[0], "show-tooltip": !1, onInput: e[7] || (e[7] = (m) => a.onMoveSliding()), onChange: e[8] || (e[8] = (m) => a.reset()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }) ]), _: 1 }), oe(l, null, { default: le(() => [ oe(o, { offset: 0, span: 6 }, { default: le(() => [ et(" y: ") ]), _: 1 }), oe(o, { offset: 0, span: 16 }, { default: le(() => [ oe(s, { modelValue: t.translation[1], "onUpdate:modelValue": e[9] || (e[9] = (m) => t.translation[1] = m), step: 0.01, min: t.min[1], max: t.max[1], "show-tooltip": !1, onInput: e[10] || (e[10] = (m) => a.onMoveSliding()), onChange: e[11] || (e[11] = (m) => a.reset()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }) ]), _: 1 }), oe(l, null, { default: le(() => [ oe(o, { offset: 0, span: 6 }, { default: le(() => [ et(" z: ") ]), _: 1 }), oe(o, { offset: 0, span: 16 }, { default: le(() => [ oe(s, { modelValue: t.translation[2], "onUpdate:modelValue": e[12] || (e[12] = (m) => t.translation[2] = m), step: 0.01, min: t.min[2], max: t.max[2], "show-tooltip": !1, onInput: e[13] || (e[13] = (m) => a.onMoveSliding()), onChange: e[14] || (e[14] = (m) => a.reset()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }) ]), _: 1 }) ], 64)) : Pe("", !0) ]), _: 1 }) ]), _: 1 }); } const eD = /* @__PURE__ */ So(hfe, [["render", pfe], ["__scopeId", "data-v-d1de9c65"]]), ffe = { name: "TextureSlidesControls", components: { Col: Jn, Container: La, Footer: Wk, Icon: yr, InputNumber: xo, Main: bo, Row: Aa, Select: Ju, Slider: An, Option: Qu, ElIconDelete: Zm, ElIconPlus: qg }, data: function() { return { settings: [], directions: [ { value: "x", label: "x" }, { value: "y", label: "y" }, { value: "z", label: "z" } ], zincObject: void 0 }; }, methods: { setObject: function(t) { t.isTextureSlides ? (this.zincObject = Si(t), this.settings = this.zincObject.getTextureSettings()) : (this.zincObject = void 0, this.settings = []); }, addNewSlide: function() { const t = { direction: "x", value: 0 }, e = this.zincObject.createSlide(t); this.settings.push(e); }, modifyDirection: function(t, e) { e && (e.direction = t, this.zincObject.modifySlideSettings(e)); }, modifySlide: function(t) { t && this.zincObject.modifySlideSettings(t); }, removeSlide: function(t, e) { this.zincObject.removeSlideWithId(e.id), this.settings.splice(t, 1); } } }; function mfe(t, e, r, i, n, a) { const o = Qu, s = Ju, c = Jn, l = An, u = xo, d = Zm, h = yr, f = Aa, p = bo, m = qg, y = Wk, g = La; return Q(), Re(g, { class: "t-slides-container" }, { default: le(() => [ oe(p, { class: "slides-block" }, { default: le(() => [ (Q(!0), be(pt, null, ir(t.settings, (v, x) => (Q(), Re(f, { key: v.id, class: "slide-row" }, { default: le(() => [ oe(c, { offset: 0, span: 6 }, { default: le(() => [ oe(s, { teleported: !1, "model-value": v.direction, placeholder: "Select", class: "input-box", "popper-class": "viewer_dropdown", onChange: (w) => a.modifyDirection(w, v) }, { default: le(() => [ (Q(!0), be(pt, null, ir(t.directions, (w) => (Q(), Re(o, { key: w.value, label: w.label, value: w.value }, null, 8, ["label", "value"]))), 128)) ]), _: 2 }, 1032, ["model-value", "onChange"]) ]), _: 2 }, 1024), oe(c, { offset: 0, span: 10 }, { default: le(() => [ oe(l, { modelValue: v.value, "onUpdate:modelValue": (w) => v.value = w, class: "my-slider", step: 0.01, min: 0, max: 1, "show-tooltip": !1, onInput: (w) => a.modifySlide(v) }, null, 8, ["modelValue", "onUpdate:modelValue", "onInput"]) ]), _: 2 }, 1024), oe(c, { offset: 0, span: 6 }, { default: le(() => [ oe(u, { modelValue: v.value, "onUpdate:modelValue": (w) => v.value = w, step: 0.01, min: 0, max: 1, controls: !1, class: "input-box number-input" }, null, 8, ["modelValue", "onUpdate:modelValue"]) ]), _: 2 }, 1024), oe(c, { offset: 0, span: 2 }, { default: le(() => [ oe(h, { class: "delete-icon", onClick: (w) => a.removeSlide(x, v) }, { default: le(() => [ oe(d) ]), _: 2 }, 1032, ["onClick"]) ]), _: 2 }, 1024) ]), _: 2 }, 1024))), 128)) ]), _: 1 }), oe(y, { height: "30px", class: "add-slides-text", onClick: a.addNewSlide }, { default: le(() => [ oe(f, null, { default: le(() => [ oe(c, { span: 2 }, { default: le(() => [ oe(h, null, { default: le(() => [ oe(m) ]), _: 1 }) ]), _: 1 }), oe(c, { span: 20 }, { default: le(() => [ et(" Add a new slide ") ]), _: 1 }) ]), _: 1 }) ]), _: 1 }, 8, ["onClick"]) ]), _: 1 }); } const tD = /* @__PURE__ */ So(ffe, [["render", mfe], ["__scopeId", "data-v-12185b7f"]]), gfe = { name: "TransformationControls", components: { Col: Jn, Container: La, InputNumber: xo, Main: bo, Slider: An }, inject: ["boundingDims"], data: function() { return { x: 0, y: 0, z: 0, scale: 1, min: [0, 0, 0], max: [1, 1, 1], zincObject: void 0 }; }, watch: { boundingDims: { handler: function(t) { const e = t.centre, r = t.size; this.min = [ e[0] - r[0], e[1] - r[1], e[2] - r[2] ], this.max = [ e[0] + r[0], e[1] + r[1], e[2] + r[2] ]; }, immediate: !0, deep: !0 } }, methods: { setObject: function(t) { if (t.isZincObject) { this.zincObject = Si(t); const e = this.zincObject.getGroup(); e && e.position && (this.x = e.position.x, this.y = e.position.y, this.z = e.position.z, this.scale = e.scale.x); } else this.zincObject = void 0, this.x = 0, this.y = 0, this.z = 0, this.scale = 1; }, modifyPosition: function() { this.zincObject.setPosition(this.x, this.y, this.z); }, modifyScale: function() { this.zincObject.setScaleAll(this.scale); } } }; function vfe(t, e, r, i, n, a) { const o = Jn, s = An, c = xo, l = Aa, u = bo, d = La; return Q(), Re(d, { class: "transformation-container" }, { default: le(() => [ oe(u, { class: "slides-block" }, { default: le(() => [ oe(l, { class: "tool-row" }, { default: le(() => [ oe(o, { offset: 0, span: 6 }, { default: le(() => [ et(" x: ") ]), _: 1 }), oe(o, { offset: 0, span: 10 }, { default: le(() => [ oe(s, { modelValue: t.x, "onUpdate:modelValue": e[0] || (e[0] = (h) => t.x = h), step: 0.01, min: t.min[0], max: t.max[0], "show-tooltip": !1, onInput: e[1] || (e[1] = (h) => a.modifyPosition()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }), oe(o, { offset: 0, span: 6 }, { default: le(() => [ oe(c, { modelValue: t.x, "onUpdate:modelValue": e[2] || (e[2] = (h) => t.x = h), step: 0.01, min: t.min[0], max: t.max[0], controls: !1, class: "input-box number-input", onChange: e[3] || (e[3] = (h) => a.modifyPosition()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }) ]), _: 1 }), oe(l, { class: "tool-row" }, { default: le(() => [ oe(o, { offset: 0, span: 6 }, { default: le(() => [ et(" y: ") ]), _: 1 }), oe(o, { offset: 0, span: 10 }, { default: le(() => [ oe(s, { modelValue: t.y, "onUpdate:modelValue": e[4] || (e[4] = (h) => t.y = h), step: 0.01, min: t.min[1], max: t.max[1], "show-tooltip": !1, onInput: e[5] || (e[5] = (h) => a.modifyPosition()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }), oe(o, { offset: 0, span: 6 }, { default: le(() => [ oe(c, { modelValue: t.y, "onUpdate:modelValue": e[6] || (e[6] = (h) => t.y = h), step: 0.01, min: t.min[1], max: t.max[1], controls: !1, class: "input-box number-input", onChange: e[7] || (e[7] = (h) => a.modifyPosition()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }) ]), _: 1 }), oe(l, { class: "tool-row" }, { default: le(() => [ oe(o, { offset: 0, span: 6 }, { default: le(() => [ et(" z: ") ]), _: 1 }), oe(o, { offset: 0, span: 10 }, { default: le(() => [ oe(s, { modelValue: t.z, "onUpdate:modelValue": e[8] || (e[8] = (h) => t.z = h), step: 0.01, min: t.min[2], max: t.max[2], "show-tooltip": !1, onInput: e[9] || (e[9] = (h) => a.modifyPosition()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }), oe(o, { offset: 0, span: 6 }, { default: le(() => [ oe(c, { modelValue: t.z, "onUpdate:modelValue": e[10] || (e[10] = (h) => t.z = h), step: 0.01, min: t.min[2], max: t.max[2], controls: !1, class: "input-box number-input", onChange: e[11] || (e[11] = (h) => a.modifyPosition()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }) ]), _: 1 }), oe(l, { class: "tool-row" }, { default: le(() => [ oe(o, { offset: 0, span: 6 }, { default: le(() => [ et(" Scale: ") ]), _: 1 }), oe(o, { offset: 0, span: 10 }, { default: le(() => [ oe(s, { modelValue: t.scale, "onUpdate:modelValue": e[12] || (e[12] = (h) => t.scale = h), step: 0.01, min: 0, max: 5, "show-tooltip": !1, onInput: e[13] || (e[13] = (h) => a.modifyScale()) }, null, 8, ["modelValue"]) ]), _: 1 }), oe(o, { offset: 0, span: 6 }, { default: le(() => [ oe(c, { modelValue: t.scale, "onUpdate:modelValue": e[14] || (e[14] = (h) => t.scale = h), step: 0.01, min: 0, max: 5, controls: !1, class: "input-box number-input", onChange: e[15] || (e[15] = (h) => a.modifyScale()) }, null, 8, ["modelValue"]) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }); } const rD = /* @__PURE__ */ So(gfe, [["render", vfe], ["__scopeId", "data-v-6b3997b7"]]), yfe = { name: "OpacityControls", components: { Container: La, Header: mne, Main: bo, Slider: An }, props: { material: void 0, zincObject: void 0 }, data: function() { return { displayString: "100%" }; }, watch: { "material.opacity": function() { this.material && this.zincObject && this.zincObject.setAlpha(this.material.opacity); } }, methods: { formatTooltip(t) { return this.displayString = Math.floor(100 * t + 0.5) + "%", this.displayString; } } }, bfe = { class: "block" }, xfe = { class: "display" }; function wfe(t, e, r, i, n, a) { const o = An, s = La; return r.material ? (Q(), Re(s, { key: 0, class: "opacity-container" }, { default: le(() => [ Ee("div", bfe, [ Ee("span", xfe, Ze(t.displayString), 1), oe(o, { modelValue: r.material.opacity, "onUpdate:modelValue": e[0] || (e[0] = (c) => r.material.opacity = c), class: "my-slider", step: 0.01, min: 0, max: 1, "format-tooltip": a.formatTooltip, "show-tooltip": !1 }, null, 8, ["modelValue", "format-tooltip"]) ]) ]), _: 1 })) : Pe("", !0); } const iD = /* @__PURE__ */ So(yfe, [["render", wfe], ["__scopeId", "data-v-cbfc46a5"]]), _fe = { name: "PrimitiveControls", components: { Collapse: $k, CollapseItem: Vk, LinesControls: QO, OpacityControls: iD, PointsControls: eD, TextureSlidesControls: tD, TransformationControls: rD, ElIconArrowRight: ys }, props: { createData: { type: Object } }, data: function() { return { activeName: "oControls", material: void 0, isTextureSlides: !1, isPointset: !1, isLines: !1, drawerOpen: !0, zincObject: void 0, isEditable: !1, displayString: "100%" }; }, methods: { formatTooltip: function(t) { return this.displayString = Math.floor(100 * t + 0.5) + "%", this.displayString; }, toggleDrawer: function() { this.drawerOpen = !this.drawerOpen; }, setObject: function(t) { var e; t ? this.zincObject = Si(t) : this.zincObject = void 0, this.isEditable = !!((e = this.zincObject) != null && e.isEditable), this.isPointset = !1, this.isTextureSlides = !1, this.isLines = !1, this.activeName = "trControls", t && (t.isTextureSlides ? (this.isTextureSlides = !0, this.$refs.tSlidesControls.setObject(t), this.activeName = "tsControls") : t.isPointset ? (this.isPointset = !0, this.$refs.pointsetControls.setObject(t), this.activeName = "pControls") : t.isLines2 && (this.isLines = !0, this.$refs.linesControls.setObject(t), this.activeName = "lControls"), t.isTextureSlides || this.$refs.transformationControls.setObject(t)), t && t.getMorph() ? this.material = t.getMorph().material : this.material = void 0; } } }; function Sfe(t, e, r, i, n, a) { const o = iD, s = Vk, c = rD, l = tD, u = eD, d = QO, h = $k, f = ys, p = yr; return ht((Q(), be("div", { class: xe(["primitive-controls", { open: t.drawerOpen, close: !t.drawerOpen }]) }, [ Ee("div", { class: xe(["my-drawer", { open: t.drawerOpen, close: !t.drawerOpen }]) }, [ oe(h, { class: "collapse", modelValue: t.activeName, "onUpdate:modelValue": e[2] || (e[2] = (m) => t.activeName = m), accordion: "" }, { default: le(() => [ ht(oe(s, { title: "Opacity", name: "oControls" }, { default: le(() => [ oe(o, { material: t.material, zincObject: t.zincObject, ref: "opacityControls" }, null, 8, ["material", "zincObject"]) ]), _: 1 }, 512), [ [Ot, !t.isTextureSlides] ]), ht(oe(s, { title: "Transformation", name: "trControls" }, { default: le(() => [ oe(c, { class: "transformation-controls", ref: "transformationControls" }, null, 512) ]), _: 1 }, 512), [ [Ot, !t.isEditable] ]), ht(oe(s, { title: "Texture Slides", name: "tsControls" }, { default: le(() => [ oe(l, { class: "texture-controls", ref: "tSlidesControls" }, null, 512) ]), _: 1 }, 512), [ [Ot, t.isTextureSlides] ]), ht(oe(s, { title: "Points", name: "pControls" }, { default: le(() => [ oe(u, { class: "pointset-controls", ref: "pointsetControls", onPrimitivesUpdated: e[0] || (e[0] = (m) => t.$emit("primitivesUpdated", m)) }, null, 512) ]), _: 1 }, 512), [ [Ot, t.isPointset] ]), ht(oe(s, { title: "Lines", name: "lControls" }, { default: le(() => [ oe(d, { class: "lines-controls", ref: "linesControls", createData: r.createData, onPrimitivesUpdated: e[1] || (e[1] = (m) => t.$emit("primitivesUpdated", m)) }, null, 8, ["createData"]) ]), _: 1 }, 512), [ [Ot, t.isLines] ]) ]), _: 1 }, 8, ["modelValue"]) ], 2), Ee("div", { class: xe(["drawer-button", { open: t.drawerOpen, close: !t.drawerOpen }]), onClick: e[3] || (e[3] = (...m) => a.toggleDrawer && a.toggleDrawer(...m)) }, [ oe(p, null, { default: le(() => [ oe(f) ]), _: 1 }) ], 2) ], 2)), [ [Ot, t.material || t.isTextureSlides] ]); } const nD = /* @__PURE__ */ So(_fe, [["render", Sfe], ["__scopeId", "data-v-764a8efa"]]), Mfe = (t, e) => { const r = t.label.toUpperCase(), i = e.label.toUpperCase(); return r < i ? -1 : r > i ? 1 : 0; }, Efe = { name: "ScaffoldTreeControls", components: { ElIconArrowLeft: vs, TreeControls: $X }, props: { /** * Enable/disable colour picker */ showColourPicker: Boolean, isReady: Boolean }, data: function() { return { treeData: [ { label: "Root", regionPath: "", id: void 0, children: [] } ], active: [], hover: [], drawerOpen: !0, nodeNumbers: 0, module: void 0 }; }, computed: { treeDataEntry: function() { return this.treeData[0].children; } }, watch: { treeDataEntry: { deep: !0, handler: function(t) { this.isReady && this.setColourField(t); } } }, methods: { addTreeItem: function(t, e, r) { t.some((i) => i.label === e.label) || (Object.assign(e, { activeColour: this.getColour(e) }), t.push(e), t.sort((i, n) => Mfe(i, n)), this.nodeNumbers++, this.$nextTick(() => { !this.$refs.treeControls.$refs.regionTree.getCheckedKeys().includes(e.id) && r.getVisibility() && this.$refs.treeControls.$refs.regionTree.setChecked(e.id, !0); })); }, // find or create new region, region id is always prefixed with // '__r/' findOrCreateRegion: function(t, e, r) { if (this.module && this.module.scene && (this.treeData[0].id = this.module.scene.getRootRegion().uuid, this.treeData[0].isRegion = !0), e.length > 0) { const i = [...e]; let n = t.children.find( (s) => s.label == i[0] ); const a = r + "/" + e[0], o = this.module.scene.getRootRegion().findChildFromPath(a); return n || (n = { label: i[0], id: o.uuid, children: [], regionPath: a, isRegion: !0 }, this.addTreeItem(t.children, n, o), a === "/_helper" && this.$nextTick(() => { this.$refs.treeControls.$refs.regionTree.setChecked(n.id, !1); })), i.shift(), this.findOrCreateRegion(n, i, a); } else return t; }, /** * This is called when a new zinc object is read into the scene. */ zincObjectAdded: function(t) { const e = t.region; if (e) { const r = e.getFullSeparatedPath(), i = this.findOrCreateRegion(this.treeData[0], r, ""); if (t.groupName && i) { i.children || (i.children = []); const n = { label: t.groupName, id: e.uuid + "/" + t.uuid, isPrimitives: !0, regionPath: t.region.getFullPath(), isTextureSlides: !!t.isTextureSlides }; this.addTreeItem(i.children, n, t); } } }, zincObjectRemoved: function(t) { const e = t.groupName; if (t.region.findObjectsWithGroupName(e, !1).length === 0) { const r = t.region.getFullSeparatedPath(), i = this.findOrCreateRegion(this.treeData[0], r, ""); if (i.children) { for (let n = 0; n < i.children.length; n++) if (i.children[n].label === e) { i.children.splice(n, 1), this.nodeNumbers--; return; } } } }, checkChanged: function(t, e) { const r = t.isRegion, i = t.isPrimitives, n = e.checkedKeys.includes(t.id), a = this.module.scene.getRootRegion().findChildFromPath(t.regionPath); r && (n ? a.showAllPrimitives() : a.hideAllPrimitives()), i && a.findObjectsWithGroupName(t.label).forEach((o) => { o.setVisibility(n); }); }, updateActiveUI: function(t) { this.active.length = 0, mT(t, this.active); }, changeActiveByPrimitives: function(t, e) { t && t.length > 0 ? (this.updateActiveUI(t), this.$emit("object-selected", t, e)) : this.removeActive(e), this.removeHover(e); }, updateHoverUI: function(t) { this.hover.length = 0, mT(t, this.hover); }, changeHoverByPrimitives: function(t, e) { t && t.length > 0 ? (this.updateHoverUI(t), this.$emit("object-hovered", t, e)) : this.removeHover(e); }, /** * Select a region by its name. */ changeActiveByNames: function(t, e, r) { const i = this.module.scene.getRootRegion(), n = qc( i, t, e, !0 ); this.changeActiveByPrimitives(n, r); }, /** * Hover a region by its name. */ changeHoverByNames: function(t, e, r) { const i = this.module.scene.getRootRegion(), n = qc( i, t, e, !0 ); this.changeHoverByPrimitives(n, r); }, changeActiveByNode: function(t, e) { if (t.isPrimitives || t.isRegion) { const r = !!t.isRegion, i = this.getZincObjectsFromNode(t, r); this.changeActiveByPrimitives(i, e); } }, changeHoverByNode: function(t, e) { if (t.isPrimitives) { const r = this.getZincObjectsFromNode(t, !1); this.changeHoverByPrimitives(r, e); } }, /** * Unselect the current selected region. */ removeActive: function(t) { this.active = [], this.$emit("object-selected", [], t); }, /** * Unselect the current hover region. */ removeHover: function(t) { this.hover = [], this.$emit("object-hovered", [], t); }, /** * Reset the controls. */ clear: function() { this.active.length = 0, this.hover.length = 0, this.nodeNumbers = 0, this.$refs.treeControls.$refs.regionTree.updateKeyChildren( this.treeData[0].id, [] ), this.treeData[0].children.length = 0, this.treeData[0].id = void 0, this.$emit("object-selected", []); }, getColour: function(t) { if (t) { let e = this.getZincObjectsFromNode(t, !1)[0]; if (e) { let r = e.getColourHex(); if (r) return "#" + r; } } return "#FFFFFF"; }, getZincObjectsFromNode: function(t, e) { const r = this.module.scene.getRootRegion(); if (t.isPrimitives) return qc( r, t.label, t.regionPath, e ); if (t.isRegion && t.regionPath) { let i = r.findChildFromPath(t.regionPath); if (i) return i.getAllObjects(e); } return []; }, //Set this right at the beginning. setModule: function(t) { this.module = Si(t), this.nodeNumbers = 0, this.module.scene.getRootRegion().getAllObjects(!0).forEach((e) => { this.zincObjectAdded(e); }), this.module.addOrganPartAddedCallback(this.zincObjectAdded), this.module.addOrganPartRemovedCallback(this.zincObjectRemoved); }, setColourField: function(t, e = void 0) { t.filter((r) => e && !r.children ? r.id === e.id : !0).map((r) => { if (r.children) this.setColourField(r.children, e); else { const i = this.getColour(r); r.defaultColour || (r.defaultColour = i), r.activeColour = i; } }); }, setColour: function(t, e) { t && t.isPrimitives && this.getZincObjectsFromNode(t, !1).forEach((r) => { let i = (e || t.defaultColour).replace("#", "0x"); r.setColourHex(i), this.setColourField(this.treeData[0].children, t); }); }, visibilityToggle: function(t, e) { this.module.changeOrganPartsVisibility(t, e), e == !1 && (this.activeRegion === t && this.removeActive(!0), this.hoverRegion === t && this.removeHover(!0)); }, toggleDrawer: function() { this.drawerOpen = !this.drawerOpen, this.$emit("drawer-toggled", this.drawerOpen); }, //Set visibility using full paths and add found id to the ids list //and remove item from list if remove is set to true. setTreeVisibilityWithFullPaths: function(t, e, r, i) { let n = !1, a = ""; t.isRegion && (a = `__r${t.regionPath}`), t.isPrimitives && (a = `${t.regionPath}/${t.label}`); const o = e.indexOf(a); o > -1 && (n = !0, e.splice(o, 1), r.push(t.id)); const s = this.module.scene.getRootRegion().findChildFromPath(t.regionPath); a && a !== "__r" && t.isPrimitives && s.findObjectsWithGroupName(t.label).forEach((c) => c.setVisibility(n)), t.children && t.children.forEach((c) => { this.setTreeVisibilityWithFullPaths(c, e, r, !0); }); }, checkAllKeys: function() { const t = [], e = []; JO(this.treeData[0], t), this.setTreeVisibilityWithFullPaths( this.treeData[0], t, e, !0 ), this.$refs.treeControls.$refs.regionTree.setCheckedKeys(e); }, getState: function() { let t = this.$refs.treeControls.$refs.regionTree.getCheckedKeys(); return t.length === this.nodeNumbers ? { checkAll: !0, version: "2.0" } : { checkedItems: ofe( this.module.scene.getRootRegion(), t ), version: "2.0" }; }, setState: function(t) { if (t) { if (t.checkAll) this.checkAllKeys(); else if (t.checkedItems) { let e = []; t.version !== "2.0" ? (e = t.checkedItems.map((i) => "/" + i), e.shift("__r/")) : e.push(...t.checkedItems); const r = []; this.setTreeVisibilityWithFullPaths( this.treeData[0], e, r, !0 ), this.$refs.treeControls.$refs.regionTree.setCheckedKeys(r); } } } } }, Tfe = { class: "traditional-container" }; function Cfe(t, e, r, i, n, a) { const o = qt("TreeControls"), s = vs, c = yr; return Q(), be("div", { class: xe(["tree-controls", { open: t.drawerOpen, close: !t.drawerOpen }]) }, [ Ee("div", Tfe, [ oe(o, { mapType: "scaffold", title: "Regions", isReady: r.isReady, treeData: a.treeDataEntry, active: t.active, hover: t.hover, showColourPicker: r.showColourPicker, onSetColour: a.setColour, onCheckChanged: a.checkChanged, onChangeActive: a.changeActiveByNode, onChangeHover: a.changeHoverByNode, ref: "treeControls" }, null, 8, ["isReady", "treeData", "active", "hover", "showColourPicker", "onSetColour", "onCheckChanged", "onChangeActive", "onChangeHover"]) ]), Ee("div", { class: xe(["drawer-button", { open: t.drawerOpen, close: !t.drawerOpen }]), onClick: e[0] || (e[0] = (...l) => a.toggleDrawer && a.toggleDrawer(...l)) }, [ oe(c, null, { default: le(() => [ oe(s) ]), _: 1 }) ], 2) ], 2); } const aD = /* @__PURE__ */ So(Efe, [["render", Cfe], ["__scopeId", "data-v-13a8c030"]]); var Afe = !1; function Kf(t, e, r) { return Array.isArray(t) ? (t.length = Math.max(t.length, e), t.splice(e, 1, r), r) : (t[e] = r, r); } function J0(t, e) { if (Array.isArray(t)) { t.splice(e, 1); return; } delete t[e]; } /*! * pinia v2.2.1 * (c) 2024 Eduardo San Martin Morote * @license MIT */ let Ud; const ag = (t) => Ud = t, Lfe = process.env.NODE_ENV !== "production" ? Symbol("pinia") : ( /* istanbul ignore next */ Symbol() ); function Nl(t) { return t && typeof t == "object" && Object.prototype.toString.call(t) === "[object Object]" && typeof t.toJSON != "function"; } var nh; (function(t) { t.direct = "direct", t.patchObject = "patch object", t.patchFunction = "patch function"; })(nh || (nh = {})); const jd = typeof window < "u"; function oD(t, e) { for (const r in e) { const i = e[r]; if (!(r in t)) continue; const n = t[r]; Nl(n) && Nl(i) && !cn(i) && !W1(i) ? t[r] = oD(n, i) : t[r] = i; } return t; } const sD = () => { }; function bT(t, e, r, i = sD) { t.push(e); const n = () => { const a = t.indexOf(e); a > -1 && (t.splice(a, 1), i()); }; return !r && H1() && G1(n), n; } function Cc(t, ...e) { t.slice().forEach((r) => { r(...e); }); } const kfe = (t) => t(), xT = Symbol(), Q0 = Symbol(); function I1(t, e) { t instanceof Map && e instanceof Map ? e.forEach((r, i) => t.set(i, r)) : t instanceof Set && e instanceof Set && e.forEach(t.add, t); for (const r in e) { if (!e.hasOwnProperty(r)) continue; const i = e[r], n = t[r]; Nl(n) && Nl(i) && t.hasOwnProperty(r) && !cn(i) && !W1(i) ? t[r] = I1(n, i) : t[r] = i; } return t; } const Pfe = process.env.NODE_ENV !== "production" ? Symbol("pinia:skipHydration") : ( /* istanbul ignore next */ Symbol() ); function Rfe(t) { return !Nl(t) || !t.hasOwnProperty(Pfe); } const { assign: vn } = Object; function wT(t) { return !!(cn(t) && t.effect); } function _T(t, e, r, i) { const { state: n, actions: a, getters: o } = e, s = r.state.value[t]; let c; function l() { !s && (process.env.NODE_ENV === "production" || !i) && (r.state.value[t] = n ? n() : {}); const u = process.env.NODE_ENV !== "production" && i ? ( // use ref() to unwrap refs inside state TODO: check if this is still necessary Zi(we(n ? n() : {}).value) ) : Zi(r.state.value[t]); return vn(u, a, Object.keys(o || {}).reduce((d, h) => (process.env.NODE_ENV !== "production" && h in u && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${h}" in store "${t}".`), d[h] = Si(ee(() => { ag(r); const f = r._s.get(t); return o[h].call(f, f); })), d), {})); } return c = N1(t, l, e, r, i, !0), c; } function N1(t, e, r = {}, i, n, a) { let o; const s = vn({ actions: {} }, r); if (process.env.NODE_ENV !== "production" && !i._e.active) throw new Error("Pinia destroyed"); const c = { deep: !0 }; process.env.NODE_ENV !== "production" && !Afe && (c.onTrigger = (E) => { l ? f = E : l == !1 && !b._hotUpdating && (Array.isArray(f) ? f.push(E) : console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.")); }); let l, u, d = [], h = [], f; const p = i.state.value[t]; !a && !p && (process.env.NODE_ENV === "production" || !n) && (i.state.value[t] = {}); const m = we({}); let y; function g(E) { let C; l = u = !1, process.env.NODE_ENV !== "production" && (f = []), typeof E == "function" ? (E(i.state.value[t]), C = { type: nh.patchFunction, storeId: t, events: f }) : (I1(i.state.value[t], E), C = { type: nh.patchObject, payload: E, storeId: t, events: f }); const L = y = Symbol(); st().then(() => { y === L && (l = !0); }), u = !0, Cc(d, C, i.state.value[t]); } const v = a ? function() { const { state: E } = r, C = E ? E() : {}; this.$patch((L) => { vn(L, C); }); } : ( /* istanbul ignore next */ process.env.NODE_ENV !== "production" ? () => { throw new Error(`🍍: Store "${t}" is built using the setup syntax and does not implement $reset().`); } : sD ); function x() { o.stop(), d = [], h = [], i._s.delete(t); } const w = (E, C = "") => { if (xT in E) return E[Q0] = C, E; const L = function() { ag(i); const A = Array.from(arguments), k = [], P = []; function R(D) { k.push(D); } function M(D) { P.push(D); } Cc(h, { args: A, name: L[Q0], store: b, after: R, onError: M }); let O; try { O = E.apply(this && this.$id === t ? this : b, A); } catch (D) { throw Cc(P, D), D; } return O instanceof Promise ? O.then((D) => (Cc(k, D), D)).catch((D) => (Cc(P, D), Promise.reject(D))) : (Cc(k, O), O); }; return L[xT] = !0, L[Q0] = C, L; }, S = /* @__PURE__ */ Si({ actions: {}, getters: {}, state: [], hotState: m }), _ = { _p: i, // _s: scope, $id: t, $onAction: bT.bind(null, h), $patch: g, $reset: v, $subscribe(E, C = {}) { const L = bT(d, E, C.detached, () => A()), A = o.run(() => ze(() => i.state.value[t], (k) => { (C.flush === "sync" ? u : l) && E({ storeId: t, type: nh.direct, events: f }, k); }, vn({}, c, C))); return L; }, $dispose: x }, b = _r(process.env.NODE_ENV !== "production" || process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && jd ? vn( { _hmrPayload: S, _customProperties: Si(/* @__PURE__ */ new Set()) // devtools custom properties }, _ // must be added later // setupStore ) : _); i._s.set(t, b); const T = (i._a && i._a.runWithContext || kfe)(() => i._e.run(() => (o = TD()).run(() => e({ action: w })))); for (const E in T) { const C = T[E]; if (cn(C) && !wT(C) || W1(C)) process.env.NODE_ENV !== "production" && n ? Kf(m.value, E, pr(T, E)) : a || (p && Rfe(C) && (cn(C) ? C.value = p[E] : I1(C, p[E])), i.state.value[t][E] = C), process.env.NODE_ENV !== "production" && S.state.push(E); else if (typeof C == "function") { const L = process.env.NODE_ENV !== "production" && n ? C : w(C, E); T[E] = L, process.env.NODE_ENV !== "production" && (S.actions[E] = C), s.actions[E] = C; } else process.env.NODE_ENV !== "production" && wT(C) && (S.getters[E] = a ? ( // @ts-expect-error r.getters[E] ) : C, jd && (T._getters || // @ts-expect-error: same (T._getters = Si([]))).push(E)); } if (vn(b, T), vn(gl(b), T), Object.defineProperty(b, "$state", { get: () => process.env.NODE_ENV !== "production" && n ? m.value : i.state.value[t], set: (E) => { if (process.env.NODE_ENV !== "production" && n) throw new Error("cannot set hotState"); g((C) => { vn(C, E); }); } }), process.env.NODE_ENV !== "production" && (b._hotUpdate = Si((E) => { b._hotUpdating = !0, E._hmrPayload.state.forEach((C) => { if (C in b.$state) { const L = E.$state[C], A = b.$state[C]; typeof L == "object" && Nl(L) && Nl(A) ? oD(L, A) : E.$state[C] = A; } Kf(b, C, pr(E.$state, C)); }), Object.keys(b.$state).forEach((C) => { C in E.$state || J0(b, C); }), l = !1, u = !1, i.state.value[t] = pr(E._hmrPayload, "hotState"), u = !0, st().then(() => { l = !0; }); for (const C in E._hmrPayload.actions) { const L = E[C]; Kf(b, C, w(L, C)); } for (const C in E._hmrPayload.getters) { const L = E._hmrPayload.getters[C], A = a ? ( // special handling of options api ee(() => (ag(i), L.call(b, b))) ) : L; Kf(b, C, A); } Object.keys(b._hmrPayload.getters).forEach((C) => { C in E._hmrPayload.getters || J0(b, C); }), Object.keys(b._hmrPayload.actions).forEach((C) => { C in E._hmrPayload.actions || J0(b, C); }), b._hmrPayload = E._hmrPayload, b._getters = E._getters, b._hotUpdating = !1; })), process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && jd) { const E = { writable: !0, configurable: !0, // avoid warning on devtools trying to display this property enumerable: !1 }; ["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((C) => { Object.defineProperty(b, C, vn({ value: b[C] }, E)); }); } return i._p.forEach((E) => { if (process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && jd) { const C = o.run(() => E({ store: b, app: i._a, pinia: i, options: s })); Object.keys(C || {}).forEach((L) => b._customProperties.add(L)), vn(b, C); } else vn(b, o.run(() => E({ store: b, app: i._a, pinia: i, options: s }))); }), process.env.NODE_ENV !== "production" && b.$state && typeof b.$state == "object" && typeof b.$state.constructor == "function" && !b.$state.constructor.toString().includes("[native code]") && console.warn(`[🍍]: The "state" must be a plain object. It cannot be state: () => new MyClass() Found in store "${b.$id}".`), p && a && r.hydrate && r.hydrate(b.$state, p), l = !0, u = !0, b; } function Ofe(t, e, r) { let i, n; const a = typeof e == "function"; i = t, n = a ? r : e; function o(s, c) { const l = ED(); if (s = // in test mode, ignore the argument provided as we can always retrieve a // pinia instance with getActivePinia() (process.env.NODE_ENV === "test" && Ud && Ud._testing ? null : s) || (l ? Ye(Lfe, null) : null), s && ag(s), process.env.NODE_ENV !== "production" && !Ud) throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"? See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help. This will fail in production.`); s = Ud, s._s.has(i) || (a ? N1(i, e, n, s) : _T(i, n, s), process.env.NODE_ENV !== "production" && (o._pinia = s)); const u = s._s.get(i); if (process.env.NODE_ENV !== "production" && c) { const d = "__hot:" + i, h = a ? N1(d, e, n, s, !0) : _T(d, vn({}, n), s, !0); c._hotUpdate(h), delete s.state.value[d], s._s.delete(d); } if (process.env.NODE_ENV !== "production" && jd) { const d = Ct(); if (d && d.proxy && // avoid adding stores that are just built for hot module replacement !c) { const h = d.proxy, f = "_pStores" in h ? h._pStores : h._pStores = {}; f[i] = u; } } return u; } return o.$id = i, o; } function lD(t, e) { return Array.isArray(e) ? e.reduce((r, i) => (r[i] = function() { return t(this.$pinia)[i]; }, r), {}) : Object.keys(e).reduce((r, i) => (r[i] = function() { const n = t(this.$pinia), a = e[i]; return typeof a == "function" ? a.call(this, n) : n[a]; }, r), {}); } const cD = Ofe("main", { state: () => ({ userProfile: { token: "" } }), getters: { userToken(t) { return t.userProfile.token; } }, actions: { setUserToken(t) { this.userProfile.token = t; } } }), Dfe = { name: "ScaffoldTooltip", components: { Col: Jn, CreateTooltipContent: D8, ElIconDelete: Zm, Icon: yr, Popover: rv, Row: Aa, Tooltip: LX }, props: { createData: { type: Object, default: { toBeConfirmed: !1, points: [], shape: "", x: 0, y: 0 } }, label: { type: String, default: "" }, annotationDisplay: { type: Boolean, default: !1 }, region: { type: String, default: "" }, visible: { type: Boolean, default: !1 }, x: { type: Number, default: 200 }, y: { type: Number, default: 200 } }, inject: ["scaffoldUrl"], provide() { return { userApiKey: this.userToken }; }, data: function() { return { display: !1, annotationEntry: {}, ElIconDelete: mr(Zm) }; }, computed: { ...lD(cD, ["userToken"]), position: function() { let t = 40; return this.region && (t = 55), { left: this.x - 40 + "px", top: this.y - t + "px" }; } }, methods: { checkForDisplay: function() { if (this.visible && this.label && this.label !== "") { if (this.display = !0, this.annotationDisplay) { const t = this.region ? this.region + "/" : ""; this.annotationEntry = { featureId: t + this.label, resourceId: this.scaffoldUrl, resource: this.scaffoldUrl }; } } else this.display = !1, this.annotationEntry = {}; }, hideTriggered: function() { this.$emit("tooltip-hide"); } }, watch: { label: { handler: function() { this.checkForDisplay(); }, immediate: !0 }, visible: { handler: function() { this.checkForDisplay(); }, immediate: !0 }, annotationDisplay: { handler: function() { this.checkForDisplay(); }, immediate: !0 } } }, Ife = { class: "tooltip-text" }, Nfe = { key: 0, class: "tooltip-text" }, Bfe = { key: 1, class: "delete-container" }; function Ffe(t, e, r, i, n, a) { const o = qt("CreateTooltipContent"), s = qt("Tooltip"), c = Jn, l = Ku, u = Aa, d = rv; return Q(), be("div", { style: yt(a.position), class: "region-tooltip" }, [ oe(d, { ref: "tooltip", visible: r.visible, placement: "top", "show-arrow": !1, teleported: !1, trigger: "manual", "popper-class": "tooltip-popper non-selectable", "virtual-triggering": "", onHide: a.hideTriggered }, { default: le(() => [ Ee("div", Ife, Ze(r.label), 1), r.region ? (Q(), be("div", Nfe, "Region: " + Ze(r.region), 1)) : Pe("", !0), ht(oe(o, { createData: r.createData, onConfirmCreate: e[0] || (e[0] = (h) => t.$emit("confirm-create", h)), onCancelCreate: e[1] || (e[1] = (h) => t.$emit("cancel-create")) }, null, 8, ["createData"]), [ [Ot, r.createData.toBeConfirmed] ]), ht(oe(s, { class: "p-tooltip", ref: "annotationTooltip", annotationDisplay: !0, annotationEntry: t.annotationEntry }, null, 8, ["annotationEntry"]), [ [Ot, r.annotationDisplay && !r.createData.toBeConfirmed] ]), r.createData.toBeDeleted ? (Q(), be("div", Bfe, [ oe(u, null, { default: le(() => [ oe(c, { span: 10 }, { default: le(() => [ et("Delete this feature?") ]), _: 1 }), oe(c, { span: 7 }, { default: le(() => [ oe(l, { class: "delete-button", icon: t.ElIconDelete, onClick: e[2] || (e[2] = (h) => t.$emit("confirm-delete")) }, { default: le(() => [ et(" Delete ") ]), _: 1 }, 8, ["icon"]) ]), _: 1 }), oe(c, { span: 6 }, { default: le(() => [ oe(l, { class: "delete-button", onClick: e[3] || (e[3] = (h) => t.$emit("cancel-create")) }, { default: le(() => [ et(" Dismiss ") ]), _: 1 }) ]), _: 1 }) ]), _: 1 }) ])) : Pe("", !0) ]), _: 1 }, 8, ["visible", "onHide"]) ], 4); } const uD = /* @__PURE__ */ So(Dfe, [["render", Ffe], ["__scopeId", "data-v-e665391a"]]); /*! js-cookie v3.0.5 | MIT */ function Jf(t) { for (var e = 1; e < arguments.length; e++) { var r = arguments[e]; for (var i in r) t[i] = r[i]; } return t; } var zfe = { read: function(t) { return t[0] === '"' && (t = t.slice(1, -1)), t.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent); }, write: function(t) { return encodeURIComponent(t).replace( /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent ); } }; function B1(t, e) { function r(n, a, o) { if (!(typeof document > "u")) { o = Jf({}, e, o), typeof o.expires == "number" && (o.expires = new Date(Date.now() + o.expires * 864e5)), o.expires && (o.expires = o.expires.toUTCString()), n = encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape); var s = ""; for (var c in o) o[c] && (s += "; " + c, o[c] !== !0 && (s += "=" + o[c].split(";")[0])); return document.cookie = n + "=" + t.write(a, n) + s; } } function i(n) { if (!(typeof document > "u" || arguments.length && !n)) { for (var a = document.cookie ? document.cookie.split("; ") : [], o = {}, s = 0; s < a.length; s++) { var c = a[s].split("="), l = c.slice(1).join("="); try { var u = decodeURIComponent(c[0]); if (o[u] = t.read(l, u), n === u) break; } catch { } } return n ? o[n] : o; } } return Object.create( { set: r, get: i, remove: function(n, a) { r( n, "", Jf({}, a, { expires: -1 }) ); }, withAttributes: function(n) { return B1(this.converter, Jf({}, this.attributes, n)); }, withConverter: function(n) { return B1(Jf({}, this.converter, n), this.attributes); } }, { attributes: { value: Object.freeze(e) }, converter: { value: Object.freeze(t) } } ); } var F1 = B1(zfe, { path: "/" }), ia = function(t, e, r, i, n) { if (typeof e == "function" ? t !== e || !n : !e.has(t)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return e.set(t, r), r; }, Er = function(t, e, r, i) { if (r === "a" && !i) throw new TypeError("Private accessor was defined without a getter"); if (typeof e == "function" ? t !== e || !i : !e.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return r === "m" ? i : r === "a" ? i.call(t) : i ? i.value : e.get(t); }, za, ah, na, _i, jo; const $fe = 1e4; class Vfe { /** * @param serverEndpoint The URL of a map annotation service. */ constructor(e) { za.add(this), ah.set(this, void 0), na.set(this, null), _i.set( this, null /** * @param serverEndpoint The URL of a map annotation service. */ ), e.slice(-1) === "/" ? ia(this, ah, e.slice(0, -1)) : ia(this, ah, e); } /** * Get information about the logged-in SPARC user. * * Requires {@linkcode authenticate} to first be called. */ get currentUser() { return Er(this, na, "f"); } /** * Get information about any error from the last call * to {@linkcode authenticate}. */ get currentError() { return Er(this, _i, "f"); } /** * Authenticate the logged-in SPARC user. * * @param userApiKey The Api token of the logged-in Pennsieve user * @return A Promise resolving to either data about a valid user * or a reason why the user is invalid. */ async authenticate(e) { ia(this, _i, null), ia(this, na, null); const r = await Er(this, za, "m", jo).call(this, e, "authenticate"); return "error" in r ? (F1.remove("annotation-key"), Promise.resolve(Er(this, _i, "f"))) : (F1.set("annotation-key", r.session, { secure: !0, expires: 1 }), ia(this, na, r.data), Promise.resolve(Er(this, na, "f"))); } /** * Unauthenticate with the annotation service. * * @param userApiKey The Api token of the logged-in Pennsieve user * @return A Promise with data about the call. */ async unauthenticate(e) { ia(this, _i, null), ia(this, na, null); const r = await Er(this, za, "m", jo).call(this, e, "unauthenticate"); return "success" in r ? Promise.resolve(r) : Promise.resolve(Er(this, _i, "f")); } /** * Get identifiers of all annotated items in a resource. * * @param userApiKey The Api token of the logged-in Pennsieve user * @param resourceId The resource's identifier * @param userId A user identifier (ORCID). Optional * @param participated Get items the user was involved in annotating or not. * Optional, default ``true`` * @return A Promise resolving to either a list of identifiers of annotated * items or a reason why identifiers couldn't be retrieved. */ async annotatedItemIds(e, r, i, n) { const a = { resource: r }; i !== void 0 && (a.user = i), n !== void 0 && (a.participated = n); const o = await Er(this, za, "m", jo).call(this, e, "items/", "GET", a); return "error" in o ? Promise.resolve(Er(this, _i, "f")) : Promise.resolve(o); } /** * Get all annotated features drawn on a resource. * * @param userApiKey The Api token of the logged-in Pennsieve user * @param resourceId The resource's identifier * @return A Promise resolving to either a list of annotated * features drawn on the resource or a reason why * features couldn't be retrieved. */ async drawnFeatures(e, r, i) { const n = { resource: r }; i !== void 0 && (n.items = i); const a = await Er(this, za, "m", jo).call(this, e, "features/", "GET", n); return "error" in a ? Promise.resolve(Er(this, _i, "f")) : Promise.resolve(a); } /** * Get all annotations about a specific item in a resource. * * @param userApiKey The Api token of the logged-in Pennsieve user * @param resourceId The resource's identifier * @param itemId The item's identifier within the resource * @return A Promise resolving to either a list of * annotations about the item or a reason * why annotations couldn't be retrieved. */ async itemAnnotations(e, r, i) { const n = await Er(this, za, "m", jo).call(this, e, "annotations/", "GET", { resource: r, item: i }); return "error" in n ? Promise.resolve(Er(this, _i, "f")) : Promise.resolve(n); } /** * Get details of a specific annotation. * * @param userApiKey The Api token of the logged-in Pennsieve user * @param annotationId The annotation's URI * @return A Promise resolving to either an annotation * with the given URI or a reason why the * annotation couldn't be retrieved. */ async annotation(e, r) { const i = await Er(this, za, "m", jo).call(this, e, "annotation/", "GET", { annotation: r }); return "error" in i ? Promise.resolve(Er(this, _i, "f")) : Promise.resolve(i); } /** * Add an annotation about a specific item in a resource. * * @param userApiKey The Api token of the logged-in Pennsieve user * @param annotation Annotation about the feature * @return A Promise resolving to either the resulting * full annotation or a reason why the * annotation couldn't be added */ async addAnnotation(e, r) { if (Er(this, na, "f") && Er(this, na, "f").canUpdate) { const i = Object.assign({ creator: Er(this, na, "f"), created: (/* @__PURE__ */ new Date()).toISOString() }, r), n = await Er(this, za, "m", jo).call(this, e, "annotation/", "POST", { data: i }); if (!("error" in n)) return Promise.resolve(n); ia(this, _i, n); } else ia(this, _i, { error: "user cannot add annotation" }); return Promise.resolve(Er(this, _i, "f")); } } ah = /* @__PURE__ */ new WeakMap(), na = /* @__PURE__ */ new WeakMap(), _i = /* @__PURE__ */ new WeakMap(), za = /* @__PURE__ */ new WeakSet(), jo = async function(t, e, r = "GET", i = {}) { let n = !0; const a = new AbortController(); setTimeout(() => { n && (console.log("Annotation server timeout..."), a.abort()); }, $fe); const o = { method: r, signal: a.signal }; let s = `${Er(this, ah, "f")}/${e}`; const c = F1.get("annotation-key") || ""; if (r === "GET") { const u = []; for (const [d, h] of Object.entries(i)) u.push(`${d}=${encodeURIComponent(JSON.stringify(h))}`); u.push(`key=${encodeURIComponent(t)}`), u.push(`session=${encodeURIComponent(c)}`), s += "?" + u.join("&"), o.headers = { Accept: "application/json; charset=utf-8", "Cache-Control": "no-store" }; } else if (r === "POST") { const u = Object.assign({ key: t, session: c }, i); o.body = JSON.stringify(u), o.headers = { Accept: "application/json; charset=utf-8", "Content-Type": "application/json; charset=utf-8", "Cache-Control": "no-store" }; } const l = await fetch(s, o); return n = !1, l.ok ? Promise.resolve(await l.json()) : (ia(this, _i, { error: `${l.status} ${l.statusText}` }), Promise.resolve(Er(this, _i, "f"))); }; const Uh = { ALL: 0, SELECTED: 1, HIGHLIGHTED: 2, MOVE: 3 }, Ufe = function(t, e, r) { this.eventType = t, this.identifiers = e, this.zincObjects = r; }, jfe = function(t, e, r) { this.targetedID = []; const i = t, n = e; this.targetEventType = r; const a = this; r === void 0 && (this.targetEventType = Uh.ALL), this.getEventType = function() { return r; }, this.notify = function(o, s, c, l) { if (o !== i && (a.targetEventType === Uh.ALL || a.targetEventType === s)) { const u = new Ufe(s, c, l); n(u); } }; }, Hfe = function() { const t = []; this.publish = function(e, r, i, n) { for (let a = 0; a < t.length; a++) t[a].notify(e, r, i, n); }, this.subscribe = function(e, r, i) { if (typeof r == "function") { const n = new jfe(e, r, i); return t.push(n), n; } }, this.unsubscribe = function(e) { for (let r = 0; r < t.length; r++) if (e === t[r]) { t.splice(r, 1); return; } }; }, ST = { isWebGLAvailable: function() { try { var t = document.createElement("canvas"); return !!(window.WebGLRenderingContext && (t.getContext("webgl") || t.getContext("experimental-webgl"))); } catch { return !1; } }, isWebGL2Available: function() { try { var t = document.createElement("canvas"); return !!(window.WebGL2RenderingContext && t.getContext("webgl2")); } catch { return !1; } }, getWebGLErrorMessage: function() { return this.getErrorMessage(1); }, getWebGL2ErrorMessage: function() { return this.getErrorMessage(2); }, getErrorMessage: function(t) { var e = { 1: "WebGL", 2: "WebGL 2" }, r = { 1: window.WebGLRenderingContext, 2: window.WebGL2RenderingContext }, i = 'This module requires $1 support but your $0 does not seem to support it.', n = document.createElement("div"); return n.id = "webglmessage", n.style.fontFamily = "monospace", n.style.fontSize = "20px", n.style.fontWeight = "normal", n.style.textAlign = "center", n.style.background = "#fff", n.style.color = "#000", n.style.padding = "1.5em", n.style.width = "400px", n.style.margin = "5em auto 0", r[t] ? i = i.replace("$0", "graphics card") : i = i.replace("$0", "browser"), i = i.replace("$1", e[t]), n.innerHTML = i, n; } }, Tw = { ALL: 0, DESTROYED: 1, NAME_CHANGED: 2, SETTINGS_CHANGED: 3 }, pn = function() { this.typeName = "Base Module", this.instanceName = "default", this.onChangedCallbacks = [], this.eventNotifiers = []; }; pn.prototype.setName = function(t) { if (t && this.instanceName !== t) { this.instanceName = t; const e = this.onChangedCallbacks.slice(); for (let r = 0; r < e.length; r++) e[r](this, Tw.NAME_CHANGED); } }; pn.prototype.settingsChanged = function() { const t = this.onChangedCallbacks.slice(); for (let e = 0; e < t.length; e++) t[e](this, Tw.SETTINGS_CHANGED); }; pn.prototype.exportSettings = function() { const t = {}; return t.dialog = this.typeName, t.name = this.instanceName, t; }; pn.prototype.importSettings = function(t) { return t.dialog == this.typeName ? (this.setName(t.name), !0) : !1; }; pn.prototype.publishChanges = function(t, e, r) { for (let i = 0; i < this.eventNotifiers.length; i++) this.eventNotifiers[i].publish(this, e, t, r); }; pn.prototype.getName = function() { return this.instanceName; }; pn.prototype.destroy = function() { const t = this.onChangedCallbacks.slice(); for (let e = 0; e < t.length; e++) t[e](this, Tw.DESTROYED); delete this; }; pn.prototype.addChangedCallback = function(t) { this.onChangedCallbacks.includes(t) == !1 && this.onChangedCallbacks.push(t); }; pn.prototype.removeChangedCallback = function(t) { const e = this.onChangedCallbacks.indexOf(t); e > -1 && this.onChangedCallbacks.splice(e, 1); }; pn.prototype.addNotifier = function(t) { this.eventNotifiers.push(t); }; const Qf = (t, e, r) => { for (let i = 0; i < t.length; i++) if (t[i] && t[i].material && t[i].material.emissive) { let n = t[i].userData; n && n.isZincObject ? n.setEmissiveRGB(e) : t[i].material && t[i].material.emissive && t[i].material.emissive.setRGB(...e), r && t[i].material.depthFunc && (t[i].material.depthFunc = es.THREE.LessEqualDepth), t[i].children.forEach((a) => { const o = a.userData; o && o.isZincObject && a.material && a.material.emissive && a.material.emissive.setRGB(...e); }); } }, Gfe = function() { let t = [], e = []; this.highlightColour = [1, 0, 0], this.selectColour = [0, 1, 0], this.originalColour = [0, 0, 0]; const r = [], i = [], n = this, a = function(c, l) { if (c.length == 0 && l.length == 0) return !1; for (let u = 0; u < c.length; u++) { let d = !1; for (let h = 0; h < l.length; h++) c[u] === l[h] && (d = !0); if (!d) return !0; } for (let u = 0; u < l.length; u++) { let d = !1; for (let h = 0; h < c.length; h++) l[u] === c[h] && (d = !0); if (!d) return !0; } return !1; }, o = function(c, l) { if (r.length = 0, l.length == 0) return c; for (let u = 0; u < c.length; u++) { let d = !1; for (let h = 0; h < l.length; h++) c[u] === l[h] && (d = !0); d || r.push(c[u]); } return r; }; this.setHighlighted = function(c) { const l = [...t]; n.resetHighlighted(); const u = o(c, e), d = s(u); return Qf(d, n.highlightColour, !1), t = u, a(t, l); }, this.setSelected = function(c) { const l = [...e]; n.resetHighlighted(), n.resetSelected(); const u = s(c); return Qf(u, n.selectColour, !1), e = c, a(e, l); }; const s = function(c) { i.length = 0; for (let l = 0; l < c.length; l++) c[l].material && i.push(c[l]); return i; }; this.resetHighlighted = function() { const c = s(t); Qf(c, n.originalColour, !0), t = []; }, this.resetSelected = function() { const c = s(e); Qf(c, n.originalColour, !0), e = []; }, this.getSelected = function() { return e; }, this.reset = function() { n.resetSelected(), n.resetHighlighted(); }; }, Cw = _m.THREE, Wfe = function() { const t = document.createElement("div"); let e; if (t.style.height = "100%", ST.isWebGLAvailable()) e = new _m.Renderer(t, window), _m.defaultMaterialColor = 16777116, e.initialiseVisualisation(), e.playAnimation = !1; else { const r = ST.getWebGLErrorMessage(); t.appendChild(r); } return { Zinc: _m, renderer: e, container: t }; }, Lr = function() { pn.call(this), this.scene = void 0, this.rendererContainer = void 0, this.displayArea = void 0, this.graphicsHighlight = new Gfe(), this.selectObjectOnPick = !0, this.zincRenderer = null, this.selectedScreenCoordinates = new Cw.Vector3(), this.selectedCenter = void 0, this.liveUpdatesObjects = void 0, this.ignorePreviousSelected = !1; }; Lr.prototype = Object.create(pn.prototype); Lr.prototype.getIntersectedObject = function(t) { if (t) { const e = t.map((i) => { if (i && i.object && i.object.userData) { if (i.object.userData.isMarker) return 1; if (i.object.name && i.object.userData.isZincObject) return 2; } return 0; }); let r = e.indexOf(1); return r = r > -1 ? r : e.indexOf(2), t[r]; } }; Lr.prototype.getAnnotationsFromObjects = function(t) { const e = []; for (var r = 0; r < t.length; r++) { const i = t[r].userData; let n; if (i) { if (i.isGlyph || i.isGlyphset) { let a = i; i.isGlyph && (a = i.getGlyphset()), n = a.userData ? a.userData.annotation : void 0, n && n.data && (t[r].name && t[r].name != "" ? n.data.id = t[r].name : n.data.id = a.groupName); } else n = i.userData ? i.userData.annotation : void 0, n && n.data && (n.data.id = t[r].name); n && (n.data.zincObject = i); } n && e.push(n); } return e; }; Lr.prototype.setHighlightedByObjects = function(t, e, r, i) { const n = this.graphicsHighlight.setHighlighted(t), a = this.objectsToZincObjects(t); if (i) { let o = Uh.MOVE; n && (o = Uh.HIGHLIGHTED); const s = this.getAnnotationsFromObjects(t); s.length > 0 && (s[0].coords = e, s[0].extraData = r), this.publishChanges(s, o, a); } return n; }; Lr.prototype.setHighlightedByZincObjects = function(t, e, r, i) { let n = []; return t && t.forEach((a) => { a && a.getMorph() && n.push(a.getMorph()); }), this.setHighlightedByObjects(n, e, r, i); }; Lr.prototype.setupLiveCoordinates = function(t) { if (this.liveUpdatesObjects = t, t && t.length > 0) { const e = this.scene.getBoundingBoxOfZincObjects(t); let r = new Cw.Vector3(); e ? (e.getCenter(r), this.selectedCenter == null ? this.selectedCenter = r : this.selectedCenter.copy(r)) : this.selectedCenter = void 0; } else this.selectedCenter = void 0; }; Lr.prototype.objectsToZincObjects = function(t) { const e = []; for (let r = 0; r < t.length; r++) { let i = t[r].userData; if (i) if (i.isGlyph || i.isGlyphset) { let n = i; i.isGlyph && (n = i.getGlyphset()), e.push(n); } else e.push(i); } return e; }; Lr.prototype.setSelectedByObjects = function(t, e, r, i) { let n = !1; if (this.selectObjectOnPick ? n = this.graphicsHighlight.setSelected(t) : n = !0, n || this.ignorePreviousSelected) { const a = this.objectsToZincObjects(t); if (this.selectObjectOnPick && this.setupLiveCoordinates(a), i) { const o = Uh.SELECTED, s = this.getAnnotationsFromObjects(t); s.length > 0 && (s[0].coords = e, s[0].extraData = r), this.publishChanges(s, o, a); } } return n; }; Lr.prototype.setSelectedByZincObjects = function(t, e, r, i) { let n = []; return t && t.forEach((a) => { if (a) { const o = a.getMorph(); o && n.push(o); } }), this.setSelectedByObjects(n, e, r, i); }; Lr.prototype.findObjectsByGroupName = function(t) { return this.scene.findObjectsWithGroupName(t); }; Lr.prototype.setHighlightedByGroupName = function(t, e) { const r = this.findObjectsByGroupName(t); return this.setHighlightedByObjects(r, void 0, {}, e); }; Lr.prototype.setSelectedByGroupName = function(t, e) { const r = this.findObjectsByGroupName(t); return this.setSelectedByObjects(r, void 0, {}, e); }; Lr.prototype.changeBackgroundColour = function(t) { const e = new Cw.Color(t); this.zincRenderer && this.zincRenderer.getThreeJSRenderer().setClearColor(e, 1); }; Lr.prototype.resetView = function() { this.zincRenderer && this.zincRenderer.resetView(); }; Lr.prototype.viewAll = function() { this.zincRenderer && this.zincRenderer.viewAll(); }; Lr.prototype.playAnimation = function(t) { this.zincRenderer && (this.zincRenderer.playAnimation = t); }; Lr.prototype.setPlayRate = function(t) { this.zincRenderer && this.zincRenderer.setPlayRate(t); }; Lr.prototype.getPlayRate = function(t) { return this.zincRenderer ? this.zincRenderer.getPlayRate() : 0; }; Lr.prototype.initialiseRenderer = function(t) { if (this.zincRenderer === void 0 || this.rendererContainer === void 0) { let e = Wfe(); this.Zinc = e.Zinc, this.zincRenderer = e.renderer, this.rendererContainer = e.container; } t && (this.displayArea = t, this.displayArea.appendChild(this.rendererContainer), this.zincRenderer && this.zincRenderer.animate()); }; Lr.prototype.destroy = function() { this.zincRenderer && (this.zincRenderer.dispose(), this.zincRenderer.getThreeJSRenderer().dispose(), this.zincRenderer = void 0), pn.prototype.destroy.call(this); }; const qfe = function() { this.type = "anatomical", this.data = void 0, this.isAnnotation = !0; }, Xfe = function() { this.currentName = "", this.currentSystem = "", this.currentPart = "", this.currentSpecies = "", this.metaURL = "", this.viewURL = "", this.timeVarying = !1, this.currentTime = 0; }, dD = function(t) { Lr.call(this); const e = this; let r; this.sceneData = new Xfe(); const i = new Array(), n = new Array(), a = new Array(), o = new Array(); let s; const c = t; this.NDCCameraControl = void 0, e.typeName = "Organ Viewer", this.getSceneData = function() { return e.sceneData; }, this.updateTime = function(b) { let T = 6e3; e.scene && (T = e.scene.getDuration()); const E = b / 100 * T; e.sceneData.nerveMapIsActive || e.scene && e.scene.setMorphsTime(E), e.sceneData.currentTime = b; }; const l = function() { let b = 3e3; e.scene && (b = e.scene.getDuration()); const T = e.zincRenderer.getCurrentTime(); for (let E = 0; E < i.length; E++) i[E](T); !e.sceneData.nerveMapIsActive && r && r.setMorphsTime(T), e.sceneData.nerveMap && e.sceneData.nerveMap.additionalReader && e.sceneData.nerveMap.additionalReader.setTime(T / b), e.sceneData.currentTime = T / b * 100; }; this.getCurrentTime = function() { return e.sceneData.currentTime; }, this.toggleSyncControl = (b, T) => { let E = this.scene.getZincCameraControls(); b ? (E.resetView(), this.NDCCameraControl = E.enableSyncControl(), E.setRotationMode(T)) : (E.disableSyncControl(), this.NDCCameraControl = void 0, E.setRotationMode("free")); }, this.isSyncControl = () => this.NDCCameraControl !== void 0, this.setSyncControlZoomToBox = (b) => { this.NDCCameraControl && this.NDCCameraControl.zoomToBox(b, 2); }, this.setSyncControlCallback = (b) => { this.NDCCameraControl && this.NDCCameraControl.setEventCallback(b); }, this.setSyncControlCenterZoom = (b, T) => { this.NDCCameraControl && this.NDCCameraControl.setCenterZoom(b, T); }; const u = function() { if (e.zincRenderer.playAnimation && e.liveUpdatesObjects && e.setupLiveCoordinates(e.liveUpdatesObjects), e.selectedCenter) { const b = new es.THREE.Vector3(); b.copy(e.selectedCenter); const T = e.scene.vectorToScreenXY(b); e.selectedScreenCoordinates.x = T.x, e.selectedScreenCoordinates.y = T.y; } }, d = function() { return function() { l(); }; }, h = function() { return function() { u(); }; }; this.addTimeChangedCallback = function(b) { i.push(b); }, this.setTexturePos = function(b) { e.sceneData.nerveMap && e.sceneData.nerveMap.additionalReader && e.sceneData.nerveMap.additionalReader.setSliderPos(b); }, this.addSceneChangedCallback = function(b) { n.push(b); }, this.addOrganPartAddedCallback = function(b) { a.push(b); }, this.addOrganPartRemovedCallback = function(b) { o.push(b); }, this.setFinishDownloadCallback = function(b) { s = b; }, this.unsetFinishDownloadCallback = function() { s = void 0; }, this.getNamedObjectsToScreenCoordinates = function(b, T) { const E = new es.THREE.Vector3(); E.setFromMatrixPosition(obj.matrixWorld); const C = width / 2, L = height / 2; return E.project(T), E.x = E.x * C + C, E.y = -(E.y * L) + L, E; }; const f = function(b) { let T, E; if (b !== void 0) { let C = !1; b.object.userData && b.object.userData.isMarker ? (C = !0, E = b.object.userData.parent.getMorph()) : E = b.object; try { E.userData.userData.annotation.data.lastActionOnMarker = C; } finally { } if (E) if (E.name) T = E.name; else { const L = e.getAnnotationsFromObjects( [E] ); L && L[0] && (T = L[0].data.group); } } return { id: T, object: E }; }, p = function() { return function(b, T, E) { var C; const L = e.getIntersectedObject(b), A = f(L), k = { worldCoords: [ L ? L.point.x : 0, L ? L.point.y : 0, L ? L.point.z : 0 ], intersected: L, intersects: b }, P = { x: T, y: E }; if (A.id) { k.threeID = (C = A.object) == null ? void 0 : C.id, A.object.userData.isGlyph ? A.object.name ? e.setSelectedByObjects( [A.object], P, k, !0 ) : e.setSelectedByZincObjects( A.object.userData.getGlyphset(), P, k, !0 ) : e.setSelectedByObjects([A.object], P, k, !0); return; } else e.setSelectedByObjects([], P, k, !0); }; }, m = function() { return function(b, T, E) { var C; const L = e.getIntersectedObject(b), A = f(L), k = { worldCoords: [ L ? L.point.x : 0, L ? L.point.y : 0, L ? L.point.z : 0 ] }, P = { x: T, y: E }; if (A.id) { k.threeID = (C = A.object) == null ? void 0 : C.id, e.displayArea.style.cursor = "pointer", e.setHighlightedByObjects([A.object], P, k, !0); return; } else e.displayArea.style.cursor = "auto", e.setHighlightedByObjects([], P, k, !0); }; }, y = function(b, T, E, C) { if (C == "all" || C == "geometries") { const L = b.findGeometriesWithGroupName(T); for (let A = 0; A < L.length; A++) L[A].setVisibility(E); } if (C == "all" || C == "glyphsets") { const L = b.findGlyphsetsWithGroupName(T); for (let A = 0; A < L.length; A++) L[A].setVisibility(E); } if (C == "all" || C == "pointsets") { const L = b.findPointsetsWithGroupName(T); for (let A = 0; A < L.length; A++) L[A].setVisibility(E); } if (C == "all" || C == "lines") { const L = b.findLinesWithGroupName(T); for (let A = 0; A < L.length; A++) L[A].setVisibility(E); } }; this.changeGeometriesVisibility = function(b, T) { y(e.scene, b, T, "geometries"); }, this.changeGlyphsetsVisibility = function(b, T) { y(e.scene, b, T, "glyphsets"); }, this.changeLinesVisibility = function(b, T) { y(e.scene, b, T, "lines"); }, this.changePointsetsVisibility = function(b, T) { y(e.scene, b, T, "pointsets"); }, this.changeOrganPartsVisibility = function(b, T, E) { let C = "all"; E !== void 0 && (C = E), y(e.scene, b, T, C); }, this.changeOrganPartsVisibilityCallback = function(b) { return function(T) { e.changeOrganPartsVisibility(b, T); }; }, this.changeBackgroundColour = function(b) { const T = new es.THREE.Color(b); e.zincRenderer && e.zincRenderer.getThreeJSRenderer().setClearColor(T, 1); }; const g = function(b, T, E, C) { for (let k = 0; k < a.length; k++) a[k](C, e.scene.isTimeVarying()); const L = new qfe(), A = C.region.getFullPath(); L.data = { species: e.sceneData.currentSpecies, system: b, part: T, group: C.groupName, region: A, uuid: C.uuid, lastActionOnMarker: !1 }, C.userData.annotation = L; }, v = function(b, T, E, C) { for (let L = 0; L < o.length; L++) o[L](C); }, x = function(b, T, E) { return function(C) { g(b, T, E, C); }; }, w = function(b, T, E) { return function(C) { v(b, T, E, C); }; }, S = function() { return function() { e.settingsChanged(), e.sceneData.timeVarying = e.scene.isTimeVarying(), s && s(); }; }; this.updateFieldvisibility = function(b, T) { for (let E = 0; E < b.length; E++) if (T != E) { const C = b[E].PartName; e.changeOrganPartsVisibility(C, !1); } if (T > -1) { const E = b[T].PartName; if (e.scene.findGeometriesWithGroupName(E).length > 0 || e.scene.findGlyphsetsWithGroupName(E).length > 0) e.changeOrganPartsVisibility(E, !0); else { const C = getOrganDetails(b[T].SystemName, E); C != null && e.scene.loadMetadataURL(c.getOrgansDirectoryPrefix() + "/" + C.meta); } } }, this.getAvailableSpecies = function(b, T, E) { const C = new Array(); C.push("none"); const L = Object.keys(organsFileMap); for (index in L) { const A = L[index]; A != b && organsFileMap[A].hasOwnProperty(T) && organsFileMap[A][T].hasOwnProperty(E) && C.push(A); } return C; }, this.getCentreAndSize = function() { const b = new es.THREE.Vector3(), T = this.scene.getBoundingBox(); T.getCenter(b); const E = [b.x, b.y, b.z]; T.getSize(b); const C = [b.x, b.y, b.z]; return { centre: E, size: C }; }; const _ = function(b, T, E, C) { e.sceneData.nerveMapIsActive = !1, e.sceneData.nerveMap = void 0, e.sceneData.metaURL = "", e.sceneData.viewURL = "", e.sceneData.currentSpecies = b, e.sceneData.currentSystem = T, e.sceneData.currentPart = E, e.sceneData.currentTime = 0, e.sceneData.timeVarying = !1; let L = ""; b && (L = b + "/"), T && (L = T + "/"), E && (L = E), e.sceneData.currentName = L; }; this.loadOrgansFromURL = function(b, T, E, C, L, A) { if (e.zincRenderer && C && e.sceneData.metaURL !== b) { _(T, E, C); const k = e.sceneData.currentName; let P = e.zincRenderer.getSceneByName(k); P ? A && P.clearAll() : P = e.zincRenderer.createScene(k), e.selectObjectOnPick = !0; for (let M = 0; M < n.length; M++) n[M](e.sceneData); L && L != "" ? (e.sceneData.viewURL = L, P.loadViewURL(e.sceneData.viewURL)) : e.sceneData.viewURL = void 0, e.sceneData.metaURL = b, P.addZincObjectAddedCallbacks(x(E, C, !1)), P.addZincObjectRemovedCallbacks(w(void 0, C, !1)), P.loadMetadataURL(b, void 0, S()), e.scene = P, e.zincRenderer.setCurrentScene(P), e.graphicsHighlight.reset(); const R = P.getZincCameraControls(); R.enableRaycaster(P, p(), m()), R.setMouseButtonAction("AUXILIARY", "ZOOM"), R.setMouseButtonAction("SECONDARY", "PAN"); } }, this.loadGLTFFromURL = function(b, T, E) { if (e.zincRenderer && T && e.sceneData.metaURL !== b) { _(void 0, void 0, T); const C = e.sceneData.currentName; let L = e.zincRenderer.getSceneByName(C); L ? E && L.clearAll() : L = e.zincRenderer.createScene(C); for (let k = 0; k < n.length; k++) n[k](e.sceneData); e.sceneData.viewURL = void 0, e.sceneData.metaURL = b, L.addZincObjectAddedCallbacks(x(void 0, T, !1)), L.addZincObjectRemovedCallbacks(w(void 0, T, !1)), L.loadGLTF(b, void 0, S()), e.scene = L, e.zincRenderer.setCurrentScene(L), e.graphicsHighlight.reset(); const A = L.getZincCameraControls(); A.enableRaycaster(L, p(), m()), A.setMouseButtonAction("AUXILIARY", "ZOOM"), A.setMouseButtonAction("SECONDARY", "PAN"); } }, this.alignCameraWithSelectedObject = function(b) { const T = e.graphicsHighlight.getSelected(); T && T[0] && T[0].userData && e.scene.alignObjectToCameraView(T[0].userData, b); }, this.exportSettings = function() { const b = {}; return b.name = e.instanceName, e.sceneData.currentSystem && (b.system = e.sceneData.currentSystem), e.sceneData.currentSpecies && (b.species = e.sceneData.currentSpecies), e.sceneData.currentPart && (b.part = e.sceneData.currentPart), b.metaURL = e.sceneData.metaURL, e.sceneData.viewURL && (b.viewURL = e.sceneData.viewURL), b.dialog = "Organ Viewer", b; }, this.importSettings = function(b) { return b && b.dialog == this.typeName ? (e.setName(b.name), b.metaURL !== void 0 && b.metaURL != "" ? e.loadOrgansFromURL( b.metaURL, b.species, b.system, b.part, b.viewURL, !0 ) : e.loadOrgans(b.species, b.system, b.part), !0) : !1; }, function() { e.initialiseRenderer(void 0), e.zincRenderer && (e.zincRenderer.addPreRenderCallbackFunction(d()), e.zincRenderer.addPostRenderCallbackFunction(h())); }(); }; dD.prototype = Object.create(Lr.prototype); var lr = function() { return lr = Object.assign || function(t) { for (var e, r = 1, i = arguments.length; r < i; r++) { e = arguments[r]; for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); } return t; }, lr.apply(this, arguments); }; function Zfe(t, e, r, i) { function n(a) { return a instanceof r ? a : new r(function(o) { o(a); }); } return new (r || (r = Promise))(function(a, o) { function s(u) { try { l(i.next(u)); } catch (d) { o(d); } } function c(u) { try { l(i.throw(u)); } catch (d) { o(d); } } function l(u) { u.done ? a(u.value) : n(u.value).then(s, c); } l((i = i.apply(t, [])).next()); }); } function Yfe(t, e) { var r = { label: 0, sent: function() { if (a[0] & 1) throw a[1]; return a[1]; }, trys: [], ops: [] }, i, n, a, o; return o = { next: s(0), throw: s(1), return: s(2) }, typeof Symbol == "function" && (o[Symbol.iterator] = function() { return this; }), o; function s(l) { return function(u) { return c([l, u]); }; } function c(l) { if (i) throw new TypeError("Generator is already executing."); for (; o && (o = 0, l[0] && (r = 0)), r; ) try { if (i = 1, n && (a = l[0] & 2 ? n.return : l[0] ? n.throw || ((a = n.return) && a.call(n), 0) : n.next) && !(a = a.call(n, l[1])).done) return a; switch (n = 0, a && (l = [l[0] & 2, a.value]), l[0]) { case 0: case 1: a = l; break; case 4: return r.label++, { value: l[1], done: !1 }; case 5: r.label++, n = l[1], l = [0]; continue; case 7: l = r.ops.pop(), r.trys.pop(); continue; default: if (a = r.trys, !(a = a.length > 0 && a[a.length - 1]) && (l[0] === 6 || l[0] === 2)) { r = 0; continue; } if (l[0] === 3 && (!a || l[1] > a[0] && l[1] < a[3])) { r.label = l[1]; break; } if (l[0] === 6 && r.label < a[1]) { r.label = a[1], a = l; break; } if (a && r.label < a[2]) { r.label = a[2], r.ops.push(l); break; } a[2] && r.ops.pop(), r.trys.pop(); continue; } l = e.call(t, r); } catch (u) { l = [6, u], n = 0; } finally { i = a = 0; } if (l[0] & 5) throw l[1]; return { value: l[0] ? l[1] : void 0, done: !0 }; } } function Rt(t) { var e = typeof Symbol == "function" && Symbol.iterator, r = e && t[e], i = 0; if (r) return r.call(t); if (t && typeof t.length == "number") return { next: function() { return t && i >= t.length && (t = void 0), { value: t && t[i++], done: !t }; } }; throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined."); } function Rr(t, e) { var r = typeof Symbol == "function" && t[Symbol.iterator]; if (!r) return t; var i = r.call(t), n, a = [], o; try { for (; (e === void 0 || e-- > 0) && !(n = i.next()).done; ) a.push(n.value); } catch (s) { o = { error: s }; } finally { try { n && !n.done && (r = i.return) && r.call(i); } finally { if (o) throw o.error; } } return a; } var Kfe = "ENTRIES", hD = "KEYS", pD = "VALUES", li = "", ey = ( /** @class */ function() { function t(e, r) { var i = e._tree, n = Array.from(i.keys()); this.set = e, this._type = r, this._path = n.length > 0 ? [{ node: i, keys: n }] : []; } return t.prototype.next = function() { var e = this.dive(); return this.backtrack(), e; }, t.prototype.dive = function() { if (this._path.length === 0) return { done: !0, value: void 0 }; var e = Ac(this._path), r = e.node, i = e.keys; if (Ac(i) === li) return { done: !1, value: this.result() }; var n = r.get(Ac(i)); return this._path.push({ node: n, keys: Array.from(n.keys()) }), this.dive(); }, t.prototype.backtrack = function() { if (this._path.length !== 0) { var e = Ac(this._path).keys; e.pop(), !(e.length > 0) && (this._path.pop(), this.backtrack()); } }, t.prototype.key = function() { return this.set._prefix + this._path.map(function(e) { var r = e.keys; return Ac(r); }).filter(function(e) { return e !== li; }).join(""); }, t.prototype.value = function() { return Ac(this._path).node.get(li); }, t.prototype.result = function() { switch (this._type) { case pD: return this.value(); case hD: return this.key(); default: return [this.key(), this.value()]; } }, t.prototype[Symbol.iterator] = function() { return this; }, t; }() ), Ac = function(t) { return t[t.length - 1]; }, Jfe = function(t, e, r) { var i = /* @__PURE__ */ new Map(); if (e === void 0) return i; for (var n = e.length + 1, a = n + r, o = new Uint8Array(a * n).fill(r + 1), s = 0; s < n; ++s) o[s] = s; for (var c = 1; c < a; ++c) o[c * n] = c; return fD(t, e, r, i, o, 1, n, ""), i; }, fD = function(t, e, r, i, n, a, o, s) { var c, l, u = a * o; try { e: for (var d = Rt(t.keys()), h = d.next(); !h.done; h = d.next()) { var f = h.value; if (f === li) { var p = n[u - 1]; p <= r && i.set(s, [t.get(f), p]); } else { for (var m = a, y = 0; y < f.length; ++y, ++m) { for (var g = f[y], v = o * m, x = v - o, w = n[v], S = Math.max(0, m - r - 1), _ = Math.min(o - 1, m + r), b = S; b < _; ++b) { var T = g !== e[b], E = n[x + b] + +T, C = n[x + b + 1] + 1, L = n[v + b] + 1, A = n[v + b + 1] = Math.min(E, C, L); A < w && (w = A); } if (w > r) continue e; } fD(t.get(f), e, r, i, n, m, o, s + f); } } } catch (k) { c = { error: k }; } finally { try { h && !h.done && (l = d.return) && l.call(d); } finally { if (c) throw c.error; } } }, ty = ( /** @class */ function() { function t(e, r) { e === void 0 && (e = /* @__PURE__ */ new Map()), r === void 0 && (r = ""), this._size = void 0, this._tree = e, this._prefix = r; } return t.prototype.atPrefix = function(e) { var r, i; if (!e.startsWith(this._prefix)) throw new Error("Mismatched prefix"); var n = Rr(og(this._tree, e.slice(this._prefix.length)), 2), a = n[0], o = n[1]; if (a === void 0) { var s = Rr(Aw(o), 2), c = s[0], l = s[1]; try { for (var u = Rt(c.keys()), d = u.next(); !d.done; d = u.next()) { var h = d.value; if (h !== li && h.startsWith(l)) { var f = /* @__PURE__ */ new Map(); return f.set(h.slice(l.length), c.get(h)), new t(f, e); } } } catch (p) { r = { error: p }; } finally { try { d && !d.done && (i = u.return) && i.call(u); } finally { if (r) throw r.error; } } } return new t(a, e); }, t.prototype.clear = function() { this._size = void 0, this._tree.clear(); }, t.prototype.delete = function(e) { return this._size = void 0, Qfe(this._tree, e); }, t.prototype.entries = function() { return new ey(this, Kfe); }, t.prototype.forEach = function(e) { var r, i; try { for (var n = Rt(this), a = n.next(); !a.done; a = n.next()) { var o = Rr(a.value, 2), s = o[0], c = o[1]; e(s, c, this); } } catch (l) { r = { error: l }; } finally { try { a && !a.done && (i = n.return) && i.call(n); } finally { if (r) throw r.error; } } }, t.prototype.fuzzyGet = function(e, r) { return Jfe(this._tree, e, r); }, t.prototype.get = function(e) { var r = z1(this._tree, e); return r !== void 0 ? r.get(li) : void 0; }, t.prototype.has = function(e) { var r = z1(this._tree, e); return r !== void 0 && r.has(li); }, t.prototype.keys = function() { return new ey(this, hD); }, t.prototype.set = function(e, r) { if (typeof e != "string") throw new Error("key must be a string"); this._size = void 0; var i = ry(this._tree, e); return i.set(li, r), this; }, Object.defineProperty(t.prototype, "size", { /** * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/size */ get: function() { if (this._size) return this._size; this._size = 0; for (var e = this.entries(); !e.next().done; ) this._size += 1; return this._size; }, enumerable: !1, configurable: !0 }), t.prototype.update = function(e, r) { if (typeof e != "string") throw new Error("key must be a string"); this._size = void 0; var i = ry(this._tree, e); return i.set(li, r(i.get(li))), this; }, t.prototype.fetch = function(e, r) { if (typeof e != "string") throw new Error("key must be a string"); this._size = void 0; var i = ry(this._tree, e), n = i.get(li); return n === void 0 && i.set(li, n = r()), n; }, t.prototype.values = function() { return new ey(this, pD); }, t.prototype[Symbol.iterator] = function() { return this.entries(); }, t.from = function(e) { var r, i, n = new t(); try { for (var a = Rt(e), o = a.next(); !o.done; o = a.next()) { var s = Rr(o.value, 2), c = s[0], l = s[1]; n.set(c, l); } } catch (u) { r = { error: u }; } finally { try { o && !o.done && (i = a.return) && i.call(a); } finally { if (r) throw r.error; } } return n; }, t.fromObject = function(e) { return t.from(Object.entries(e)); }, t; }() ), og = function(t, e, r) { var i, n; if (r === void 0 && (r = []), e.length === 0 || t == null) return [t, r]; try { for (var a = Rt(t.keys()), o = a.next(); !o.done; o = a.next()) { var s = o.value; if (s !== li && e.startsWith(s)) return r.push([t, s]), og(t.get(s), e.slice(s.length), r); } } catch (c) { i = { error: c }; } finally { try { o && !o.done && (n = a.return) && n.call(a); } finally { if (i) throw i.error; } } return r.push([t, e]), og(void 0, "", r); }, z1 = function(t, e) { var r, i; if (e.length === 0 || t == null) return t; try { for (var n = Rt(t.keys()), a = n.next(); !a.done; a = n.next()) { var o = a.value; if (o !== li && e.startsWith(o)) return z1(t.get(o), e.slice(o.length)); } } catch (s) { r = { error: s }; } finally { try { a && !a.done && (i = n.return) && i.call(n); } finally { if (r) throw r.error; } } }, ry = function(t, e) { var r, i, n = e.length; e: for (var a = 0; t && a < n; ) { try { for (var o = (r = void 0, Rt(t.keys())), s = o.next(); !s.done; s = o.next()) { var c = s.value; if (c !== li && e[a] === c[0]) { for (var l = Math.min(n - a, c.length), u = 1; u < l && e[a + u] === c[u]; ) ++u; var d = t.get(c); if (u === c.length) t = d; else { var h = /* @__PURE__ */ new Map(); h.set(c.slice(u), d), t.set(e.slice(a, a + u), h), t.delete(c), t = h; } a += u; continue e; } } } catch (p) { r = { error: p }; } finally { try { s && !s.done && (i = o.return) && i.call(o); } finally { if (r) throw r.error; } } var f = /* @__PURE__ */ new Map(); return t.set(e.slice(a), f), f; } return t; }, Qfe = function(t, e) { var r = Rr(og(t, e), 2), i = r[0], n = r[1]; if (i !== void 0) { if (i.delete(li), i.size === 0) mD(n); else if (i.size === 1) { var a = Rr(i.entries().next().value, 2), o = a[0], s = a[1]; gD(n, o, s); } } }, mD = function(t) { if (t.length !== 0) { var e = Rr(Aw(t), 2), r = e[0], i = e[1]; if (r.delete(i), r.size === 0) mD(t.slice(0, -1)); else if (r.size === 1) { var n = Rr(r.entries().next().value, 2), a = n[0], o = n[1]; a !== li && gD(t.slice(0, -1), a, o); } } }, gD = function(t, e, r) { if (t.length !== 0) { var i = Rr(Aw(t), 2), n = i[0], a = i[1]; n.set(a + e, r), n.delete(a); } }, Aw = function(t) { return t[t.length - 1]; }, Dd, Lw = "or", vD = "and", eme = "and_not", tme = ( /** @class */ function() { function t(e) { if ((e == null ? void 0 : e.fields) == null) throw new Error('MiniSearch: option "fields" must be provided'); var r = e.autoVacuum == null || e.autoVacuum === !0 ? ay : e.autoVacuum; this._options = lr(lr(lr({}, ny), e), { autoVacuum: r, searchOptions: lr(lr({}, MT), e.searchOptions || {}), autoSuggestOptions: lr(lr({}, ome), e.autoSuggestOptions || {}) }), this._index = new ty(), this._documentCount = 0, this._documentIds = /* @__PURE__ */ new Map(), this._idToShortId = /* @__PURE__ */ new Map(), this._fieldIds = {}, this._fieldLength = /* @__PURE__ */ new Map(), this._avgFieldLength = [], this._nextId = 0, this._storedFields = /* @__PURE__ */ new Map(), this._dirtCount = 0, this._currentVacuum = null, this._enqueuedVacuum = null, this._enqueuedVacuumConditions = V1, this.addFields(this._options.fields); } return t.prototype.add = function(e) { var r, i, n, a, o, s, c = this._options, l = c.extractField, u = c.tokenize, d = c.processTerm, h = c.fields, f = c.idField, p = l(e, f); if (p == null) throw new Error('MiniSearch: document does not have ID field "'.concat(f, '"')); if (this._idToShortId.has(p)) throw new Error("MiniSearch: duplicate ID ".concat(p)); var m = this.addDocumentId(p); this.saveStoredFields(m, e); try { for (var y = Rt(h), g = y.next(); !g.done; g = y.next()) { var v = g.value, x = l(e, v); if (x != null) { var w = u(x.toString(), v), S = this._fieldIds[v], _ = new Set(w).size; this.addFieldLength(m, S, this._documentCount - 1, _); try { for (var b = (n = void 0, Rt(w)), T = b.next(); !T.done; T = b.next()) { var E = T.value, C = d(E, v); if (Array.isArray(C)) try { for (var L = (o = void 0, Rt(C)), A = L.next(); !A.done; A = L.next()) { var k = A.value; this.addTerm(S, m, k); } } catch (P) { o = { error: P }; } finally { try { A && !A.done && (s = L.return) && s.call(L); } finally { if (o) throw o.error; } } else C && this.addTerm(S, m, C); } } catch (P) { n = { error: P }; } finally { try { T && !T.done && (a = b.return) && a.call(b); } finally { if (n) throw n.error; } } } } } catch (P) { r = { error: P }; } finally { try { g && !g.done && (i = y.return) && i.call(y); } finally { if (r) throw r.error; } } }, t.prototype.addAll = function(e) { var r, i; try { for (var n = Rt(e), a = n.next(); !a.done; a = n.next()) { var o = a.value; this.add(o); } } catch (s) { r = { error: s }; } finally { try { a && !a.done && (i = n.return) && i.call(n); } finally { if (r) throw r.error; } } }, t.prototype.addAllAsync = function(e, r) { var i = this; r === void 0 && (r = {}); var n = r.chunkSize, a = n === void 0 ? 10 : n, o = { chunk: [], promise: Promise.resolve() }, s = e.reduce(function(u, d, h) { var f = u.chunk, p = u.promise; return f.push(d), (h + 1) % a === 0 ? { chunk: [], promise: p.then(function() { return new Promise(function(m) { return setTimeout(m, 0); }); }).then(function() { return i.addAll(f); }) } : { chunk: f, promise: p }; }, o), c = s.chunk, l = s.promise; return l.then(function() { return i.addAll(c); }); }, t.prototype.remove = function(e) { var r, i, n, a, o, s, c = this._options, l = c.tokenize, u = c.processTerm, d = c.extractField, h = c.fields, f = c.idField, p = d(e, f); if (p == null) throw new Error('MiniSearch: document does not have ID field "'.concat(f, '"')); var m = this._idToShortId.get(p); if (m == null) throw new Error("MiniSearch: cannot remove document with ID ".concat(p, ": it is not in the index")); try { for (var y = Rt(h), g = y.next(); !g.done; g = y.next()) { var v = g.value, x = d(e, v); if (x != null) { var w = l(x.toString(), v), S = this._fieldIds[v], _ = new Set(w).size; this.removeFieldLength(m, S, this._documentCount, _); try { for (var b = (n = void 0, Rt(w)), T = b.next(); !T.done; T = b.next()) { var E = T.value, C = u(E, v); if (Array.isArray(C)) try { for (var L = (o = void 0, Rt(C)), A = L.next(); !A.done; A = L.next()) { var k = A.value; this.removeTerm(S, m, k); } } catch (P) { o = { error: P }; } finally { try { A && !A.done && (s = L.return) && s.call(L); } finally { if (o) throw o.error; } } else C && this.removeTerm(S, m, C); } } catch (P) { n = { error: P }; } finally { try { T && !T.done && (a = b.return) && a.call(b); } finally { if (n) throw n.error; } } } } } catch (P) { r = { error: P }; } finally { try { g && !g.done && (i = y.return) && i.call(y); } finally { if (r) throw r.error; } } this._storedFields.delete(m), this._documentIds.delete(m), this._idToShortId.delete(p), this._fieldLength.delete(m), this._documentCount -= 1; }, t.prototype.removeAll = function(e) { var r, i; if (e) try { for (var n = Rt(e), a = n.next(); !a.done; a = n.next()) { var o = a.value; this.remove(o); } } catch (s) { r = { error: s }; } finally { try { a && !a.done && (i = n.return) && i.call(n); } finally { if (r) throw r.error; } } else { if (arguments.length > 0) throw new Error("Expected documents to be present. Omit the argument to remove all documents."); this._index = new ty(), this._documentCount = 0, this._documentIds = /* @__PURE__ */ new Map(), this._idToShortId = /* @__PURE__ */ new Map(), this._fieldLength = /* @__PURE__ */ new Map(), this._avgFieldLength = [], this._storedFields = /* @__PURE__ */ new Map(), this._nextId = 0; } }, t.prototype.discard = function(e) { var r = this, i = this._idToShortId.get(e); if (i == null) throw new Error("MiniSearch: cannot discard document with ID ".concat(e, ": it is not in the index")); this._idToShortId.delete(e), this._documentIds.delete(i), this._storedFields.delete(i), (this._fieldLength.get(i) || []).forEach(function(n, a) { r.removeFieldLength(i, a, r._documentCount, n); }), this._fieldLength.delete(i), this._documentCount -= 1, this._dirtCount += 1, this.maybeAutoVacuum(); }, t.prototype.maybeAutoVacuum = function() { if (this._options.autoVacuum !== !1) { var e = this._options.autoVacuum, r = e.minDirtFactor, i = e.minDirtCount, n = e.batchSize, a = e.batchWait; this.conditionalVacuum({ batchSize: n, batchWait: a }, { minDirtCount: i, minDirtFactor: r }); } }, t.prototype.discardAll = function(e) { var r, i, n = this._options.autoVacuum; try { this._options.autoVacuum = !1; try { for (var a = Rt(e), o = a.next(); !o.done; o = a.next()) { var s = o.value; this.discard(s); } } catch (c) { r = { error: c }; } finally { try { o && !o.done && (i = a.return) && i.call(a); } finally { if (r) throw r.error; } } } finally { this._options.autoVacuum = n; } this.maybeAutoVacuum(); }, t.prototype.replace = function(e) { var r = this._options, i = r.idField, n = r.extractField, a = n(e, i); this.discard(a), this.add(e); }, t.prototype.vacuum = function(e) { return e === void 0 && (e = {}), this.conditionalVacuum(e); }, t.prototype.conditionalVacuum = function(e, r) { var i = this; return this._currentVacuum ? (this._enqueuedVacuumConditions = this._enqueuedVacuumConditions && r, this._enqueuedVacuum != null ? this._enqueuedVacuum : (this._enqueuedVacuum = this._currentVacuum.then(function() { var n = i._enqueuedVacuumConditions; return i._enqueuedVacuumConditions = V1, i.performVacuuming(e, n); }), this._enqueuedVacuum)) : this.vacuumConditionsMet(r) === !1 ? Promise.resolve() : (this._currentVacuum = this.performVacuuming(e), this._currentVacuum); }, t.prototype.performVacuuming = function(e, r) { return Zfe(this, void 0, void 0, function() { var i, n, a, o, s, c, l, u, d, h, f, p, m, y, g, v, x, w, S, _, b, T, E, C, L; return Yfe(this, function(A) { switch (A.label) { case 0: if (i = this._dirtCount, !this.vacuumConditionsMet(r)) return [3, 10]; n = e.batchSize || $1.batchSize, a = e.batchWait || $1.batchWait, o = 1, A.label = 1; case 1: A.trys.push([1, 7, 8, 9]), s = Rt(this._index), c = s.next(), A.label = 2; case 2: if (c.done) return [3, 6]; l = Rr(c.value, 2), u = l[0], d = l[1]; try { for (h = (T = void 0, Rt(d)), f = h.next(); !f.done; f = h.next()) { p = Rr(f.value, 2), m = p[0], y = p[1]; try { for (g = (C = void 0, Rt(y)), v = g.next(); !v.done; v = g.next()) x = Rr(v.value, 1), w = x[0], !this._documentIds.has(w) && (y.size <= 1 ? d.delete(m) : y.delete(w)); } catch (k) { C = { error: k }; } finally { try { v && !v.done && (L = g.return) && L.call(g); } finally { if (C) throw C.error; } } } } catch (k) { T = { error: k }; } finally { try { f && !f.done && (E = h.return) && E.call(h); } finally { if (T) throw T.error; } } return this._index.get(u).size === 0 && this._index.delete(u), o % n !== 0 ? [3, 4] : [4, new Promise(function(k) { return setTimeout(k, a); })]; case 3: A.sent(), A.label = 4; case 4: o += 1, A.label = 5; case 5: return c = s.next(), [3, 2]; case 6: return [3, 9]; case 7: return S = A.sent(), _ = { error: S }, [3, 9]; case 8: try { c && !c.done && (b = s.return) && b.call(s); } finally { if (_) throw _.error; } return [ 7 /*endfinally*/ ]; case 9: this._dirtCount -= i, A.label = 10; case 10: return [4, null]; case 11: return A.sent(), this._currentVacuum = this._enqueuedVacuum, this._enqueuedVacuum = null, [ 2 /*return*/ ]; } }); }); }, t.prototype.vacuumConditionsMet = function(e) { if (e == null) return !0; var r = e.minDirtCount, i = e.minDirtFactor; return r = r || ay.minDirtCount, i = i || ay.minDirtFactor, this.dirtCount >= r && this.dirtFactor >= i; }, Object.defineProperty(t.prototype, "isVacuuming", { /** * Is `true` if a vacuuming operation is ongoing, `false` otherwise */ get: function() { return this._currentVacuum != null; }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "dirtCount", { /** * The number of documents discarded since the most recent vacuuming */ get: function() { return this._dirtCount; }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "dirtFactor", { /** * A number between 0 and 1 giving an indication about the proportion of * documents that are discarded, and can therefore be cleaned up by vacuuming. * A value close to 0 means that the index is relatively clean, while a higher * value means that the index is relatively dirty, and vacuuming could release * memory. */ get: function() { return this._dirtCount / (1 + this._documentCount + this._dirtCount); }, enumerable: !1, configurable: !0 }), t.prototype.has = function(e) { return this._idToShortId.has(e); }, t.prototype.getStoredFields = function(e) { var r = this._idToShortId.get(e); if (r != null) return this._storedFields.get(r); }, t.prototype.search = function(e, r) { var i, n; r === void 0 && (r = {}); var a = this.executeQuery(e, r), o = []; try { for (var s = Rt(a), c = s.next(); !c.done; c = s.next()) { var l = Rr(c.value, 2), u = l[0], d = l[1], h = d.score, f = d.terms, p = d.match, m = f.length || 1, y = { id: this._documentIds.get(u), score: h * m, terms: Object.keys(p), queryTerms: f, match: p }; Object.assign(y, this._storedFields.get(u)), (r.filter == null || r.filter(y)) && o.push(y); } } catch (g) { i = { error: g }; } finally { try { c && !c.done && (n = s.return) && n.call(s); } finally { if (i) throw i.error; } } return e === t.wildcard && r.boostDocument == null && this._options.searchOptions.boostDocument == null || o.sort(TT), o; }, t.prototype.autoSuggest = function(e, r) { var i, n, a, o; r === void 0 && (r = {}), r = lr(lr({}, this._options.autoSuggestOptions), r); var s = /* @__PURE__ */ new Map(); try { for (var c = Rt(this.search(e, r)), l = c.next(); !l.done; l = c.next()) { var u = l.value, d = u.score, h = u.terms, f = h.join(" "), p = s.get(f); p != null ? (p.score += d, p.count += 1) : s.set(f, { score: d, terms: h, count: 1 }); } } catch (S) { i = { error: S }; } finally { try { l && !l.done && (n = c.return) && n.call(c); } finally { if (i) throw i.error; } } var m = []; try { for (var y = Rt(s), g = y.next(); !g.done; g = y.next()) { var v = Rr(g.value, 2), p = v[0], x = v[1], d = x.score, h = x.terms, w = x.count; m.push({ suggestion: p, terms: h, score: d / w }); } } catch (S) { a = { error: S }; } finally { try { g && !g.done && (o = y.return) && o.call(y); } finally { if (a) throw a.error; } } return m.sort(TT), m; }, Object.defineProperty(t.prototype, "documentCount", { /** * Total number of documents available to search */ get: function() { return this._documentCount; }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "termCount", { /** * Number of terms in the index */ get: function() { return this._index.size; }, enumerable: !1, configurable: !0 }), t.loadJSON = function(e, r) { if (r == null) throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index"); return this.loadJS(JSON.parse(e), r); }, t.getDefault = function(e) { if (ny.hasOwnProperty(e)) return iy(ny, e); throw new Error('MiniSearch: unknown option "'.concat(e, '"')); }, t.loadJS = function(e, r) { var i, n, a, o, s, c, l = e.index, u = e.documentCount, d = e.nextId, h = e.documentIds, f = e.fieldIds, p = e.fieldLength, m = e.averageFieldLength, y = e.storedFields, g = e.dirtCount, v = e.serializationVersion; if (v !== 1 && v !== 2) throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version"); var x = new t(r); x._documentCount = u, x._nextId = d, x._documentIds = em(h), x._idToShortId = /* @__PURE__ */ new Map(), x._fieldIds = f, x._fieldLength = em(p), x._avgFieldLength = m, x._storedFields = em(y), x._dirtCount = g || 0, x._index = new ty(); try { for (var w = Rt(x._documentIds), S = w.next(); !S.done; S = w.next()) { var _ = Rr(S.value, 2), b = _[0], T = _[1]; x._idToShortId.set(T, b); } } catch (I) { i = { error: I }; } finally { try { S && !S.done && (n = w.return) && n.call(w); } finally { if (i) throw i.error; } } try { for (var E = Rt(l), C = E.next(); !C.done; C = E.next()) { var L = Rr(C.value, 2), A = L[0], k = L[1], P = /* @__PURE__ */ new Map(); try { for (var R = (s = void 0, Rt(Object.keys(k))), M = R.next(); !M.done; M = R.next()) { var O = M.value, D = k[O]; v === 1 && (D = D.ds), P.set(parseInt(O, 10), em(D)); } } catch (I) { s = { error: I }; } finally { try { M && !M.done && (c = R.return) && c.call(R); } finally { if (s) throw s.error; } } x._index.set(A, P); } } catch (I) { a = { error: I }; } finally { try { C && !C.done && (o = E.return) && o.call(E); } finally { if (a) throw a.error; } } return x; }, t.prototype.executeQuery = function(e, r) { var i = this; if (r === void 0 && (r = {}), e === t.wildcard) return this.executeWildcardQuery(r); if (typeof e != "string") { var n = lr(lr(lr({}, r), e), { queries: void 0 }), a = e.queries.map(function(y) { return i.executeQuery(y, n); }); return this.combineResults(a, n.combineWith); } var o = this._options, s = o.tokenize, c = o.processTerm, l = o.searchOptions, u = lr(lr({ tokenize: s, processTerm: c }, l), r), d = u.tokenize, h = u.processTerm, f = d(e).flatMap(function(y) { return h(y); }).filter(function(y) { return !!y; }), p = f.map(ame(u)), m = p.map(function(y) { return i.executeQuerySpec(y, u); }); return this.combineResults(m, u.combineWith); }, t.prototype.executeQuerySpec = function(e, r) { var i, n, a, o, s = lr(lr({}, this._options.searchOptions), r), c = (s.fields || this._options.fields).reduce(function(O, D) { var I; return lr(lr({}, O), (I = {}, I[D] = iy(s.boost, D) || 1, I)); }, {}), l = s.boostDocument, u = s.weights, d = s.maxFuzzy, h = s.bm25, f = lr(lr({}, MT.weights), u), p = f.fuzzy, m = f.prefix, y = this._index.get(e.term), g = this.termResults(e.term, e.term, 1, y, c, l, h), v, x; if (e.prefix && (v = this._index.atPrefix(e.term)), e.fuzzy) { var w = e.fuzzy === !0 ? 0.2 : e.fuzzy, S = w < 1 ? Math.min(d, Math.round(e.term.length * w)) : w; S && (x = this._index.fuzzyGet(e.term, S)); } if (v) try { for (var _ = Rt(v), b = _.next(); !b.done; b = _.next()) { var T = Rr(b.value, 2), E = T[0], C = T[1], L = E.length - e.term.length; if (L) { x == null || x.delete(E); var A = m * E.length / (E.length + 0.3 * L); this.termResults(e.term, E, A, C, c, l, h, g); } } } catch (O) { i = { error: O }; } finally { try { b && !b.done && (n = _.return) && n.call(_); } finally { if (i) throw i.error; } } if (x) try { for (var k = Rt(x.keys()), P = k.next(); !P.done; P = k.next()) { var E = P.value, R = Rr(x.get(E), 2), M = R[0], L = R[1]; if (L) { var A = p * E.length / (E.length + L); this.termResults(e.term, E, A, M, c, l, h, g); } } } catch (O) { a = { error: O }; } finally { try { P && !P.done && (o = k.return) && o.call(k); } finally { if (a) throw a.error; } } return g; }, t.prototype.executeWildcardQuery = function(e) { var r, i, n = /* @__PURE__ */ new Map(), a = lr(lr({}, this._options.searchOptions), e); try { for (var o = Rt(this._documentIds), s = o.next(); !s.done; s = o.next()) { var c = Rr(s.value, 2), l = c[0], u = c[1], d = a.boostDocument ? a.boostDocument(u, "", this._storedFields.get(l)) : 1; n.set(l, { score: d, terms: [], match: {} }); } } catch (h) { r = { error: h }; } finally { try { s && !s.done && (i = o.return) && i.call(o); } finally { if (r) throw r.error; } } return n; }, t.prototype.combineResults = function(e, r) { if (r === void 0 && (r = Lw), e.length === 0) return /* @__PURE__ */ new Map(); var i = r.toLowerCase(); return e.reduce(rme[i]) || /* @__PURE__ */ new Map(); }, t.prototype.toJSON = function() { var e, r, i, n, a = []; try { for (var o = Rt(this._index), s = o.next(); !s.done; s = o.next()) { var c = Rr(s.value, 2), l = c[0], u = c[1], d = {}; try { for (var h = (i = void 0, Rt(u)), f = h.next(); !f.done; f = h.next()) { var p = Rr(f.value, 2), m = p[0], y = p[1]; d[m] = Object.fromEntries(y); } } catch (g) { i = { error: g }; } finally { try { f && !f.done && (n = h.return) && n.call(h); } finally { if (i) throw i.error; } } a.push([l, d]); } } catch (g) { e = { error: g }; } finally { try { s && !s.done && (r = o.return) && r.call(o); } finally { if (e) throw e.error; } } return { documentCount: this._documentCount, nextId: this._nextId, documentIds: Object.fromEntries(this._documentIds), fieldIds: this._fieldIds, fieldLength: Object.fromEntries(this._fieldLength), averageFieldLength: this._avgFieldLength, storedFields: Object.fromEntries(this._storedFields), dirtCount: this._dirtCount, index: a, serializationVersion: 2 }; }, t.prototype.termResults = function(e, r, i, n, a, o, s, c) { var l, u, d, h, f; if (c === void 0 && (c = /* @__PURE__ */ new Map()), n == null) return c; try { for (var p = Rt(Object.keys(a)), m = p.next(); !m.done; m = p.next()) { var y = m.value, g = a[y], v = this._fieldIds[y], x = n.get(v); if (x != null) { var w = x.size, S = this._avgFieldLength[v]; try { for (var _ = (d = void 0, Rt(x.keys())), b = _.next(); !b.done; b = _.next()) { var T = b.value; if (!this._documentIds.has(T)) { this.removeTerm(v, T, r), w -= 1; continue; } var E = o ? o(this._documentIds.get(T), r, this._storedFields.get(T)) : 1; if (E) { var C = x.get(T), L = this._fieldLength.get(T)[v], A = nme(C, w, this._documentCount, L, S, s), k = i * g * E * A, P = c.get(T); if (P) { P.score += k, sme(P.terms, e); var R = iy(P.match, r); R ? R.push(y) : P.match[r] = [y]; } else c.set(T, { score: k, terms: [e], match: (f = {}, f[r] = [y], f) }); } } } catch (M) { d = { error: M }; } finally { try { b && !b.done && (h = _.return) && h.call(_); } finally { if (d) throw d.error; } } } } } catch (M) { l = { error: M }; } finally { try { m && !m.done && (u = p.return) && u.call(p); } finally { if (l) throw l.error; } } return c; }, t.prototype.addTerm = function(e, r, i) { var n = this._index.fetch(i, CT), a = n.get(e); if (a == null) a = /* @__PURE__ */ new Map(), a.set(r, 1), n.set(e, a); else { var o = a.get(r); a.set(r, (o || 0) + 1); } }, t.prototype.removeTerm = function(e, r, i) { if (!this._index.has(i)) { this.warnDocumentChanged(r, e, i); return; } var n = this._index.fetch(i, CT), a = n.get(e); a == null || a.get(r) == null ? this.warnDocumentChanged(r, e, i) : a.get(r) <= 1 ? a.size <= 1 ? n.delete(e) : a.delete(r) : a.set(r, a.get(r) - 1), this._index.get(i).size === 0 && this._index.delete(i); }, t.prototype.warnDocumentChanged = function(e, r, i) { var n, a; try { for (var o = Rt(Object.keys(this._fieldIds)), s = o.next(); !s.done; s = o.next()) { var c = s.value; if (this._fieldIds[c] === r) { this._options.logger("warn", "MiniSearch: document with ID ".concat(this._documentIds.get(e), ' has changed before removal: term "').concat(i, '" was not present in field "').concat(c, '". Removing a document after it has changed can corrupt the index!'), "version_conflict"); return; } } } catch (l) { n = { error: l }; } finally { try { s && !s.done && (a = o.return) && a.call(o); } finally { if (n) throw n.error; } } }, t.prototype.addDocumentId = function(e) { var r = this._nextId; return this._idToShortId.set(e, r), this._documentIds.set(r, e), this._documentCount += 1, this._nextId += 1, r; }, t.prototype.addFields = function(e) { for (var r = 0; r < e.length; r++) this._fieldIds[e[r]] = r; }, t.prototype.addFieldLength = function(e, r, i, n) { var a = this._fieldLength.get(e); a == null && this._fieldLength.set(e, a = []), a[r] = n; var o = this._avgFieldLength[r] || 0, s = o * i + n; this._avgFieldLength[r] = s / (i + 1); }, t.prototype.removeFieldLength = function(e, r, i, n) { if (i === 1) { this._avgFieldLength[r] = 0; return; } var a = this._avgFieldLength[r] * i - n; this._avgFieldLength[r] = a / (i - 1); }, t.prototype.saveStoredFields = function(e, r) { var i, n, a = this._options, o = a.storeFields, s = a.extractField; if (!(o == null || o.length === 0)) { var c = this._storedFields.get(e); c == null && this._storedFields.set(e, c = {}); try { for (var l = Rt(o), u = l.next(); !u.done; u = l.next()) { var d = u.value, h = s(r, d); h !== void 0 && (c[d] = h); } } catch (f) { i = { error: f }; } finally { try { u && !u.done && (n = l.return) && n.call(l); } finally { if (i) throw i.error; } } } }, t.wildcard = Symbol("*"), t; }() ), iy = function(t, e) { return Object.prototype.hasOwnProperty.call(t, e) ? t[e] : void 0; }, rme = (Dd = {}, Dd[Lw] = function(t, e) { var r, i; try { for (var n = Rt(e.keys()), a = n.next(); !a.done; a = n.next()) { var o = a.value, s = t.get(o); if (s == null) t.set(o, e.get(o)); else { var c = e.get(o), l = c.score, u = c.terms, d = c.match; s.score = s.score + l, s.match = Object.assign(s.match, d), ET(s.terms, u); } } } catch (h) { r = { error: h }; } finally { try { a && !a.done && (i = n.return) && i.call(n); } finally { if (r) throw r.error; } } return t; }, Dd[vD] = function(t, e) { var r, i, n = /* @__PURE__ */ new Map(); try { for (var a = Rt(e.keys()), o = a.next(); !o.done; o = a.next()) { var s = o.value, c = t.get(s); if (c != null) { var l = e.get(s), u = l.score, d = l.terms, h = l.match; ET(c.terms, d), n.set(s, { score: c.score + u, terms: c.terms, match: Object.assign(c.match, h) }); } } } catch (f) { r = { error: f }; } finally { try { o && !o.done && (i = a.return) && i.call(a); } finally { if (r) throw r.error; } } return n; }, Dd[eme] = function(t, e) { var r, i; try { for (var n = Rt(e.keys()), a = n.next(); !a.done; a = n.next()) { var o = a.value; t.delete(o); } } catch (s) { r = { error: s }; } finally { try { a && !a.done && (i = n.return) && i.call(n); } finally { if (r) throw r.error; } } return t; }, Dd), ime = { k: 1.2, b: 0.7, d: 0.5 }, nme = function(t, e, r, i, n, a) { var o = a.k, s = a.b, c = a.d, l = Math.log(1 + (r - e + 0.5) / (e + 0.5)); return l * (c + t * (o + 1) / (t + o * (1 - s + s * i / n))); }, ame = function(t) { return function(e, r, i) { var n = typeof t.fuzzy == "function" ? t.fuzzy(e, r, i) : t.fuzzy || !1, a = typeof t.prefix == "function" ? t.prefix(e, r, i) : t.prefix === !0; return { term: e, fuzzy: n, prefix: a }; }; }, ny = { idField: "id", extractField: function(t, e) { return t[e]; }, tokenize: function(t) { return t.split(lme); }, processTerm: function(t) { return t.toLowerCase(); }, fields: void 0, searchOptions: void 0, storeFields: [], logger: function(t, e) { typeof (console == null ? void 0 : console[t]) == "function" && console[t](e); }, autoVacuum: !0 }, MT = { combineWith: Lw, prefix: !1, fuzzy: !1, maxFuzzy: 6, boost: {}, weights: { fuzzy: 0.45, prefix: 0.375 }, bm25: ime }, ome = { combineWith: vD, prefix: function(t, e, r) { return e === r.length - 1; } }, $1 = { batchSize: 1e3, batchWait: 10 }, V1 = { minDirtFactor: 0.1, minDirtCount: 20 }, ay = lr(lr({}, $1), V1), sme = function(t, e) { t.includes(e) || t.push(e); }, ET = function(t, e) { var r, i; try { for (var n = Rt(e), a = n.next(); !a.done; a = n.next()) { var o = a.value; t.includes(o) || t.push(o); } } catch (s) { r = { error: s }; } finally { try { a && !a.done && (i = n.return) && i.call(n); } finally { if (r) throw r.error; } } }, TT = function(t, e) { var r = t.score, i = e.score; return i - r; }, CT = function() { return /* @__PURE__ */ new Map(); }, em = function(t) { var e, r, i = /* @__PURE__ */ new Map(); try { for (var n = Rt(Object.keys(t)), a = n.next(); !a.done; a = n.next()) { var o = a.value; i.set(parseInt(o, 10), t[o]); } } catch (s) { e = { error: s }; } finally { try { a && !a.done && (r = n.return) && r.call(n); } finally { if (e) throw e.error; } } return i; }, lme = /[\n\r -#%-*,-/:;?@[-\]_{}\u00A0\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u3000-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]+/u; class cme { constructor() { this._searchEngine = new tme({ fields: ["path", "name"], storeFields: ["path"], tokenize: (e, r) => e.split(/[\s/]+/) // indexing tokenizer }), this.idMaps = {}; } addZincObject(e, r) { const i = e.getRegion().getFullPath(); let n = e.groupName, a = i ? `${i}/${e.groupName}` : e.groupName; n = n.replaceAll('"', ""), a = a.replaceAll('"', ""); const o = { path: a, name: n, id: r }; this._searchEngine.add(o), this.idMaps[r] = { path: a, zincObject: e }; } removeZincObject(e, r) { const i = e.getRegion().getFullPath(); let n = e.groupName, a = i ? `${i}/${e.groupName}` : e.groupName; n = n.replaceAll('"', ""), a = a.replaceAll('"', ""); const o = { path: a, name: n, id: r }; this._searchEngine.remove(o), delete this.idMaps[r]; } addRegion(e, r) { let i = e.getFullPath(), n = e.getName(); i = i.replaceAll('"', ""), n = n.replaceAll('"', ""); const a = { path: i, name: n, id: r }; this._searchEngine.add(a), this.idMaps[r] = { path: i, zincObject: e }; } clearResults() { this._; } removeAll() { this._searchEngine.removeAll(), this.idMaps = {}; } auto_suggest(e) { let r = []; e.length > 2 && ["'", '"'].includes(e.slice(0, 1)) ? (e = e.replaceAll(e.slice(0, 1), ""), r = this._searchEngine.search(e, { prefix: !0, combineWith: "AND" })) : e.length > 1 && (r = this._searchEngine.search(e, { prefix: !0 })); const i = []; r.forEach((o) => { o.id in this.idMaps && i.push(this.idMaps[o.id].path); }); const n = [...new Set(i)], a = []; return n.forEach((o) => a.push({ suggestion: '"' + o + '"' })), a; } processResults(e, r) { const i = { regionPath: void 0, label: 'Search Results for "' }; return Array.isArray(r) ? i.label += ",".join(r) : i.label += r, i.label += '"', e.length === 1 && (e[0].isRegion ? i.regionPath = e[0].getFullPath() : e[0].isZincObject && (i.regionPath = e[0].getRegion().getFullPath(), i.label = e[0].groupName)), i.zincObjects = sfe(e), i; } search(e) { let r; e.length > 2 && ["'", '"'].includes(e.slice(0, 1)) ? (e = e.replaceAll(e.slice(0, 1), ""), r = this._searchEngine.search(e, { prefix: !0, combineWith: "AND" })) : e.length > 1 && (r = this._searchEngine.search(e, { prefix: !0 })); const i = []; return r.forEach((n) => { n.id in this.idMaps && i.push(this.idMaps[n.id].zincObject); }), i; } searchTerms(e) { let r = []; return e.forEach((i) => { const n = this.search(i); r.push(...n); }), r; } searchAndProcessResult(e) { let r = []; return Array.isArray(e) ? r = this.searchTerms(e) : r = this.search(e), this.processResults(r, e); } } const ume = { name: "ScaffoldVuer", components: { Button: Ku, Col: Jn, Loading: Uae, Option: Qu, Popover: rv, Row: Aa, Select: Ju, Slider: An, TabPane: eP, Tabs: Qk, MapSvgIcon: bD, MapSvgSpriteColor: xD, PrimitiveControls: nD, ScaffoldTooltip: uD, ElIconWarningFilled: QL, ElIconArrowDown: ox, ElIconArrowLeft: vs, DrawToolbar: Uq, ScaffoldTreeControls: aD }, setup(t) { let e = Ye("$annotator"); return e || (e = Si(new Vfe(`${t.flatmapAPI}annotator`)), Dt("$annotator", e)), { annotator: e }; }, props: { /** * The option to show annotation information in sidebar */ annotationSidebar: { type: Boolean, default: !1 }, /** * URL of the zincjs metadata. This value will be ignored if a valid * state prop is also provided. * If the url needs to be updated with state present, please use * the setURL method. */ url: { type: String, default: "" }, /** * Show the colour control of set to true. */ showColourPicker: { type: Boolean, default: !1 }, /** * Flag to show/hide the UI. */ displayUI: { type: Boolean, default: !0 }, /** * Display all graphics at start. * * This setting only works when traditional is set to false. */ displayAtStartUp: { type: Boolean, default: !0 }, /** * Use for toggling the help tooltips. */ helpMode: { type: Boolean, default: !1 }, /** * The active item index of help mode. */ helpModeActiveItem: { type: Number, default: 0 }, /** * The option to use helpModeDialog. * On default, `false`, clicking help will show all tooltips. * If `true`, clicking help will show the help-mode-dialog. */ helpModeDialog: { type: Boolean, default: !1 }, /** * The last item of help mode. */ helpModeLastItem: { type: Boolean, default: !1 }, /** * The initial index number for help mode tooltips. * Set negative (e.g. -1) if there are other tooltips outside of `hoverVisibilities`. */ helpModeInitialIndex: { type: Number, default: 0 }, /** * Use for show/display beta warning icon. */ displayWarning: { type: Boolean, default: !0 }, /** * Warning message for the hovered over text * on the warning icon. */ warningMessage: { type: String, default: "Beta feature - under active development" }, displayLatestChanges: { type: Boolean, default: !1 }, latestChangesMessage: { type: String, default: "New feature - Local search is now available" }, /** * Show/hide pickable markers for regions. */ displayMarkers: { type: Boolean, default: !1 }, /** * Display adjacent markers with a cluster marker. */ markerCluster: { type: Boolean, default: !1 }, /** * GroupName to value pair. * The value can be a single number or and object in the following * form: * * { * number: Number, * imgURL: String * } * * When imgURL is specified, scaffoldvuer will attempt to render * the image in imgURL as marker instead. * */ markerLabels: { type: Object, default: function() { return {}; } }, /** * Show/hide minimap. */ displayMinimap: { type: Boolean, default: !1 }, /** * Format of the input URL */ format: { type: String, default: "metadata" }, /** * Settings for minimap position, size and alignment. */ minimapSettings: { type: Object, default: function() { return { x_offset: 16, y_offset: 16, width: 128, height: 128, align: "top-right" }; } }, /** * Flag to determine rather the open map UI icon and popup * should be shown or not. */ enableOpenMapUI: { type: Boolean, default: !1 }, /** * This array populate the the openMapOptions popup. * Each entry contains a pair of display and key. */ openMapOptions: { type: Array, default: function() { return [ { display: "Open AC Map", key: "AC" }, { display: "Open FC Map", key: "FC" }, { display: "Open 3D Human Map", key: "3D" } ]; } }, /** * State containing state of the scaffold. */ state: { type: Object, default: void 0 }, /** * Optional prop for the name of the region to focus on, * this option is ignored if state or viewURL is also provided. */ region: { type: String, default: "" }, /** * Optional prop for an URL of containing information of a viewport. * This option is ignored if state is also provided. * It will use the provided URL as base if a relative parth is provided. */ viewURL: { type: String, default: "" }, /** * Settings for turning on/off rendering */ render: { type: Boolean, default: !0 }, /** * Specify the endpoint of the flatmap server. * This is used by annotation service included in * third party flatmapvuer library. */ flatmapAPI: { type: String, default: "https://mapcore-demo.org/current/flatmap/v3/" }, /** * Enable local annotations */ enableLocalAnnotations: { type: Boolean, default: !1 } }, provide() { return { flatmapAPI: this.flatmapAPI, scaffoldUrl: this.url, boundingDims: this.boundingDims }; }, data: function() { return { annotator: void 0, createData: { drawingBox: !1, toBeConfirmed: !1, points: [], shape: "", x: 0, y: 0, editingIndex: -1, faceIndex: -1, toBeDeleted: !1 }, currentTime: 0, timeVarying: !1, isPlaying: !1, isReady: !1, /** * This is set when scene is transitioning. */ isTransitioning: !1, tooltipAppendToBody: !1, hoverVisibilities: [ { value: !1, ref: "zoomInPopover" }, // 0 { value: !1, ref: "zoomOutPopover" }, // 1 { value: !1, ref: "zoomFitPopover" }, // 2 { value: !1, ref: "openMapPopover" }, // 3 { value: !1, ref: "settingsPopover" }, // 4 { value: !1, ref: "sliderPopover" }, // 5 { value: !1, ref: "regionVisibilityPopover" }, // 6 { value: !1, ref: "warningPopover" }, // 7 { value: !1, ref: "whatsNewPopover" }, // 8 { value: !1, refs: "toolbarPopover", ref: "editPopover" }, // 9 { value: !1, refs: "toolbarPopover", ref: "pointPopover" }, // 10 { value: !1, refs: "toolbarPopover", ref: "lineStringPopover" }, // 11 { value: !1, refs: "toolbarPopover", ref: "deletePopover" } // 11 ], inHelp: !1, helpModeActiveIndex: this.helpModeInitialIndex, loading: !1, duration: 3e3, drawerOpen: !0, currentBackground: "white", availableBackground: ["white", "lightskyblue", "black"], minimisedSlider: !1, sliderPosition: "", timeMax: 100, orginalDuration: "", animateDuration: "6secs", playSpeed: [ { value: 0.1, label: "0.1x" }, { value: 0.5, label: "0.5x" }, { value: 1, label: "1x" }, { value: 2, label: "2x" }, { value: 5, label: "5x" }, { value: 10, label: "10x" } ], currentSpeed: 1, timeStamps: {}, defaultCheckedKeys: [], tData: { label: "", region: "", visible: !1, x: 200, y: 200, active: !1 }, fileFormat: "metadata", previousMarkerLabels: Si({}), viewingMode: "Exploration", viewingModes: { Exploration: "View and explore detailed visualization of 3D scaffolds", Annotation: "View internal identifiers of features" }, openMapRef: void 0, backgroundIconRef: void 0, userInformation: void 0, toolbarOptions: [ "Delete", "Edit", "Point", "LineString" ], activeDrawTool: void 0, activeDrawMode: void 0, localAnnotationsList: Si([]), boundingDims: { centre: [0, 0, 0], size: [1, 1, 1] }, lastSelected: Si({ region: "", group: "", isSearch: !1 }) }; }, watch: { format: { handler: function(t) { this.fileFormat = t; }, immediate: !0 }, url: { handler: function(t) { (this.state === void 0 || this.state.url === void 0) && this.setURL(t); }, immediate: !0 }, region: { handler: function(t) { this.state || this.viewURL || this.setFocusedRegion(t); }, immediate: !0 }, state: { handler: function(t) { this.setState(t); }, immediate: !0, deep: !0 }, viewURL: { handler: function(t) { this.updateViewURL(t); }, immediate: !0 }, helpMode: function(t, e) { t !== e && this.setHelpMode(t); }, helpModeActiveItem: function() { this.helpMode && (this.helpModeActiveIndex += 1, this.setHelpMode(this.helpMode)); }, displayMarkers: function(t) { this.$module.scene.displayMarkers = t, this.$module.scene.forcePickableObjectsUpdate = !0; }, displayMinimap: function(t) { this.$module.scene.displayMinimap = t; }, currentTime: { handler: function() { this.$emit("timeChanged", this.currentTime); } }, duration: function() { this.$module.scene.setDuration(this.duration); }, minimapSettings: { deep: !0, handler: "updateMinimapScissor" }, render: function(t) { this.toggleRendering(t); }, markerCluster: { handler: function(t) { this.$module.scene.enableMarkerCluster(t); }, immediate: !0 }, markerLabels: function(t) { for (const [e, r] of Object.entries(this.previousMarkerLabels)) this.setMarkerModeForObjectsWithName(e, r, "off"); for (const [e, r] of Object.entries(t)) this.setMarkerModeForObjectsWithName(e, r, "on"); this.previousMarkerLabels = Si({ ...t }); }, annotationDisplay: function(t) { if (this.annotationSidebar) if (t) { const e = { featureId: (this.tData.region ? this.tData.region + "/" : "") + this.tData.label, resourceId: this.url, resource: this.url }; this.$emit("annotation-open", { annotationEntry: e, commitCallback: this.commitAnnotationEvent }); } else (!this.createData.toBeConfirmed || !this.createData.toBeDeleted) && this.$emit("annotation-close"); } }, beforeCreate: function() { this.$module = new dD(), this.selectedObjects = [], this.hoveredObjects = [], this.currentBackground = "white", this._currentURL = void 0, this.availableBackground = ["white", "black", "lightskyblue"], this.$_searchIndex = new cme(); }, mounted: function() { this.openMapRef = mr(this.$refs.openMapRef), this.backgroundIconRef = mr(this.$refs.backgroundIconRef), this.$refs.scaffoldTreeControls.setModule(this.$module); let t = new Hfe(); t.subscribe(this, this.eventNotifierCallback), this.$module.addNotifier(t), this.$module.addOrganPartAddedCallback(this.zincObjectAdded), this.$module.addOrganPartRemovedCallback(this.zincObjectRemoved), this.$module.initialiseRenderer(this.$refs.display), this.toggleRendering(this.render), this.ro = new ResizeObserver(this.adjustLayout).observe( this.$refs.scaffoldContainer ), this.helpTextWait = [], this.helpTextWait.length = this.hoverVisibilities.length, this.defaultRate = this.$module.getPlayRate(), this.$module.zincRenderer.addPreRenderCallbackFunction(() => { this.currentTime = this.$module.getCurrentTime(); }); }, beforeUnmount: function() { this.ro && this.ro.disconnect(), this.$module.destroy(), this.$module = void 0; }, computed: { ...lD(cD, ["userToken"]), annotationDisplay: function() { return this.viewingMode === "Annotation" && this.tData.active === !0 && this.activeDrawMode !== "Point" && this.activeDrawMode !== "LineString"; } }, methods: { /** * @public * Call this to manually add a zinc object into the current scene. * This will subsequently trigger a zincObjectAdded * @arg {Object} "ZincObject object to be added" */ addZincObject: function(t) { this.$module.scene && this.$module.scene.addZincObject(t); }, /** * Internal only. * This is called when a new zinc object is read into the scene. */ zincObjectAdded: function(t) { this.loading = !1, this.$_searchIndex.addZincObject(t, t.uuid), this.timeVarying === !1 && t.isTimeVarying() && (this.timeVarying = !0), this.$emit("zinc-object-added", t); }, /** * Internal only. * Remove an entry matching region and group from * local annotation list. */ removeFromLocalAnnotationList: function(t, e) { for (let r = 0; r < this.localAnnotationsList.length; r++) { const i = this.localAnnotationsList[r]; if (i.region === t && i.group === e) { this.localAnnotationsList.splice(r, 1); return; } } }, /** * Internal only. * This is called when a zinc object is removed. */ zincObjectRemoved: function(t) { if (this.$module.scene) { const e = t.region.getFullPath(), r = t.groupName; t.region.findObjectsWithGroupName(r, !1).length === 0 && (this.$_searchIndex.removeZincObject(t, t.uuid), this.removeFromLocalAnnotationList(e, r)); } }, /** * Internal only. * Add regions to search index. */ addRegionsToSearchIndex: function() { this.$module.scene.getRootRegion().getChildRegions(!0).forEach((t) => { this.$_searchIndex.addRegion(t, t.uuid); }); }, /** * Internal only. * This is called when Change backgspeedround colour button * is pressed an causes the backgrouColornd colour to be changed * to one of the three preset colour: white, black and * lightskyblue. */ backgroundChangeCallback: function(t) { this.currentBackground = t, this.$module.zincRenderer.getThreeJSRenderer().setClearColor(this.currentBackground, 1); }, /** * Internal only. * This is called by captueeScreenshot and after the last render * loop, it download a screenshot of the current scene with no UI. */ captureScreenshotCallback: function() { this.$module.zincRenderer.removePostRenderCallbackFunction( this.captureID ); let t = this.$module.zincRenderer.getThreeJSRenderer().domElement.toDataURL("image/png"), e = document.createElement("a"); document.body.append(e), this.captureFilename ? e.download = this.captureFilename : e.download = "screenshot.png", e.href = t, e.click(), e.remove(); }, /** * @public * Function for capturing a screenshot of the current rendering. * * @arg {String} "filename given to the screenshot." */ captureScreenshot: function(t) { this.captureFilename = t, this.captureID = this.$module.zincRenderer.addPostRenderCallbackFunction( this.captureScreenshotCallback ); }, /** * @public * Function to clear current scene, the tree controls and the search index. */ clearScene: function() { this.$refs.scaffoldTreeControls && this.$refs.scaffoldTreeControls.clear(), this.$_searchIndex && this.$_searchIndex.removeAll(), this.$module.scene && this.$module.scene.clearAll(); }, /** * @public * Add and edit local annotations * @arg `region`, * @arg `group`, * @arg `zincObject`, * @arg `comment` */ addAndEditAnnotations: function(t, e, r, i) { const n = vT( this.annotator, this.userToken, r, t, e, this.url, i ); if (this.enableLocalAnnotations) { n.group = e; let a = t; a.slice(-1) === "/" && (a = a.slice(0, -1)), n.region = a, this.removeFromLocalAnnotationList(a, e), this.localAnnotationsList.push(n); } this.$emit("userPrimitivesUpdated", { region: t, group: e, zincObject: r }); }, /** * @public * Callback for when primitives have been update using primitive controls. * This is only called from callback. * @arg `object` */ primitivesUpdated: function(t) { if (t.isZincObject && t.isEditable) { const e = t.groupName, r = t.region.getFullPath(); this.addAndEditAnnotations(r, e, t, "Position Updated"); } }, /** * @public * Confirm creation of new primitive. This is only called from callback. * @arg `payload` */ confirmCreate: function(t) { if (t) { let e; if (t.shape === "Point") e = this.$module.scene.createPoints( t.region, t.group, this.createData.points, t.group, 8942 ); else if (t.shape === "LineString") e = this.$module.scene.createLines( t.region, t.group, [this.createData.points[0], this.createData.points[1]], 60962 ); else if (t.editingIndex > -1 && this._editingZincObject) { this._editingZincObject.editVertices( [this.createData.points[1]], t.editingIndex ); const r = this._editingZincObject.region.getFullPath() + "/", i = this._editingZincObject.groupName; this.addAndEditAnnotations(r, i, this._editingZincObject, "Position Updated"); } e && (this.addAndEditAnnotations(t.region, t.group, e.zincObject, "Create"), e.zincObject.isEditable = !0, this.tData.region = t.region, this.tData.label = t.group, this.changeActiveByName([t.group], t.region, !1)); } this.cancelCreate(); }, /** * Internal only. * Cancel create workflows. Reset all relevant UIs and data. */ cancelCreate: function() { this.createData.points.length = 0, this.createData.toBeConfirmed = !1, this._editingZincObject = void 0, this.createData.editingIndex = -1, this.createData.faceIndex = -1, this.tData.visible = !1, this.createData.toBeDeleted = !1, this._tempLine && (this.$module.scene.removeTemporaryPrimitive(this._tempLine), this._tempLine = void 0), this._tempPoint && (this.$module.scene.removeTemporaryPrimitive(this._tempPoint), this._tempPoint = void 0), this.annotationSidebar && this.$emit("annotation-close"); }, /** * Internal only. * Confirm delete of user created primitive. * This is only called from callback. */ confirmDelete: function() { var t; if ((t = this._editingZincObject) != null && t.isEditable) { const e = this._editingZincObject.region.getFullPath() + "/", r = this._editingZincObject.groupName; vT( this.annotator, this.userToken, this._editingZincObject, e, r, this.url, "Deleted" ) && this.$module.scene.getRootRegion().findChildFromPath(e).removeZincObject(this._editingZincObject); } this.cancelCreate(); }, /** * Internal only. * This is triggered when tooltip is hidden */ onTooltipHide: function() { this.createData.toBeConfirmed && !this.annotationSidebar && this.cancelCreate(); }, formatTooltip(t) { if (this.timeMax >= 1e3 && t) { let e = (t % 6e4 / 1e3).toFixed(2) + "s"; return (t > 6e4 ? (t / 6e4).toFixed(0) + "m " : "") + e; } return t ? t.toFixed(2) + " ms" : "0 ms"; }, /** * @public * Function to reset the view to default. * Also called when the associated button is pressed. */ fitWindow: function() { if (this.$module.scene) { let t = !1; this._boundingBoxGeo && (t = this._boundingBoxGeo.getVisibility(), this._boundingBoxGeo.setVisibility(!1)), this.$module.scene.viewAll(), this._boundingBoxGeo && (afe(this._boundingBoxGeo, this.$module.scene), this._boundingBoxGeo.setVisibility(t)); } }, /** * @public * Function to zoom in. * Also called when the associated button is pressed. */ zoomIn: function() { this.$module.scene && this.$module.scene.changeZoomByScrollRateUnit(-1); }, /** * Function to zoom out. * Also called when the associated button is pressed. * * @public */ zoomOut: function() { this.$module.scene && this.$module.scene.changeZoomByScrollRateUnit(1); }, /** * Function to change the current play speed. * * @public * @arg `speed` */ speedChanged: function(t) { this.currentSpeed = t, this.$module.setPlayRate(this.defaultRate * this.currentSpeed); }, /** * Function used to stop the free spin * * @public */ stopFreeSpin: function() { this.$module.scene.getZincCameraControls().stopAutoTumble(), this.isTransitioning = !1; }, /** * Return a list of obejcts with the provided name. * @arg "Group name to search." * * @public */ findObjectsWithGroupName: function(t) { let e = []; return t && t != "" && this.$module.scene && (e = this.$module.scene.findObjectsWithGroupName(t)), e; }, /** * @public * Switch active drawing type * @arg {String} `type` * @arg {String} `icon` */ toggleDrawing: function(t, e) { this.createData.toBeDeleted = !1, t === "mode" ? (this.cancelCreate(), this.activeDrawMode = e, this.createData.shape = "", this.$module.selectObjectOnPick = !0) : t === "tool" && (this.activeDrawTool = e, this.createData.shape = this.activeDrawTool ? this.activeDrawTool : "", this.$module.selectObjectOnPick = !1); }, /** * Toggle the drawing box which aid the drawing * * @public */ toggleDrawingBox: function() { this.createData.drawingBox = !this.createData.drawingBox; }, /** * Find and and zoom into objects with the provided list of names. * @arg "List of names" * * @public */ viewRegion: function(t) { const e = this.$module.scene.getRootRegion(), r = Array.isArray(t) ? t : [t], i = qc(e, r, "", !0); let n = this.$module.scene.getBoundingBoxOfZincObjects(i); if (n) { if (this.$module.isSyncControl()) this.$module.setSyncControlZoomToBox(n); else { const a = this.$module.scene.camera.far - this.$module.scene.camera.near; this.$module.scene.viewAllWithBoundingBox(n), this.$module.scene.camera.far = this.$module.scene.camera.near + a, this.$module.scene.camera.updateProjectionMatrix(); } return !0; } return !1; }, setFocusedRegion: function(t) { t && (this.isReady ? this.viewRegion(t) : this.$module.setFinishDownloadCallback( this.setURLFinishCallback({ region: t }) )); }, updateViewURL: function(t) { if (t) if (this.isReady) { const e = new URL(t, this.url); this.$module.scene.loadViewURL(e); } else this.$module.setFinishDownloadCallback( this.setURLFinishCallback({ viewURL: t }) ); }, createEditTemporaryLines: function(t) { const e = t[0].extraData.worldCoords; if (e && (this.createData.shape === "LineString" || this.createData.editingIndex > -1) && this.createData.points.length === 1) if (this.showRegionTooltipWithAnnotations(t, !0, !1), this.tData.x = 50, this.tData.y = 200, this._tempLine) { const r = this._tempLine.geometry.getAttribute("position"); r.setXYZ(1, e[0], e[1], e[2]), r.needsUpdate = !0; } else this._tempLine = this.$module.scene.addTemporaryLines( [this.createData.points[0], e], 65535 ); }, draw: function(t) { t && t.length > 0 && t[0].data.group && t[0].extraData.worldCoords && (this.createData.shape === "Point" ? this.drawPoint(t[0].extraData.worldCoords, t) : (this.createData.shape === "LineString" || this.createData.editingIndex > -1) && this.drawLine(t[0].extraData.worldCoords, t)); }, drawPoint: function(t, e) { this.createData.toBeConfirmed === !1 && (this.createData.points.length = 0, this.createData.points.push(t), this.createData.toBeConfirmed = !0, this.showRegionTooltipWithAnnotations(e, !0, !1), this.tData.x = 50, this.tData.y = 200, this._tempPoint = this.$module.scene.addTemporaryPoints([t], 16776960)); }, drawLine: function(t, e) { this.createData.toBeConfirmed === !1 && (this.createData.points.length === 1 ? (this.createData.points.push(t), this.createData.toBeConfirmed = !0, this.showRegionTooltipWithAnnotations(e, !0, !1), this.tData.x = 50, this.tData.y = 200) : (this._tempPoint = this.$module.scene.addTemporaryPoints([t], 16776960), this.createData.points.push(t))); }, /** * Return renderer information * * @public */ getRendererInfo: function() { if (this.$module.zincRenderer) return this.$module.zincRenderer.getThreeJSRenderer().info; }, /** * Function used to rotate the scene. * Also called when the associated button is pressed. * * @public */ freeSpin: function() { if (this.$module.scene) { let t = this.$module.scene.getZincCameraControls(); this.isTransitioning = !0, t.enableAutoTumble(), t.autoTumble([1, 0], Math.PI, !0), setTimeout(this.stopFreeSpin, 4e3); } }, activateAnnotationMode: function(t, e) { if (this.userInformation || this.enableLocalAnnotations) if (this.createData.toBeDeleted = !1, this.createData.shape !== "" || this.createData.editingIndex > -1) t.length > 0 && e.identifiers[0].coords && (this.createData.x = e.identifiers[0].coords.x, this.createData.y = e.identifiers[0].coords.y, this.draw(e.identifiers)); else { if (this.activeDrawMode === "Edit") { const r = rfe(e); r && this.activateEditingMode( r.zincObject, r.faceIndex, r.vertexIndex, r.point ); } else if (this.activeDrawMode === "Delete") { const r = ife(e); r && (this.createData.toBeDeleted = !0, this._editingZincObject = r); } this.activeDrawMode !== "Point" && this.activeDrawMode !== "LineString" ? this.showRegionTooltipWithAnnotations(e.identifiers, !0, !1) : this.showRegionTooltipWithAnnotations(e.identifiers, !0, !0); } else this.showRegionTooltipWithAnnotations(e.identifiers, !0, !0); }, activateEditingMode: function(t, e, r, i) { this._editingZincObject = t, this.createData.faceIndex = e, this.createData.editingIndex = r, this.drawLine(i, void 0); }, /** * Callback when a region is selected/highlighted. * It will also update other controls. * */ eventNotifierCallback: function(t) { if (!(this.createData.toBeConfirmed || this.createData.toBeDeleted)) { const e = []; let r = []; (t.eventType == 1 || t.eventType == 2) && (t.identifiers.forEach((a) => { if (a) { let o = a.data.id ? a.data.id : a.data.group; e.push(o); } }), r = t.zincObjects); let i, n; if (t.identifiers.length > 0 && t.identifiers[0] && (i = t.identifiers[0].data.id ? t.identifiers[0].data.id : t.identifiers[0].data.group, t.identifiers[0].data.region && (n = t.identifiers[0].data.region)), t.eventType == 1) this.viewingMode === "Annotation" ? (this.tData.label = i, this.tData.region = n, this.activateAnnotationMode(e, t)) : (this.$refs.scaffoldTreeControls && (e.length > 0 ? (this.$refs.scaffoldTreeControls.updateActiveUI(r), this.updatePrimitiveControls(r)) : (this.hideRegionTooltip(), this.$refs.scaffoldTreeControls.removeActive(!1))), t.identifiers.length === 1 ? (this.lastSelected.isSearch = !1, this.lastSelected.region = n, this.lastSelected.group = t.identifiers[0].data.group) : t.identifiers.length === 0 && (this.lastSelected.isSearch = !1, this.lastSelected.region = "", this.lastSelected.group = ""), this.$emit("scaffold-selected", t.identifiers)); else if (t.eventType == 2) this.selectedObjects.length === 0 && (this.hideRegionTooltip(), this.$refs.scaffoldTreeControls && (e.length > 0 ? this.$refs.scaffoldTreeControls.updateHoverUI(r) : this.$refs.scaffoldTreeControls.removeHover(!0)), t.identifiers.length > 0 && t.identifiers[0] && t.identifiers[0].coords && (this.tData.active = !1, (this.viewingMode !== "Annotation" || !this.annotationSidebar) && (this.tData.visible = !0), this.tData.label = i, this.tData.region = n, this.tData.x = t.identifiers[0].coords.x, this.tData.y = t.identifiers[0].coords.y, this.createEditTemporaryLines(t.identifiers)), this.$emit("scaffold-highlighted", t.identifiers)); else if (t.eventType == 3 && t.identifiers.length > 0 && t.identifiers[0]) { if (t.identifiers[0].coords) { const a = this.$refs.scaffoldContainer.getBoundingClientRect(); this.tData.x = t.identifiers[0].coords.x - a.left, this.tData.y = t.identifiers[0].coords.y - a.top; } this.createEditTemporaryLines(t.identifiers); } } }, /** * Get the coordinates of the current selected region. * * @public */ getCoordinatesOfSelected: function() { if (this.selectedObjects && this.selectedObjects.length > 0) return this.$module.scene.getObjectsScreenXY(this.selectedObjects); }, /** * Return an object containing the window coordinates of the * current selected region which will be updated after each render * loop. * * @public */ getDynamicSelectedCoordinates: function() { return this.$module.selectedScreenCoordinates; }, /** * Callback when time is changed through the UI. */ timeChange: function(t) { let e = t / this.timeMax * 100; e != this.currentTime && this.$module.updateTime(e); }, /** * Update primitive controls UI with the specified objects * * @arg objects objects to be set for the selected */ updatePrimitiveControls: function(t) { this.selectedObjects = t, this.selectedObjects && this.selectedObjects.length > 0 ? this.$refs.primitiveControls.setObject(this.selectedObjects[0]) : this.$refs.primitiveControls.setObject(void 0); }, /** * A callback used by children components. Set the selected zinc object * * @arg Selected zinc objects * @arg Flag to determine if callback should be triggered when new selection * is made */ objectSelected: function(t, e) { this.updatePrimitiveControls(t), this.$module.setSelectedByZincObjects(t, void 0, {}, e); }, /** * A callback used by children components. Set the highlighted zinc object * * @arg Hovered zinc objects * @arg Flag to determine if callback should be triggered when new selection * is made */ objectHovered: function(t, e) { this.hoveredObjects = t, this.$module.setHighlightedByZincObjects(t, void 0, {}, e); }, /** * Set the selected by name. * * @param {} name Name of the group */ changeActiveByName: function(t, e, r) { const i = Array.isArray(t); if (t === void 0 || i && t.length === 0) this.$refs.scaffoldTreeControls.removeActive(r); else { let n = t; i || (n = [n]), this.$refs.scaffoldTreeControls.changeActiveByNames(n, e, r); } }, /** * Set the highlighted by name. * * @param {name} name Name of the group */ changeHighlightedByName: function(t, e, r) { const i = Array.isArray(t); if (t === void 0 || i && t.length === 0) this.$refs.scaffoldTreeControls.removeHover(r); else { let n = t; i || (n = [n]), this.$refs.scaffoldTreeControls.changeHoverByNames(n, e, r); } }, /** * @public * Start the animation. * * @arg "flag to turn the animation on/off" */ play: function(t) { this.$module.playAnimation(t), this.isPlaying = t; }, /** * @public * Function to toggle on/off overlay help. */ setHelpMode: function(t) { const e = this.hoverVisibilities.length, r = e - 1, i = this.hoverVisibilities[this.helpModeActiveIndex]; if (i) { const n = i == null ? void 0 : i.refs, a = i == null ? void 0 : i.ref; this.$refs[n || a] || (this.helpModeActiveIndex += 1); } t || (this.helpModeActiveIndex = this.helpModeInitialIndex), t && this.helpModeActiveIndex >= r && this.$emit("help-mode-last-item", !0), t && !this.helpModeDialog ? (this.inHelp = !0, this.hoverVisibilities.forEach((n) => { n.value = !0; })) : t && this.helpModeDialog && e > this.helpModeActiveIndex ? this.helpModeActiveIndex > -1 && setTimeout(() => { this.inHelp = !1, this.hoverVisibilities.forEach((n) => { n.value = !1; }), this.showHelpText(this.helpModeActiveIndex, 200); }, 300) : (this.inHelp = !1, this.hoverVisibilities.forEach((n) => { n.value = !1; })); }, /** * Callback function used by showRegionTooltip in the case when the tooltip * is out of view. */ displayTooltipOfObjectsCallback: function(t, e, r, i, n) { const a = this; return function() { a.$module.zincRenderer.removePostRenderCallbackFunction( a.$_regionTooltipCallback ), a.$_regionTooltipCallback = void 0, a.displayTooltipOfObjects(t, e, r, i, n); }; }, liveUpdateTooltipPosition: function() { this.$module.selectedCenter && (this.tData.x = this.$module.selectedScreenCoordinates.x, this.tData.y = this.$module.selectedScreenCoordinates.y); }, displayTooltipOfObjects: function(t, e, r, i, n) { if (e.length > 0) { let a = e[0].getClosestVertexDOMElementCoords( this.$module.scene ); if (a) return a.inView ? (t.includes("Search Results for") ? this.tData.active = !1 : this.tData.active = !0, this.tData.visible = !0, this.tData.label = t, this.tData.x = a.position.x, this.tData.y = a.position.y, this.tData.region = r, this.$_liveCoordinatesUpdated && this.$module.zincRenderer.removePostRenderCallbackFunction( this.$_liveCoordinatesUpdated ), n && (this.$module.setupLiveCoordinates(e), this.$_liveCoordinatesUpdated = this.$module.zincRenderer.addPostRenderCallbackFunction( this.liveUpdateTooltipPosition ))) : (this.hideRegionTooltip(), i && (this.$module.scene.viewAll(), this.$_regionTooltipCallback && this.$module.zincRenderer.removePostRenderCallbackFunction( this.$_regionTooltipCallback ), this.$_regionTooltipCallback = this.$module.zincRenderer.addPostRenderCallbackFunction( this.displayTooltipOfObjectsCallback( t, e, r, i, n ) ))), !0; } return this.hideRegionTooltip(), !1; }, /** * Display the tooltip used for displaying search result. * When resetView is set to true, it will * reset view if the tooltip is not in view. * Setting liveUpdates to true will update the tooltip location * at every rendering loop. */ showRegionTooltipWithObjects: function(t, e, r, i, n) { return t && e && e.length > 0 && this.$module.scene ? this.displayTooltipOfObjects( t, e, r, i, n ) : (this.hideRegionTooltip(), !1); }, /** * Display the tooltip. When resetView is set to true, it will * reset view if the tooltip is not in view. * Setting liveUpdates to true will update the tooltip location * at every rendering loop. */ showRegionTooltip: function(t, e, r) { if (t && this.$module.scene) { const i = this.$module.scene.getRootRegion(), n = qc(i, [t], "", !0); let a; return n && n.length > 0 && (a = n[0].getRegion().getFullPath()), this.showRegionTooltipWithObjects( t, n, a, e, r ); } return this.hideRegionTooltip(), !1; }, /** * Display the tooltip using the list of annotations. * When resetView is set to true, it will * reset view if the tooltip is not in view. * Setting liveUpdates to true will update the tooltip location * at every rendering loop. */ showRegionTooltipWithAnnotations: function(t, e, r) { if (this.$module.scene) { const i = gT(this.$module.scene, t); if (i && i.objects.length > 0) if (this.annotationSidebar) { const n = { featureId: (this.tData.region ? this.tData.region + "/" : "") + this.tData.label, resourceId: this.url, resource: this.url }; this.$emit("annotation-open", { annotationEntry: n, createData: this.createData, confirmCreate: this.confirmCreate, cancelCreate: this.cancelCreate, confirmDelete: this.confirmDelete }); return; } else return this.showRegionTooltipWithObjects( i.label, i.objects, i.regionPath, e, r ); } return this.hideRegionTooltip(), !1; }, /** * Callback on viewing mode change * Optional, can be used to update the view mode. */ changeViewingMode: function(t) { if (this.$module) { if (t && (this.viewingMode = t), this.viewingMode === "Annotation") { let e = !1; this.userInformation && (e = !0), this.userInformation = void 0, this.annotator.authenticate(this.userToken).then((r) => { r.name && r.email && r.canUpdate && (this.userInformation = r, e || (yT(this.annotator, this.userToken, this.url).then((i) => { i && i.features && K0(this.$module.scene, i.features); }), yT(this.annotator, this.userToken, encodeURIComponent(this.url)).then((i) => { i && i.features && K0(this.$module.scene, i.features); }))); }); } else this.viewingMode === "Exploration" && (this.activeDrawTool = void 0, this.activeDrawMode = void 0, this.createData.shape = ""); this.viewingMode === "Exploration" || this.viewingMode === "Annotation" && this.createData.shape === "" ? this.$module.selectObjectOnPick = !0 : this.$module.selectObjectOnPick = !1, this.cancelCreate(); } }, /** * @public * Hide the tooltip */ hideRegionTooltip: function() { this.$_liveCoordinatesUpdated && (this.$module.zincRenderer.removePostRenderCallbackFunction( this.$_liveCoordinatesUpdated ), this.$module.setupLiveCoordinates(void 0)), this.tData.active = !1, this.tData.visible = !1, this.tData.region = void 0; }, /** * Set the marker modes for objects with the provided name, mode can * be "on", "off" or "inherited". * Value can either be number or an object containing number and * imgURL. */ setMarkerModeForObjectsWithName: function(t, e, r) { if (t && this.$module.scene) { let i = e; typeof e == "number" && (i = { number: e, imgURL: void 0 }); const n = this.$module.scene.getRootRegion(); qc(n, [t], "", !0).forEach((a) => a.setMarkerMode(r, i)); } }, /** * @public * Set the marker modes for objects specified by the list of annotations * @arg `annotations` * @arg `mode` */ setMarkerModeWithAnnotations: function(t, e) { if (this.$module.scene) { const r = gT(this.$module.scene, t); r && r.objects.length > 0 && r.objects.forEach((i) => i.setMarkerMode(e)); } }, /** * This is called when mouse cursor enters supported elements * with help tootltips. */ showHelpText: function(t, e = 500) { this.inHelp || (clearTimeout(this.helpTextWait[t]), this.helpTextWait[t] = setTimeout(() => { this.hoverVisibilities[t].value = !0, this.$emit("shown-tooltip"); }, e)); }, /** * This is called when mouse cursor exits supported element.. */ hideHelpText: function(t, e = 500) { this.inHelp || (clearTimeout(this.helpTextWait[t]), this.helpTextWait[t] = setTimeout(() => { this.hoverVisibilities[t].value = !1; }, e)); }, /** * @public * * Search a object and display the tooltip * @arg "text to search across" * @arg "toggle the tooltip if this is set" */ search: function(t, e) { if (this.$_searchIndex) { if (t === void 0 || t === "" || Array.isArray(t) && t.length === 0) return this.lastSelected.region = "", this.lastSelected.group = "", this.lastSelected.isSearch = !0, this.objectSelected([], !0), !1; { this.lastSelected.region = "", this.lastSelected.group = t, this.lastSelected.isSearch = !0; const r = this.$_searchIndex.searchAndProcessResult(t), i = r.zincObjects; if (i.length > 0) { if (this.objectSelected(i, !0), e) for (let n = 0; n < i.length; n++) i[n] && i[n].groupName && this.showRegionTooltipWithObjects( r.label, i, r.regionPath, !0, !0 ); return !0; } else this.objectSelected([], !0); } } return !1; }, /** * @public * * Get the list of suggested terms based on the provided term. * This can be used for autocomplete. * @arg `term` */ fetchSuggestions: function(t) { return this.$_searchIndex === void 0 ? [] : this.$_searchIndex.auto_suggest(t); }, /** * Called when minimap settings has changed. Pass the * parameters to ZincJS and marked it for update. */ updateMinimapScissor: function() { Object.keys(this.minimapSettings).forEach((t) => { this.$module.scene.minimapScissor[t] = this.minimapSettings[t]; }), this.$module.scene.minimapScissor.updateRequired = !0; }, updateSettingsfromScene: function() { this.currentSpeed = 1, this.$module.setPlayRate(this.defaultRate), this.orginalDuration = this.$module.scene.getMetadataTag("OriginalDuration"), this.animateDuration = this.$module.scene.getMetadataTag("Duration"); let t = this.$module.scene.getMetadataTag("TimeStamps"); this.timeStamps = {}; for (const e in t) this.timeStamps[t[e]] = e; this.timeMax = this.$module.scene.getDuration(); }, restoreSettings: function(t) { if (t) { if (t.viewport) this.$module.scene.getZincCameraControls().setCurrentCameraSettings(t.viewport); else if (t.viewURL && t.viewURL !== "") { const r = new URL(t.viewURL, this.url); this.$module.scene.loadViewURL(r); } else t.region && t.region !== "" && this.viewRegion(t.region); t.visibility && this.$nextTick(() => { this.$refs.scaffoldTreeControls.setState(t.visibility); }), t.background && this.backgroundChangeCallback(t.background), t.viewingMode && this.changeViewingMode(t.viewingMode); const e = t.search; e && e.group && (e.isSearch ? this.search(e.group, !0) : this.changeActiveByName(e.group, e.region, !0)); } }, setURLFinishCallback: function(t) { return () => { this.localAnnotationsList.length = 0, this.updateSettingsfromScene(), this.$module.updateTime(0.01), this.$module.updateTime(0), this.$module.unsetFinishDownloadCallback(), this.addRegionsToSearchIndex(), this.$emit("on-ready"), this.setMarkers(), this._boundingBoxGeo = this.$module.scene.addBoundingBoxPrimitive( "_helper", "boundingBox", 4251856, 0.15 ), this._slides = this.$module.scene.addSlicesPrimitive( "_helper", ["x-plane", "y-plane", "z-plane"], [16733525, 5635925, 5592575], 0.5 ); const { centre: e, size: r } = this.$module.getCentreAndSize(); this.boundingDims.centre = e, this.boundingDims.size = r, this.$nextTick(() => this.restoreSettings(t)), this.isReady = !0; }; }, /** * Function used for getting the current states of the scene. This exported states * can be imported using the importStates method. * * @public */ getState: function() { let t = { format: this.fileFormat, url: this._currentURL, viewport: void 0, visibility: void 0, background: this.currentBackground, viewingMode: this.viewingMode }; if (this.$refs.scaffoldTreeControls && (t.visibility = this.$refs.scaffoldTreeControls.getState()), this.$module.scene) { let e = this.$module.scene.getZincCameraControls(); t.viewport = e.getCurrentViewport(); } return this.lastSelected && this.lastSelected.group && (t.search = { ...this.lastSelected }), t; }, /** * Function used for importing the states of the scene. This exported states * can be imported using the read states method. * * @public * @arg `state` */ setState: function(t) { t && (t.url && t.url !== this._currentURL ? this.setURLAndState(t.url, { fileFormat: t.fileFormat, viewport: t.viewport, visibility: t.visibility, background: t.background, viewingMode: this.viewingMode, search: t.search }) : (t.background || t.search || t.viewport || t.viewingMode || t.visibility) && (this.isReady && this.$module.scene ? this.restoreSettings(t) : this.$module.setFinishDownloadCallback( this.setURLFinishCallback({ background: t.background, viewingMode: t.viewingMode, viewport: t.viewport, visibility: t.visibility, search: t.search }) ))); }, /** * export current scene in GLTF. * @arg "Return in binary form when set to true" * * @public */ exportGLTF: function(t) { return this.$module.scene.exportGLTF(t); }, /** * Return a copy of the local annotations list. * This list is used for storing user created annotation * when enableLocalAnnotations is set to true. * * @public */ getLocalAnnotations: function() { return [...this.localAnnotationsList]; }, /** * Import local annotations. The annotations will only * be imported when enableLocalAnnotations is set to * true; * * @public * @arg {Array} `annotationsList` */ importLocalAnnotations: function(t) { if (this.enableLocalAnnotations) { t.forEach((r) => { const i = r.group, n = r.region; let a = n.slice(-1) === "/" ? n : n + "/"; const o = a.slice(0, -1); r.region = o, a = a + i; const s = a; r.item.id = s, r.feature.id = s; }); const e = t.map((r) => r.feature); K0(this.$module.scene, e), t.forEach((r) => { this.localAnnotationsList.push({ ...r }); }); } }, /** * Function used for reading in new scaffold metadata and a custom * viewport. This function will ignore the state prop and * read in the new url. * * @public * @arg `newValue` * @arg `state` */ setURLAndState: function(t, e) { t != this._currentURL && (e != null && e.format && (this.fileFormat = e.format), this._currentURL = t, this.$refs.scaffoldTreeControls && this.$refs.scaffoldTreeControls.clear(), this.loading = !0, this.timeVarying = !1, this.isReady = !1, this.$_searchIndex.removeAll(), this.hideRegionTooltip(), this.$module.setFinishDownloadCallback( this.setURLFinishCallback({ background: e == null ? void 0 : e.background, region: this.region, search: e == null ? void 0 : e.search, viewingMode: e == null ? void 0 : e.viewingMode, viewURL: this.viewURL, viewport: e == null ? void 0 : e.viewport, visibility: e == null ? void 0 : e.visibility }) ), this.fileFormat === "gltf" ? this.$module.loadGLTFFromURL(t, "scene", !0) : this.$module.loadOrgansFromURL( t, void 0, void 0, "scene", void 0, !0 ), this.$module && this.$module.scene && (this.$module.scene.displayMarkers = this.displayMarkers, this.$module.scene.forcePickableObjectsUpdate = !0, this.$module.scene.displayMinimap = this.displayMinimap, this.updateMinimapScissor())); }, /** * Function used for reading in new scaffold metadata. This function will ignore * the state prop and read in the new url. * * @public * @arg `newValue` */ setURL: function(t) { this.setURLAndState(t, void 0); }, /** * Callback when drawer is toggled. */ drawerToggled: function(t) { this.drawerOpen = t, this.adjustLayout(); }, /** * Callback using ResizeObserver. */ adjustLayout: function() { if (this.$refs.scaffoldContainer) { let t = this.$refs.scaffoldContainer.clientWidth; this.minimisedSlider = t < 812, this.minimisedSlider ? this.sliderPosition = this.drawerOpen ? "right" : "left" : this.sliderPosition = ""; } }, toggleRendering: function(t) { this.$module.zincRenderer && (t ? this.$module.zincRenderer.animate() : this.$module.zincRenderer.stopAnimate()); }, /** * @public * * Force the renderer to resize */ forceResize: function() { this.$module.zincRenderer && this.$module.zincRenderer.onWindowResize(); }, syncControlCallback: function() { const t = this.$module.NDCCameraControl.getPanZoom(); this.tData.visible && this.showRegionTooltip(this.tData.label, !0, !0), this.$emit("scaffold-navigated", t); }, /** * Rotate mode - "none", "horizontal", "vertical", "free" but * it will be ignored if flag is set to false. */ toggleSyncControl: function(t, e) { this.$module.toggleSyncControl(t, e), this.$module.setSyncControlCallback(this.syncControlCallback); }, /** * Set the markers for the scene. */ setMarkers: function() { for (const [t, e] of Object.entries(this.markerLabels)) this.setMarkerModeForObjectsWithName(t, e, "on"); } } }, kw = (t) => (Hh("data-v-3a5a2c2d"), t = t(), Gh(), t), dme = { ref: "scaffoldContainer", class: "scaffold-container", "element-loading-text": "Loading...", "element-loading-background": "rgba(0, 0, 0, 0.3)" }, hme = /* @__PURE__ */ kw(() => /* @__PURE__ */ Ee("span", { class: "message-text" }, "Beta", -1)), pme = /* @__PURE__ */ kw(() => /* @__PURE__ */ Ee("span", { class: "message-text" }, "What's new?", -1)), fme = { class: "primitive-controls-box" }, mme = { class: "animation-data" }, gme = { class: "purple" }, vme = { class: "animation-data" }, yme = { class: "purple" }, bme = { class: "animation-data" }, xme = { class: "bottom-right-control" }, wme = /* @__PURE__ */ kw(() => /* @__PURE__ */ Ee("div", null, [ /* @__PURE__ */ et(" Fit to "), /* @__PURE__ */ Ee("br"), /* @__PURE__ */ et(" window ") ], -1)), _me = { style: { "margin-bottom": "2px" } }, Sme = { key: 0, class: "viewing-mode-title" }, Mme = ["onClick"], Eme = ["onClick"]; function Tme(t, e, r, i, n, a) { const o = qt("map-svg-sprite-color"), s = uD, c = qt("DrawToolbar"), l = QL, u = yr, d = rv, h = aD, f = nD, p = qt("map-svg-icon"), m = An, y = Aa, g = eP, v = Qu, x = Ju, w = Qk, S = Ku, _ = t1; return ht((Q(), be("div", dme, [ oe(o), oe(s, { createData: t.createData, label: t.tData.label, region: t.tData.region, visible: t.tData.visible, x: t.tData.x, y: t.tData.y, annotationDisplay: a.annotationDisplay, onConfirmCreate: e[0] || (e[0] = (b) => a.confirmCreate(b)), onCancelCreate: e[1] || (e[1] = (b) => a.cancelCreate()), onConfirmDelete: e[2] || (e[2] = (b) => a.confirmDelete()), onTooltipHide: e[3] || (e[3] = (b) => a.onTooltipHide()) }, null, 8, ["createData", "label", "region", "visible", "x", "y", "annotationDisplay"]), Ee("div", { id: "organsDisplayArea", ref: "display", tabindex: "-1", style: { height: "100%", width: "100%" }, onKeydown: e[4] || (e[4] = ti((...b) => a.backgroundChangeCallback && a.backgroundChangeCallback(...b), ["66"])) }, null, 544), ht(Ee("div", null, [ t.viewingMode === "Annotation" && (t.userInformation || r.enableLocalAnnotations) ? (Q(), Re(c, { key: 0, toolbarOptions: t.toolbarOptions, activeDrawTool: t.activeDrawTool, activeDrawMode: t.activeDrawMode, hoverVisibilities: t.hoverVisibilities, onClickToolbar: a.toggleDrawing, onShowTooltip: a.showHelpText, onHideTooltip: a.hideHelpText, ref: "toolbarPopover" }, null, 8, ["toolbarOptions", "activeDrawTool", "activeDrawMode", "hoverVisibilities", "onClickToolbar", "onShowTooltip", "onHideTooltip"])) : Pe("", !0), r.displayWarning ? (Q(), Re(d, { key: 1, ref: "warningPopover", visible: t.hoverVisibilities[7].value, content: r.warningMessage, placement: "right", width: "max-content", teleported: !1, "popper-class": "scaffold-popper message-popper right-popper non-selectable" }, { reference: le(() => [ r.displayWarning ? (Q(), be("div", { key: 0, class: "message-icon warning-icon", onMouseover: e[5] || (e[5] = (b) => a.showHelpText(7)), onMouseout: e[6] || (e[6] = (b) => a.hideHelpText(7)) }, [ oe(u, null, { default: le(() => [ oe(l) ]), _: 1 }), hme ], 32)) : Pe("", !0) ]), _: 1 }, 8, ["visible", "content"])) : Pe("", !0), r.displayLatestChanges ? (Q(), Re(d, { key: 2, visible: t.hoverVisibilities[8].value, content: r.latestChangesMessage, placement: "right", teleported: !1, trigger: "manual", "popper-class": "scaffold-popper message-popper right-popper non-selectable", ref: "whatsNewPopover" }, { reference: le(() => [ r.displayLatestChanges && r.latestChangesMessage ? (Q(), be("div", { key: 0, class: "el-icon-warning message-icon latest-changesicon", onMouseover: e[7] || (e[7] = (b) => a.showHelpText(8)), onMouseout: e[8] || (e[8] = (b) => a.hideHelpText(8)) }, [ oe(u, null, { default: le(() => [ oe(l) ]), _: 1 }), pme ], 32)) : Pe("", !0) ]), _: 1 }, 8, ["visible", "content"])) : Pe("", !0), oe(d, { visible: t.hoverVisibilities[6].value, content: "Change region visibility", placement: "right", width: "max-content", teleported: !1, trigger: "manual", "popper-class": "scaffold-popper right-popper non-selectable", ref: "regionVisibilityPopover" }, { reference: le(() => [ oe(h, { ref: "scaffoldTreeControls", isReady: t.isReady, "show-colour-picker": r.showColourPicker, onObjectSelected: a.objectSelected, onObjectHovered: a.objectHovered, onDrawerToggled: a.drawerToggled }, null, 8, ["isReady", "show-colour-picker", "onObjectSelected", "onObjectHovered", "onDrawerToggled"]) ]), _: 1 }, 8, ["visible"]), Ee("div", fme, [ oe(f, { ref: "primitiveControls", createData: t.createData, onPrimitivesUpdated: a.primitivesUpdated }, null, 8, ["createData", "onPrimitivesUpdated"]) ]), t.timeVarying ? (Q(), Re(d, { key: 3, ref: "sliderPopover", width: "max-content", visible: t.hoverVisibilities[5].value, content: "Move the slider to animate the region", placement: "top", teleported: !1, trigger: "manual", "popper-class": "scaffold-popper top-popper non-selectable" }, { reference: le(() => [ t.timeVarying ? (Q(), be("div", { key: 0, class: xe(["time-slider-container", [t.minimisedSlider ? "minimised" : "", t.sliderPosition]]) }, [ oe(w, { type: "card" }, { default: le(() => [ oe(g, { label: "Animate scaffold" }, { default: le(() => [ oe(y, { class: "tab-content" }, { default: le(() => [ t.isPlaying ? (Q(), Re(p, { key: 0, icon: "pause", class: "icon-button video-button", onClick: e[9] || (e[9] = (b) => a.play(!1)) })) : (Q(), Re(p, { key: 1, icon: "play", class: "video-button icon-button", onClick: e[10] || (e[10] = (b) => a.play(!0)) })), oe(m, { min: 0, max: t.timeMax, "model-value": t.currentTime / 100 * t.timeMax, step: 0.1, "tooltip-class": "time-slider-tooltip", class: "slider", "format-tooltip": a.formatTooltip, marks: t.timeStamps, onInput: e[11] || (e[11] = (b) => a.timeChange(b)) }, null, 8, ["max", "model-value", "format-tooltip", "marks"]) ]), _: 1 }) ]), _: 1 }), oe(g, { label: "Animation data" }, { default: le(() => [ oe(y, { class: "tab-content" }, { default: le(() => [ Ee("div", mme, [ et(" Original duration: "), Ee("div", gme, Ze(t.orginalDuration), 1) ]), Ee("div", vme, [ et(" Animation duration: "), Ee("div", yme, Ze(t.animateDuration), 1) ]), Ee("div", bme, [ et(" Playback speed "), oe(x, { teleported: !0, "model-value": t.currentSpeed, placeholder: "Select", class: "scaffold-select-box speed", "popper-class": "scaffold_viewer_dropdown", onChange: e[12] || (e[12] = (b) => a.speedChanged(b)) }, { default: le(() => [ (Q(!0), be(pt, null, ir(t.playSpeed, (b) => (Q(), Re(v, { key: b.value, label: b.label, value: b.value }, null, 8, ["label", "value"]))), 128)) ]), _: 1 }, 8, ["model-value"]) ]) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }) ], 2)) : Pe("", !0) ]), _: 1 }, 8, ["visible"])) : Pe("", !0), Ee("div", xme, [ oe(d, { visible: t.hoverVisibilities[0].value, content: "Zoom in", width: "max-content", placement: "left", teleported: !1, trigger: "manual", "popper-class": "scaffold-popper left-popper non-selectable", ref: "zoomInPopover" }, { reference: le(() => [ oe(p, { icon: "zoomIn", class: "icon-button zoomIn", onClick: e[13] || (e[13] = (b) => a.zoomIn()), onMouseover: e[14] || (e[14] = (b) => a.showHelpText(0)), onMouseout: e[15] || (e[15] = (b) => a.hideHelpText(0)) }) ]), _: 1 }, 8, ["visible"]), oe(d, { visible: t.hoverVisibilities[1].value, content: "Zoom out", placement: "top-end", width: "max-content", teleported: !1, trigger: "manual", "popper-class": "scaffold-popper popper-zoomout non-selectable", ref: "zoomOutPopover" }, { reference: le(() => [ oe(p, { icon: "zoomOut", class: "icon-button zoomOut", onClick: e[16] || (e[16] = (b) => a.zoomOut()), onMouseover: e[17] || (e[17] = (b) => a.showHelpText(1)), onMouseout: e[18] || (e[18] = (b) => a.hideHelpText(1)) }) ]), _: 1 }, 8, ["visible"]), oe(d, { visible: t.hoverVisibilities[2].value, placement: "top", teleported: !1, trigger: "manual", width: "max-content", "popper-class": "scaffold-popper non-selectable", ref: "zoomFitPopover" }, { reference: le(() => [ oe(p, { icon: "fitWindow", class: "icon-button fitWindow", onClick: e[19] || (e[19] = (b) => a.fitWindow()), onMouseover: e[20] || (e[20] = (b) => a.showHelpText(2)), onMouseout: e[21] || (e[21] = (b) => a.hideHelpText(2)) }) ]), default: le(() => [ wme ]), _: 1 }, 8, ["visible"]) ]), t.openMapRef ? (Q(), Re(d, { key: 4, ref: "open-map-popover", "virtual-ref": t.openMapRef, placement: "top-start", width: "128", teleported: !1, trigger: "click", "popper-class": "open-map-popper", "virtual-triggering": "" }, { default: le(() => [ (Q(!0), be(pt, null, ir(r.openMapOptions, (b) => (Q(), Re(y, { key: b.key }, { default: le(() => [ oe(S, { type: "primary", plain: "", onClick: (T) => t.$emit("open-map", b.key) }, { default: le(() => [ et(Ze(b.display), 1) ]), _: 2 }, 1032, ["onClick"]) ]), _: 2 }, 1024))), 128)) ]), _: 1 }, 8, ["virtual-ref"])) : Pe("", !0), oe(d, { ref: "backgroundPopover", "virtual-ref": t.backgroundIconRef, placement: "top-start", width: "128", teleported: !1, trigger: "click", "popper-class": "background-popper non-selectable h-auto", "virtual-triggering": "" }, { default: le(() => [ Ee("div", null, [ oe(y, { class: "backgroundText" }, { default: le(() => [ et("Viewing Mode") ]), _: 1 }), oe(y, { class: "backgroundControl" }, { default: le(() => [ Ee("div", _me, [ (Q(!0), be(pt, null, ir(t.viewingModes, (b, T, E) => (Q(), be(pt, { key: T }, [ T === t.viewingMode ? (Q(), be("span", Sme, [ Ee("b", null, Ze(T), 1) ])) : (Q(), be("span", { key: 1, class: "viewing-mode-unselected", onClick: (C) => a.changeViewingMode(T) }, Ze(T), 9, Mme)) ], 64))), 128)) ]), oe(y, { class: "viewing-mode-description" }, { default: le(() => [ et(Ze(t.viewingModes[t.viewingMode]), 1) ]), _: 1 }) ]), _: 1 }), oe(y, { class: "backgroundSpacer" }), oe(y, { class: "backgroundText" }, { default: le(() => [ et(" Change background ") ]), _: 1 }), oe(y, { class: "backgroundChooser" }, { default: le(() => [ (Q(!0), be(pt, null, ir(t.availableBackground, (b) => (Q(), be("div", { key: b, class: xe([ "backgroundChoice", b, b == t.currentBackground ? "active" : "" ]), onClick: (T) => a.backgroundChangeCallback(b) }, null, 10, Eme))), 128)) ]), _: 1 }) ]) ]), _: 1 }, 8, ["virtual-ref"]), Ee("div", { class: xe(["settings-group", { open: t.drawerOpen, close: !t.drawerOpen }]) }, [ oe(y, null, { default: le(() => [ oe(d, { visible: t.hoverVisibilities[3].value, content: "Open new map", placement: "right", teleported: !1, trigger: "manual", width: "max-content", "popper-class": "scaffold-popper right-popper non-selectable", ref: "openMapPopover" }, { reference: le(() => [ r.enableOpenMapUI && r.openMapOptions.length > 0 ? (Q(), Re(p, { key: 0, ref: "openMapRef", icon: "openMap", class: "icon-button open-map-button", onMouseover: e[22] || (e[22] = (b) => a.showHelpText(3)), onMouseout: e[23] || (e[23] = (b) => a.hideHelpText(3)) }, null, 512)) : Pe("", !0) ]), _: 1 }, 8, ["visible"]) ]), _: 1 }), oe(y, null, { default: le(() => [ oe(d, { visible: t.hoverVisibilities[4].value, content: "Change background color", placement: "right", width: "max-content", teleported: !1, trigger: "manual", "popper-class": "scaffold-popper right-popper non-selectable", ref: "settingsPopover" }, { reference: le(() => [ oe(p, { ref: "backgroundIconRef", icon: "changeBckgd", class: "icon-button", onMouseover: e[24] || (e[24] = (b) => a.showHelpText(4)), onMouseout: e[25] || (e[25] = (b) => a.hideHelpText(4)) }, null, 512) ]), _: 1 }, 8, ["visible"]) ]), _: 1 }) ], 2) ], 512), [ [Ot, r.displayUI && !t.isTransitioning] ]) ])), [ [_, t.loading] ]); } const Cme = /* @__PURE__ */ So(ume, [["render", Tme], ["__scopeId", "data-v-3a5a2c2d"]]), Ame = { name: "Scaffold", mixins: [SD], components: { ScaffoldVuer: Cme, HelpModeDialog: _D }, methods: { onResize: function() { this.scaffoldCamera.onResize(); }, getState: function() { return this.$refs.scaffold.getState(); }, /** * Perform a local search on this contentvuer */ search: function(t) { return this.$refs.scaffold.search(t, !0); }, searchSuggestions: function(t, e) { if (t === "" || !this.$refs.scaffold) return e; this.$refs.scaffold.fetchSuggestions(t).forEach((i) => { i.suggestion && e.push(i.suggestion); }); }, /** * Handle sync pan zoom event */ handleSyncPanZoomEvent: function(t) { if (!this.mouseHovered && t.type !== this.entry.type) { const e = t.payload.origin, r = t.payload.size, i = [e[0] + r[0] / 2, e[1] + r[1] / 2], n = [ (i[0] - 0.5) * 2, (0.5 - i[1]) * 2 ], a = 1 / Math.max(r[0], r[1]); this.$refs.scaffold.$module.setSyncControlCenterZoom( n, a ); } }, displayTooltip: function(t) { let e; t && (e = t.name), e ? this.$refs.scaffold.search(e, !0) : this.$refs.scaffold.hideRegionTooltip(); }, zoomToFeatures: function(t, e) { let r; Array.isArray(t) ? r = t : r = [t.name], e && this.$refs.scaffold.changeActiveByName(r, "", !1), this.$refs.scaffold.viewRegion(r); }, highlightFeatures: function(t) { let e; Array.isArray(t) ? e = t : e = [t.name], this.$refs.scaffold.changeHighlightedByName(e, "", !1); }, scaffoldIsReady: function() { if (this.scaffoldLoaded = !0, this.$refs.scaffold.$module.graphicsHighlight.highlightColour = [1, 0, 1], this.isVisible()) { let t = "free"; this.entry.rotation && (t = this.entry.rotation), this.$refs.scaffold.toggleSyncControl(this.splitFlowStore.globalCallback, t), this.splitFlowStore.syncMode && this.$refs.scaffold.fitWindow(); } Ev.emit("mapLoaded", this.$refs.scaffold); }, requestSynchronisedEvent: function(t) { if (this.scaffoldLoaded) { let e = "free"; this.entry.rotation && (e = this.entry.rotation), this.$refs.scaffold.toggleSyncControl(t, e); } }, /** * Callback when the vuers emit a selected event. */ scaffoldHighlighted: function(t, e) { var i, n, a; const r = { paneIndex: this.entry.id, type: t, resource: e, internalName: void 0 }; e && e[0] && ((((i = e[0].data) == null ? void 0 : i.id) === void 0 || ((n = e[0].data) == null ? void 0 : n.id) === "") && (e[0].data.id = (a = e[0].data) == null ? void 0 : a.group), r.internalName = e[0].data.id, r.eventType = "highlighted"), this.$emit("resource-selected", r); }, /** * Callback when the vuers emit a selected event. */ scaffoldNavigated: function(t, e) { if (this.mouseHovered) { const r = { paneIndex: this.entry.id, eventType: "panZoom", payload: e, type: t }; this.$emit("resource-selected", r); } }, updateWithViewUrl: function(t) { this.$refs.scaffold.updateViewURL(t); }, /** * Change the view mode of the current scaffold */ changeViewingMode: function(t) { this.$refs.scaffold.changeViewingMode(t); } }, computed: { warningMessage: function() { return this.entry.isBodyScaffold ? "This map displays the anatomical location and connectivity of nerves, through which the neuron populations from the ApiNATOMY models available in SCKAN can be routed." : "Under active development"; }, markerLabels: function() { return this.settingsStore.numberOfDatasetsForFacets; } }, data: function() { return { apiLocation: process.env.VUE_APP_API_LOCATION, scaffoldCamera: void 0, scaffoldLoaded: !1 }; }, mounted: function() { this.scaffoldCamera = this.$refs.scaffold.$module.scene.getZincCameraControls(), Ev.on("startHelp", () => { this.startHelp(); }), Ev.on("hoverUpdate", () => { this.scaffoldLoaded && this.mapHoverHighlight(this.$refs.scaffold); }); } }, Lme = { class: "viewer-container" }; function kme(t, e, r, i, n, a) { const o = qt("ScaffoldVuer"), s = qt("HelpModeDialog"); return Q(), be("div", Lme, [ oe(o, { state: t.entry.state, url: t.entry.resource, region: t.entry.region, onScaffoldSelected: e[0] || (e[0] = (c) => t.resourceSelected(t.entry.type, c, !0)), onScaffoldHighlighted: e[1] || (e[1] = (c) => a.scaffoldHighlighted(t.entry.type, c)), onScaffoldNavigated: e[2] || (e[2] = (c) => a.scaffoldNavigated(t.entry.type, c)), onOnReady: a.scaffoldIsReady, onOpenMap: t.openMap, ref: "scaffold", "background-toggle": !0, traditional: !0, helpMode: t.helpMode, helpModeActiveItem: t.helpModeActiveItem, helpModeDialog: t.useHelpModeDialog, onAnnotationOpen: t.onAnnotationOpen, onAnnotationClose: t.onAnnotationClose, annotationSidebar: t.annotationSidebar, onHelpModeLastItem: t.onHelpModeLastItem, onShownTooltip: t.onTooltipShown, onShownMapTooltip: t.onMapTooltipShown, render: t.visible, "display-latest-message": !0, "warning-message": a.warningMessage, "display-minimap": !1, "display-markers": !1, enableOpenMapUI: !0, "view-u-r-l": t.entry.viewUrl, markerCluster: !0, markerLabels: a.markerLabels, flatmapAPI: t.flatmapAPI }, null, 8, ["state", "url", "region", "onOnReady", "onOpenMap", "helpMode", "helpModeActiveItem", "helpModeDialog", "onAnnotationOpen", "onAnnotationClose", "annotationSidebar", "onHelpModeLastItem", "onShownTooltip", "onShownMapTooltip", "render", "warning-message", "view-u-r-l", "markerLabels", "flatmapAPI"]), t.helpMode && t.useHelpModeDialog ? (Q(), Re(s, { key: 0, ref: "scaffoldHelp", scaffoldRef: t.scaffoldRef, lastItem: t.helpModeLastItem, onShowNext: t.onHelpModeShowNext, onFinishHelpMode: t.onFinishHelpMode }, null, 8, ["scaffoldRef", "lastItem", "onShowNext", "onFinishHelpMode"])) : Pe("", !0) ]); } const Bme = /* @__PURE__ */ wD(Ame, [["render", kme], ["__scopeId", "data-v-343030f1"]]); export { Bme as default };