import { hn, wn } from "./chunk-EEZUFMIV.js"; import { Comment, Fragment, Teleport, Text, Transition, cloneVNode, computed, createApp, createBaseVNode, createBlock, createCommentVNode, createElementBlock, createSlots, createStaticVNode, createTextVNode, createVNode, defineComponent, effectScope, getCurrentInstance, getCurrentScope, h, hasInjectionContext, inject, isReactive, isRef, isVNode, markRaw, mergeProps, nextTick, normalizeClass, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onDeactivated, onMounted, onScopeDispose, onUnmounted, onUpdated, openBlock, popScopeId, provide, pushScopeId, reactive, readonly, ref, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, shallowRef, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, unref, useAttrs, useSlots, vModelCheckbox, vModelText, vShow, warn, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "./chunk-6UGCK2MK.js"; import "./chunk-DC5AMYBS.js"; // node_modules/@abi-software/scaffoldvuer/node_modules/@abi-software/map-utilities/dist/map-utilities.js var v0 = Object.defineProperty; var h0 = (t13, e, r) => e in t13 ? v0(t13, e, { enumerable: true, configurable: true, writable: true, value: r }) : t13[e] = r; var Fr = (t13, e, r) => h0(t13, typeof e != "symbol" ? e + "" : e, r); var cn = (t13, e, { checkForDefaultPrevented: r = true } = {}) => (a) => { const i = t13 == null ? void 0 : t13(a); if (r === false || !i) return e == null ? void 0 : e(a); }; var Ic; var _t = typeof window < "u"; var I0 = (t13) => typeof t13 == "string"; var bv = () => { }; var Gl = _t && ((Ic = window == null ? void 0 : window.navigator) == null ? void 0 : Ic.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent); function wv(t13) { return typeof t13 == "function" ? t13() : unref(t13); } function A0(t13) { return t13; } function Rs(t13) { return getCurrentScope() ? (onScopeDispose(t13), true) : false; } function M0(t13, e = true) { getCurrentInstance() ? onMounted(t13) : e ? t13() : nextTick(t13); } function vn(t13) { var e; const r = wv(t13); return (e = r == null ? void 0 : r.$el) != null ? e : r; } var zs = _t ? window : void 0; function kr(...t13) { let e, r, n, a; if (I0(t13[0]) || Array.isArray(t13[0]) ? ([r, n, a] = t13, e = zs) : [e, r, n, a] = t13, !e) return bv; Array.isArray(r) || (r = [r]), Array.isArray(n) || (n = [n]); const i = [], o = () => { i.forEach((c) => c()), i.length = 0; }, s = (c, d, v, h6) => (c.addEventListener(d, v, h6), () => c.removeEventListener(d, v, h6)), u = watch(() => [vn(e), wv(a)], ([c, d]) => { o(), c && i.push(...r.flatMap((v) => n.map((h6) => s(c, v, h6, d)))); }, { immediate: true, flush: "post" }), l = () => { u(), o(); }; return Rs(l), l; } var Ac = false; function B0(t13, e, r = {}) { const { window: n = zs, ignore: a = [], capture: i = true, detectIframe: o = false } = r; if (!n) return; Gl && !Ac && (Ac = true, Array.from(n.document.body.children).forEach((v) => v.addEventListener("click", bv))); let s = true; const u = (v) => a.some((h6) => { if (typeof h6 == "string") return Array.from(n.document.querySelectorAll(h6)).some((f) => f === v.target || v.composedPath().includes(f)); { const f = vn(h6); return f && (v.target === f || v.composedPath().includes(f)); } }), c = [ kr(n, "click", (v) => { const h6 = vn(t13); if (!(!h6 || h6 === v.target || v.composedPath().includes(h6))) { if (v.detail === 0 && (s = !u(v)), !s) { s = true; return; } e(v); } }, { passive: true, capture: i }), kr(n, "pointerdown", (v) => { const h6 = vn(t13); h6 && (s = !v.composedPath().includes(h6) && !u(v)); }, { passive: true }), o && kr(n, "blur", (v) => { var h6; const f = vn(t13); ((h6 = n.document.activeElement) == null ? void 0 : h6.tagName) === "IFRAME" && !(f != null && f.contains(n.document.activeElement)) && e(v); }) ].filter(Boolean); return () => c.forEach((v) => v()); } function xv(t13, e = false) { const r = ref(), n = () => r.value = !!t13(); return n(), M0(n, e), r; } var Mc = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; var Bc = "__vueuse_ssr_handlers__"; Mc[Bc] = Mc[Bc] || {}; var Nc = Object.getOwnPropertySymbols; var N0 = Object.prototype.hasOwnProperty; var $0 = Object.prototype.propertyIsEnumerable; var R0 = (t13, e) => { var r = {}; for (var n in t13) N0.call(t13, n) && e.indexOf(n) < 0 && (r[n] = t13[n]); if (t13 != null && Nc) for (var n of Nc(t13)) e.indexOf(n) < 0 && $0.call(t13, n) && (r[n] = t13[n]); return r; }; function dn(t13, e, r = {}) { const n = r, { window: a = zs } = n, i = R0(n, ["window"]); let o; const s = xv(() => a && "ResizeObserver" in a), u = () => { o && (o.disconnect(), o = void 0); }, l = watch(() => vn(t13), (d) => { u(), s.value && a && d && (o = new ResizeObserver(e), o.observe(d, i)); }, { immediate: true, flush: "post" }), c = () => { u(), l(); }; return Rs(c), { isSupported: s, stop: c }; } var $c = Object.getOwnPropertySymbols; var z0 = Object.prototype.hasOwnProperty; var V0 = Object.prototype.propertyIsEnumerable; var H0 = (t13, e) => { var r = {}; for (var n in t13) z0.call(t13, n) && e.indexOf(n) < 0 && (r[n] = t13[n]); if (t13 != null && $c) for (var n of $c(t13)) e.indexOf(n) < 0 && V0.call(t13, n) && (r[n] = t13[n]); return r; }; function q0(t13, e, r = {}) { const n = r, { window: a = zs } = n, i = H0(n, ["window"]); let o; const s = xv(() => a && "MutationObserver" in a), u = () => { o && (o.disconnect(), o = void 0); }, l = watch(() => vn(t13), (d) => { u(), s.value && a && d && (o = new MutationObserver(e), o.observe(d, i)); }, { immediate: true }), c = () => { u(), l(); }; return Rs(c), { isSupported: s, stop: c }; } var Rc; (function(t13) { t13.UP = "UP", t13.RIGHT = "RIGHT", t13.DOWN = "DOWN", t13.LEFT = "LEFT", t13.NONE = "NONE"; })(Rc || (Rc = {})); var K0 = Object.defineProperty; var zc = Object.getOwnPropertySymbols; var U0 = Object.prototype.hasOwnProperty; var G0 = Object.prototype.propertyIsEnumerable; var Vc = (t13, e, r) => e in t13 ? K0(t13, e, { enumerable: true, configurable: true, writable: true, value: r }) : t13[e] = r; var W0 = (t13, e) => { for (var r in e || (e = {})) U0.call(e, r) && Vc(t13, r, e[r]); if (zc) for (var r of zc(e)) G0.call(e, r) && Vc(t13, r, e[r]); return t13; }; var Y0 = { 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] }; W0({ linear: A0 }, Y0); var Z0 = () => _t && /firefox/i.test(window.navigator.userAgent); var Su = (t13) => { let e, r; return t13.type === "touchend" ? (r = t13.changedTouches[0].clientY, e = t13.changedTouches[0].clientX) : t13.type.startsWith("touch") ? (r = t13.touches[0].clientY, e = t13.touches[0].clientX) : (r = t13.clientY, e = t13.clientX), { clientX: e, clientY: r }; }; Object.freeze({}); Object.freeze([]); var Wi = () => { }; var X0 = Object.prototype.hasOwnProperty; var va = (t13, e) => X0.call(t13, e); var fr = Array.isArray; var lr = (t13) => typeof t13 == "function"; var tr = (t13) => typeof t13 == "string"; var Ht = (t13) => t13 !== null && typeof t13 == "object"; var j0 = Object.prototype.toString; var Q0 = (t13) => j0.call(t13); var bl = (t13) => Q0(t13).slice(8, -1); var Cv = (t13) => { const e = /* @__PURE__ */ Object.create(null); return (r) => e[r] || (e[r] = t13(r)); }; var J0 = /-(\w)/g; var em = Cv((t13) => t13.replace(J0, (e, r) => r ? r.toUpperCase() : "")); var tm = /\B([A-Z])/g; var rm = Cv( (t13) => t13.replace(tm, "-$1").toLowerCase() ); var Ev = typeof global == "object" && global && global.Object === Object && global; var nm = typeof self == "object" && self && self.Object === Object && self; var nn = Ev || nm || Function("return this")(); var en = nn.Symbol; var kv = Object.prototype; var am = kv.hasOwnProperty; var im = kv.toString; var Si = en ? en.toStringTag : void 0; function om(t13) { var e = am.call(t13, Si), r = t13[Si]; try { t13[Si] = void 0; var n = true; } catch { } var a = im.call(t13); return n && (e ? t13[Si] = r : delete t13[Si]), a; } var sm = Object.prototype; var lm = sm.toString; function um(t13) { return lm.call(t13); } var cm = "[object Null]"; var dm = "[object Undefined]"; var Hc = en ? en.toStringTag : void 0; function ci(t13) { return t13 == null ? t13 === void 0 ? dm : cm : Hc && Hc in Object(t13) ? om(t13) : um(t13); } function ja(t13) { return t13 != null && typeof t13 == "object"; } var fm = "[object Symbol]"; function Vs(t13) { return typeof t13 == "symbol" || ja(t13) && ci(t13) == fm; } function vm(t13, e) { for (var r = -1, n = t13 == null ? 0 : t13.length, a = Array(n); ++r < n; ) a[r] = e(t13[r], r, t13); return a; } var Vr = Array.isArray; var hm = 1 / 0; var qc = en ? en.prototype : void 0; var Kc = qc ? qc.toString : void 0; function Sv(t13) { if (typeof t13 == "string") return t13; if (Vr(t13)) return vm(t13, Sv) + ""; if (Vs(t13)) return Kc ? Kc.call(t13) : ""; var e = t13 + ""; return e == "0" && 1 / t13 == -hm ? "-0" : e; } var pm = /\s/; function gm(t13) { for (var e = t13.length; e-- && pm.test(t13.charAt(e)); ) ; return e; } var mm = /^\s+/; function ym(t13) { return t13 && t13.slice(0, gm(t13) + 1).replace(mm, ""); } function Vn(t13) { var e = typeof t13; return t13 != null && (e == "object" || e == "function"); } var Uc = NaN; var bm = /^[-+]0x[0-9a-f]+$/i; var wm = /^0b[01]+$/i; var xm = /^0o[0-7]+$/i; var Cm = parseInt; function Gc(t13) { if (typeof t13 == "number") return t13; if (Vs(t13)) return Uc; if (Vn(t13)) { var e = typeof t13.valueOf == "function" ? t13.valueOf() : t13; t13 = Vn(e) ? e + "" : e; } if (typeof t13 != "string") return t13 === 0 ? t13 : +t13; t13 = ym(t13); var r = wm.test(t13); return r || xm.test(t13) ? Cm(t13.slice(2), r ? 2 : 8) : bm.test(t13) ? Uc : +t13; } function Tv(t13) { return t13; } var Em = "[object AsyncFunction]"; var km = "[object Function]"; var Sm = "[object GeneratorFunction]"; var Tm = "[object Proxy]"; function _v(t13) { if (!Vn(t13)) return false; var e = ci(t13); return e == km || e == Sm || e == Em || e == Tm; } var wl = nn["__core-js_shared__"]; var Wc = function() { var t13 = /[^.]+$/.exec(wl && wl.keys && wl.keys.IE_PROTO || ""); return t13 ? "Symbol(src)_1." + t13 : ""; }(); function _m(t13) { return !!Wc && Wc in t13; } var Dm = Function.prototype; var Pm = Dm.toString; function ka(t13) { if (t13 != null) { try { return Pm.call(t13); } catch { } try { return t13 + ""; } catch { } } return ""; } var Om = /[\\^$.*+?()[\]{}|]/g; var Lm = /^\[object .+?Constructor\]$/; var Fm = Function.prototype; var Im = Object.prototype; var Am = Fm.toString; var Mm = Im.hasOwnProperty; var Bm = RegExp( "^" + Am.call(Mm).replace(Om, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); function Nm(t13) { if (!Vn(t13) || _m(t13)) return false; var e = _v(t13) ? Bm : Lm; return e.test(ka(t13)); } function $m(t13, e) { return t13 == null ? void 0 : t13[e]; } function Sa(t13, e) { var r = $m(t13, e); return Nm(r) ? r : void 0; } var Wl = Sa(nn, "WeakMap"); function Rm(t13, e, r) { switch (r.length) { case 0: return t13.call(e); case 1: return t13.call(e, r[0]); case 2: return t13.call(e, r[0], r[1]); case 3: return t13.call(e, r[0], r[1], r[2]); } return t13.apply(e, r); } var zm = 800; var Vm = 16; var Hm = Date.now; function qm(t13) { var e = 0, r = 0; return function() { var n = Hm(), a = Vm - (n - r); if (r = n, a > 0) { if (++e >= zm) return arguments[0]; } else e = 0; return t13.apply(void 0, arguments); }; } function Km(t13) { return function() { return t13; }; } var ws = function() { try { var t13 = Sa(Object, "defineProperty"); return t13({}, "", {}), t13; } catch { } }(); var Um = ws ? function(t13, e) { return ws(t13, "toString", { configurable: true, enumerable: false, value: Km(e), writable: true }); } : Tv; var Gm = qm(Um); function Wm(t13, e, r, n) { t13.length; for (var a = r + 1; a--; ) if (e(t13[a], a, t13)) return a; return -1; } var Ym = 9007199254740991; var Zm = /^(?:0|[1-9]\d*)$/; function Tu(t13, e) { var r = typeof t13; return e = e ?? Ym, !!e && (r == "number" || r != "symbol" && Zm.test(t13)) && t13 > -1 && t13 % 1 == 0 && t13 < e; } function Xm(t13, e, r) { e == "__proto__" && ws ? ws(t13, e, { configurable: true, enumerable: true, value: r, writable: true }) : t13[e] = r; } function _u(t13, e) { return t13 === e || t13 !== t13 && e !== e; } var jm = Object.prototype; var Qm = jm.hasOwnProperty; function Jm(t13, e, r) { var n = t13[e]; (!(Qm.call(t13, e) && _u(n, r)) || r === void 0 && !(e in t13)) && Xm(t13, e, r); } var Yc = Math.max; function ey(t13, e, r) { return e = Yc(e === void 0 ? t13.length - 1 : e, 0), function() { for (var n = arguments, a = -1, i = Yc(n.length - e, 0), o = Array(i); ++a < i; ) o[a] = n[e + a]; a = -1; for (var s = Array(e + 1); ++a < e; ) s[a] = n[a]; return s[e] = r(o), Rm(t13, this, s); }; } var ty = 9007199254740991; function Du(t13) { return typeof t13 == "number" && t13 > -1 && t13 % 1 == 0 && t13 <= ty; } function ry(t13) { return t13 != null && Du(t13.length) && !_v(t13); } var ny = Object.prototype; function ay(t13) { var e = t13 && t13.constructor, r = typeof e == "function" && e.prototype || ny; return t13 === r; } function iy(t13, e) { for (var r = -1, n = Array(t13); ++r < t13; ) n[r] = e(r); return n; } var oy = "[object Arguments]"; function Zc(t13) { return ja(t13) && ci(t13) == oy; } var Dv = Object.prototype; var sy = Dv.hasOwnProperty; var ly = Dv.propertyIsEnumerable; var Pu = Zc(/* @__PURE__ */ function() { return arguments; }()) ? Zc : function(t13) { return ja(t13) && sy.call(t13, "callee") && !ly.call(t13, "callee"); }; function uy() { return false; } var Pv = typeof exports == "object" && exports && !exports.nodeType && exports; var Xc = Pv && typeof module == "object" && module && !module.nodeType && module; var cy = Xc && Xc.exports === Pv; var jc = cy ? nn.Buffer : void 0; var dy = jc ? jc.isBuffer : void 0; var Yl = dy || uy; var fy = "[object Arguments]"; var vy = "[object Array]"; var hy = "[object Boolean]"; var py = "[object Date]"; var gy = "[object Error]"; var my = "[object Function]"; var yy = "[object Map]"; var by = "[object Number]"; var wy = "[object Object]"; var xy = "[object RegExp]"; var Cy = "[object Set]"; var Ey = "[object String]"; var ky = "[object WeakMap]"; var Sy = "[object ArrayBuffer]"; var Ty = "[object DataView]"; var _y = "[object Float32Array]"; var Dy = "[object Float64Array]"; var Py = "[object Int8Array]"; var Oy = "[object Int16Array]"; var Ly = "[object Int32Array]"; var Fy = "[object Uint8Array]"; var Iy = "[object Uint8ClampedArray]"; var Ay = "[object Uint16Array]"; var My = "[object Uint32Array]"; var ft = {}; ft[_y] = ft[Dy] = ft[Py] = ft[Oy] = ft[Ly] = ft[Fy] = ft[Iy] = ft[Ay] = ft[My] = true; ft[fy] = ft[vy] = ft[Sy] = ft[hy] = ft[Ty] = ft[py] = ft[gy] = ft[my] = ft[yy] = ft[by] = ft[wy] = ft[xy] = ft[Cy] = ft[Ey] = ft[ky] = false; function By(t13) { return ja(t13) && Du(t13.length) && !!ft[ci(t13)]; } function Ny(t13) { return function(e) { return t13(e); }; } var Ov = typeof exports == "object" && exports && !exports.nodeType && exports; var zi = Ov && typeof module == "object" && module && !module.nodeType && module; var $y = zi && zi.exports === Ov; var xl = $y && Ev.process; var Qc = function() { try { var t13 = zi && zi.require && zi.require("util").types; return t13 || xl && xl.binding && xl.binding("util"); } catch { } }(); var Jc = Qc && Qc.isTypedArray; var Lv = Jc ? Ny(Jc) : By; var Ry = Object.prototype; var zy = Ry.hasOwnProperty; function Vy(t13, e) { var r = Vr(t13), n = !r && Pu(t13), a = !r && !n && Yl(t13), i = !r && !n && !a && Lv(t13), o = r || n || a || i, s = o ? iy(t13.length, String) : [], u = s.length; for (var l in t13) zy.call(t13, l) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode. (l == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. a && (l == "offset" || l == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. i && (l == "buffer" || l == "byteLength" || l == "byteOffset") || // Skip index properties. Tu(l, u))) && s.push(l); return s; } function Hy(t13, e) { return function(r) { return t13(e(r)); }; } var qy = Hy(Object.keys, Object); var Ky = Object.prototype; var Uy = Ky.hasOwnProperty; function Gy(t13) { if (!ay(t13)) return qy(t13); var e = []; for (var r in Object(t13)) Uy.call(t13, r) && r != "constructor" && e.push(r); return e; } function Fv(t13) { return ry(t13) ? Vy(t13) : Gy(t13); } var Wy = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/; var Yy = /^\w*$/; function Ou(t13, e) { if (Vr(t13)) return false; var r = typeof t13; return r == "number" || r == "symbol" || r == "boolean" || t13 == null || Vs(t13) ? true : Yy.test(t13) || !Wy.test(t13) || e != null && t13 in Object(e); } var Yi = Sa(Object, "create"); function Zy() { this.__data__ = Yi ? Yi(null) : {}, this.size = 0; } function Xy(t13) { var e = this.has(t13) && delete this.__data__[t13]; return this.size -= e ? 1 : 0, e; } var jy = "__lodash_hash_undefined__"; var Qy = Object.prototype; var Jy = Qy.hasOwnProperty; function e1(t13) { var e = this.__data__; if (Yi) { var r = e[t13]; return r === jy ? void 0 : r; } return Jy.call(e, t13) ? e[t13] : void 0; } var t1 = Object.prototype; var r1 = t1.hasOwnProperty; function n1(t13) { var e = this.__data__; return Yi ? e[t13] !== void 0 : r1.call(e, t13); } var a1 = "__lodash_hash_undefined__"; function i1(t13, e) { var r = this.__data__; return this.size += this.has(t13) ? 0 : 1, r[t13] = Yi && e === void 0 ? a1 : e, this; } function ha(t13) { var e = -1, r = t13 == null ? 0 : t13.length; for (this.clear(); ++e < r; ) { var n = t13[e]; this.set(n[0], n[1]); } } ha.prototype.clear = Zy; ha.prototype.delete = Xy; ha.prototype.get = e1; ha.prototype.has = n1; ha.prototype.set = i1; function o1() { this.__data__ = [], this.size = 0; } function Hs(t13, e) { for (var r = t13.length; r--; ) if (_u(t13[r][0], e)) return r; return -1; } var s1 = Array.prototype; var l1 = s1.splice; function u1(t13) { var e = this.__data__, r = Hs(e, t13); if (r < 0) return false; var n = e.length - 1; return r == n ? e.pop() : l1.call(e, r, 1), --this.size, true; } function c1(t13) { var e = this.__data__, r = Hs(e, t13); return r < 0 ? void 0 : e[r][1]; } function d1(t13) { return Hs(this.__data__, t13) > -1; } function f1(t13, e) { var r = this.__data__, n = Hs(r, t13); return n < 0 ? (++this.size, r.push([t13, e])) : r[n][1] = e, this; } function bn(t13) { var e = -1, r = t13 == null ? 0 : t13.length; for (this.clear(); ++e < r; ) { var n = t13[e]; this.set(n[0], n[1]); } } bn.prototype.clear = o1; bn.prototype.delete = u1; bn.prototype.get = c1; bn.prototype.has = d1; bn.prototype.set = f1; var Zi = Sa(nn, "Map"); function v1() { this.size = 0, this.__data__ = { hash: new ha(), map: new (Zi || bn)(), string: new ha() }; } function h1(t13) { var e = typeof t13; return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t13 !== "__proto__" : t13 === null; } function qs(t13, e) { var r = t13.__data__; return h1(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map; } function p1(t13) { var e = qs(this, t13).delete(t13); return this.size -= e ? 1 : 0, e; } function g1(t13) { return qs(this, t13).get(t13); } function m1(t13) { return qs(this, t13).has(t13); } function y1(t13, e) { var r = qs(this, t13), n = r.size; return r.set(t13, e), this.size += r.size == n ? 0 : 1, this; } function wn2(t13) { var e = -1, r = t13 == null ? 0 : t13.length; for (this.clear(); ++e < r; ) { var n = t13[e]; this.set(n[0], n[1]); } } wn2.prototype.clear = v1; wn2.prototype.delete = p1; wn2.prototype.get = g1; wn2.prototype.has = m1; wn2.prototype.set = y1; var b1 = "Expected a function"; function Lu(t13, e) { if (typeof t13 != "function" || e != null && typeof e != "function") throw new TypeError(b1); var r = function() { var n = arguments, a = e ? e.apply(this, n) : n[0], i = r.cache; if (i.has(a)) return i.get(a); var o = t13.apply(this, n); return r.cache = i.set(a, o) || i, o; }; return r.cache = new (Lu.Cache || wn2)(), r; } Lu.Cache = wn2; var w1 = 500; function x1(t13) { var e = Lu(t13, function(n) { return r.size === w1 && r.clear(), n; }), r = e.cache; return e; } var C1 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; var E1 = /\\(\\)?/g; var k1 = x1(function(t13) { var e = []; return t13.charCodeAt(0) === 46 && e.push(""), t13.replace(C1, function(r, n, a, i) { e.push(a ? i.replace(E1, "$1") : n || r); }), e; }); function S1(t13) { return t13 == null ? "" : Sv(t13); } function Ks(t13, e) { return Vr(t13) ? t13 : Ou(t13, e) ? [t13] : k1(S1(t13)); } var T1 = 1 / 0; function mo(t13) { if (typeof t13 == "string" || Vs(t13)) return t13; var e = t13 + ""; return e == "0" && 1 / t13 == -T1 ? "-0" : e; } function Fu(t13, e) { e = Ks(e, t13); for (var r = 0, n = e.length; t13 != null && r < n; ) t13 = t13[mo(e[r++])]; return r && r == n ? t13 : void 0; } function fn(t13, e, r) { var n = t13 == null ? void 0 : Fu(t13, e); return n === void 0 ? r : n; } function Iv(t13, e) { for (var r = -1, n = e.length, a = t13.length; ++r < n; ) t13[a + r] = e[r]; return t13; } var ed = en ? en.isConcatSpreadable : void 0; function _1(t13) { return Vr(t13) || Pu(t13) || !!(ed && t13 && t13[ed]); } function D1(t13, e, r, n, a) { var i = -1, o = t13.length; for (r || (r = _1), a || (a = []); ++i < o; ) { var s = t13[i]; r(s) ? Iv(a, s) : a[a.length] = s; } return a; } function P1(t13) { var e = t13 == null ? 0 : t13.length; return e ? D1(t13) : []; } function O1(t13) { return Gm(ey(t13, void 0, P1), t13 + ""); } function In() { if (!arguments.length) return []; var t13 = arguments[0]; return Vr(t13) ? t13 : [t13]; } function L1() { this.__data__ = new bn(), this.size = 0; } function F1(t13) { var e = this.__data__, r = e.delete(t13); return this.size = e.size, r; } function I1(t13) { return this.__data__.get(t13); } function A1(t13) { return this.__data__.has(t13); } var M1 = 200; function B1(t13, e) { var r = this.__data__; if (r instanceof bn) { var n = r.__data__; if (!Zi || n.length < M1 - 1) return n.push([t13, e]), this.size = ++r.size, this; r = this.__data__ = new wn2(n); } return r.set(t13, e), this.size = r.size, this; } function hn2(t13) { var e = this.__data__ = new bn(t13); this.size = e.size; } hn2.prototype.clear = L1; hn2.prototype.delete = F1; hn2.prototype.get = I1; hn2.prototype.has = A1; hn2.prototype.set = B1; function N1(t13, e) { for (var r = -1, n = t13 == null ? 0 : t13.length, a = 0, i = []; ++r < n; ) { var o = t13[r]; e(o, r, t13) && (i[a++] = o); } return i; } function $1() { return []; } var R1 = Object.prototype; var z1 = R1.propertyIsEnumerable; var td = Object.getOwnPropertySymbols; var V1 = td ? function(t13) { return t13 == null ? [] : (t13 = Object(t13), N1(td(t13), function(e) { return z1.call(t13, e); })); } : $1; function H1(t13, e, r) { var n = e(t13); return Vr(t13) ? n : Iv(n, r(t13)); } function rd(t13) { return H1(t13, Fv, V1); } var Zl = Sa(nn, "DataView"); var Xl = Sa(nn, "Promise"); var jl = Sa(nn, "Set"); var nd = "[object Map]"; var q1 = "[object Object]"; var ad = "[object Promise]"; var id = "[object Set]"; var od = "[object WeakMap]"; var sd = "[object DataView]"; var K1 = ka(Zl); var U1 = ka(Zi); var G1 = ka(Xl); var W1 = ka(jl); var Y1 = ka(Wl); var Fn = ci; (Zl && Fn(new Zl(new ArrayBuffer(1))) != sd || Zi && Fn(new Zi()) != nd || Xl && Fn(Xl.resolve()) != ad || jl && Fn(new jl()) != id || Wl && Fn(new Wl()) != od) && (Fn = function(t13) { var e = ci(t13), r = e == q1 ? t13.constructor : void 0, n = r ? ka(r) : ""; if (n) switch (n) { case K1: return sd; case U1: return nd; case G1: return ad; case W1: return id; case Y1: return od; } return e; }); var ld = nn.Uint8Array; var Z1 = "__lodash_hash_undefined__"; function X1(t13) { return this.__data__.set(t13, Z1), this; } function j1(t13) { return this.__data__.has(t13); } function xs(t13) { var e = -1, r = t13 == null ? 0 : t13.length; for (this.__data__ = new wn2(); ++e < r; ) this.add(t13[e]); } xs.prototype.add = xs.prototype.push = X1; xs.prototype.has = j1; function Q1(t13, e) { for (var r = -1, n = t13 == null ? 0 : t13.length; ++r < n; ) if (e(t13[r], r, t13)) return true; return false; } function J1(t13, e) { return t13.has(e); } var eb = 1; var tb = 2; function Av(t13, e, r, n, a, i) { var o = r & eb, s = t13.length, u = e.length; if (s != u && !(o && u > s)) return false; var l = i.get(t13), c = i.get(e); if (l && c) return l == e && c == t13; var d = -1, v = true, h6 = r & tb ? new xs() : void 0; for (i.set(t13, e), i.set(e, t13); ++d < s; ) { var f = t13[d], p = e[d]; if (n) var m = o ? n(p, f, d, e, t13, i) : n(f, p, d, t13, e, i); if (m !== void 0) { if (m) continue; v = false; break; } if (h6) { if (!Q1(e, function(g, y) { if (!J1(h6, y) && (f === g || a(f, g, r, n, i))) return h6.push(y); })) { v = false; break; } } else if (!(f === p || a(f, p, r, n, i))) { v = false; break; } } return i.delete(t13), i.delete(e), v; } function rb(t13) { var e = -1, r = Array(t13.size); return t13.forEach(function(n, a) { r[++e] = [a, n]; }), r; } function nb(t13) { var e = -1, r = Array(t13.size); return t13.forEach(function(n) { r[++e] = n; }), r; } var ab = 1; var ib = 2; var ob = "[object Boolean]"; var sb = "[object Date]"; var lb = "[object Error]"; var ub = "[object Map]"; var cb = "[object Number]"; var db = "[object RegExp]"; var fb = "[object Set]"; var vb = "[object String]"; var hb = "[object Symbol]"; var pb = "[object ArrayBuffer]"; var gb = "[object DataView]"; var ud = en ? en.prototype : void 0; var Cl = ud ? ud.valueOf : void 0; function mb(t13, e, r, n, a, i, o) { switch (r) { case gb: if (t13.byteLength != e.byteLength || t13.byteOffset != e.byteOffset) return false; t13 = t13.buffer, e = e.buffer; case pb: return !(t13.byteLength != e.byteLength || !i(new ld(t13), new ld(e))); case ob: case sb: case cb: return _u(+t13, +e); case lb: return t13.name == e.name && t13.message == e.message; case db: case vb: return t13 == e + ""; case ub: var s = rb; case fb: var u = n & ab; if (s || (s = nb), t13.size != e.size && !u) return false; var l = o.get(t13); if (l) return l == e; n |= ib, o.set(t13, e); var c = Av(s(t13), s(e), n, a, i, o); return o.delete(t13), c; case hb: if (Cl) return Cl.call(t13) == Cl.call(e); } return false; } var yb = 1; var bb = Object.prototype; var wb = bb.hasOwnProperty; function xb(t13, e, r, n, a, i) { var o = r & yb, s = rd(t13), u = s.length, l = rd(e), c = l.length; if (u != c && !o) return false; for (var d = u; d--; ) { var v = s[d]; if (!(o ? v in e : wb.call(e, v))) return false; } var h6 = i.get(t13), f = i.get(e); if (h6 && f) return h6 == e && f == t13; var p = true; i.set(t13, e), i.set(e, t13); for (var m = o; ++d < u; ) { v = s[d]; var g = t13[v], y = e[v]; if (n) var b = o ? n(y, g, v, e, t13, i) : n(g, y, v, t13, e, i); if (!(b === void 0 ? g === y || a(g, y, r, n, i) : b)) { p = false; break; } m || (m = v == "constructor"); } if (p && !m) { var w = t13.constructor, C = e.constructor; w != C && "constructor" in t13 && "constructor" in e && !(typeof w == "function" && w instanceof w && typeof C == "function" && C instanceof C) && (p = false); } return i.delete(t13), i.delete(e), p; } var Cb = 1; var cd = "[object Arguments]"; var dd = "[object Array]"; var No = "[object Object]"; var Eb = Object.prototype; var fd = Eb.hasOwnProperty; function kb(t13, e, r, n, a, i) { var o = Vr(t13), s = Vr(e), u = o ? dd : Fn(t13), l = s ? dd : Fn(e); u = u == cd ? No : u, l = l == cd ? No : l; var c = u == No, d = l == No, v = u == l; if (v && Yl(t13)) { if (!Yl(e)) return false; o = true, c = false; } if (v && !c) return i || (i = new hn2()), o || Lv(t13) ? Av(t13, e, r, n, a, i) : mb(t13, e, u, r, n, a, i); if (!(r & Cb)) { var h6 = c && fd.call(t13, "__wrapped__"), f = d && fd.call(e, "__wrapped__"); if (h6 || f) { var p = h6 ? t13.value() : t13, m = f ? e.value() : e; return i || (i = new hn2()), a(p, m, r, n, i); } } return v ? (i || (i = new hn2()), xb(t13, e, r, n, a, i)) : false; } function Us(t13, e, r, n, a) { return t13 === e ? true : t13 == null || e == null || !ja(t13) && !ja(e) ? t13 !== t13 && e !== e : kb(t13, e, r, n, Us, a); } var Sb = 1; var Tb = 2; function _b(t13, e, r, n) { var a = r.length, i = a; if (t13 == null) return !i; for (t13 = Object(t13); a--; ) { var o = r[a]; if (o[2] ? o[1] !== t13[o[0]] : !(o[0] in t13)) return false; } for (; ++a < i; ) { o = r[a]; var s = o[0], u = t13[s], l = o[1]; if (o[2]) { if (u === void 0 && !(s in t13)) return false; } else { var c = new hn2(), d; if (!(d === void 0 ? Us(l, u, Sb | Tb, n, c) : d)) return false; } } return true; } function Mv(t13) { return t13 === t13 && !Vn(t13); } function Db(t13) { for (var e = Fv(t13), r = e.length; r--; ) { var n = e[r], a = t13[n]; e[r] = [n, a, Mv(a)]; } return e; } function Bv(t13, e) { return function(r) { return r == null ? false : r[t13] === e && (e !== void 0 || t13 in Object(r)); }; } function Pb(t13) { var e = Db(t13); return e.length == 1 && e[0][2] ? Bv(e[0][0], e[0][1]) : function(r) { return r === t13 || _b(r, t13, e); }; } function Ob(t13, e) { return t13 != null && e in Object(t13); } function Lb(t13, e, r) { e = Ks(e, t13); for (var n = -1, a = e.length, i = false; ++n < a; ) { var o = mo(e[n]); if (!(i = t13 != null && r(t13, o))) break; t13 = t13[o]; } return i || ++n != a ? i : (a = t13 == null ? 0 : t13.length, !!a && Du(a) && Tu(o, a) && (Vr(t13) || Pu(t13))); } function Nv(t13, e) { return t13 != null && Lb(t13, e, Ob); } var Fb = 1; var Ib = 2; function Ab(t13, e) { return Ou(t13) && Mv(e) ? Bv(mo(t13), e) : function(r) { var n = fn(r, t13); return n === void 0 && n === e ? Nv(r, t13) : Us(e, n, Fb | Ib); }; } function Mb(t13) { return function(e) { return e == null ? void 0 : e[t13]; }; } function Bb(t13) { return function(e) { return Fu(e, t13); }; } function Nb(t13) { return Ou(t13) ? Mb(mo(t13)) : Bb(t13); } function $b(t13) { return typeof t13 == "function" ? t13 : t13 == null ? Tv : typeof t13 == "object" ? Vr(t13) ? Ab(t13[0], t13[1]) : Pb(t13) : Nb(t13); } var El = function() { return nn.Date.now(); }; var Rb = "Expected a function"; var zb = Math.max; var Vb = Math.min; function $v(t13, e, r) { var n, a, i, o, s, u, l = 0, c = false, d = false, v = true; if (typeof t13 != "function") throw new TypeError(Rb); e = Gc(e) || 0, Vn(r) && (c = !!r.leading, d = "maxWait" in r, i = d ? zb(Gc(r.maxWait) || 0, e) : i, v = "trailing" in r ? !!r.trailing : v); function h6(E) { var x = n, T = a; return n = a = void 0, l = E, o = t13.apply(T, x), o; } function f(E) { return l = E, s = setTimeout(g, e), c ? h6(E) : o; } function p(E) { var x = E - u, T = E - l, k = e - x; return d ? Vb(k, i - T) : k; } function m(E) { var x = E - u, T = E - l; return u === void 0 || x >= e || x < 0 || d && T >= i; } function g() { var E = El(); if (m(E)) return y(E); s = setTimeout(g, p(E)); } function y(E) { return s = void 0, v && n ? h6(E) : (n = a = void 0, o); } function b() { s !== void 0 && clearTimeout(s), l = 0, n = u = a = s = void 0; } function w() { return s === void 0 ? o : y(El()); } function C() { var E = El(), x = m(E); if (n = arguments, a = this, u = E, x) { if (s === void 0) return f(u); if (d) return clearTimeout(s), s = setTimeout(g, e), h6(u); } return s === void 0 && (s = setTimeout(g, e)), o; } return C.cancel = b, C.flush = w, C; } function Hb(t13, e, r) { var n = t13 == null ? 0 : t13.length; if (!n) return -1; var a = n - 1; return Wm(t13, $b(e), a); } function Cs(t13) { for (var e = -1, r = t13 == null ? 0 : t13.length, n = {}; ++e < r; ) { var a = t13[e]; n[a[0]] = a[1]; } return n; } function Es(t13, e) { return Us(t13, e); } function $n(t13) { return t13 == null; } function qb(t13) { return t13 === void 0; } function Kb(t13, e, r, n) { if (!Vn(t13)) return t13; e = Ks(e, t13); for (var a = -1, i = e.length, o = i - 1, s = t13; s != null && ++a < i; ) { var u = mo(e[a]), l = r; if (u === "__proto__" || u === "constructor" || u === "prototype") return t13; if (a != o) { var c = s[u]; l = void 0, l === void 0 && (l = Vn(c) ? c : Tu(e[a + 1]) ? [] : {}); } Jm(s, u, l), s = s[u]; } return t13; } function Ub(t13, e, r) { for (var n = -1, a = e.length, i = {}; ++n < a; ) { var o = e[n], s = Fu(t13, o); r(s, o) && Kb(i, Ks(o, t13), s); } return i; } function Gb(t13, e) { return Ub(t13, e, function(r, n) { return Nv(t13, n); }); } var Rv = O1(function(t13, e) { return t13 == null ? {} : Gb(t13, e); }); var Mn = (t13) => t13 === void 0; var Qa = (t13) => typeof t13 == "boolean"; var qt = (t13) => typeof t13 == "number"; var ua = (t13) => typeof Element > "u" ? false : t13 instanceof Element; var ks = (t13) => $n(t13); var Wb = (t13) => tr(t13) ? !Number.isNaN(Number(t13)) : false; var Yb = (t13 = "") => t13.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); var vd = (t13) => Object.keys(t13); var zv = class extends Error { constructor(e) { super(e), this.name = "ElementPlusError"; } }; function Zb(t13, e) { throw new zv(`[${t13}] ${e}`); } function Dt(t13, e) { if (true) { const r = tr(t13) ? new zv(`[${t13}] ${e}`) : t13; console.warn(r); } } var Xb = "utils/dom/style"; var Vv = (t13 = "") => t13.split(" ").filter((e) => !!e.trim()); var Ql = (t13, e) => { !t13 || !e.trim() || t13.classList.add(...Vv(e)); }; var ca = (t13, e) => { !t13 || !e.trim() || t13.classList.remove(...Vv(e)); }; var Ti = (t13, e) => { var r; if (!_t || !t13 || !e) return ""; let n = em(e); n === "float" && (n = "cssFloat"); try { const a = t13.style[n]; if (a) return a; const i = (r = document.defaultView) == null ? void 0 : r.getComputedStyle(t13, ""); return i ? i[n] : ""; } catch { return t13.style[n]; } }; function Ja(t13, e = "px") { if (!t13) return ""; if (qt(t13) || Wb(t13)) return `${t13}${e}`; if (tr(t13)) return t13; Dt(Xb, "binding value must be a string or number"); } function jb(t13, e) { if (!_t) return; if (!e) { t13.scrollTop = 0; return; } const r = []; let n = e.offsetParent; for (; n !== null && t13 !== n && t13.contains(n); ) r.push(n), n = n.offsetParent; const a = e.offsetTop + r.reduce((u, l) => u + l.offsetTop, 0), i = a + e.offsetHeight, o = t13.scrollTop, s = o + t13.clientHeight; a < o ? t13.scrollTop = a : i > s && (t13.scrollTop = i - t13.clientHeight); } var Qb = defineComponent({ name: "Aim", __name: "aim", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }), createBaseVNode("path", { fill: "currentColor", d: "M512 96a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V128a32 32 0 0 1 32-32m0 576a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V704a32 32 0 0 1 32-32M96 512a32 32 0 0 1 32-32h192a32 32 0 0 1 0 64H128a32 32 0 0 1-32-32m576 0a32 32 0 0 1 32-32h192a32 32 0 1 1 0 64H704a32 32 0 0 1-32-32" }) ])); } }); var Jb = Qb; var e2 = defineComponent({ name: "ArrowDown", __name: "arrow-down", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z" }) ])); } }); var Gs = e2; var t2 = defineComponent({ name: "ArrowUp", __name: "arrow-up", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0" }) ])); } }); var Hv = t2; var r2 = defineComponent({ name: "CaretRight", __name: "caret-right", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M384 192v640l384-320.064z" }) ])); } }); var n2 = r2; var a2 = defineComponent({ name: "CircleCheck", __name: "circle-check", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }), createBaseVNode("path", { fill: "currentColor", d: "M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z" }) ])); } }); var i2 = a2; var o2 = defineComponent({ name: "CircleClose", __name: "circle-close", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z" }), createBaseVNode("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }) ])); } }); var Iu = o2; var s2 = defineComponent({ name: "Close", __name: "close", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z" }) ])); } }); var Ss = s2; var l2 = defineComponent({ name: "CopyDocument", __name: "copy-document", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M768 832a128 128 0 0 1-128 128H192A128 128 0 0 1 64 832V384a128 128 0 0 1 128-128v64a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64z" }), createBaseVNode("path", { fill: "currentColor", d: "M384 128a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64zm0-64h448a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H384a128 128 0 0 1-128-128V192A128 128 0 0 1 384 64" }) ])); } }); var u2 = l2; var c2 = defineComponent({ name: "Delete", __name: "delete", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32" }) ])); } }); var d2 = c2; var f2 = defineComponent({ name: "Edit", __name: "edit", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z" }), createBaseVNode("path", { fill: "currentColor", d: "m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z" }) ])); } }); var v2 = f2; var h2 = defineComponent({ name: "Finished", __name: "finished", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M280.768 753.728 691.456 167.04a32 32 0 1 1 52.416 36.672L314.24 817.472a32 32 0 0 1-45.44 7.296l-230.4-172.8a32 32 0 0 1 38.4-51.2l203.968 152.96zM736 448a32 32 0 1 1 0-64h192a32 32 0 1 1 0 64zM608 640a32 32 0 0 1 0-64h319.936a32 32 0 1 1 0 64zM480 832a32 32 0 1 1 0-64h447.936a32 32 0 1 1 0 64z" }) ])); } }); var p2 = h2; var g2 = defineComponent({ name: "Hide", __name: "hide", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z" }), createBaseVNode("path", { fill: "currentColor", d: "M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z" }) ])); } }); var m2 = g2; var y2 = defineComponent({ name: "Loading", __name: "loading", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z" }) ])); } }); var Au = y2; var b2 = defineComponent({ name: "Lock", __name: "lock", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96" }), createBaseVNode("path", { fill: "currentColor", d: "M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m192-160v-64a192 192 0 1 0-384 0v64zM512 64a256 256 0 0 1 256 256v128H256V320A256 256 0 0 1 512 64" }) ])); } }); var w2 = b2; var x2 = defineComponent({ name: "Notebook", __name: "notebook", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M192 128v768h640V128zm-32-64h704a32 32 0 0 1 32 32v832a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32" }), createBaseVNode("path", { fill: "currentColor", d: "M672 128h64v768h-64zM96 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32m0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32m0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32m0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32" }) ])); } }); var C2 = x2; var E2 = defineComponent({ name: "Unlock", __name: "unlock", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96" }), createBaseVNode("path", { fill: "currentColor", d: "M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m178.304-295.296A192.064 192.064 0 0 0 320 320v64h352l96 38.4V448H256V320a256 256 0 0 1 493.76-95.104z" }) ])); } }); var k2 = E2; var S2 = defineComponent({ name: "View", __name: "view", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160" }) ])); } }); var T2 = S2; var _2 = defineComponent({ name: "Warning", __name: "warning", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m48-176a48 48 0 1 1-96 0 48 48 0 0 1 96 0m-48-464a32 32 0 0 1 32 32v288a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32" }) ])); } }); var D2 = _2; var P2 = defineComponent({ name: "ZoomIn", __name: "zoom-in", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z" }) ])); } }); var O2 = P2; var L2 = defineComponent({ name: "ZoomOut", __name: "zoom-out", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64" }) ])); } }); var F2 = L2; var qv = "__epPropKey"; var $e = (t13) => t13; var I2 = (t13) => Ht(t13) && !!t13[qv]; var Ws = (t13, e) => { if (!Ht(t13) || I2(t13)) return t13; const { values: r, required: n, default: a, type: i, validator: o } = t13, u = { type: i, required: !!n, validator: r || o ? (l) => { let c = false, d = []; if (r && (d = Array.from(r), va(t13, "default") && d.push(a), c || (c = d.includes(l))), o && (c || (c = o(l))), !c && d.length > 0) { const v = [...new Set(d)].map((h6) => JSON.stringify(h6)).join(", "); warn(`Invalid prop: validation failed${e ? ` for prop "${e}"` : ""}. Expected one of [${v}], got value ${JSON.stringify(l)}.`); } return c; } : void 0, [qv]: true }; return va(t13, "default") && (u.default = a), u; }; var rt = (t13) => Cs(Object.entries(t13).map(([e, r]) => [ e, Ws(r, e) ])); var Hn = $e([ String, Object, Function ]); var Kv = { validating: Au, success: i2, error: Iu }; var $t = (t13, e) => { if (t13.install = (r) => { for (const n of [t13, ...Object.values(e ?? {})]) r.component(n.name, n); }, e) for (const [r, n] of Object.entries(e)) t13[r] = n; return t13; }; var A2 = (t13, e) => (t13.install = (r) => { r.directive(e, t13); }, t13); var xn = (t13) => (t13.install = Wi, t13); var Lt = { tab: "Tab", enter: "Enter", space: "Space", left: "ArrowLeft", up: "ArrowUp", right: "ArrowRight", down: "ArrowDown", esc: "Escape", delete: "Delete", backspace: "Backspace", numpadEnter: "NumpadEnter", pageUp: "PageUp", pageDown: "PageDown", home: "Home", end: "End" }; var zt = "update:modelValue"; var Mu = "change"; var Uv = ["", "default", "small", "large"]; var M2 = (t13) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(t13); var Ra = (t13) => t13; var B2 = ["class", "style"]; var N2 = /^on[A-Z]/; var $2 = (t13 = {}) => { const { excludeListeners: e = false, excludeKeys: r } = t13, n = computed(() => ((r == null ? void 0 : r.value) || []).concat(B2)), a = getCurrentInstance(); return a ? computed(() => { var i; return Cs(Object.entries((i = a.proxy) == null ? void 0 : i.$attrs).filter(([o]) => !n.value.includes(o) && !(e && N2.test(o)))); }) : (Dt("use-attrs", "getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"), computed(() => ({}))); }; var as = ({ from: t13, replacement: e, scope: r, version: n, ref: a, type: i = "API" }, o) => { watch(() => unref(o), (s) => { s && Dt(r, `[${i}] ${t13} is about to be deprecated in version ${n}, please use ${e} instead. For more detail, please visit: ${a} `); }, { immediate: true }); }; var R2 = { name: "en", el: { breadcrumb: { label: "Breadcrumb" }, colorpicker: { confirm: "OK", clear: "Clear", defaultLabel: "color picker", description: "current color is {color}. press enter to select a new color.", alphaLabel: "pick alpha value" }, datepicker: { now: "Now", today: "Today", cancel: "Cancel", clear: "Clear", confirm: "OK", dateTablePrompt: "Use the arrow keys and enter to select the day of the month", monthTablePrompt: "Use the arrow keys and enter to select the month", yearTablePrompt: "Use the arrow keys and enter to select the year", selectedDate: "Selected date", selectDate: "Select date", selectTime: "Select time", startDate: "Start Date", startTime: "Start Time", endDate: "End Date", endTime: "End Time", prevYear: "Previous Year", nextYear: "Next Year", prevMonth: "Previous Month", nextMonth: "Next Month", year: "", month1: "January", month2: "February", month3: "March", month4: "April", month5: "May", month6: "June", month7: "July", month8: "August", month9: "September", month10: "October", month11: "November", month12: "December", week: "week", weeks: { sun: "Sun", mon: "Mon", tue: "Tue", wed: "Wed", thu: "Thu", fri: "Fri", sat: "Sat" }, weeksFull: { sun: "Sunday", mon: "Monday", tue: "Tuesday", wed: "Wednesday", thu: "Thursday", fri: "Friday", sat: "Saturday" }, months: { jan: "Jan", feb: "Feb", mar: "Mar", apr: "Apr", may: "May", jun: "Jun", jul: "Jul", aug: "Aug", sep: "Sep", oct: "Oct", nov: "Nov", dec: "Dec" } }, inputNumber: { decrease: "decrease number", increase: "increase number" }, select: { loading: "Loading", noMatch: "No matching data", noData: "No data", placeholder: "Select" }, mention: { loading: "Loading" }, dropdown: { toggleDropdown: "Toggle Dropdown" }, cascader: { noMatch: "No matching data", loading: "Loading", placeholder: "Select", noData: "No data" }, pagination: { goto: "Go to", pagesize: "/page", total: "Total {total}", pageClassifier: "", page: "Page", prev: "Go to previous page", next: "Go to next page", currentPage: "page {pager}", prevPages: "Previous {pager} pages", nextPages: "Next {pager} pages", deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details" }, dialog: { close: "Close this dialog" }, drawer: { close: "Close this dialog" }, messagebox: { title: "Message", confirm: "OK", cancel: "Cancel", error: "Illegal input", close: "Close this dialog" }, upload: { deleteTip: "press delete to remove", delete: "Delete", preview: "Preview", continue: "Continue" }, slider: { defaultLabel: "slider between {min} and {max}", defaultRangeStartLabel: "pick start value", defaultRangeEndLabel: "pick end value" }, table: { emptyText: "No Data", confirmFilter: "Confirm", resetFilter: "Reset", clearFilter: "All", sumText: "Sum" }, tour: { next: "Next", previous: "Previous", finish: "Finish" }, tree: { emptyText: "No Data" }, transfer: { noMatch: "No matching data", noData: "No data", titles: ["List 1", "List 2"], filterPlaceholder: "Enter keyword", noCheckedFormat: "{total} items", hasCheckedFormat: "{checked}/{total} checked" }, image: { error: "FAILED" }, pageHeader: { title: "Back" }, popconfirm: { confirmButtonText: "Yes", cancelButtonText: "No" }, carousel: { leftArrow: "Carousel arrow left", rightArrow: "Carousel arrow right", indicator: "Carousel switch to index {index}" } } }; var z2 = (t13) => (e, r) => V2(e, r, unref(t13)); var V2 = (t13, e, r) => fn(r, t13, t13).replace(/\{(\w+)\}/g, (n, a) => { var i; return `${(i = e == null ? void 0 : e[a]) != null ? i : `{${a}}`}`; }); var H2 = (t13) => { const e = computed(() => unref(t13).name), r = isRef(t13) ? t13 : ref(t13); return { lang: e, locale: r, t: z2(t13) }; }; var Gv = Symbol("localeContextKey"); var yo = (t13) => { const e = t13 || inject(Gv, ref()); return H2(computed(() => e.value || R2)); }; var is = "el"; var q2 = "is-"; var Qn = (t13, e, r, n, a) => { let i = `${t13}-${e}`; return r && (i += `-${r}`), n && (i += `__${n}`), a && (i += `--${a}`), i; }; var Wv = Symbol("namespaceContextKey"); var Bu = (t13) => { const e = t13 || (getCurrentInstance() ? inject(Wv, ref(is)) : ref(is)); return computed(() => unref(e) || is); }; var He = (t13, e) => { const r = Bu(e); return { namespace: r, b: (p = "") => Qn(r.value, t13, p, "", ""), e: (p) => p ? Qn(r.value, t13, "", p, "") : "", m: (p) => p ? Qn(r.value, t13, "", "", p) : "", be: (p, m) => p && m ? Qn(r.value, t13, p, m, "") : "", em: (p, m) => p && m ? Qn(r.value, t13, "", p, m) : "", bm: (p, m) => p && m ? Qn(r.value, t13, p, "", m) : "", bem: (p, m, g) => p && m && g ? Qn(r.value, t13, p, m, g) : "", is: (p, ...m) => { const g = m.length >= 1 ? m[0] : true; return p && g ? `${q2}${p}` : ""; }, cssVar: (p) => { const m = {}; for (const g in p) p[g] && (m[`--${r.value}-${g}`] = p[g]); return m; }, cssVarName: (p) => `--${r.value}-${p}`, cssVarBlock: (p) => { const m = {}; for (const g in p) p[g] && (m[`--${r.value}-${t13}-${g}`] = p[g]); return m; }, cssVarBlockName: (p) => `--${r.value}-${t13}-${p}` }; }; var K2 = Ws({ type: $e(Boolean), default: null }); var U2 = Ws({ type: $e(Function) }); var G2 = (t13) => { const e = `update:${t13}`, r = `onUpdate:${t13}`, n = [e], a = { [t13]: K2, [r]: U2 }; return { useModelToggle: ({ indicator: o, toggleReason: s, shouldHideWhenRouteChanges: u, shouldProceed: l, onShow: c, onHide: d }) => { const v = getCurrentInstance(), { emit: h6 } = v, f = v.props, p = computed(() => lr(f[r])), m = computed(() => f[t13] === null), g = (x) => { o.value !== true && (o.value = true, s && (s.value = x), lr(c) && c(x)); }, y = (x) => { o.value !== false && (o.value = false, s && (s.value = x), lr(d) && d(x)); }, b = (x) => { if (f.disabled === true || lr(l) && !l()) return; const T = p.value && _t; T && h6(e, true), (m.value || !T) && g(x); }, w = (x) => { if (f.disabled === true || !_t) return; const T = p.value && _t; T && h6(e, false), (m.value || !T) && y(x); }, C = (x) => { Qa(x) && (f.disabled && x ? p.value && h6(e, false) : o.value !== x && (x ? g() : y())); }, E = () => { o.value ? w() : b(); }; return watch(() => f[t13], C), u && v.appContext.config.globalProperties.$route !== void 0 && watch(() => ({ ...v.proxy.$route }), () => { u.value && o.value && w(); }), onMounted(() => { C(f[t13]); }), { hide: w, show: b, toggle: E, hasUpdateHandler: p }; }, useModelToggleProps: a, useModelToggleEmits: n }; }; var Yv = (t13) => { const e = getCurrentInstance(); return computed(() => { var r, n; return (n = (r = e == null ? void 0 : e.proxy) == null ? void 0 : r.$props) == null ? void 0 : n[t13]; }); }; var vr = "top"; var _r = "bottom"; var Dr = "right"; var hr = "left"; var Nu = "auto"; var bo = [vr, _r, Dr, hr]; var ei = "start"; var Xi = "end"; var W2 = "clippingParents"; var Zv = "viewport"; var _i = "popper"; var Y2 = "reference"; var hd = bo.reduce(function(t13, e) { return t13.concat([e + "-" + ei, e + "-" + Xi]); }, []); var Ys = [].concat(bo, [Nu]).reduce(function(t13, e) { return t13.concat([e, e + "-" + ei, e + "-" + Xi]); }, []); var Z2 = "beforeRead"; var X2 = "read"; var j2 = "afterRead"; var Q2 = "beforeMain"; var J2 = "main"; var ew = "afterMain"; var tw = "beforeWrite"; var rw = "write"; var nw = "afterWrite"; var aw = [Z2, X2, j2, Q2, J2, ew, tw, rw, nw]; function tn(t13) { return t13 ? (t13.nodeName || "").toLowerCase() : null; } function Kr(t13) { if (t13 == null) return window; if (t13.toString() !== "[object Window]") { var e = t13.ownerDocument; return e && e.defaultView || window; } return t13; } function ti(t13) { var e = Kr(t13).Element; return t13 instanceof e || t13 instanceof Element; } function Tr(t13) { var e = Kr(t13).HTMLElement; return t13 instanceof e || t13 instanceof HTMLElement; } function $u(t13) { if (typeof ShadowRoot > "u") return false; var e = Kr(t13).ShadowRoot; return t13 instanceof e || t13 instanceof ShadowRoot; } function iw(t13) { var e = t13.state; Object.keys(e.elements).forEach(function(r) { var n = e.styles[r] || {}, a = e.attributes[r] || {}, i = e.elements[r]; !Tr(i) || !tn(i) || (Object.assign(i.style, n), Object.keys(a).forEach(function(o) { var s = a[o]; s === false ? i.removeAttribute(o) : i.setAttribute(o, s === true ? "" : s); })); }); } function ow(t13) { var e = t13.state, r = { popper: { position: e.options.strategy, left: "0", top: "0", margin: "0" }, arrow: { position: "absolute" }, reference: {} }; return Object.assign(e.elements.popper.style, r.popper), e.styles = r, e.elements.arrow && Object.assign(e.elements.arrow.style, r.arrow), function() { Object.keys(e.elements).forEach(function(n) { var a = e.elements[n], i = e.attributes[n] || {}, o = Object.keys(e.styles.hasOwnProperty(n) ? e.styles[n] : r[n]), s = o.reduce(function(u, l) { return u[l] = "", u; }, {}); !Tr(a) || !tn(a) || (Object.assign(a.style, s), Object.keys(i).forEach(function(u) { a.removeAttribute(u); })); }); }; } var Xv = { name: "applyStyles", enabled: true, phase: "write", fn: iw, effect: ow, requires: ["computeStyles"] }; function Qr(t13) { return t13.split("-")[0]; } var da = Math.max; var Ts = Math.min; var ri = Math.round; function ni(t13, e) { e === void 0 && (e = false); var r = t13.getBoundingClientRect(), n = 1, a = 1; if (Tr(t13) && e) { var i = t13.offsetHeight, o = t13.offsetWidth; o > 0 && (n = ri(r.width) / o || 1), i > 0 && (a = ri(r.height) / i || 1); } return { width: r.width / n, height: r.height / a, top: r.top / a, right: r.right / n, bottom: r.bottom / a, left: r.left / n, x: r.left / n, y: r.top / a }; } function Ru(t13) { var e = ni(t13), r = t13.offsetWidth, n = t13.offsetHeight; return Math.abs(e.width - r) <= 1 && (r = e.width), Math.abs(e.height - n) <= 1 && (n = e.height), { x: t13.offsetLeft, y: t13.offsetTop, width: r, height: n }; } function jv(t13, e) { var r = e.getRootNode && e.getRootNode(); if (t13.contains(e)) return true; if (r && $u(r)) { var n = e; do { if (n && t13.isSameNode(n)) return true; n = n.parentNode || n.host; } while (n); } return false; } function pn(t13) { return Kr(t13).getComputedStyle(t13); } function sw(t13) { return ["table", "td", "th"].indexOf(tn(t13)) >= 0; } function Yn(t13) { return ((ti(t13) ? t13.ownerDocument : t13.document) || window.document).documentElement; } function Zs(t13) { return tn(t13) === "html" ? t13 : t13.assignedSlot || t13.parentNode || ($u(t13) ? t13.host : null) || Yn(t13); } function pd(t13) { return !Tr(t13) || pn(t13).position === "fixed" ? null : t13.offsetParent; } function lw(t13) { var e = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1, r = navigator.userAgent.indexOf("Trident") !== -1; if (r && Tr(t13)) { var n = pn(t13); if (n.position === "fixed") return null; } var a = Zs(t13); for ($u(a) && (a = a.host); Tr(a) && ["html", "body"].indexOf(tn(a)) < 0; ) { var i = pn(a); if (i.transform !== "none" || i.perspective !== "none" || i.contain === "paint" || ["transform", "perspective"].indexOf(i.willChange) !== -1 || e && i.willChange === "filter" || e && i.filter && i.filter !== "none") return a; a = a.parentNode; } return null; } function wo(t13) { for (var e = Kr(t13), r = pd(t13); r && sw(r) && pn(r).position === "static"; ) r = pd(r); return r && (tn(r) === "html" || tn(r) === "body" && pn(r).position === "static") ? e : r || lw(t13) || e; } function zu(t13) { return ["top", "bottom"].indexOf(t13) >= 0 ? "x" : "y"; } function Vi(t13, e, r) { return da(t13, Ts(e, r)); } function uw(t13, e, r) { var n = Vi(t13, e, r); return n > r ? r : n; } function Qv() { return { top: 0, right: 0, bottom: 0, left: 0 }; } function Jv(t13) { return Object.assign({}, Qv(), t13); } function eh(t13, e) { return e.reduce(function(r, n) { return r[n] = t13, r; }, {}); } var cw = function(t13, e) { return t13 = typeof t13 == "function" ? t13(Object.assign({}, e.rects, { placement: e.placement })) : t13, Jv(typeof t13 != "number" ? t13 : eh(t13, bo)); }; function dw(t13) { var e, r = t13.state, n = t13.name, a = t13.options, i = r.elements.arrow, o = r.modifiersData.popperOffsets, s = Qr(r.placement), u = zu(s), l = [hr, Dr].indexOf(s) >= 0, c = l ? "height" : "width"; if (!(!i || !o)) { var d = cw(a.padding, r), v = Ru(i), h6 = u === "y" ? vr : hr, f = u === "y" ? _r : Dr, p = r.rects.reference[c] + r.rects.reference[u] - o[u] - r.rects.popper[c], m = o[u] - r.rects.reference[u], g = wo(i), y = g ? u === "y" ? g.clientHeight || 0 : g.clientWidth || 0 : 0, b = p / 2 - m / 2, w = d[h6], C = y - v[c] - d[f], E = y / 2 - v[c] / 2 + b, x = Vi(w, E, C), T = u; r.modifiersData[n] = (e = {}, e[T] = x, e.centerOffset = x - E, e); } } function fw(t13) { var e = t13.state, r = t13.options, n = r.element, a = n === void 0 ? "[data-popper-arrow]" : n; a != null && (typeof a == "string" && (a = e.elements.popper.querySelector(a), !a) || !jv(e.elements.popper, a) || (e.elements.arrow = a)); } var vw = { name: "arrow", enabled: true, phase: "main", fn: dw, effect: fw, requires: ["popperOffsets"], requiresIfExists: ["preventOverflow"] }; function ai(t13) { return t13.split("-")[1]; } var hw = { top: "auto", right: "auto", bottom: "auto", left: "auto" }; function pw(t13) { var e = t13.x, r = t13.y, n = window, a = n.devicePixelRatio || 1; return { x: ri(e * a) / a || 0, y: ri(r * a) / a || 0 }; } function gd(t13) { var e, r = t13.popper, n = t13.popperRect, a = t13.placement, i = t13.variation, o = t13.offsets, s = t13.position, u = t13.gpuAcceleration, l = t13.adaptive, c = t13.roundOffsets, d = t13.isFixed, v = o.x, h6 = v === void 0 ? 0 : v, f = o.y, p = f === void 0 ? 0 : f, m = typeof c == "function" ? c({ x: h6, y: p }) : { x: h6, y: p }; h6 = m.x, p = m.y; var g = o.hasOwnProperty("x"), y = o.hasOwnProperty("y"), b = hr, w = vr, C = window; if (l) { var E = wo(r), x = "clientHeight", T = "clientWidth"; if (E === Kr(r) && (E = Yn(r), pn(E).position !== "static" && s === "absolute" && (x = "scrollHeight", T = "scrollWidth")), E = E, a === vr || (a === hr || a === Dr) && i === Xi) { w = _r; var k = d && E === C && C.visualViewport ? C.visualViewport.height : E[x]; p -= k - n.height, p *= u ? 1 : -1; } if (a === hr || (a === vr || a === _r) && i === Xi) { b = Dr; var _ = d && E === C && C.visualViewport ? C.visualViewport.width : E[T]; h6 -= _ - n.width, h6 *= u ? 1 : -1; } } var D = Object.assign({ position: s }, l && hw), O = c === true ? pw({ x: h6, y: p }) : { x: h6, y: p }; if (h6 = O.x, p = O.y, u) { var I; return Object.assign({}, D, (I = {}, I[w] = y ? "0" : "", I[b] = g ? "0" : "", I.transform = (C.devicePixelRatio || 1) <= 1 ? "translate(" + h6 + "px, " + p + "px)" : "translate3d(" + h6 + "px, " + p + "px, 0)", I)); } return Object.assign({}, D, (e = {}, e[w] = y ? p + "px" : "", e[b] = g ? h6 + "px" : "", e.transform = "", e)); } function gw(t13) { var e = t13.state, r = t13.options, n = r.gpuAcceleration, a = n === void 0 ? true : n, i = r.adaptive, o = i === void 0 ? true : i, s = r.roundOffsets, u = s === void 0 ? true : s, l = { placement: Qr(e.placement), variation: ai(e.placement), popper: e.elements.popper, popperRect: e.rects.popper, gpuAcceleration: a, isFixed: e.options.strategy === "fixed" }; e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, gd(Object.assign({}, l, { offsets: e.modifiersData.popperOffsets, position: e.options.strategy, adaptive: o, roundOffsets: u })))), e.modifiersData.arrow != null && (e.styles.arrow = Object.assign({}, e.styles.arrow, gd(Object.assign({}, l, { offsets: e.modifiersData.arrow, position: "absolute", adaptive: false, roundOffsets: u })))), e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-placement": e.placement }); } var th = { name: "computeStyles", enabled: true, phase: "beforeWrite", fn: gw, data: {} }; var $o = { passive: true }; function mw(t13) { var e = t13.state, r = t13.instance, n = t13.options, a = n.scroll, i = a === void 0 ? true : a, o = n.resize, s = o === void 0 ? true : o, u = Kr(e.elements.popper), l = [].concat(e.scrollParents.reference, e.scrollParents.popper); return i && l.forEach(function(c) { c.addEventListener("scroll", r.update, $o); }), s && u.addEventListener("resize", r.update, $o), function() { i && l.forEach(function(c) { c.removeEventListener("scroll", r.update, $o); }), s && u.removeEventListener("resize", r.update, $o); }; } var rh = { name: "eventListeners", enabled: true, phase: "write", fn: function() { }, effect: mw, data: {} }; var yw = { left: "right", right: "left", bottom: "top", top: "bottom" }; function os(t13) { return t13.replace(/left|right|bottom|top/g, function(e) { return yw[e]; }); } var bw = { start: "end", end: "start" }; function md(t13) { return t13.replace(/start|end/g, function(e) { return bw[e]; }); } function Vu(t13) { var e = Kr(t13), r = e.pageXOffset, n = e.pageYOffset; return { scrollLeft: r, scrollTop: n }; } function Hu(t13) { return ni(Yn(t13)).left + Vu(t13).scrollLeft; } function ww(t13) { var e = Kr(t13), r = Yn(t13), n = e.visualViewport, a = r.clientWidth, i = r.clientHeight, o = 0, s = 0; return n && (a = n.width, i = n.height, /^((?!chrome|android).)*safari/i.test(navigator.userAgent) || (o = n.offsetLeft, s = n.offsetTop)), { width: a, height: i, x: o + Hu(t13), y: s }; } function xw(t13) { var e, r = Yn(t13), n = Vu(t13), a = (e = t13.ownerDocument) == null ? void 0 : e.body, i = da(r.scrollWidth, r.clientWidth, a ? a.scrollWidth : 0, a ? a.clientWidth : 0), o = da(r.scrollHeight, r.clientHeight, a ? a.scrollHeight : 0, a ? a.clientHeight : 0), s = -n.scrollLeft + Hu(t13), u = -n.scrollTop; return pn(a || r).direction === "rtl" && (s += da(r.clientWidth, a ? a.clientWidth : 0) - i), { width: i, height: o, x: s, y: u }; } function qu(t13) { var e = pn(t13), r = e.overflow, n = e.overflowX, a = e.overflowY; return /auto|scroll|overlay|hidden/.test(r + a + n); } function nh(t13) { return ["html", "body", "#document"].indexOf(tn(t13)) >= 0 ? t13.ownerDocument.body : Tr(t13) && qu(t13) ? t13 : nh(Zs(t13)); } function Hi(t13, e) { var r; e === void 0 && (e = []); var n = nh(t13), a = n === ((r = t13.ownerDocument) == null ? void 0 : r.body), i = Kr(n), o = a ? [i].concat(i.visualViewport || [], qu(n) ? n : []) : n, s = e.concat(o); return a ? s : s.concat(Hi(Zs(o))); } function Jl(t13) { return Object.assign({}, t13, { left: t13.x, top: t13.y, right: t13.x + t13.width, bottom: t13.y + t13.height }); } function Cw(t13) { var e = ni(t13); return e.top = e.top + t13.clientTop, e.left = e.left + t13.clientLeft, e.bottom = e.top + t13.clientHeight, e.right = e.left + t13.clientWidth, e.width = t13.clientWidth, e.height = t13.clientHeight, e.x = e.left, e.y = e.top, e; } function yd(t13, e) { return e === Zv ? Jl(ww(t13)) : ti(e) ? Cw(e) : Jl(xw(Yn(t13))); } function Ew(t13) { var e = Hi(Zs(t13)), r = ["absolute", "fixed"].indexOf(pn(t13).position) >= 0, n = r && Tr(t13) ? wo(t13) : t13; return ti(n) ? e.filter(function(a) { return ti(a) && jv(a, n) && tn(a) !== "body"; }) : []; } function kw(t13, e, r) { var n = e === "clippingParents" ? Ew(t13) : [].concat(e), a = [].concat(n, [r]), i = a[0], o = a.reduce(function(s, u) { var l = yd(t13, u); return s.top = da(l.top, s.top), s.right = Ts(l.right, s.right), s.bottom = Ts(l.bottom, s.bottom), s.left = da(l.left, s.left), s; }, yd(t13, i)); return o.width = o.right - o.left, o.height = o.bottom - o.top, o.x = o.left, o.y = o.top, o; } function ah(t13) { var e = t13.reference, r = t13.element, n = t13.placement, a = n ? Qr(n) : null, i = n ? ai(n) : null, o = e.x + e.width / 2 - r.width / 2, s = e.y + e.height / 2 - r.height / 2, u; switch (a) { case vr: u = { x: o, y: e.y - r.height }; break; case _r: u = { x: o, y: e.y + e.height }; break; case Dr: u = { x: e.x + e.width, y: s }; break; case hr: u = { x: e.x - r.width, y: s }; break; default: u = { x: e.x, y: e.y }; } var l = a ? zu(a) : null; if (l != null) { var c = l === "y" ? "height" : "width"; switch (i) { case ei: u[l] = u[l] - (e[c] / 2 - r[c] / 2); break; case Xi: u[l] = u[l] + (e[c] / 2 - r[c] / 2); break; } } return u; } function ji(t13, e) { e === void 0 && (e = {}); var r = e, n = r.placement, a = n === void 0 ? t13.placement : n, i = r.boundary, o = i === void 0 ? W2 : i, s = r.rootBoundary, u = s === void 0 ? Zv : s, l = r.elementContext, c = l === void 0 ? _i : l, d = r.altBoundary, v = d === void 0 ? false : d, h6 = r.padding, f = h6 === void 0 ? 0 : h6, p = Jv(typeof f != "number" ? f : eh(f, bo)), m = c === _i ? Y2 : _i, g = t13.rects.popper, y = t13.elements[v ? m : c], b = kw(ti(y) ? y : y.contextElement || Yn(t13.elements.popper), o, u), w = ni(t13.elements.reference), C = ah({ reference: w, element: g, strategy: "absolute", placement: a }), E = Jl(Object.assign({}, g, C)), x = c === _i ? E : w, T = { top: b.top - x.top + p.top, bottom: x.bottom - b.bottom + p.bottom, left: b.left - x.left + p.left, right: x.right - b.right + p.right }, k = t13.modifiersData.offset; if (c === _i && k) { var _ = k[a]; Object.keys(T).forEach(function(D) { var O = [Dr, _r].indexOf(D) >= 0 ? 1 : -1, I = [vr, _r].indexOf(D) >= 0 ? "y" : "x"; T[D] += _[I] * O; }); } return T; } function Sw(t13, e) { e === void 0 && (e = {}); var r = e, n = r.placement, a = r.boundary, i = r.rootBoundary, o = r.padding, s = r.flipVariations, u = r.allowedAutoPlacements, l = u === void 0 ? Ys : u, c = ai(n), d = c ? s ? hd : hd.filter(function(f) { return ai(f) === c; }) : bo, v = d.filter(function(f) { return l.indexOf(f) >= 0; }); v.length === 0 && (v = d); var h6 = v.reduce(function(f, p) { return f[p] = ji(t13, { placement: p, boundary: a, rootBoundary: i, padding: o })[Qr(p)], f; }, {}); return Object.keys(h6).sort(function(f, p) { return h6[f] - h6[p]; }); } function Tw(t13) { if (Qr(t13) === Nu) return []; var e = os(t13); return [md(t13), e, md(e)]; } function _w(t13) { var e = t13.state, r = t13.options, n = t13.name; if (!e.modifiersData[n]._skip) { for (var a = r.mainAxis, i = a === void 0 ? true : a, o = r.altAxis, s = o === void 0 ? true : o, u = r.fallbackPlacements, l = r.padding, c = r.boundary, d = r.rootBoundary, v = r.altBoundary, h6 = r.flipVariations, f = h6 === void 0 ? true : h6, p = r.allowedAutoPlacements, m = e.options.placement, g = Qr(m), y = g === m, b = u || (y || !f ? [os(m)] : Tw(m)), w = [m].concat(b).reduce(function(se, oe) { return se.concat(Qr(oe) === Nu ? Sw(e, { placement: oe, boundary: c, rootBoundary: d, padding: l, flipVariations: f, allowedAutoPlacements: p }) : oe); }, []), C = e.rects.reference, E = e.rects.popper, x = /* @__PURE__ */ new Map(), T = true, k = w[0], _ = 0; _ < w.length; _++) { var D = w[_], O = Qr(D), I = ai(D) === ei, L = [vr, _r].indexOf(O) >= 0, B = L ? "width" : "height", F = ji(e, { placement: D, boundary: c, rootBoundary: d, altBoundary: v, padding: l }), M = L ? I ? Dr : hr : I ? _r : vr; C[B] > E[B] && (M = os(M)); var A = os(M), R = []; if (i && R.push(F[O] <= 0), s && R.push(F[M] <= 0, F[A] <= 0), R.every(function(se) { return se; })) { k = D, T = false; break; } x.set(D, R); } if (T) for (var K = f ? 3 : 1, H = function(se) { var oe = w.find(function(ae) { var ue = x.get(ae); if (ue) return ue.slice(0, se).every(function(te) { return te; }); }); if (oe) return k = oe, "break"; }, q = K; q > 0; q--) { var ee = H(q); if (ee === "break") break; } e.placement !== k && (e.modifiersData[n]._skip = true, e.placement = k, e.reset = true); } } var Dw = { name: "flip", enabled: true, phase: "main", fn: _w, requiresIfExists: ["offset"], data: { _skip: false } }; function bd(t13, e, r) { return r === void 0 && (r = { x: 0, y: 0 }), { top: t13.top - e.height - r.y, right: t13.right - e.width + r.x, bottom: t13.bottom - e.height + r.y, left: t13.left - e.width - r.x }; } function wd(t13) { return [vr, Dr, _r, hr].some(function(e) { return t13[e] >= 0; }); } function Pw(t13) { var e = t13.state, r = t13.name, n = e.rects.reference, a = e.rects.popper, i = e.modifiersData.preventOverflow, o = ji(e, { elementContext: "reference" }), s = ji(e, { altBoundary: true }), u = bd(o, n), l = bd(s, a, i), c = wd(u), d = wd(l); e.modifiersData[r] = { referenceClippingOffsets: u, popperEscapeOffsets: l, isReferenceHidden: c, hasPopperEscaped: d }, e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-reference-hidden": c, "data-popper-escaped": d }); } var Ow = { name: "hide", enabled: true, phase: "main", requiresIfExists: ["preventOverflow"], fn: Pw }; function Lw(t13, e, r) { var n = Qr(t13), a = [hr, vr].indexOf(n) >= 0 ? -1 : 1, i = typeof r == "function" ? r(Object.assign({}, e, { placement: t13 })) : r, o = i[0], s = i[1]; return o = o || 0, s = (s || 0) * a, [hr, Dr].indexOf(n) >= 0 ? { x: s, y: o } : { x: o, y: s }; } function Fw(t13) { var e = t13.state, r = t13.options, n = t13.name, a = r.offset, i = a === void 0 ? [0, 0] : a, o = Ys.reduce(function(c, d) { return c[d] = Lw(d, e.rects, i), c; }, {}), s = o[e.placement], u = s.x, l = s.y; e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += u, e.modifiersData.popperOffsets.y += l), e.modifiersData[n] = o; } var Iw = { name: "offset", enabled: true, phase: "main", requires: ["popperOffsets"], fn: Fw }; function Aw(t13) { var e = t13.state, r = t13.name; e.modifiersData[r] = ah({ reference: e.rects.reference, element: e.rects.popper, strategy: "absolute", placement: e.placement }); } var ih = { name: "popperOffsets", enabled: true, phase: "read", fn: Aw, data: {} }; function Mw(t13) { return t13 === "x" ? "y" : "x"; } function Bw(t13) { var e = t13.state, r = t13.options, n = t13.name, a = r.mainAxis, i = a === void 0 ? true : a, o = r.altAxis, s = o === void 0 ? false : o, u = r.boundary, l = r.rootBoundary, c = r.altBoundary, d = r.padding, v = r.tether, h6 = v === void 0 ? true : v, f = r.tetherOffset, p = f === void 0 ? 0 : f, m = ji(e, { boundary: u, rootBoundary: l, padding: d, altBoundary: c }), g = Qr(e.placement), y = ai(e.placement), b = !y, w = zu(g), C = Mw(w), E = e.modifiersData.popperOffsets, x = e.rects.reference, T = e.rects.popper, k = typeof p == "function" ? p(Object.assign({}, e.rects, { placement: e.placement })) : p, _ = typeof k == "number" ? { mainAxis: k, altAxis: k } : Object.assign({ mainAxis: 0, altAxis: 0 }, k), D = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, O = { x: 0, y: 0 }; if (E) { if (i) { var I, L = w === "y" ? vr : hr, B = w === "y" ? _r : Dr, F = w === "y" ? "height" : "width", M = E[w], A = M + m[L], R = M - m[B], K = h6 ? -T[F] / 2 : 0, H = y === ei ? x[F] : T[F], q = y === ei ? -T[F] : -x[F], ee = e.elements.arrow, se = h6 && ee ? Ru(ee) : { width: 0, height: 0 }, oe = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : Qv(), ae = oe[L], ue = oe[B], te = Vi(0, x[F], se[F]), $ = b ? x[F] / 2 - K - te - ae - _.mainAxis : H - te - ae - _.mainAxis, G = b ? -x[F] / 2 + K + te + ue + _.mainAxis : q + te + ue + _.mainAxis, Q = e.elements.arrow && wo(e.elements.arrow), ge = Q ? w === "y" ? Q.clientTop || 0 : Q.clientLeft || 0 : 0, Ee = (I = D == null ? void 0 : D[w]) != null ? I : 0, fe = M + $ - Ee - ge, me = M + G - Ee, xe = Vi(h6 ? Ts(A, fe) : A, M, h6 ? da(R, me) : R); E[w] = xe, O[w] = xe - M; } if (s) { var ke, Ce = w === "x" ? vr : hr, De = w === "x" ? _r : Dr, qe = E[C], Ke = C === "y" ? "height" : "width", Be = qe + m[Ce], Ge = qe - m[De], le = [vr, hr].indexOf(g) !== -1, S = (ke = D == null ? void 0 : D[C]) != null ? ke : 0, z = le ? Be : qe - x[Ke] - T[Ke] - S + _.altAxis, ie = le ? qe + x[Ke] + T[Ke] - S - _.altAxis : Ge, j = h6 && le ? uw(z, qe, ie) : Vi(h6 ? z : Be, qe, h6 ? ie : Ge); E[C] = j, O[C] = j - qe; } e.modifiersData[n] = O; } } var Nw = { name: "preventOverflow", enabled: true, phase: "main", fn: Bw, requiresIfExists: ["offset"] }; function $w(t13) { return { scrollLeft: t13.scrollLeft, scrollTop: t13.scrollTop }; } function Rw(t13) { return t13 === Kr(t13) || !Tr(t13) ? Vu(t13) : $w(t13); } function zw(t13) { var e = t13.getBoundingClientRect(), r = ri(e.width) / t13.offsetWidth || 1, n = ri(e.height) / t13.offsetHeight || 1; return r !== 1 || n !== 1; } function Vw(t13, e, r) { r === void 0 && (r = false); var n = Tr(e), a = Tr(e) && zw(e), i = Yn(e), o = ni(t13, a), s = { scrollLeft: 0, scrollTop: 0 }, u = { x: 0, y: 0 }; return (n || !n && !r) && ((tn(e) !== "body" || qu(i)) && (s = Rw(e)), Tr(e) ? (u = ni(e, true), u.x += e.clientLeft, u.y += e.clientTop) : i && (u.x = Hu(i))), { x: o.left + s.scrollLeft - u.x, y: o.top + s.scrollTop - u.y, width: o.width, height: o.height }; } function Hw(t13) { var e = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), n = []; t13.forEach(function(i) { e.set(i.name, i); }); function a(i) { r.add(i.name); var o = [].concat(i.requires || [], i.requiresIfExists || []); o.forEach(function(s) { if (!r.has(s)) { var u = e.get(s); u && a(u); } }), n.push(i); } return t13.forEach(function(i) { r.has(i.name) || a(i); }), n; } function qw(t13) { var e = Hw(t13); return aw.reduce(function(r, n) { return r.concat(e.filter(function(a) { return a.phase === n; })); }, []); } function Kw(t13) { var e; return function() { return e || (e = new Promise(function(r) { Promise.resolve().then(function() { e = void 0, r(t13()); }); })), e; }; } function Uw(t13) { var e = t13.reduce(function(r, n) { var a = r[n.name]; return r[n.name] = a ? Object.assign({}, a, n, { options: Object.assign({}, a.options, n.options), data: Object.assign({}, a.data, n.data) }) : n, r; }, {}); return Object.keys(e).map(function(r) { return e[r]; }); } var xd = { placement: "bottom", modifiers: [], strategy: "absolute" }; function Cd() { for (var t13 = arguments.length, e = new Array(t13), r = 0; r < t13; r++) e[r] = arguments[r]; return !e.some(function(n) { return !(n && typeof n.getBoundingClientRect == "function"); }); } function Ku(t13) { t13 === void 0 && (t13 = {}); var e = t13, r = e.defaultModifiers, n = r === void 0 ? [] : r, a = e.defaultOptions, i = a === void 0 ? xd : a; return function(o, s, u) { u === void 0 && (u = i); var l = { placement: "bottom", orderedModifiers: [], options: Object.assign({}, xd, i), modifiersData: {}, elements: { reference: o, popper: s }, attributes: {}, styles: {} }, c = [], d = false, v = { state: l, setOptions: function(p) { var m = typeof p == "function" ? p(l.options) : p; f(), l.options = Object.assign({}, i, l.options, m), l.scrollParents = { reference: ti(o) ? Hi(o) : o.contextElement ? Hi(o.contextElement) : [], popper: Hi(s) }; var g = qw(Uw([].concat(n, l.options.modifiers))); return l.orderedModifiers = g.filter(function(y) { return y.enabled; }), h6(), v.update(); }, forceUpdate: function() { if (!d) { var p = l.elements, m = p.reference, g = p.popper; if (Cd(m, g)) { l.rects = { reference: Vw(m, wo(g), l.options.strategy === "fixed"), popper: Ru(g) }, l.reset = false, l.placement = l.options.placement, l.orderedModifiers.forEach(function(T) { return l.modifiersData[T.name] = Object.assign({}, T.data); }); for (var y = 0; y < l.orderedModifiers.length; y++) { if (l.reset === true) { l.reset = false, y = -1; continue; } var b = l.orderedModifiers[y], w = b.fn, C = b.options, E = C === void 0 ? {} : C, x = b.name; typeof w == "function" && (l = w({ state: l, options: E, name: x, instance: v }) || l); } } } }, update: Kw(function() { return new Promise(function(p) { v.forceUpdate(), p(l); }); }), destroy: function() { f(), d = true; } }; if (!Cd(o, s)) return v; v.setOptions(u).then(function(p) { !d && u.onFirstUpdate && u.onFirstUpdate(p); }); function h6() { l.orderedModifiers.forEach(function(p) { var m = p.name, g = p.options, y = g === void 0 ? {} : g, b = p.effect; if (typeof b == "function") { var w = b({ state: l, name: m, instance: v, options: y }), C = function() { }; c.push(w || C); } }); } function f() { c.forEach(function(p) { return p(); }), c = []; } return v; }; } Ku(); var Gw = [rh, ih, th, Xv]; Ku({ defaultModifiers: Gw }); var Ww = [rh, ih, th, Xv, Iw, Dw, Nw, vw, Ow]; var Yw = Ku({ defaultModifiers: Ww }); var Zw = (t13, e, r = {}) => { const n = { name: "updateState", enabled: true, phase: "write", fn: ({ state: u }) => { const l = Xw(u); Object.assign(o.value, l); }, requires: ["computeStyles"] }, a = computed(() => { const { onFirstUpdate: u, placement: l, strategy: c, modifiers: d } = unref(r); return { onFirstUpdate: u, placement: l || "bottom", strategy: c || "absolute", modifiers: [ ...d || [], n, { name: "applyStyles", enabled: false } ] }; }), i = shallowRef(), o = ref({ styles: { popper: { position: unref(a).strategy, left: "0", top: "0" }, arrow: { position: "absolute" } }, attributes: {} }), s = () => { i.value && (i.value.destroy(), i.value = void 0); }; return watch(a, (u) => { const l = unref(i); l && l.setOptions(u); }, { deep: true }), watch([t13, e], ([u, l]) => { s(), !(!u || !l) && (i.value = Yw(u, l, unref(a))); }), onBeforeUnmount(() => { s(); }), { state: computed(() => { var u; return { ...((u = unref(i)) == null ? void 0 : u.state) || {} }; }), styles: computed(() => unref(o).styles), attributes: computed(() => unref(o).attributes), update: () => { var u; return (u = unref(i)) == null ? void 0 : u.update(); }, forceUpdate: () => { var u; return (u = unref(i)) == null ? void 0 : u.forceUpdate(); }, instanceRef: computed(() => unref(i)) }; }; function Xw(t13) { const e = Object.keys(t13.elements), r = Cs(e.map((a) => [a, t13.styles[a] || {}])), n = Cs(e.map((a) => [a, t13.attributes[a]])); return { styles: r, attributes: n }; } function Ed() { let t13; const e = (n, a) => { r(), t13 = window.setTimeout(n, a); }, r = () => window.clearTimeout(t13); return Rs(() => r()), { registerTimeout: e, cancelTimeout: r }; } var eu = { prefix: Math.floor(Math.random() * 1e4), current: 0 }; var jw = Symbol("elIdInjection"); var oh = () => getCurrentInstance() ? inject(jw, eu) : eu; var Xs = (t13) => { const e = oh(); !_t && e === eu && Dt("IdInjection", `Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed usage: app.provide(ID_INJECTION_KEY, { prefix: number, current: number, })`); const r = Bu(); return computed(() => unref(t13) || `${r.value}-id-${e.prefix}-${e.current++}`); }; var za = []; var kd = (t13) => { const e = t13; e.key === Lt.esc && za.forEach((r) => r(e)); }; var Qw = (t13) => { onMounted(() => { za.length === 0 && document.addEventListener("keydown", kd), _t && za.push(t13); }), onBeforeUnmount(() => { za = za.filter((e) => e !== t13), za.length === 0 && _t && document.removeEventListener("keydown", kd); }); }; var Sd; var sh = () => { const t13 = Bu(), e = oh(), r = computed(() => `${t13.value}-popper-container-${e.prefix}`), n = computed(() => `#${r.value}`); return { id: r, selector: n }; }; var Jw = (t13) => { const e = document.createElement("div"); return e.id = t13, document.body.appendChild(e), e; }; var ex = () => { const { id: t13, selector: e } = sh(); return onBeforeMount(() => { _t && (!Sd || !document.body.querySelector(e.value)) && (Sd = Jw(t13.value)); }), { id: t13, selector: e }; }; var tx = rt({ showAfter: { type: Number, default: 0 }, hideAfter: { type: Number, default: 200 }, autoClose: { type: Number, default: 0 } }); var rx = ({ showAfter: t13, hideAfter: e, autoClose: r, open: n, close: a }) => { const { registerTimeout: i } = Ed(), { registerTimeout: o, cancelTimeout: s } = Ed(); return { onOpen: (c) => { i(() => { n(c); const d = unref(r); qt(d) && d > 0 && o(() => { a(c); }, d); }, unref(t13)); }, onClose: (c) => { s(), i(() => { a(c); }, unref(e)); } }; }; var lh = Symbol("elForwardRef"); var nx = (t13) => { provide(lh, { setForwardRef: (r) => { t13.value = r; } }); }; var ax = (t13) => ({ mounted(e) { t13(e); }, updated(e) { t13(e); }, unmounted() { t13(null); } }); var Td = { current: 0 }; var _d = ref(0); var uh = 2e3; var Dd = Symbol("elZIndexContextKey"); var ch = Symbol("zIndexContextKey"); var dh = (t13) => { const e = getCurrentInstance() ? inject(Dd, Td) : Td, r = t13 || (getCurrentInstance() ? inject(ch, void 0) : void 0), n = computed(() => { const o = unref(r); return qt(o) ? o : uh; }), a = computed(() => n.value + _d.value), i = () => (e.current++, _d.value = e.current, a.value); return !_t && !inject(Dd) && Dt("ZIndexInjection", `Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`), { initialZIndex: n, currentZIndex: a, nextZIndex: i }; }; function ix(t13) { let e; function r() { if (t13.value == null) return; const { selectionStart: a, selectionEnd: i, value: o } = t13.value; if (a == null || i == null) return; const s = o.slice(0, Math.max(0, a)), u = o.slice(Math.max(0, i)); e = { selectionStart: a, selectionEnd: i, value: o, beforeTxt: s, afterTxt: u }; } function n() { if (t13.value == null || e == null) return; const { value: a } = t13.value, { beforeTxt: i, afterTxt: o, selectionStart: s } = e; if (i == null || o == null || s == null) return; let u = a.length; if (a.endsWith(o)) u = a.length - o.length; else if (a.startsWith(i)) u = i.length; else { const l = i[s - 1], c = a.indexOf(l, s - 1); c !== -1 && (u = c + 1); } t13.value.setSelectionRange(u, u); } return [r, n]; } var di = Ws({ type: String, values: Uv, required: false }); var fh = Symbol("size"); var ox = () => { const t13 = inject(fh, {}); return computed(() => unref(t13.size) || ""); }; function Uu(t13, { beforeFocus: e, afterFocus: r, beforeBlur: n, afterBlur: a } = {}) { const i = getCurrentInstance(), { emit: o } = i, s = shallowRef(), u = ref(false), l = (v) => { lr(e) && e(v) || u.value || (u.value = true, o("focus", v), r == null || r()); }, c = (v) => { var h6; lr(n) && n(v) || v.relatedTarget && ((h6 = s.value) != null && h6.contains(v.relatedTarget)) || (u.value = false, o("blur", v), a == null || a()); }, d = () => { var v, h6; (v = s.value) != null && v.contains(document.activeElement) && s.value !== document.activeElement || (h6 = t13.value) == null || h6.focus(); }; return watch(s, (v) => { v && v.setAttribute("tabindex", "-1"); }), kr(s, "focus", l, true), kr(s, "blur", c, true), kr(s, "click", d, true), false, { isFocused: u, wrapperRef: s, handleFocus: l, handleBlur: c }; } function vh({ afterComposition: t13, emit: e }) { const r = ref(false), n = (s) => { e == null || e("compositionstart", s), r.value = true; }, a = (s) => { var u; e == null || e("compositionupdate", s); const l = (u = s.target) == null ? void 0 : u.value, c = l[l.length - 1] || ""; r.value = !M2(c); }, i = (s) => { e == null || e("compositionend", s), r.value && (r.value = false, nextTick(() => t13(s))); }; return { isComposing: r, handleComposition: (s) => { s.type === "compositionend" ? i(s) : a(s); }, handleCompositionStart: n, handleCompositionUpdate: a, handleCompositionEnd: i }; } var hh = Symbol("emptyValuesContextKey"); var sx = "use-empty-values"; var lx = ["", void 0, null]; var ux = void 0; var cx = rt({ emptyValues: Array, valueOnClear: { type: [String, Number, Boolean, Function], default: void 0, validator: (t13) => lr(t13) ? !t13() : !t13 } }); var dx = (t13, e) => { const r = getCurrentInstance() ? inject(hh, ref({})) : ref({}), n = computed(() => t13.emptyValues || r.value.emptyValues || lx), a = computed(() => lr(t13.valueOnClear) ? t13.valueOnClear() : t13.valueOnClear !== void 0 ? t13.valueOnClear : lr(r.value.valueOnClear) ? r.value.valueOnClear() : r.value.valueOnClear !== void 0 ? r.value.valueOnClear : ux), i = (o) => n.value.includes(o); return n.value.includes(a.value) || Dt(sx, "value-on-clear should be a value of empty-values"), { emptyValues: n, valueOnClear: a, isEmptyValue: i }; }; var fx = rt({ ariaLabel: String, ariaOrientation: { type: String, values: ["horizontal", "vertical", "undefined"] }, ariaControls: String }); var Zn = (t13) => Rv(fx, t13); var ph = Symbol(); var _s = ref(); function Gu(t13, e = void 0) { const r = getCurrentInstance() ? inject(ph, _s) : _s; return t13 ? computed(() => { var n, a; return (a = (n = r.value) == null ? void 0 : n[t13]) != null ? a : e; }) : r; } function vx(t13, e) { const r = Gu(), n = He(t13, computed(() => { var s; return ((s = r.value) == null ? void 0 : s.namespace) || is; })), a = yo(computed(() => { var s; return (s = r.value) == null ? void 0 : s.locale; })), i = dh(computed(() => { var s; return ((s = r.value) == null ? void 0 : s.zIndex) || uh; })), o = computed(() => { var s; return unref(e) || ((s = r.value) == null ? void 0 : s.size) || ""; }); return hx(computed(() => unref(r) || {})), { ns: n, locale: a, zIndex: i, size: o }; } var hx = (t13, e, r = false) => { var n; const a = !!getCurrentInstance(), i = a ? Gu() : void 0, o = (n = void 0) != null ? n : a ? provide : void 0; if (!o) { Dt("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup()."); return; } const s = computed(() => { const u = unref(t13); return i != null && i.value ? px(i.value, u) : u; }); return o(ph, s), o(Gv, computed(() => s.value.locale)), o(Wv, computed(() => s.value.namespace)), o(ch, computed(() => s.value.zIndex)), o(fh, { size: computed(() => s.value.size || "") }), o(hh, computed(() => ({ emptyValues: s.value.emptyValues, valueOnClear: s.value.valueOnClear }))), (r || !_s.value) && (_s.value = s.value), s; }; var px = (t13, e) => { const r = [.../* @__PURE__ */ new Set([...vd(t13), ...vd(e)])], n = {}; for (const a of r) n[a] = e[a] !== void 0 ? e[a] : t13[a]; return n; }; var ze = (t13, e) => { const r = t13.__vccOpts || t13; for (const [n, a] of e) r[n] = a; return r; }; var gx = rt({ size: { type: $e([Number, String]) }, color: { type: String } }); var mx = defineComponent({ name: "ElIcon", inheritAttrs: false }); var yx = defineComponent({ ...mx, props: gx, setup(t13) { const e = t13, r = He("icon"), n = computed(() => { const { size: a, color: i } = e; return !a && !i ? {} : { fontSize: Mn(a) ? void 0 : Ja(a), "--color": i }; }); return (a, i) => (openBlock(), createElementBlock("i", mergeProps({ class: unref(r).b(), style: unref(n) }, a.$attrs), [ renderSlot(a.$slots, "default") ], 16)); } }); var bx = ze(yx, [["__file", "icon.vue"]]); var Vt = $t(bx); var Wu = Symbol("formContextKey"); var Qi = Symbol("formItemContextKey"); var pa = (t13, e = {}) => { const r = ref(void 0), n = e.prop ? r : Yv("size"), a = e.global ? r : ox(), i = e.form ? { size: void 0 } : inject(Wu, void 0), o = e.formItem ? { size: void 0 } : inject(Qi, void 0); return computed(() => n.value || unref(t13) || (o == null ? void 0 : o.size) || (i == null ? void 0 : i.size) || a.value || ""); }; var xo = (t13) => { const e = Yv("disabled"), r = inject(Wu, void 0); return computed(() => e.value || unref(t13) || (r == null ? void 0 : r.disabled) || false); }; var Ta = () => { const t13 = inject(Wu, void 0), e = inject(Qi, void 0); return { form: t13, formItem: e }; }; var Co = (t13, { formItemContext: e, disableIdGeneration: r, disableIdManagement: n }) => { r || (r = ref(false)), n || (n = ref(false)); const a = ref(); let i; const o = computed(() => { var s; return !!(!(t13.label || t13.ariaLabel) && e && e.inputIds && ((s = e.inputIds) == null ? void 0 : s.length) <= 1); }); return onMounted(() => { i = watch([toRef(t13, "id"), r], ([s, u]) => { const l = s ?? (u ? void 0 : Xs().value); l !== a.value && (e != null && e.removeInputId && (a.value && e.removeInputId(a.value), !(n != null && n.value) && !u && l && e.addInputId(l)), a.value = l); }, { immediate: true }); }), onUnmounted(() => { i && i(), e != null && e.removeInputId && a.value && e.removeInputId(a.value); }), { isLabeledByFormItem: o, inputId: a }; }; var Ir; var wx = ` height:0 !important; visibility:hidden !important; ${Z0() ? "" : "overflow:hidden !important;"} position:absolute !important; z-index:-1000 !important; top:0 !important; right:0 !important; `; var xx = [ "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 Cx(t13) { const e = window.getComputedStyle(t13), r = e.getPropertyValue("box-sizing"), n = Number.parseFloat(e.getPropertyValue("padding-bottom")) + Number.parseFloat(e.getPropertyValue("padding-top")), a = Number.parseFloat(e.getPropertyValue("border-bottom-width")) + Number.parseFloat(e.getPropertyValue("border-top-width")); return { contextStyle: xx.map((o) => `${o}:${e.getPropertyValue(o)}`).join(";"), paddingSize: n, borderSize: a, boxSizing: r }; } function Pd(t13, e = 1, r) { var n; Ir || (Ir = document.createElement("textarea"), document.body.appendChild(Ir)); const { paddingSize: a, borderSize: i, boxSizing: o, contextStyle: s } = Cx(t13); Ir.setAttribute("style", `${s};${wx}`), Ir.value = t13.value || t13.placeholder || ""; let u = Ir.scrollHeight; const l = {}; o === "border-box" ? u = u + i : o === "content-box" && (u = u - a), Ir.value = ""; const c = Ir.scrollHeight - a; if (qt(e)) { let d = c * e; o === "border-box" && (d = d + a + i), u = Math.max(d, u), l.minHeight = `${d}px`; } if (qt(r)) { let d = c * r; o === "border-box" && (d = d + a + i), u = Math.min(d, u); } return l.height = `${u}px`, (n = Ir.parentNode) == null || n.removeChild(Ir), Ir = void 0, l; } var Ex = rt({ id: { type: String, default: void 0 }, size: di, disabled: Boolean, modelValue: { type: $e([ String, Number, Object ]), default: "" }, maxlength: { type: [String, Number] }, minlength: { type: [String, Number] }, type: { type: String, default: "text" }, resize: { type: String, values: ["none", "both", "horizontal", "vertical"] }, autosize: { type: $e([Boolean, Object]), default: false }, autocomplete: { type: String, default: "off" }, formatter: { type: Function }, parser: { type: Function }, placeholder: { type: String }, form: { type: String }, readonly: Boolean, clearable: Boolean, showPassword: Boolean, showWordLimit: Boolean, suffixIcon: { type: Hn }, prefixIcon: { type: Hn }, containerRole: { type: String, default: void 0 }, tabindex: { type: [String, Number], default: 0 }, validateEvent: { type: Boolean, default: true }, inputStyle: { type: $e([Object, Array, String]), default: () => Ra({}) }, autofocus: Boolean, rows: { type: Number, default: 2 }, ...Zn(["ariaLabel"]) }); var kx = { [zt]: (t13) => tr(t13), input: (t13) => tr(t13), change: (t13) => tr(t13), focus: (t13) => t13 instanceof FocusEvent, blur: (t13) => t13 instanceof FocusEvent, clear: () => true, mouseleave: (t13) => t13 instanceof MouseEvent, mouseenter: (t13) => t13 instanceof MouseEvent, keydown: (t13) => t13 instanceof Event, compositionstart: (t13) => t13 instanceof CompositionEvent, compositionupdate: (t13) => t13 instanceof CompositionEvent, compositionend: (t13) => t13 instanceof CompositionEvent }; var Sx = defineComponent({ name: "ElInput", inheritAttrs: false }); var Tx = defineComponent({ ...Sx, props: Ex, emits: kx, setup(t13, { expose: e, emit: r }) { const n = t13, a = useAttrs(), i = useSlots(), o = computed(() => { const S = {}; return n.containerRole === "combobox" && (S["aria-haspopup"] = a["aria-haspopup"], S["aria-owns"] = a["aria-owns"], S["aria-expanded"] = a["aria-expanded"]), S; }), s = computed(() => [ n.type === "textarea" ? m.b() : p.b(), p.m(h6.value), p.is("disabled", f.value), p.is("exceed", ee.value), { [p.b("group")]: i.prepend || i.append, [p.m("prefix")]: i.prefix || n.prefixIcon, [p.m("suffix")]: i.suffix || n.suffixIcon || n.clearable || n.showPassword, [p.bm("suffix", "password-clear")]: R.value && K.value, [p.b("hidden")]: n.type === "hidden" }, a.class ]), u = computed(() => [ p.e("wrapper"), p.is("focus", k.value) ]), l = $2({ excludeKeys: computed(() => Object.keys(o.value)) }), { form: c, formItem: d } = Ta(), { inputId: v } = Co(n, { formItemContext: d }), h6 = pa(), f = xo(), p = He("input"), m = He("textarea"), g = shallowRef(), y = shallowRef(), b = ref(false), w = ref(false), C = ref(), E = shallowRef(n.inputStyle), x = computed(() => g.value || y.value), { wrapperRef: T, isFocused: k, handleFocus: _, handleBlur: D } = Uu(x, { beforeFocus() { return f.value; }, afterBlur() { var S; n.validateEvent && ((S = d == null ? void 0 : d.validate) == null || S.call(d, "blur").catch((z) => Dt(z))); } }), O = computed(() => { var S; return (S = c == null ? void 0 : c.statusIcon) != null ? S : false; }), I = computed(() => (d == null ? void 0 : d.validateState) || ""), L = computed(() => I.value && Kv[I.value]), B = computed(() => w.value ? T2 : m2), F = computed(() => [ a.style ]), M = computed(() => [ n.inputStyle, E.value, { resize: n.resize } ]), A = computed(() => $n(n.modelValue) ? "" : String(n.modelValue)), R = computed(() => n.clearable && !f.value && !n.readonly && !!A.value && (k.value || b.value)), K = computed(() => n.showPassword && !f.value && !n.readonly && !!A.value && (!!A.value || k.value)), H = computed(() => n.showWordLimit && !!n.maxlength && (n.type === "text" || n.type === "textarea") && !f.value && !n.readonly && !n.showPassword), q = computed(() => A.value.length), ee = computed(() => !!H.value && q.value > Number(n.maxlength)), se = computed(() => !!i.suffix || !!n.suffixIcon || R.value || n.showPassword || H.value || !!I.value && O.value), [oe, ae] = ix(g); dn(y, (S) => { if ($(), !H.value || n.resize !== "both") return; const z = S[0], { width: ie } = z.contentRect; C.value = { right: `calc(100% - ${ie + 15 + 6}px)` }; }); const ue = () => { const { type: S, autosize: z } = n; if (!(!_t || S !== "textarea" || !y.value)) if (z) { const ie = Ht(z) ? z.minRows : void 0, j = Ht(z) ? z.maxRows : void 0, Y = Pd(y.value, ie, j); E.value = { overflowY: "hidden", ...Y }, nextTick(() => { y.value.offsetHeight, E.value = Y; }); } else E.value = { minHeight: Pd(y.value).minHeight }; }, $ = /* @__PURE__ */ ((S) => { let z = false; return () => { var ie; if (z || !n.autosize) return; ((ie = y.value) == null ? void 0 : ie.offsetParent) === null || (S(), z = true); }; })(ue), G = () => { const S = x.value, z = n.formatter ? n.formatter(A.value) : A.value; !S || S.value === z || (S.value = z); }, Q = async (S) => { oe(); let { value: z } = S.target; if (n.formatter && (z = n.parser ? n.parser(z) : z), !Ee.value) { if (z === A.value) { G(); return; } r(zt, z), r("input", z), await nextTick(), G(), ae(); } }, ge = (S) => { r("change", S.target.value); }, { isComposing: Ee, handleCompositionStart: fe, handleCompositionUpdate: me, handleCompositionEnd: xe } = vh({ emit: r, afterComposition: Q }), ke = () => { w.value = !w.value, Ce(); }, Ce = async () => { var S; await nextTick(), (S = x.value) == null || S.focus(); }, De = () => { var S; return (S = x.value) == null ? void 0 : S.blur(); }, qe = (S) => { b.value = false, r("mouseleave", S); }, Ke = (S) => { b.value = true, r("mouseenter", S); }, Be = (S) => { r("keydown", S); }, Ge = () => { var S; (S = x.value) == null || S.select(); }, le = () => { r(zt, ""), r("change", ""), r("clear"), r("input", ""); }; return watch(() => n.modelValue, () => { var S; nextTick(() => ue()), n.validateEvent && ((S = d == null ? void 0 : d.validate) == null || S.call(d, "change").catch((z) => Dt(z))); }), watch(A, () => G()), watch(() => n.type, async () => { await nextTick(), G(), ue(); }), onMounted(() => { !n.formatter && n.parser && Dt("ElInput", "If you set the parser, you also need to set the formatter."), G(), nextTick(ue); }), e({ input: g, textarea: y, ref: x, textareaStyle: M, autosize: toRef(n, "autosize"), isComposing: Ee, focus: Ce, blur: De, select: Ge, clear: le, resizeTextarea: ue }), (S, z) => (openBlock(), createElementBlock("div", mergeProps(unref(o), { class: [ unref(s), { [unref(p).bm("group", "append")]: S.$slots.append, [unref(p).bm("group", "prepend")]: S.$slots.prepend } ], style: unref(F), role: S.containerRole, onMouseenter: Ke, onMouseleave: qe }), [ createCommentVNode(" input "), S.type !== "textarea" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ createCommentVNode(" prepend slot "), S.$slots.prepend ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(p).be("group", "prepend")) }, [ renderSlot(S.$slots, "prepend") ], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { ref_key: "wrapperRef", ref: T, class: normalizeClass(unref(u)) }, [ createCommentVNode(" prefix slot "), S.$slots.prefix || S.prefixIcon ? (openBlock(), createElementBlock("span", { key: 0, class: normalizeClass(unref(p).e("prefix")) }, [ createBaseVNode("span", { class: normalizeClass(unref(p).e("prefix-inner")) }, [ renderSlot(S.$slots, "prefix"), S.prefixIcon ? (openBlock(), createBlock(unref(Vt), { key: 0, class: normalizeClass(unref(p).e("icon")) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(S.prefixIcon))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true) ], 2) ], 2)) : createCommentVNode("v-if", true), createBaseVNode("input", mergeProps({ id: unref(v), ref_key: "input", ref: g, class: unref(p).e("inner") }, unref(l), { minlength: S.minlength, maxlength: S.maxlength, type: S.showPassword ? w.value ? "text" : "password" : S.type, disabled: unref(f), readonly: S.readonly, autocomplete: S.autocomplete, tabindex: S.tabindex, "aria-label": S.ariaLabel, placeholder: S.placeholder, style: S.inputStyle, form: S.form, autofocus: S.autofocus, onCompositionstart: unref(fe), onCompositionupdate: unref(me), onCompositionend: unref(xe), onInput: Q, onChange: ge, onKeydown: Be }), null, 16, ["id", "minlength", "maxlength", "type", "disabled", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form", "autofocus", "onCompositionstart", "onCompositionupdate", "onCompositionend"]), createCommentVNode(" suffix slot "), unref(se) ? (openBlock(), createElementBlock("span", { key: 1, class: normalizeClass(unref(p).e("suffix")) }, [ createBaseVNode("span", { class: normalizeClass(unref(p).e("suffix-inner")) }, [ !unref(R) || !unref(K) || !unref(H) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ renderSlot(S.$slots, "suffix"), S.suffixIcon ? (openBlock(), createBlock(unref(Vt), { key: 0, class: normalizeClass(unref(p).e("icon")) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(S.suffixIcon))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true) ], 64)) : createCommentVNode("v-if", true), unref(R) ? (openBlock(), createBlock(unref(Vt), { key: 1, class: normalizeClass([unref(p).e("icon"), unref(p).e("clear")]), onMousedown: withModifiers(unref(Wi), ["prevent"]), onClick: le }, { default: withCtx(() => [ createVNode(unref(Iu)) ]), _: 1 }, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true), unref(K) ? (openBlock(), createBlock(unref(Vt), { key: 2, class: normalizeClass([unref(p).e("icon"), unref(p).e("password")]), onClick: ke }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(unref(B)))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true), unref(H) ? (openBlock(), createElementBlock("span", { key: 3, class: normalizeClass(unref(p).e("count")) }, [ createBaseVNode("span", { class: normalizeClass(unref(p).e("count-inner")) }, toDisplayString(unref(q)) + " / " + toDisplayString(S.maxlength), 3) ], 2)) : createCommentVNode("v-if", true), unref(I) && unref(L) && unref(O) ? (openBlock(), createBlock(unref(Vt), { key: 4, class: normalizeClass([ unref(p).e("icon"), unref(p).e("validateIcon"), unref(p).is("loading", unref(I) === "validating") ]) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(unref(L)))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true) ], 2) ], 2)) : createCommentVNode("v-if", true) ], 2), createCommentVNode(" append slot "), S.$slots.append ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(unref(p).be("group", "append")) }, [ renderSlot(S.$slots, "append") ], 2)) : createCommentVNode("v-if", true) ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [ createCommentVNode(" textarea "), createBaseVNode("textarea", mergeProps({ id: unref(v), ref_key: "textarea", ref: y, class: [unref(m).e("inner"), unref(p).is("focus", unref(k))] }, unref(l), { minlength: S.minlength, maxlength: S.maxlength, tabindex: S.tabindex, disabled: unref(f), readonly: S.readonly, autocomplete: S.autocomplete, style: unref(M), "aria-label": S.ariaLabel, placeholder: S.placeholder, form: S.form, autofocus: S.autofocus, rows: S.rows, onCompositionstart: unref(fe), onCompositionupdate: unref(me), onCompositionend: unref(xe), onInput: Q, onFocus: unref(_), onBlur: unref(D), onChange: ge, onKeydown: Be }), null, 16, ["id", "minlength", "maxlength", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form", "autofocus", "rows", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onFocus", "onBlur"]), unref(H) ? (openBlock(), createElementBlock("span", { key: 0, style: normalizeStyle(C.value), class: normalizeClass(unref(p).e("count")) }, toDisplayString(unref(q)) + " / " + toDisplayString(S.maxlength), 7)) : createCommentVNode("v-if", true) ], 64)) ], 16, ["role"])); } }); var _x = ze(Tx, [["__file", "input.vue"]]); var Eo = $t(_x); var La = 4; var Dx = { vertical: { offset: "offsetHeight", scroll: "scrollTop", scrollSize: "scrollHeight", size: "height", key: "vertical", axis: "Y", client: "clientY", direction: "top" }, horizontal: { offset: "offsetWidth", scroll: "scrollLeft", scrollSize: "scrollWidth", size: "width", key: "horizontal", axis: "X", client: "clientX", direction: "left" } }; var Px = ({ move: t13, size: e, bar: r }) => ({ [r.size]: e, transform: `translate${r.axis}(${t13}%)` }); var Yu = Symbol("scrollbarContextKey"); var Ox = rt({ vertical: Boolean, size: String, move: Number, ratio: { type: Number, required: true }, always: Boolean }); var Lx = "Thumb"; var Fx = defineComponent({ __name: "thumb", props: Ox, setup(t13) { const e = t13, r = inject(Yu), n = He("scrollbar"); r || Zb(Lx, "can not inject scrollbar context"); const a = ref(), i = ref(), o = ref({}), s = ref(false); let u = false, l = false, c = _t ? document.onselectstart : null; const d = computed(() => Dx[e.vertical ? "vertical" : "horizontal"]), v = computed(() => Px({ size: e.size, move: e.move, bar: d.value })), h6 = computed(() => a.value[d.value.offset] ** 2 / r.wrapElement[d.value.scrollSize] / e.ratio / i.value[d.value.offset]), f = (E) => { var x; if (E.stopPropagation(), E.ctrlKey || [1, 2].includes(E.button)) return; (x = window.getSelection()) == null || x.removeAllRanges(), m(E); const T = E.currentTarget; T && (o.value[d.value.axis] = T[d.value.offset] - (E[d.value.client] - T.getBoundingClientRect()[d.value.direction])); }, p = (E) => { if (!i.value || !a.value || !r.wrapElement) return; const x = Math.abs(E.target.getBoundingClientRect()[d.value.direction] - E[d.value.client]), T = i.value[d.value.offset] / 2, k = (x - T) * 100 * h6.value / a.value[d.value.offset]; r.wrapElement[d.value.scroll] = k * r.wrapElement[d.value.scrollSize] / 100; }, m = (E) => { E.stopImmediatePropagation(), u = true, document.addEventListener("mousemove", g), document.addEventListener("mouseup", y), c = document.onselectstart, document.onselectstart = () => false; }, g = (E) => { if (!a.value || !i.value || u === false) return; const x = o.value[d.value.axis]; if (!x) return; const T = (a.value.getBoundingClientRect()[d.value.direction] - E[d.value.client]) * -1, k = i.value[d.value.offset] - x, _ = (T - k) * 100 * h6.value / a.value[d.value.offset]; r.wrapElement[d.value.scroll] = _ * r.wrapElement[d.value.scrollSize] / 100; }, y = () => { u = false, o.value[d.value.axis] = 0, document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", y), C(), l && (s.value = false); }, b = () => { l = false, s.value = !!e.size; }, w = () => { l = true, s.value = u; }; onBeforeUnmount(() => { C(), document.removeEventListener("mouseup", y); }); const C = () => { document.onselectstart !== c && (document.onselectstart = c); }; return kr(toRef(r, "scrollbarElement"), "mousemove", b), kr(toRef(r, "scrollbarElement"), "mouseleave", w), (E, x) => (openBlock(), createBlock(Transition, { name: unref(n).b("fade"), persisted: "" }, { default: withCtx(() => [ withDirectives(createBaseVNode("div", { ref_key: "instance", ref: a, class: normalizeClass([unref(n).e("bar"), unref(n).is(unref(d).key)]), onMousedown: p }, [ createBaseVNode("div", { ref_key: "thumb", ref: i, class: normalizeClass(unref(n).e("thumb")), style: normalizeStyle(unref(v)), onMousedown: f }, null, 38) ], 34), [ [vShow, E.always || s.value] ]) ]), _: 1 }, 8, ["name"])); } }); var Od = ze(Fx, [["__file", "thumb.vue"]]); var Ix = rt({ always: { type: Boolean, default: true }, minSize: { type: Number, required: true } }); var Ax = defineComponent({ __name: "bar", props: Ix, setup(t13, { expose: e }) { const r = t13, n = inject(Yu), a = ref(0), i = ref(0), o = ref(""), s = ref(""), u = ref(1), l = ref(1); return e({ handleScroll: (v) => { if (v) { const h6 = v.offsetHeight - La, f = v.offsetWidth - La; i.value = v.scrollTop * 100 / h6 * u.value, a.value = v.scrollLeft * 100 / f * l.value; } }, update: () => { const v = n == null ? void 0 : n.wrapElement; if (!v) return; const h6 = v.offsetHeight - La, f = v.offsetWidth - La, p = h6 ** 2 / v.scrollHeight, m = f ** 2 / v.scrollWidth, g = Math.max(p, r.minSize), y = Math.max(m, r.minSize); u.value = p / (h6 - p) / (g / (h6 - g)), l.value = m / (f - m) / (y / (f - y)), s.value = g + La < h6 ? `${g}px` : "", o.value = y + La < f ? `${y}px` : ""; } }), (v, h6) => (openBlock(), createElementBlock(Fragment, null, [ createVNode(Od, { move: a.value, ratio: l.value, size: o.value, always: v.always }, null, 8, ["move", "ratio", "size", "always"]), createVNode(Od, { move: i.value, ratio: u.value, size: s.value, vertical: "", always: v.always }, null, 8, ["move", "ratio", "size", "always"]) ], 64)); } }); var Mx = ze(Ax, [["__file", "bar.vue"]]); var Bx = rt({ height: { type: [String, Number], default: "" }, maxHeight: { type: [String, Number], default: "" }, native: { type: Boolean, default: false }, wrapStyle: { type: $e([String, Object, Array]), default: "" }, wrapClass: { type: [String, Array], default: "" }, viewClass: { type: [String, Array], default: "" }, viewStyle: { type: [String, Array, Object], default: "" }, noresize: Boolean, tag: { type: String, default: "div" }, always: Boolean, minSize: { type: Number, default: 20 }, tabindex: { type: [String, Number], default: void 0 }, id: String, role: String, ...Zn(["ariaLabel", "ariaOrientation"]) }); var Nx = { scroll: ({ scrollTop: t13, scrollLeft: e }) => [t13, e].every(qt) }; var tu = "ElScrollbar"; var $x = defineComponent({ name: tu }); var Rx = defineComponent({ ...$x, props: Bx, emits: Nx, setup(t13, { expose: e, emit: r }) { const n = t13, a = He("scrollbar"); let i, o, s = 0, u = 0; const l = ref(), c = ref(), d = ref(), v = ref(), h6 = computed(() => { const C = {}; return n.height && (C.height = Ja(n.height)), n.maxHeight && (C.maxHeight = Ja(n.maxHeight)), [n.wrapStyle, C]; }), f = computed(() => [ n.wrapClass, a.e("wrap"), { [a.em("wrap", "hidden-default")]: !n.native } ]), p = computed(() => [a.e("view"), n.viewClass]), m = () => { var C; c.value && ((C = v.value) == null || C.handleScroll(c.value), s = c.value.scrollTop, u = c.value.scrollLeft, r("scroll", { scrollTop: c.value.scrollTop, scrollLeft: c.value.scrollLeft })); }; function g(C, E) { Ht(C) ? c.value.scrollTo(C) : qt(C) && qt(E) && c.value.scrollTo(C, E); } const y = (C) => { if (!qt(C)) { Dt(tu, "value must be a number"); return; } c.value.scrollTop = C; }, b = (C) => { if (!qt(C)) { Dt(tu, "value must be a number"); return; } c.value.scrollLeft = C; }, w = () => { var C; (C = v.value) == null || C.update(); }; return watch(() => n.noresize, (C) => { C ? (i == null || i(), o == null || o()) : ({ stop: i } = dn(d, w), o = kr("resize", w)); }, { immediate: true }), watch(() => [n.maxHeight, n.height], () => { n.native || nextTick(() => { var C; w(), c.value && ((C = v.value) == null || C.handleScroll(c.value)); }); }), provide(Yu, reactive({ scrollbarElement: l, wrapElement: c })), onActivated(() => { c.value && (c.value.scrollTop = s, c.value.scrollLeft = u); }), onMounted(() => { n.native || nextTick(() => { w(); }); }), onUpdated(() => w()), e({ wrapRef: c, update: w, scrollTo: g, setScrollTop: y, setScrollLeft: b, handleScroll: m }), (C, E) => (openBlock(), createElementBlock("div", { ref_key: "scrollbarRef", ref: l, class: normalizeClass(unref(a).b()) }, [ createBaseVNode("div", { ref_key: "wrapRef", ref: c, class: normalizeClass(unref(f)), style: normalizeStyle(unref(h6)), tabindex: C.tabindex, onScroll: m }, [ (openBlock(), createBlock(resolveDynamicComponent(C.tag), { id: C.id, ref_key: "resizeRef", ref: d, class: normalizeClass(unref(p)), style: normalizeStyle(C.viewStyle), role: C.role, "aria-label": C.ariaLabel, "aria-orientation": C.ariaOrientation }, { default: withCtx(() => [ renderSlot(C.$slots, "default") ]), _: 3 }, 8, ["id", "class", "style", "role", "aria-label", "aria-orientation"])) ], 46, ["tabindex"]), C.native ? createCommentVNode("v-if", true) : (openBlock(), createBlock(Mx, { key: 0, ref_key: "barRef", ref: v, always: C.always, "min-size": C.minSize }, null, 8, ["always", "min-size"])) ], 2)); } }); var zx = ze(Rx, [["__file", "scrollbar.vue"]]); var Vx = $t(zx); var Zu = Symbol("popper"); var gh = Symbol("popperContent"); var Hx = [ "dialog", "grid", "group", "listbox", "menu", "navigation", "tooltip", "tree" ]; var mh = rt({ role: { type: String, values: Hx, default: "tooltip" } }); var qx = defineComponent({ name: "ElPopper", inheritAttrs: false }); var Kx = defineComponent({ ...qx, props: mh, setup(t13, { expose: e }) { const r = t13, n = ref(), a = ref(), i = ref(), o = ref(), s = computed(() => r.role), u = { triggerRef: n, popperInstanceRef: a, contentRef: i, referenceRef: o, role: s }; return e(u), provide(Zu, u), (l, c) => renderSlot(l.$slots, "default"); } }); var Ux = ze(Kx, [["__file", "popper.vue"]]); var yh = rt({ arrowOffset: { type: Number, default: 5 } }); var Gx = defineComponent({ name: "ElPopperArrow", inheritAttrs: false }); var Wx = defineComponent({ ...Gx, props: yh, setup(t13, { expose: e }) { const r = t13, n = He("popper"), { arrowOffset: a, arrowRef: i, arrowStyle: o } = inject(gh, void 0); return watch(() => r.arrowOffset, (s) => { a.value = s; }), onBeforeUnmount(() => { i.value = void 0; }), e({ arrowRef: i }), (s, u) => (openBlock(), createElementBlock("span", { ref_key: "arrowRef", ref: i, class: normalizeClass(unref(n).e("arrow")), style: normalizeStyle(unref(o)), "data-popper-arrow": "" }, null, 6)); } }); var Yx = ze(Wx, [["__file", "arrow.vue"]]); var kl = "ElOnlyChild"; var Zx = defineComponent({ name: kl, setup(t13, { slots: e, attrs: r }) { var n; const a = inject(lh), i = ax((n = a == null ? void 0 : a.setForwardRef) != null ? n : Wi); return () => { var o; const s = (o = e.default) == null ? void 0 : o.call(e, r); if (!s) return null; if (s.length > 1) return Dt(kl, "requires exact only one valid child."), null; const u = bh(s); return u ? withDirectives(cloneVNode(u, r), [[i]]) : (Dt(kl, "no valid child node found"), null); }; } }); function bh(t13) { if (!t13) return null; const e = t13; for (const r of e) { if (Ht(r)) switch (r.type) { case Comment: continue; case Text: case "svg": return Ld(r); case Fragment: return bh(r.children); default: return r; } return Ld(r); } return null; } function Ld(t13) { const e = He("only-child"); return createVNode("span", { class: e.e("content") }, [t13]); } var wh = rt({ virtualRef: { type: $e(Object) }, virtualTriggering: Boolean, onMouseenter: { type: $e(Function) }, onMouseleave: { type: $e(Function) }, onClick: { type: $e(Function) }, onKeydown: { type: $e(Function) }, onFocus: { type: $e(Function) }, onBlur: { type: $e(Function) }, onContextmenu: { type: $e(Function) }, id: String, open: Boolean }); var Xx = defineComponent({ name: "ElPopperTrigger", inheritAttrs: false }); var jx = defineComponent({ ...Xx, props: wh, setup(t13, { expose: e }) { const r = t13, { role: n, triggerRef: a } = inject(Zu, void 0); nx(a); const i = computed(() => s.value ? r.id : void 0), o = computed(() => { if (n && n.value === "tooltip") return r.open && r.id ? r.id : void 0; }), s = computed(() => { if (n && n.value !== "tooltip") return n.value; }), u = computed(() => s.value ? `${r.open}` : void 0); let l; const c = [ "onMouseenter", "onMouseleave", "onClick", "onKeydown", "onFocus", "onBlur", "onContextmenu" ]; return onMounted(() => { watch(() => r.virtualRef, (d) => { d && (a.value = vn(d)); }, { immediate: true }), watch(a, (d, v) => { l == null || l(), l = void 0, ua(d) && (c.forEach((h6) => { var f; const p = r[h6]; p && (d.addEventListener(h6.slice(2).toLowerCase(), p), (f = v == null ? void 0 : v.removeEventListener) == null || f.call(v, h6.slice(2).toLowerCase(), p)); }), l = watch([i, o, s, u], (h6) => { [ "aria-controls", "aria-describedby", "aria-haspopup", "aria-expanded" ].forEach((f, p) => { $n(h6[p]) ? d.removeAttribute(f) : d.setAttribute(f, h6[p]); }); }, { immediate: true })), ua(v) && [ "aria-controls", "aria-describedby", "aria-haspopup", "aria-expanded" ].forEach((h6) => v.removeAttribute(h6)); }, { immediate: true }); }), onBeforeUnmount(() => { if (l == null || l(), l = void 0, a.value && ua(a.value)) { const d = a.value; c.forEach((v) => { const h6 = r[v]; h6 && d.removeEventListener(v.slice(2).toLowerCase(), h6); }), a.value = void 0; } }), e({ triggerRef: a }), (d, v) => d.virtualTriggering ? createCommentVNode("v-if", true) : (openBlock(), createBlock(unref(Zx), mergeProps({ key: 0 }, d.$attrs, { "aria-controls": unref(i), "aria-describedby": unref(o), "aria-expanded": unref(u), "aria-haspopup": unref(s) }), { default: withCtx(() => [ renderSlot(d.$slots, "default") ]), _: 3 }, 16, ["aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup"])); } }); var Qx = ze(jx, [["__file", "trigger.vue"]]); var Sl = "focus-trap.focus-after-trapped"; var Tl = "focus-trap.focus-after-released"; var Jx = "focus-trap.focusout-prevented"; var Fd = { cancelable: true, bubbles: false }; var eC = { cancelable: true, bubbles: false }; var Id = "focusAfterTrapped"; var Ad = "focusAfterReleased"; var tC = Symbol("elFocusTrap"); var Xu = ref(); var js = ref(0); var ju = ref(0); var Ro = 0; var xh = (t13) => { const e = [], r = document.createTreeWalker(t13, NodeFilter.SHOW_ELEMENT, { acceptNode: (n) => { const a = n.tagName === "INPUT" && n.type === "hidden"; return n.disabled || n.hidden || a ? NodeFilter.FILTER_SKIP : n.tabIndex >= 0 || n === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; } }); for (; r.nextNode(); ) e.push(r.currentNode); return e; }; var Md = (t13, e) => { for (const r of t13) if (!rC(r, e)) return r; }; var rC = (t13, e) => { if (false) return false; if (getComputedStyle(t13).visibility === "hidden") return true; for (; t13; ) { if (e && t13 === e) return false; if (getComputedStyle(t13).display === "none") return true; t13 = t13.parentElement; } return false; }; var nC = (t13) => { const e = xh(t13), r = Md(e, t13), n = Md(e.reverse(), t13); return [r, n]; }; var aC = (t13) => t13 instanceof HTMLInputElement && "select" in t13; var On = (t13, e) => { if (t13 && t13.focus) { const r = document.activeElement; t13.focus({ preventScroll: true }), ju.value = window.performance.now(), t13 !== r && aC(t13) && e && t13.select(); } }; function Bd(t13, e) { const r = [...t13], n = t13.indexOf(e); return n !== -1 && r.splice(n, 1), r; } var iC = () => { let t13 = []; return { push: (n) => { const a = t13[0]; a && n !== a && a.pause(), t13 = Bd(t13, n), t13.unshift(n); }, remove: (n) => { var a, i; t13 = Bd(t13, n), (i = (a = t13[0]) == null ? void 0 : a.resume) == null || i.call(a); } }; }; var oC = (t13, e = false) => { const r = document.activeElement; for (const n of t13) if (On(n, e), document.activeElement !== r) return; }; var Nd = iC(); var sC = () => js.value > ju.value; var zo = () => { Xu.value = "pointer", js.value = window.performance.now(); }; var $d = () => { Xu.value = "keyboard", js.value = window.performance.now(); }; var lC = () => (onMounted(() => { Ro === 0 && (document.addEventListener("mousedown", zo), document.addEventListener("touchstart", zo), document.addEventListener("keydown", $d)), Ro++; }), onBeforeUnmount(() => { Ro--, Ro <= 0 && (document.removeEventListener("mousedown", zo), document.removeEventListener("touchstart", zo), document.removeEventListener("keydown", $d)); }), { focusReason: Xu, lastUserFocusTimestamp: js, lastAutomatedFocusTimestamp: ju }); var Vo = (t13) => new CustomEvent(Jx, { ...eC, detail: t13 }); var uC = defineComponent({ name: "ElFocusTrap", inheritAttrs: false, props: { loop: Boolean, trapped: Boolean, focusTrapEl: Object, focusStartEl: { type: [Object, String], default: "first" } }, emits: [ Id, Ad, "focusin", "focusout", "focusout-prevented", "release-requested" ], setup(t13, { emit: e }) { const r = ref(); let n, a; const { focusReason: i } = lC(); Qw((f) => { t13.trapped && !o.paused && e("release-requested", f); }); const o = { paused: false, pause() { this.paused = true; }, resume() { this.paused = false; } }, s = (f) => { if (!t13.loop && !t13.trapped || o.paused) return; const { key: p, altKey: m, ctrlKey: g, metaKey: y, currentTarget: b, shiftKey: w } = f, { loop: C } = t13, E = p === Lt.tab && !m && !g && !y, x = document.activeElement; if (E && x) { const T = b, [k, _] = nC(T); if (k && _) { if (!w && x === _) { const O = Vo({ focusReason: i.value }); e("focusout-prevented", O), O.defaultPrevented || (f.preventDefault(), C && On(k, true)); } else if (w && [k, T].includes(x)) { const O = Vo({ focusReason: i.value }); e("focusout-prevented", O), O.defaultPrevented || (f.preventDefault(), C && On(_, true)); } } else if (x === T) { const O = Vo({ focusReason: i.value }); e("focusout-prevented", O), O.defaultPrevented || f.preventDefault(); } } }; provide(tC, { focusTrapRef: r, onKeydown: s }), watch(() => t13.focusTrapEl, (f) => { f && (r.value = f); }, { immediate: true }), watch([r], ([f], [p]) => { f && (f.addEventListener("keydown", s), f.addEventListener("focusin", c), f.addEventListener("focusout", d)), p && (p.removeEventListener("keydown", s), p.removeEventListener("focusin", c), p.removeEventListener("focusout", d)); }); const u = (f) => { e(Id, f); }, l = (f) => e(Ad, f), c = (f) => { const p = unref(r); if (!p) return; const m = f.target, g = f.relatedTarget, y = m && p.contains(m); t13.trapped || g && p.contains(g) || (n = g), y && e("focusin", f), !o.paused && t13.trapped && (y ? a = m : On(a, true)); }, d = (f) => { const p = unref(r); if (!(o.paused || !p)) if (t13.trapped) { const m = f.relatedTarget; !$n(m) && !p.contains(m) && setTimeout(() => { if (!o.paused && t13.trapped) { const g = Vo({ focusReason: i.value }); e("focusout-prevented", g), g.defaultPrevented || On(a, true); } }, 0); } else { const m = f.target; m && p.contains(m) || e("focusout", f); } }; async function v() { await nextTick(); const f = unref(r); if (f) { Nd.push(o); const p = f.contains(document.activeElement) ? n : document.activeElement; if (n = p, !f.contains(p)) { const g = new Event(Sl, Fd); f.addEventListener(Sl, u), f.dispatchEvent(g), g.defaultPrevented || nextTick(() => { let y = t13.focusStartEl; tr(y) || (On(y), document.activeElement !== y && (y = "first")), y === "first" && oC(xh(f), true), (document.activeElement === p || y === "container") && On(f); }); } } } function h6() { const f = unref(r); if (f) { f.removeEventListener(Sl, u); const p = new CustomEvent(Tl, { ...Fd, detail: { focusReason: i.value } }); f.addEventListener(Tl, l), f.dispatchEvent(p), !p.defaultPrevented && (i.value == "keyboard" || !sC() || f.contains(document.activeElement)) && On(n ?? document.body), f.removeEventListener(Tl, l), Nd.remove(o); } } return onMounted(() => { t13.trapped && v(), watch(() => t13.trapped, (f) => { f ? v() : h6(); }); }), onBeforeUnmount(() => { t13.trapped && h6(), r.value && (r.value.removeEventListener("keydown", s), r.value.removeEventListener("focusin", c), r.value.removeEventListener("focusout", d), r.value = void 0); }), { onKeydown: s }; } }); function cC(t13, e, r, n, a, i) { return renderSlot(t13.$slots, "default", { handleKeydown: t13.onKeydown }); } var dC = ze(uC, [["render", cC], ["__file", "focus-trap.vue"]]); var fC = ["fixed", "absolute"]; var vC = rt({ boundariesPadding: { type: Number, default: 0 }, fallbackPlacements: { type: $e(Array), default: void 0 }, gpuAcceleration: { type: Boolean, default: true }, offset: { type: Number, default: 12 }, placement: { type: String, values: Ys, default: "bottom" }, popperOptions: { type: $e(Object), default: () => ({}) }, strategy: { type: String, values: fC, default: "absolute" } }); var Ch = rt({ ...vC, id: String, style: { type: $e([String, Array, Object]) }, className: { type: $e([String, Array, Object]) }, effect: { type: $e(String), default: "dark" }, visible: Boolean, enterable: { type: Boolean, default: true }, pure: Boolean, focusOnShow: { type: Boolean, default: false }, trapping: { type: Boolean, default: false }, popperClass: { type: $e([String, Array, Object]) }, popperStyle: { type: $e([String, Array, Object]) }, referenceEl: { type: $e(Object) }, triggerTargetEl: { type: $e(Object) }, stopPopperMouseEvent: { type: Boolean, default: true }, virtualTriggering: Boolean, zIndex: Number, ...Zn(["ariaLabel"]) }); var hC = { mouseenter: (t13) => t13 instanceof MouseEvent, mouseleave: (t13) => t13 instanceof MouseEvent, focus: () => true, blur: () => true, close: () => true }; var pC = (t13, e = []) => { const { placement: r, strategy: n, popperOptions: a } = t13, i = { placement: r, strategy: n, ...a, modifiers: [...mC(t13), ...e] }; return yC(i, a == null ? void 0 : a.modifiers), i; }; var gC = (t13) => { if (_t) return vn(t13); }; function mC(t13) { const { offset: e, gpuAcceleration: r, fallbackPlacements: n } = t13; return [ { name: "offset", options: { offset: [0, e ?? 12] } }, { name: "preventOverflow", options: { padding: { top: 2, bottom: 2, left: 5, right: 5 } } }, { name: "flip", options: { padding: 5, fallbackPlacements: n } }, { name: "computeStyles", options: { gpuAcceleration: r } } ]; } function yC(t13, e) { e && (t13.modifiers = [...t13.modifiers, ...e ?? []]); } var bC = 0; var wC = (t13) => { const { popperInstanceRef: e, contentRef: r, triggerRef: n, role: a } = inject(Zu, void 0), i = ref(), o = ref(), s = computed(() => ({ name: "eventListeners", enabled: !!t13.visible })), u = computed(() => { var g; const y = unref(i), b = (g = unref(o)) != null ? g : bC; return { name: "arrow", enabled: !qb(y), options: { element: y, padding: b } }; }), l = computed(() => ({ onFirstUpdate: () => { f(); }, ...pC(t13, [ unref(u), unref(s) ]) })), c = computed(() => gC(t13.referenceEl) || unref(n)), { attributes: d, state: v, styles: h6, update: f, forceUpdate: p, instanceRef: m } = Zw(c, r, l); return watch(m, (g) => e.value = g), onMounted(() => { watch(() => { var g; return (g = unref(c)) == null ? void 0 : g.getBoundingClientRect(); }, () => { f(); }); }), { attributes: d, arrowRef: i, contentRef: r, instanceRef: m, state: v, styles: h6, role: a, forceUpdate: p, update: f }; }; var xC = (t13, { attributes: e, styles: r, role: n }) => { const { nextZIndex: a } = dh(), i = He("popper"), o = computed(() => unref(e).popper), s = ref(qt(t13.zIndex) ? t13.zIndex : a()), u = computed(() => [ i.b(), i.is("pure", t13.pure), i.is(t13.effect), t13.popperClass ]), l = computed(() => [ { zIndex: unref(s) }, unref(r).popper, t13.popperStyle || {} ]), c = computed(() => n.value === "dialog" ? "false" : void 0), d = computed(() => unref(r).arrow || {}); return { ariaModal: c, arrowStyle: d, contentAttrs: o, contentClass: u, contentStyle: l, contentZIndex: s, updateZIndex: () => { s.value = qt(t13.zIndex) ? t13.zIndex : a(); } }; }; var CC = (t13, e) => { const r = ref(false), n = ref(); return { focusStartRef: n, trapped: r, onFocusAfterReleased: (l) => { var c; ((c = l.detail) == null ? void 0 : c.focusReason) !== "pointer" && (n.value = "first", e("blur")); }, onFocusAfterTrapped: () => { e("focus"); }, onFocusInTrap: (l) => { t13.visible && !r.value && (l.target && (n.value = l.target), r.value = true); }, onFocusoutPrevented: (l) => { t13.trapping || (l.detail.focusReason === "pointer" && l.preventDefault(), r.value = false); }, onReleaseRequested: () => { r.value = false, e("close"); } }; }; var EC = defineComponent({ name: "ElPopperContent" }); var kC = defineComponent({ ...EC, props: Ch, emits: hC, setup(t13, { expose: e, emit: r }) { const n = t13, { focusStartRef: a, trapped: i, onFocusAfterReleased: o, onFocusAfterTrapped: s, onFocusInTrap: u, onFocusoutPrevented: l, onReleaseRequested: c } = CC(n, r), { attributes: d, arrowRef: v, contentRef: h6, styles: f, instanceRef: p, role: m, update: g } = wC(n), { ariaModal: y, arrowStyle: b, contentAttrs: w, contentClass: C, contentStyle: E, updateZIndex: x } = xC(n, { styles: f, attributes: d, role: m }), T = inject(Qi, void 0), k = ref(); provide(gh, { arrowStyle: b, arrowRef: v, arrowOffset: k }), T && provide(Qi, { ...T, addInputId: Wi, removeInputId: Wi }); let _; const D = (I = true) => { g(), I && x(); }, O = () => { D(false), n.visible && n.focusOnShow ? i.value = true : n.visible === false && (i.value = false); }; return onMounted(() => { watch(() => n.triggerTargetEl, (I, L) => { _ == null || _(), _ = void 0; const B = unref(I || h6.value), F = unref(L || h6.value); ua(B) && (_ = watch([m, () => n.ariaLabel, y, () => n.id], (M) => { ["role", "aria-label", "aria-modal", "id"].forEach((A, R) => { $n(M[R]) ? B.removeAttribute(A) : B.setAttribute(A, M[R]); }); }, { immediate: true })), F !== B && ua(F) && ["role", "aria-label", "aria-modal", "id"].forEach((M) => { F.removeAttribute(M); }); }, { immediate: true }), watch(() => n.visible, O, { immediate: true }); }), onBeforeUnmount(() => { _ == null || _(), _ = void 0; }), e({ popperContentRef: h6, popperInstanceRef: p, updatePopper: D, contentStyle: E }), (I, L) => (openBlock(), createElementBlock("div", mergeProps({ ref_key: "contentRef", ref: h6 }, unref(w), { style: unref(E), class: unref(C), tabindex: "-1", onMouseenter: (B) => I.$emit("mouseenter", B), onMouseleave: (B) => I.$emit("mouseleave", B) }), [ createVNode(unref(dC), { trapped: unref(i), "trap-on-focus-in": true, "focus-trap-el": unref(h6), "focus-start-el": unref(a), onFocusAfterTrapped: unref(s), onFocusAfterReleased: unref(o), onFocusin: unref(u), onFocusoutPrevented: unref(l), onReleaseRequested: unref(c) }, { default: withCtx(() => [ renderSlot(I.$slots, "default") ]), _: 3 }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested"]) ], 16, ["onMouseenter", "onMouseleave"])); } }); var SC = ze(kC, [["__file", "content.vue"]]); var TC = $t(Ux); var Qu = Symbol("elTooltip"); var cr = rt({ ...tx, ...Ch, appendTo: { type: $e([String, Object]) }, content: { type: String, default: "" }, rawContent: Boolean, persistent: Boolean, visible: { type: $e(Boolean), default: null }, transition: String, teleported: { type: Boolean, default: true }, disabled: Boolean, ...Zn(["ariaLabel"]) }); var Ji = rt({ ...wh, disabled: Boolean, trigger: { type: $e([String, Array]), default: "hover" }, triggerKeys: { type: $e(Array), default: () => [Lt.enter, Lt.space] } }); var { useModelToggleProps: _C, useModelToggleEmits: DC, useModelToggle: PC } = G2("visible"); var OC = rt({ ...mh, ..._C, ...cr, ...Ji, ...yh, showArrow: { type: Boolean, default: true } }); var LC = [ ...DC, "before-show", "before-hide", "show", "hide", "open", "close" ]; var FC = (t13, e) => fr(t13) ? t13.includes(e) : t13 === e; var Fa = (t13, e, r) => (n) => { FC(unref(t13), e) && r(n); }; var IC = defineComponent({ name: "ElTooltipTrigger" }); var AC = defineComponent({ ...IC, props: Ji, setup(t13, { expose: e }) { const r = t13, n = He("tooltip"), { controlled: a, id: i, open: o, onOpen: s, onClose: u, onToggle: l } = inject(Qu, void 0), c = ref(null), d = () => { if (unref(a) || r.disabled) return true; }, v = toRef(r, "trigger"), h6 = cn(d, Fa(v, "hover", s)), f = cn(d, Fa(v, "hover", u)), p = cn(d, Fa(v, "click", (w) => { w.button === 0 && l(w); })), m = cn(d, Fa(v, "focus", s)), g = cn(d, Fa(v, "focus", u)), y = cn(d, Fa(v, "contextmenu", (w) => { w.preventDefault(), l(w); })), b = cn(d, (w) => { const { code: C } = w; r.triggerKeys.includes(C) && (w.preventDefault(), l(w)); }); return e({ triggerRef: c }), (w, C) => (openBlock(), createBlock(unref(Qx), { id: unref(i), "virtual-ref": w.virtualRef, open: unref(o), "virtual-triggering": w.virtualTriggering, class: normalizeClass(unref(n).e("trigger")), onBlur: unref(g), onClick: unref(p), onContextmenu: unref(y), onFocus: unref(m), onMouseenter: unref(h6), onMouseleave: unref(f), onKeydown: unref(b) }, { default: withCtx(() => [ renderSlot(w.$slots, "default") ]), _: 3 }, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"])); } }); var MC = ze(AC, [["__file", "trigger.vue"]]); var BC = rt({ to: { type: $e([String, Object]), required: true }, disabled: Boolean }); var NC = defineComponent({ __name: "teleport", props: BC, setup(t13) { return (e, r) => e.disabled ? renderSlot(e.$slots, "default", { key: 0 }) : (openBlock(), createBlock(Teleport, { key: 1, to: e.to }, [ renderSlot(e.$slots, "default") ], 8, ["to"])); } }); var $C = ze(NC, [["__file", "teleport.vue"]]); var RC = $t($C); var zC = defineComponent({ name: "ElTooltipContent", inheritAttrs: false }); var VC = defineComponent({ ...zC, props: cr, setup(t13, { expose: e }) { const r = t13, { selector: n } = sh(), a = He("tooltip"), i = ref(null); let o; const { controlled: s, id: u, open: l, trigger: c, onClose: d, onOpen: v, onShow: h6, onHide: f, onBeforeShow: p, onBeforeHide: m } = inject(Qu, void 0), g = computed(() => r.transition || `${a.namespace.value}-fade-in-linear`), y = computed(() => false ? true : r.persistent); onBeforeUnmount(() => { o == null || o(); }); const b = computed(() => unref(y) ? true : unref(l)), w = computed(() => r.disabled ? false : unref(l)), C = computed(() => r.appendTo || n.value), E = computed(() => { var F; return (F = r.style) != null ? F : {}; }), x = ref(true), T = () => { f(), x.value = true; }, k = () => { if (unref(s)) return true; }, _ = cn(k, () => { r.enterable && unref(c) === "hover" && v(); }), D = cn(k, () => { unref(c) === "hover" && d(); }), O = () => { var F, M; (M = (F = i.value) == null ? void 0 : F.updatePopper) == null || M.call(F), p == null || p(); }, I = () => { m == null || m(); }, L = () => { h6(), o = B0(computed(() => { var F; return (F = i.value) == null ? void 0 : F.popperContentRef; }), () => { if (unref(s)) return; unref(c) !== "hover" && d(); }); }, B = () => { r.virtualTriggering || d(); }; return watch(() => unref(l), (F) => { F ? x.value = false : o == null || o(); }, { flush: "post" }), watch(() => r.content, () => { var F, M; (M = (F = i.value) == null ? void 0 : F.updatePopper) == null || M.call(F); }), e({ contentRef: i }), (F, M) => (openBlock(), createBlock(unref(RC), { disabled: !F.teleported, to: unref(C) }, { default: withCtx(() => [ createVNode(Transition, { name: unref(g), onAfterLeave: T, onBeforeEnter: O, onAfterEnter: L, onBeforeLeave: I }, { default: withCtx(() => [ unref(b) ? withDirectives((openBlock(), createBlock(unref(SC), mergeProps({ key: 0, id: unref(u), ref_key: "contentRef", ref: i }, F.$attrs, { "aria-label": F.ariaLabel, "aria-hidden": x.value, "boundaries-padding": F.boundariesPadding, "fallback-placements": F.fallbackPlacements, "gpu-acceleration": F.gpuAcceleration, offset: F.offset, placement: F.placement, "popper-options": F.popperOptions, strategy: F.strategy, effect: F.effect, enterable: F.enterable, pure: F.pure, "popper-class": F.popperClass, "popper-style": [F.popperStyle, unref(E)], "reference-el": F.referenceEl, "trigger-target-el": F.triggerTargetEl, visible: unref(w), "z-index": F.zIndex, onMouseenter: unref(_), onMouseleave: unref(D), onBlur: B, onClose: unref(d) }), { default: withCtx(() => [ renderSlot(F.$slots, "default") ]), _: 3 }, 16, ["id", "aria-label", "aria-hidden", "boundaries-padding", "fallback-placements", "gpu-acceleration", "offset", "placement", "popper-options", "strategy", "effect", "enterable", "pure", "popper-class", "popper-style", "reference-el", "trigger-target-el", "visible", "z-index", "onMouseenter", "onMouseleave", "onClose"])), [ [vShow, unref(w)] ]) : createCommentVNode("v-if", true) ]), _: 3 }, 8, ["name"]) ]), _: 3 }, 8, ["disabled", "to"])); } }); var HC = ze(VC, [["__file", "content.vue"]]); var qC = defineComponent({ name: "ElTooltip" }); var KC = defineComponent({ ...qC, props: OC, emits: LC, setup(t13, { expose: e, emit: r }) { const n = t13; ex(); const a = Xs(), i = ref(), o = ref(), s = () => { var g; const y = unref(i); y && ((g = y.popperInstanceRef) == null || g.update()); }, u = ref(false), l = ref(), { show: c, hide: d, hasUpdateHandler: v } = PC({ indicator: u, toggleReason: l }), { onOpen: h6, onClose: f } = rx({ showAfter: toRef(n, "showAfter"), hideAfter: toRef(n, "hideAfter"), autoClose: toRef(n, "autoClose"), open: c, close: d }), p = computed(() => Qa(n.visible) && !v.value); provide(Qu, { controlled: p, id: a, open: readonly(u), trigger: toRef(n, "trigger"), onOpen: (g) => { h6(g); }, onClose: (g) => { f(g); }, onToggle: (g) => { unref(u) ? f(g) : h6(g); }, onShow: () => { r("show", l.value); }, onHide: () => { r("hide", l.value); }, onBeforeShow: () => { r("before-show", l.value); }, onBeforeHide: () => { r("before-hide", l.value); }, updatePopper: s }), watch(() => n.disabled, (g) => { g && u.value && (u.value = false); }); const m = (g) => { var y, b; const w = (b = (y = o.value) == null ? void 0 : y.contentRef) == null ? void 0 : b.popperContentRef, C = (g == null ? void 0 : g.relatedTarget) || document.activeElement; return w && w.contains(C); }; return onDeactivated(() => u.value && d()), e({ popperRef: i, contentRef: o, isFocusInsideContent: m, updatePopper: s, onOpen: h6, onClose: f, hide: d }), (g, y) => (openBlock(), createBlock(unref(TC), { ref_key: "popperRef", ref: i, role: g.role }, { default: withCtx(() => [ createVNode(MC, { disabled: g.disabled, trigger: g.trigger, "trigger-keys": g.triggerKeys, "virtual-ref": g.virtualRef, "virtual-triggering": g.virtualTriggering }, { default: withCtx(() => [ g.$slots.default ? renderSlot(g.$slots, "default", { key: 0 }) : createCommentVNode("v-if", true) ]), _: 3 }, 8, ["disabled", "trigger", "trigger-keys", "virtual-ref", "virtual-triggering"]), createVNode(HC, { ref_key: "contentRef", ref: o, "aria-label": g.ariaLabel, "boundaries-padding": g.boundariesPadding, content: g.content, disabled: g.disabled, effect: g.effect, enterable: g.enterable, "fallback-placements": g.fallbackPlacements, "hide-after": g.hideAfter, "gpu-acceleration": g.gpuAcceleration, offset: g.offset, persistent: g.persistent, "popper-class": g.popperClass, "popper-style": g.popperStyle, placement: g.placement, "popper-options": g.popperOptions, pure: g.pure, "raw-content": g.rawContent, "reference-el": g.referenceEl, "trigger-target-el": g.triggerTargetEl, "show-after": g.showAfter, strategy: g.strategy, teleported: g.teleported, transition: g.transition, "virtual-triggering": g.virtualTriggering, "z-index": g.zIndex, "append-to": g.appendTo }, { default: withCtx(() => [ renderSlot(g.$slots, "content", {}, () => [ g.rawContent ? (openBlock(), createElementBlock("span", { key: 0, innerHTML: g.content }, null, 8, ["innerHTML"])) : (openBlock(), createElementBlock("span", { key: 1 }, toDisplayString(g.content), 1)) ]), g.showArrow ? (openBlock(), createBlock(unref(Yx), { key: 0, "arrow-offset": g.arrowOffset }, null, 8, ["arrow-offset"])) : createCommentVNode("v-if", true) ]), _: 3 }, 8, ["aria-label", "boundaries-padding", "content", "disabled", "effect", "enterable", "fallback-placements", "hide-after", "gpu-acceleration", "offset", "persistent", "popper-class", "popper-style", "placement", "popper-options", "pure", "raw-content", "reference-el", "trigger-target-el", "show-after", "strategy", "teleported", "transition", "virtual-triggering", "z-index", "append-to"]) ]), _: 3 }, 8, ["role"])); } }); var UC = ze(KC, [["__file", "tooltip.vue"]]); var ko = $t(UC); var Eh = Symbol("buttonGroupContextKey"); var GC = (t13, e) => { as({ from: "type.text", replacement: "link", version: "3.0.0", scope: "props", ref: "https://element-plus.org/en-US/component/button.html#button-attributes" }, computed(() => t13.type === "text")); const r = inject(Eh, void 0), n = Gu("button"), { form: a } = Ta(), i = pa(computed(() => r == null ? void 0 : r.size)), o = xo(), s = ref(), u = useSlots(), l = computed(() => t13.type || (r == null ? void 0 : r.type) || ""), c = computed(() => { var f, p, m; return (m = (p = t13.autoInsertSpace) != null ? p : (f = n.value) == null ? void 0 : f.autoInsertSpace) != null ? m : false; }), d = computed(() => t13.tag === "button" ? { ariaDisabled: o.value || t13.loading, disabled: o.value || t13.loading, autofocus: t13.autofocus, type: t13.nativeType } : {}), v = computed(() => { var f; const p = (f = u.default) == null ? void 0 : f.call(u); if (c.value && (p == null ? void 0 : p.length) === 1) { const m = p[0]; if ((m == null ? void 0 : m.type) === Text) { const g = m.children; return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(g.trim()); } } return false; }); return { _disabled: o, _size: i, _type: l, _ref: s, _props: d, shouldAddSpace: v, handleClick: (f) => { if (o.value || t13.loading) { f.stopPropagation(); return; } t13.nativeType === "reset" && (a == null || a.resetFields()), e("click", f); } }; }; var WC = [ "default", "primary", "success", "warning", "info", "danger", "text", "" ]; var YC = ["button", "submit", "reset"]; var ru = rt({ size: di, disabled: Boolean, type: { type: String, values: WC, default: "" }, icon: { type: Hn }, nativeType: { type: String, values: YC, default: "button" }, loading: Boolean, loadingIcon: { type: Hn, default: () => Au }, plain: Boolean, text: Boolean, link: Boolean, bg: Boolean, autofocus: Boolean, round: Boolean, circle: Boolean, color: String, dark: Boolean, autoInsertSpace: { type: Boolean, default: void 0 }, tag: { type: $e([String, Object]), default: "button" } }); var ZC = { click: (t13) => t13 instanceof MouseEvent }; function Kt(t13, e) { XC(t13) && (t13 = "100%"); var r = jC(t13); return t13 = e === 360 ? t13 : Math.min(e, Math.max(0, parseFloat(t13))), r && (t13 = parseInt(String(t13 * e), 10) / 100), Math.abs(t13 - e) < 1e-6 ? 1 : (e === 360 ? t13 = (t13 < 0 ? t13 % e + e : t13 % e) / parseFloat(String(e)) : t13 = t13 % e / parseFloat(String(e)), t13); } function Ho(t13) { return Math.min(1, Math.max(0, t13)); } function XC(t13) { return typeof t13 == "string" && t13.indexOf(".") !== -1 && parseFloat(t13) === 1; } function jC(t13) { return typeof t13 == "string" && t13.indexOf("%") !== -1; } function kh(t13) { return t13 = parseFloat(t13), (isNaN(t13) || t13 < 0 || t13 > 1) && (t13 = 1), t13; } function qo(t13) { return t13 <= 1 ? "".concat(Number(t13) * 100, "%") : t13; } function sa(t13) { return t13.length === 1 ? "0" + t13 : String(t13); } function QC(t13, e, r) { return { r: Kt(t13, 255) * 255, g: Kt(e, 255) * 255, b: Kt(r, 255) * 255 }; } function Rd(t13, e, r) { t13 = Kt(t13, 255), e = Kt(e, 255), r = Kt(r, 255); var n = Math.max(t13, e, r), a = Math.min(t13, e, r), i = 0, o = 0, s = (n + a) / 2; if (n === a) o = 0, i = 0; else { var u = n - a; switch (o = s > 0.5 ? u / (2 - n - a) : u / (n + a), n) { case t13: i = (e - r) / u + (e < r ? 6 : 0); break; case e: i = (r - t13) / u + 2; break; case r: i = (t13 - e) / u + 4; break; } i /= 6; } return { h: i, s: o, l: s }; } function _l(t13, e, r) { return r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? t13 + (e - t13) * (6 * r) : r < 1 / 2 ? e : r < 2 / 3 ? t13 + (e - t13) * (2 / 3 - r) * 6 : t13; } function JC(t13, e, r) { var n, a, i; if (t13 = Kt(t13, 360), e = Kt(e, 100), r = Kt(r, 100), e === 0) a = r, i = r, n = r; else { var o = r < 0.5 ? r * (1 + e) : r + e - r * e, s = 2 * r - o; n = _l(s, o, t13 + 1 / 3), a = _l(s, o, t13), i = _l(s, o, t13 - 1 / 3); } return { r: n * 255, g: a * 255, b: i * 255 }; } function zd(t13, e, r) { t13 = Kt(t13, 255), e = Kt(e, 255), r = Kt(r, 255); var n = Math.max(t13, e, r), a = Math.min(t13, e, r), i = 0, o = n, s = n - a, u = n === 0 ? 0 : s / n; if (n === a) i = 0; else { switch (n) { case t13: i = (e - r) / s + (e < r ? 6 : 0); break; case e: i = (r - t13) / s + 2; break; case r: i = (t13 - e) / s + 4; break; } i /= 6; } return { h: i, s: u, v: o }; } function eE(t13, e, r) { t13 = Kt(t13, 360) * 6, e = Kt(e, 100), r = Kt(r, 100); var n = Math.floor(t13), a = t13 - n, i = r * (1 - e), o = r * (1 - a * e), s = r * (1 - (1 - a) * e), u = n % 6, l = [r, o, i, i, s, r][u], c = [s, r, r, o, i, i][u], d = [i, i, s, r, r, o][u]; return { r: l * 255, g: c * 255, b: d * 255 }; } function Vd(t13, e, r, n) { var a = [ sa(Math.round(t13).toString(16)), sa(Math.round(e).toString(16)), sa(Math.round(r).toString(16)) ]; return n && a[0].startsWith(a[0].charAt(1)) && a[1].startsWith(a[1].charAt(1)) && a[2].startsWith(a[2].charAt(1)) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) : a.join(""); } function tE(t13, e, r, n, a) { var i = [ sa(Math.round(t13).toString(16)), sa(Math.round(e).toString(16)), sa(Math.round(r).toString(16)), sa(rE(n)) ]; return a && i[0].startsWith(i[0].charAt(1)) && i[1].startsWith(i[1].charAt(1)) && i[2].startsWith(i[2].charAt(1)) && i[3].startsWith(i[3].charAt(1)) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) + i[3].charAt(0) : i.join(""); } function rE(t13) { return Math.round(parseFloat(t13) * 255).toString(16); } function Hd(t13) { return mr(t13) / 255; } function mr(t13) { return parseInt(t13, 16); } function nE(t13) { return { r: t13 >> 16, g: (t13 & 65280) >> 8, b: t13 & 255 }; } var nu = { aliceblue: "#f0f8ff", antiquewhite: "#faebd7", aqua: "#00ffff", aquamarine: "#7fffd4", azure: "#f0ffff", beige: "#f5f5dc", bisque: "#ffe4c4", black: "#000000", blanchedalmond: "#ffebcd", blue: "#0000ff", blueviolet: "#8a2be2", brown: "#a52a2a", burlywood: "#deb887", cadetblue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", cornflowerblue: "#6495ed", cornsilk: "#fff8dc", crimson: "#dc143c", cyan: "#00ffff", darkblue: "#00008b", darkcyan: "#008b8b", darkgoldenrod: "#b8860b", darkgray: "#a9a9a9", darkgreen: "#006400", darkgrey: "#a9a9a9", darkkhaki: "#bdb76b", darkmagenta: "#8b008b", darkolivegreen: "#556b2f", darkorange: "#ff8c00", darkorchid: "#9932cc", darkred: "#8b0000", darksalmon: "#e9967a", darkseagreen: "#8fbc8f", darkslateblue: "#483d8b", darkslategray: "#2f4f4f", darkslategrey: "#2f4f4f", darkturquoise: "#00ced1", darkviolet: "#9400d3", deeppink: "#ff1493", deepskyblue: "#00bfff", dimgray: "#696969", dimgrey: "#696969", dodgerblue: "#1e90ff", firebrick: "#b22222", floralwhite: "#fffaf0", forestgreen: "#228b22", fuchsia: "#ff00ff", gainsboro: "#dcdcdc", ghostwhite: "#f8f8ff", goldenrod: "#daa520", gold: "#ffd700", gray: "#808080", green: "#008000", greenyellow: "#adff2f", grey: "#808080", honeydew: "#f0fff0", hotpink: "#ff69b4", indianred: "#cd5c5c", indigo: "#4b0082", ivory: "#fffff0", khaki: "#f0e68c", lavenderblush: "#fff0f5", lavender: "#e6e6fa", lawngreen: "#7cfc00", lemonchiffon: "#fffacd", lightblue: "#add8e6", lightcoral: "#f08080", lightcyan: "#e0ffff", lightgoldenrodyellow: "#fafad2", lightgray: "#d3d3d3", lightgreen: "#90ee90", lightgrey: "#d3d3d3", lightpink: "#ffb6c1", lightsalmon: "#ffa07a", lightseagreen: "#20b2aa", lightskyblue: "#87cefa", lightslategray: "#778899", lightslategrey: "#778899", lightsteelblue: "#b0c4de", lightyellow: "#ffffe0", lime: "#00ff00", limegreen: "#32cd32", linen: "#faf0e6", magenta: "#ff00ff", maroon: "#800000", mediumaquamarine: "#66cdaa", mediumblue: "#0000cd", mediumorchid: "#ba55d3", mediumpurple: "#9370db", mediumseagreen: "#3cb371", mediumslateblue: "#7b68ee", mediumspringgreen: "#00fa9a", mediumturquoise: "#48d1cc", mediumvioletred: "#c71585", midnightblue: "#191970", mintcream: "#f5fffa", mistyrose: "#ffe4e1", moccasin: "#ffe4b5", navajowhite: "#ffdead", navy: "#000080", oldlace: "#fdf5e6", olive: "#808000", olivedrab: "#6b8e23", orange: "#ffa500", orangered: "#ff4500", orchid: "#da70d6", palegoldenrod: "#eee8aa", palegreen: "#98fb98", paleturquoise: "#afeeee", palevioletred: "#db7093", papayawhip: "#ffefd5", peachpuff: "#ffdab9", peru: "#cd853f", pink: "#ffc0cb", plum: "#dda0dd", powderblue: "#b0e0e6", purple: "#800080", rebeccapurple: "#663399", red: "#ff0000", rosybrown: "#bc8f8f", royalblue: "#4169e1", saddlebrown: "#8b4513", salmon: "#fa8072", sandybrown: "#f4a460", seagreen: "#2e8b57", seashell: "#fff5ee", sienna: "#a0522d", silver: "#c0c0c0", skyblue: "#87ceeb", slateblue: "#6a5acd", slategray: "#708090", slategrey: "#708090", snow: "#fffafa", springgreen: "#00ff7f", steelblue: "#4682b4", tan: "#d2b48c", teal: "#008080", thistle: "#d8bfd8", tomato: "#ff6347", turquoise: "#40e0d0", violet: "#ee82ee", wheat: "#f5deb3", white: "#ffffff", whitesmoke: "#f5f5f5", yellow: "#ffff00", yellowgreen: "#9acd32" }; function aE(t13) { var e = { r: 0, g: 0, b: 0 }, r = 1, n = null, a = null, i = null, o = false, s = false; return typeof t13 == "string" && (t13 = sE(t13)), typeof t13 == "object" && (ln(t13.r) && ln(t13.g) && ln(t13.b) ? (e = QC(t13.r, t13.g, t13.b), o = true, s = String(t13.r).substr(-1) === "%" ? "prgb" : "rgb") : ln(t13.h) && ln(t13.s) && ln(t13.v) ? (n = qo(t13.s), a = qo(t13.v), e = eE(t13.h, n, a), o = true, s = "hsv") : ln(t13.h) && ln(t13.s) && ln(t13.l) && (n = qo(t13.s), i = qo(t13.l), e = JC(t13.h, n, i), o = true, s = "hsl"), Object.prototype.hasOwnProperty.call(t13, "a") && (r = t13.a)), r = kh(r), { ok: o, format: t13.format || s, r: Math.min(255, Math.max(e.r, 0)), g: Math.min(255, Math.max(e.g, 0)), b: Math.min(255, Math.max(e.b, 0)), a: r }; } var iE = "[-\\+]?\\d+%?"; var oE = "[-\\+]?\\d*\\.\\d+%?"; var Bn = "(?:".concat(oE, ")|(?:").concat(iE, ")"); var Dl = "[\\s|\\(]+(".concat(Bn, ")[,|\\s]+(").concat(Bn, ")[,|\\s]+(").concat(Bn, ")\\s*\\)?"); var Pl = "[\\s|\\(]+(".concat(Bn, ")[,|\\s]+(").concat(Bn, ")[,|\\s]+(").concat(Bn, ")[,|\\s]+(").concat(Bn, ")\\s*\\)?"); var Ar = { CSS_UNIT: new RegExp(Bn), rgb: new RegExp("rgb" + Dl), rgba: new RegExp("rgba" + Pl), hsl: new RegExp("hsl" + Dl), hsla: new RegExp("hsla" + Pl), hsv: new RegExp("hsv" + Dl), hsva: new RegExp("hsva" + Pl), hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ }; function sE(t13) { if (t13 = t13.trim().toLowerCase(), t13.length === 0) return false; var e = false; if (nu[t13]) t13 = nu[t13], e = true; else if (t13 === "transparent") return { r: 0, g: 0, b: 0, a: 0, format: "name" }; var r = Ar.rgb.exec(t13); return r ? { r: r[1], g: r[2], b: r[3] } : (r = Ar.rgba.exec(t13), r ? { r: r[1], g: r[2], b: r[3], a: r[4] } : (r = Ar.hsl.exec(t13), r ? { h: r[1], s: r[2], l: r[3] } : (r = Ar.hsla.exec(t13), r ? { h: r[1], s: r[2], l: r[3], a: r[4] } : (r = Ar.hsv.exec(t13), r ? { h: r[1], s: r[2], v: r[3] } : (r = Ar.hsva.exec(t13), r ? { h: r[1], s: r[2], v: r[3], a: r[4] } : (r = Ar.hex8.exec(t13), r ? { r: mr(r[1]), g: mr(r[2]), b: mr(r[3]), a: Hd(r[4]), format: e ? "name" : "hex8" } : (r = Ar.hex6.exec(t13), r ? { r: mr(r[1]), g: mr(r[2]), b: mr(r[3]), format: e ? "name" : "hex" } : (r = Ar.hex4.exec(t13), r ? { r: mr(r[1] + r[1]), g: mr(r[2] + r[2]), b: mr(r[3] + r[3]), a: Hd(r[4] + r[4]), format: e ? "name" : "hex8" } : (r = Ar.hex3.exec(t13), r ? { r: mr(r[1] + r[1]), g: mr(r[2] + r[2]), b: mr(r[3] + r[3]), format: e ? "name" : "hex" } : false))))))))); } function ln(t13) { return !!Ar.CSS_UNIT.exec(String(t13)); } var lE = ( /** @class */ function() { function t13(e, r) { e === void 0 && (e = ""), r === void 0 && (r = {}); var n; if (e instanceof t13) return e; typeof e == "number" && (e = nE(e)), this.originalInput = e; var a = aE(e); this.originalInput = e, this.r = a.r, this.g = a.g, this.b = a.b, this.a = a.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (n = r.format) !== null && n !== void 0 ? n : a.format, this.gradientType = r.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = a.ok; } return t13.prototype.isDark = function() { return this.getBrightness() < 128; }, t13.prototype.isLight = function() { return !this.isDark(); }, t13.prototype.getBrightness = function() { var e = this.toRgb(); return (e.r * 299 + e.g * 587 + e.b * 114) / 1e3; }, t13.prototype.getLuminance = function() { var e = this.toRgb(), r, n, a, i = e.r / 255, o = e.g / 255, s = e.b / 255; return i <= 0.03928 ? r = i / 12.92 : r = Math.pow((i + 0.055) / 1.055, 2.4), o <= 0.03928 ? n = o / 12.92 : n = Math.pow((o + 0.055) / 1.055, 2.4), s <= 0.03928 ? a = s / 12.92 : a = Math.pow((s + 0.055) / 1.055, 2.4), 0.2126 * r + 0.7152 * n + 0.0722 * a; }, t13.prototype.getAlpha = function() { return this.a; }, t13.prototype.setAlpha = function(e) { return this.a = kh(e), this.roundA = Math.round(100 * this.a) / 100, this; }, t13.prototype.isMonochrome = function() { var e = this.toHsl().s; return e === 0; }, t13.prototype.toHsv = function() { var e = zd(this.r, this.g, this.b); return { h: e.h * 360, s: e.s, v: e.v, a: this.a }; }, t13.prototype.toHsvString = function() { var e = zd(this.r, this.g, this.b), r = Math.round(e.h * 360), n = Math.round(e.s * 100), a = Math.round(e.v * 100); return this.a === 1 ? "hsv(".concat(r, ", ").concat(n, "%, ").concat(a, "%)") : "hsva(".concat(r, ", ").concat(n, "%, ").concat(a, "%, ").concat(this.roundA, ")"); }, t13.prototype.toHsl = function() { var e = Rd(this.r, this.g, this.b); return { h: e.h * 360, s: e.s, l: e.l, a: this.a }; }, t13.prototype.toHslString = function() { var e = Rd(this.r, this.g, this.b), r = Math.round(e.h * 360), n = Math.round(e.s * 100), a = Math.round(e.l * 100); return this.a === 1 ? "hsl(".concat(r, ", ").concat(n, "%, ").concat(a, "%)") : "hsla(".concat(r, ", ").concat(n, "%, ").concat(a, "%, ").concat(this.roundA, ")"); }, t13.prototype.toHex = function(e) { return e === void 0 && (e = false), Vd(this.r, this.g, this.b, e); }, t13.prototype.toHexString = function(e) { return e === void 0 && (e = false), "#" + this.toHex(e); }, t13.prototype.toHex8 = function(e) { return e === void 0 && (e = false), tE(this.r, this.g, this.b, this.a, e); }, t13.prototype.toHex8String = function(e) { return e === void 0 && (e = false), "#" + this.toHex8(e); }, t13.prototype.toHexShortString = function(e) { return e === void 0 && (e = false), this.a === 1 ? this.toHexString(e) : this.toHex8String(e); }, t13.prototype.toRgb = function() { return { r: Math.round(this.r), g: Math.round(this.g), b: Math.round(this.b), a: this.a }; }, t13.prototype.toRgbString = function() { var e = Math.round(this.r), r = Math.round(this.g), n = Math.round(this.b); return this.a === 1 ? "rgb(".concat(e, ", ").concat(r, ", ").concat(n, ")") : "rgba(".concat(e, ", ").concat(r, ", ").concat(n, ", ").concat(this.roundA, ")"); }, t13.prototype.toPercentageRgb = function() { var e = function(r) { return "".concat(Math.round(Kt(r, 255) * 100), "%"); }; return { r: e(this.r), g: e(this.g), b: e(this.b), a: this.a }; }, t13.prototype.toPercentageRgbString = function() { var e = function(r) { return Math.round(Kt(r, 255) * 100); }; return this.a === 1 ? "rgb(".concat(e(this.r), "%, ").concat(e(this.g), "%, ").concat(e(this.b), "%)") : "rgba(".concat(e(this.r), "%, ").concat(e(this.g), "%, ").concat(e(this.b), "%, ").concat(this.roundA, ")"); }, t13.prototype.toName = function() { if (this.a === 0) return "transparent"; if (this.a < 1) return false; for (var e = "#" + Vd(this.r, this.g, this.b, false), r = 0, n = Object.entries(nu); r < n.length; r++) { var a = n[r], i = a[0], o = a[1]; if (e === o) return i; } return false; }, t13.prototype.toString = function(e) { var r = !!e; e = e ?? this.format; var n = false, a = this.a < 1 && this.a >= 0, i = !r && a && (e.startsWith("hex") || e === "name"); return i ? e === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (n = this.toRgbString()), e === "prgb" && (n = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (n = this.toHexString()), e === "hex3" && (n = this.toHexString(true)), e === "hex4" && (n = this.toHex8String(true)), e === "hex8" && (n = this.toHex8String()), e === "name" && (n = this.toName()), e === "hsl" && (n = this.toHslString()), e === "hsv" && (n = this.toHsvString()), n || this.toHexString()); }, t13.prototype.toNumber = function() { return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b); }, t13.prototype.clone = function() { return new t13(this.toString()); }, t13.prototype.lighten = function(e) { e === void 0 && (e = 10); var r = this.toHsl(); return r.l += e / 100, r.l = Ho(r.l), new t13(r); }, t13.prototype.brighten = function(e) { e === void 0 && (e = 10); var r = this.toRgb(); return r.r = Math.max(0, Math.min(255, r.r - Math.round(255 * -(e / 100)))), r.g = Math.max(0, Math.min(255, r.g - Math.round(255 * -(e / 100)))), r.b = Math.max(0, Math.min(255, r.b - Math.round(255 * -(e / 100)))), new t13(r); }, t13.prototype.darken = function(e) { e === void 0 && (e = 10); var r = this.toHsl(); return r.l -= e / 100, r.l = Ho(r.l), new t13(r); }, t13.prototype.tint = function(e) { return e === void 0 && (e = 10), this.mix("white", e); }, t13.prototype.shade = function(e) { return e === void 0 && (e = 10), this.mix("black", e); }, t13.prototype.desaturate = function(e) { e === void 0 && (e = 10); var r = this.toHsl(); return r.s -= e / 100, r.s = Ho(r.s), new t13(r); }, t13.prototype.saturate = function(e) { e === void 0 && (e = 10); var r = this.toHsl(); return r.s += e / 100, r.s = Ho(r.s), new t13(r); }, t13.prototype.greyscale = function() { return this.desaturate(100); }, t13.prototype.spin = function(e) { var r = this.toHsl(), n = (r.h + e) % 360; return r.h = n < 0 ? 360 + n : n, new t13(r); }, t13.prototype.mix = function(e, r) { r === void 0 && (r = 50); var n = this.toRgb(), a = new t13(e).toRgb(), i = r / 100, o = { r: (a.r - n.r) * i + n.r, g: (a.g - n.g) * i + n.g, b: (a.b - n.b) * i + n.b, a: (a.a - n.a) * i + n.a }; return new t13(o); }, t13.prototype.analogous = function(e, r) { e === void 0 && (e = 6), r === void 0 && (r = 30); var n = this.toHsl(), a = 360 / r, i = [this]; for (n.h = (n.h - (a * e >> 1) + 720) % 360; --e; ) n.h = (n.h + a) % 360, i.push(new t13(n)); return i; }, t13.prototype.complement = function() { var e = this.toHsl(); return e.h = (e.h + 180) % 360, new t13(e); }, t13.prototype.monochromatic = function(e) { e === void 0 && (e = 6); for (var r = this.toHsv(), n = r.h, a = r.s, i = r.v, o = [], s = 1 / e; e--; ) o.push(new t13({ h: n, s: a, v: i })), i = (i + s) % 1; return o; }, t13.prototype.splitcomplement = function() { var e = this.toHsl(), r = e.h; return [ this, new t13({ h: (r + 72) % 360, s: e.s, l: e.l }), new t13({ h: (r + 216) % 360, s: e.s, l: e.l }) ]; }, t13.prototype.onBackground = function(e) { var r = this.toRgb(), n = new t13(e).toRgb(), a = r.a + n.a * (1 - r.a); return new t13({ r: (r.r * r.a + n.r * n.a * (1 - r.a)) / a, g: (r.g * r.a + n.g * n.a * (1 - r.a)) / a, b: (r.b * r.a + n.b * n.a * (1 - r.a)) / a, a }); }, t13.prototype.triad = function() { return this.polyad(3); }, t13.prototype.tetrad = function() { return this.polyad(4); }, t13.prototype.polyad = function(e) { for (var r = this.toHsl(), n = r.h, a = [this], i = 360 / e, o = 1; o < e; o++) a.push(new t13({ h: (n + o * i) % 360, s: r.s, l: r.l })); return a; }, t13.prototype.equals = function(e) { return this.toRgbString() === new t13(e).toRgbString(); }, t13; }() ); function _n(t13, e = 20) { return t13.mix("#141414", e).toString(); } function uE(t13) { const e = xo(), r = He("button"); return computed(() => { let n = {}, a = t13.color; if (a) { const i = a.match(/var\((.*?)\)/); i && (a = window.getComputedStyle(window.document.documentElement).getPropertyValue(i[1])); const o = new lE(a), s = t13.dark ? o.tint(20).toString() : _n(o, 20); if (t13.plain) n = r.cssVarBlock({ "bg-color": t13.dark ? _n(o, 90) : o.tint(90).toString(), "text-color": a, "border-color": t13.dark ? _n(o, 50) : o.tint(50).toString(), "hover-text-color": `var(${r.cssVarName("color-white")})`, "hover-bg-color": a, "hover-border-color": a, "active-bg-color": s, "active-text-color": `var(${r.cssVarName("color-white")})`, "active-border-color": s }), e.value && (n[r.cssVarBlockName("disabled-bg-color")] = t13.dark ? _n(o, 90) : o.tint(90).toString(), n[r.cssVarBlockName("disabled-text-color")] = t13.dark ? _n(o, 50) : o.tint(50).toString(), n[r.cssVarBlockName("disabled-border-color")] = t13.dark ? _n(o, 80) : o.tint(80).toString()); else { const u = t13.dark ? _n(o, 30) : o.tint(30).toString(), l = o.isDark() ? `var(${r.cssVarName("color-white")})` : `var(${r.cssVarName("color-black")})`; if (n = r.cssVarBlock({ "bg-color": a, "text-color": l, "border-color": a, "hover-bg-color": u, "hover-text-color": l, "hover-border-color": u, "active-bg-color": s, "active-border-color": s }), e.value) { const c = t13.dark ? _n(o, 50) : o.tint(50).toString(); n[r.cssVarBlockName("disabled-bg-color")] = c, n[r.cssVarBlockName("disabled-text-color")] = t13.dark ? "rgba(255, 255, 255, 0.5)" : `var(${r.cssVarName("color-white")})`, n[r.cssVarBlockName("disabled-border-color")] = c; } } } return n; }); } var cE = defineComponent({ name: "ElButton" }); var dE = defineComponent({ ...cE, props: ru, emits: ZC, setup(t13, { expose: e, emit: r }) { const n = t13, a = uE(n), i = He("button"), { _ref: o, _size: s, _type: u, _disabled: l, _props: c, shouldAddSpace: d, handleClick: v } = GC(n, r), h6 = computed(() => [ i.b(), i.m(u.value), i.m(s.value), i.is("disabled", l.value), i.is("loading", n.loading), i.is("plain", n.plain), i.is("round", n.round), i.is("circle", n.circle), i.is("text", n.text), i.is("link", n.link), i.is("has-bg", n.bg) ]); return e({ ref: o, size: s, type: u, disabled: l, shouldAddSpace: d }), (f, p) => (openBlock(), createBlock(resolveDynamicComponent(f.tag), mergeProps({ ref_key: "_ref", ref: o }, unref(c), { class: unref(h6), style: unref(a), onClick: unref(v) }), { default: withCtx(() => [ f.loading ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ f.$slots.loading ? renderSlot(f.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(unref(Vt), { key: 1, class: normalizeClass(unref(i).is("loading")) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(f.loadingIcon))) ]), _: 1 }, 8, ["class"])) ], 64)) : f.icon || f.$slots.icon ? (openBlock(), createBlock(unref(Vt), { key: 1 }, { default: withCtx(() => [ f.icon ? (openBlock(), createBlock(resolveDynamicComponent(f.icon), { key: 0 })) : renderSlot(f.$slots, "icon", { key: 1 }) ]), _: 3 })) : createCommentVNode("v-if", true), f.$slots.default ? (openBlock(), createElementBlock("span", { key: 2, class: normalizeClass({ [unref(i).em("text", "expand")]: unref(d) }) }, [ renderSlot(f.$slots, "default") ], 2)) : createCommentVNode("v-if", true) ]), _: 3 }, 16, ["class", "style", "onClick"])); } }); var fE = ze(dE, [["__file", "button.vue"]]); var vE = { size: ru.size, type: ru.type }; var hE = defineComponent({ name: "ElButtonGroup" }); var pE = defineComponent({ ...hE, props: vE, setup(t13) { const e = t13; provide(Eh, reactive({ size: toRef(e, "size"), type: toRef(e, "type") })); const r = He("button"); return (n, a) => (openBlock(), createElementBlock("div", { class: normalizeClass(unref(r).b("group")) }, [ renderSlot(n.$slots, "default") ], 2)); } }); var Sh = ze(pE, [["__file", "button-group.vue"]]); var Hr = $t(fE, { ButtonGroup: Sh }); var gE = xn(Sh); var Ln = /* @__PURE__ */ new Map(); if (_t) { let t13; document.addEventListener("mousedown", (e) => t13 = e), document.addEventListener("mouseup", (e) => { if (t13) { for (const r of Ln.values()) for (const { documentHandler: n } of r) n(e, t13); t13 = void 0; } }); } function qd(t13, e) { let r = []; return Array.isArray(e.arg) ? r = e.arg : ua(e.arg) && r.push(e.arg), function(n, a) { const i = e.instance.popperRef, o = n.target, s = a == null ? void 0 : a.target, u = !e || !e.instance, l = !o || !s, c = t13.contains(o) || t13.contains(s), d = t13 === o, v = r.length && r.some((f) => f == null ? void 0 : f.contains(o)) || r.length && r.includes(s), h6 = i && (i.contains(o) || i.contains(s)); u || l || c || d || v || h6 || e.value(n, a); }; } var Th = { beforeMount(t13, e) { Ln.has(t13) || Ln.set(t13, []), Ln.get(t13).push({ documentHandler: qd(t13, e), bindingFn: e.value }); }, updated(t13, e) { Ln.has(t13) || Ln.set(t13, []); const r = Ln.get(t13), n = r.findIndex((i) => i.bindingFn === e.oldValue), a = { documentHandler: qd(t13, e), bindingFn: e.value }; n >= 0 ? r.splice(n, 1, a) : r.push(a); }, unmounted(t13) { Ln.delete(t13); } }; var mE = rt({ header: { type: String, default: "" }, footer: { type: String, default: "" }, bodyStyle: { type: $e([String, Object, Array]), default: "" }, bodyClass: String, shadow: { type: String, values: ["always", "hover", "never"], default: "always" } }); var yE = defineComponent({ name: "ElCard" }); var bE = defineComponent({ ...yE, props: mE, setup(t13) { const e = He("card"); return (r, n) => (openBlock(), createElementBlock("div", { class: normalizeClass([unref(e).b(), unref(e).is(`${r.shadow}-shadow`)]) }, [ r.$slots.header || r.header ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(e).e("header")) }, [ renderSlot(r.$slots, "header", {}, () => [ createTextVNode(toDisplayString(r.header), 1) ]) ], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass([unref(e).e("body"), r.bodyClass]), style: normalizeStyle(r.bodyStyle) }, [ renderSlot(r.$slots, "default") ], 6), r.$slots.footer || r.footer ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(unref(e).e("footer")) }, [ renderSlot(r.$slots, "footer", {}, () => [ createTextVNode(toDisplayString(r.footer), 1) ]) ], 2)) : createCommentVNode("v-if", true) ], 2)); } }); var wE = ze(bE, [["__file", "card.vue"]]); var xE = $t(wE); var _h = { modelValue: { type: [Number, String, Boolean], default: void 0 }, label: { type: [String, Boolean, Number, Object], default: void 0 }, value: { type: [String, Boolean, Number, Object], default: void 0 }, indeterminate: Boolean, disabled: Boolean, checked: Boolean, name: { type: String, default: void 0 }, trueValue: { type: [String, Number], default: void 0 }, falseValue: { type: [String, Number], default: void 0 }, trueLabel: { type: [String, Number], default: void 0 }, falseLabel: { type: [String, Number], default: void 0 }, id: { type: String, default: void 0 }, border: Boolean, size: di, tabindex: [String, Number], validateEvent: { type: Boolean, default: true }, ...Zn(["ariaControls"]) }; var Dh = { [zt]: (t13) => tr(t13) || qt(t13) || Qa(t13), change: (t13) => tr(t13) || qt(t13) || Qa(t13) }; var fi = Symbol("checkboxGroupContextKey"); var CE = ({ model: t13, isChecked: e }) => { const r = inject(fi, void 0), n = computed(() => { var i, o; const s = (i = r == null ? void 0 : r.max) == null ? void 0 : i.value, u = (o = r == null ? void 0 : r.min) == null ? void 0 : o.value; return !Mn(s) && t13.value.length >= s && !e.value || !Mn(u) && t13.value.length <= u && e.value; }); return { isDisabled: xo(computed(() => (r == null ? void 0 : r.disabled.value) || n.value)), isLimitDisabled: n }; }; var EE = (t13, { model: e, isLimitExceeded: r, hasOwnLabel: n, isDisabled: a, isLabeledByFormItem: i }) => { const o = inject(fi, void 0), { formItem: s } = Ta(), { emit: u } = getCurrentInstance(); function l(f) { var p, m, g, y; return [true, t13.trueValue, t13.trueLabel].includes(f) ? (m = (p = t13.trueValue) != null ? p : t13.trueLabel) != null ? m : true : (y = (g = t13.falseValue) != null ? g : t13.falseLabel) != null ? y : false; } function c(f, p) { u("change", l(f), p); } function d(f) { if (r.value) return; const p = f.target; u("change", l(p.checked), f); } async function v(f) { r.value || !n.value && !a.value && i.value && (f.composedPath().some((g) => g.tagName === "LABEL") || (e.value = l([false, t13.falseValue, t13.falseLabel].includes(e.value)), await nextTick(), c(e.value, f))); } const h6 = computed(() => (o == null ? void 0 : o.validateEvent) || t13.validateEvent); return watch(() => t13.modelValue, () => { h6.value && (s == null || s.validate("change").catch((f) => Dt(f))); }), { handleChange: d, onClickRoot: v }; }; var kE = (t13) => { const e = ref(false), { emit: r } = getCurrentInstance(), n = inject(fi, void 0), a = computed(() => Mn(n) === false), i = ref(false), o = computed({ get() { var s, u; return a.value ? (s = n == null ? void 0 : n.modelValue) == null ? void 0 : s.value : (u = t13.modelValue) != null ? u : e.value; }, set(s) { var u, l; a.value && fr(s) ? (i.value = ((u = n == null ? void 0 : n.max) == null ? void 0 : u.value) !== void 0 && s.length > (n == null ? void 0 : n.max.value) && s.length > o.value.length, i.value === false && ((l = n == null ? void 0 : n.changeEvent) == null || l.call(n, s))) : (r(zt, s), e.value = s); } }); return { model: o, isGroup: a, isLimitExceeded: i }; }; var SE = (t13, e, { model: r }) => { const n = inject(fi, void 0), a = ref(false), i = computed(() => ks(t13.value) ? t13.label : t13.value), o = computed(() => { const c = r.value; return Qa(c) ? c : fr(c) ? Ht(i.value) ? c.map(toRaw).some((d) => Es(d, i.value)) : c.map(toRaw).includes(i.value) : c != null ? c === t13.trueValue || c === t13.trueLabel : !!c; }), s = pa(computed(() => { var c; return (c = n == null ? void 0 : n.size) == null ? void 0 : c.value; }), { prop: true }), u = pa(computed(() => { var c; return (c = n == null ? void 0 : n.size) == null ? void 0 : c.value; })), l = computed(() => !!e.default || !ks(i.value)); return { checkboxButtonSize: s, isChecked: o, isFocused: a, checkboxSize: u, hasOwnLabel: l, actualValue: i }; }; var Ph = (t13, e) => { const { formItem: r } = Ta(), { model: n, isGroup: a, isLimitExceeded: i } = kE(t13), { isFocused: o, isChecked: s, checkboxButtonSize: u, checkboxSize: l, hasOwnLabel: c, actualValue: d } = SE(t13, e, { model: n }), { isDisabled: v } = CE({ model: n, isChecked: s }), { inputId: h6, isLabeledByFormItem: f } = Co(t13, { formItemContext: r, disableIdGeneration: c, disableIdManagement: a }), { handleChange: p, onClickRoot: m } = EE(t13, { model: n, isLimitExceeded: i, hasOwnLabel: c, isDisabled: v, isLabeledByFormItem: f }); return (() => { function y() { var b, w; fr(n.value) && !n.value.includes(d.value) ? n.value.push(d.value) : n.value = (w = (b = t13.trueValue) != null ? b : t13.trueLabel) != null ? w : true; } t13.checked && y(); })(), as({ from: "label act as value", replacement: "value", version: "3.0.0", scope: "el-checkbox", ref: "https://element-plus.org/en-US/component/checkbox.html" }, computed(() => a.value && ks(t13.value))), as({ from: "true-label", replacement: "true-value", version: "3.0.0", scope: "el-checkbox", ref: "https://element-plus.org/en-US/component/checkbox.html" }, computed(() => !!t13.trueLabel)), as({ from: "false-label", replacement: "false-value", version: "3.0.0", scope: "el-checkbox", ref: "https://element-plus.org/en-US/component/checkbox.html" }, computed(() => !!t13.falseLabel)), { inputId: h6, isLabeledByFormItem: f, isChecked: s, isDisabled: v, isFocused: o, checkboxButtonSize: u, checkboxSize: l, hasOwnLabel: c, model: n, actualValue: d, handleChange: p, onClickRoot: m }; }; var TE = defineComponent({ name: "ElCheckbox" }); var _E = defineComponent({ ...TE, props: _h, emits: Dh, setup(t13) { const e = t13, r = useSlots(), { inputId: n, isLabeledByFormItem: a, isChecked: i, isDisabled: o, isFocused: s, checkboxSize: u, hasOwnLabel: l, model: c, actualValue: d, handleChange: v, onClickRoot: h6 } = Ph(e, r), f = He("checkbox"), p = computed(() => [ f.b(), f.m(u.value), f.is("disabled", o.value), f.is("bordered", e.border), f.is("checked", i.value) ]), m = computed(() => [ f.e("input"), f.is("disabled", o.value), f.is("checked", i.value), f.is("indeterminate", e.indeterminate), f.is("focus", s.value) ]); return (g, y) => (openBlock(), createBlock(resolveDynamicComponent(!unref(l) && unref(a) ? "span" : "label"), { class: normalizeClass(unref(p)), "aria-controls": g.indeterminate ? g.ariaControls : null, onClick: unref(h6) }, { default: withCtx(() => { var b, w, C, E; return [ createBaseVNode("span", { class: normalizeClass(unref(m)) }, [ g.trueValue || g.falseValue || g.trueLabel || g.falseLabel ? withDirectives((openBlock(), createElementBlock("input", { key: 0, id: unref(n), "onUpdate:modelValue": (x) => isRef(c) ? c.value = x : null, class: normalizeClass(unref(f).e("original")), type: "checkbox", indeterminate: g.indeterminate, name: g.name, tabindex: g.tabindex, disabled: unref(o), "true-value": (w = (b = g.trueValue) != null ? b : g.trueLabel) != null ? w : true, "false-value": (E = (C = g.falseValue) != null ? C : g.falseLabel) != null ? E : false, onChange: unref(v), onFocus: (x) => s.value = true, onBlur: (x) => s.value = false, onClick: withModifiers(() => { }, ["stop"]) }, null, 42, ["id", "onUpdate:modelValue", "indeterminate", "name", "tabindex", "disabled", "true-value", "false-value", "onChange", "onFocus", "onBlur", "onClick"])), [ [vModelCheckbox, unref(c)] ]) : withDirectives((openBlock(), createElementBlock("input", { key: 1, id: unref(n), "onUpdate:modelValue": (x) => isRef(c) ? c.value = x : null, class: normalizeClass(unref(f).e("original")), type: "checkbox", indeterminate: g.indeterminate, disabled: unref(o), value: unref(d), name: g.name, tabindex: g.tabindex, onChange: unref(v), onFocus: (x) => s.value = true, onBlur: (x) => s.value = false, onClick: withModifiers(() => { }, ["stop"]) }, null, 42, ["id", "onUpdate:modelValue", "indeterminate", "disabled", "value", "name", "tabindex", "onChange", "onFocus", "onBlur", "onClick"])), [ [vModelCheckbox, unref(c)] ]), createBaseVNode("span", { class: normalizeClass(unref(f).e("inner")) }, null, 2) ], 2), unref(l) ? (openBlock(), createElementBlock("span", { key: 0, class: normalizeClass(unref(f).e("label")) }, [ renderSlot(g.$slots, "default"), g.$slots.default ? createCommentVNode("v-if", true) : (openBlock(), createElementBlock(Fragment, { key: 0 }, [ createTextVNode(toDisplayString(g.label), 1) ], 64)) ], 2)) : createCommentVNode("v-if", true) ]; }), _: 3 }, 8, ["class", "aria-controls", "onClick"])); } }); var DE = ze(_E, [["__file", "checkbox.vue"]]); var PE = defineComponent({ name: "ElCheckboxButton" }); var OE = defineComponent({ ...PE, props: _h, emits: Dh, setup(t13) { const e = t13, r = useSlots(), { isFocused: n, isChecked: a, isDisabled: i, checkboxButtonSize: o, model: s, actualValue: u, handleChange: l } = Ph(e, r), c = inject(fi, void 0), d = He("checkbox"), v = computed(() => { var f, p, m, g; const y = (p = (f = c == null ? void 0 : c.fill) == null ? void 0 : f.value) != null ? p : ""; return { backgroundColor: y, borderColor: y, color: (g = (m = c == null ? void 0 : c.textColor) == null ? void 0 : m.value) != null ? g : "", boxShadow: y ? `-1px 0 0 0 ${y}` : void 0 }; }), h6 = computed(() => [ d.b("button"), d.bm("button", o.value), d.is("disabled", i.value), d.is("checked", a.value), d.is("focus", n.value) ]); return (f, p) => { var m, g, y, b; return openBlock(), createElementBlock("label", { class: normalizeClass(unref(h6)) }, [ f.trueValue || f.falseValue || f.trueLabel || f.falseLabel ? withDirectives((openBlock(), createElementBlock("input", { key: 0, "onUpdate:modelValue": (w) => isRef(s) ? s.value = w : null, class: normalizeClass(unref(d).be("button", "original")), type: "checkbox", name: f.name, tabindex: f.tabindex, disabled: unref(i), "true-value": (g = (m = f.trueValue) != null ? m : f.trueLabel) != null ? g : true, "false-value": (b = (y = f.falseValue) != null ? y : f.falseLabel) != null ? b : false, onChange: unref(l), onFocus: (w) => n.value = true, onBlur: (w) => n.value = false, onClick: withModifiers(() => { }, ["stop"]) }, null, 42, ["onUpdate:modelValue", "name", "tabindex", "disabled", "true-value", "false-value", "onChange", "onFocus", "onBlur", "onClick"])), [ [vModelCheckbox, unref(s)] ]) : withDirectives((openBlock(), createElementBlock("input", { key: 1, "onUpdate:modelValue": (w) => isRef(s) ? s.value = w : null, class: normalizeClass(unref(d).be("button", "original")), type: "checkbox", name: f.name, tabindex: f.tabindex, disabled: unref(i), value: unref(u), onChange: unref(l), onFocus: (w) => n.value = true, onBlur: (w) => n.value = false, onClick: withModifiers(() => { }, ["stop"]) }, null, 42, ["onUpdate:modelValue", "name", "tabindex", "disabled", "value", "onChange", "onFocus", "onBlur", "onClick"])), [ [vModelCheckbox, unref(s)] ]), f.$slots.default || f.label ? (openBlock(), createElementBlock("span", { key: 2, class: normalizeClass(unref(d).be("button", "inner")), style: normalizeStyle(unref(a) ? unref(v) : void 0) }, [ renderSlot(f.$slots, "default", {}, () => [ createTextVNode(toDisplayString(f.label), 1) ]) ], 6)) : createCommentVNode("v-if", true) ], 2); }; } }); var Oh = ze(OE, [["__file", "checkbox-button.vue"]]); var LE = rt({ modelValue: { type: $e(Array), default: () => [] }, disabled: Boolean, min: Number, max: Number, size: di, fill: String, textColor: String, tag: { type: String, default: "div" }, validateEvent: { type: Boolean, default: true }, ...Zn(["ariaLabel"]) }); var FE = { [zt]: (t13) => fr(t13), change: (t13) => fr(t13) }; var IE = defineComponent({ name: "ElCheckboxGroup" }); var AE = defineComponent({ ...IE, props: LE, emits: FE, setup(t13, { emit: e }) { const r = t13, n = He("checkbox"), { formItem: a } = Ta(), { inputId: i, isLabeledByFormItem: o } = Co(r, { formItemContext: a }), s = async (l) => { e(zt, l), await nextTick(), e("change", l); }, u = computed({ get() { return r.modelValue; }, set(l) { s(l); } }); return provide(fi, { ...Rv(toRefs(r), [ "size", "min", "max", "disabled", "validateEvent", "fill", "textColor" ]), modelValue: u, changeEvent: s }), watch(() => r.modelValue, () => { r.validateEvent && (a == null || a.validate("change").catch((l) => Dt(l))); }), (l, c) => { var d; return openBlock(), createBlock(resolveDynamicComponent(l.tag), { id: unref(i), class: normalizeClass(unref(n).b("group")), role: "group", "aria-label": unref(o) ? void 0 : l.ariaLabel || "checkbox-group", "aria-labelledby": unref(o) ? (d = unref(a)) == null ? void 0 : d.labelId : void 0 }, { default: withCtx(() => [ renderSlot(l.$slots, "default") ]), _: 3 }, 8, ["id", "class", "aria-label", "aria-labelledby"]); }; } }); var Lh = ze(AE, [["__file", "checkbox-group.vue"]]); var ME = $t(DE, { CheckboxButton: Oh, CheckboxGroup: Lh }); xn(Oh); xn(Lh); var au = rt({ type: { type: String, values: ["primary", "success", "info", "warning", "danger"], default: "primary" }, closable: Boolean, disableTransitions: Boolean, hit: Boolean, color: String, size: { type: String, values: Uv }, effect: { type: String, values: ["dark", "light", "plain"], default: "light" }, round: Boolean }); var BE = { close: (t13) => t13 instanceof MouseEvent, click: (t13) => t13 instanceof MouseEvent }; var NE = defineComponent({ name: "ElTag" }); var $E = defineComponent({ ...NE, props: au, emits: BE, setup(t13, { emit: e }) { const r = t13, n = pa(), a = He("tag"), i = computed(() => { const { type: l, hit: c, effect: d, closable: v, round: h6 } = r; return [ a.b(), a.is("closable", v), a.m(l || "primary"), a.m(n.value), a.m(d), a.is("hit", c), a.is("round", h6) ]; }), o = (l) => { e("close", l); }, s = (l) => { e("click", l); }, u = (l) => { l.component.subTree.component.bum = null; }; return (l, c) => l.disableTransitions ? (openBlock(), createElementBlock("span", { key: 0, class: normalizeClass(unref(i)), style: normalizeStyle({ backgroundColor: l.color }), onClick: s }, [ createBaseVNode("span", { class: normalizeClass(unref(a).e("content")) }, [ renderSlot(l.$slots, "default") ], 2), l.closable ? (openBlock(), createBlock(unref(Vt), { key: 0, class: normalizeClass(unref(a).e("close")), onClick: withModifiers(o, ["stop"]) }, { default: withCtx(() => [ createVNode(unref(Ss)) ]), _: 1 }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true) ], 6)) : (openBlock(), createBlock(Transition, { key: 1, name: `${unref(a).namespace.value}-zoom-in-center`, appear: "", onVnodeMounted: u }, { default: withCtx(() => [ createBaseVNode("span", { class: normalizeClass(unref(i)), style: normalizeStyle({ backgroundColor: l.color }), onClick: s }, [ createBaseVNode("span", { class: normalizeClass(unref(a).e("content")) }, [ renderSlot(l.$slots, "default") ], 2), l.closable ? (openBlock(), createBlock(unref(Vt), { key: 0, class: normalizeClass(unref(a).e("close")), onClick: withModifiers(o, ["stop"]) }, { default: withCtx(() => [ createVNode(unref(Ss)) ]), _: 1 }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true) ], 6) ]), _: 3 }, 8, ["name"])); } }); var RE = ze($E, [["__file", "tag.vue"]]); var zE = $t(RE); var Fh = Symbol("rowContextKey"); var VE = [ "start", "center", "end", "space-around", "space-between", "space-evenly" ]; var HE = ["top", "middle", "bottom"]; var qE = rt({ tag: { type: String, default: "div" }, gutter: { type: Number, default: 0 }, justify: { type: String, values: VE, default: "start" }, align: { type: String, values: HE } }); var KE = defineComponent({ name: "ElRow" }); var UE = defineComponent({ ...KE, props: qE, setup(t13) { const e = t13, r = He("row"), n = computed(() => e.gutter); provide(Fh, { gutter: n }); const a = computed(() => { const o = {}; return e.gutter && (o.marginRight = o.marginLeft = `-${e.gutter / 2}px`), o; }), i = computed(() => [ r.b(), r.is(`justify-${e.justify}`, e.justify !== "start"), r.is(`align-${e.align}`, !!e.align) ]); return (o, s) => (openBlock(), createBlock(resolveDynamicComponent(o.tag), { class: normalizeClass(unref(i)), style: normalizeStyle(unref(a)) }, { default: withCtx(() => [ renderSlot(o.$slots, "default") ]), _: 3 }, 8, ["class", "style"])); } }); var GE = ze(UE, [["__file", "row.vue"]]); var Qs = $t(GE); var WE = rt({ tag: { type: String, default: "div" }, span: { type: Number, default: 24 }, offset: { type: Number, default: 0 }, pull: { type: Number, default: 0 }, push: { type: Number, default: 0 }, xs: { type: $e([Number, Object]), default: () => Ra({}) }, sm: { type: $e([Number, Object]), default: () => Ra({}) }, md: { type: $e([Number, Object]), default: () => Ra({}) }, lg: { type: $e([Number, Object]), default: () => Ra({}) }, xl: { type: $e([Number, Object]), default: () => Ra({}) } }); var YE = defineComponent({ name: "ElCol" }); var ZE = defineComponent({ ...YE, props: WE, setup(t13) { const e = t13, { gutter: r } = inject(Fh, { gutter: computed(() => 0) }), n = He("col"), a = computed(() => { const o = {}; return r.value && (o.paddingLeft = o.paddingRight = `${r.value / 2}px`), o; }), i = computed(() => { const o = []; return ["span", "offset", "pull", "push"].forEach((l) => { const c = e[l]; qt(c) && (l === "span" ? o.push(n.b(`${e[l]}`)) : c > 0 && o.push(n.b(`${l}-${e[l]}`))); }), ["xs", "sm", "md", "lg", "xl"].forEach((l) => { qt(e[l]) ? o.push(n.b(`${l}-${e[l]}`)) : Ht(e[l]) && Object.entries(e[l]).forEach(([c, d]) => { o.push(c !== "span" ? n.b(`${l}-${c}-${d}`) : n.b(`${l}-${d}`)); }); }), r.value && o.push(n.is("guttered")), [n.b(), o]; }); return (o, s) => (openBlock(), createBlock(resolveDynamicComponent(o.tag), { class: normalizeClass(unref(i)), style: normalizeStyle(unref(a)) }, { default: withCtx(() => [ renderSlot(o.$slots, "default") ]), _: 3 }, 8, ["class", "style"])); } }); var XE = ze(ZE, [["__file", "col.vue"]]); var So = $t(XE); var jE = defineComponent({ name: "ElCollapseTransition" }); var QE = defineComponent({ ...jE, setup(t13) { const e = He("collapse-transition"), r = (a) => { a.style.maxHeight = "", a.style.overflow = a.dataset.oldOverflow, a.style.paddingTop = a.dataset.oldPaddingTop, a.style.paddingBottom = a.dataset.oldPaddingBottom; }, n = { beforeEnter(a) { a.dataset || (a.dataset = {}), a.dataset.oldPaddingTop = a.style.paddingTop, a.dataset.oldPaddingBottom = a.style.paddingBottom, a.style.height && (a.dataset.elExistsHeight = a.style.height), a.style.maxHeight = 0, a.style.paddingTop = 0, a.style.paddingBottom = 0; }, enter(a) { requestAnimationFrame(() => { a.dataset.oldOverflow = a.style.overflow, a.dataset.elExistsHeight ? a.style.maxHeight = a.dataset.elExistsHeight : a.scrollHeight !== 0 ? a.style.maxHeight = `${a.scrollHeight}px` : a.style.maxHeight = 0, a.style.paddingTop = a.dataset.oldPaddingTop, a.style.paddingBottom = a.dataset.oldPaddingBottom, a.style.overflow = "hidden"; }); }, afterEnter(a) { a.style.maxHeight = "", a.style.overflow = a.dataset.oldOverflow; }, enterCancelled(a) { r(a); }, beforeLeave(a) { a.dataset || (a.dataset = {}), a.dataset.oldPaddingTop = a.style.paddingTop, a.dataset.oldPaddingBottom = a.style.paddingBottom, a.dataset.oldOverflow = a.style.overflow, a.style.maxHeight = `${a.scrollHeight}px`, a.style.overflow = "hidden"; }, leave(a) { a.scrollHeight !== 0 && (a.style.maxHeight = 0, a.style.paddingTop = 0, a.style.paddingBottom = 0); }, afterLeave(a) { r(a); }, leaveCancelled(a) { r(a); } }; return (a, i) => (openBlock(), createBlock(Transition, mergeProps({ name: unref(e).b() }, toHandlers(n)), { default: withCtx(() => [ renderSlot(a.$slots, "default") ]), _: 3 }, 16, ["name"])); } }); var JE = ze(QE, [["__file", "collapse-transition.vue"]]); var ek = $t(JE); var tk = rt({ color: { type: $e(Object), required: true }, vertical: { type: Boolean, default: false } }); var Ol = false; function eo(t13, e) { if (!_t) return; const r = function(i) { var o; (o = e.drag) == null || o.call(e, i); }, n = function(i) { var o; document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", n), document.removeEventListener("touchmove", r), document.removeEventListener("touchend", n), document.onselectstart = null, document.ondragstart = null, Ol = false, (o = e.end) == null || o.call(e, i); }, a = function(i) { var o; Ol || (i.preventDefault(), document.onselectstart = () => false, document.ondragstart = () => false, document.addEventListener("mousemove", r), document.addEventListener("mouseup", n), document.addEventListener("touchmove", r), document.addEventListener("touchend", n), Ol = true, (o = e.start) == null || o.call(e, i)); }; t13.addEventListener("mousedown", a), t13.addEventListener("touchstart", a, { passive: false }); } var rk = (t13) => { const e = getCurrentInstance(), { t: r } = yo(), n = shallowRef(), a = shallowRef(), i = computed(() => t13.color.get("alpha")), o = computed(() => r("el.colorpicker.alphaLabel")); function s(d) { var v; d.target !== n.value && u(d), (v = n.value) == null || v.focus(); } function u(d) { if (!a.value || !n.value) return; const h6 = e.vnode.el.getBoundingClientRect(), { clientX: f, clientY: p } = Su(d); if (t13.vertical) { let m = p - h6.top; m = Math.max(n.value.offsetHeight / 2, m), m = Math.min(m, h6.height - n.value.offsetHeight / 2), t13.color.set("alpha", Math.round((m - n.value.offsetHeight / 2) / (h6.height - n.value.offsetHeight) * 100)); } else { let m = f - h6.left; m = Math.max(n.value.offsetWidth / 2, m), m = Math.min(m, h6.width - n.value.offsetWidth / 2), t13.color.set("alpha", Math.round((m - n.value.offsetWidth / 2) / (h6.width - n.value.offsetWidth) * 100)); } } function l(d) { const { code: v, shiftKey: h6 } = d, f = h6 ? 10 : 1; switch (v) { case Lt.left: case Lt.down: d.preventDefault(), d.stopPropagation(), c(-f); break; case Lt.right: case Lt.up: d.preventDefault(), d.stopPropagation(), c(f); break; } } function c(d) { let v = i.value + d; v = v < 0 ? 0 : v > 100 ? 100 : v, t13.color.set("alpha", v); } return { thumb: n, bar: a, alpha: i, alphaLabel: o, handleDrag: u, handleClick: s, handleKeydown: l }; }; var nk = (t13, { bar: e, thumb: r, handleDrag: n }) => { const a = getCurrentInstance(), i = He("color-alpha-slider"), o = ref(0), s = ref(0), u = ref(); function l() { if (!r.value || t13.vertical) return 0; const y = a.vnode.el, b = t13.color.get("alpha"); return y ? Math.round(b * (y.offsetWidth - r.value.offsetWidth / 2) / 100) : 0; } function c() { if (!r.value) return 0; const y = a.vnode.el; if (!t13.vertical) return 0; const b = t13.color.get("alpha"); return y ? Math.round(b * (y.offsetHeight - r.value.offsetHeight / 2) / 100) : 0; } function d() { if (t13.color && t13.color.value) { const { r: y, g: b, b: w } = t13.color.toRgb(); return `linear-gradient(to right, rgba(${y}, ${b}, ${w}, 0) 0%, rgba(${y}, ${b}, ${w}, 1) 100%)`; } return ""; } function v() { o.value = l(), s.value = c(), u.value = d(); } onMounted(() => { if (!e.value || !r.value) return; const y = { drag: (b) => { n(b); }, end: (b) => { n(b); } }; eo(e.value, y), eo(r.value, y), v(); }), watch(() => t13.color.get("alpha"), () => v()), watch(() => t13.color.value, () => v()); const h6 = computed(() => [i.b(), i.is("vertical", t13.vertical)]), f = computed(() => i.e("bar")), p = computed(() => i.e("thumb")), m = computed(() => ({ background: u.value })), g = computed(() => ({ left: Ja(o.value), top: Ja(s.value) })); return { rootKls: h6, barKls: f, barStyle: m, thumbKls: p, thumbStyle: g, update: v }; }; var ak = "ElColorAlphaSlider"; var ik = defineComponent({ name: ak }); var ok = defineComponent({ ...ik, props: tk, setup(t13, { expose: e }) { const r = t13, { alpha: n, alphaLabel: a, bar: i, thumb: o, handleDrag: s, handleClick: u, handleKeydown: l } = rk(r), { rootKls: c, barKls: d, barStyle: v, thumbKls: h6, thumbStyle: f, update: p } = nk(r, { bar: i, thumb: o, handleDrag: s }); return e({ update: p, bar: i, thumb: o }), (m, g) => (openBlock(), createElementBlock("div", { class: normalizeClass(unref(c)) }, [ createBaseVNode("div", { ref_key: "bar", ref: i, class: normalizeClass(unref(d)), style: normalizeStyle(unref(v)), onClick: unref(u) }, null, 14, ["onClick"]), createBaseVNode("div", { ref_key: "thumb", ref: o, class: normalizeClass(unref(h6)), style: normalizeStyle(unref(f)), "aria-label": unref(a), "aria-valuenow": unref(n), "aria-orientation": m.vertical ? "vertical" : "horizontal", "aria-valuemin": "0", "aria-valuemax": "100", role: "slider", tabindex: "0", onKeydown: unref(l) }, null, 46, ["aria-label", "aria-valuenow", "aria-orientation", "onKeydown"]) ], 2)); } }); var sk = ze(ok, [["__file", "alpha-slider.vue"]]); var lk = defineComponent({ name: "ElColorHueSlider", props: { color: { type: Object, required: true }, vertical: Boolean }, setup(t13) { const e = He("color-hue-slider"), r = getCurrentInstance(), n = ref(), a = ref(), i = ref(0), o = ref(0), s = computed(() => t13.color.get("hue")); watch(() => s.value, () => { v(); }); function u(h6) { h6.target !== n.value && l(h6); } function l(h6) { if (!a.value || !n.value) return; const p = r.vnode.el.getBoundingClientRect(), { clientX: m, clientY: g } = Su(h6); let y; if (t13.vertical) { let b = g - p.top; b = Math.min(b, p.height - n.value.offsetHeight / 2), b = Math.max(n.value.offsetHeight / 2, b), y = Math.round((b - n.value.offsetHeight / 2) / (p.height - n.value.offsetHeight) * 360); } else { let b = m - p.left; b = Math.min(b, p.width - n.value.offsetWidth / 2), b = Math.max(n.value.offsetWidth / 2, b), y = Math.round((b - n.value.offsetWidth / 2) / (p.width - n.value.offsetWidth) * 360); } t13.color.set("hue", y); } function c() { if (!n.value) return 0; const h6 = r.vnode.el; if (t13.vertical) return 0; const f = t13.color.get("hue"); return h6 ? Math.round(f * (h6.offsetWidth - n.value.offsetWidth / 2) / 360) : 0; } function d() { if (!n.value) return 0; const h6 = r.vnode.el; if (!t13.vertical) return 0; const f = t13.color.get("hue"); return h6 ? Math.round(f * (h6.offsetHeight - n.value.offsetHeight / 2) / 360) : 0; } function v() { i.value = c(), o.value = d(); } return onMounted(() => { if (!a.value || !n.value) return; const h6 = { drag: (f) => { l(f); }, end: (f) => { l(f); } }; eo(a.value, h6), eo(n.value, h6), v(); }), { bar: a, thumb: n, thumbLeft: i, thumbTop: o, hueValue: s, handleClick: u, update: v, ns: e }; } }); function uk(t13, e, r, n, a, i) { return openBlock(), createElementBlock("div", { class: normalizeClass([t13.ns.b(), t13.ns.is("vertical", t13.vertical)]) }, [ createBaseVNode("div", { ref: "bar", class: normalizeClass(t13.ns.e("bar")), onClick: t13.handleClick }, null, 10, ["onClick"]), createBaseVNode("div", { ref: "thumb", class: normalizeClass(t13.ns.e("thumb")), style: normalizeStyle({ left: t13.thumbLeft + "px", top: t13.thumbTop + "px" }) }, null, 6) ], 2); } var ck = ze(lk, [["render", uk], ["__file", "hue-slider.vue"]]); var dk = rt({ modelValue: String, id: String, showAlpha: Boolean, colorFormat: String, disabled: Boolean, size: di, popperClass: { type: String, default: "" }, tabindex: { type: [String, Number], default: 0 }, teleported: cr.teleported, predefine: { type: $e(Array) }, validateEvent: { type: Boolean, default: true }, ...Zn(["ariaLabel"]) }); var fk = { [zt]: (t13) => tr(t13) || $n(t13), [Mu]: (t13) => tr(t13) || $n(t13), activeChange: (t13) => tr(t13) || $n(t13), focus: (t13) => t13 instanceof FocusEvent, blur: (t13) => t13 instanceof FocusEvent }; var Ih = Symbol("colorPickerContextKey"); var Kd = function(t13, e, r) { return [ t13, e * r / ((t13 = (2 - e) * r) < 1 ? t13 : 2 - t13) || 0, t13 / 2 ]; }; var vk = function(t13) { return typeof t13 == "string" && t13.includes(".") && Number.parseFloat(t13) === 1; }; var hk = function(t13) { return typeof t13 == "string" && t13.includes("%"); }; var Ka = function(t13, e) { vk(t13) && (t13 = "100%"); const r = hk(t13); return t13 = Math.min(e, Math.max(0, Number.parseFloat(`${t13}`))), r && (t13 = Number.parseInt(`${t13 * e}`, 10) / 100), Math.abs(t13 - e) < 1e-6 ? 1 : t13 % e / Number.parseFloat(e); }; var Ud = { 10: "A", 11: "B", 12: "C", 13: "D", 14: "E", 15: "F" }; var ss = (t13) => { t13 = Math.min(Math.round(t13), 255); const e = Math.floor(t13 / 16), r = t13 % 16; return `${Ud[e] || e}${Ud[r] || r}`; }; var Gd = function({ r: t13, g: e, b: r }) { return Number.isNaN(+t13) || Number.isNaN(+e) || Number.isNaN(+r) ? "" : `#${ss(t13)}${ss(e)}${ss(r)}`; }; var Ll = { A: 10, B: 11, C: 12, D: 13, E: 14, F: 15 }; var Jn = function(t13) { return t13.length === 2 ? (Ll[t13[0].toUpperCase()] || +t13[0]) * 16 + (Ll[t13[1].toUpperCase()] || +t13[1]) : Ll[t13[1].toUpperCase()] || +t13[1]; }; var pk = function(t13, e, r) { e = e / 100, r = r / 100; let n = e; const a = Math.max(r, 0.01); r *= 2, e *= r <= 1 ? r : 2 - r, n *= a <= 1 ? a : 2 - a; const i = (r + e) / 2, o = r === 0 ? 2 * n / (a + n) : 2 * e / (r + e); return { h: t13, s: o * 100, v: i * 100 }; }; var Wd = (t13, e, r) => { t13 = Ka(t13, 255), e = Ka(e, 255), r = Ka(r, 255); const n = Math.max(t13, e, r), a = Math.min(t13, e, r); let i; const o = n, s = n - a, u = n === 0 ? 0 : s / n; if (n === a) i = 0; else { switch (n) { case t13: { i = (e - r) / s + (e < r ? 6 : 0); break; } case e: { i = (r - t13) / s + 2; break; } case r: { i = (t13 - e) / s + 4; break; } } i /= 6; } return { h: i * 360, s: u * 100, v: o * 100 }; }; var Di = function(t13, e, r) { t13 = Ka(t13, 360) * 6, e = Ka(e, 100), r = Ka(r, 100); const n = Math.floor(t13), a = t13 - n, i = r * (1 - e), o = r * (1 - a * e), s = r * (1 - (1 - a) * e), u = n % 6, l = [r, o, i, i, s, r][u], c = [s, r, r, o, i, i][u], d = [i, i, s, r, r, o][u]; return { r: Math.round(l * 255), g: Math.round(c * 255), b: Math.round(d * 255) }; }; var qi = class { constructor(e = {}) { this._hue = 0, this._saturation = 100, this._value = 100, this._alpha = 100, this.enableAlpha = false, this.format = "hex", this.value = ""; for (const r in e) va(e, r) && (this[r] = e[r]); e.value ? this.fromString(e.value) : this.doOnChange(); } set(e, r) { if (arguments.length === 1 && typeof e == "object") { for (const n in e) va(e, n) && this.set(n, e[n]); return; } this[`_${e}`] = r, this.doOnChange(); } get(e) { return e === "alpha" ? Math.floor(this[`_${e}`]) : this[`_${e}`]; } toRgb() { return Di(this._hue, this._saturation, this._value); } fromString(e) { if (!e) { this._hue = 0, this._saturation = 100, this._value = 100, this.doOnChange(); return; } const r = (n, a, i) => { this._hue = Math.max(0, Math.min(360, n)), this._saturation = Math.max(0, Math.min(100, a)), this._value = Math.max(0, Math.min(100, i)), this.doOnChange(); }; if (e.includes("hsl")) { const n = e.replace(/hsla|hsl|\(|\)/gm, "").split(/\s|,/g).filter((a) => a !== "").map((a, i) => i > 2 ? Number.parseFloat(a) : Number.parseInt(a, 10)); if (n.length === 4 ? this._alpha = Number.parseFloat(n[3]) * 100 : n.length === 3 && (this._alpha = 100), n.length >= 3) { const { h: a, s: i, v: o } = pk(n[0], n[1], n[2]); r(a, i, o); } } else if (e.includes("hsv")) { const n = e.replace(/hsva|hsv|\(|\)/gm, "").split(/\s|,/g).filter((a) => a !== "").map((a, i) => i > 2 ? Number.parseFloat(a) : Number.parseInt(a, 10)); n.length === 4 ? this._alpha = Number.parseFloat(n[3]) * 100 : n.length === 3 && (this._alpha = 100), n.length >= 3 && r(n[0], n[1], n[2]); } else if (e.includes("rgb")) { const n = e.replace(/rgba|rgb|\(|\)/gm, "").split(/\s|,/g).filter((a) => a !== "").map((a, i) => i > 2 ? Number.parseFloat(a) : Number.parseInt(a, 10)); if (n.length === 4 ? this._alpha = Number.parseFloat(n[3]) * 100 : n.length === 3 && (this._alpha = 100), n.length >= 3) { const { h: a, s: i, v: o } = Wd(n[0], n[1], n[2]); r(a, i, o); } } else if (e.includes("#")) { const n = e.replace("#", "").trim(); if (!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(n)) return; let a, i, o; n.length === 3 ? (a = Jn(n[0] + n[0]), i = Jn(n[1] + n[1]), o = Jn(n[2] + n[2])) : (n.length === 6 || n.length === 8) && (a = Jn(n.slice(0, 2)), i = Jn(n.slice(2, 4)), o = Jn(n.slice(4, 6))), n.length === 8 ? this._alpha = Jn(n.slice(6)) / 255 * 100 : (n.length === 3 || n.length === 6) && (this._alpha = 100); const { h: s, s: u, v: l } = Wd(a, i, o); r(s, u, l); } } compare(e) { return Math.abs(e._hue - this._hue) < 2 && Math.abs(e._saturation - this._saturation) < 1 && Math.abs(e._value - this._value) < 1 && Math.abs(e._alpha - this._alpha) < 1; } doOnChange() { const { _hue: e, _saturation: r, _value: n, _alpha: a, format: i } = this; if (this.enableAlpha) switch (i) { case "hsl": { const o = Kd(e, r / 100, n / 100); this.value = `hsla(${e}, ${Math.round(o[1] * 100)}%, ${Math.round(o[2] * 100)}%, ${this.get("alpha") / 100})`; break; } case "hsv": { this.value = `hsva(${e}, ${Math.round(r)}%, ${Math.round(n)}%, ${this.get("alpha") / 100})`; break; } case "hex": { this.value = `${Gd(Di(e, r, n))}${ss(a * 255 / 100)}`; break; } default: { const { r: o, g: s, b: u } = Di(e, r, n); this.value = `rgba(${o}, ${s}, ${u}, ${this.get("alpha") / 100})`; } } else switch (i) { case "hsl": { const o = Kd(e, r / 100, n / 100); this.value = `hsl(${e}, ${Math.round(o[1] * 100)}%, ${Math.round(o[2] * 100)}%)`; break; } case "hsv": { this.value = `hsv(${e}, ${Math.round(r)}%, ${Math.round(n)}%)`; break; } case "rgb": { const { r: o, g: s, b: u } = Di(e, r, n); this.value = `rgb(${o}, ${s}, ${u})`; break; } default: this.value = Gd(Di(e, r, n)); } } }; var gk = defineComponent({ props: { colors: { type: Array, required: true }, color: { type: Object, required: true }, enableAlpha: { type: Boolean, required: true } }, setup(t13) { const e = He("color-predefine"), { currentColor: r } = inject(Ih), n = ref(i(t13.colors, t13.color)); watch(() => r.value, (o) => { const s = new qi(); s.fromString(o), n.value.forEach((u) => { u.selected = s.compare(u); }); }), watchEffect(() => { n.value = i(t13.colors, t13.color); }); function a(o) { t13.color.fromString(t13.colors[o]); } function i(o, s) { return o.map((u) => { const l = new qi(); return l.enableAlpha = t13.enableAlpha, l.format = "rgba", l.fromString(u), l.selected = l.value === s.value, l; }); } return { rgbaColors: n, handleSelect: a, ns: e }; } }); function mk(t13, e, r, n, a, i) { return openBlock(), createElementBlock("div", { class: normalizeClass(t13.ns.b()) }, [ createBaseVNode("div", { class: normalizeClass(t13.ns.e("colors")) }, [ (openBlock(true), createElementBlock(Fragment, null, renderList(t13.rgbaColors, (o, s) => (openBlock(), createElementBlock("div", { key: t13.colors[s], class: normalizeClass([ t13.ns.e("color-selector"), t13.ns.is("alpha", o._alpha < 100), { selected: o.selected } ]), onClick: (u) => t13.handleSelect(s) }, [ createBaseVNode("div", { style: normalizeStyle({ backgroundColor: o.value }) }, null, 4) ], 10, ["onClick"]))), 128)) ], 2) ], 2); } var yk = ze(gk, [["render", mk], ["__file", "predefine.vue"]]); var bk = defineComponent({ name: "ElSlPanel", props: { color: { type: Object, required: true } }, setup(t13) { const e = He("color-svpanel"), r = getCurrentInstance(), n = ref(0), a = ref(0), i = ref("hsl(0, 100%, 50%)"), o = computed(() => { const l = t13.color.get("hue"), c = t13.color.get("value"); return { hue: l, value: c }; }); function s() { const l = t13.color.get("saturation"), c = t13.color.get("value"), d = r.vnode.el, { clientWidth: v, clientHeight: h6 } = d; a.value = l * v / 100, n.value = (100 - c) * h6 / 100, i.value = `hsl(${t13.color.get("hue")}, 100%, 50%)`; } function u(l) { const d = r.vnode.el.getBoundingClientRect(), { clientX: v, clientY: h6 } = Su(l); let f = v - d.left, p = h6 - d.top; f = Math.max(0, f), f = Math.min(f, d.width), p = Math.max(0, p), p = Math.min(p, d.height), a.value = f, n.value = p, t13.color.set({ saturation: f / d.width * 100, value: 100 - p / d.height * 100 }); } return watch(() => o.value, () => { s(); }), onMounted(() => { eo(r.vnode.el, { drag: (l) => { u(l); }, end: (l) => { u(l); } }), s(); }), { cursorTop: n, cursorLeft: a, background: i, colorValue: o, handleDrag: u, update: s, ns: e }; } }); function wk(t13, e, r, n, a, i) { return openBlock(), createElementBlock("div", { class: normalizeClass(t13.ns.b()), style: normalizeStyle({ backgroundColor: t13.background }) }, [ createBaseVNode("div", { class: normalizeClass(t13.ns.e("white")) }, null, 2), createBaseVNode("div", { class: normalizeClass(t13.ns.e("black")) }, null, 2), createBaseVNode("div", { class: normalizeClass(t13.ns.e("cursor")), style: normalizeStyle({ top: t13.cursorTop + "px", left: t13.cursorLeft + "px" }) }, [ createBaseVNode("div") ], 6) ], 6); } var xk = ze(bk, [["render", wk], ["__file", "sv-panel.vue"]]); var Ck = defineComponent({ name: "ElColorPicker" }); var Ek = defineComponent({ ...Ck, props: dk, emits: fk, setup(t13, { expose: e, emit: r }) { const n = t13, { t: a } = yo(), i = He("color"), { formItem: o } = Ta(), s = pa(), u = xo(), { inputId: l, isLabeledByFormItem: c } = Co(n, { formItemContext: o }), d = ref(), v = ref(), h6 = ref(), f = ref(), p = ref(), m = ref(), { isFocused: g, handleFocus: y, handleBlur: b } = Uu(p, { beforeFocus() { return u.value; }, beforeBlur($) { var G; return (G = f.value) == null ? void 0 : G.isFocusInsideContent($); }, afterBlur() { B(false), R(); } }); let w = true; const C = reactive(new qi({ enableAlpha: n.showAlpha, format: n.colorFormat || "", value: n.modelValue })), E = ref(false), x = ref(false), T = ref(""), k = computed(() => !n.modelValue && !x.value ? "transparent" : L(C, n.showAlpha)), _ = computed(() => !n.modelValue && !x.value ? "" : C.value), D = computed(() => c.value ? void 0 : n.ariaLabel || a("el.colorpicker.defaultLabel")), O = computed(() => c.value ? o == null ? void 0 : o.labelId : void 0), I = computed(() => [ i.b("picker"), i.is("disabled", u.value), i.bm("picker", s.value), i.is("focused", g.value) ]); function L($, G) { if (!($ instanceof qi)) throw new TypeError("color should be instance of _color Class"); const { r: Q, g: ge, b: Ee } = $.toRgb(); return G ? `rgba(${Q}, ${ge}, ${Ee}, ${$.get("alpha") / 100})` : `rgb(${Q}, ${ge}, ${Ee})`; } function B($) { E.value = $; } const F = $v(B, 100, { leading: true }); function M() { u.value || B(true); } function A() { F(false), R(); } function R() { nextTick(() => { n.modelValue ? C.fromString(n.modelValue) : (C.value = "", nextTick(() => { x.value = false; })); }); } function K() { u.value || F(!E.value); } function H() { C.fromString(T.value); } function q() { const $ = C.value; r(zt, $), r("change", $), n.validateEvent && (o == null || o.validate("change").catch((G) => Dt(G))), F(false), nextTick(() => { const G = new qi({ enableAlpha: n.showAlpha, format: n.colorFormat || "", value: n.modelValue }); C.compare(G) || R(); }); } function ee() { F(false), r(zt, null), r("change", null), n.modelValue !== null && n.validateEvent && (o == null || o.validate("change").catch(($) => Dt($))), R(); } function se() { E.value && (A(), g.value && ue()); } function oe($) { $.preventDefault(), $.stopPropagation(), B(false), R(); } function ae($) { switch ($.code) { case Lt.enter: case Lt.space: $.preventDefault(), $.stopPropagation(), M(), m.value.focus(); break; case Lt.esc: oe($); break; } } function ue() { p.value.focus(); } function te() { p.value.blur(); } return onMounted(() => { n.modelValue && (T.value = _.value); }), watch(() => n.modelValue, ($) => { $ ? $ && $ !== C.value && (w = false, C.fromString($)) : x.value = false; }), watch(() => [n.colorFormat, n.showAlpha], () => { C.enableAlpha = n.showAlpha, C.format = n.colorFormat || C.format, C.doOnChange(), r(zt, C.value); }), watch(() => _.value, ($) => { T.value = $, w && r("activeChange", $), w = true; }), watch(() => C.value, () => { !n.modelValue && !x.value && (x.value = true); }), watch(() => E.value, () => { nextTick(() => { var $, G, Q; ($ = d.value) == null || $.update(), (G = v.value) == null || G.update(), (Q = h6.value) == null || Q.update(); }); }), provide(Ih, { currentColor: _ }), e({ color: C, show: M, hide: A, focus: ue, blur: te }), ($, G) => (openBlock(), createBlock(unref(ko), { ref_key: "popper", ref: f, visible: E.value, "show-arrow": false, "fallback-placements": ["bottom", "top", "right", "left"], offset: 0, "gpu-acceleration": false, "popper-class": [unref(i).be("picker", "panel"), unref(i).b("dropdown"), $.popperClass], "stop-popper-mouse-event": false, effect: "light", trigger: "click", teleported: $.teleported, transition: `${unref(i).namespace.value}-zoom-in-top`, persistent: "", onHide: (Q) => B(false) }, { content: withCtx(() => [ withDirectives((openBlock(), createElementBlock("div", { onKeydown: withKeys(oe, ["esc"]) }, [ createBaseVNode("div", { class: normalizeClass(unref(i).be("dropdown", "main-wrapper")) }, [ createVNode(ck, { ref_key: "hue", ref: d, class: "hue-slider", color: unref(C), vertical: "" }, null, 8, ["color"]), createVNode(xk, { ref_key: "sv", ref: v, color: unref(C) }, null, 8, ["color"]) ], 2), $.showAlpha ? (openBlock(), createBlock(sk, { key: 0, ref_key: "alpha", ref: h6, color: unref(C) }, null, 8, ["color"])) : createCommentVNode("v-if", true), $.predefine ? (openBlock(), createBlock(yk, { key: 1, ref: "predefine", "enable-alpha": $.showAlpha, color: unref(C), colors: $.predefine }, null, 8, ["enable-alpha", "color", "colors"])) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass(unref(i).be("dropdown", "btns")) }, [ createBaseVNode("span", { class: normalizeClass(unref(i).be("dropdown", "value")) }, [ createVNode(unref(Eo), { ref_key: "inputRef", ref: m, modelValue: T.value, "onUpdate:modelValue": (Q) => T.value = Q, "validate-event": false, size: "small", onKeyup: withKeys(H, ["enter"]), onBlur: H }, null, 8, ["modelValue", "onUpdate:modelValue", "onKeyup"]) ], 2), createVNode(unref(Hr), { class: normalizeClass(unref(i).be("dropdown", "link-btn")), text: "", size: "small", onClick: ee }, { default: withCtx(() => [ createTextVNode(toDisplayString(unref(a)("el.colorpicker.clear")), 1) ]), _: 1 }, 8, ["class"]), createVNode(unref(Hr), { plain: "", size: "small", class: normalizeClass(unref(i).be("dropdown", "btn")), onClick: q }, { default: withCtx(() => [ createTextVNode(toDisplayString(unref(a)("el.colorpicker.confirm")), 1) ]), _: 1 }, 8, ["class"]) ], 2) ], 40, ["onKeydown"])), [ [unref(Th), se] ]) ]), default: withCtx(() => [ createBaseVNode("div", mergeProps({ id: unref(l), ref_key: "triggerRef", ref: p }, $.$attrs, { class: unref(I), role: "button", "aria-label": unref(D), "aria-labelledby": unref(O), "aria-description": unref(a)("el.colorpicker.description", { color: $.modelValue || "" }), "aria-disabled": unref(u), tabindex: unref(u) ? -1 : $.tabindex, onKeydown: ae, onFocus: unref(y), onBlur: unref(b) }), [ unref(u) ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(i).be("picker", "mask")) }, null, 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass(unref(i).be("picker", "trigger")), onClick: K }, [ createBaseVNode("span", { class: normalizeClass([unref(i).be("picker", "color"), unref(i).is("alpha", $.showAlpha)]) }, [ createBaseVNode("span", { class: normalizeClass(unref(i).be("picker", "color-inner")), style: normalizeStyle({ backgroundColor: unref(k) }) }, [ withDirectives(createVNode(unref(Vt), { class: normalizeClass([unref(i).be("picker", "icon"), unref(i).is("icon-arrow-down")]) }, { default: withCtx(() => [ createVNode(unref(Gs)) ]), _: 1 }, 8, ["class"]), [ [vShow, $.modelValue || x.value] ]), withDirectives(createVNode(unref(Vt), { class: normalizeClass([unref(i).be("picker", "empty"), unref(i).is("icon-close")]) }, { default: withCtx(() => [ createVNode(unref(Ss)) ]), _: 1 }, 8, ["class"]), [ [vShow, !$.modelValue && !x.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 kk = ze(Ek, [["__file", "color-picker.vue"]]); var Sk = $t(kk); var Tk = defineComponent({ name: "ElContainer" }); var _k = defineComponent({ ...Tk, props: { direction: { type: String } }, setup(t13) { const e = t13, r = useSlots(), n = He("container"), a = computed(() => e.direction === "vertical" ? true : e.direction === "horizontal" ? false : r && r.default ? r.default().some((o) => { const s = o.type.name; return s === "ElHeader" || s === "ElFooter"; }) : false); return (i, o) => (openBlock(), createElementBlock("section", { class: normalizeClass([unref(n).b(), unref(n).is("vertical", unref(a))]) }, [ renderSlot(i.$slots, "default") ], 2)); } }); var Dk = ze(_k, [["__file", "container.vue"]]); var Pk = defineComponent({ name: "ElAside" }); var Ok = defineComponent({ ...Pk, props: { width: { type: String, default: null } }, setup(t13) { const e = t13, r = He("aside"), n = computed(() => e.width ? r.cssVarBlock({ width: e.width }) : {}); return (a, i) => (openBlock(), createElementBlock("aside", { class: normalizeClass(unref(r).b()), style: normalizeStyle(unref(n)) }, [ renderSlot(a.$slots, "default") ], 6)); } }); var Ah = ze(Ok, [["__file", "aside.vue"]]); var Lk = defineComponent({ name: "ElFooter" }); var Fk = defineComponent({ ...Lk, props: { height: { type: String, default: null } }, setup(t13) { const e = t13, r = He("footer"), n = computed(() => e.height ? r.cssVarBlock({ height: e.height }) : {}); return (a, i) => (openBlock(), createElementBlock("footer", { class: normalizeClass(unref(r).b()), style: normalizeStyle(unref(n)) }, [ renderSlot(a.$slots, "default") ], 6)); } }); var Mh = ze(Fk, [["__file", "footer.vue"]]); var Ik = defineComponent({ name: "ElHeader" }); var Ak = defineComponent({ ...Ik, props: { height: { type: String, default: null } }, setup(t13) { const e = t13, r = He("header"), n = computed(() => e.height ? r.cssVarBlock({ height: e.height }) : {}); return (a, i) => (openBlock(), createElementBlock("header", { class: normalizeClass(unref(r).b()), style: normalizeStyle(unref(n)) }, [ renderSlot(a.$slots, "default") ], 6)); } }); var Bh = ze(Ak, [["__file", "header.vue"]]); var Mk = defineComponent({ name: "ElMain" }); var Bk = defineComponent({ ...Mk, setup(t13) { const e = He("main"); return (r, n) => (openBlock(), createElementBlock("main", { class: normalizeClass(unref(e).b()) }, [ renderSlot(r.$slots, "default") ], 2)); } }); var Nh = ze(Bk, [["__file", "main.vue"]]); var $h = $t(Dk, { Aside: Ah, Footer: Mh, Header: Bh, Main: Nh }); xn(Ah); xn(Mh); var Rh = xn(Bh); var Ju = xn(Nh); var Nk = defineComponent({ inheritAttrs: false }); function $k(t13, e, r, n, a, i) { return renderSlot(t13.$slots, "default"); } var Rk = ze(Nk, [["render", $k], ["__file", "collection.vue"]]); var zk = defineComponent({ name: "ElCollectionItem", inheritAttrs: false }); function Vk(t13, e, r, n, a, i) { return renderSlot(t13.$slots, "default"); } var Hk = ze(zk, [["render", Vk], ["__file", "collection-item.vue"]]); var qk = "data-el-collection-item"; var Kk = (t13) => { const e = `El${t13}Collection`, r = `${e}Item`, n = Symbol(e), a = Symbol(r), i = { ...Rk, name: e, setup() { const s = ref(null), u = /* @__PURE__ */ new Map(); provide(n, { itemMap: u, getItems: () => { const c = unref(s); if (!c) return []; const d = Array.from(c.querySelectorAll(`[${qk}]`)); return [...u.values()].sort((h6, f) => d.indexOf(h6.ref) - d.indexOf(f.ref)); }, collectionRef: s }); } }, o = { ...Hk, name: r, setup(s, { attrs: u }) { const l = ref(null), c = inject(n, void 0); provide(a, { collectionItemRef: l }), onMounted(() => { const d = unref(l); d && c.itemMap.set(d, { ref: d, ...u }); }), onBeforeUnmount(() => { const d = unref(l); c.itemMap.delete(d); }); } }; return { COLLECTION_INJECTION_KEY: n, COLLECTION_ITEM_INJECTION_KEY: a, ElCollection: i, ElCollectionItem: o }; }; var Fl = rt({ trigger: Ji.trigger, effect: { ...cr.effect, default: "light" }, type: { type: $e(String) }, placement: { type: $e(String), default: "bottom" }, popperOptions: { type: $e(Object), default: () => ({}) }, id: String, size: { type: String, default: "" }, splitButton: Boolean, hideOnClick: { type: Boolean, default: true }, loop: { type: Boolean, default: true }, showTimeout: { type: Number, default: 150 }, hideTimeout: { type: Number, default: 150 }, tabindex: { type: $e([Number, String]), default: 0 }, maxHeight: { type: $e([Number, String]), default: "" }, popperClass: { type: String, default: "" }, disabled: Boolean, role: { type: String, default: "menu" }, buttonProps: { type: $e(Object) }, teleported: cr.teleported }); rt({ command: { type: [Object, String, Number], default: () => ({}) }, disabled: Boolean, divided: Boolean, textValue: String, icon: { type: Hn } }); rt({ onKeydown: { type: $e(Function) } }); Kk("Dropdown"); var zh = Symbol("ElSelectGroup"); var To = Symbol("ElSelect"); function Uk(t13, e) { const r = inject(To), n = inject(zh, { disabled: false }), a = computed(() => c(In(r.props.modelValue), t13.value)), i = computed(() => { var h6; if (r.props.multiple) { const f = In((h6 = r.props.modelValue) != null ? h6 : []); return !a.value && f.length >= r.props.multipleLimit && r.props.multipleLimit > 0; } else return false; }), o = computed(() => t13.label || (Ht(t13.value) ? "" : t13.value)), s = computed(() => t13.value || t13.label || ""), u = computed(() => t13.disabled || e.groupDisabled || i.value), l = getCurrentInstance(), c = (h6 = [], f) => { if (Ht(t13.value)) { const p = r.props.valueKey; return h6 && h6.some((m) => toRaw(fn(m, p)) === fn(f, p)); } else return h6 && h6.includes(f); }, d = () => { !t13.disabled && !n.disabled && (r.states.hoveringIndex = r.optionsArray.indexOf(l.proxy)); }, v = (h6) => { const f = new RegExp(Yb(h6), "i"); e.visible = f.test(o.value) || t13.created; }; return watch(() => o.value, () => { !t13.created && !r.props.remote && r.setSelected(); }), watch(() => t13.value, (h6, f) => { const { remote: p, valueKey: m } = r.props; if (h6 !== f && (r.onOptionDestroy(f, l.proxy), r.onOptionCreate(l.proxy)), !t13.created && !p) { if (m && Ht(h6) && Ht(f) && h6[m] === f[m]) return; r.setSelected(); } }), watch(() => n.disabled, () => { e.groupDisabled = n.disabled; }, { immediate: true }), { select: r, currentLabel: o, currentValue: s, itemSelected: a, isDisabled: u, hoverItem: d, updateOption: v }; } var Gk = defineComponent({ name: "ElOption", componentName: "ElOption", props: { value: { required: true, type: [String, Number, Boolean, Object] }, label: [String, Number], created: Boolean, disabled: Boolean }, setup(t13) { const e = He("select"), r = Xs(), n = computed(() => [ e.be("dropdown", "item"), e.is("disabled", unref(s)), e.is("selected", unref(o)), e.is("hovering", unref(v)) ]), a = reactive({ index: -1, groupDisabled: false, visible: true, hover: false }), { currentLabel: i, itemSelected: o, isDisabled: s, select: u, hoverItem: l, updateOption: c } = Uk(t13, a), { visible: d, hover: v } = toRefs(a), h6 = getCurrentInstance().proxy; u.onOptionCreate(h6), onBeforeUnmount(() => { const p = h6.value, { selected: m } = u.states, y = (u.props.multiple ? m : [m]).some((b) => b.value === h6.value); nextTick(() => { u.states.cachedOptions.get(p) === h6 && !y && u.states.cachedOptions.delete(p); }), u.onOptionDestroy(p, h6); }); function f() { s.value || u.handleOptionSelect(h6); } return { ns: e, id: r, containerKls: n, currentLabel: i, itemSelected: o, isDisabled: s, select: u, hoverItem: l, updateOption: c, visible: d, hover: v, selectOptionClick: f, states: a }; } }); function Wk(t13, e, r, n, a, i) { return withDirectives((openBlock(), createElementBlock("li", { id: t13.id, class: normalizeClass(t13.containerKls), role: "option", "aria-disabled": t13.isDisabled || void 0, "aria-selected": t13.itemSelected, onMouseenter: t13.hoverItem, onClick: withModifiers(t13.selectOptionClick, ["stop"]) }, [ renderSlot(t13.$slots, "default", {}, () => [ createBaseVNode("span", null, toDisplayString(t13.currentLabel), 1) ]) ], 42, ["id", "aria-disabled", "aria-selected", "onMouseenter", "onClick"])), [ [vShow, t13.visible] ]); } var ec = ze(Gk, [["render", Wk], ["__file", "option.vue"]]); var Yk = defineComponent({ name: "ElSelectDropdown", componentName: "ElSelectDropdown", setup() { const t13 = inject(To), e = He("select"), r = computed(() => t13.props.popperClass), n = computed(() => t13.props.multiple), a = computed(() => t13.props.fitInputWidth), i = ref(""); function o() { var s; i.value = `${(s = t13.selectRef) == null ? void 0 : s.offsetWidth}px`; } return onMounted(() => { o(), dn(t13.selectRef, o); }), { ns: e, minWidth: i, popperClass: r, isMultiple: n, isFitInputWidth: a }; } }); function Zk(t13, e, r, n, a, i) { return openBlock(), createElementBlock("div", { class: normalizeClass([t13.ns.b("dropdown"), t13.ns.is("multiple", t13.isMultiple), t13.popperClass]), style: normalizeStyle({ [t13.isFitInputWidth ? "width" : "minWidth"]: t13.minWidth }) }, [ t13.$slots.header ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(t13.ns.be("dropdown", "header")) }, [ renderSlot(t13.$slots, "header") ], 2)) : createCommentVNode("v-if", true), renderSlot(t13.$slots, "default"), t13.$slots.footer ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(t13.ns.be("dropdown", "footer")) }, [ renderSlot(t13.$slots, "footer") ], 2)) : createCommentVNode("v-if", true) ], 6); } var Xk = ze(Yk, [["render", Zk], ["__file", "select-dropdown.vue"]]); var jk = 11; var Qk = (t13, e) => { const { t: r } = yo(), n = Xs(), a = He("select"), i = He("input"), o = reactive({ inputValue: "", options: /* @__PURE__ */ new Map(), cachedOptions: /* @__PURE__ */ new Map(), disabledOptions: /* @__PURE__ */ new Map(), optionValues: [], selected: [], selectionWidth: 0, calculatorWidth: 0, collapseItemWidth: 0, selectedLabel: "", hoveringIndex: -1, previousQuery: null, inputHovering: false, menuVisibleOnFocus: false, isBeforeHide: false }), s = ref(null), u = ref(null), l = ref(null), c = ref(null), d = ref(null), v = ref(null), h6 = ref(null), f = ref(null), p = ref(null), m = ref(null), g = ref(null), y = ref(null), { isComposing: b, handleCompositionStart: w, handleCompositionUpdate: C, handleCompositionEnd: E } = vh({ afterComposition: (W) => ie(W) }), { wrapperRef: x, isFocused: T } = Uu(d, { beforeFocus() { return F.value; }, afterFocus() { t13.automaticDropdown && !k.value && (k.value = true, o.menuVisibleOnFocus = true); }, beforeBlur(W) { var we, We2; return ((we = l.value) == null ? void 0 : we.isFocusInsideContent(W)) || ((We2 = c.value) == null ? void 0 : We2.isFocusInsideContent(W)); }, afterBlur() { k.value = false, o.menuVisibleOnFocus = false; } }), k = ref(false), _ = ref(), { form: D, formItem: O } = Ta(), { inputId: I } = Co(t13, { formItemContext: O }), { valueOnClear: L, isEmptyValue: B } = dx(t13), F = computed(() => t13.disabled || (D == null ? void 0 : D.disabled)), M = computed(() => fr(t13.modelValue) ? t13.modelValue.length > 0 : !B(t13.modelValue)), A = computed(() => t13.clearable && !F.value && o.inputHovering && M.value), R = computed(() => t13.remote && t13.filterable && !t13.remoteShowSuffix ? "" : t13.suffixIcon), K = computed(() => a.is("reverse", R.value && k.value)), H = computed(() => (O == null ? void 0 : O.validateState) || ""), q = computed(() => Kv[H.value]), ee = computed(() => t13.remote ? 300 : 0), se = computed(() => t13.loading ? t13.loadingText || r("el.select.loading") : t13.remote && !o.inputValue && o.options.size === 0 ? false : t13.filterable && o.inputValue && o.options.size > 0 && oe.value === 0 ? t13.noMatchText || r("el.select.noMatch") : o.options.size === 0 ? t13.noDataText || r("el.select.noData") : null), oe = computed(() => ae.value.filter((W) => W.visible).length), ae = computed(() => { const W = Array.from(o.options.values()), we = []; return o.optionValues.forEach((We2) => { const at2 = W.findIndex((Gr2) => Gr2.value === We2); at2 > -1 && we.push(W[at2]); }), we.length >= W.length ? we : W; }), ue = computed(() => Array.from(o.cachedOptions.values())), te = computed(() => { const W = ae.value.filter((we) => !we.created).some((we) => we.currentLabel === o.inputValue); return t13.filterable && t13.allowCreate && o.inputValue !== "" && !W; }), $ = () => { t13.filterable && lr(t13.filterMethod) || t13.filterable && t13.remote && lr(t13.remoteMethod) || ae.value.forEach((W) => { var we; (we = W.updateOption) == null || we.call(W, o.inputValue); }); }, G = pa(), Q = computed(() => ["small"].includes(G.value) ? "small" : "default"), ge = computed({ get() { return k.value && se.value !== false; }, set(W) { k.value = W; } }), Ee = computed(() => { if (t13.multiple && !Mn(t13.modelValue)) return In(t13.modelValue).length === 0 && !o.inputValue; const W = fr(t13.modelValue) ? t13.modelValue[0] : t13.modelValue; return t13.filterable || Mn(W) ? !o.inputValue : true; }), fe = computed(() => { var W; const we = (W = t13.placeholder) != null ? W : r("el.select.placeholder"); return t13.multiple || !M.value ? we : o.selectedLabel; }), me = computed(() => Gl ? null : "mouseenter"); watch(() => t13.modelValue, (W, we) => { t13.multiple && t13.filterable && !t13.reserveKeyword && (o.inputValue = "", xe("")), Ce(), !Es(W, we) && t13.validateEvent && (O == null || O.validate("change").catch((We2) => Dt(We2))); }, { flush: "post", deep: true }), watch(() => k.value, (W) => { W ? xe(o.inputValue) : (o.inputValue = "", o.previousQuery = null, o.isBeforeHide = true), e("visible-change", W); }), watch(() => o.options.entries(), () => { var W; if (!_t) return; const we = ((W = s.value) == null ? void 0 : W.querySelectorAll("input")) || []; (!t13.filterable && !t13.defaultFirstOption && !Mn(t13.modelValue) || !Array.from(we).includes(document.activeElement)) && Ce(), t13.defaultFirstOption && (t13.filterable || t13.remote) && oe.value && ke(); }, { flush: "post" }), watch(() => o.hoveringIndex, (W) => { qt(W) && W > -1 ? _.value = ae.value[W] || {} : _.value = {}, ae.value.forEach((we) => { we.hover = _.value === we; }); }), watchEffect(() => { o.isBeforeHide || $(); }); const xe = (W) => { o.previousQuery === W || b.value || (o.previousQuery = W, t13.filterable && lr(t13.filterMethod) ? t13.filterMethod(W) : t13.filterable && t13.remote && lr(t13.remoteMethod) && t13.remoteMethod(W), t13.defaultFirstOption && (t13.filterable || t13.remote) && oe.value ? nextTick(ke) : nextTick(qe)); }, ke = () => { const W = ae.value.filter((at2) => at2.visible && !at2.disabled && !at2.states.groupDisabled), we = W.find((at2) => at2.created), We2 = W[0]; o.hoveringIndex = _e(ae.value, we || We2); }, Ce = () => { if (t13.multiple) o.selectedLabel = ""; else { const we = fr(t13.modelValue) ? t13.modelValue[0] : t13.modelValue, We2 = De(we); o.selectedLabel = We2.currentLabel, o.selected = [We2]; return; } const W = []; Mn(t13.modelValue) || In(t13.modelValue).forEach((we) => { W.push(De(we)); }), o.selected = W; }, De = (W) => { let we; const We2 = bl(W).toLowerCase() === "object", at2 = bl(W).toLowerCase() === "null", Gr2 = bl(W).toLowerCase() === "undefined"; for (let sn2 = o.cachedOptions.size - 1; sn2 >= 0; sn2--) { const xr2 = ue.value[sn2]; if (We2 ? fn(xr2.value, t13.valueKey) === fn(W, t13.valueKey) : xr2.value === W) { we = { value: W, currentLabel: xr2.currentLabel, get isDisabled() { return xr2.isDisabled; } }; break; } } if (we) return we; const Sn2 = We2 ? W.label : !at2 && !Gr2 ? W : ""; return { value: W, currentLabel: Sn2 }; }, qe = () => { o.hoveringIndex = ae.value.findIndex((W) => o.selected.some((we) => Xt2(we) === Xt2(W))); }, Ke = () => { o.selectionWidth = u.value.getBoundingClientRect().width; }, Be = () => { o.calculatorWidth = v.value.getBoundingClientRect().width; }, Ge = () => { o.collapseItemWidth = g.value.getBoundingClientRect().width; }, le = () => { var W, we; (we = (W = l.value) == null ? void 0 : W.updatePopper) == null || we.call(W); }, S = () => { var W, we; (we = (W = c.value) == null ? void 0 : W.updatePopper) == null || we.call(W); }, z = () => { o.inputValue.length > 0 && !k.value && (k.value = true), xe(o.inputValue); }, ie = (W) => { if (o.inputValue = W.target.value, t13.remote) j(); else return z(); }, j = $v(() => { z(); }, ee.value), Y = (W) => { Es(t13.modelValue, W) || e(Mu, W); }, pe = (W) => Hb(W, (we) => !o.disabledOptions.has(we)), re = (W) => { if (t13.multiple && W.code !== Lt.delete && W.target.value.length <= 0) { const we = In(t13.modelValue).slice(), We2 = pe(we); if (We2 < 0) return; const at2 = we[We2]; we.splice(We2, 1), e(zt, we), Y(we), e("remove-tag", at2); } }, ve = (W, we) => { const We2 = o.selected.indexOf(we); if (We2 > -1 && !F.value) { const at2 = In(t13.modelValue).slice(); at2.splice(We2, 1), e(zt, at2), Y(at2), e("remove-tag", we.value); } W.stopPropagation(), kt(); }, Ae = (W) => { W.stopPropagation(); const we = t13.multiple ? [] : L.value; if (t13.multiple) for (const We2 of o.selected) We2.isDisabled && we.push(We2.value); e(zt, we), Y(we), o.hoveringIndex = -1, k.value = false, e("clear"), kt(); }, Me = (W) => { var we; if (t13.multiple) { const We2 = In((we = t13.modelValue) != null ? we : []).slice(), at2 = _e(We2, W.value); at2 > -1 ? We2.splice(at2, 1) : (t13.multipleLimit <= 0 || We2.length < t13.multipleLimit) && We2.push(W.value), e(zt, We2), Y(We2), W.created && xe(""), t13.filterable && !t13.reserveKeyword && (o.inputValue = ""); } else e(zt, W.value), Y(W.value), k.value = false; kt(), !k.value && nextTick(() => { Ne(W); }); }, _e = (W = [], we) => { if (!Ht(we)) return W.indexOf(we); const We2 = t13.valueKey; let at2 = -1; return W.some((Gr2, Sn2) => toRaw(fn(Gr2, We2)) === fn(we, We2) ? (at2 = Sn2, true) : false), at2; }, Ne = (W) => { var we, We2, at2, Gr2, Sn2; const Oa2 = fr(W) ? W[0] : W; let sn2 = null; if (Oa2 != null && Oa2.value) { const xr2 = ae.value.filter((Tn) => Tn.value === Oa2.value); xr2.length > 0 && (sn2 = xr2[0].$el); } if (l.value && sn2) { const xr2 = (Gr2 = (at2 = (We2 = (we = l.value) == null ? void 0 : we.popperRef) == null ? void 0 : We2.contentRef) == null ? void 0 : at2.querySelector) == null ? void 0 : Gr2.call(at2, `.${a.be("dropdown", "wrap")}`); xr2 && jb(xr2, sn2); } (Sn2 = y.value) == null || Sn2.handleScroll(); }, Te = (W) => { o.options.set(W.value, W), o.cachedOptions.set(W.value, W), W.disabled && o.disabledOptions.set(W.value, W); }, Oe = (W, we) => { o.options.get(W) === we && o.options.delete(W); }, ut = computed(() => { var W, we; return (we = (W = l.value) == null ? void 0 : W.popperRef) == null ? void 0 : we.contentRef; }), nt2 = () => { o.isBeforeHide = false, nextTick(() => Ne(o.selected)); }, kt = () => { var W; (W = d.value) == null || W.focus(); }, St2 = () => { var W; (W = d.value) == null || W.blur(); }, wt = (W) => { Ae(W); }, Zt = () => { k.value = false, T.value && St2(); }, Pt2 = () => { o.inputValue.length > 0 ? o.inputValue = "" : k.value = false; }, Mt = () => { F.value || (Gl && (o.inputHovering = true), o.menuVisibleOnFocus ? o.menuVisibleOnFocus = false : k.value = !k.value); }, gr2 = () => { k.value ? ae.value[o.hoveringIndex] && Me(ae.value[o.hoveringIndex]) : Mt(); }, Xt2 = (W) => Ht(W.value) ? fn(W.value, t13.valueKey) : W.value, jt2 = computed(() => ae.value.filter((W) => W.visible).every((W) => W.disabled)), wr2 = computed(() => t13.multiple ? t13.collapseTags ? o.selected.slice(0, t13.maxCollapseTags) : o.selected : []), Pr2 = computed(() => t13.multiple ? t13.collapseTags ? o.selected.slice(t13.maxCollapseTags) : [] : []), ur2 = (W) => { if (!k.value) { k.value = true; return; } if (!(o.options.size === 0 || o.filteredOptionsCount === 0 || b.value) && !jt2.value) { W === "next" ? (o.hoveringIndex++, o.hoveringIndex === o.options.size && (o.hoveringIndex = 0)) : W === "prev" && (o.hoveringIndex--, o.hoveringIndex < 0 && (o.hoveringIndex = o.options.size - 1)); const we = ae.value[o.hoveringIndex]; (we.disabled === true || we.states.groupDisabled === true || !we.visible) && ur2(W), nextTick(() => Ne(_.value)); } }, xt = () => { if (!u.value) return 0; const W = window.getComputedStyle(u.value); return Number.parseFloat(W.gap || "6px"); }, Tt = computed(() => { const W = xt(); return { maxWidth: `${g.value && t13.maxCollapseTags === 1 ? o.selectionWidth - o.collapseItemWidth - W : o.selectionWidth}px` }; }), Bt2 = computed(() => ({ maxWidth: `${o.selectionWidth}px` })), kn2 = computed(() => ({ width: `${Math.max(o.calculatorWidth, jk)}px` })); return dn(u, Ke), dn(v, Be), dn(p, le), dn(x, le), dn(m, S), dn(g, Ge), onMounted(() => { Ce(); }), { inputId: I, contentId: n, nsSelect: a, nsInput: i, states: o, isFocused: T, expanded: k, optionsArray: ae, hoverOption: _, selectSize: G, filteredOptionsCount: oe, resetCalculatorWidth: Be, updateTooltip: le, updateTagTooltip: S, debouncedOnInputChange: j, onInput: ie, deletePrevTag: re, deleteTag: ve, deleteSelected: Ae, handleOptionSelect: Me, scrollToOption: Ne, hasModelValue: M, shouldShowPlaceholder: Ee, currentPlaceholder: fe, mouseEnterEventName: me, showClose: A, iconComponent: R, iconReverse: K, validateState: H, validateIcon: q, showNewOption: te, updateOptions: $, collapseTagSize: Q, setSelected: Ce, selectDisabled: F, emptyText: se, handleCompositionStart: w, handleCompositionUpdate: C, handleCompositionEnd: E, onOptionCreate: Te, onOptionDestroy: Oe, handleMenuEnter: nt2, focus: kt, blur: St2, handleClearClick: wt, handleClickOutside: Zt, handleEsc: Pt2, toggleMenu: Mt, selectOption: gr2, getValueKey: Xt2, navigateOptions: ur2, dropdownMenuVisible: ge, showTagList: wr2, collapseTagList: Pr2, tagStyle: Tt, collapseTagStyle: Bt2, inputStyle: kn2, popperRef: ut, inputRef: d, tooltipRef: l, tagTooltipRef: c, calculatorRef: v, prefixRef: h6, suffixRef: f, selectRef: s, wrapperRef: x, selectionRef: u, scrollbarRef: y, menuRef: p, tagMenuRef: m, collapseItemRef: g }; }; var Jk = defineComponent({ name: "ElOptions", setup(t13, { slots: e }) { const r = inject(To); let n = []; return () => { var a, i; const o = (a = e.default) == null ? void 0 : a.call(e), s = []; function u(l) { fr(l) && l.forEach((c) => { var d, v, h6, f; const p = (d = (c == null ? void 0 : c.type) || {}) == null ? void 0 : d.name; p === "ElOptionGroup" ? u(!tr(c.children) && !fr(c.children) && lr((v = c.children) == null ? void 0 : v.default) ? (h6 = c.children) == null ? void 0 : h6.default() : c.children) : p === "ElOption" ? s.push((f = c.props) == null ? void 0 : f.value) : fr(c.children) && u(c.children); }); } return o.length && u((i = o[0]) == null ? void 0 : i.children), Es(s, n) || (n = s, r && (r.states.optionValues = s)), o; }; } }); var eS = rt({ name: String, id: String, modelValue: { type: [Array, String, Number, Boolean, Object], default: void 0 }, autocomplete: { type: String, default: "off" }, automaticDropdown: Boolean, size: di, effect: { type: $e(String), default: "light" }, disabled: Boolean, clearable: Boolean, filterable: Boolean, allowCreate: Boolean, loading: Boolean, popperClass: { type: String, default: "" }, popperOptions: { type: $e(Object), default: () => ({}) }, remote: Boolean, loadingText: String, noMatchText: String, noDataText: String, remoteMethod: Function, filterMethod: Function, multiple: Boolean, multipleLimit: { type: Number, default: 0 }, placeholder: { type: String }, defaultFirstOption: Boolean, reserveKeyword: { type: Boolean, default: true }, valueKey: { type: String, default: "value" }, collapseTags: Boolean, collapseTagsTooltip: Boolean, maxCollapseTags: { type: Number, default: 1 }, teleported: cr.teleported, persistent: { type: Boolean, default: true }, clearIcon: { type: Hn, default: Iu }, fitInputWidth: Boolean, suffixIcon: { type: Hn, default: Gs }, tagType: { ...au.type, default: "info" }, tagEffect: { ...au.effect, default: "light" }, validateEvent: { type: Boolean, default: true }, remoteShowSuffix: Boolean, placement: { type: $e(String), values: Ys, default: "bottom-start" }, fallbackPlacements: { type: $e(Array), default: ["bottom-start", "top-start", "right", "left"] }, appendTo: String, ...cx, ...Zn(["ariaLabel"]) }); var Yd = "ElSelect"; var tS = defineComponent({ name: Yd, componentName: Yd, components: { ElSelectMenu: Xk, ElOption: ec, ElOptions: Jk, ElTag: zE, ElScrollbar: Vx, ElTooltip: ko, ElIcon: Vt }, directives: { ClickOutside: Th }, props: eS, emits: [ zt, Mu, "remove-tag", "clear", "visible-change", "focus", "blur" ], setup(t13, { emit: e }) { const r = computed(() => { const { modelValue: i, multiple: o } = t13, s = o ? [] : void 0; return fr(i) ? o ? i : s : o ? s : i; }), n = reactive({ ...toRefs(t13), modelValue: r }), a = Qk(n, e); return provide(To, reactive({ props: n, states: a.states, optionsArray: a.optionsArray, handleOptionSelect: a.handleOptionSelect, onOptionCreate: a.onOptionCreate, onOptionDestroy: a.onOptionDestroy, selectRef: a.selectRef, setSelected: a.setSelected })), { ...a, modelValue: r }; } }); function rS(t13, e, r, n, a, i) { const o = resolveComponent("el-tag"), s = resolveComponent("el-tooltip"), u = resolveComponent("el-icon"), l = resolveComponent("el-option"), c = resolveComponent("el-options"), d = resolveComponent("el-scrollbar"), v = resolveComponent("el-select-menu"), h6 = resolveDirective("click-outside"); return withDirectives((openBlock(), createElementBlock("div", { ref: "selectRef", class: normalizeClass([t13.nsSelect.b(), t13.nsSelect.m(t13.selectSize)]), [toHandlerKey(t13.mouseEnterEventName)]: (f) => t13.states.inputHovering = true, onMouseleave: (f) => t13.states.inputHovering = false }, [ createVNode(s, { ref: "tooltipRef", visible: t13.dropdownMenuVisible, placement: t13.placement, teleported: t13.teleported, "popper-class": [t13.nsSelect.e("popper"), t13.popperClass], "popper-options": t13.popperOptions, "fallback-placements": t13.fallbackPlacements, effect: t13.effect, pure: "", trigger: "click", transition: `${t13.nsSelect.namespace.value}-zoom-in-top`, "stop-popper-mouse-event": false, "gpu-acceleration": false, persistent: t13.persistent, "append-to": t13.appendTo, onBeforeShow: t13.handleMenuEnter, onHide: (f) => t13.states.isBeforeHide = false }, { default: withCtx(() => { var f; return [ createBaseVNode("div", { ref: "wrapperRef", class: normalizeClass([ t13.nsSelect.e("wrapper"), t13.nsSelect.is("focused", t13.isFocused), t13.nsSelect.is("hovering", t13.states.inputHovering), t13.nsSelect.is("filterable", t13.filterable), t13.nsSelect.is("disabled", t13.selectDisabled) ]), onClick: withModifiers(t13.toggleMenu, ["prevent"]) }, [ t13.$slots.prefix ? (openBlock(), createElementBlock("div", { key: 0, ref: "prefixRef", class: normalizeClass(t13.nsSelect.e("prefix")) }, [ renderSlot(t13.$slots, "prefix") ], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { ref: "selectionRef", class: normalizeClass([ t13.nsSelect.e("selection"), t13.nsSelect.is("near", t13.multiple && !t13.$slots.prefix && !!t13.states.selected.length) ]) }, [ t13.multiple ? renderSlot(t13.$slots, "tag", { key: 0 }, () => [ (openBlock(true), createElementBlock(Fragment, null, renderList(t13.showTagList, (p) => (openBlock(), createElementBlock("div", { key: t13.getValueKey(p), class: normalizeClass(t13.nsSelect.e("selected-item")) }, [ createVNode(o, { closable: !t13.selectDisabled && !p.isDisabled, size: t13.collapseTagSize, type: t13.tagType, effect: t13.tagEffect, "disable-transitions": "", style: normalizeStyle(t13.tagStyle), onClose: (m) => t13.deleteTag(m, p) }, { default: withCtx(() => [ createBaseVNode("span", { class: normalizeClass(t13.nsSelect.e("tags-text")) }, [ renderSlot(t13.$slots, "label", { label: p.currentLabel, value: p.value }, () => [ createTextVNode(toDisplayString(p.currentLabel), 1) ]) ], 2) ]), _: 2 }, 1032, ["closable", "size", "type", "effect", "style", "onClose"]) ], 2))), 128)), t13.collapseTags && t13.states.selected.length > t13.maxCollapseTags ? (openBlock(), createBlock(s, { key: 0, ref: "tagTooltipRef", disabled: t13.dropdownMenuVisible || !t13.collapseTagsTooltip, "fallback-placements": ["bottom", "top", "right", "left"], effect: t13.effect, placement: "bottom", teleported: t13.teleported }, { default: withCtx(() => [ createBaseVNode("div", { ref: "collapseItemRef", class: normalizeClass(t13.nsSelect.e("selected-item")) }, [ createVNode(o, { closable: false, size: t13.collapseTagSize, type: t13.tagType, effect: t13.tagEffect, "disable-transitions": "", style: normalizeStyle(t13.collapseTagStyle) }, { default: withCtx(() => [ createBaseVNode("span", { class: normalizeClass(t13.nsSelect.e("tags-text")) }, " + " + toDisplayString(t13.states.selected.length - t13.maxCollapseTags), 3) ]), _: 1 }, 8, ["size", "type", "effect", "style"]) ], 2) ]), content: withCtx(() => [ createBaseVNode("div", { ref: "tagMenuRef", class: normalizeClass(t13.nsSelect.e("selection")) }, [ (openBlock(true), createElementBlock(Fragment, null, renderList(t13.collapseTagList, (p) => (openBlock(), createElementBlock("div", { key: t13.getValueKey(p), class: normalizeClass(t13.nsSelect.e("selected-item")) }, [ createVNode(o, { class: "in-tooltip", closable: !t13.selectDisabled && !p.isDisabled, size: t13.collapseTagSize, type: t13.tagType, effect: t13.tagEffect, "disable-transitions": "", onClose: (m) => t13.deleteTag(m, p) }, { default: withCtx(() => [ createBaseVNode("span", { class: normalizeClass(t13.nsSelect.e("tags-text")) }, [ renderSlot(t13.$slots, "label", { label: p.currentLabel, value: p.value }, () => [ createTextVNode(toDisplayString(p.currentLabel), 1) ]) ], 2) ]), _: 2 }, 1032, ["closable", "size", "type", "effect", "onClose"]) ], 2))), 128)) ], 2) ]), _: 3 }, 8, ["disabled", "effect", "teleported"])) : createCommentVNode("v-if", true) ]) : createCommentVNode("v-if", true), t13.selectDisabled ? createCommentVNode("v-if", true) : (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass([ t13.nsSelect.e("selected-item"), t13.nsSelect.e("input-wrapper"), t13.nsSelect.is("hidden", !t13.filterable) ]) }, [ withDirectives(createBaseVNode("input", { id: t13.inputId, ref: "inputRef", "onUpdate:modelValue": (p) => t13.states.inputValue = p, type: "text", name: t13.name, class: normalizeClass([t13.nsSelect.e("input"), t13.nsSelect.is(t13.selectSize)]), disabled: t13.selectDisabled, autocomplete: t13.autocomplete, style: normalizeStyle(t13.inputStyle), role: "combobox", readonly: !t13.filterable, spellcheck: "false", "aria-activedescendant": ((f = t13.hoverOption) == null ? void 0 : f.id) || "", "aria-controls": t13.contentId, "aria-expanded": t13.dropdownMenuVisible, "aria-label": t13.ariaLabel, "aria-autocomplete": "none", "aria-haspopup": "listbox", onKeydown: [ withKeys(withModifiers((p) => t13.navigateOptions("next"), ["stop", "prevent"]), ["down"]), withKeys(withModifiers((p) => t13.navigateOptions("prev"), ["stop", "prevent"]), ["up"]), withKeys(withModifiers(t13.handleEsc, ["stop", "prevent"]), ["esc"]), withKeys(withModifiers(t13.selectOption, ["stop", "prevent"]), ["enter"]), withKeys(withModifiers(t13.deletePrevTag, ["stop"]), ["delete"]) ], onCompositionstart: t13.handleCompositionStart, onCompositionupdate: t13.handleCompositionUpdate, onCompositionend: t13.handleCompositionEnd, onInput: t13.onInput, onClick: withModifiers(t13.toggleMenu, ["stop"]) }, null, 46, ["id", "onUpdate:modelValue", "name", "disabled", "autocomplete", "readonly", "aria-activedescendant", "aria-controls", "aria-expanded", "aria-label", "onKeydown", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onInput", "onClick"]), [ [vModelText, t13.states.inputValue] ]), t13.filterable ? (openBlock(), createElementBlock("span", { key: 0, ref: "calculatorRef", "aria-hidden": "true", class: normalizeClass(t13.nsSelect.e("input-calculator")), textContent: toDisplayString(t13.states.inputValue) }, null, 10, ["textContent"])) : createCommentVNode("v-if", true) ], 2)), t13.shouldShowPlaceholder ? (openBlock(), createElementBlock("div", { key: 2, class: normalizeClass([ t13.nsSelect.e("selected-item"), t13.nsSelect.e("placeholder"), t13.nsSelect.is("transparent", !t13.hasModelValue || t13.expanded && !t13.states.inputValue) ]) }, [ t13.hasModelValue ? renderSlot(t13.$slots, "label", { key: 0, label: t13.currentPlaceholder, value: t13.modelValue }, () => [ createBaseVNode("span", null, toDisplayString(t13.currentPlaceholder), 1) ]) : (openBlock(), createElementBlock("span", { key: 1 }, toDisplayString(t13.currentPlaceholder), 1)) ], 2)) : createCommentVNode("v-if", true) ], 2), createBaseVNode("div", { ref: "suffixRef", class: normalizeClass(t13.nsSelect.e("suffix")) }, [ t13.iconComponent && !t13.showClose ? (openBlock(), createBlock(u, { key: 0, class: normalizeClass([t13.nsSelect.e("caret"), t13.nsSelect.e("icon"), t13.iconReverse]) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(t13.iconComponent))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true), t13.showClose && t13.clearIcon ? (openBlock(), createBlock(u, { key: 1, class: normalizeClass([ t13.nsSelect.e("caret"), t13.nsSelect.e("icon"), t13.nsSelect.e("clear") ]), onClick: t13.handleClearClick }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(t13.clearIcon))) ]), _: 1 }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true), t13.validateState && t13.validateIcon ? (openBlock(), createBlock(u, { key: 2, class: normalizeClass([t13.nsInput.e("icon"), t13.nsInput.e("validateIcon")]) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(t13.validateIcon))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true) ], 2) ], 10, ["onClick"]) ]; }), content: withCtx(() => [ createVNode(v, { ref: "menuRef" }, { default: withCtx(() => [ t13.$slots.header ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(t13.nsSelect.be("dropdown", "header")), onClick: withModifiers(() => { }, ["stop"]) }, [ renderSlot(t13.$slots, "header") ], 10, ["onClick"])) : createCommentVNode("v-if", true), withDirectives(createVNode(d, { id: t13.contentId, ref: "scrollbarRef", tag: "ul", "wrap-class": t13.nsSelect.be("dropdown", "wrap"), "view-class": t13.nsSelect.be("dropdown", "list"), class: normalizeClass([t13.nsSelect.is("empty", t13.filteredOptionsCount === 0)]), role: "listbox", "aria-label": t13.ariaLabel, "aria-orientation": "vertical" }, { default: withCtx(() => [ t13.showNewOption ? (openBlock(), createBlock(l, { key: 0, value: t13.states.inputValue, created: true }, null, 8, ["value"])) : createCommentVNode("v-if", true), createVNode(c, null, { default: withCtx(() => [ renderSlot(t13.$slots, "default") ]), _: 3 }) ]), _: 3 }, 8, ["id", "wrap-class", "view-class", "class", "aria-label"]), [ [vShow, t13.states.options.size > 0 && !t13.loading] ]), t13.$slots.loading && t13.loading ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(t13.nsSelect.be("dropdown", "loading")) }, [ renderSlot(t13.$slots, "loading") ], 2)) : t13.loading || t13.filteredOptionsCount === 0 ? (openBlock(), createElementBlock("div", { key: 2, class: normalizeClass(t13.nsSelect.be("dropdown", "empty")) }, [ renderSlot(t13.$slots, "empty", {}, () => [ createBaseVNode("span", null, toDisplayString(t13.emptyText), 1) ]) ], 2)) : createCommentVNode("v-if", true), t13.$slots.footer ? (openBlock(), createElementBlock("div", { key: 3, class: normalizeClass(t13.nsSelect.be("dropdown", "footer")), onClick: withModifiers(() => { }, ["stop"]) }, [ renderSlot(t13.$slots, "footer") ], 10, ["onClick"])) : createCommentVNode("v-if", true) ]), _: 3 }, 512) ]), _: 3 }, 8, ["visible", "placement", "teleported", "popper-class", "popper-options", "fallback-placements", "effect", "transition", "persistent", "append-to", "onBeforeShow", "onHide"]) ], 16, ["onMouseleave"])), [ [h6, t13.handleClickOutside, t13.popperRef] ]); } var nS = ze(tS, [["render", rS], ["__file", "select.vue"]]); var aS = defineComponent({ name: "ElOptionGroup", componentName: "ElOptionGroup", props: { label: String, disabled: Boolean }, setup(t13) { const e = He("select"), r = ref(null), n = getCurrentInstance(), a = ref([]); provide(zh, reactive({ ...toRefs(t13) })); const i = computed(() => a.value.some((l) => l.visible === true)), o = (l) => { var c, d; return ((c = l.type) == null ? void 0 : c.name) === "ElOption" && !!((d = l.component) != null && d.proxy); }, s = (l) => { const c = In(l), d = []; return c.forEach((v) => { var h6, f; o(v) ? d.push(v.component.proxy) : (h6 = v.children) != null && h6.length ? d.push(...s(v.children)) : (f = v.component) != null && f.subTree && d.push(...s(v.component.subTree)); }), d; }, u = () => { a.value = s(n.subTree); }; return onMounted(() => { u(); }), q0(r, u, { attributes: true, subtree: true, childList: true }), { groupRef: r, visible: i, ns: e }; } }); function iS(t13, e, r, n, a, i) { return withDirectives((openBlock(), createElementBlock("ul", { ref: "groupRef", class: normalizeClass(t13.ns.be("group", "wrap")) }, [ createBaseVNode("li", { class: normalizeClass(t13.ns.be("group", "title")) }, toDisplayString(t13.label), 3), createBaseVNode("li", null, [ createBaseVNode("ul", { class: normalizeClass(t13.ns.b("group")) }, [ renderSlot(t13.$slots, "default") ], 2) ]) ], 2)), [ [vShow, t13.visible] ]); } var Vh = ze(aS, [["render", iS], ["__file", "option-group.vue"]]); var oS = $t(nS, { Option: ec, OptionGroup: Vh }); var sS = xn(ec); xn(Vh); var lS = rt({ trigger: Ji.trigger, placement: Fl.placement, disabled: Ji.disabled, visible: cr.visible, transition: cr.transition, popperOptions: Fl.popperOptions, tabindex: Fl.tabindex, content: cr.content, popperStyle: cr.popperStyle, popperClass: cr.popperClass, enterable: { ...cr.enterable, default: true }, effect: { ...cr.effect, default: "light" }, teleported: cr.teleported, title: String, width: { type: [String, Number], default: 150 }, offset: { type: Number, default: void 0 }, showAfter: { type: Number, default: 0 }, hideAfter: { type: Number, default: 200 }, autoClose: { type: Number, default: 0 }, showArrow: { type: Boolean, default: true }, persistent: { type: Boolean, default: true }, "onUpdate:visible": { type: Function } }); var uS = { "update:visible": (t13) => Qa(t13), "before-enter": () => true, "before-leave": () => true, "after-enter": () => true, "after-leave": () => true }; var cS = "onUpdate:visible"; var dS = defineComponent({ name: "ElPopover" }); var fS = defineComponent({ ...dS, props: lS, emits: uS, setup(t13, { expose: e, emit: r }) { const n = t13, a = computed(() => n[cS]), i = He("popover"), o = ref(), s = computed(() => { var m; return (m = unref(o)) == null ? void 0 : m.popperRef; }), u = computed(() => [ { width: Ja(n.width) }, n.popperStyle ]), l = computed(() => [i.b(), n.popperClass, { [i.m("plain")]: !!n.content }]), c = computed(() => n.transition === `${i.namespace.value}-fade-in-linear`), d = () => { var m; (m = o.value) == null || m.hide(); }, v = () => { r("before-enter"); }, h6 = () => { r("before-leave"); }, f = () => { r("after-enter"); }, p = () => { r("update:visible", false), r("after-leave"); }; return e({ popperRef: s, hide: d }), (m, g) => (openBlock(), createBlock(unref(ko), mergeProps({ ref_key: "tooltipRef", ref: o }, m.$attrs, { trigger: m.trigger, placement: m.placement, disabled: m.disabled, visible: m.visible, transition: m.transition, "popper-options": m.popperOptions, tabindex: m.tabindex, content: m.content, offset: m.offset, "show-after": m.showAfter, "hide-after": m.hideAfter, "auto-close": m.autoClose, "show-arrow": m.showArrow, "aria-label": m.title, effect: m.effect, enterable: m.enterable, "popper-class": unref(l), "popper-style": unref(u), teleported: m.teleported, persistent: m.persistent, "gpu-acceleration": unref(c), "onUpdate:visible": unref(a), onBeforeShow: v, onBeforeHide: h6, onShow: f, onHide: p }), { content: withCtx(() => [ m.title ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(i).e("title")), role: "title" }, toDisplayString(m.title), 3)) : createCommentVNode("v-if", true), renderSlot(m.$slots, "default", {}, () => [ createTextVNode(toDisplayString(m.content), 1) ]) ]), default: withCtx(() => [ m.$slots.reference ? renderSlot(m.$slots, "reference", { key: 0 }) : createCommentVNode("v-if", true) ]), _: 3 }, 16, ["trigger", "placement", "disabled", "visible", "transition", "popper-options", "tabindex", "content", "offset", "show-after", "hide-after", "auto-close", "show-arrow", "aria-label", "effect", "enterable", "popper-class", "popper-style", "teleported", "persistent", "gpu-acceleration", "onUpdate:visible"])); } }); var vS = ze(fS, [["__file", "popover.vue"]]); var Zd = (t13, e) => { const r = e.arg || e.value, n = r == null ? void 0 : r.popperRef; n && (n.triggerRef = t13); }; var hS = { mounted(t13, e) { Zd(t13, e); }, updated(t13, e) { Zd(t13, e); } }; var pS = "popover"; var gS = A2(hS, pS); var tc = $t(vS, { directive: gS }); var Ua = "$treeNodeId"; var Xd = function(t13, e) { !e || e[Ua] || Object.defineProperty(e, Ua, { value: t13.id, enumerable: false, configurable: false, writable: false }); }; var rc = function(t13, e) { return t13 ? e[t13] : e[Ua]; }; var iu = (t13, e, r) => { const n = t13.value.currentNode; r(); const a = t13.value.currentNode; n !== a && e("current-change", a ? a.data : null, a); }; var ou = (t13) => { let e = true, r = true, n = true; for (let a = 0, i = t13.length; a < i; a++) { const o = t13[a]; (o.checked !== true || o.indeterminate) && (e = false, o.disabled || (n = false)), (o.checked !== false || o.indeterminate) && (r = false); } return { all: e, none: r, allWithoutDisable: n, half: !e && !r }; }; var Ai = function(t13) { if (t13.childNodes.length === 0 || t13.loading) return; const { all: e, none: r, half: n } = ou(t13.childNodes); e ? (t13.checked = true, t13.indeterminate = false) : n ? (t13.checked = false, t13.indeterminate = true) : r && (t13.checked = false, t13.indeterminate = false); const a = t13.parent; !a || a.level === 0 || t13.store.checkStrictly || Ai(a); }; var Ko = function(t13, e) { const r = t13.store.props, n = t13.data || {}, a = r[e]; if (typeof a == "function") return a(n, t13); if (typeof a == "string") return n[a]; if (typeof a > "u") { const i = n[e]; return i === void 0 ? "" : i; } }; var mS = 0; var fa = class _fa { constructor(e) { this.id = mS++, this.text = null, this.checked = false, this.indeterminate = false, this.data = null, this.expanded = false, this.parent = null, this.visible = true, this.isCurrent = false, this.canFocus = false; for (const r in e) va(e, r) && (this[r] = e[r]); this.level = 0, this.loaded = false, this.childNodes = [], this.loading = false, this.parent && (this.level = this.parent.level + 1); } initialize() { const e = this.store; if (!e) throw new Error("[Node]store is required!"); e.registerNode(this); const r = e.props; if (r && typeof r.isLeaf < "u") { const i = Ko(this, "isLeaf"); typeof i == "boolean" && (this.isLeafByUser = i); } if (e.lazy !== true && this.data ? (this.setData(this.data), e.defaultExpandAll && (this.expanded = true, this.canFocus = true)) : this.level > 0 && e.lazy && e.defaultExpandAll && !this.isLeafByUser && this.expand(), Array.isArray(this.data) || Xd(this, this.data), !this.data) return; const n = e.defaultExpandedKeys, a = e.key; a && n && n.includes(this.key) && this.expand(null, e.autoExpandParent), a && e.currentNodeKey !== void 0 && this.key === e.currentNodeKey && (e.currentNode = this, e.currentNode.isCurrent = true), e.lazy && e._initDefaultCheckedNode(this), this.updateLeafState(), this.parent && (this.level === 1 || this.parent.expanded === true) && (this.canFocus = true); } setData(e) { Array.isArray(e) || Xd(this, e), this.data = e, this.childNodes = []; let r; this.level === 0 && Array.isArray(this.data) ? r = this.data : r = Ko(this, "children") || []; for (let n = 0, a = r.length; n < a; n++) this.insertChild({ data: r[n] }); } get label() { return Ko(this, "label"); } get key() { const e = this.store.key; return this.data ? this.data[e] : null; } get disabled() { return Ko(this, "disabled"); } get nextSibling() { const e = this.parent; if (e) { const r = e.childNodes.indexOf(this); if (r > -1) return e.childNodes[r + 1]; } return null; } get previousSibling() { const e = this.parent; if (e) { const r = e.childNodes.indexOf(this); if (r > -1) return r > 0 ? e.childNodes[r - 1] : null; } return null; } contains(e, r = true) { return (this.childNodes || []).some((n) => n === e || r && n.contains(e)); } remove() { const e = this.parent; e && e.removeChild(this); } insertChild(e, r, n) { if (!e) throw new Error("InsertChild error: child is required."); if (!(e instanceof _fa)) { if (!n) { const a = this.getChildren(true); a.includes(e.data) || (typeof r > "u" || r < 0 ? a.push(e.data) : a.splice(r, 0, e.data)); } Object.assign(e, { parent: this, store: this.store }), e = reactive(new _fa(e)), e instanceof _fa && e.initialize(); } e.level = this.level + 1, typeof r > "u" || r < 0 ? this.childNodes.push(e) : this.childNodes.splice(r, 0, e), this.updateLeafState(); } insertBefore(e, r) { let n; r && (n = this.childNodes.indexOf(r)), this.insertChild(e, n); } insertAfter(e, r) { let n; r && (n = this.childNodes.indexOf(r), n !== -1 && (n += 1)), this.insertChild(e, n); } removeChild(e) { const r = this.getChildren() || [], n = r.indexOf(e.data); n > -1 && r.splice(n, 1); const a = this.childNodes.indexOf(e); a > -1 && (this.store && this.store.deregisterNode(e), e.parent = null, this.childNodes.splice(a, 1)), this.updateLeafState(); } removeChildByData(e) { let r = null; for (let n = 0; n < this.childNodes.length; n++) if (this.childNodes[n].data === e) { r = this.childNodes[n]; break; } r && this.removeChild(r); } expand(e, r) { const n = () => { if (r) { let a = this.parent; for (; a.level > 0; ) a.expanded = true, a = a.parent; } this.expanded = true, e && e(), this.childNodes.forEach((a) => { a.canFocus = true; }); }; this.shouldLoadData() ? this.loadData((a) => { Array.isArray(a) && (this.checked ? this.setChecked(true, true) : this.store.checkStrictly || Ai(this), n()); }) : n(); } doCreateChildren(e, r = {}) { e.forEach((n) => { this.insertChild(Object.assign({ data: n }, r), void 0, true); }); } collapse() { this.expanded = false, this.childNodes.forEach((e) => { e.canFocus = false; }); } shouldLoadData() { return this.store.lazy === true && this.store.load && !this.loaded; } updateLeafState() { if (this.store.lazy === true && this.loaded !== true && typeof this.isLeafByUser < "u") { this.isLeaf = this.isLeafByUser; return; } const e = this.childNodes; if (!this.store.lazy || this.store.lazy === true && this.loaded === true) { this.isLeaf = !e || e.length === 0; return; } this.isLeaf = false; } setChecked(e, r, n, a) { if (this.indeterminate = e === "half", this.checked = e === true, this.store.checkStrictly) return; if (!(this.shouldLoadData() && !this.store.checkDescendants)) { const { all: o, allWithoutDisable: s } = ou(this.childNodes); !this.isLeaf && !o && s && (this.checked = false, e = false); const u = () => { if (r) { const l = this.childNodes; for (let v = 0, h6 = l.length; v < h6; v++) { const f = l[v]; a = a || e !== false; const p = f.disabled ? f.checked : a; f.setChecked(p, r, true, a); } const { half: c, all: d } = ou(l); d || (this.checked = d, this.indeterminate = c); } }; if (this.shouldLoadData()) { this.loadData(() => { u(), Ai(this); }, { checked: e !== false }); return; } else u(); } const i = this.parent; !i || i.level === 0 || n || Ai(i); } getChildren(e = false) { if (this.level === 0) return this.data; const r = this.data; if (!r) return null; const n = this.store.props; let a = "children"; return n && (a = n.children || "children"), r[a] === void 0 && (r[a] = null), e && !r[a] && (r[a] = []), r[a]; } updateChildren() { const e = this.getChildren() || [], r = this.childNodes.map((i) => i.data), n = {}, a = []; e.forEach((i, o) => { const s = i[Ua]; !!s && r.findIndex((l) => l[Ua] === s) >= 0 ? n[s] = { index: o, data: i } : a.push({ index: o, data: i }); }), this.store.lazy || r.forEach((i) => { n[i[Ua]] || this.removeChildByData(i); }), a.forEach(({ index: i, data: o }) => { this.insertChild({ data: o }, i); }), this.updateLeafState(); } loadData(e, r = {}) { if (this.store.lazy === true && this.store.load && !this.loaded && (!this.loading || Object.keys(r).length)) { this.loading = true; const n = (i) => { this.childNodes = [], this.doCreateChildren(i, r), this.loaded = true, this.loading = false, this.updateLeafState(), e && e.call(this, i); }, a = () => { this.loading = false; }; this.store.load(this, n, a); } else e && e.call(this); } eachNode(e) { const r = [this]; for (; r.length; ) { const n = r.shift(); r.unshift(...n.childNodes), e(n); } } reInitChecked() { this.store.checkStrictly || Ai(this); } }; var yS = class { constructor(e) { this.currentNode = null, this.currentNodeKey = null; for (const r in e) va(e, r) && (this[r] = e[r]); this.nodesMap = {}; } initialize() { if (this.root = new fa({ data: this.data, store: this }), this.root.initialize(), this.lazy && this.load) { const e = this.load; e(this.root, (r) => { this.root.doCreateChildren(r), this._initDefaultCheckedNodes(); }); } else this._initDefaultCheckedNodes(); } filter(e) { const r = this.filterNodeMethod, n = this.lazy, a = function(i) { const o = i.root ? i.root.childNodes : i.childNodes; if (o.forEach((s) => { s.visible = r.call(s, e, s.data, s), a(s); }), !i.visible && o.length) { let s = true; s = !o.some((u) => u.visible), i.root ? i.root.visible = s === false : i.visible = s === false; } e && i.visible && !i.isLeaf && (!n || i.loaded) && i.expand(); }; a(this); } setData(e) { e !== this.root.data ? (this.nodesMap = {}, this.root.setData(e), this._initDefaultCheckedNodes()) : this.root.updateChildren(); } getNode(e) { if (e instanceof fa) return e; const r = Ht(e) ? rc(this.key, e) : e; return this.nodesMap[r] || null; } insertBefore(e, r) { const n = this.getNode(r); n.parent.insertBefore({ data: e }, n); } insertAfter(e, r) { const n = this.getNode(r); n.parent.insertAfter({ data: e }, n); } remove(e) { const r = this.getNode(e); r && r.parent && (r === this.currentNode && (this.currentNode = null), r.parent.removeChild(r)); } append(e, r) { const n = ks(r) ? this.root : this.getNode(r); n && n.insertChild({ data: e }); } _initDefaultCheckedNodes() { const e = this.defaultCheckedKeys || [], r = this.nodesMap; e.forEach((n) => { const a = r[n]; a && a.setChecked(true, !this.checkStrictly); }); } _initDefaultCheckedNode(e) { (this.defaultCheckedKeys || []).includes(e.key) && e.setChecked(true, !this.checkStrictly); } setDefaultCheckedKey(e) { e !== this.defaultCheckedKeys && (this.defaultCheckedKeys = e, this._initDefaultCheckedNodes()); } registerNode(e) { const r = this.key; !e || !e.data || (r ? e.key !== void 0 && (this.nodesMap[e.key] = e) : this.nodesMap[e.id] = e); } deregisterNode(e) { !this.key || !e || !e.data || (e.childNodes.forEach((n) => { this.deregisterNode(n); }), delete this.nodesMap[e.key]); } getCheckedNodes(e = false, r = false) { const n = [], a = function(i) { (i.root ? i.root.childNodes : i.childNodes).forEach((s) => { (s.checked || r && s.indeterminate) && (!e || e && s.isLeaf) && n.push(s.data), a(s); }); }; return a(this), n; } getCheckedKeys(e = false) { return this.getCheckedNodes(e).map((r) => (r || {})[this.key]); } getHalfCheckedNodes() { const e = [], r = function(n) { (n.root ? n.root.childNodes : n.childNodes).forEach((i) => { i.indeterminate && e.push(i.data), r(i); }); }; return r(this), e; } getHalfCheckedKeys() { return this.getHalfCheckedNodes().map((e) => (e || {})[this.key]); } _getAllNodes() { const e = [], r = this.nodesMap; for (const n in r) va(r, n) && e.push(r[n]); return e; } updateChildren(e, r) { const n = this.nodesMap[e]; if (!n) return; const a = n.childNodes; for (let i = a.length - 1; i >= 0; i--) { const o = a[i]; this.remove(o.data); } for (let i = 0, o = r.length; i < o; i++) { const s = r[i]; this.append(s, n.data); } } _setCheckedKeys(e, r = false, n) { const a = this._getAllNodes().sort((u, l) => u.level - l.level), i = /* @__PURE__ */ Object.create(null), o = Object.keys(n); a.forEach((u) => u.setChecked(false, false)); const s = (u) => { u.childNodes.forEach((l) => { var c; i[l.data[e]] = true, (c = l.childNodes) != null && c.length && s(l); }); }; for (let u = 0, l = a.length; u < l; u++) { const c = a[u], d = c.data[e].toString(); if (!o.includes(d)) { c.checked && !i[d] && c.setChecked(false, false); continue; } if (c.childNodes.length && s(c), c.isLeaf || this.checkStrictly) { c.setChecked(true, false); continue; } if (c.setChecked(true, true), r) { c.setChecked(false, false); const h6 = function(f) { f.childNodes.forEach((m) => { m.isLeaf || m.setChecked(false, false), h6(m); }); }; h6(c); } } } setCheckedNodes(e, r = false) { const n = this.key, a = {}; e.forEach((i) => { a[(i || {})[n]] = true; }), this._setCheckedKeys(n, r, a); } setCheckedKeys(e, r = false) { this.defaultCheckedKeys = e; const n = this.key, a = {}; e.forEach((i) => { a[i] = true; }), this._setCheckedKeys(n, r, a); } setDefaultExpandedKeys(e) { e = e || [], this.defaultExpandedKeys = e, e.forEach((r) => { const n = this.getNode(r); n && n.expand(null, this.autoExpandParent); }); } setChecked(e, r, n) { const a = this.getNode(e); a && a.setChecked(!!r, n); } getCurrentNode() { return this.currentNode; } setCurrentNode(e) { const r = this.currentNode; r && (r.isCurrent = false), this.currentNode = e, this.currentNode.isCurrent = true; } setUserCurrentNode(e, r = true) { const n = e[this.key], a = this.nodesMap[n]; this.setCurrentNode(a), r && this.currentNode.level > 1 && this.currentNode.parent.expand(null, true); } setCurrentNodeKey(e, r = true) { if (e == null) { this.currentNode && (this.currentNode.isCurrent = false), this.currentNode = null; return; } const n = this.getNode(e); n && (this.setCurrentNode(n), r && this.currentNode.level > 1 && this.currentNode.parent.expand(null, true)); } }; var bS = defineComponent({ name: "ElTreeNodeContent", props: { node: { type: Object, required: true }, renderContent: Function }, setup(t13) { const e = He("tree"), r = inject("NodeInstance"), n = inject("RootTree"); return () => { const a = t13.node, { data: i, store: o } = a; return t13.renderContent ? t13.renderContent(h, { _self: r, node: a, data: i, store: o }) : renderSlot(n.ctx.slots, "default", { node: a, data: i }, () => [ h("span", { class: e.be("node", "label") }, [a.label]) ]); }; } }); var wS = ze(bS, [["__file", "tree-node-content.vue"]]); function Hh(t13) { const e = inject("TreeNodeMap", null), r = { treeNodeExpand: (n) => { t13.node !== n && t13.node.collapse(); }, children: [] }; return e && e.children.push(r), provide("TreeNodeMap", r), { broadcastExpanded: (n) => { if (t13.accordion) for (const a of r.children) a.treeNodeExpand(n); } }; } var qh = Symbol("dragEvents"); function xS({ props: t13, ctx: e, el$: r, dropIndicator$: n, store: a }) { const i = He("tree"), o = ref({ showDropIndicator: false, draggingNode: null, dropNode: null, allowDrop: true, dropType: null }); return provide(qh, { treeNodeDragStart: ({ event: c, treeNode: d }) => { if (typeof t13.allowDrag == "function" && !t13.allowDrag(d.node)) return c.preventDefault(), false; c.dataTransfer.effectAllowed = "move"; try { c.dataTransfer.setData("text/plain", ""); } catch { } o.value.draggingNode = d, e.emit("node-drag-start", d.node, c); }, treeNodeDragOver: ({ event: c, treeNode: d }) => { const v = d, h6 = o.value.dropNode; h6 && h6.node.id !== v.node.id && ca(h6.$el, i.is("drop-inner")); const f = o.value.draggingNode; if (!f || !v) return; let p = true, m = true, g = true, y = true; typeof t13.allowDrop == "function" && (p = t13.allowDrop(f.node, v.node, "prev"), y = m = t13.allowDrop(f.node, v.node, "inner"), g = t13.allowDrop(f.node, v.node, "next")), c.dataTransfer.dropEffect = m || p || g ? "move" : "none", (p || m || g) && (h6 == null ? void 0 : h6.node.id) !== v.node.id && (h6 && e.emit("node-drag-leave", f.node, h6.node, c), e.emit("node-drag-enter", f.node, v.node, c)), p || m || g ? o.value.dropNode = v : o.value.dropNode = null, v.node.nextSibling === f.node && (g = false), v.node.previousSibling === f.node && (p = false), v.node.contains(f.node, false) && (m = false), (f.node === v.node || f.node.contains(v.node)) && (p = false, m = false, g = false); const b = v.$el.querySelector(`.${i.be("node", "content")}`).getBoundingClientRect(), w = r.value.getBoundingClientRect(); let C; const E = p ? m ? 0.25 : g ? 0.45 : 1 : -1, x = g ? m ? 0.75 : p ? 0.55 : 0 : 1; let T = -9999; const k = c.clientY - b.top; k < b.height * E ? C = "before" : k > b.height * x ? C = "after" : m ? C = "inner" : C = "none"; const _ = v.$el.querySelector(`.${i.be("node", "expand-icon")}`).getBoundingClientRect(), D = n.value; C === "before" ? T = _.top - w.top : C === "after" && (T = _.bottom - w.top), D.style.top = `${T}px`, D.style.left = `${_.right - w.left}px`, C === "inner" ? Ql(v.$el, i.is("drop-inner")) : ca(v.$el, i.is("drop-inner")), o.value.showDropIndicator = C === "before" || C === "after", o.value.allowDrop = o.value.showDropIndicator || y, o.value.dropType = C, e.emit("node-drag-over", f.node, v.node, c); }, treeNodeDragEnd: (c) => { const { draggingNode: d, dropType: v, dropNode: h6 } = o.value; if (c.preventDefault(), c.dataTransfer && (c.dataTransfer.dropEffect = "move"), d && h6) { const f = { data: d.node.data }; v !== "none" && d.node.remove(), v === "before" ? h6.node.parent.insertBefore(f, h6.node) : v === "after" ? h6.node.parent.insertAfter(f, h6.node) : v === "inner" && h6.node.insertChild(f), v !== "none" && (a.value.registerNode(f), a.value.key && d.node.eachNode((p) => { var m; (m = a.value.nodesMap[p.data[a.value.key]]) == null || m.setChecked(p.checked, !a.value.checkStrictly); })), ca(h6.$el, i.is("drop-inner")), e.emit("node-drag-end", d.node, h6.node, v, c), v !== "none" && e.emit("node-drop", d.node, h6.node, v, c); } d && !h6 && e.emit("node-drag-end", d.node, null, v, c), o.value.showDropIndicator = false, o.value.draggingNode = null, o.value.dropNode = null, o.value.allowDrop = true; } }), { dragState: o }; } var CS = defineComponent({ name: "ElTreeNode", components: { ElCollapseTransition: ek, ElCheckbox: ME, NodeContent: wS, ElIcon: Vt, Loading: Au }, props: { node: { type: fa, default: () => ({}) }, props: { type: Object, default: () => ({}) }, accordion: Boolean, renderContent: Function, renderAfterExpand: Boolean, showCheckbox: { type: Boolean, default: false } }, emits: ["node-expand"], setup(t13, e) { const r = He("tree"), { broadcastExpanded: n } = Hh(t13), a = inject("RootTree"), i = ref(false), o = ref(false), s = ref(null), u = ref(null), l = ref(null), c = inject(qh), d = getCurrentInstance(); provide("NodeInstance", d), a || Dt("Tree", "Can not find node's tree."), t13.node.expanded && (i.value = true, o.value = true); const v = a.props.props.children || "children"; watch(() => { const k = t13.node.data[v]; return k && [...k]; }, () => { t13.node.updateChildren(); }), watch(() => t13.node.indeterminate, (k) => { p(t13.node.checked, k); }), watch(() => t13.node.checked, (k) => { p(k, t13.node.indeterminate); }), watch(() => t13.node.childNodes.length, () => t13.node.reInitChecked()), watch(() => t13.node.expanded, (k) => { nextTick(() => i.value = k), k && (o.value = true); }); const h6 = (k) => rc(a.props.nodeKey, k.data), f = (k) => { const _ = t13.props.class; if (!_) return {}; let D; if (lr(_)) { const { data: O } = k; D = _(O, k); } else D = _; return tr(D) ? { [D]: true } : D; }, p = (k, _) => { (s.value !== k || u.value !== _) && a.ctx.emit("check-change", t13.node.data, k, _), s.value = k, u.value = _; }, m = (k) => { iu(a.store, a.ctx.emit, () => a.store.value.setCurrentNode(t13.node)), a.currentNode.value = t13.node, a.props.expandOnClickNode && y(), a.props.checkOnClickNode && !t13.node.disabled && b(null, { target: { checked: !t13.node.checked } }), a.ctx.emit("node-click", t13.node.data, t13.node, d, k); }, g = (k) => { a.instance.vnode.props.onNodeContextmenu && (k.stopPropagation(), k.preventDefault()), a.ctx.emit("node-contextmenu", k, t13.node.data, t13.node, d); }, y = () => { t13.node.isLeaf || (i.value ? (a.ctx.emit("node-collapse", t13.node.data, t13.node, d), t13.node.collapse()) : t13.node.expand(() => { e.emit("node-expand", t13.node.data, t13.node, d); })); }, b = (k, _) => { t13.node.setChecked(_.target.checked, !a.props.checkStrictly), nextTick(() => { const D = a.store.value; a.ctx.emit("check", t13.node.data, { checkedNodes: D.getCheckedNodes(), checkedKeys: D.getCheckedKeys(), halfCheckedNodes: D.getHalfCheckedNodes(), halfCheckedKeys: D.getHalfCheckedKeys() }); }); }; return { ns: r, node$: l, tree: a, expanded: i, childNodeRendered: o, oldChecked: s, oldIndeterminate: u, getNodeKey: h6, getNodeClass: f, handleSelectChange: p, handleClick: m, handleContextMenu: g, handleExpandIconClick: y, handleCheckChange: b, handleChildNodeExpand: (k, _, D) => { n(_), a.ctx.emit("node-expand", k, _, D); }, handleDragStart: (k) => { a.props.draggable && c.treeNodeDragStart({ event: k, treeNode: t13 }); }, handleDragOver: (k) => { k.preventDefault(), a.props.draggable && c.treeNodeDragOver({ event: k, treeNode: { $el: l.value, node: t13.node } }); }, handleDrop: (k) => { k.preventDefault(); }, handleDragEnd: (k) => { a.props.draggable && c.treeNodeDragEnd(k); }, CaretRight: n2 }; } }); function ES(t13, e, r, n, a, i) { const o = resolveComponent("el-icon"), s = resolveComponent("el-checkbox"), u = resolveComponent("loading"), l = resolveComponent("node-content"), c = resolveComponent("el-tree-node"), d = resolveComponent("el-collapse-transition"); return withDirectives((openBlock(), createElementBlock("div", { ref: "node$", class: normalizeClass([ t13.ns.b("node"), t13.ns.is("expanded", t13.expanded), t13.ns.is("current", t13.node.isCurrent), t13.ns.is("hidden", !t13.node.visible), t13.ns.is("focusable", !t13.node.disabled), t13.ns.is("checked", !t13.node.disabled && t13.node.checked), t13.getNodeClass(t13.node) ]), role: "treeitem", tabindex: "-1", "aria-expanded": t13.expanded, "aria-disabled": t13.node.disabled, "aria-checked": t13.node.checked, draggable: t13.tree.props.draggable, "data-key": t13.getNodeKey(t13.node), onClick: withModifiers(t13.handleClick, ["stop"]), onContextmenu: t13.handleContextMenu, onDragstart: withModifiers(t13.handleDragStart, ["stop"]), onDragover: withModifiers(t13.handleDragOver, ["stop"]), onDragend: withModifiers(t13.handleDragEnd, ["stop"]), onDrop: withModifiers(t13.handleDrop, ["stop"]) }, [ createBaseVNode("div", { class: normalizeClass(t13.ns.be("node", "content")), style: normalizeStyle({ paddingLeft: (t13.node.level - 1) * t13.tree.props.indent + "px" }) }, [ t13.tree.props.icon || t13.CaretRight ? (openBlock(), createBlock(o, { key: 0, class: normalizeClass([ t13.ns.be("node", "expand-icon"), t13.ns.is("leaf", t13.node.isLeaf), { expanded: !t13.node.isLeaf && t13.expanded } ]), onClick: withModifiers(t13.handleExpandIconClick, ["stop"]) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(t13.tree.props.icon || t13.CaretRight))) ]), _: 1 }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true), t13.showCheckbox ? (openBlock(), createBlock(s, { key: 1, "model-value": t13.node.checked, indeterminate: t13.node.indeterminate, disabled: !!t13.node.disabled, onClick: withModifiers(() => { }, ["stop"]), onChange: t13.handleCheckChange }, null, 8, ["model-value", "indeterminate", "disabled", "onClick", "onChange"])) : createCommentVNode("v-if", true), t13.node.loading ? (openBlock(), createBlock(o, { key: 2, class: normalizeClass([t13.ns.be("node", "loading-icon"), t13.ns.is("loading")]) }, { default: withCtx(() => [ createVNode(u) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true), createVNode(l, { node: t13.node, "render-content": t13.renderContent }, null, 8, ["node", "render-content"]) ], 6), createVNode(d, null, { default: withCtx(() => [ !t13.renderAfterExpand || t13.childNodeRendered ? withDirectives((openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(t13.ns.be("node", "children")), role: "group", "aria-expanded": t13.expanded }, [ (openBlock(true), createElementBlock(Fragment, null, renderList(t13.node.childNodes, (v) => (openBlock(), createBlock(c, { key: t13.getNodeKey(v), "render-content": t13.renderContent, "render-after-expand": t13.renderAfterExpand, "show-checkbox": t13.showCheckbox, node: v, accordion: t13.accordion, props: t13.props, onNodeExpand: t13.handleChildNodeExpand }, null, 8, ["render-content", "render-after-expand", "show-checkbox", "node", "accordion", "props", "onNodeExpand"]))), 128)) ], 10, ["aria-expanded"])), [ [vShow, t13.expanded] ]) : createCommentVNode("v-if", true) ]), _: 1 }) ], 42, ["aria-expanded", "aria-disabled", "aria-checked", "draggable", "data-key", "onClick", "onContextmenu", "onDragstart", "onDragover", "onDragend", "onDrop"])), [ [vShow, t13.node.visible] ]); } var kS = ze(CS, [["render", ES], ["__file", "tree-node.vue"]]); function SS({ el$: t13 }, e) { const r = He("tree"), n = shallowRef([]), a = shallowRef([]); onMounted(() => { o(); }), onUpdated(() => { n.value = Array.from(t13.value.querySelectorAll("[role=treeitem]")), a.value = Array.from(t13.value.querySelectorAll("input[type=checkbox]")); }), watch(a, (s) => { s.forEach((u) => { u.setAttribute("tabindex", "-1"); }); }), kr(t13, "keydown", (s) => { const u = s.target; if (!u.className.includes(r.b("node"))) return; const l = s.code; n.value = Array.from(t13.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)); const c = n.value.indexOf(u); let d; if ([Lt.up, Lt.down].includes(l)) { if (s.preventDefault(), l === Lt.up) { d = c === -1 ? 0 : c !== 0 ? c - 1 : n.value.length - 1; const h6 = d; for (; !e.value.getNode(n.value[d].dataset.key).canFocus; ) { if (d--, d === h6) { d = -1; break; } d < 0 && (d = n.value.length - 1); } } else { d = c === -1 ? 0 : c < n.value.length - 1 ? c + 1 : 0; const h6 = d; for (; !e.value.getNode(n.value[d].dataset.key).canFocus; ) { if (d++, d === h6) { d = -1; break; } d >= n.value.length && (d = 0); } } d !== -1 && n.value[d].focus(); } [Lt.left, Lt.right].includes(l) && (s.preventDefault(), u.click()); const v = u.querySelector('[type="checkbox"]'); [Lt.enter, Lt.space].includes(l) && v && (s.preventDefault(), v.click()); }); const o = () => { var s; n.value = Array.from(t13.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)), a.value = Array.from(t13.value.querySelectorAll("input[type=checkbox]")); const u = t13.value.querySelectorAll(`.${r.is("checked")}[role=treeitem]`); if (u.length) { u[0].setAttribute("tabindex", "0"); return; } (s = n.value[0]) == null || s.setAttribute("tabindex", "0"); }; } var TS = defineComponent({ name: "ElTree", components: { ElTreeNode: kS }, props: { data: { type: Array, default: () => [] }, emptyText: { type: String }, renderAfterExpand: { type: Boolean, default: true }, nodeKey: String, checkStrictly: Boolean, defaultExpandAll: Boolean, expandOnClickNode: { type: Boolean, default: true }, checkOnClickNode: Boolean, checkDescendants: { type: Boolean, default: false }, autoExpandParent: { type: Boolean, default: true }, defaultCheckedKeys: Array, defaultExpandedKeys: Array, currentNodeKey: [String, Number], renderContent: Function, showCheckbox: { type: Boolean, default: false }, draggable: { type: Boolean, default: false }, allowDrag: Function, allowDrop: Function, props: { type: Object, default: () => ({ children: "children", label: "label", disabled: "disabled" }) }, lazy: { type: Boolean, default: false }, highlightCurrent: Boolean, load: Function, filterNodeMethod: Function, accordion: Boolean, indent: { type: Number, default: 18 }, icon: { type: Hn } }, emits: [ "check-change", "current-change", "node-click", "node-contextmenu", "node-collapse", "node-expand", "check", "node-drag-start", "node-drag-end", "node-drop", "node-drag-leave", "node-drag-enter", "node-drag-over" ], setup(t13, e) { const { t: r } = yo(), n = He("tree"), a = inject(To, null), i = ref(new yS({ key: t13.nodeKey, data: t13.data, lazy: t13.lazy, props: t13.props, load: t13.load, currentNodeKey: t13.currentNodeKey, checkStrictly: t13.checkStrictly, checkDescendants: t13.checkDescendants, defaultCheckedKeys: t13.defaultCheckedKeys, defaultExpandedKeys: t13.defaultExpandedKeys, autoExpandParent: t13.autoExpandParent, defaultExpandAll: t13.defaultExpandAll, filterNodeMethod: t13.filterNodeMethod })); i.value.initialize(); const o = ref(i.value.root), s = ref(null), u = ref(null), l = ref(null), { broadcastExpanded: c } = Hh(t13), { dragState: d } = xS({ props: t13, ctx: e, el$: u, dropIndicator$: l, store: i }); SS({ el$: u }, i); const v = computed(() => { const { childNodes: A } = o.value, R = a ? a.hasFilteredOptions !== 0 : false; return (!A || A.length === 0 || A.every(({ visible: K }) => !K)) && !R; }); watch(() => t13.currentNodeKey, (A) => { i.value.setCurrentNodeKey(A); }), watch(() => t13.defaultCheckedKeys, (A) => { i.value.setDefaultCheckedKey(A); }), watch(() => t13.defaultExpandedKeys, (A) => { i.value.setDefaultExpandedKeys(A); }), watch(() => t13.data, (A) => { i.value.setData(A); }, { deep: true }), watch(() => t13.checkStrictly, (A) => { i.value.checkStrictly = A; }); const h6 = (A) => { if (!t13.filterNodeMethod) throw new Error("[Tree] filterNodeMethod is required when filter"); i.value.filter(A); }, f = (A) => rc(t13.nodeKey, A.data), p = (A) => { if (!t13.nodeKey) throw new Error("[Tree] nodeKey is required in getNodePath"); const R = i.value.getNode(A); if (!R) return []; const K = [R.data]; let H = R.parent; for (; H && H !== o.value; ) K.push(H.data), H = H.parent; return K.reverse(); }, m = (A, R) => i.value.getCheckedNodes(A, R), g = (A) => i.value.getCheckedKeys(A), y = () => { const A = i.value.getCurrentNode(); return A ? A.data : null; }, b = () => { if (!t13.nodeKey) throw new Error("[Tree] nodeKey is required in getCurrentKey"); const A = y(); return A ? A[t13.nodeKey] : null; }, w = (A, R) => { if (!t13.nodeKey) throw new Error("[Tree] nodeKey is required in setCheckedNodes"); i.value.setCheckedNodes(A, R); }, C = (A, R) => { if (!t13.nodeKey) throw new Error("[Tree] nodeKey is required in setCheckedKeys"); i.value.setCheckedKeys(A, R); }, E = (A, R, K) => { i.value.setChecked(A, R, K); }, x = () => i.value.getHalfCheckedNodes(), T = () => i.value.getHalfCheckedKeys(), k = (A, R = true) => { if (!t13.nodeKey) throw new Error("[Tree] nodeKey is required in setCurrentNode"); iu(i, e.emit, () => { c(A), i.value.setUserCurrentNode(A, R); }); }, _ = (A, R = true) => { if (!t13.nodeKey) throw new Error("[Tree] nodeKey is required in setCurrentKey"); iu(i, e.emit, () => { c(), i.value.setCurrentNodeKey(A, R); }); }, D = (A) => i.value.getNode(A), O = (A) => { i.value.remove(A); }, I = (A, R) => { i.value.append(A, R); }, L = (A, R) => { i.value.insertBefore(A, R); }, B = (A, R) => { i.value.insertAfter(A, R); }, F = (A, R, K) => { c(R), e.emit("node-expand", A, R, K); }, M = (A, R) => { if (!t13.nodeKey) throw new Error("[Tree] nodeKey is required in updateKeyChild"); i.value.updateChildren(A, R); }; return provide("RootTree", { ctx: e, props: t13, store: i, root: o, currentNode: s, instance: getCurrentInstance() }), provide(Qi, void 0), { ns: n, store: i, root: o, currentNode: s, dragState: d, el$: u, dropIndicator$: l, isEmpty: v, filter: h6, getNodeKey: f, getNodePath: p, getCheckedNodes: m, getCheckedKeys: g, getCurrentNode: y, getCurrentKey: b, setCheckedNodes: w, setCheckedKeys: C, setChecked: E, getHalfCheckedNodes: x, getHalfCheckedKeys: T, setCurrentNode: k, setCurrentKey: _, t: r, getNode: D, remove: O, append: I, insertBefore: L, insertAfter: B, handleNodeExpand: F, updateKeyChildren: M }; } }); function _S(t13, e, r, n, a, i) { const o = resolveComponent("el-tree-node"); return openBlock(), createElementBlock("div", { ref: "el$", class: normalizeClass([ t13.ns.b(), t13.ns.is("dragging", !!t13.dragState.draggingNode), t13.ns.is("drop-not-allow", !t13.dragState.allowDrop), t13.ns.is("drop-inner", t13.dragState.dropType === "inner"), { [t13.ns.m("highlight-current")]: t13.highlightCurrent } ]), role: "tree" }, [ (openBlock(true), createElementBlock(Fragment, null, renderList(t13.root.childNodes, (s) => (openBlock(), createBlock(o, { key: t13.getNodeKey(s), node: s, props: t13.props, accordion: t13.accordion, "render-after-expand": t13.renderAfterExpand, "show-checkbox": t13.showCheckbox, "render-content": t13.renderContent, onNodeExpand: t13.handleNodeExpand }, null, 8, ["node", "props", "accordion", "render-after-expand", "show-checkbox", "render-content", "onNodeExpand"]))), 128)), t13.isEmpty ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(t13.ns.e("empty-block")) }, [ renderSlot(t13.$slots, "empty", {}, () => { var s; return [ createBaseVNode("span", { class: normalizeClass(t13.ns.e("empty-text")) }, toDisplayString((s = t13.emptyText) != null ? s : t13.t("el.tree.emptyText")), 3) ]; }) ], 2)) : createCommentVNode("v-if", true), withDirectives(createBaseVNode("div", { ref: "dropIndicator$", class: normalizeClass(t13.ns.e("drop-indicator")) }, null, 2), [ [vShow, t13.dragState.showDropIndicator] ]) ], 2); } var DS = ze(TS, [["render", _S], ["__file", "tree.vue"]]); var PS = $t(DS); function OS(t13) { let e; const r = ref(false), n = reactive({ ...t13, originalPosition: "", originalOverflow: "", visible: false }); function a(v) { n.text = v; } function i() { const v = n.parent, h6 = d.ns; if (!v.vLoadingAddClassList) { let f = v.getAttribute("loading-number"); f = Number.parseInt(f) - 1, f ? v.setAttribute("loading-number", f.toString()) : (ca(v, h6.bm("parent", "relative")), v.removeAttribute("loading-number")), ca(v, h6.bm("parent", "hidden")); } o(), c.unmount(); } function o() { var v, h6; (h6 = (v = d.$el) == null ? void 0 : v.parentNode) == null || h6.removeChild(d.$el); } function s() { var v; t13.beforeClose && !t13.beforeClose() || (r.value = true, clearTimeout(e), e = setTimeout(u, 400), n.visible = false, (v = t13.closed) == null || v.call(t13)); } function u() { if (!r.value) return; const v = n.parent; r.value = false, v.vLoadingAddClassList = void 0, i(); } const l = defineComponent({ name: "ElLoading", setup(v, { expose: h6 }) { const { ns: f, zIndex: p } = vx("loading"); return h6({ ns: f, zIndex: p }), () => { const m = n.spinner || n.svg, g = h("svg", { class: "circular", viewBox: n.svgViewBox ? n.svgViewBox : "0 0 50 50", ...m ? { innerHTML: m } : {} }, [ h("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none" }) ]), y = n.text ? h("p", { class: f.b("text") }, [n.text]) : void 0; return h(Transition, { name: f.b("fade"), onAfterLeave: u }, { default: withCtx(() => [ withDirectives(createVNode("div", { style: { backgroundColor: n.background || "" }, class: [ f.b("mask"), n.customClass, n.fullscreen ? "is-fullscreen" : "" ] }, [ h("div", { class: f.b("spinner") }, [g, y]) ]), [[vShow, n.visible]]) ]) }); }; } }), c = createApp(l), d = c.mount(document.createElement("div")); return { ...toRefs(n), setText: a, removeElLoadingChild: o, close: s, handleAfterLeave: u, vm: d, get $el() { return d.$el; } }; } var Uo; var LS = function(t13 = {}) { if (!_t) return; const e = FS(t13); if (e.fullscreen && Uo) return Uo; const r = OS({ ...e, closed: () => { var a; (a = e.closed) == null || a.call(e), e.fullscreen && (Uo = void 0); } }); IS(e, e.parent, r), jd(e, e.parent, r), e.parent.vLoadingAddClassList = () => jd(e, e.parent, r); let n = e.parent.getAttribute("loading-number"); return n ? n = `${Number.parseInt(n) + 1}` : n = "1", e.parent.setAttribute("loading-number", n), e.parent.appendChild(r.$el), nextTick(() => r.visible.value = e.visible), e.fullscreen && (Uo = r), r; }; var FS = (t13) => { var e, r, n, a; let i; return tr(t13.target) ? i = (e = document.querySelector(t13.target)) != null ? e : document.body : i = t13.target || document.body, { parent: i === document.body || t13.body ? document.body : i, background: t13.background || "", svg: t13.svg || "", svgViewBox: t13.svgViewBox || "", spinner: t13.spinner || false, text: t13.text || "", fullscreen: i === document.body && ((r = t13.fullscreen) != null ? r : true), lock: (n = t13.lock) != null ? n : false, customClass: t13.customClass || "", visible: (a = t13.visible) != null ? a : true, beforeClose: t13.beforeClose, closed: t13.closed, target: i }; }; var IS = async (t13, e, r) => { const { nextZIndex: n } = r.vm.zIndex || r.vm._.exposed.zIndex, a = {}; if (t13.fullscreen) r.originalPosition.value = Ti(document.body, "position"), r.originalOverflow.value = Ti(document.body, "overflow"), a.zIndex = n(); else if (t13.parent === document.body) { r.originalPosition.value = Ti(document.body, "position"), await nextTick(); for (const i of ["top", "left"]) { const o = i === "top" ? "scrollTop" : "scrollLeft"; a[i] = `${t13.target.getBoundingClientRect()[i] + document.body[o] + document.documentElement[o] - Number.parseInt(Ti(document.body, `margin-${i}`), 10)}px`; } for (const i of ["height", "width"]) a[i] = `${t13.target.getBoundingClientRect()[i]}px`; } else r.originalPosition.value = Ti(e, "position"); for (const [i, o] of Object.entries(a)) r.$el.style[i] = o; }; var jd = (t13, e, r) => { const n = r.vm.ns || r.vm._.exposed.ns; ["absolute", "fixed", "sticky"].includes(r.originalPosition.value) ? ca(e, n.bm("parent", "relative")) : Ql(e, n.bm("parent", "relative")), t13.fullscreen && t13.lock ? Ql(e, n.bm("parent", "hidden")) : ca(e, n.bm("parent", "hidden")); }; var ls = Symbol("ElLoading"); var Qd = (t13, e) => { var r, n, a, i; const o = e.instance, s = (v) => Ht(e.value) ? e.value[v] : void 0, u = (v) => { const h6 = tr(v) && (o == null ? void 0 : o[v]) || v; return h6 && ref(h6); }, l = (v) => u(s(v) || t13.getAttribute(`element-loading-${rm(v)}`)), c = (r = s("fullscreen")) != null ? r : e.modifiers.fullscreen, d = { text: l("text"), svg: l("svg"), svgViewBox: l("svgViewBox"), spinner: l("spinner"), background: l("background"), customClass: l("customClass"), fullscreen: c, target: (n = s("target")) != null ? n : c ? void 0 : t13, body: (a = s("body")) != null ? a : e.modifiers.body, lock: (i = s("lock")) != null ? i : e.modifiers.lock }; t13[ls] = { options: d, instance: LS(d) }; }; var AS = (t13, e) => { for (const r of Object.keys(e)) isRef(e[r]) && (e[r].value = t13[r]); }; var nc = { mounted(t13, e) { e.value && Qd(t13, e); }, updated(t13, e) { const r = t13[ls]; e.oldValue !== e.value && (e.value && !e.oldValue ? Qd(t13, e) : e.value && e.oldValue ? Ht(e.value) && AS(e.value, r.options) : r == null || r.instance.close()); }, unmounted(t13) { var e; (e = t13[ls]) == null || e.instance.close(), t13[ls] = null; } }; var Ur = (t13, e) => { const r = t13.__vccOpts || t13; for (const [n, a] of e) r[n] = a; return r; }; var MS = { name: "AnnotationPopup", props: { annotationEntry: { type: Object } }, inject: ["$annotator", "userApiKey"], data: function() { return { displayPair: { "Feature ID": "featureId", Tooltip: "label", Models: "models", Name: "name", Resource: "resourceId" }, editing: false, evidencePrefixes: ["", "DOI:", "PMID:"], evidencePrefix: "", evidence: [], authenticated: false, newEvidence: "", comment: "", prevSubs: [], showSubmissions: true, errorMessage: "", creator: void 0 }; }, computed: { isEditable: function() { return this.annotationEntry.resourceId && this.annotationEntry.featureId; }, isPositionUpdated: function() { return this.annotationEntry.resourceId && this.annotationEntry.type === "updated" && this.annotationEntry.positionUpdated; }, isDeleted: function() { return this.annotationEntry.resourceId && this.annotationEntry.type === "deleted"; } }, methods: { evidenceEntered: function(t13) { t13 && (this.evidence.push(this.evidencePrefix + t13), this.newEvidence = ""); }, formatTime: function(t13) { const e = { year: "numeric", month: "long", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }; return new Date(t13).toLocaleDateString(void 0, e); }, updatePrevSubmissions: function() { var t13; this.$annotator && this.authenticated && this.annotationEntry.resourceId && this.annotationEntry.featureId && ((t13 = this.$annotator) == null || t13.itemAnnotations( this.userApiKey, this.annotationEntry.resourceId, this.annotationEntry.featureId ).then((e) => { this.prevSubs = e; }).catch((e) => { console.log(e); })); }, submit: function() { var t13; if (this.annotationEntry.type === "updated" && this.annotationEntry.positionUpdated ? this.comment = this.comment ? `Position Updated: ${this.comment}` : "Position Updated" : this.annotationEntry.type === "deleted" && (this.comment = this.comment ? `Feature Deleted: ${this.comment}` : "Feature Deleted"), (this.evidence.length > 0 || this.comment) && this.annotationEntry.resourceId && this.annotationEntry.featureId) { const e = []; this.evidence.forEach((n) => { if (n.includes("DOI:")) { const a = n.replace("DOI:", "https://doi.org/"); e.push(new URL(a)); } else if (n.includes("PMID:")) { const a = n.replace( "PMID:", "https://pubmed.ncbi.nlm.nih.gov/" ); e.push(new URL(a)); } else e.push(n); }); const r = { resource: this.annotationEntry.resourceId, item: Object.assign( { id: this.annotationEntry.featureId }, Object.fromEntries( Object.entries(this.annotationEntry).filter( ([n]) => ["label", "models"].includes(n) ) ) ), body: { evidence: e, comment: this.comment }, feature: this.annotationEntry.feature }; Object.assign(r.body, this.annotationEntry.body), this.annotationEntry.type === "deleted" && (r.feature = void 0), this.creator && (r.creator = this.creator), (t13 = this.$annotator) == null || t13.addAnnotation(this.userApiKey, r).then(() => { this.$emit("annotation", r), this.errorMessage = "", this.resetSubmission(), this.updatePrevSubmissions(); }).catch(() => { this.errorMessage = "There is a problem with the submission, please try again later"; }); } }, removeEvidence: function(t13) { this.evidence.splice(t13, 1); }, resetSubmission: function() { this.editing = false, this.evidence = [], this.newFeature = "", this.comment = ""; } }, watch: { annotationEntry: { handler: function(t13, e) { t13 !== e && (this.resetSubmission(), this.updatePrevSubmissions()); }, immediate: false, deep: false } }, mounted: function() { var t13; (t13 = this.$annotator) == null || t13.authenticate(this.userApiKey).then((e) => { e.name && e.email && e.canUpdate ? (this.creator = e, e.orcid || (this.creator.orcid = "0000-0000-0000-0000"), this.authenticated = true, this.updatePrevSubmissions()) : this.errorMessage = ""; }); } }; var _a = (t13) => (pushScopeId("data-v-9930ef40"), t13 = t13(), popScopeId(), t13); var BS = { class: "block" }; var NS = _a(() => createBaseVNode("div", { class: "title" }, "Feature Annotations", -1)); var $S = _a(() => createBaseVNode("strong", { class: "sub-title" }, "Previous submissions:", -1)); var RS = _a(() => createBaseVNode("strong", null, "Evidence: ", -1)); var zS = ["href"]; var VS = _a(() => createBaseVNode("strong", null, "Comment: ", -1)); var HS = _a(() => createBaseVNode("strong", { class: "sub-title" }, "Suggest changes:", -1)); var qS = _a(() => createBaseVNode("strong", null, "Evidence:", -1)); var KS = _a(() => createBaseVNode("strong", null, "Comment:", -1)); var US = { class: "sub-title" }; function GS(t13, e, r, n, a, i) { const o = Qs, s = Hv, u = Vt, l = Gs, c = v2, d = d2, v = p2, h6 = So, f = Ss, p = sS, m = oS, g = Eo, y = Hr, b = Ju; return openBlock(), createBlock(b, { class: "main" }, { default: withCtx(() => [ createBaseVNode("div", BS, [ createVNode(o, { class: "info-field" }, { default: withCtx(() => [ NS ]), _: 1 }), r.annotationEntry ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ (openBlock(true), createElementBlock(Fragment, null, renderList(t13.displayPair, (w, C) => withDirectives((openBlock(), createBlock(o, { class: "dialog-text", key: w }, { default: withCtx(() => [ createBaseVNode("strong", null, toDisplayString(C) + ": ", 1), createTextVNode(" " + toDisplayString(r.annotationEntry[w]), 1) ]), _: 2 }, 1024)), [ [vShow, r.annotationEntry[w]] ])), 128)), t13.prevSubs.length > 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ withDirectives(createBaseVNode("div", { class: "hide", onClick: e[0] || (e[0] = (w) => t13.showSubmissions = false) }, [ createTextVNode(" Hide previous submissions "), createVNode(u, null, { default: withCtx(() => [ createVNode(s) ]), _: 1 }) ], 512), [ [vShow, t13.showSubmissions] ]), withDirectives(createBaseVNode("div", { class: "hide", onClick: e[1] || (e[1] = (w) => t13.showSubmissions = true) }, [ createTextVNode(" Show previous " + toDisplayString(t13.prevSubs.length) + " submission(s) ", 1), createVNode(u, null, { default: withCtx(() => [ createVNode(l) ]), _: 1 }) ], 512), [ [vShow, !t13.showSubmissions] ]), t13.showSubmissions ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ createVNode(o, { class: "dialog-spacer" }), createVNode(o, { class: "dialog-text" }, { default: withCtx(() => [ $S ]), _: 1 }), (openBlock(true), createElementBlock(Fragment, null, renderList(t13.prevSubs, (w, C) => (openBlock(), createElementBlock("div", { class: "entry", key: C }, [ createVNode(o, { class: "dialog-text" }, { default: withCtx(() => [ createBaseVNode("strong", null, toDisplayString(i.formatTime(w.created)), 1), createTextVNode(" " + toDisplayString(w.creator.name), 1) ]), _: 2 }, 1024), createVNode(o, { class: "dialog-text" }, { default: withCtx(() => [ RS, (openBlock(true), createElementBlock(Fragment, null, renderList(w.body.evidence, (E) => (openBlock(), createBlock(o, { key: E, class: "dialog-text" }, { default: withCtx(() => [ createBaseVNode("a", { href: E, target: "_blank" }, toDisplayString(E), 9, zS) ]), _: 2 }, 1024))), 128)) ]), _: 2 }, 1024), createVNode(o, { class: "dialog-text" }, { default: withCtx(() => [ VS, createTextVNode(" " + toDisplayString(w.body.comment), 1) ]), _: 2 }, 1024) ]))), 128)) ], 64)) : createCommentVNode("", true) ], 64)) : createCommentVNode("", true), t13.authenticated ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [ i.isEditable ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ createVNode(o, { class: "dialog-spacer" }), t13.editing ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [ createVNode(o, { class: "dialog-text" }, { default: withCtx(() => [ HS ]), _: 1 }), i.isDeleted ? createCommentVNode("", true) : (openBlock(), createElementBlock(Fragment, { key: 0 }, [ createVNode(o, { class: "dialog-text" }, { default: withCtx(() => [ qS ]), _: 1 }), (openBlock(true), createElementBlock(Fragment, null, renderList(t13.evidence, (w, C) => (openBlock(), createBlock(o, { key: w }, { default: withCtx(() => [ createVNode(h6, { span: 20 }, { default: withCtx(() => [ createTextVNode(toDisplayString(t13.evidence[C]), 1) ]), _: 2 }, 1024), createVNode(h6, { span: 4 }, { default: withCtx(() => [ createVNode(u, { class: "standard-icon" }, { default: withCtx(() => [ createVNode(f, { onClick: (E) => i.removeEvidence(C) }, null, 8, ["onClick"]) ]), _: 2 }, 1024) ]), _: 2 }, 1024) ]), _: 2 }, 1024))), 128)), createVNode(o, null, { default: withCtx(() => [ createVNode(g, { size: "small", placeholder: "Enter", modelValue: t13.newEvidence, "onUpdate:modelValue": e[4] || (e[4] = (w) => t13.newEvidence = w), onChange: e[5] || (e[5] = (w) => i.evidenceEntered(w)) }, { prepend: withCtx(() => [ createVNode(m, { teleported: false, modelValue: t13.evidencePrefix, "onUpdate:modelValue": e[3] || (e[3] = (w) => t13.evidencePrefix = w), placeholder: "No Prefix", class: "select-box", "popper-class": "flatmap_dropdown" }, { default: withCtx(() => [ (openBlock(true), createElementBlock(Fragment, null, renderList(t13.evidencePrefixes, (w) => (openBlock(), createBlock(p, { key: w, label: w, value: w }, { default: withCtx(() => [ createVNode(o, null, { default: withCtx(() => [ createVNode(h6, { span: 12 }, { default: withCtx(() => [ createTextVNode(toDisplayString(w), 1) ]), _: 2 }, 1024) ]), _: 2 }, 1024) ]), _: 2 }, 1032, ["label", "value"]))), 128)) ]), _: 1 }, 8, ["modelValue"]) ]), _: 1 }, 8, ["modelValue"]) ]), _: 1 }) ], 64)), createVNode(o, null, { default: withCtx(() => [ KS ]), _: 1 }), createVNode(o, { class: "dialog-text" }, { default: withCtx(() => [ createVNode(g, { type: "textarea", autosize: { minRows: 2, maxRows: 4 }, placeholder: "Enter", modelValue: t13.comment, "onUpdate:modelValue": e[6] || (e[6] = (w) => t13.comment = w) }, null, 8, ["modelValue"]) ]), _: 1 }), createVNode(o, { class: "dialog-text" }, { default: withCtx(() => [ createVNode(y, { class: "button", type: "primary", plain: "", onClick: i.submit }, { default: withCtx(() => [ createTextVNode(" Submit ") ]), _: 1 }, 8, ["onClick"]) ]), _: 1 }) ], 64)) : (openBlock(), createBlock(o, { key: 0 }, { default: withCtx(() => [ createVNode(u, { class: "standard-icon" }, { default: withCtx(() => [ createVNode(c, { onClick: e[2] || (e[2] = (w) => t13.editing = true) }) ]), _: 1 }), i.isDeleted ? (openBlock(), createBlock(u, { key: 0, class: "standard-icon" }, { default: withCtx(() => [ createVNode(d, { onClick: i.submit }, null, 8, ["onClick"]) ]), _: 1 })) : i.isPositionUpdated ? (openBlock(), createBlock(u, { key: 1, class: "standard-icon" }, { default: withCtx(() => [ createVNode(v, { onClick: i.submit }, null, 8, ["onClick"]) ]), _: 1 })) : createCommentVNode("", true) ]), _: 1 })), t13.errorMessage ? (openBlock(), createBlock(o, { key: 2, class: "dialog-text" }, { default: withCtx(() => [ createBaseVNode("strong", US, toDisplayString(t13.errorMessage), 1) ]), _: 1 })) : createCommentVNode("", true) ], 64)) : createCommentVNode("", true) ], 64)) : createCommentVNode("", true) ], 64)) : createCommentVNode("", true) ]) ]), _: 1 }); } var WS = Ur(MS, [["render", GS], ["__scopeId", "data-v-9930ef40"]]); var YS = { name: "CreateTooltipContent", components: { Button: Hr, Col: So, Container: $h, Header: Rh, Input: Eo, Main: Ju }, props: { createData: { type: Object } }, watch: { "createData.shape": { handler: function(t13, e) { this.group = t13, e !== void 0 && this.$emit("cancel-create"); }, immediate: true } }, computed: { confirmText: function() { return this.createData.editingIndex > -1 ? "Edit" : "Confirm"; } }, data: function() { return { group: "default", region: "", showPoint: false }; }, methods: { confirm: function() { this.$emit( "confirm-create", { region: "__annotation/" + this.region, group: this.group, shape: this.createData.shape, editingIndex: this.createData.editingIndex } ), this.group = this.createData.shape; }, cancel: function() { this.$emit("cancel-create"); } } }; var ZS = (t13) => (pushScopeId("data-v-d61c5879"), t13 = t13(), popScopeId(), t13); var XS = ZS(() => createBaseVNode("span", { class: "create-text" }, " Primitives will be created in the __annotation region ", -1)); function jS(t13, e, r, n, a, i) { const o = Rh, s = So, u = Qs, l = Eo, c = Hr, d = Ju, v = $h; return openBlock(), createBlock(v, { class: "create-container" }, { default: withCtx(() => [ createVNode(o, { height: "30px", class: "header" }, { default: withCtx(() => [ createBaseVNode("div", null, "Create " + toDisplayString(r.createData.shape), 1) ]), _: 1 }), createVNode(d, { class: "slides-block" }, { default: withCtx(() => [ XS, withDirectives(createVNode(u, { class: "row" }, { default: withCtx(() => [ createVNode(s, { offset: 0, span: 8 }, { default: withCtx(() => [ createTextVNode(" Position: ") ]), _: 1 }), createVNode(s, { offset: 0, span: 16 }, { default: withCtx(() => [ (openBlock(true), createElementBlock(Fragment, null, renderList(r.createData.points, ({ value: h6, i: f }) => (openBlock(), createBlock(u, { key: f, class: "value" }, { default: withCtx(() => [ createTextVNode(toDisplayString(f), 1) ]), _: 2 }, 1024))), 128)) ]), _: 1 }) ]), _: 1 }, 512), [ [vShow, t13.showPoint] ]), createVNode(u, { class: "row" }, { default: withCtx(() => [ createVNode(s, { offset: 0, span: 8 }, { default: withCtx(() => [ createTextVNode(" Region: ") ]), _: 1 }), createVNode(s, { offset: 0, span: 16 }, { default: withCtx(() => [ createVNode(l, { modelValue: t13.region, "onUpdate:modelValue": e[0] || (e[0] = (h6) => t13.region = h6), placeholder: "__annotation", size: "small" }, null, 8, ["modelValue"]) ]), _: 1 }) ]), _: 1 }), createVNode(u, { class: "row" }, { default: withCtx(() => [ createVNode(s, { offset: 0, span: 8 }, { default: withCtx(() => [ createTextVNode(" Group: ") ]), _: 1 }), createVNode(s, { offset: 0, span: 16 }, { default: withCtx(() => [ createVNode(l, { modelValue: t13.group, "onUpdate:modelValue": e[1] || (e[1] = (h6) => t13.group = h6), placeholder: r.createData.shape, size: "small" }, null, 8, ["modelValue", "placeholder"]) ]), _: 1 }) ]), _: 1 }), createVNode(u, null, { default: withCtx(() => [ createVNode(s, { offset: 0, span: 12 }, { default: withCtx(() => [ createVNode(c, { type: "primary", plain: "", onClick: i.confirm }, { default: withCtx(() => [ createTextVNode(toDisplayString(i.confirmText), 1) ]), _: 1 }, 8, ["onClick"]) ]), _: 1 }), createVNode(s, { offset: 0, span: 12 }, { default: withCtx(() => [ createVNode(c, { type: "primary", plain: "", onClick: i.cancel }, { default: withCtx(() => [ createTextVNode(" Cancel ") ]), _: 1 }, 8, ["onClick"]) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }); } var IF = Ur(YS, [["render", jS], ["__scopeId", "data-v-d61c5879"]]); function It(t13) { "@babel/helpers - typeof"; return It = 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; }, It(t13); } function ac(t13, e) { if (!(t13 instanceof e)) throw new TypeError("Cannot call a class as a function"); } function QS(t13, e) { for (var r = 0; r < e.length; r++) { var n = e[r]; n.enumerable = n.enumerable || false, n.configurable = true, "value" in n && (n.writable = true), Object.defineProperty(t13, n.key, n); } } function ic(t13, e, r) { return e && QS(t13.prototype, e), Object.defineProperty(t13, "prototype", { writable: false }), t13; } function Kh(t13, e, r) { return e in t13 ? Object.defineProperty(t13, e, { value: r, enumerable: true, configurable: true, writable: true }) : t13[e] = r, t13; } function Mr(t13, e) { return JS(t13) || eT(t13, e) || Uh(t13, e) || tT(); } function JS(t13) { if (Array.isArray(t13)) return t13; } function eT(t13, e) { var r = t13 == null ? null : typeof Symbol < "u" && t13[Symbol.iterator] || t13["@@iterator"]; if (r != null) { var n = [], a = true, i = false, o, s; try { for (r = r.call(t13); !(a = (o = r.next()).done) && (n.push(o.value), !(e && n.length === e)); a = true) ; } catch (u) { i = true, s = u; } finally { try { !a && r.return != null && r.return(); } finally { if (i) throw s; } } return n; } } function Uh(t13, e) { if (t13) { if (typeof t13 == "string") return Jd(t13, e); var r = Object.prototype.toString.call(t13).slice(8, -1); if (r === "Object" && t13.constructor && (r = t13.constructor.name), r === "Map" || r === "Set") return Array.from(t13); if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return Jd(t13, e); } } function Jd(t13, e) { (e == null || e > t13.length) && (e = t13.length); for (var r = 0, n = new Array(e); r < e; r++) n[r] = t13[r]; return n; } function tT() { 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 Gh(t13, e) { var r = typeof Symbol < "u" && t13[Symbol.iterator] || t13["@@iterator"]; if (!r) { if (Array.isArray(t13) || (r = Uh(t13)) || e) { r && (t13 = r); var n = 0, a = function() { }; return { s: a, n: function() { return n >= t13.length ? { done: true } : { done: false, value: t13[n++] }; }, e: function(u) { throw u; }, f: a }; } throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`); } var i = true, o = false, s; return { s: function() { r = r.call(t13); }, n: function() { var u = r.next(); return i = u.done, u; }, e: function(u) { o = true, s = u; }, f: function() { try { !i && r.return != null && r.return(); } finally { if (o) throw s; } } }; } var Ot = typeof window > "u" ? null : window; var ef = Ot ? Ot.navigator : null; Ot && Ot.document; var rT = It(""); var Wh = It({}); var nT = It(function() { }); var aT = typeof HTMLElement > "u" ? "undefined" : It(HTMLElement); var _o = function(e) { return e && e.instanceString && pt(e.instanceString) ? e.instanceString() : null; }; var Ie = function(e) { return e != null && It(e) == rT; }; var pt = function(e) { return e != null && It(e) === nT; }; var st = function(e) { return !yr(e) && (Array.isArray ? Array.isArray(e) : e != null && e instanceof Array); }; var Xe = function(e) { return e != null && It(e) === Wh && !st(e) && e.constructor === Object; }; var iT = function(e) { return e != null && It(e) === Wh; }; var be = function(e) { return e != null && It(e) === It(1) && !isNaN(e); }; var oT = function(e) { return be(e) && Math.floor(e) === e; }; var Ds = function(e) { if (aT !== "undefined") return e != null && e instanceof HTMLElement; }; var yr = function(e) { return Do(e) || Yh(e); }; var Do = function(e) { return _o(e) === "collection" && e._private.single; }; var Yh = function(e) { return _o(e) === "collection" && !e._private.single; }; var oc = function(e) { return _o(e) === "core"; }; var Zh = function(e) { return _o(e) === "stylesheet"; }; var sT = function(e) { return _o(e) === "event"; }; var qn = function(e) { return e == null ? true : !!(e === "" || e.match(/^\s+$/)); }; var lT = function(e) { return typeof HTMLElement > "u" ? false : e instanceof HTMLElement; }; var uT = function(e) { return Xe(e) && be(e.x1) && be(e.x2) && be(e.y1) && be(e.y2); }; var cT = function(e) { return iT(e) && pt(e.then); }; var dT = function() { return ef && ef.userAgent.match(/msie|trident|edge/i); }; var to = function(e, r) { r || (r = function() { if (arguments.length === 1) return arguments[0]; if (arguments.length === 0) return "undefined"; for (var i = [], o = 0; o < arguments.length; o++) i.push(arguments[o]); return i.join("$"); }); var n = function a() { var i = this, o = arguments, s, u = r.apply(i, o), l = a.cache; return (s = l[u]) || (s = l[u] = e.apply(i, o)), s; }; return n.cache = {}, n; }; var sc = to(function(t13) { return t13.replace(/([A-Z])/g, function(e) { return "-" + e.toLowerCase(); }); }); var Js = to(function(t13) { return t13.replace(/(-\w)/g, function(e) { return e[1].toUpperCase(); }); }); var Xh = to(function(t13, e) { return t13 + e[0].toUpperCase() + e.substring(1); }, function(t13, e) { return t13 + "$" + e; }); var tf = function(e) { return qn(e) ? e : e.charAt(0).toUpperCase() + e.substring(1); }; var Ft = "(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))"; var fT = "rgb[a]?\\((" + Ft + "[%]?)\\s*,\\s*(" + Ft + "[%]?)\\s*,\\s*(" + Ft + "[%]?)(?:\\s*,\\s*(" + Ft + "))?\\)"; var vT = "rgb[a]?\\((?:" + Ft + "[%]?)\\s*,\\s*(?:" + Ft + "[%]?)\\s*,\\s*(?:" + Ft + "[%]?)(?:\\s*,\\s*(?:" + Ft + "))?\\)"; var hT = "hsl[a]?\\((" + Ft + ")\\s*,\\s*(" + Ft + "[%])\\s*,\\s*(" + Ft + "[%])(?:\\s*,\\s*(" + Ft + "))?\\)"; var pT = "hsl[a]?\\((?:" + Ft + ")\\s*,\\s*(?:" + Ft + "[%])\\s*,\\s*(?:" + Ft + "[%])(?:\\s*,\\s*(?:" + Ft + "))?\\)"; var gT = "\\#[0-9a-fA-F]{3}"; var mT = "\\#[0-9a-fA-F]{6}"; var jh = function(e, r) { return e < r ? -1 : e > r ? 1 : 0; }; var yT = function(e, r) { return -1 * jh(e, r); }; var Re = Object.assign != null ? Object.assign.bind(Object) : function(t13) { for (var e = arguments, r = 1; r < e.length; r++) { var n = e[r]; if (n != null) for (var a = Object.keys(n), i = 0; i < a.length; i++) { var o = a[i]; t13[o] = n[o]; } } return t13; }; var bT = function(e) { if (!(!(e.length === 4 || e.length === 7) || e[0] !== "#")) { var r = e.length === 4, n, a, i, o = 16; return r ? (n = parseInt(e[1] + e[1], o), a = parseInt(e[2] + e[2], o), i = parseInt(e[3] + e[3], o)) : (n = parseInt(e[1] + e[2], o), a = parseInt(e[3] + e[4], o), i = parseInt(e[5] + e[6], o)), [n, a, i]; } }; var wT = function(e) { var r, n, a, i, o, s, u, l; function c(f, p, m) { return m < 0 && (m += 1), m > 1 && (m -= 1), m < 1 / 6 ? f + (p - f) * 6 * m : m < 1 / 2 ? p : m < 2 / 3 ? f + (p - f) * (2 / 3 - m) * 6 : f; } var d = new RegExp("^" + hT + "$").exec(e); if (d) { if (n = parseInt(d[1]), n < 0 ? n = (360 - -1 * n % 360) % 360 : n > 360 && (n = n % 360), n /= 360, a = parseFloat(d[2]), a < 0 || a > 100 || (a = a / 100, i = parseFloat(d[3]), i < 0 || i > 100) || (i = i / 100, o = d[4], o !== void 0 && (o = parseFloat(o), o < 0 || o > 1))) return; if (a === 0) s = u = l = Math.round(i * 255); else { var v = i < 0.5 ? i * (1 + a) : i + a - i * a, h6 = 2 * i - v; s = Math.round(255 * c(h6, v, n + 1 / 3)), u = Math.round(255 * c(h6, v, n)), l = Math.round(255 * c(h6, v, n - 1 / 3)); } r = [s, u, l, o]; } return r; }; var xT = function(e) { var r, n = new RegExp("^" + fT + "$").exec(e); if (n) { r = []; for (var a = [], i = 1; i <= 3; i++) { var o = n[i]; if (o[o.length - 1] === "%" && (a[i] = true), o = parseFloat(o), a[i] && (o = o / 100 * 255), o < 0 || o > 255) return; r.push(Math.floor(o)); } var s = a[1] || a[2] || a[3], u = a[1] && a[2] && a[3]; if (s && !u) return; var l = n[4]; if (l !== void 0) { if (l = parseFloat(l), l < 0 || l > 1) return; r.push(l); } } return r; }; var CT = function(e) { return kT[e.toLowerCase()]; }; var ET = function(e) { return (st(e) ? e : null) || CT(e) || bT(e) || xT(e) || wT(e); }; var kT = { // special colour names transparent: [0, 0, 0, 0], // NB alpha === 0 // regular colours aliceblue: [240, 248, 255], antiquewhite: [250, 235, 215], aqua: [0, 255, 255], aquamarine: [127, 255, 212], azure: [240, 255, 255], beige: [245, 245, 220], bisque: [255, 228, 196], black: [0, 0, 0], blanchedalmond: [255, 235, 205], blue: [0, 0, 255], blueviolet: [138, 43, 226], brown: [165, 42, 42], burlywood: [222, 184, 135], cadetblue: [95, 158, 160], chartreuse: [127, 255, 0], chocolate: [210, 105, 30], coral: [255, 127, 80], cornflowerblue: [100, 149, 237], cornsilk: [255, 248, 220], crimson: [220, 20, 60], cyan: [0, 255, 255], darkblue: [0, 0, 139], darkcyan: [0, 139, 139], darkgoldenrod: [184, 134, 11], darkgray: [169, 169, 169], darkgreen: [0, 100, 0], darkgrey: [169, 169, 169], darkkhaki: [189, 183, 107], darkmagenta: [139, 0, 139], darkolivegreen: [85, 107, 47], darkorange: [255, 140, 0], darkorchid: [153, 50, 204], darkred: [139, 0, 0], darksalmon: [233, 150, 122], darkseagreen: [143, 188, 143], darkslateblue: [72, 61, 139], darkslategray: [47, 79, 79], darkslategrey: [47, 79, 79], darkturquoise: [0, 206, 209], darkviolet: [148, 0, 211], deeppink: [255, 20, 147], deepskyblue: [0, 191, 255], dimgray: [105, 105, 105], dimgrey: [105, 105, 105], dodgerblue: [30, 144, 255], firebrick: [178, 34, 34], floralwhite: [255, 250, 240], forestgreen: [34, 139, 34], fuchsia: [255, 0, 255], gainsboro: [220, 220, 220], ghostwhite: [248, 248, 255], gold: [255, 215, 0], goldenrod: [218, 165, 32], gray: [128, 128, 128], grey: [128, 128, 128], green: [0, 128, 0], greenyellow: [173, 255, 47], honeydew: [240, 255, 240], hotpink: [255, 105, 180], indianred: [205, 92, 92], indigo: [75, 0, 130], ivory: [255, 255, 240], khaki: [240, 230, 140], lavender: [230, 230, 250], lavenderblush: [255, 240, 245], lawngreen: [124, 252, 0], lemonchiffon: [255, 250, 205], lightblue: [173, 216, 230], lightcoral: [240, 128, 128], lightcyan: [224, 255, 255], lightgoldenrodyellow: [250, 250, 210], lightgray: [211, 211, 211], lightgreen: [144, 238, 144], lightgrey: [211, 211, 211], lightpink: [255, 182, 193], lightsalmon: [255, 160, 122], lightseagreen: [32, 178, 170], lightskyblue: [135, 206, 250], lightslategray: [119, 136, 153], lightslategrey: [119, 136, 153], lightsteelblue: [176, 196, 222], lightyellow: [255, 255, 224], lime: [0, 255, 0], limegreen: [50, 205, 50], linen: [250, 240, 230], magenta: [255, 0, 255], maroon: [128, 0, 0], mediumaquamarine: [102, 205, 170], mediumblue: [0, 0, 205], mediumorchid: [186, 85, 211], mediumpurple: [147, 112, 219], mediumseagreen: [60, 179, 113], mediumslateblue: [123, 104, 238], mediumspringgreen: [0, 250, 154], mediumturquoise: [72, 209, 204], mediumvioletred: [199, 21, 133], midnightblue: [25, 25, 112], mintcream: [245, 255, 250], mistyrose: [255, 228, 225], moccasin: [255, 228, 181], navajowhite: [255, 222, 173], navy: [0, 0, 128], oldlace: [253, 245, 230], olive: [128, 128, 0], olivedrab: [107, 142, 35], orange: [255, 165, 0], orangered: [255, 69, 0], orchid: [218, 112, 214], palegoldenrod: [238, 232, 170], palegreen: [152, 251, 152], paleturquoise: [175, 238, 238], palevioletred: [219, 112, 147], papayawhip: [255, 239, 213], peachpuff: [255, 218, 185], peru: [205, 133, 63], pink: [255, 192, 203], plum: [221, 160, 221], powderblue: [176, 224, 230], purple: [128, 0, 128], red: [255, 0, 0], rosybrown: [188, 143, 143], royalblue: [65, 105, 225], saddlebrown: [139, 69, 19], salmon: [250, 128, 114], sandybrown: [244, 164, 96], seagreen: [46, 139, 87], seashell: [255, 245, 238], sienna: [160, 82, 45], silver: [192, 192, 192], skyblue: [135, 206, 235], slateblue: [106, 90, 205], slategray: [112, 128, 144], slategrey: [112, 128, 144], snow: [255, 250, 250], springgreen: [0, 255, 127], steelblue: [70, 130, 180], tan: [210, 180, 140], teal: [0, 128, 128], thistle: [216, 191, 216], tomato: [255, 99, 71], turquoise: [64, 224, 208], violet: [238, 130, 238], wheat: [245, 222, 179], white: [255, 255, 255], whitesmoke: [245, 245, 245], yellow: [255, 255, 0], yellowgreen: [154, 205, 50] }; var Qh = function(e) { for (var r = e.map, n = e.keys, a = n.length, i = 0; i < a; i++) { var o = n[i]; if (Xe(o)) throw Error("Tried to set map with object key"); i < n.length - 1 ? (r[o] == null && (r[o] = {}), r = r[o]) : r[o] = e.value; } }; var Jh = function(e) { for (var r = e.map, n = e.keys, a = n.length, i = 0; i < a; i++) { var o = n[i]; if (Xe(o)) throw Error("Tried to get map with object key"); if (r = r[o], r == null) return r; } return r; }; function ST(t13) { var e = typeof t13; return t13 != null && (e == "object" || e == "function"); } var ga = ST; var Mi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function TT(t13, e) { return e = { exports: {} }, t13(e, e.exports), e.exports; } var _T = typeof Mi == "object" && Mi && Mi.Object === Object && Mi; var DT = _T; var PT = typeof self == "object" && self && self.Object === Object && self; var OT = DT || PT || Function("return this")(); var el = OT; var LT = function() { return el.Date.now(); }; var Il = LT; var FT = /\s/; function IT(t13) { for (var e = t13.length; e-- && FT.test(t13.charAt(e)); ) ; return e; } var AT = IT; var MT = /^\s+/; function BT(t13) { return t13 && t13.slice(0, AT(t13) + 1).replace(MT, ""); } var NT = BT; var $T = el.Symbol; var ii = $T; var ep = Object.prototype; var RT = ep.hasOwnProperty; var zT = ep.toString; var Pi = ii ? ii.toStringTag : void 0; function VT(t13) { var e = RT.call(t13, Pi), r = t13[Pi]; try { t13[Pi] = void 0; var n = true; } catch { } var a = zT.call(t13); return n && (e ? t13[Pi] = r : delete t13[Pi]), a; } var HT = VT; var qT = Object.prototype; var KT = qT.toString; function UT(t13) { return KT.call(t13); } var GT = UT; var WT = "[object Null]"; var YT = "[object Undefined]"; var rf = ii ? ii.toStringTag : void 0; function ZT(t13) { return t13 == null ? t13 === void 0 ? YT : WT : rf && rf in Object(t13) ? HT(t13) : GT(t13); } var tp = ZT; function XT(t13) { return t13 != null && typeof t13 == "object"; } var jT = XT; var QT = "[object Symbol]"; function JT(t13) { return typeof t13 == "symbol" || jT(t13) && tp(t13) == QT; } var Po = JT; var nf = NaN; var e5 = /^[-+]0x[0-9a-f]+$/i; var t5 = /^0b[01]+$/i; var r5 = /^0o[0-7]+$/i; var n5 = parseInt; function a5(t13) { if (typeof t13 == "number") return t13; if (Po(t13)) return nf; if (ga(t13)) { var e = typeof t13.valueOf == "function" ? t13.valueOf() : t13; t13 = ga(e) ? e + "" : e; } if (typeof t13 != "string") return t13 === 0 ? t13 : +t13; t13 = NT(t13); var r = t5.test(t13); return r || r5.test(t13) ? n5(t13.slice(2), r ? 2 : 8) : e5.test(t13) ? nf : +t13; } var af = a5; var i5 = "Expected a function"; var o5 = Math.max; var s5 = Math.min; function l5(t13, e, r) { var n, a, i, o, s, u, l = 0, c = false, d = false, v = true; if (typeof t13 != "function") throw new TypeError(i5); e = af(e) || 0, ga(r) && (c = !!r.leading, d = "maxWait" in r, i = d ? o5(af(r.maxWait) || 0, e) : i, v = "trailing" in r ? !!r.trailing : v); function h6(E) { var x = n, T = a; return n = a = void 0, l = E, o = t13.apply(T, x), o; } function f(E) { return l = E, s = setTimeout(g, e), c ? h6(E) : o; } function p(E) { var x = E - u, T = E - l, k = e - x; return d ? s5(k, i - T) : k; } function m(E) { var x = E - u, T = E - l; return u === void 0 || x >= e || x < 0 || d && T >= i; } function g() { var E = Il(); if (m(E)) return y(E); s = setTimeout(g, p(E)); } function y(E) { return s = void 0, v && n ? h6(E) : (n = a = void 0, o); } function b() { s !== void 0 && clearTimeout(s), l = 0, n = u = a = s = void 0; } function w() { return s === void 0 ? o : y(Il()); } function C() { var E = Il(), x = m(E); if (n = arguments, a = this, u = E, x) { if (s === void 0) return f(u); if (d) return clearTimeout(s), s = setTimeout(g, e), h6(u); } return s === void 0 && (s = setTimeout(g, e)), o; } return C.cancel = b, C.flush = w, C; } var tl = l5; var Al = Ot ? Ot.performance : null; var rp = Al && Al.now ? function() { return Al.now(); } : function() { return Date.now(); }; var u5 = function() { if (Ot) { if (Ot.requestAnimationFrame) return function(t13) { Ot.requestAnimationFrame(t13); }; if (Ot.mozRequestAnimationFrame) return function(t13) { Ot.mozRequestAnimationFrame(t13); }; if (Ot.webkitRequestAnimationFrame) return function(t13) { Ot.webkitRequestAnimationFrame(t13); }; if (Ot.msRequestAnimationFrame) return function(t13) { Ot.msRequestAnimationFrame(t13); }; } return function(t13) { t13 && setTimeout(function() { t13(rp()); }, 1e3 / 60); }; }(); var Ps = function(e) { return u5(e); }; var gn = rp; var Va = 9261; var np = 65599; var Bi = 5381; var ap = function(e) { for (var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Va, n = r, a; a = e.next(), !a.done; ) n = n * np + a.value | 0; return n; }; var ro = function(e) { var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Va; return r * np + e | 0; }; var no = function(e) { var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Bi; return (r << 5) + r + e | 0; }; var c5 = function(e, r) { return e * 2097152 + r; }; var Dn = function(e) { return e[0] * 2097152 + e[1]; }; var Go = function(e, r) { return [ro(e[0], r[0]), no(e[1], r[1])]; }; var d5 = function(e, r) { var n = { value: 0, done: false }, a = 0, i = e.length, o = { next: function() { return a < i ? n.value = e[a++] : n.done = true, n; } }; return ap(o, r); }; var ma = function(e, r) { var n = { value: 0, done: false }, a = 0, i = e.length, o = { next: function() { return a < i ? n.value = e.charCodeAt(a++) : n.done = true, n; } }; return ap(o, r); }; var ip = function() { return f5(arguments); }; var f5 = function(e) { for (var r, n = 0; n < e.length; n++) { var a = e[n]; n === 0 ? r = ma(a) : r = ma(a, r); } return r; }; var of = true; var v5 = console.warn != null; var h5 = console.trace != null; var lc = Number.MAX_SAFE_INTEGER || 9007199254740991; var op = function() { return true; }; var Os = function() { return false; }; var sf = function() { return 0; }; var uc = function() { }; var yt = function(e) { throw new Error(e); }; var sp = function(e) { if (e !== void 0) of = !!e; else return of; }; var tt = function(e) { sp() && (v5 ? console.warn(e) : (console.log(e), h5 && console.trace())); }; var p5 = function(e) { return Re({}, e); }; var Zr = function(e) { return e == null ? e : st(e) ? e.slice() : Xe(e) ? p5(e) : e; }; var g5 = function(e) { return e.slice(); }; var lp = function(e, r) { for ( // loop :) r = e = ""; // b - result , a - numeric letiable e++ < 36; // r += e * 51 & 52 ? ( // return a random number or 4 (e ^ 15 ? ( // generate a random number from 0 to 15 8 ^ Math.random() * (e ^ 20 ? 16 : 4) ) : 4).toString(16) ) : "-" ) ; return r; }; var m5 = {}; var up = function() { return m5; }; var Wt = function(e) { var r = Object.keys(e); return function(n) { for (var a = {}, i = 0; i < r.length; i++) { var o = r[i], s = n == null ? void 0 : n[o]; a[o] = s === void 0 ? e[o] : s; } return a; }; }; var Kn = function(e, r, n) { for (var a = e.length - 1; a >= 0; a--) e[a] === r && e.splice(a, 1); }; var cc = function(e) { e.splice(0, e.length); }; var y5 = function(e, r) { for (var n = 0; n < r.length; n++) { var a = r[n]; e.push(a); } }; var Nr = function(e, r, n) { return n && (r = Xh(n, r)), e[r]; }; var An = function(e, r, n, a) { n && (r = Xh(n, r)), e[r] = a; }; var b5 = function() { function t13() { ac(this, t13), this._obj = {}; } return ic(t13, [{ key: "set", value: function(r, n) { return this._obj[r] = n, this; } }, { key: "delete", value: function(r) { return this._obj[r] = void 0, this; } }, { key: "clear", value: function() { this._obj = {}; } }, { key: "has", value: function(r) { return this._obj[r] !== void 0; } }, { key: "get", value: function(r) { return this._obj[r]; } }]), t13; }(); var Xr = typeof Map < "u" ? Map : b5; var w5 = "undefined"; var x5 = function() { function t13(e) { if (ac(this, t13), this._obj = /* @__PURE__ */ Object.create(null), this.size = 0, e != null) { var r; e.instanceString != null && e.instanceString() === this.instanceString() ? r = e.toArray() : r = e; for (var n = 0; n < r.length; n++) this.add(r[n]); } } return ic(t13, [{ key: "instanceString", value: function() { return "set"; } }, { key: "add", value: function(r) { var n = this._obj; n[r] !== 1 && (n[r] = 1, this.size++); } }, { key: "delete", value: function(r) { var n = this._obj; n[r] === 1 && (n[r] = 0, this.size--); } }, { key: "clear", value: function() { this._obj = /* @__PURE__ */ Object.create(null); } }, { key: "has", value: function(r) { return this._obj[r] === 1; } }, { key: "toArray", value: function() { var r = this; return Object.keys(this._obj).filter(function(n) { return r.has(n); }); } }, { key: "forEach", value: function(r, n) { return this.toArray().forEach(r, n); } }]), t13; }(); var vi = (typeof Set > "u" ? "undefined" : It(Set)) !== w5 ? Set : x5; var rl = function(e, r) { var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true; if (e === void 0 || r === void 0 || !oc(e)) { yt("An element must have a core reference and parameters set"); return; } var a = r.group; if (a == null && (r.data && r.data.source != null && r.data.target != null ? a = "edges" : a = "nodes"), a !== "nodes" && a !== "edges") { yt("An element must be of type `nodes` or `edges`; you specified `" + a + "`"); return; } this.length = 1, this[0] = this; var i = this._private = { cy: e, single: true, // indicates this is an element data: r.data || {}, // data object position: r.position || { x: 0, y: 0 }, // (x, y) position pair autoWidth: void 0, // width and height of nodes calculated by the renderer when set to special 'auto' value autoHeight: void 0, autoPadding: void 0, compoundBoundsClean: false, // whether the compound dimensions need to be recalculated the next time dimensions are read listeners: [], // array of bound listeners group: a, // string; 'nodes' or 'edges' style: {}, // properties as set by the style rstyle: {}, // properties for style sent from the renderer to the core styleCxts: [], // applied style contexts from the styler styleKeys: {}, // per-group keys of style property values removed: true, // whether it's inside the vis; true if removed (set true here since we call restore) selected: !!r.selected, // whether it's selected selectable: r.selectable === void 0 ? true : !!r.selectable, // whether it's selectable locked: !!r.locked, // whether the element is locked (cannot be moved) grabbed: false, // whether the element is grabbed by the mouse; renderer sets this privately grabbable: r.grabbable === void 0 ? true : !!r.grabbable, // whether the element can be grabbed pannable: r.pannable === void 0 ? a === "edges" : !!r.pannable, // whether the element has passthrough panning enabled active: false, // whether the element is active from user interaction classes: new vi(), // map ( className => true ) animation: { // object for currently-running animations current: [], queue: [] }, rscratch: {}, // object in which the renderer can store information scratch: r.scratch || {}, // scratch objects edges: [], // array of connected edges children: [], // array of children parent: r.parent && r.parent.isNode() ? r.parent : null, // parent ref traversalCache: {}, // cache of output of traversal functions backgrounding: false, // whether background images are loading bbCache: null, // cache of the current bounding box bbCacheShift: { x: 0, y: 0 }, // shift applied to cached bb to be applied on next get bodyBounds: null, // bounds cache of element body, w/o overlay overlayBounds: null, // bounds cache of element body, including overlay labelBounds: { // bounds cache of labels all: null, source: null, target: null, main: null }, arrowBounds: { // bounds cache of edge arrows source: null, target: null, "mid-source": null, "mid-target": null } }; if (i.position.x == null && (i.position.x = 0), i.position.y == null && (i.position.y = 0), r.renderedPosition) { var o = r.renderedPosition, s = e.pan(), u = e.zoom(); i.position = { x: (o.x - s.x) / u, y: (o.y - s.y) / u }; } var l = []; st(r.classes) ? l = r.classes : Ie(r.classes) && (l = r.classes.split(/\s+/)); for (var c = 0, d = l.length; c < d; c++) { var v = l[c]; !v || v === "" || i.classes.add(v); } this.createEmitter(); var h6 = r.style || r.css; h6 && (tt("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."), this.style(h6)), (n === void 0 || n) && this.restore(); }; var lf = function(e) { return e = { bfs: e.bfs || !e.dfs, dfs: e.dfs || !e.bfs }, function(n, a, i) { var o; Xe(n) && !yr(n) && (o = n, n = o.roots || o.root, a = o.visit, i = o.directed), i = arguments.length === 2 && !pt(a) ? a : i, a = pt(a) ? a : function() { }; for (var s = this._private.cy, u = n = Ie(n) ? this.filter(n) : n, l = [], c = [], d = {}, v = {}, h6 = {}, f = 0, p, m = this.byGroup(), g = m.nodes, y = m.edges, b = 0; b < u.length; b++) { var w = u[b], C = w.id(); w.isNode() && (l.unshift(w), e.bfs && (h6[C] = true, c.push(w)), v[C] = 0); } for (var E = function() { var I = e.bfs ? l.shift() : l.pop(), L = I.id(); if (e.dfs) { if (h6[L]) return "continue"; h6[L] = true, c.push(I); } var B = v[L], F = d[L], M = F != null ? F.source() : null, A = F != null ? F.target() : null, R = F == null ? void 0 : I.same(M) ? A[0] : M[0], K = void 0; if (K = a(I, F, R, f++, B), K === true) return p = I, "break"; if (K === false) return "break"; for (var H = I.connectedEdges().filter(function(ae) { return (!i || ae.source().same(I)) && y.has(ae); }), q = 0; q < H.length; q++) { var ee = H[q], se = ee.connectedNodes().filter(function(ae) { return !ae.same(I) && g.has(ae); }), oe = se.id(); se.length !== 0 && !h6[oe] && (se = se[0], l.push(se), e.bfs && (h6[oe] = true, c.push(se)), d[oe] = ee, v[oe] = v[L] + 1); } }; l.length !== 0; ) { var x = E(); if (x !== "continue" && x === "break") break; } for (var T = s.collection(), k = 0; k < c.length; k++) { var _ = c[k], D = d[_.id()]; D != null && T.push(D), T.push(_); } return { path: s.collection(T), found: s.collection(p) }; }; }; var ao = { breadthFirstSearch: lf({ bfs: true }), depthFirstSearch: lf({ dfs: true }) }; ao.bfs = ao.breadthFirstSearch; ao.dfs = ao.depthFirstSearch; var C5 = TT(function(t13, e) { (function() { var r, n, a, i, o, s, u, l, c, d, v, h6, f, p, m; a = Math.floor, d = Math.min, n = function(g, y) { return g < y ? -1 : g > y ? 1 : 0; }, c = function(g, y, b, w, C) { var E; if (b == null && (b = 0), C == null && (C = n), b < 0) throw new Error("lo must be non-negative"); for (w == null && (w = g.length); b < w; ) E = a((b + w) / 2), C(y, g[E]) < 0 ? w = E : b = E + 1; return [].splice.apply(g, [b, b - b].concat(y)), y; }, s = function(g, y, b) { return b == null && (b = n), g.push(y), p(g, 0, g.length - 1, b); }, o = function(g, y) { var b, w; return y == null && (y = n), b = g.pop(), g.length ? (w = g[0], g[0] = b, m(g, 0, y)) : w = b, w; }, l = function(g, y, b) { var w; return b == null && (b = n), w = g[0], g[0] = y, m(g, 0, b), w; }, u = function(g, y, b) { var w; return b == null && (b = n), g.length && b(g[0], y) < 0 && (w = [g[0], y], y = w[0], g[0] = w[1], m(g, 0, b)), y; }, i = function(g, y) { var b, w, C, E, x, T; for (y == null && (y = n), E = (function() { T = []; for (var k = 0, _ = a(g.length / 2); 0 <= _ ? k < _ : k > _; 0 <= _ ? k++ : k--) T.push(k); return T; }).apply(this).reverse(), x = [], w = 0, C = E.length; w < C; w++) b = E[w], x.push(m(g, b, y)); return x; }, f = function(g, y, b) { var w; if (b == null && (b = n), w = g.indexOf(y), w !== -1) return p(g, 0, w, b), m(g, w, b); }, v = function(g, y, b) { var w, C, E, x, T; if (b == null && (b = n), C = g.slice(0, y), !C.length) return C; for (i(C, b), T = g.slice(y), E = 0, x = T.length; E < x; E++) w = T[E], u(C, w, b); return C.sort(b).reverse(); }, h6 = function(g, y, b) { var w, C, E, x, T, k, _, D, O; if (b == null && (b = n), y * 10 <= g.length) { if (E = g.slice(0, y).sort(b), !E.length) return E; for (C = E[E.length - 1], _ = g.slice(y), x = 0, k = _.length; x < k; x++) w = _[x], b(w, C) < 0 && (c(E, w, 0, null, b), E.pop(), C = E[E.length - 1]); return E; } for (i(g, b), O = [], T = 0, D = d(y, g.length); 0 <= D ? T < D : T > D; 0 <= D ? ++T : --T) O.push(o(g, b)); return O; }, p = function(g, y, b, w) { var C, E, x; for (w == null && (w = n), C = g[b]; b > y; ) { if (x = b - 1 >> 1, E = g[x], w(C, E) < 0) { g[b] = E, b = x; continue; } break; } return g[b] = C; }, m = function(g, y, b) { var w, C, E, x, T; for (b == null && (b = n), C = g.length, T = y, E = g[y], w = 2 * y + 1; w < C; ) x = w + 1, x < C && !(b(g[w], g[x]) < 0) && (w = x), g[y] = g[w], y = w, w = 2 * y + 1; return g[y] = E, p(g, T, y, b); }, r = function() { g.push = s, g.pop = o, g.replace = l, g.pushpop = u, g.heapify = i, g.updateItem = f, g.nlargest = v, g.nsmallest = h6; function g(y) { this.cmp = y ?? n, this.nodes = []; } return g.prototype.push = function(y) { return s(this.nodes, y, this.cmp); }, g.prototype.pop = function() { return o(this.nodes, this.cmp); }, g.prototype.peek = function() { return this.nodes[0]; }, g.prototype.contains = function(y) { return this.nodes.indexOf(y) !== -1; }, g.prototype.replace = function(y) { return l(this.nodes, y, this.cmp); }, g.prototype.pushpop = function(y) { return u(this.nodes, y, this.cmp); }, g.prototype.heapify = function() { return i(this.nodes, this.cmp); }, g.prototype.updateItem = function(y) { return f(this.nodes, y, this.cmp); }, g.prototype.clear = function() { return this.nodes = []; }, g.prototype.empty = function() { return this.nodes.length === 0; }, g.prototype.size = function() { return this.nodes.length; }, g.prototype.clone = function() { var y; return y = new g(), y.nodes = this.nodes.slice(0), y; }, g.prototype.toArray = function() { return this.nodes.slice(0); }, g.prototype.insert = g.prototype.push, g.prototype.top = g.prototype.peek, g.prototype.front = g.prototype.peek, g.prototype.has = g.prototype.contains, g.prototype.copy = g.prototype.clone, g; }(), function(g, y) { return t13.exports = y(); }(this, function() { return r; }); }).call(Mi); }); var Oo = C5; var E5 = Wt({ root: null, weight: function(e) { return 1; }, directed: false }); var k5 = { dijkstra: function(e) { if (!Xe(e)) { var r = arguments; e = { root: r[0], weight: r[1], directed: r[2] }; } var n = E5(e), a = n.root, i = n.weight, o = n.directed, s = this, u = i, l = Ie(a) ? this.filter(a)[0] : a[0], c = {}, d = {}, v = {}, h6 = this.byGroup(), f = h6.nodes, p = h6.edges; p.unmergeBy(function(B) { return B.isLoop(); }); for (var m = function(F) { return c[F.id()]; }, g = function(F, M) { c[F.id()] = M, y.updateItem(F); }, y = new Oo(function(B, F) { return m(B) - m(F); }), b = 0; b < f.length; b++) { var w = f[b]; c[w.id()] = w.same(l) ? 0 : 1 / 0, y.push(w); } for (var C = function(F, M) { for (var A = (o ? F.edgesTo(M) : F.edgesWith(M)).intersect(p), R = 1 / 0, K, H = 0; H < A.length; H++) { var q = A[H], ee = u(q); (ee < R || !K) && (R = ee, K = q); } return { edge: K, dist: R }; }; y.size() > 0; ) { var E = y.pop(), x = m(E), T = E.id(); if (v[T] = x, x !== 1 / 0) for (var k = E.neighborhood().intersect(f), _ = 0; _ < k.length; _++) { var D = k[_], O = D.id(), I = C(E, D), L = x + I.dist; L < m(D) && (g(D, L), d[O] = { node: E, edge: I.edge }); } } return { distanceTo: function(F) { var M = Ie(F) ? f.filter(F)[0] : F[0]; return v[M.id()]; }, pathTo: function(F) { var M = Ie(F) ? f.filter(F)[0] : F[0], A = [], R = M, K = R.id(); if (M.length > 0) for (A.unshift(M); d[K]; ) { var H = d[K]; A.unshift(H.edge), A.unshift(H.node), R = H.node, K = R.id(); } return s.spawn(A); } }; } }; var S5 = { // kruskal's algorithm (finds min spanning tree, assuming undirected graph) // implemented from pseudocode from wikipedia kruskal: function(e) { e = e || function(b) { return 1; }; for (var r = this.byGroup(), n = r.nodes, a = r.edges, i = n.length, o = new Array(i), s = n, u = function(w) { for (var C = 0; C < o.length; C++) { var E = o[C]; if (E.has(w)) return C; } }, l = 0; l < i; l++) o[l] = this.spawn(n[l]); for (var c = a.sort(function(b, w) { return e(b) - e(w); }), d = 0; d < c.length; d++) { var v = c[d], h6 = v.source()[0], f = v.target()[0], p = u(h6), m = u(f), g = o[p], y = o[m]; p !== m && (s.merge(v), g.merge(y), o.splice(m, 1)); } return s; } }; var T5 = Wt({ root: null, goal: null, weight: function(e) { return 1; }, heuristic: function(e) { return 0; }, directed: false }); var _5 = { // Implemented from pseudocode from wikipedia aStar: function(e) { var r = this.cy(), n = T5(e), a = n.root, i = n.goal, o = n.heuristic, s = n.directed, u = n.weight; a = r.collection(a)[0], i = r.collection(i)[0]; var l = a.id(), c = i.id(), d = {}, v = {}, h6 = {}, f = new Oo(function(K, H) { return v[K.id()] - v[H.id()]; }), p = new vi(), m = {}, g = {}, y = function(H, q) { f.push(H), p.add(q); }, b, w, C = function() { b = f.pop(), w = b.id(), p.delete(w); }, E = function(H) { return p.has(H); }; y(a, l), d[l] = 0, v[l] = o(a); for (var x = 0; f.size() > 0; ) { if (C(), x++, w === c) { for (var T = [], k = i, _ = c, D = g[_]; T.unshift(k), D != null && T.unshift(D), k = m[_], k != null; ) _ = k.id(), D = g[_]; return { found: true, distance: d[w], path: this.spawn(T), steps: x }; } h6[w] = true; for (var O = b._private.edges, I = 0; I < O.length; I++) { var L = O[I]; if (this.hasElementWithId(L.id()) && !(s && L.data("source") !== w)) { var B = L.source(), F = L.target(), M = B.id() !== w ? B : F, A = M.id(); if (this.hasElementWithId(A) && !h6[A]) { var R = d[w] + u(L); if (!E(A)) { d[A] = R, v[A] = R + o(M), y(M, A), m[A] = b, g[A] = L; continue; } R < d[A] && (d[A] = R, v[A] = R + o(M), m[A] = b, g[A] = L); } } } } return { found: false, distance: void 0, path: void 0, steps: x }; } }; var D5 = Wt({ weight: function(e) { return 1; }, directed: false }); var P5 = { // Implemented from pseudocode from wikipedia floydWarshall: function(e) { for (var r = this.cy(), n = D5(e), a = n.weight, i = n.directed, o = a, s = this.byGroup(), u = s.nodes, l = s.edges, c = u.length, d = c * c, v = function(ee) { return u.indexOf(ee); }, h6 = function(ee) { return u[ee]; }, f = new Array(d), p = 0; p < d; p++) { var m = p % c, g = (p - m) / c; g === m ? f[p] = 0 : f[p] = 1 / 0; } for (var y = new Array(d), b = new Array(d), w = 0; w < l.length; w++) { var C = l[w], E = C.source()[0], x = C.target()[0]; if (E !== x) { var T = v(E), k = v(x), _ = T * c + k, D = o(C); if (f[_] > D && (f[_] = D, y[_] = k, b[_] = C), !i) { var O = k * c + T; !i && f[O] > D && (f[O] = D, y[O] = T, b[O] = C); } } } for (var I = 0; I < c; I++) for (var L = 0; L < c; L++) for (var B = L * c + I, F = 0; F < c; F++) { var M = L * c + F, A = I * c + F; f[B] + f[A] < f[M] && (f[M] = f[B] + f[A], y[M] = y[B]); } var R = function(ee) { return (Ie(ee) ? r.filter(ee) : ee)[0]; }, K = function(ee) { return v(R(ee)); }, H = { distance: function(ee, se) { var oe = K(ee), ae = K(se); return f[oe * c + ae]; }, path: function(ee, se) { var oe = K(ee), ae = K(se), ue = h6(oe); if (oe === ae) return ue.collection(); if (y[oe * c + ae] == null) return r.collection(); var te = r.collection(), $ = oe, G; for (te.merge(ue); oe !== ae; ) $ = oe, oe = y[oe * c + ae], G = b[$ * c + oe], te.merge(G), te.merge(h6(oe)); return te; } }; return H; } // floydWarshall }; var O5 = Wt({ weight: function(e) { return 1; }, directed: false, root: null }); var L5 = { // Implemented from pseudocode from wikipedia bellmanFord: function(e) { var r = this, n = O5(e), a = n.weight, i = n.directed, o = n.root, s = a, u = this, l = this.cy(), c = this.byGroup(), d = c.edges, v = c.nodes, h6 = v.length, f = new Xr(), p = false, m = []; o = l.collection(o)[0], d.unmergeBy(function(ke) { return ke.isLoop(); }); for (var g = d.length, y = function(Ce) { var De = f.get(Ce.id()); return De || (De = {}, f.set(Ce.id(), De)), De; }, b = function(Ce) { return (Ie(Ce) ? l.$(Ce) : Ce)[0]; }, w = function(Ce) { return y(b(Ce)).dist; }, C = function(Ce) { for (var De = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : o, qe = b(Ce), Ke = [], Be = qe; ; ) { if (Be == null) return r.spawn(); var Ge = y(Be), le = Ge.edge, S = Ge.pred; if (Ke.unshift(Be[0]), Be.same(De) && Ke.length > 0) break; le != null && Ke.unshift(le), Be = S; } return u.spawn(Ke); }, E = 0; E < h6; E++) { var x = v[E], T = y(x); x.same(o) ? T.dist = 0 : T.dist = 1 / 0, T.pred = null, T.edge = null; } for (var k = false, _ = function(Ce, De, qe, Ke, Be, Ge) { var le = Ke.dist + Ge; le < Be.dist && !qe.same(Ke.edge) && (Be.dist = le, Be.pred = Ce, Be.edge = qe, k = true); }, D = 1; D < h6; D++) { k = false; for (var O = 0; O < g; O++) { var I = d[O], L = I.source(), B = I.target(), F = s(I), M = y(L), A = y(B); _(L, B, I, M, A, F), i || _(B, L, I, A, M, F); } if (!k) break; } if (k) for (var R = [], K = 0; K < g; K++) { var H = d[K], q = H.source(), ee = H.target(), se = s(H), oe = y(q).dist, ae = y(ee).dist; if (oe + se < ae || !i && ae + se < oe) if (p || (tt("Graph contains a negative weight cycle for Bellman-Ford"), p = true), e.findNegativeWeightCycles !== false) { var ue = []; oe + se < ae && ue.push(q), !i && ae + se < oe && ue.push(ee); for (var te = ue.length, $ = 0; $ < te; $++) { var G = ue[$], Q = [G]; Q.push(y(G).edge); for (var ge = y(G).pred; Q.indexOf(ge) === -1; ) Q.push(ge), Q.push(y(ge).edge), ge = y(ge).pred; Q = Q.slice(Q.indexOf(ge)); for (var Ee = Q[0].id(), fe = 0, me = 2; me < Q.length; me += 2) Q[me].id() < Ee && (Ee = Q[me].id(), fe = me); Q = Q.slice(fe).concat(Q.slice(0, fe)), Q.push(Q[0]); var xe = Q.map(function(ke) { return ke.id(); }).join(","); R.indexOf(xe) === -1 && (m.push(u.spawn(Q)), R.push(xe)); } } else break; } return { distanceTo: w, pathTo: C, hasNegativeWeightCycle: p, negativeWeightCycles: m }; } // bellmanFord }; var F5 = Math.sqrt(2); var I5 = function(e, r, n) { n.length === 0 && yt("Karger-Stein must be run on a connected (sub)graph"); for (var a = n[e], i = a[1], o = a[2], s = r[i], u = r[o], l = n, c = l.length - 1; c >= 0; c--) { var d = l[c], v = d[1], h6 = d[2]; (r[v] === s && r[h6] === u || r[v] === u && r[h6] === s) && l.splice(c, 1); } for (var f = 0; f < l.length; f++) { var p = l[f]; p[1] === u ? (l[f] = p.slice(), l[f][1] = s) : p[2] === u && (l[f] = p.slice(), l[f][2] = s); } for (var m = 0; m < r.length; m++) r[m] === u && (r[m] = s); return l; }; var Ml = function(e, r, n, a) { for (; n > a; ) { var i = Math.floor(Math.random() * r.length); r = I5(i, e, r), n--; } return r; }; var A5 = { // Computes the minimum cut of an undirected graph // Returns the correct answer with high probability kargerStein: function() { var e = this, r = this.byGroup(), n = r.nodes, a = r.edges; a.unmergeBy(function(A) { return A.isLoop(); }); var i = n.length, o = a.length, s = Math.ceil(Math.pow(Math.log(i) / Math.LN2, 2)), u = Math.floor(i / F5); if (i < 2) { yt("At least 2 nodes are required for Karger-Stein algorithm"); return; } for (var l = [], c = 0; c < o; c++) { var d = a[c]; l.push([c, n.indexOf(d.source()), n.indexOf(d.target())]); } for (var v = 1 / 0, h6 = [], f = new Array(i), p = new Array(i), m = new Array(i), g = function(R, K) { for (var H = 0; H < i; H++) K[H] = R[H]; }, y = 0; y <= s; y++) { for (var b = 0; b < i; b++) p[b] = b; var w = Ml(p, l.slice(), i, u), C = w.slice(); g(p, m); var E = Ml(p, w, u, 2), x = Ml(m, C, u, 2); E.length <= x.length && E.length < v ? (v = E.length, h6 = E, g(p, f)) : x.length <= E.length && x.length < v && (v = x.length, h6 = x, g(m, f)); } for (var T = this.spawn(h6.map(function(A) { return a[A[0]]; })), k = this.spawn(), _ = this.spawn(), D = f[0], O = 0; O < f.length; O++) { var I = f[O], L = n[O]; I === D ? k.merge(L) : _.merge(L); } var B = function(R) { var K = e.spawn(); return R.forEach(function(H) { K.merge(H), H.connectedEdges().forEach(function(q) { e.contains(q) && !T.contains(q) && K.merge(q); }); }), K; }, F = [B(k), B(_)], M = { cut: T, components: F, // n.b. partitions are included to be compatible with the old api spec // (could be removed in a future major version) partition1: k, partition2: _ }; return M; } }; var M5 = function(e) { return { x: e.x, y: e.y }; }; var nl = function(e, r, n) { return { x: e.x * r + n.x, y: e.y * r + n.y }; }; var cp = function(e, r, n) { return { x: (e.x - n.x) / r, y: (e.y - n.y) / r }; }; var Ha = function(e) { return { x: e[0], y: e[1] }; }; var B5 = function(e) { for (var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : e.length, a = 1 / 0, i = r; i < n; i++) { var o = e[i]; isFinite(o) && (a = Math.min(o, a)); } return a; }; var N5 = function(e) { for (var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : e.length, a = -1 / 0, i = r; i < n; i++) { var o = e[i]; isFinite(o) && (a = Math.max(o, a)); } return a; }; var $5 = function(e) { for (var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : e.length, a = 0, i = 0, o = r; o < n; o++) { var s = e[o]; isFinite(s) && (a += s, i++); } return a / i; }; var R5 = function(e) { var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : e.length, a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true, i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true, o = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true; a ? e = e.slice(r, n) : (n < e.length && e.splice(n, e.length - n), r > 0 && e.splice(0, r)); for (var s = 0, u = e.length - 1; u >= 0; u--) { var l = e[u]; o ? isFinite(l) || (e[u] = -1 / 0, s++) : e.splice(u, 1); } i && e.sort(function(v, h6) { return v - h6; }); var c = e.length, d = Math.floor(c / 2); return c % 2 !== 0 ? e[d + 1 + s] : (e[d - 1 + s] + e[d + s]) / 2; }; var z5 = function(e) { return Math.PI * e / 180; }; var Wo = function(e, r) { return Math.atan2(r, e) - Math.PI / 2; }; var dc = Math.log2 || function(t13) { return Math.log(t13) / Math.log(2); }; var dp = function(e) { return e > 0 ? 1 : e < 0 ? -1 : 0; }; var ya = function(e, r) { return Math.sqrt(ta(e, r)); }; var ta = function(e, r) { var n = r.x - e.x, a = r.y - e.y; return n * n + a * a; }; var V5 = function(e) { for (var r = e.length, n = 0, a = 0; a < r; a++) n += e[a]; for (var i = 0; i < r; i++) e[i] = e[i] / n; return e; }; var Nt = function(e, r, n, a) { return (1 - a) * (1 - a) * e + 2 * (1 - a) * a * r + a * a * n; }; var Ga = function(e, r, n, a) { return { x: Nt(e.x, r.x, n.x, a), y: Nt(e.y, r.y, n.y, a) }; }; var H5 = function(e, r, n, a) { var i = { x: r.x - e.x, y: r.y - e.y }, o = ya(e, r), s = { x: i.x / o, y: i.y / o }; return n = n ?? 0, a = a ?? n * o, { x: e.x + s.x * a, y: e.y + s.y * a }; }; var io = function(e, r, n) { return Math.max(e, Math.min(n, r)); }; var pr = function(e) { if (e == null) return { x1: 1 / 0, y1: 1 / 0, x2: -1 / 0, y2: -1 / 0, w: 0, h: 0 }; if (e.x1 != null && e.y1 != null) { if (e.x2 != null && e.y2 != null && e.x2 >= e.x1 && e.y2 >= e.y1) return { x1: e.x1, y1: e.y1, x2: e.x2, y2: e.y2, w: e.x2 - e.x1, h: e.y2 - e.y1 }; if (e.w != null && e.h != null && e.w >= 0 && e.h >= 0) return { x1: e.x1, y1: e.y1, x2: e.x1 + e.w, y2: e.y1 + e.h, w: e.w, h: e.h }; } }; var q5 = function(e) { return { x1: e.x1, x2: e.x2, w: e.w, y1: e.y1, y2: e.y2, h: e.h }; }; var K5 = function(e) { e.x1 = 1 / 0, e.y1 = 1 / 0, e.x2 = -1 / 0, e.y2 = -1 / 0, e.w = 0, e.h = 0; }; var U5 = function(e, r, n) { return { x1: e.x1 + r, x2: e.x2 + r, y1: e.y1 + n, y2: e.y2 + n, w: e.w, h: e.h }; }; var fp = function(e, r) { e.x1 = Math.min(e.x1, r.x1), e.x2 = Math.max(e.x2, r.x2), e.w = e.x2 - e.x1, e.y1 = Math.min(e.y1, r.y1), e.y2 = Math.max(e.y2, r.y2), e.h = e.y2 - e.y1; }; var G5 = function(e, r, n) { e.x1 = Math.min(e.x1, r), e.x2 = Math.max(e.x2, r), e.w = e.x2 - e.x1, e.y1 = Math.min(e.y1, n), e.y2 = Math.max(e.y2, n), e.h = e.y2 - e.y1; }; var us = function(e) { var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0; return e.x1 -= r, e.x2 += r, e.y1 -= r, e.y2 += r, e.w = e.x2 - e.x1, e.h = e.y2 - e.y1, e; }; var cs = function(e) { var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [0], n, a, i, o; if (r.length === 1) n = a = i = o = r[0]; else if (r.length === 2) n = i = r[0], o = a = r[1]; else if (r.length === 4) { var s = Mr(r, 4); n = s[0], a = s[1], i = s[2], o = s[3]; } return e.x1 -= o, e.x2 += a, e.y1 -= n, e.y2 += i, e.w = e.x2 - e.x1, e.h = e.y2 - e.y1, e; }; var uf = function(e, r) { e.x1 = r.x1, e.y1 = r.y1, e.x2 = r.x2, e.y2 = r.y2, e.w = e.x2 - e.x1, e.h = e.y2 - e.y1; }; var fc = function(e, r) { return !(e.x1 > r.x2 || r.x1 > e.x2 || e.x2 < r.x1 || r.x2 < e.x1 || e.y2 < r.y1 || r.y2 < e.y1 || e.y1 > r.y2 || r.y1 > e.y2); }; var oi = function(e, r, n) { return e.x1 <= r && r <= e.x2 && e.y1 <= n && n <= e.y2; }; var W5 = function(e, r) { return oi(e, r.x, r.y); }; var vp = function(e, r) { return oi(e, r.x1, r.y1) && oi(e, r.x2, r.y2); }; var hp = function(e, r, n, a, i, o, s) { var u = arguments.length > 7 && arguments[7] !== void 0 ? arguments[7] : "auto", l = u === "auto" ? ba(i, o) : u, c = i / 2, d = o / 2; l = Math.min(l, c, d); var v = l !== c, h6 = l !== d, f; if (v) { var p = n - c + l - s, m = a - d - s, g = n + c - l + s, y = m; if (f = Nn(e, r, n, a, p, m, g, y, false), f.length > 0) return f; } if (h6) { var b = n + c + s, w = a - d + l - s, C = b, E = a + d - l + s; if (f = Nn(e, r, n, a, b, w, C, E, false), f.length > 0) return f; } if (v) { var x = n - c + l - s, T = a + d + s, k = n + c - l + s, _ = T; if (f = Nn(e, r, n, a, x, T, k, _, false), f.length > 0) return f; } if (h6) { var D = n - c - s, O = a - d + l - s, I = D, L = a + d - l + s; if (f = Nn(e, r, n, a, D, O, I, L, false), f.length > 0) return f; } var B; { var F = n - c + l, M = a - d + l; if (B = Ni(e, r, n, a, F, M, l + s), B.length > 0 && B[0] <= F && B[1] <= M) return [B[0], B[1]]; } { var A = n + c - l, R = a - d + l; if (B = Ni(e, r, n, a, A, R, l + s), B.length > 0 && B[0] >= A && B[1] <= R) return [B[0], B[1]]; } { var K = n + c - l, H = a + d - l; if (B = Ni(e, r, n, a, K, H, l + s), B.length > 0 && B[0] >= K && B[1] >= H) return [B[0], B[1]]; } { var q = n - c + l, ee = a + d - l; if (B = Ni(e, r, n, a, q, ee, l + s), B.length > 0 && B[0] <= q && B[1] >= ee) return [B[0], B[1]]; } return []; }; var Y5 = function(e, r, n, a, i, o, s) { var u = s, l = Math.min(n, i), c = Math.max(n, i), d = Math.min(a, o), v = Math.max(a, o); return l - u <= e && e <= c + u && d - u <= r && r <= v + u; }; var Z5 = function(e, r, n, a, i, o, s, u, l) { var c = { x1: Math.min(n, s, i) - l, x2: Math.max(n, s, i) + l, y1: Math.min(a, u, o) - l, y2: Math.max(a, u, o) + l }; return !(e < c.x1 || e > c.x2 || r < c.y1 || r > c.y2); }; var X5 = function(e, r, n, a) { n -= a; var i = r * r - 4 * e * n; if (i < 0) return []; var o = Math.sqrt(i), s = 2 * e, u = (-r + o) / s, l = (-r - o) / s; return [u, l]; }; var j5 = function(e, r, n, a, i) { var o = 1e-5; e === 0 && (e = o), r /= e, n /= e, a /= e; var s, u, l, c, d, v, h6, f; if (u = (3 * n - r * r) / 9, l = -(27 * a) + r * (9 * n - 2 * (r * r)), l /= 54, s = u * u * u + l * l, i[1] = 0, h6 = r / 3, s > 0) { d = l + Math.sqrt(s), d = d < 0 ? -Math.pow(-d, 1 / 3) : Math.pow(d, 1 / 3), v = l - Math.sqrt(s), v = v < 0 ? -Math.pow(-v, 1 / 3) : Math.pow(v, 1 / 3), i[0] = -h6 + d + v, h6 += (d + v) / 2, i[4] = i[2] = -h6, h6 = Math.sqrt(3) * (-v + d) / 2, i[3] = h6, i[5] = -h6; return; } if (i[5] = i[3] = 0, s === 0) { f = l < 0 ? -Math.pow(-l, 1 / 3) : Math.pow(l, 1 / 3), i[0] = -h6 + 2 * f, i[4] = i[2] = -(f + h6); return; } u = -u, c = u * u * u, c = Math.acos(l / Math.sqrt(c)), f = 2 * Math.sqrt(u), i[0] = -h6 + f * Math.cos(c / 3), i[2] = -h6 + f * Math.cos((c + 2 * Math.PI) / 3), i[4] = -h6 + f * Math.cos((c + 4 * Math.PI) / 3); }; var Q5 = function(e, r, n, a, i, o, s, u) { var l = 1 * n * n - 4 * n * i + 2 * n * s + 4 * i * i - 4 * i * s + s * s + a * a - 4 * a * o + 2 * a * u + 4 * o * o - 4 * o * u + u * u, c = 1 * 9 * n * i - 3 * n * n - 3 * n * s - 6 * i * i + 3 * i * s + 9 * a * o - 3 * a * a - 3 * a * u - 6 * o * o + 3 * o * u, d = 1 * 3 * n * n - 6 * n * i + n * s - n * e + 2 * i * i + 2 * i * e - s * e + 3 * a * a - 6 * a * o + a * u - a * r + 2 * o * o + 2 * o * r - u * r, v = 1 * n * i - n * n + n * e - i * e + a * o - a * a + a * r - o * r, h6 = []; j5(l, c, d, v, h6); for (var f = 1e-7, p = [], m = 0; m < 6; m += 2) Math.abs(h6[m + 1]) < f && h6[m] >= 0 && h6[m] <= 1 && p.push(h6[m]); p.push(1), p.push(0); for (var g = -1, y, b, w, C = 0; C < p.length; C++) y = Math.pow(1 - p[C], 2) * n + 2 * (1 - p[C]) * p[C] * i + p[C] * p[C] * s, b = Math.pow(1 - p[C], 2) * a + 2 * (1 - p[C]) * p[C] * o + p[C] * p[C] * u, w = Math.pow(y - e, 2) + Math.pow(b - r, 2), g >= 0 ? w < g && (g = w) : g = w; return g; }; var J5 = function(e, r, n, a, i, o) { var s = [e - n, r - a], u = [i - n, o - a], l = u[0] * u[0] + u[1] * u[1], c = s[0] * s[0] + s[1] * s[1], d = s[0] * u[0] + s[1] * u[1], v = d * d / l; return d < 0 ? c : v > l ? (e - i) * (e - i) + (r - o) * (r - o) : c - v; }; var dr = function(e, r, n) { for (var a, i, o, s, u, l = 0, c = 0; c < n.length / 2; c++) if (a = n[c * 2], i = n[c * 2 + 1], c + 1 < n.length / 2 ? (o = n[(c + 1) * 2], s = n[(c + 1) * 2 + 1]) : (o = n[(c + 1 - n.length / 2) * 2], s = n[(c + 1 - n.length / 2) * 2 + 1]), !(a == e && o == e)) if (a >= e && e >= o || a <= e && e <= o) u = (e - a) / (o - a) * (s - i) + i, u > r && l++; else continue; return l % 2 !== 0; }; var mn = function(e, r, n, a, i, o, s, u, l) { var c = new Array(n.length), d; u[0] != null ? (d = Math.atan(u[1] / u[0]), u[0] < 0 ? d = d + Math.PI / 2 : d = -d - Math.PI / 2) : d = u; for (var v = Math.cos(-d), h6 = Math.sin(-d), f = 0; f < c.length / 2; f++) c[f * 2] = o / 2 * (n[f * 2] * v - n[f * 2 + 1] * h6), c[f * 2 + 1] = s / 2 * (n[f * 2 + 1] * v + n[f * 2] * h6), c[f * 2] += a, c[f * 2 + 1] += i; var p; if (l > 0) { var m = Fs(c, -l); p = Ls(m); } else p = c; return dr(e, r, p); }; var e4 = function(e, r, n, a, i, o, s, u) { for (var l = new Array(n.length * 2), c = 0; c < u.length; c++) { var d = u[c]; l[c * 4 + 0] = d.startX, l[c * 4 + 1] = d.startY, l[c * 4 + 2] = d.stopX, l[c * 4 + 3] = d.stopY; var v = Math.pow(d.cx - e, 2) + Math.pow(d.cy - r, 2); if (v <= Math.pow(d.radius, 2)) return true; } return dr(e, r, l); }; var Ls = function(e) { for (var r = new Array(e.length / 2), n, a, i, o, s, u, l, c, d = 0; d < e.length / 4; d++) { n = e[d * 4], a = e[d * 4 + 1], i = e[d * 4 + 2], o = e[d * 4 + 3], d < e.length / 4 - 1 ? (s = e[(d + 1) * 4], u = e[(d + 1) * 4 + 1], l = e[(d + 1) * 4 + 2], c = e[(d + 1) * 4 + 3]) : (s = e[0], u = e[1], l = e[2], c = e[3]); var v = Nn(n, a, i, o, s, u, l, c, true); r[d * 2] = v[0], r[d * 2 + 1] = v[1]; } return r; }; var Fs = function(e, r) { for (var n = new Array(e.length * 2), a, i, o, s, u = 0; u < e.length / 2; u++) { a = e[u * 2], i = e[u * 2 + 1], u < e.length / 2 - 1 ? (o = e[(u + 1) * 2], s = e[(u + 1) * 2 + 1]) : (o = e[0], s = e[1]); var l = s - i, c = -(o - a), d = Math.sqrt(l * l + c * c), v = l / d, h6 = c / d; n[u * 4] = a + v * r, n[u * 4 + 1] = i + h6 * r, n[u * 4 + 2] = o + v * r, n[u * 4 + 3] = s + h6 * r; } return n; }; var t4 = function(e, r, n, a, i, o) { var s = n - e, u = a - r; s /= i, u /= o; var l = Math.sqrt(s * s + u * u), c = l - 1; if (c < 0) return []; var d = c / l; return [(n - e) * d + e, (a - r) * d + r]; }; var la = function(e, r, n, a, i, o, s) { return e -= i, r -= o, e /= n / 2 + s, r /= a / 2 + s, e * e + r * r <= 1; }; var Ni = function(e, r, n, a, i, o, s) { var u = [n - e, a - r], l = [e - i, r - o], c = u[0] * u[0] + u[1] * u[1], d = 2 * (l[0] * u[0] + l[1] * u[1]), v = l[0] * l[0] + l[1] * l[1] - s * s, h6 = d * d - 4 * c * v; if (h6 < 0) return []; var f = (-d + Math.sqrt(h6)) / (2 * c), p = (-d - Math.sqrt(h6)) / (2 * c), m = Math.min(f, p), g = Math.max(f, p), y = []; if (m >= 0 && m <= 1 && y.push(m), g >= 0 && g <= 1 && y.push(g), y.length === 0) return []; var b = y[0] * u[0] + e, w = y[0] * u[1] + r; if (y.length > 1) { if (y[0] == y[1]) return [b, w]; var C = y[1] * u[0] + e, E = y[1] * u[1] + r; return [b, w, C, E]; } else return [b, w]; }; var Bl = function(e, r, n) { return r <= e && e <= n || n <= e && e <= r ? e : e <= r && r <= n || n <= r && r <= e ? r : n; }; var Nn = function(e, r, n, a, i, o, s, u, l) { var c = e - i, d = n - e, v = s - i, h6 = r - o, f = a - r, p = u - o, m = v * h6 - p * c, g = d * h6 - f * c, y = p * d - v * f; if (y !== 0) { var b = m / y, w = g / y, C = 1e-3, E = 0 - C, x = 1 + C; return E <= b && b <= x && E <= w && w <= x ? [e + b * d, r + b * f] : l ? [e + b * d, r + b * f] : []; } else return m === 0 || g === 0 ? Bl(e, n, s) === s ? [s, u] : Bl(e, n, i) === i ? [i, o] : Bl(i, s, n) === n ? [n, a] : [] : []; }; var oo = function(e, r, n, a, i, o, s, u) { var l = [], c, d = new Array(n.length), v = true; o == null && (v = false); var h6; if (v) { for (var f = 0; f < d.length / 2; f++) d[f * 2] = n[f * 2] * o + a, d[f * 2 + 1] = n[f * 2 + 1] * s + i; if (u > 0) { var p = Fs(d, -u); h6 = Ls(p); } else h6 = d; } else h6 = n; for (var m, g, y, b, w = 0; w < h6.length / 2; w++) m = h6[w * 2], g = h6[w * 2 + 1], w < h6.length / 2 - 1 ? (y = h6[(w + 1) * 2], b = h6[(w + 1) * 2 + 1]) : (y = h6[0], b = h6[1]), c = Nn(e, r, a, i, m, g, y, b), c.length !== 0 && l.push(c[0], c[1]); return l; }; var r4 = function(e, r, n, a, i, o, s, u, l) { var c = [], d, v = new Array(n.length * 2); l.forEach(function(y, b) { b === 0 ? (v[v.length - 2] = y.startX, v[v.length - 1] = y.startY) : (v[b * 4 - 2] = y.startX, v[b * 4 - 1] = y.startY), v[b * 4] = y.stopX, v[b * 4 + 1] = y.stopY, d = Ni(e, r, a, i, y.cx, y.cy, y.radius), d.length !== 0 && c.push(d[0], d[1]); }); for (var h6 = 0; h6 < v.length / 4; h6++) d = Nn(e, r, a, i, v[h6 * 4], v[h6 * 4 + 1], v[h6 * 4 + 2], v[h6 * 4 + 3], false), d.length !== 0 && c.push(d[0], d[1]); if (c.length > 2) { for (var f = [c[0], c[1]], p = Math.pow(f[0] - e, 2) + Math.pow(f[1] - r, 2), m = 1; m < c.length / 2; m++) { var g = Math.pow(c[m * 2] - e, 2) + Math.pow(c[m * 2 + 1] - r, 2); g <= p && (f[0] = c[m * 2], f[1] = c[m * 2 + 1], p = g); } return f; } return c; }; var Yo = function(e, r, n) { var a = [e[0] - r[0], e[1] - r[1]], i = Math.sqrt(a[0] * a[0] + a[1] * a[1]), o = (i - n) / i; return o < 0 && (o = 1e-5), [r[0] + o * a[0], r[1] + o * a[1]]; }; var sr = function(e, r) { var n = su(e, r); return n = pp(n), n; }; var pp = function(e) { for (var r, n, a = e.length / 2, i = 1 / 0, o = 1 / 0, s = -1 / 0, u = -1 / 0, l = 0; l < a; l++) r = e[2 * l], n = e[2 * l + 1], i = Math.min(i, r), s = Math.max(s, r), o = Math.min(o, n), u = Math.max(u, n); for (var c = 2 / (s - i), d = 2 / (u - o), v = 0; v < a; v++) r = e[2 * v] = e[2 * v] * c, n = e[2 * v + 1] = e[2 * v + 1] * d, i = Math.min(i, r), s = Math.max(s, r), o = Math.min(o, n), u = Math.max(u, n); if (o < -1) for (var h6 = 0; h6 < a; h6++) n = e[2 * h6 + 1] = e[2 * h6 + 1] + (-1 - o); return e; }; var su = function(e, r) { var n = 1 / e * 2 * Math.PI, a = e % 2 === 0 ? Math.PI / 2 + n / 2 : Math.PI / 2; a += r; for (var i = new Array(e * 2), o, s = 0; s < e; s++) o = s * n + a, i[2 * s] = Math.cos(o), i[2 * s + 1] = Math.sin(-o); return i; }; var ba = function(e, r) { return Math.min(e / 4, r / 4, 8); }; var gp = function(e, r) { return Math.min(e / 10, r / 10, 8); }; var vc = function() { return 8; }; var n4 = function(e, r, n) { return [e - 2 * r + n, 2 * (r - e), e]; }; var lu = function(e, r) { return { heightOffset: Math.min(15, 0.05 * r), widthOffset: Math.min(100, 0.25 * e), ctrlPtOffsetPct: 0.05 }; }; var a4 = Wt({ dampingFactor: 0.8, precision: 1e-6, iterations: 200, weight: function(e) { return 1; } }); var i4 = { pageRank: function(e) { for (var r = a4(e), n = r.dampingFactor, a = r.precision, i = r.iterations, o = r.weight, s = this._private.cy, u = this.byGroup(), l = u.nodes, c = u.edges, d = l.length, v = d * d, h6 = c.length, f = new Array(v), p = new Array(d), m = (1 - n) / d, g = 0; g < d; g++) { for (var y = 0; y < d; y++) { var b = g * d + y; f[b] = 0; } p[g] = 0; } for (var w = 0; w < h6; w++) { var C = c[w], E = C.data("source"), x = C.data("target"); if (E !== x) { var T = l.indexOfId(E), k = l.indexOfId(x), _ = o(C), D = k * d + T; f[D] += _, p[T] += _; } } for (var O = 1 / d + m, I = 0; I < d; I++) if (p[I] === 0) for (var L = 0; L < d; L++) { var B = L * d + I; f[B] = O; } else for (var F = 0; F < d; F++) { var M = F * d + I; f[M] = f[M] / p[I] + m; } for (var A = new Array(d), R = new Array(d), K, H = 0; H < d; H++) A[H] = 1; for (var q = 0; q < i; q++) { for (var ee = 0; ee < d; ee++) R[ee] = 0; for (var se = 0; se < d; se++) for (var oe = 0; oe < d; oe++) { var ae = se * d + oe; R[se] += f[ae] * A[oe]; } V5(R), K = A, A = R, R = K; for (var ue = 0, te = 0; te < d; te++) { var $ = K[te] - A[te]; ue += $ * $; } if (ue < a) break; } var G = { rank: function(ge) { return ge = s.collection(ge)[0], A[l.indexOf(ge)]; } }; return G; } // pageRank }; var cf = Wt({ root: null, weight: function(e) { return 1; }, directed: false, alpha: 0 }); var Wa = { degreeCentralityNormalized: function(e) { e = cf(e); var r = this.cy(), n = this.nodes(), a = n.length; if (e.directed) { for (var c = {}, d = {}, v = 0, h6 = 0, f = 0; f < a; f++) { var p = n[f], m = p.id(); e.root = p; var g = this.degreeCentrality(e); v < g.indegree && (v = g.indegree), h6 < g.outdegree && (h6 = g.outdegree), c[m] = g.indegree, d[m] = g.outdegree; } return { indegree: function(b) { return v == 0 ? 0 : (Ie(b) && (b = r.filter(b)), c[b.id()] / v); }, outdegree: function(b) { return h6 === 0 ? 0 : (Ie(b) && (b = r.filter(b)), d[b.id()] / h6); } }; } else { for (var i = {}, o = 0, s = 0; s < a; s++) { var u = n[s]; e.root = u; var l = this.degreeCentrality(e); o < l.degree && (o = l.degree), i[u.id()] = l.degree; } return { degree: function(b) { return o === 0 ? 0 : (Ie(b) && (b = r.filter(b)), i[b.id()] / o); } }; } }, // degreeCentralityNormalized // Implemented from the algorithm in Opsahl's paper // "Node centrality in weighted networks: Generalizing degree and shortest paths" // check the heading 2 "Degree" degreeCentrality: function(e) { e = cf(e); var r = this.cy(), n = this, a = e, i = a.root, o = a.weight, s = a.directed, u = a.alpha; if (i = r.collection(i)[0], s) { for (var h6 = i.connectedEdges(), f = h6.filter(function(E) { return E.target().same(i) && n.has(E); }), p = h6.filter(function(E) { return E.source().same(i) && n.has(E); }), m = f.length, g = p.length, y = 0, b = 0, w = 0; w < f.length; w++) y += o(f[w]); for (var C = 0; C < p.length; C++) b += o(p[C]); return { indegree: Math.pow(m, 1 - u) * Math.pow(y, u), outdegree: Math.pow(g, 1 - u) * Math.pow(b, u) }; } else { for (var l = i.connectedEdges().intersection(n), c = l.length, d = 0, v = 0; v < l.length; v++) d += o(l[v]); return { degree: Math.pow(c, 1 - u) * Math.pow(d, u) }; } } // degreeCentrality }; Wa.dc = Wa.degreeCentrality; Wa.dcn = Wa.degreeCentralityNormalised = Wa.degreeCentralityNormalized; var df = Wt({ harmonic: true, weight: function() { return 1; }, directed: false, root: null }); var Ya = { closenessCentralityNormalized: function(e) { for (var r = df(e), n = r.harmonic, a = r.weight, i = r.directed, o = this.cy(), s = {}, u = 0, l = this.nodes(), c = this.floydWarshall({ weight: a, directed: i }), d = 0; d < l.length; d++) { for (var v = 0, h6 = l[d], f = 0; f < l.length; f++) if (d !== f) { var p = c.distance(h6, l[f]); n ? v += 1 / p : v += p; } n || (v = 1 / v), u < v && (u = v), s[h6.id()] = v; } return { closeness: function(g) { return u == 0 ? 0 : (Ie(g) ? g = o.filter(g)[0].id() : g = g.id(), s[g] / u); } }; }, // Implemented from pseudocode from wikipedia closenessCentrality: function(e) { var r = df(e), n = r.root, a = r.weight, i = r.directed, o = r.harmonic; n = this.filter(n)[0]; for (var s = this.dijkstra({ root: n, weight: a, directed: i }), u = 0, l = this.nodes(), c = 0; c < l.length; c++) { var d = l[c]; if (!d.same(n)) { var v = s.distanceTo(d); o ? u += 1 / v : u += v; } } return o ? u : 1 / u; } // closenessCentrality }; Ya.cc = Ya.closenessCentrality; Ya.ccn = Ya.closenessCentralityNormalised = Ya.closenessCentralityNormalized; var o4 = Wt({ weight: null, directed: false }); var uu = { // Implemented from the algorithm in the paper "On Variants of Shortest-Path Betweenness Centrality and their Generic Computation" by Ulrik Brandes betweennessCentrality: function(e) { for (var r = o4(e), n = r.directed, a = r.weight, i = a != null, o = this.cy(), s = this.nodes(), u = {}, l = {}, c = 0, d = { set: function(b, w) { l[b] = w, w > c && (c = w); }, get: function(b) { return l[b]; } }, v = 0; v < s.length; v++) { var h6 = s[v], f = h6.id(); n ? u[f] = h6.outgoers().nodes() : u[f] = h6.openNeighborhood().nodes(), d.set(f, 0); } for (var p = function(b) { for (var w = s[b].id(), C = [], E = {}, x = {}, T = {}, k = new Oo(function(oe, ae) { return T[oe] - T[ae]; }), _ = 0; _ < s.length; _++) { var D = s[_].id(); E[D] = [], x[D] = 0, T[D] = 1 / 0; } for (x[w] = 1, T[w] = 0, k.push(w); !k.empty(); ) { var O = k.pop(); if (C.push(O), i) for (var I = 0; I < u[O].length; I++) { var L = u[O][I], B = o.getElementById(O), F = void 0; B.edgesTo(L).length > 0 ? F = B.edgesTo(L)[0] : F = L.edgesTo(B)[0]; var M = a(F); L = L.id(), T[L] > T[O] + M && (T[L] = T[O] + M, k.nodes.indexOf(L) < 0 ? k.push(L) : k.updateItem(L), x[L] = 0, E[L] = []), T[L] == T[O] + M && (x[L] = x[L] + x[O], E[L].push(O)); } else for (var A = 0; A < u[O].length; A++) { var R = u[O][A].id(); T[R] == 1 / 0 && (k.push(R), T[R] = T[O] + 1), T[R] == T[O] + 1 && (x[R] = x[R] + x[O], E[R].push(O)); } } for (var K = {}, H = 0; H < s.length; H++) K[s[H].id()] = 0; for (; C.length > 0; ) { for (var q = C.pop(), ee = 0; ee < E[q].length; ee++) { var se = E[q][ee]; K[se] = K[se] + x[se] / x[q] * (1 + K[q]); } q != s[b].id() && d.set(q, d.get(q) + K[q]); } }, m = 0; m < s.length; m++) p(m); var g = { betweenness: function(b) { var w = o.collection(b).id(); return d.get(w); }, betweennessNormalized: function(b) { if (c == 0) return 0; var w = o.collection(b).id(); return d.get(w) / c; } }; return g.betweennessNormalised = g.betweennessNormalized, g; } // betweennessCentrality }; uu.bc = uu.betweennessCentrality; var s4 = Wt({ expandFactor: 2, // affects time of computation and cluster granularity to some extent: M * M inflateFactor: 2, // affects cluster granularity (the greater the value, the more clusters): M(i,j) / E(j) multFactor: 1, // optional self loops for each node. Use a neutral value to improve cluster computations. maxIterations: 20, // maximum number of iterations of the MCL algorithm in a single run attributes: [ // attributes/features used to group nodes, ie. similarity values between nodes function(t13) { return 1; } ] }); var l4 = function(e) { return s4(e); }; var u4 = function(e, r) { for (var n = 0, a = 0; a < r.length; a++) n += r[a](e); return n; }; var c4 = function(e, r, n) { for (var a = 0; a < r; a++) e[a * r + a] = n; }; var mp = function(e, r) { for (var n, a = 0; a < r; a++) { n = 0; for (var i = 0; i < r; i++) n += e[i * r + a]; for (var o = 0; o < r; o++) e[o * r + a] = e[o * r + a] / n; } }; var d4 = function(e, r, n) { for (var a = new Array(n * n), i = 0; i < n; i++) { for (var o = 0; o < n; o++) a[i * n + o] = 0; for (var s = 0; s < n; s++) for (var u = 0; u < n; u++) a[i * n + u] += e[i * n + s] * r[s * n + u]; } return a; }; var f4 = function(e, r, n) { for (var a = e.slice(0), i = 1; i < n; i++) e = d4(e, a, r); return e; }; var v4 = function(e, r, n) { for (var a = new Array(r * r), i = 0; i < r * r; i++) a[i] = Math.pow(e[i], n); return mp(a, r), a; }; var h4 = function(e, r, n, a) { for (var i = 0; i < n; i++) { var o = Math.round(e[i] * Math.pow(10, a)) / Math.pow(10, a), s = Math.round(r[i] * Math.pow(10, a)) / Math.pow(10, a); if (o !== s) return false; } return true; }; var p4 = function(e, r, n, a) { for (var i = [], o = 0; o < r; o++) { for (var s = [], u = 0; u < r; u++) Math.round(e[o * r + u] * 1e3) / 1e3 > 0 && s.push(n[u]); s.length !== 0 && i.push(a.collection(s)); } return i; }; var g4 = function(e, r) { for (var n = 0; n < e.length; n++) if (!r[n] || e[n].id() !== r[n].id()) return false; return true; }; var m4 = function(e) { for (var r = 0; r < e.length; r++) for (var n = 0; n < e.length; n++) r != n && g4(e[r], e[n]) && e.splice(n, 1); return e; }; var ff = function(e) { for (var r = this.nodes(), n = this.edges(), a = this.cy(), i = l4(e), o = {}, s = 0; s < r.length; s++) o[r[s].id()] = s; for (var u = r.length, l = u * u, c = new Array(l), d, v = 0; v < l; v++) c[v] = 0; for (var h6 = 0; h6 < n.length; h6++) { var f = n[h6], p = o[f.source().id()], m = o[f.target().id()], g = u4(f, i.attributes); c[p * u + m] += g, c[m * u + p] += g; } c4(c, u, i.multFactor), mp(c, u); for (var y = true, b = 0; y && b < i.maxIterations; ) y = false, d = f4(c, u, i.expandFactor), c = v4(d, u, i.inflateFactor), h4(c, d, l, 4) || (y = true), b++; var w = p4(c, u, r, a); return w = m4(w), w; }; var y4 = { markovClustering: ff, mcl: ff }; var b4 = function(e) { return e; }; var yp = function(e, r) { return Math.abs(r - e); }; var vf = function(e, r, n) { return e + yp(r, n); }; var hf = function(e, r, n) { return e + Math.pow(n - r, 2); }; var w4 = function(e) { return Math.sqrt(e); }; var x4 = function(e, r, n) { return Math.max(e, yp(r, n)); }; var Oi = function(e, r, n, a, i) { for (var o = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : b4, s = a, u, l, c = 0; c < e; c++) u = r(c), l = n(c), s = i(s, u, l); return o(s); }; var si = { euclidean: function(e, r, n) { return e >= 2 ? Oi(e, r, n, 0, hf, w4) : Oi(e, r, n, 0, vf); }, squaredEuclidean: function(e, r, n) { return Oi(e, r, n, 0, hf); }, manhattan: function(e, r, n) { return Oi(e, r, n, 0, vf); }, max: function(e, r, n) { return Oi(e, r, n, -1 / 0, x4); } }; si["squared-euclidean"] = si.squaredEuclidean; si.squaredeuclidean = si.squaredEuclidean; function al(t13, e, r, n, a, i) { var o; return pt(t13) ? o = t13 : o = si[t13] || si.euclidean, e === 0 && pt(t13) ? o(a, i) : o(e, r, n, a, i); } var C4 = Wt({ k: 2, m: 2, sensitivityThreshold: 1e-4, distance: "euclidean", maxIterations: 10, attributes: [], testMode: false, testCentroids: null }); var hc = function(e) { return C4(e); }; var Is = function(e, r, n, a, i) { var o = i !== "kMedoids", s = o ? function(d) { return n[d]; } : function(d) { return a[d](n); }, u = function(v) { return a[v](r); }, l = n, c = r; return al(e, a.length, s, u, l, c); }; var Nl = function(e, r, n) { for (var a = n.length, i = new Array(a), o = new Array(a), s = new Array(r), u = null, l = 0; l < a; l++) i[l] = e.min(n[l]).value, o[l] = e.max(n[l]).value; for (var c = 0; c < r; c++) { u = []; for (var d = 0; d < a; d++) u[d] = Math.random() * (o[d] - i[d]) + i[d]; s[c] = u; } return s; }; var bp = function(e, r, n, a, i) { for (var o = 1 / 0, s = 0, u = 0; u < r.length; u++) { var l = Is(n, e, r[u], a, i); l < o && (o = l, s = u); } return s; }; var wp = function(e, r, n) { for (var a = [], i = null, o = 0; o < r.length; o++) i = r[o], n[i.id()] === e && a.push(i); return a; }; var E4 = function(e, r, n) { return Math.abs(r - e) <= n; }; var k4 = function(e, r, n) { for (var a = 0; a < e.length; a++) for (var i = 0; i < e[a].length; i++) { var o = Math.abs(e[a][i] - r[a][i]); if (o > n) return false; } return true; }; var S4 = function(e, r, n) { for (var a = 0; a < n; a++) if (e === r[a]) return true; return false; }; var pf = function(e, r) { var n = new Array(r); if (e.length < 50) for (var a = 0; a < r; a++) { for (var i = e[Math.floor(Math.random() * e.length)]; S4(i, n, a); ) i = e[Math.floor(Math.random() * e.length)]; n[a] = i; } else for (var o = 0; o < r; o++) n[o] = e[Math.floor(Math.random() * e.length)]; return n; }; var gf = function(e, r, n) { for (var a = 0, i = 0; i < r.length; i++) a += Is("manhattan", r[i], e, n, "kMedoids"); return a; }; var T4 = function(e) { var r = this.cy(), n = this.nodes(), a = null, i = hc(e), o = new Array(i.k), s = {}, u; i.testMode ? typeof i.testCentroids == "number" ? (i.testCentroids, u = Nl(n, i.k, i.attributes)) : It(i.testCentroids) === "object" ? u = i.testCentroids : u = Nl(n, i.k, i.attributes) : u = Nl(n, i.k, i.attributes); for (var l = true, c = 0; l && c < i.maxIterations; ) { for (var d = 0; d < n.length; d++) a = n[d], s[a.id()] = bp(a, u, i.distance, i.attributes, "kMeans"); l = false; for (var v = 0; v < i.k; v++) { var h6 = wp(v, n, s); if (h6.length !== 0) { for (var f = i.attributes.length, p = u[v], m = new Array(f), g = new Array(f), y = 0; y < f; y++) { g[y] = 0; for (var b = 0; b < h6.length; b++) a = h6[b], g[y] += i.attributes[y](a); m[y] = g[y] / h6.length, E4(m[y], p[y], i.sensitivityThreshold) || (l = true); } u[v] = m, o[v] = r.collection(h6); } } c++; } return o; }; var _4 = function(e) { var r = this.cy(), n = this.nodes(), a = null, i = hc(e), o = new Array(i.k), s, u = {}, l, c = new Array(i.k); i.testMode ? typeof i.testCentroids == "number" || (It(i.testCentroids) === "object" ? s = i.testCentroids : s = pf(n, i.k)) : s = pf(n, i.k); for (var d = true, v = 0; d && v < i.maxIterations; ) { for (var h6 = 0; h6 < n.length; h6++) a = n[h6], u[a.id()] = bp(a, s, i.distance, i.attributes, "kMedoids"); d = false; for (var f = 0; f < s.length; f++) { var p = wp(f, n, u); if (p.length !== 0) { c[f] = gf(s[f], p, i.attributes); for (var m = 0; m < p.length; m++) l = gf(p[m], p, i.attributes), l < c[f] && (c[f] = l, s[f] = p[m], d = true); o[f] = r.collection(p); } } v++; } return o; }; var D4 = function(e, r, n, a, i) { for (var o, s, u = 0; u < r.length; u++) for (var l = 0; l < e.length; l++) a[u][l] = Math.pow(n[u][l], i.m); for (var c = 0; c < e.length; c++) for (var d = 0; d < i.attributes.length; d++) { o = 0, s = 0; for (var v = 0; v < r.length; v++) o += a[v][c] * i.attributes[d](r[v]), s += a[v][c]; e[c][d] = o / s; } }; var P4 = function(e, r, n, a, i) { for (var o = 0; o < e.length; o++) r[o] = e[o].slice(); for (var s, u, l, c = 2 / (i.m - 1), d = 0; d < n.length; d++) for (var v = 0; v < a.length; v++) { s = 0; for (var h6 = 0; h6 < n.length; h6++) u = Is(i.distance, a[v], n[d], i.attributes, "cmeans"), l = Is(i.distance, a[v], n[h6], i.attributes, "cmeans"), s += Math.pow(u / l, c); e[v][d] = 1 / s; } }; var O4 = function(e, r, n, a) { for (var i = new Array(n.k), o = 0; o < i.length; o++) i[o] = []; for (var s, u, l = 0; l < r.length; l++) { s = -1 / 0, u = -1; for (var c = 0; c < r[0].length; c++) r[l][c] > s && (s = r[l][c], u = c); i[u].push(e[l]); } for (var d = 0; d < i.length; d++) i[d] = a.collection(i[d]); return i; }; var mf = function(e) { var r = this.cy(), n = this.nodes(), a = hc(e), i, o, s, u, l; u = new Array(n.length); for (var c = 0; c < n.length; c++) u[c] = new Array(a.k); s = new Array(n.length); for (var d = 0; d < n.length; d++) s[d] = new Array(a.k); for (var v = 0; v < n.length; v++) { for (var h6 = 0, f = 0; f < a.k; f++) s[v][f] = Math.random(), h6 += s[v][f]; for (var p = 0; p < a.k; p++) s[v][p] = s[v][p] / h6; } o = new Array(a.k); for (var m = 0; m < a.k; m++) o[m] = new Array(a.attributes.length); l = new Array(n.length); for (var g = 0; g < n.length; g++) l[g] = new Array(a.k); for (var y = true, b = 0; y && b < a.maxIterations; ) y = false, D4(o, n, s, l, a), P4(s, u, o, n, a), k4(s, u, a.sensitivityThreshold) || (y = true), b++; return i = O4(n, s, a, r), { clusters: i, degreeOfMembership: s }; }; var L4 = { kMeans: T4, kMedoids: _4, fuzzyCMeans: mf, fcm: mf }; var F4 = Wt({ distance: "euclidean", // distance metric to compare nodes linkage: "min", // linkage criterion : how to determine the distance between clusters of nodes mode: "threshold", // mode:'threshold' => clusters must be threshold distance apart threshold: 1 / 0, // the distance threshold // mode:'dendrogram' => the nodes are organised as leaves in a tree (siblings are close), merging makes clusters addDendrogram: false, // whether to add the dendrogram to the graph for viz dendrogramDepth: 0, // depth at which dendrogram branches are merged into the returned clusters attributes: [] // array of attr functions }); var I4 = { single: "min", complete: "max" }; var A4 = function(e) { var r = F4(e), n = I4[r.linkage]; return n != null && (r.linkage = n), r; }; var yf = function(e, r, n, a, i) { for (var o = 0, s = 1 / 0, u, l = i.attributes, c = function(k, _) { return al(i.distance, l.length, function(D) { return l[D](k); }, function(D) { return l[D](_); }, k, _); }, d = 0; d < e.length; d++) { var v = e[d].key, h6 = n[v][a[v]]; h6 < s && (o = v, s = h6); } if (i.mode === "threshold" && s >= i.threshold || i.mode === "dendrogram" && e.length === 1) return false; var f = r[o], p = r[a[o]], m; i.mode === "dendrogram" ? m = { left: f, right: p, key: f.key } : m = { value: f.value.concat(p.value), key: f.key }, e[f.index] = m, e.splice(p.index, 1), r[f.key] = m; for (var g = 0; g < e.length; g++) { var y = e[g]; f.key === y.key ? u = 1 / 0 : i.linkage === "min" ? (u = n[f.key][y.key], n[f.key][y.key] > n[p.key][y.key] && (u = n[p.key][y.key])) : i.linkage === "max" ? (u = n[f.key][y.key], n[f.key][y.key] < n[p.key][y.key] && (u = n[p.key][y.key])) : i.linkage === "mean" ? u = (n[f.key][y.key] * f.size + n[p.key][y.key] * p.size) / (f.size + p.size) : i.mode === "dendrogram" ? u = c(y.value, f.value) : u = c(y.value[0], f.value[0]), n[f.key][y.key] = n[y.key][f.key] = u; } for (var b = 0; b < e.length; b++) { var w = e[b].key; if (a[w] === f.key || a[w] === p.key) { for (var C = w, E = 0; E < e.length; E++) { var x = e[E].key; n[w][x] < n[w][C] && (C = x); } a[w] = C; } e[b].index = b; } return f.key = p.key = f.index = p.index = null, true; }; var Zo = function t(e, r, n) { e && (e.value ? r.push(e.value) : (e.left && t(e.left, r), e.right && t(e.right, r))); }; var M4 = function t3(e, r) { if (!e) return ""; if (e.left && e.right) { var n = t3(e.left, r), a = t3(e.right, r), i = r.add({ group: "nodes", data: { id: n + "," + a } }); return r.add({ group: "edges", data: { source: n, target: i.id() } }), r.add({ group: "edges", data: { source: a, target: i.id() } }), i.id(); } else if (e.value) return e.value.id(); }; var B4 = function t6(e, r, n) { if (!e) return []; var a = [], i = [], o = []; return r === 0 ? (e.left && Zo(e.left, a), e.right && Zo(e.right, i), o = a.concat(i), [n.collection(o)]) : r === 1 ? e.value ? [n.collection(e.value)] : (e.left && Zo(e.left, a), e.right && Zo(e.right, i), [n.collection(a), n.collection(i)]) : e.value ? [n.collection(e.value)] : (e.left && (a = t6(e.left, r - 1, n)), e.right && (i = t6(e.right, r - 1, n)), a.concat(i)); }; var bf = function(e) { for (var r = this.cy(), n = this.nodes(), a = A4(e), i = a.attributes, o = function(b, w) { return al(a.distance, i.length, function(C) { return i[C](b); }, function(C) { return i[C](w); }, b, w); }, s = [], u = [], l = [], c = [], d = 0; d < n.length; d++) { var v = { value: a.mode === "dendrogram" ? n[d] : [n[d]], key: d, index: d }; s[d] = v, c[d] = v, u[d] = [], l[d] = 0; } for (var h6 = 0; h6 < s.length; h6++) for (var f = 0; f <= h6; f++) { var p = void 0; a.mode === "dendrogram" ? p = h6 === f ? 1 / 0 : o(s[h6].value, s[f].value) : p = h6 === f ? 1 / 0 : o(s[h6].value[0], s[f].value[0]), u[h6][f] = p, u[f][h6] = p, p < u[h6][l[h6]] && (l[h6] = f); } for (var m = yf(s, c, u, l, a); m; ) m = yf(s, c, u, l, a); var g; return a.mode === "dendrogram" ? (g = B4(s[0], a.dendrogramDepth, r), a.addDendrogram && M4(s[0], r)) : (g = new Array(s.length), s.forEach(function(y, b) { y.key = y.index = null, g[b] = r.collection(y.value); })), g; }; var N4 = { hierarchicalClustering: bf, hca: bf }; var $4 = Wt({ distance: "euclidean", // distance metric to compare attributes between two nodes preference: "median", // suitability of a data point to serve as an exemplar damping: 0.8, // damping factor between [0.5, 1) maxIterations: 1e3, // max number of iterations to run minIterations: 100, // min number of iterations to run in order for clustering to stop attributes: [ // functions to quantify the similarity between any two points // e.g. node => node.data('weight') ] }); var R4 = function(e) { var r = e.damping, n = e.preference; 0.5 <= r && r < 1 || yt("Damping must range on [0.5, 1). Got: ".concat(r)); var a = ["median", "mean", "min", "max"]; return a.some(function(i) { return i === n; }) || be(n) || yt("Preference must be one of [".concat(a.map(function(i) { return "'".concat(i, "'"); }).join(", "), "] or a number. Got: ").concat(n)), $4(e); }; var z4 = function(e, r, n, a) { var i = function(s, u) { return a[u](s); }; return -al(e, a.length, function(o) { return i(r, o); }, function(o) { return i(n, o); }, r, n); }; var V4 = function(e, r) { var n = null; return r === "median" ? n = R5(e) : r === "mean" ? n = $5(e) : r === "min" ? n = B5(e) : r === "max" ? n = N5(e) : n = r, n; }; var H4 = function(e, r, n) { for (var a = [], i = 0; i < e; i++) r[i * e + i] + n[i * e + i] > 0 && a.push(i); return a; }; var wf = function(e, r, n) { for (var a = [], i = 0; i < e; i++) { for (var o = -1, s = -1 / 0, u = 0; u < n.length; u++) { var l = n[u]; r[i * e + l] > s && (o = l, s = r[i * e + l]); } o > 0 && a.push(o); } for (var c = 0; c < n.length; c++) a[n[c]] = n[c]; return a; }; var q4 = function(e, r, n) { for (var a = wf(e, r, n), i = 0; i < n.length; i++) { for (var o = [], s = 0; s < a.length; s++) a[s] === n[i] && o.push(s); for (var u = -1, l = -1 / 0, c = 0; c < o.length; c++) { for (var d = 0, v = 0; v < o.length; v++) d += r[o[v] * e + o[c]]; d > l && (u = c, l = d); } n[i] = o[u]; } return a = wf(e, r, n), a; }; var xf = function(e) { for (var r = this.cy(), n = this.nodes(), a = R4(e), i = {}, o = 0; o < n.length; o++) i[n[o].id()] = o; var s, u, l, c, d, v; s = n.length, u = s * s, l = new Array(u); for (var h6 = 0; h6 < u; h6++) l[h6] = -1 / 0; for (var f = 0; f < s; f++) for (var p = 0; p < s; p++) f !== p && (l[f * s + p] = z4(a.distance, n[f], n[p], a.attributes)); c = V4(l, a.preference); for (var m = 0; m < s; m++) l[m * s + m] = c; d = new Array(u); for (var g = 0; g < u; g++) d[g] = 0; v = new Array(u); for (var y = 0; y < u; y++) v[y] = 0; for (var b = new Array(s), w = new Array(s), C = new Array(s), E = 0; E < s; E++) b[E] = 0, w[E] = 0, C[E] = 0; for (var x = new Array(s * a.minIterations), T = 0; T < x.length; T++) x[T] = 0; var k; for (k = 0; k < a.maxIterations; k++) { for (var _ = 0; _ < s; _++) { for (var D = -1 / 0, O = -1 / 0, I = -1, L = 0, B = 0; B < s; B++) b[B] = d[_ * s + B], L = v[_ * s + B] + l[_ * s + B], L >= D ? (O = D, D = L, I = B) : L > O && (O = L); for (var F = 0; F < s; F++) d[_ * s + F] = (1 - a.damping) * (l[_ * s + F] - D) + a.damping * b[F]; d[_ * s + I] = (1 - a.damping) * (l[_ * s + I] - O) + a.damping * b[I]; } for (var M = 0; M < s; M++) { for (var A = 0, R = 0; R < s; R++) b[R] = v[R * s + M], w[R] = Math.max(0, d[R * s + M]), A += w[R]; A -= w[M], w[M] = d[M * s + M], A += w[M]; for (var K = 0; K < s; K++) v[K * s + M] = (1 - a.damping) * Math.min(0, A - w[K]) + a.damping * b[K]; v[M * s + M] = (1 - a.damping) * (A - w[M]) + a.damping * b[M]; } for (var H = 0, q = 0; q < s; q++) { var ee = v[q * s + q] + d[q * s + q] > 0 ? 1 : 0; x[k % a.minIterations * s + q] = ee, H += ee; } if (H > 0 && (k >= a.minIterations - 1 || k == a.maxIterations - 1)) { for (var se = 0, oe = 0; oe < s; oe++) { C[oe] = 0; for (var ae = 0; ae < a.minIterations; ae++) C[oe] += x[ae * s + oe]; (C[oe] === 0 || C[oe] === a.minIterations) && se++; } if (se === s) break; } } for (var ue = H4(s, d, v), te = q4(s, l, ue), $ = {}, G = 0; G < ue.length; G++) $[ue[G]] = []; for (var Q = 0; Q < n.length; Q++) { var ge = i[n[Q].id()], Ee = te[ge]; Ee != null && $[Ee].push(n[Q]); } for (var fe = new Array(ue.length), me = 0; me < ue.length; me++) fe[me] = r.collection($[ue[me]]); return fe; }; var K4 = { affinityPropagation: xf, ap: xf }; var U4 = Wt({ root: void 0, directed: false }); var G4 = { hierholzer: function(e) { if (!Xe(e)) { var r = arguments; e = { root: r[0], directed: r[1] }; } var n = U4(e), a = n.root, i = n.directed, o = this, s = false, u, l, c; a && (c = Ie(a) ? this.filter(a)[0].id() : a[0].id()); var d = {}, v = {}; i ? o.forEach(function(y) { var b = y.id(); if (y.isNode()) { var w = y.indegree(true), C = y.outdegree(true), E = w - C, x = C - w; E == 1 ? u ? s = true : u = b : x == 1 ? l ? s = true : l = b : (x > 1 || E > 1) && (s = true), d[b] = [], y.outgoers().forEach(function(T) { T.isEdge() && d[b].push(T.id()); }); } else v[b] = [void 0, y.target().id()]; }) : o.forEach(function(y) { var b = y.id(); if (y.isNode()) { var w = y.degree(true); w % 2 && (u ? l ? s = true : l = b : u = b), d[b] = [], y.connectedEdges().forEach(function(C) { return d[b].push(C.id()); }); } else v[b] = [y.source().id(), y.target().id()]; }); var h6 = { found: false, trail: void 0 }; if (s) return h6; if (l && u) if (i) { if (c && l != c) return h6; c = l; } else { if (c && l != c && u != c) return h6; c || (c = l); } else c || (c = o[0].id()); var f = function(b) { for (var w = b, C = [b], E, x, T; d[w].length; ) E = d[w].shift(), x = v[E][0], T = v[E][1], w != T ? (d[T] = d[T].filter(function(k) { return k != E; }), w = T) : !i && w != x && (d[x] = d[x].filter(function(k) { return k != E; }), w = x), C.unshift(E), C.unshift(w); return C; }, p = [], m = []; for (m = f(c); m.length != 1; ) d[m[0]].length == 0 ? (p.unshift(o.getElementById(m.shift())), p.unshift(o.getElementById(m.shift()))) : m = f(m.shift()).concat(m); p.unshift(o.getElementById(m.shift())); for (var g in d) if (d[g].length) return h6; return h6.found = true, h6.trail = this.spawn(p, true), h6; } }; var Xo = function() { var e = this, r = {}, n = 0, a = 0, i = [], o = [], s = {}, u = function(v, h6) { for (var f = o.length - 1, p = [], m = e.spawn(); o[f].x != v || o[f].y != h6; ) p.push(o.pop().edge), f--; p.push(o.pop().edge), p.forEach(function(g) { var y = g.connectedNodes().intersection(e); m.merge(g), y.forEach(function(b) { var w = b.id(), C = b.connectedEdges().intersection(e); m.merge(b), r[w].cutVertex ? m.merge(C.filter(function(E) { return E.isLoop(); })) : m.merge(C); }); }), i.push(m); }, l = function d(v, h6, f) { v === f && (a += 1), r[h6] = { id: n, low: n++, cutVertex: false }; var p = e.getElementById(h6).connectedEdges().intersection(e); if (p.size() === 0) i.push(e.spawn(e.getElementById(h6))); else { var m, g, y, b; p.forEach(function(w) { m = w.source().id(), g = w.target().id(), y = m === h6 ? g : m, y !== f && (b = w.id(), s[b] || (s[b] = true, o.push({ x: h6, y, edge: w })), y in r ? r[h6].low = Math.min(r[h6].low, r[y].id) : (d(v, y, h6), r[h6].low = Math.min(r[h6].low, r[y].low), r[h6].id <= r[y].low && (r[h6].cutVertex = true, u(h6, y)))); }); } }; e.forEach(function(d) { if (d.isNode()) { var v = d.id(); v in r || (a = 0, l(v, v), r[v].cutVertex = a > 1); } }); var c = Object.keys(r).filter(function(d) { return r[d].cutVertex; }).map(function(d) { return e.getElementById(d); }); return { cut: e.spawn(c), components: i }; }; var W4 = { hopcroftTarjanBiconnected: Xo, htbc: Xo, htb: Xo, hopcroftTarjanBiconnectedComponents: Xo }; var jo = function() { var e = this, r = {}, n = 0, a = [], i = [], o = e.spawn(e), s = function u(l) { i.push(l), r[l] = { index: n, low: n++, explored: false }; var c = e.getElementById(l).connectedEdges().intersection(e); if (c.forEach(function(p) { var m = p.target().id(); m !== l && (m in r || u(m), r[m].explored || (r[l].low = Math.min(r[l].low, r[m].low))); }), r[l].index === r[l].low) { for (var d = e.spawn(); ; ) { var v = i.pop(); if (d.merge(e.getElementById(v)), r[v].low = r[l].index, r[v].explored = true, v === l) break; } var h6 = d.edgesWith(d), f = d.merge(h6); a.push(f), o = o.difference(f); } }; return e.forEach(function(u) { if (u.isNode()) { var l = u.id(); l in r || s(l); } }), { cut: o, components: a }; }; var Y4 = { tarjanStronglyConnected: jo, tsc: jo, tscc: jo, tarjanStronglyConnectedComponents: jo }; var xp = {}; [ao, k5, S5, _5, P5, L5, A5, i4, Wa, Ya, uu, y4, L4, N4, K4, G4, W4, Y4].forEach(function(t13) { Re(xp, t13); }); var Cp = 0; var Ep = 1; var kp = 2; var yn = function t7(e) { if (!(this instanceof t7)) return new t7(e); this.id = "Thenable/1.0.7", this.state = Cp, this.fulfillValue = void 0, this.rejectReason = void 0, this.onFulfilled = [], this.onRejected = [], this.proxy = { then: this.then.bind(this) }, typeof e == "function" && e.call(this, this.fulfill.bind(this), this.reject.bind(this)); }; yn.prototype = { /* promise resolving methods */ fulfill: function(e) { return Cf(this, Ep, "fulfillValue", e); }, reject: function(e) { return Cf(this, kp, "rejectReason", e); }, /* "The then Method" [Promises/A+ 1.1, 1.2, 2.2] */ then: function(e, r) { var n = this, a = new yn(); return n.onFulfilled.push(kf(e, a, "fulfill")), n.onRejected.push(kf(r, a, "reject")), Sp(n), a.proxy; } }; var Cf = function(e, r, n, a) { return e.state === Cp && (e.state = r, e[n] = a, Sp(e)), e; }; var Sp = function(e) { e.state === Ep ? Ef(e, "onFulfilled", e.fulfillValue) : e.state === kp && Ef(e, "onRejected", e.rejectReason); }; var Ef = function(e, r, n) { if (e[r].length !== 0) { var a = e[r]; e[r] = []; var i = function() { for (var s = 0; s < a.length; s++) a[s](n); }; typeof setImmediate == "function" ? setImmediate(i) : setTimeout(i, 0); } }; var kf = function(e, r, n) { return function(a) { if (typeof e != "function") r[n].call(r, a); else { var i; try { i = e(a); } catch (o) { r.reject(o); return; } Z4(r, i); } }; }; var Z4 = function t8(e, r) { if (e === r || e.proxy === r) { e.reject(new TypeError("cannot resolve promise with itself")); return; } var n; if (It(r) === "object" && r !== null || typeof r == "function") try { n = r.then; } catch (i) { e.reject(i); return; } if (typeof n == "function") { var a = false; try { n.call( r, /* resolvePromise */ /* [Promises/A+ 2.3.3.3.1] */ function(i) { a || (a = true, i === r ? e.reject(new TypeError("circular thenable chain")) : t8(e, i)); }, /* rejectPromise */ /* [Promises/A+ 2.3.3.3.2] */ function(i) { a || (a = true, e.reject(i)); } ); } catch (i) { a || e.reject(i); } return; } e.fulfill(r); }; yn.all = function(t13) { return new yn(function(e, r) { for (var n = new Array(t13.length), a = 0, i = function(u, l) { n[u] = l, a++, a === t13.length && e(n); }, o = 0; o < t13.length; o++) (function(s) { var u = t13[s], l = u != null && u.then != null; if (l) u.then(function(d) { i(s, d); }, function(d) { r(d); }); else { var c = u; i(s, c); } })(o); }); }; yn.resolve = function(t13) { return new yn(function(e, r) { e(t13); }); }; yn.reject = function(t13) { return new yn(function(e, r) { r(t13); }); }; var hi = typeof Promise < "u" ? Promise : yn; var cu = function(e, r, n) { var a = oc(e), i = !a, o = this._private = Re({ duration: 1e3 }, r, n); if (o.target = e, o.style = o.style || o.css, o.started = false, o.playing = false, o.hooked = false, o.applying = false, o.progress = 0, o.completes = [], o.frames = [], o.complete && pt(o.complete) && o.completes.push(o.complete), i) { var s = e.position(); o.startPosition = o.startPosition || { x: s.x, y: s.y }, o.startStyle = o.startStyle || e.cy().style().getAnimationStartStyle(e, o.style); } if (a) { var u = e.pan(); o.startPan = { x: u.x, y: u.y }, o.startZoom = e.zoom(); } this.length = 1, this[0] = this; }; var wa = cu.prototype; Re(wa, { instanceString: function() { return "animation"; }, hook: function() { var e = this._private; if (!e.hooked) { var r, n = e.target._private.animation; e.queue ? r = n.queue : r = n.current, r.push(this), yr(e.target) && e.target.cy().addToAnimationPool(e.target), e.hooked = true; } return this; }, play: function() { var e = this._private; return e.progress === 1 && (e.progress = 0), e.playing = true, e.started = false, e.stopped = false, this.hook(), this; }, playing: function() { return this._private.playing; }, apply: function() { var e = this._private; return e.applying = true, e.started = false, e.stopped = false, this.hook(), this; }, applying: function() { return this._private.applying; }, pause: function() { var e = this._private; return e.playing = false, e.started = false, this; }, stop: function() { var e = this._private; return e.playing = false, e.started = false, e.stopped = true, this; }, rewind: function() { return this.progress(0); }, fastforward: function() { return this.progress(1); }, time: function(e) { var r = this._private; return e === void 0 ? r.progress * r.duration : this.progress(e / r.duration); }, progress: function(e) { var r = this._private, n = r.playing; return e === void 0 ? r.progress : (n && this.pause(), r.progress = e, r.started = false, n && this.play(), this); }, completed: function() { return this._private.progress === 1; }, reverse: function() { var e = this._private, r = e.playing; r && this.pause(), e.progress = 1 - e.progress, e.started = false; var n = function(l, c) { var d = e[l]; d != null && (e[l] = e[c], e[c] = d); }; if (n("zoom", "startZoom"), n("pan", "startPan"), n("position", "startPosition"), e.style) for (var a = 0; a < e.style.length; a++) { var i = e.style[a], o = i.name, s = e.startStyle[o]; e.startStyle[o] = i, e.style[a] = s; } return r && this.play(), this; }, promise: function(e) { var r = this._private, n; switch (e) { case "frame": n = r.frames; break; default: case "complete": case "completed": n = r.completes; } return new hi(function(a, i) { n.push(function() { a(); }); }); } }); wa.complete = wa.completed; wa.run = wa.play; wa.running = wa.playing; var X4 = { animated: function() { return function() { var r = this, n = r.length !== void 0, a = n ? r : [r], i = this._private.cy || this; if (!i.styleEnabled()) return false; var o = a[0]; if (o) return o._private.animation.current.length > 0; }; }, // animated clearQueue: function() { return function() { var r = this, n = r.length !== void 0, a = n ? r : [r], i = this._private.cy || this; if (!i.styleEnabled()) return this; for (var o = 0; o < a.length; o++) { var s = a[o]; s._private.animation.queue = []; } return this; }; }, // clearQueue delay: function() { return function(r, n) { var a = this._private.cy || this; return a.styleEnabled() ? this.animate({ delay: r, duration: r, complete: n }) : this; }; }, // delay delayAnimation: function() { return function(r, n) { var a = this._private.cy || this; return a.styleEnabled() ? this.animation({ delay: r, duration: r, complete: n }) : this; }; }, // delay animation: function() { return function(r, n) { var a = this, i = a.length !== void 0, o = i ? a : [a], s = this._private.cy || this, u = !i, l = !u; if (!s.styleEnabled()) return this; var c = s.style(); r = Re({}, r, n); var d = Object.keys(r).length === 0; if (d) return new cu(o[0], r); switch (r.duration === void 0 && (r.duration = 400), r.duration) { case "slow": r.duration = 600; break; case "fast": r.duration = 200; break; } if (l && (r.style = c.getPropsList(r.style || r.css), r.css = void 0), l && r.renderedPosition != null) { var v = r.renderedPosition, h6 = s.pan(), f = s.zoom(); r.position = cp(v, f, h6); } if (u && r.panBy != null) { var p = r.panBy, m = s.pan(); r.pan = { x: m.x + p.x, y: m.y + p.y }; } var g = r.center || r.centre; if (u && g != null) { var y = s.getCenterPan(g.eles, r.zoom); y != null && (r.pan = y); } if (u && r.fit != null) { var b = r.fit, w = s.getFitViewport(b.eles || b.boundingBox, b.padding); w != null && (r.pan = w.pan, r.zoom = w.zoom); } if (u && Xe(r.zoom)) { var C = s.getZoomedViewport(r.zoom); C != null ? (C.zoomed && (r.zoom = C.zoom), C.panned && (r.pan = C.pan)) : r.zoom = null; } return new cu(o[0], r); }; }, // animate animate: function() { return function(r, n) { var a = this, i = a.length !== void 0, o = i ? a : [a], s = this._private.cy || this; if (!s.styleEnabled()) return this; n && (r = Re({}, r, n)); for (var u = 0; u < o.length; u++) { var l = o[u], c = l.animated() && (r.queue === void 0 || r.queue), d = l.animation(r, c ? { queue: true } : void 0); d.play(); } return this; }; }, // animate stop: function() { return function(r, n) { var a = this, i = a.length !== void 0, o = i ? a : [a], s = this._private.cy || this; if (!s.styleEnabled()) return this; for (var u = 0; u < o.length; u++) { for (var l = o[u], c = l._private, d = c.animation.current, v = 0; v < d.length; v++) { var h6 = d[v], f = h6._private; n && (f.duration = 0); } r && (c.animation.queue = []), n || (c.animation.current = []); } return s.notify("draw"), this; }; } // stop }; var j4 = Array.isArray; var il = j4; var Q4 = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/; var J4 = /^\w*$/; function e3(t13, e) { if (il(t13)) return false; var r = typeof t13; return r == "number" || r == "symbol" || r == "boolean" || t13 == null || Po(t13) ? true : J4.test(t13) || !Q4.test(t13) || e != null && t13 in Object(e); } var t32 = e3; var r3 = "[object AsyncFunction]"; var n3 = "[object Function]"; var a3 = "[object GeneratorFunction]"; var i3 = "[object Proxy]"; function o3(t13) { if (!ga(t13)) return false; var e = tp(t13); return e == n3 || e == a3 || e == r3 || e == i3; } var s3 = o3; var l3 = el["__core-js_shared__"]; var $l = l3; var Sf = function() { var t13 = /[^.]+$/.exec($l && $l.keys && $l.keys.IE_PROTO || ""); return t13 ? "Symbol(src)_1." + t13 : ""; }(); function u3(t13) { return !!Sf && Sf in t13; } var c3 = u3; var d3 = Function.prototype; var f3 = d3.toString; function v3(t13) { if (t13 != null) { try { return f3.call(t13); } catch { } try { return t13 + ""; } catch { } } return ""; } var h3 = v3; var p3 = /[\\^$.*+?()[\]{}|]/g; var g3 = /^\[object .+?Constructor\]$/; var m3 = Function.prototype; var y3 = Object.prototype; var b3 = m3.toString; var w3 = y3.hasOwnProperty; var x3 = RegExp( "^" + b3.call(w3).replace(p3, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); function C3(t13) { if (!ga(t13) || c3(t13)) return false; var e = s3(t13) ? x3 : g3; return e.test(h3(t13)); } var E3 = C3; function k3(t13, e) { return t13 == null ? void 0 : t13[e]; } var S3 = k3; function T3(t13, e) { var r = S3(t13, e); return E3(r) ? r : void 0; } var pc = T3; var _3 = pc(Object, "create"); var so = _3; function D3() { this.__data__ = so ? so(null) : {}, this.size = 0; } var P3 = D3; function O3(t13) { var e = this.has(t13) && delete this.__data__[t13]; return this.size -= e ? 1 : 0, e; } var L3 = O3; var F3 = "__lodash_hash_undefined__"; var I3 = Object.prototype; var A3 = I3.hasOwnProperty; function M3(t13) { var e = this.__data__; if (so) { var r = e[t13]; return r === F3 ? void 0 : r; } return A3.call(e, t13) ? e[t13] : void 0; } var B3 = M3; var N3 = Object.prototype; var $3 = N3.hasOwnProperty; function R3(t13) { var e = this.__data__; return so ? e[t13] !== void 0 : $3.call(e, t13); } var z3 = R3; var V3 = "__lodash_hash_undefined__"; function H3(t13, e) { var r = this.__data__; return this.size += this.has(t13) ? 0 : 1, r[t13] = so && e === void 0 ? V3 : e, this; } var q3 = H3; function pi(t13) { var e = -1, r = t13 == null ? 0 : t13.length; for (this.clear(); ++e < r; ) { var n = t13[e]; this.set(n[0], n[1]); } } pi.prototype.clear = P3; pi.prototype.delete = L3; pi.prototype.get = B3; pi.prototype.has = z3; pi.prototype.set = q3; var Tf = pi; function K3() { this.__data__ = [], this.size = 0; } var U3 = K3; function G3(t13, e) { return t13 === e || t13 !== t13 && e !== e; } var Tp = G3; function W3(t13, e) { for (var r = t13.length; r--; ) if (Tp(t13[r][0], e)) return r; return -1; } var ol = W3; var Y3 = Array.prototype; var Z3 = Y3.splice; function X3(t13) { var e = this.__data__, r = ol(e, t13); if (r < 0) return false; var n = e.length - 1; return r == n ? e.pop() : Z3.call(e, r, 1), --this.size, true; } var j3 = X3; function Q3(t13) { var e = this.__data__, r = ol(e, t13); return r < 0 ? void 0 : e[r][1]; } var J3 = Q3; function e_(t13) { return ol(this.__data__, t13) > -1; } var t_ = e_; function r_(t13, e) { var r = this.__data__, n = ol(r, t13); return n < 0 ? (++this.size, r.push([t13, e])) : r[n][1] = e, this; } var n_ = r_; function gi(t13) { var e = -1, r = t13 == null ? 0 : t13.length; for (this.clear(); ++e < r; ) { var n = t13[e]; this.set(n[0], n[1]); } } gi.prototype.clear = U3; gi.prototype.delete = j3; gi.prototype.get = J3; gi.prototype.has = t_; gi.prototype.set = n_; var a_ = gi; var i_ = pc(el, "Map"); var o_ = i_; function s_() { this.size = 0, this.__data__ = { hash: new Tf(), map: new (o_ || a_)(), string: new Tf() }; } var l_ = s_; function u_(t13) { var e = typeof t13; return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t13 !== "__proto__" : t13 === null; } var c_ = u_; function d_(t13, e) { var r = t13.__data__; return c_(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map; } var sl = d_; function f_(t13) { var e = sl(this, t13).delete(t13); return this.size -= e ? 1 : 0, e; } var v_ = f_; function h_(t13) { return sl(this, t13).get(t13); } var p_ = h_; function g_(t13) { return sl(this, t13).has(t13); } var m_ = g_; function y_(t13, e) { var r = sl(this, t13), n = r.size; return r.set(t13, e), this.size += r.size == n ? 0 : 1, this; } var b_ = y_; function mi(t13) { var e = -1, r = t13 == null ? 0 : t13.length; for (this.clear(); ++e < r; ) { var n = t13[e]; this.set(n[0], n[1]); } } mi.prototype.clear = l_; mi.prototype.delete = v_; mi.prototype.get = p_; mi.prototype.has = m_; mi.prototype.set = b_; var _p = mi; var w_ = "Expected a function"; function gc(t13, e) { if (typeof t13 != "function" || e != null && typeof e != "function") throw new TypeError(w_); var r = function() { var n = arguments, a = e ? e.apply(this, n) : n[0], i = r.cache; if (i.has(a)) return i.get(a); var o = t13.apply(this, n); return r.cache = i.set(a, o) || i, o; }; return r.cache = new (gc.Cache || _p)(), r; } gc.Cache = _p; var x_ = gc; var C_ = 500; function E_(t13) { var e = x_(t13, function(n) { return r.size === C_ && r.clear(), n; }), r = e.cache; return e; } var k_ = E_; var S_ = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; var T_ = /\\(\\)?/g; var __ = k_(function(t13) { var e = []; return t13.charCodeAt(0) === 46 && e.push(""), t13.replace(S_, function(r, n, a, i) { e.push(a ? i.replace(T_, "$1") : n || r); }), e; }); var Dp = __; function D_(t13, e) { for (var r = -1, n = t13 == null ? 0 : t13.length, a = Array(n); ++r < n; ) a[r] = e(t13[r], r, t13); return a; } var Pp = D_; var P_ = 1 / 0; var _f = ii ? ii.prototype : void 0; var Df = _f ? _f.toString : void 0; function Op(t13) { if (typeof t13 == "string") return t13; if (il(t13)) return Pp(t13, Op) + ""; if (Po(t13)) return Df ? Df.call(t13) : ""; var e = t13 + ""; return e == "0" && 1 / t13 == -P_ ? "-0" : e; } var O_ = Op; function L_(t13) { return t13 == null ? "" : O_(t13); } var Lp = L_; function F_(t13, e) { return il(t13) ? t13 : t32(t13, e) ? [t13] : Dp(Lp(t13)); } var Fp = F_; var I_ = 1 / 0; function A_(t13) { if (typeof t13 == "string" || Po(t13)) return t13; var e = t13 + ""; return e == "0" && 1 / t13 == -I_ ? "-0" : e; } var mc = A_; function M_(t13, e) { e = Fp(e, t13); for (var r = 0, n = e.length; t13 != null && r < n; ) t13 = t13[mc(e[r++])]; return r && r == n ? t13 : void 0; } var B_ = M_; function N_(t13, e, r) { var n = t13 == null ? void 0 : B_(t13, e); return n === void 0 ? r : n; } var $_ = N_; var R_ = function() { try { var t13 = pc(Object, "defineProperty"); return t13({}, "", {}), t13; } catch { } }(); var Pf = R_; function z_(t13, e, r) { e == "__proto__" && Pf ? Pf(t13, e, { configurable: true, enumerable: true, value: r, writable: true }) : t13[e] = r; } var V_ = z_; var H_ = Object.prototype; var q_ = H_.hasOwnProperty; function K_(t13, e, r) { var n = t13[e]; (!(q_.call(t13, e) && Tp(n, r)) || r === void 0 && !(e in t13)) && V_(t13, e, r); } var U_ = K_; var G_ = 9007199254740991; var W_ = /^(?:0|[1-9]\d*)$/; function Y_(t13, e) { var r = typeof t13; return e = e ?? G_, !!e && (r == "number" || r != "symbol" && W_.test(t13)) && t13 > -1 && t13 % 1 == 0 && t13 < e; } var Z_ = Y_; function X_(t13, e, r, n) { if (!ga(t13)) return t13; e = Fp(e, t13); for (var a = -1, i = e.length, o = i - 1, s = t13; s != null && ++a < i; ) { var u = mc(e[a]), l = r; if (u === "__proto__" || u === "constructor" || u === "prototype") return t13; if (a != o) { var c = s[u]; l = n ? n(c, u, s) : void 0, l === void 0 && (l = ga(c) ? c : Z_(e[a + 1]) ? [] : {}); } U_(s, u, l), s = s[u]; } return t13; } var j_ = X_; function Q_(t13, e, r) { return t13 == null ? t13 : j_(t13, e, r); } var J_ = Q_; function eD(t13, e) { var r = -1, n = t13.length; for (e || (e = Array(n)); ++r < n; ) e[r] = t13[r]; return e; } var tD = eD; function rD(t13) { return il(t13) ? Pp(t13, mc) : Po(t13) ? [t13] : tD(Dp(Lp(t13))); } var nD = rD; var aD = { // access data field data: function(e) { var r = { field: "data", bindingEvent: "data", allowBinding: false, allowSetting: false, allowGetting: false, settingEvent: "data", settingTriggersEvent: false, triggerFnName: "trigger", immutableKeys: {}, // key => true if immutable updateStyle: false, beforeGet: function(a) { }, beforeSet: function(a, i) { }, onSet: function(a) { }, canSet: function(a) { return true; } }; return e = Re({}, r, e), function(a, i) { var o = e, s = this, u = s.length !== void 0, l = u ? s : [s], c = u ? s[0] : s; if (Ie(a)) { var d = a.indexOf(".") !== -1, v = d && nD(a); if (o.allowGetting && i === void 0) { var h6; return c && (o.beforeGet(c), v && c._private[o.field][a] === void 0 ? h6 = $_(c._private[o.field], v) : h6 = c._private[o.field][a]), h6; } else if (o.allowSetting && i !== void 0) { var f = !o.immutableKeys[a]; if (f) { var p = Kh({}, a, i); o.beforeSet(s, p); for (var m = 0, g = l.length; m < g; m++) { var y = l[m]; o.canSet(y) && (v && c._private[o.field][a] === void 0 ? J_(y._private[o.field], v, i) : y._private[o.field][a] = i); } o.updateStyle && s.updateStyle(), o.onSet(s), o.settingTriggersEvent && s[o.triggerFnName](o.settingEvent); } } } else if (o.allowSetting && Xe(a)) { var b = a, w, C, E = Object.keys(b); o.beforeSet(s, b); for (var x = 0; x < E.length; x++) { w = E[x], C = b[w]; var T = !o.immutableKeys[w]; if (T) for (var k = 0; k < l.length; k++) { var _ = l[k]; o.canSet(_) && (_._private[o.field][w] = C); } } o.updateStyle && s.updateStyle(), o.onSet(s), o.settingTriggersEvent && s[o.triggerFnName](o.settingEvent); } else if (o.allowBinding && pt(a)) { var D = a; s.on(o.bindingEvent, D); } else if (o.allowGetting && a === void 0) { var O; return c && (o.beforeGet(c), O = c._private[o.field]), O; } return s; }; }, // data // remove data field removeData: function(e) { var r = { field: "data", event: "data", triggerFnName: "trigger", triggerEvent: false, immutableKeys: {} // key => true if immutable }; return e = Re({}, r, e), function(a) { var i = e, o = this, s = o.length !== void 0, u = s ? o : [o]; if (Ie(a)) { for (var l = a.split(/\s+/), c = l.length, d = 0; d < c; d++) { var v = l[d]; if (!qn(v)) { var h6 = !i.immutableKeys[v]; if (h6) for (var f = 0, p = u.length; f < p; f++) u[f]._private[i.field][v] = void 0; } } i.triggerEvent && o[i.triggerFnName](i.event); } else if (a === void 0) { for (var m = 0, g = u.length; m < g; m++) for (var y = u[m]._private[i.field], b = Object.keys(y), w = 0; w < b.length; w++) { var C = b[w], E = !i.immutableKeys[C]; E && (y[C] = void 0); } i.triggerEvent && o[i.triggerFnName](i.event); } return o; }; } // removeData }; var iD = { eventAliasesOn: function(e) { var r = e; r.addListener = r.listen = r.bind = r.on, r.unlisten = r.unbind = r.off = r.removeListener, r.trigger = r.emit, r.pon = r.promiseOn = function(n, a) { var i = this, o = Array.prototype.slice.call(arguments, 0); return new hi(function(s, u) { var l = function(h6) { i.off.apply(i, d), s(h6); }, c = o.concat([l]), d = c.concat([]); i.on.apply(i, c); }); }; } }; var et = {}; [X4, aD, iD].forEach(function(t13) { Re(et, t13); }); var oD = { animate: et.animate(), animation: et.animation(), animated: et.animated(), clearQueue: et.clearQueue(), delay: et.delay(), delayAnimation: et.delayAnimation(), stop: et.stop() }; var ds = { classes: function(e) { var r = this; if (e === void 0) { var n = []; return r[0]._private.classes.forEach(function(f) { return n.push(f); }), n; } else st(e) || (e = (e || "").match(/\S+/g) || []); for (var a = [], i = new vi(e), o = 0; o < r.length; o++) { for (var s = r[o], u = s._private, l = u.classes, c = false, d = 0; d < e.length; d++) { var v = e[d], h6 = l.has(v); if (!h6) { c = true; break; } } c || (c = l.size !== e.length), c && (u.classes = i, a.push(s)); } return a.length > 0 && this.spawn(a).updateStyle().emit("class"), r; }, addClass: function(e) { return this.toggleClass(e, true); }, hasClass: function(e) { var r = this[0]; return r != null && r._private.classes.has(e); }, toggleClass: function(e, r) { st(e) || (e = e.match(/\S+/g) || []); for (var n = this, a = r === void 0, i = [], o = 0, s = n.length; o < s; o++) for (var u = n[o], l = u._private.classes, c = false, d = 0; d < e.length; d++) { var v = e[d], h6 = l.has(v), f = false; r || a && !h6 ? (l.add(v), f = true) : (!r || a && h6) && (l.delete(v), f = true), !c && f && (i.push(u), c = true); } return i.length > 0 && this.spawn(i).updateStyle().emit("class"), n; }, removeClass: function(e) { return this.toggleClass(e, false); }, flashClass: function(e, r) { var n = this; if (r == null) r = 250; else if (r === 0) return n; return n.addClass(e), setTimeout(function() { n.removeClass(e); }, r), n; } }; ds.className = ds.classNames = ds.classes; var Ye = { metaChar: "[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]", // chars we need to escape in let names, etc comparatorOp: "=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=", // binary comparison op (used in data selectors) boolOp: "\\?|\\!|\\^", // boolean (unary) operators (used in data selectors) string: `"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`, // string literals (used in data selectors) -- doublequotes | singlequotes number: Ft, // number literal (used in data selectors) --- e.g. 0.1234, 1234, 12e123 meta: "degree|indegree|outdegree", // allowed metadata fields (i.e. allowed functions to use from Collection) separator: "\\s*,\\s*", // queries are separated by commas, e.g. edge[foo = 'bar'], node.someClass descendant: "\\s+", child: "\\s+>\\s+", subject: "\\$", group: "node|edge|\\*", directedEdge: "\\s+->\\s+", undirectedEdge: "\\s+<->\\s+" }; Ye.variable = "(?:[\\w-.]|(?:\\\\" + Ye.metaChar + "))+"; Ye.className = "(?:[\\w-]|(?:\\\\" + Ye.metaChar + "))+"; Ye.value = Ye.string + "|" + Ye.number; Ye.id = Ye.variable; (function() { var t13, e, r; for (t13 = Ye.comparatorOp.split("|"), r = 0; r < t13.length; r++) e = t13[r], Ye.comparatorOp += "|@" + e; for (t13 = Ye.comparatorOp.split("|"), r = 0; r < t13.length; r++) e = t13[r], !(e.indexOf("!") >= 0) && e !== "=" && (Ye.comparatorOp += "|\\!" + e); })(); var it = function() { return { checks: [] }; }; var Se = { /** E.g. node */ GROUP: 0, /** A collection of elements */ COLLECTION: 1, /** A filter(ele) function */ FILTER: 2, /** E.g. [foo > 1] */ DATA_COMPARE: 3, /** E.g. [foo] */ DATA_EXIST: 4, /** E.g. [?foo] */ DATA_BOOL: 5, /** E.g. [[degree > 2]] */ META_COMPARE: 6, /** E.g. :selected */ STATE: 7, /** E.g. #foo */ ID: 8, /** E.g. .foo */ CLASS: 9, /** E.g. #foo <-> #bar */ UNDIRECTED_EDGE: 10, /** E.g. #foo -> #bar */ DIRECTED_EDGE: 11, /** E.g. $#foo -> #bar */ NODE_SOURCE: 12, /** E.g. #foo -> $#bar */ NODE_TARGET: 13, /** E.g. $#foo <-> #bar */ NODE_NEIGHBOR: 14, /** E.g. #foo > #bar */ CHILD: 15, /** E.g. #foo #bar */ DESCENDANT: 16, /** E.g. $#foo > #bar */ PARENT: 17, /** E.g. $#foo #bar */ ANCESTOR: 18, /** E.g. #foo > $bar > #baz */ COMPOUND_SPLIT: 19, /** Always matches, useful placeholder for subject in `COMPOUND_SPLIT` */ TRUE: 20 }; var du = [{ selector: ":selected", matches: function(e) { return e.selected(); } }, { selector: ":unselected", matches: function(e) { return !e.selected(); } }, { selector: ":selectable", matches: function(e) { return e.selectable(); } }, { selector: ":unselectable", matches: function(e) { return !e.selectable(); } }, { selector: ":locked", matches: function(e) { return e.locked(); } }, { selector: ":unlocked", matches: function(e) { return !e.locked(); } }, { selector: ":visible", matches: function(e) { return e.visible(); } }, { selector: ":hidden", matches: function(e) { return !e.visible(); } }, { selector: ":transparent", matches: function(e) { return e.transparent(); } }, { selector: ":grabbed", matches: function(e) { return e.grabbed(); } }, { selector: ":free", matches: function(e) { return !e.grabbed(); } }, { selector: ":removed", matches: function(e) { return e.removed(); } }, { selector: ":inside", matches: function(e) { return !e.removed(); } }, { selector: ":grabbable", matches: function(e) { return e.grabbable(); } }, { selector: ":ungrabbable", matches: function(e) { return !e.grabbable(); } }, { selector: ":animated", matches: function(e) { return e.animated(); } }, { selector: ":unanimated", matches: function(e) { return !e.animated(); } }, { selector: ":parent", matches: function(e) { return e.isParent(); } }, { selector: ":childless", matches: function(e) { return e.isChildless(); } }, { selector: ":child", matches: function(e) { return e.isChild(); } }, { selector: ":orphan", matches: function(e) { return e.isOrphan(); } }, { selector: ":nonorphan", matches: function(e) { return e.isChild(); } }, { selector: ":compound", matches: function(e) { return e.isNode() ? e.isParent() : e.source().isParent() || e.target().isParent(); } }, { selector: ":loop", matches: function(e) { return e.isLoop(); } }, { selector: ":simple", matches: function(e) { return e.isSimple(); } }, { selector: ":active", matches: function(e) { return e.active(); } }, { selector: ":inactive", matches: function(e) { return !e.active(); } }, { selector: ":backgrounding", matches: function(e) { return e.backgrounding(); } }, { selector: ":nonbackgrounding", matches: function(e) { return !e.backgrounding(); } }].sort(function(t13, e) { return yT(t13.selector, e.selector); }); var sD = function() { for (var t13 = {}, e, r = 0; r < du.length; r++) e = du[r], t13[e.selector] = e.matches; return t13; }(); var lD = function(e, r) { return sD[e](r); }; var uD = "(" + du.map(function(t13) { return t13.selector; }).join("|") + ")"; var Ia = function(e) { return e.replace(new RegExp("\\\\(" + Ye.metaChar + ")", "g"), function(r, n) { return n; }); }; var Pn = function(e, r, n) { e[e.length - 1] = n; }; var fu = [{ name: "group", // just used for identifying when debugging query: true, regex: "(" + Ye.group + ")", populate: function(e, r, n) { var a = Mr(n, 1), i = a[0]; r.checks.push({ type: Se.GROUP, value: i === "*" ? i : i + "s" }); } }, { name: "state", query: true, regex: uD, populate: function(e, r, n) { var a = Mr(n, 1), i = a[0]; r.checks.push({ type: Se.STATE, value: i }); } }, { name: "id", query: true, regex: "\\#(" + Ye.id + ")", populate: function(e, r, n) { var a = Mr(n, 1), i = a[0]; r.checks.push({ type: Se.ID, value: Ia(i) }); } }, { name: "className", query: true, regex: "\\.(" + Ye.className + ")", populate: function(e, r, n) { var a = Mr(n, 1), i = a[0]; r.checks.push({ type: Se.CLASS, value: Ia(i) }); } }, { name: "dataExists", query: true, regex: "\\[\\s*(" + Ye.variable + ")\\s*\\]", populate: function(e, r, n) { var a = Mr(n, 1), i = a[0]; r.checks.push({ type: Se.DATA_EXIST, field: Ia(i) }); } }, { name: "dataCompare", query: true, regex: "\\[\\s*(" + Ye.variable + ")\\s*(" + Ye.comparatorOp + ")\\s*(" + Ye.value + ")\\s*\\]", populate: function(e, r, n) { var a = Mr(n, 3), i = a[0], o = a[1], s = a[2], u = new RegExp("^" + Ye.string + "$").exec(s) != null; u ? s = s.substring(1, s.length - 1) : s = parseFloat(s), r.checks.push({ type: Se.DATA_COMPARE, field: Ia(i), operator: o, value: s }); } }, { name: "dataBool", query: true, regex: "\\[\\s*(" + Ye.boolOp + ")\\s*(" + Ye.variable + ")\\s*\\]", populate: function(e, r, n) { var a = Mr(n, 2), i = a[0], o = a[1]; r.checks.push({ type: Se.DATA_BOOL, field: Ia(o), operator: i }); } }, { name: "metaCompare", query: true, regex: "\\[\\[\\s*(" + Ye.meta + ")\\s*(" + Ye.comparatorOp + ")\\s*(" + Ye.number + ")\\s*\\]\\]", populate: function(e, r, n) { var a = Mr(n, 3), i = a[0], o = a[1], s = a[2]; r.checks.push({ type: Se.META_COMPARE, field: Ia(i), operator: o, value: parseFloat(s) }); } }, { name: "nextQuery", separator: true, regex: Ye.separator, populate: function(e, r) { var n = e.currentSubject, a = e.edgeCount, i = e.compoundCount, o = e[e.length - 1]; n != null && (o.subject = n, e.currentSubject = null), o.edgeCount = a, o.compoundCount = i, e.edgeCount = 0, e.compoundCount = 0; var s = e[e.length++] = it(); return s; } }, { name: "directedEdge", separator: true, regex: Ye.directedEdge, populate: function(e, r) { if (e.currentSubject == null) { var n = it(), a = r, i = it(); return n.checks.push({ type: Se.DIRECTED_EDGE, source: a, target: i }), Pn(e, r, n), e.edgeCount++, i; } else { var o = it(), s = r, u = it(); return o.checks.push({ type: Se.NODE_SOURCE, source: s, target: u }), Pn(e, r, o), e.edgeCount++, u; } } }, { name: "undirectedEdge", separator: true, regex: Ye.undirectedEdge, populate: function(e, r) { if (e.currentSubject == null) { var n = it(), a = r, i = it(); return n.checks.push({ type: Se.UNDIRECTED_EDGE, nodes: [a, i] }), Pn(e, r, n), e.edgeCount++, i; } else { var o = it(), s = r, u = it(); return o.checks.push({ type: Se.NODE_NEIGHBOR, node: s, neighbor: u }), Pn(e, r, o), u; } } }, { name: "child", separator: true, regex: Ye.child, populate: function(e, r) { if (e.currentSubject == null) { var n = it(), a = it(), i = e[e.length - 1]; return n.checks.push({ type: Se.CHILD, parent: i, child: a }), Pn(e, r, n), e.compoundCount++, a; } else if (e.currentSubject === r) { var o = it(), s = e[e.length - 1], u = it(), l = it(), c = it(), d = it(); return o.checks.push({ type: Se.COMPOUND_SPLIT, left: s, right: u, subject: l }), l.checks = r.checks, r.checks = [{ type: Se.TRUE }], d.checks.push({ type: Se.TRUE }), u.checks.push({ type: Se.PARENT, // type is swapped on right side queries parent: d, child: c // empty for now }), Pn(e, s, o), e.currentSubject = l, e.compoundCount++, c; } else { var v = it(), h6 = it(), f = [{ type: Se.PARENT, parent: v, child: h6 }]; return v.checks = r.checks, r.checks = f, e.compoundCount++, h6; } } }, { name: "descendant", separator: true, regex: Ye.descendant, populate: function(e, r) { if (e.currentSubject == null) { var n = it(), a = it(), i = e[e.length - 1]; return n.checks.push({ type: Se.DESCENDANT, ancestor: i, descendant: a }), Pn(e, r, n), e.compoundCount++, a; } else if (e.currentSubject === r) { var o = it(), s = e[e.length - 1], u = it(), l = it(), c = it(), d = it(); return o.checks.push({ type: Se.COMPOUND_SPLIT, left: s, right: u, subject: l }), l.checks = r.checks, r.checks = [{ type: Se.TRUE }], d.checks.push({ type: Se.TRUE }), u.checks.push({ type: Se.ANCESTOR, // type is swapped on right side queries ancestor: d, descendant: c // empty for now }), Pn(e, s, o), e.currentSubject = l, e.compoundCount++, c; } else { var v = it(), h6 = it(), f = [{ type: Se.ANCESTOR, ancestor: v, descendant: h6 }]; return v.checks = r.checks, r.checks = f, e.compoundCount++, h6; } } }, { name: "subject", modifier: true, regex: Ye.subject, populate: function(e, r) { if (e.currentSubject != null && e.currentSubject !== r) return tt("Redefinition of subject in selector `" + e.toString() + "`"), false; e.currentSubject = r; var n = e[e.length - 1], a = n.checks[0], i = a == null ? null : a.type; i === Se.DIRECTED_EDGE ? a.type = Se.NODE_TARGET : i === Se.UNDIRECTED_EDGE && (a.type = Se.NODE_NEIGHBOR, a.node = a.nodes[1], a.neighbor = a.nodes[0], a.nodes = null); } }]; fu.forEach(function(t13) { return t13.regexObj = new RegExp("^" + t13.regex); }); var cD = function(e) { for (var r, n, a, i = 0; i < fu.length; i++) { var o = fu[i], s = o.name, u = e.match(o.regexObj); if (u != null) { n = u, r = o, a = s; var l = u[0]; e = e.substring(l.length); break; } } return { expr: r, match: n, name: a, remaining: e }; }; var dD = function(e) { var r = e.match(/^\s+/); if (r) { var n = r[0]; e = e.substring(n.length); } return e; }; var fD = function(e) { var r = this, n = r.inputText = e, a = r[0] = it(); for (r.length = 1, n = dD(n); ; ) { var i = cD(n); if (i.expr == null) return tt("The selector `" + e + "`is invalid"), false; var o = i.match.slice(1), s = i.expr.populate(r, a, o); if (s === false) return false; if (s != null && (a = s), n = i.remaining, n.match(/^\s*$/)) break; } var u = r[r.length - 1]; r.currentSubject != null && (u.subject = r.currentSubject), u.edgeCount = r.edgeCount, u.compoundCount = r.compoundCount; for (var l = 0; l < r.length; l++) { var c = r[l]; if (c.compoundCount > 0 && c.edgeCount > 0) return tt("The selector `" + e + "` is invalid because it uses both a compound selector and an edge selector"), false; if (c.edgeCount > 1) return tt("The selector `" + e + "` is invalid because it uses multiple edge selectors"), false; c.edgeCount === 1 && tt("The selector `" + e + "` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes."); } return true; }; var vD = function() { if (this.toStringCache != null) return this.toStringCache; for (var e = function(c) { return c ?? ""; }, r = function(c) { return Ie(c) ? '"' + c + '"' : e(c); }, n = function(c) { return " " + c + " "; }, a = function(c, d) { var v = c.type, h6 = c.value; switch (v) { case Se.GROUP: { var f = e(h6); return f.substring(0, f.length - 1); } case Se.DATA_COMPARE: { var p = c.field, m = c.operator; return "[" + p + n(e(m)) + r(h6) + "]"; } case Se.DATA_BOOL: { var g = c.operator, y = c.field; return "[" + e(g) + y + "]"; } case Se.DATA_EXIST: { var b = c.field; return "[" + b + "]"; } case Se.META_COMPARE: { var w = c.operator, C = c.field; return "[[" + C + n(e(w)) + r(h6) + "]]"; } case Se.STATE: return h6; case Se.ID: return "#" + h6; case Se.CLASS: return "." + h6; case Se.PARENT: case Se.CHILD: return i(c.parent, d) + n(">") + i(c.child, d); case Se.ANCESTOR: case Se.DESCENDANT: return i(c.ancestor, d) + " " + i(c.descendant, d); case Se.COMPOUND_SPLIT: { var E = i(c.left, d), x = i(c.subject, d), T = i(c.right, d); return E + (E.length > 0 ? " " : "") + x + T; } case Se.TRUE: return ""; } }, i = function(c, d) { return c.checks.reduce(function(v, h6, f) { return v + (d === c && f === 0 ? "$" : "") + a(h6, d); }, ""); }, o = "", s = 0; s < this.length; s++) { var u = this[s]; o += i(u, u.subject), this.length > 1 && s < this.length - 1 && (o += ", "); } return this.toStringCache = o, o; }; var hD = { parse: fD, toString: vD }; var Ip = function(e, r, n) { var a, i = Ie(e), o = be(e), s = Ie(n), u, l, c = false, d = false, v = false; switch (r.indexOf("!") >= 0 && (r = r.replace("!", ""), d = true), r.indexOf("@") >= 0 && (r = r.replace("@", ""), c = true), (i || s || c) && (u = !i && !o ? "" : "" + e, l = "" + n), c && (e = u = u.toLowerCase(), n = l = l.toLowerCase()), r) { case "*=": a = u.indexOf(l) >= 0; break; case "$=": a = u.indexOf(l, u.length - l.length) >= 0; break; case "^=": a = u.indexOf(l) === 0; break; case "=": a = e === n; break; case ">": v = true, a = e > n; break; case ">=": v = true, a = e >= n; break; case "<": v = true, a = e < n; break; case "<=": v = true, a = e <= n; break; default: a = false; break; } return d && (e != null || !v) && (a = !a), a; }; var pD = function(e, r) { switch (r) { case "?": return !!e; case "!": return !e; case "^": return e === void 0; } }; var gD = function(e) { return e !== void 0; }; var yc = function(e, r) { return e.data(r); }; var mD = function(e, r) { return e[r](); }; var bt = []; var vt = function(e, r) { return e.checks.every(function(n) { return bt[n.type](n, r); }); }; bt[Se.GROUP] = function(t13, e) { var r = t13.value; return r === "*" || r === e.group(); }; bt[Se.STATE] = function(t13, e) { var r = t13.value; return lD(r, e); }; bt[Se.ID] = function(t13, e) { var r = t13.value; return e.id() === r; }; bt[Se.CLASS] = function(t13, e) { var r = t13.value; return e.hasClass(r); }; bt[Se.META_COMPARE] = function(t13, e) { var r = t13.field, n = t13.operator, a = t13.value; return Ip(mD(e, r), n, a); }; bt[Se.DATA_COMPARE] = function(t13, e) { var r = t13.field, n = t13.operator, a = t13.value; return Ip(yc(e, r), n, a); }; bt[Se.DATA_BOOL] = function(t13, e) { var r = t13.field, n = t13.operator; return pD(yc(e, r), n); }; bt[Se.DATA_EXIST] = function(t13, e) { var r = t13.field; return t13.operator, gD(yc(e, r)); }; bt[Se.UNDIRECTED_EDGE] = function(t13, e) { var r = t13.nodes[0], n = t13.nodes[1], a = e.source(), i = e.target(); return vt(r, a) && vt(n, i) || vt(n, a) && vt(r, i); }; bt[Se.NODE_NEIGHBOR] = function(t13, e) { return vt(t13.node, e) && e.neighborhood().some(function(r) { return r.isNode() && vt(t13.neighbor, r); }); }; bt[Se.DIRECTED_EDGE] = function(t13, e) { return vt(t13.source, e.source()) && vt(t13.target, e.target()); }; bt[Se.NODE_SOURCE] = function(t13, e) { return vt(t13.source, e) && e.outgoers().some(function(r) { return r.isNode() && vt(t13.target, r); }); }; bt[Se.NODE_TARGET] = function(t13, e) { return vt(t13.target, e) && e.incomers().some(function(r) { return r.isNode() && vt(t13.source, r); }); }; bt[Se.CHILD] = function(t13, e) { return vt(t13.child, e) && vt(t13.parent, e.parent()); }; bt[Se.PARENT] = function(t13, e) { return vt(t13.parent, e) && e.children().some(function(r) { return vt(t13.child, r); }); }; bt[Se.DESCENDANT] = function(t13, e) { return vt(t13.descendant, e) && e.ancestors().some(function(r) { return vt(t13.ancestor, r); }); }; bt[Se.ANCESTOR] = function(t13, e) { return vt(t13.ancestor, e) && e.descendants().some(function(r) { return vt(t13.descendant, r); }); }; bt[Se.COMPOUND_SPLIT] = function(t13, e) { return vt(t13.subject, e) && vt(t13.left, e) && vt(t13.right, e); }; bt[Se.TRUE] = function() { return true; }; bt[Se.COLLECTION] = function(t13, e) { var r = t13.value; return r.has(e); }; bt[Se.FILTER] = function(t13, e) { var r = t13.value; return r(e); }; var yD = function(e) { var r = this; if (r.length === 1 && r[0].checks.length === 1 && r[0].checks[0].type === Se.ID) return e.getElementById(r[0].checks[0].value).collection(); var n = function(i) { for (var o = 0; o < r.length; o++) { var s = r[o]; if (vt(s, i)) return true; } return false; }; return r.text() == null && (n = function() { return true; }), e.filter(n); }; var bD = function(e) { for (var r = this, n = 0; n < r.length; n++) { var a = r[n]; if (vt(a, e)) return true; } return false; }; var wD = { matches: bD, filter: yD }; var Un = function(e) { this.inputText = e, this.currentSubject = null, this.compoundCount = 0, this.edgeCount = 0, this.length = 0, e == null || Ie(e) && e.match(/^\s*$/) || (yr(e) ? this.addQuery({ checks: [{ type: Se.COLLECTION, value: e.collection() }] }) : pt(e) ? this.addQuery({ checks: [{ type: Se.FILTER, value: e }] }) : Ie(e) ? this.parse(e) || (this.invalid = true) : yt("A selector must be created from a string; found ")); }; var Gn = Un.prototype; [hD, wD].forEach(function(t13) { return Re(Gn, t13); }); Gn.text = function() { return this.inputText; }; Gn.size = function() { return this.length; }; Gn.eq = function(t13) { return this[t13]; }; Gn.sameText = function(t13) { return !this.invalid && !t13.invalid && this.text() === t13.text(); }; Gn.addQuery = function(t13) { this[this.length++] = t13; }; Gn.selector = Gn.toString; var Rn = { allAre: function(e) { var r = new Un(e); return this.every(function(n) { return r.matches(n); }); }, is: function(e) { var r = new Un(e); return this.some(function(n) { return r.matches(n); }); }, some: function(e, r) { for (var n = 0; n < this.length; n++) { var a = r ? e.apply(r, [this[n], n, this]) : e(this[n], n, this); if (a) return true; } return false; }, every: function(e, r) { for (var n = 0; n < this.length; n++) { var a = r ? e.apply(r, [this[n], n, this]) : e(this[n], n, this); if (!a) return false; } return true; }, same: function(e) { if (this === e) return true; e = this.cy().collection(e); var r = this.length, n = e.length; return r !== n ? false : r === 1 ? this[0] === e[0] : this.every(function(a) { return e.hasElementWithId(a.id()); }); }, anySame: function(e) { return e = this.cy().collection(e), this.some(function(r) { return e.hasElementWithId(r.id()); }); }, allAreNeighbors: function(e) { e = this.cy().collection(e); var r = this.neighborhood(); return e.every(function(n) { return r.hasElementWithId(n.id()); }); }, contains: function(e) { e = this.cy().collection(e); var r = this; return e.every(function(n) { return r.hasElementWithId(n.id()); }); } }; Rn.allAreNeighbours = Rn.allAreNeighbors; Rn.has = Rn.contains; Rn.equal = Rn.equals = Rn.same; var Sr = function(e, r) { return function(a, i, o, s) { var u = a, l = this, c; if (u == null ? c = "" : yr(u) && u.length === 1 && (c = u.id()), l.length === 1 && c) { var d = l[0]._private, v = d.traversalCache = d.traversalCache || {}, h6 = v[r] = v[r] || [], f = ma(c), p = h6[f]; return p || (h6[f] = e.call(l, a, i, o, s)); } else return e.call(l, a, i, o, s); }; }; var li = { parent: function(e) { var r = []; if (this.length === 1) { var n = this[0]._private.parent; if (n) return n; } for (var a = 0; a < this.length; a++) { var i = this[a], o = i._private.parent; o && r.push(o); } return this.spawn(r, true).filter(e); }, parents: function(e) { for (var r = [], n = this.parent(); n.nonempty(); ) { for (var a = 0; a < n.length; a++) { var i = n[a]; r.push(i); } n = n.parent(); } return this.spawn(r, true).filter(e); }, commonAncestors: function(e) { for (var r, n = 0; n < this.length; n++) { var a = this[n], i = a.parents(); r = r || i, r = r.intersect(i); } return r.filter(e); }, orphans: function(e) { return this.stdFilter(function(r) { return r.isOrphan(); }).filter(e); }, nonorphans: function(e) { return this.stdFilter(function(r) { return r.isChild(); }).filter(e); }, children: Sr(function(t13) { for (var e = [], r = 0; r < this.length; r++) for (var n = this[r], a = n._private.children, i = 0; i < a.length; i++) e.push(a[i]); return this.spawn(e, true).filter(t13); }, "children"), siblings: function(e) { return this.parent().children().not(this).filter(e); }, isParent: function() { var e = this[0]; if (e) return e.isNode() && e._private.children.length !== 0; }, isChildless: function() { var e = this[0]; if (e) return e.isNode() && e._private.children.length === 0; }, isChild: function() { var e = this[0]; if (e) return e.isNode() && e._private.parent != null; }, isOrphan: function() { var e = this[0]; if (e) return e.isNode() && e._private.parent == null; }, descendants: function(e) { var r = []; function n(a) { for (var i = 0; i < a.length; i++) { var o = a[i]; r.push(o), o.children().nonempty() && n(o.children()); } } return n(this.children()), this.spawn(r, true).filter(e); } }; function bc(t13, e, r, n) { for (var a = [], i = new vi(), o = t13.cy(), s = o.hasCompoundNodes(), u = 0; u < t13.length; u++) { var l = t13[u]; r ? a.push(l) : s && n(a, i, l); } for (; a.length > 0; ) { var c = a.shift(); e(c), i.add(c.id()), s && n(a, i, c); } return t13; } function Ap(t13, e, r) { if (r.isParent()) for (var n = r._private.children, a = 0; a < n.length; a++) { var i = n[a]; e.has(i.id()) || t13.push(i); } } li.forEachDown = function(t13) { var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; return bc(this, t13, e, Ap); }; function Mp(t13, e, r) { if (r.isChild()) { var n = r._private.parent; e.has(n.id()) || t13.push(n); } } li.forEachUp = function(t13) { var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; return bc(this, t13, e, Mp); }; function xD(t13, e, r) { Mp(t13, e, r), Ap(t13, e, r); } li.forEachUpAndDown = function(t13) { var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; return bc(this, t13, e, xD); }; li.ancestors = li.parents; var lo; var Bp; lo = Bp = { data: et.data({ field: "data", bindingEvent: "data", allowBinding: true, allowSetting: true, settingEvent: "data", settingTriggersEvent: true, triggerFnName: "trigger", allowGetting: true, immutableKeys: { id: true, source: true, target: true, parent: true }, updateStyle: true }), removeData: et.removeData({ field: "data", event: "data", triggerFnName: "trigger", triggerEvent: true, immutableKeys: { id: true, source: true, target: true, parent: true }, updateStyle: true }), scratch: et.data({ field: "scratch", bindingEvent: "scratch", allowBinding: true, allowSetting: true, settingEvent: "scratch", settingTriggersEvent: true, triggerFnName: "trigger", allowGetting: true, updateStyle: true }), removeScratch: et.removeData({ field: "scratch", event: "scratch", triggerFnName: "trigger", triggerEvent: true, updateStyle: true }), rscratch: et.data({ field: "rscratch", allowBinding: false, allowSetting: true, settingTriggersEvent: false, allowGetting: true }), removeRscratch: et.removeData({ field: "rscratch", triggerEvent: false }), id: function() { var e = this[0]; if (e) return e._private.data.id; } }; lo.attr = lo.data; lo.removeAttr = lo.removeData; var CD = Bp; var ll = {}; function Rl(t13) { return function(e) { var r = this; if (e === void 0 && (e = true), r.length !== 0) if (r.isNode() && !r.removed()) { for (var n = 0, a = r[0], i = a._private.edges, o = 0; o < i.length; o++) { var s = i[o]; !e && s.isLoop() || (n += t13(a, s)); } return n; } else return; }; } Re(ll, { degree: Rl(function(t13, e) { return e.source().same(e.target()) ? 2 : 1; }), indegree: Rl(function(t13, e) { return e.target().same(t13) ? 1 : 0; }), outdegree: Rl(function(t13, e) { return e.source().same(t13) ? 1 : 0; }) }); function Aa(t13, e) { return function(r) { for (var n, a = this.nodes(), i = 0; i < a.length; i++) { var o = a[i], s = o[t13](r); s !== void 0 && (n === void 0 || e(s, n)) && (n = s); } return n; }; } Re(ll, { minDegree: Aa("degree", function(t13, e) { return t13 < e; }), maxDegree: Aa("degree", function(t13, e) { return t13 > e; }), minIndegree: Aa("indegree", function(t13, e) { return t13 < e; }), maxIndegree: Aa("indegree", function(t13, e) { return t13 > e; }), minOutdegree: Aa("outdegree", function(t13, e) { return t13 < e; }), maxOutdegree: Aa("outdegree", function(t13, e) { return t13 > e; }) }); Re(ll, { totalDegree: function(e) { for (var r = 0, n = this.nodes(), a = 0; a < n.length; a++) r += n[a].degree(e); return r; } }); var zr; var Np; var $p = function(e, r, n) { for (var a = 0; a < e.length; a++) { var i = e[a]; if (!i.locked()) { var o = i._private.position, s = { x: r.x != null ? r.x - o.x : 0, y: r.y != null ? r.y - o.y : 0 }; i.isParent() && !(s.x === 0 && s.y === 0) && i.children().shift(s, n), i.dirtyBoundingBoxCache(); } } }; var Of = { field: "position", bindingEvent: "position", allowBinding: true, allowSetting: true, settingEvent: "position", settingTriggersEvent: true, triggerFnName: "emitAndNotify", allowGetting: true, validKeys: ["x", "y"], beforeGet: function(e) { e.updateCompoundBounds(); }, beforeSet: function(e, r) { $p(e, r, false); }, onSet: function(e) { e.dirtyCompoundBoundsCache(); }, canSet: function(e) { return !e.locked(); } }; zr = Np = { position: et.data(Of), // position but no notification to renderer silentPosition: et.data(Re({}, Of, { allowBinding: false, allowSetting: true, settingTriggersEvent: false, allowGetting: false, beforeSet: function(e, r) { $p(e, r, true); }, onSet: function(e) { e.dirtyCompoundBoundsCache(); } })), positions: function(e, r) { if (Xe(e)) r ? this.silentPosition(e) : this.position(e); else if (pt(e)) { var n = e, a = this.cy(); a.startBatch(); for (var i = 0; i < this.length; i++) { var o = this[i], s = void 0; (s = n(o, i)) && (r ? o.silentPosition(s) : o.position(s)); } a.endBatch(); } return this; }, silentPositions: function(e) { return this.positions(e, true); }, shift: function(e, r, n) { var a; if (Xe(e) ? (a = { x: be(e.x) ? e.x : 0, y: be(e.y) ? e.y : 0 }, n = r) : Ie(e) && be(r) && (a = { x: 0, y: 0 }, a[e] = r), a != null) { var i = this.cy(); i.startBatch(); for (var o = 0; o < this.length; o++) { var s = this[o]; if (!(i.hasCompoundNodes() && s.isChild() && s.ancestors().anySame(this))) { var u = s.position(), l = { x: u.x + a.x, y: u.y + a.y }; n ? s.silentPosition(l) : s.position(l); } } i.endBatch(); } return this; }, silentShift: function(e, r) { return Xe(e) ? this.shift(e, true) : Ie(e) && be(r) && this.shift(e, r, true), this; }, // get/set the rendered (i.e. on screen) positon of the element renderedPosition: function(e, r) { var n = this[0], a = this.cy(), i = a.zoom(), o = a.pan(), s = Xe(e) ? e : void 0, u = s !== void 0 || r !== void 0 && Ie(e); if (n && n.isNode()) if (u) for (var l = 0; l < this.length; l++) { var c = this[l]; r !== void 0 ? c.position(e, (r - o[e]) / i) : s !== void 0 && c.position(cp(s, i, o)); } else { var d = n.position(); return s = nl(d, i, o), e === void 0 ? s : s[e]; } else if (!u) return; return this; }, // get/set the position relative to the parent relativePosition: function(e, r) { var n = this[0], a = this.cy(), i = Xe(e) ? e : void 0, o = i !== void 0 || r !== void 0 && Ie(e), s = a.hasCompoundNodes(); if (n && n.isNode()) if (o) for (var u = 0; u < this.length; u++) { var l = this[u], c = s ? l.parent() : null, d = c && c.length > 0, v = d; d && (c = c[0]); var h6 = v ? c.position() : { x: 0, y: 0 }; r !== void 0 ? l.position(e, r + h6[e]) : i !== void 0 && l.position({ x: i.x + h6.x, y: i.y + h6.y }); } else { var f = n.position(), p = s ? n.parent() : null, m = p && p.length > 0, g = m; m && (p = p[0]); var y = g ? p.position() : { x: 0, y: 0 }; return i = { x: f.x - y.x, y: f.y - y.y }, e === void 0 ? i : i[e]; } else if (!o) return; return this; } }; zr.modelPosition = zr.point = zr.position; zr.modelPositions = zr.points = zr.positions; zr.renderedPoint = zr.renderedPosition; zr.relativePoint = zr.relativePosition; var ED = Np; var Za; var Xn; Za = Xn = {}; Xn.renderedBoundingBox = function(t13) { var e = this.boundingBox(t13), r = this.cy(), n = r.zoom(), a = r.pan(), i = e.x1 * n + a.x, o = e.x2 * n + a.x, s = e.y1 * n + a.y, u = e.y2 * n + a.y; return { x1: i, x2: o, y1: s, y2: u, w: o - i, h: u - s }; }; Xn.dirtyCompoundBoundsCache = function() { var t13 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false, e = this.cy(); return !e.styleEnabled() || !e.hasCompoundNodes() ? this : (this.forEachUp(function(r) { if (r.isParent()) { var n = r._private; n.compoundBoundsClean = false, n.bbCache = null, t13 || r.emitAndNotify("bounds"); } }), this); }; Xn.updateCompoundBounds = function() { var t13 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false, e = this.cy(); if (!e.styleEnabled() || !e.hasCompoundNodes()) return this; if (!t13 && e.batching()) return this; function r(o) { if (!o.isParent()) return; var s = o._private, u = o.children(), l = o.pstyle("compound-sizing-wrt-labels").value === "include", c = { width: { val: o.pstyle("min-width").pfValue, left: o.pstyle("min-width-bias-left"), right: o.pstyle("min-width-bias-right") }, height: { val: o.pstyle("min-height").pfValue, top: o.pstyle("min-height-bias-top"), bottom: o.pstyle("min-height-bias-bottom") } }, d = u.boundingBox({ includeLabels: l, includeOverlays: false, // updating the compound bounds happens outside of the regular // cache cycle (i.e. before fired events) useCache: false }), v = s.position; (d.w === 0 || d.h === 0) && (d = { w: o.pstyle("width").pfValue, h: o.pstyle("height").pfValue }, d.x1 = v.x - d.w / 2, d.x2 = v.x + d.w / 2, d.y1 = v.y - d.h / 2, d.y2 = v.y + d.h / 2); function h6(k, _, D) { var O = 0, I = 0, L = _ + D; return k > 0 && L > 0 && (O = _ / L * k, I = D / L * k), { biasDiff: O, biasComplementDiff: I }; } function f(k, _, D, O) { if (D.units === "%") switch (O) { case "width": return k > 0 ? D.pfValue * k : 0; case "height": return _ > 0 ? D.pfValue * _ : 0; case "average": return k > 0 && _ > 0 ? D.pfValue * (k + _) / 2 : 0; case "min": return k > 0 && _ > 0 ? k > _ ? D.pfValue * _ : D.pfValue * k : 0; case "max": return k > 0 && _ > 0 ? k > _ ? D.pfValue * k : D.pfValue * _ : 0; default: return 0; } else return D.units === "px" ? D.pfValue : 0; } var p = c.width.left.value; c.width.left.units === "px" && c.width.val > 0 && (p = p * 100 / c.width.val); var m = c.width.right.value; c.width.right.units === "px" && c.width.val > 0 && (m = m * 100 / c.width.val); var g = c.height.top.value; c.height.top.units === "px" && c.height.val > 0 && (g = g * 100 / c.height.val); var y = c.height.bottom.value; c.height.bottom.units === "px" && c.height.val > 0 && (y = y * 100 / c.height.val); var b = h6(c.width.val - d.w, p, m), w = b.biasDiff, C = b.biasComplementDiff, E = h6(c.height.val - d.h, g, y), x = E.biasDiff, T = E.biasComplementDiff; s.autoPadding = f(d.w, d.h, o.pstyle("padding"), o.pstyle("padding-relative-to").value), s.autoWidth = Math.max(d.w, c.width.val), v.x = (-w + d.x1 + d.x2 + C) / 2, s.autoHeight = Math.max(d.h, c.height.val), v.y = (-x + d.y1 + d.y2 + T) / 2; } for (var n = 0; n < this.length; n++) { var a = this[n], i = a._private; (!i.compoundBoundsClean || t13) && (r(a), e.batching() || (i.compoundBoundsClean = true)); } return this; }; var Er = function(e) { return e === 1 / 0 || e === -1 / 0 ? 0 : e; }; var Br = function(e, r, n, a, i) { a - r === 0 || i - n === 0 || r == null || n == null || a == null || i == null || (e.x1 = r < e.x1 ? r : e.x1, e.x2 = a > e.x2 ? a : e.x2, e.y1 = n < e.y1 ? n : e.y1, e.y2 = i > e.y2 ? i : e.y2, e.w = e.x2 - e.x1, e.h = e.y2 - e.y1); }; var ra = function(e, r) { return r == null ? e : Br(e, r.x1, r.y1, r.x2, r.y2); }; var Li = function(e, r, n) { return Nr(e, r, n); }; var Qo = function(e, r, n) { if (!r.cy().headless()) { var a = r._private, i = a.rstyle, o = i.arrowWidth / 2, s = r.pstyle(n + "-arrow-shape").value, u, l; if (s !== "none") { n === "source" ? (u = i.srcX, l = i.srcY) : n === "target" ? (u = i.tgtX, l = i.tgtY) : (u = i.midX, l = i.midY); var c = a.arrowBounds = a.arrowBounds || {}, d = c[n] = c[n] || {}; d.x1 = u - o, d.y1 = l - o, d.x2 = u + o, d.y2 = l + o, d.w = d.x2 - d.x1, d.h = d.y2 - d.y1, us(d, 1), Br(e, d.x1, d.y1, d.x2, d.y2); } } }; var zl = function(e, r, n) { if (!r.cy().headless()) { var a; n ? a = n + "-" : a = ""; var i = r._private, o = i.rstyle, s = r.pstyle(a + "label").strValue; if (s) { var u = r.pstyle("text-halign"), l = r.pstyle("text-valign"), c = Li(o, "labelWidth", n), d = Li(o, "labelHeight", n), v = Li(o, "labelX", n), h6 = Li(o, "labelY", n), f = r.pstyle(a + "text-margin-x").pfValue, p = r.pstyle(a + "text-margin-y").pfValue, m = r.isEdge(), g = r.pstyle(a + "text-rotation"), y = r.pstyle("text-outline-width").pfValue, b = r.pstyle("text-border-width").pfValue, w = b / 2, C = r.pstyle("text-background-padding").pfValue, E = 2, x = d, T = c, k = T / 2, _ = x / 2, D, O, I, L; if (m) D = v - k, O = v + k, I = h6 - _, L = h6 + _; else { switch (u.value) { case "left": D = v - T, O = v; break; case "center": D = v - k, O = v + k; break; case "right": D = v, O = v + T; break; } switch (l.value) { case "top": I = h6 - x, L = h6; break; case "center": I = h6 - _, L = h6 + _; break; case "bottom": I = h6, L = h6 + x; break; } } D += f - Math.max(y, w) - C - E, O += f + Math.max(y, w) + C + E, I += p - Math.max(y, w) - C - E, L += p + Math.max(y, w) + C + E; var B = n || "main", F = i.labelBounds, M = F[B] = F[B] || {}; M.x1 = D, M.y1 = I, M.x2 = O, M.y2 = L, M.w = O - D, M.h = L - I; var A = m && g.strValue === "autorotate", R = g.pfValue != null && g.pfValue !== 0; if (A || R) { var K = A ? Li(i.rstyle, "labelAngle", n) : g.pfValue, H = Math.cos(K), q = Math.sin(K), ee = (D + O) / 2, se = (I + L) / 2; if (!m) { switch (u.value) { case "left": ee = O; break; case "right": ee = D; break; } switch (l.value) { case "top": se = L; break; case "bottom": se = I; break; } } var oe = function(Ee, fe) { return Ee = Ee - ee, fe = fe - se, { x: Ee * H - fe * q + ee, y: Ee * q + fe * H + se }; }, ae = oe(D, I), ue = oe(D, L), te = oe(O, I), $ = oe(O, L); D = Math.min(ae.x, ue.x, te.x, $.x), O = Math.max(ae.x, ue.x, te.x, $.x), I = Math.min(ae.y, ue.y, te.y, $.y), L = Math.max(ae.y, ue.y, te.y, $.y); } var G = B + "Rot", Q = F[G] = F[G] || {}; Q.x1 = D, Q.y1 = I, Q.x2 = O, Q.y2 = L, Q.w = O - D, Q.h = L - I, Br(e, D, I, O, L), Br(i.labelBounds.all, D, I, O, L); } return e; } }; var kD = function(e, r) { if (!r.cy().headless()) { var n = r.pstyle("outline-opacity").value, a = r.pstyle("outline-width").value; if (n > 0 && a > 0) { var i = r.pstyle("outline-offset").value, o = r.pstyle("shape").value, s = a + i, u = (e.w + s * 2) / e.w, l = (e.h + s * 2) / e.h, c = 0, d = 0; ["diamond", "pentagon", "round-triangle"].includes(o) ? (u = (e.w + s * 2.4) / e.w, d = -s / 3.6) : ["concave-hexagon", "rhomboid", "right-rhomboid"].includes(o) ? u = (e.w + s * 2.4) / e.w : o === "star" ? (u = (e.w + s * 2.8) / e.w, l = (e.h + s * 2.6) / e.h, d = -s / 3.8) : o === "triangle" ? (u = (e.w + s * 2.8) / e.w, l = (e.h + s * 2.4) / e.h, d = -s / 1.4) : o === "vee" && (u = (e.w + s * 4.4) / e.w, l = (e.h + s * 3.8) / e.h, d = -s * 0.5); var v = e.h * l - e.h, h6 = e.w * u - e.w; if (cs(e, [Math.ceil(v / 2), Math.ceil(h6 / 2)]), c != 0 || d !== 0) { var f = U5(e, c, d); fp(e, f); } } } }; var SD = function(e, r) { var n = e._private.cy, a = n.styleEnabled(), i = n.headless(), o = pr(), s = e._private, u = e.isNode(), l = e.isEdge(), c, d, v, h6, f, p, m = s.rstyle, g = u && a ? e.pstyle("bounds-expansion").pfValue : [0], y = function(xe) { return xe.pstyle("display").value !== "none"; }, b = !a || y(e) && (!l || y(e.source()) && y(e.target())); if (b) { var w = 0, C = 0; a && r.includeOverlays && (w = e.pstyle("overlay-opacity").value, w !== 0 && (C = e.pstyle("overlay-padding").value)); var E = 0, x = 0; a && r.includeUnderlays && (E = e.pstyle("underlay-opacity").value, E !== 0 && (x = e.pstyle("underlay-padding").value)); var T = Math.max(C, x), k = 0, _ = 0; if (a && (k = e.pstyle("width").pfValue, _ = k / 2), u && r.includeNodes) { var D = e.position(); f = D.x, p = D.y; var O = e.outerWidth(), I = O / 2, L = e.outerHeight(), B = L / 2; c = f - I, d = f + I, v = p - B, h6 = p + B, Br(o, c, v, d, h6), a && r.includeOutlines && kD(o, e); } else if (l && r.includeEdges) if (a && !i) { var F = e.pstyle("curve-style").strValue; if (c = Math.min(m.srcX, m.midX, m.tgtX), d = Math.max(m.srcX, m.midX, m.tgtX), v = Math.min(m.srcY, m.midY, m.tgtY), h6 = Math.max(m.srcY, m.midY, m.tgtY), c -= _, d += _, v -= _, h6 += _, Br(o, c, v, d, h6), F === "haystack") { var M = m.haystackPts; if (M && M.length === 2) { if (c = M[0].x, v = M[0].y, d = M[1].x, h6 = M[1].y, c > d) { var A = c; c = d, d = A; } if (v > h6) { var R = v; v = h6, h6 = R; } Br(o, c - _, v - _, d + _, h6 + _); } } else if (F === "bezier" || F === "unbundled-bezier" || F.endsWith("segments") || F.endsWith("taxi")) { var K; switch (F) { case "bezier": case "unbundled-bezier": K = m.bezierPts; break; case "segments": case "taxi": case "round-segments": case "round-taxi": K = m.linePts; break; } if (K != null) for (var H = 0; H < K.length; H++) { var q = K[H]; c = q.x - _, d = q.x + _, v = q.y - _, h6 = q.y + _, Br(o, c, v, d, h6); } } } else { var ee = e.source(), se = ee.position(), oe = e.target(), ae = oe.position(); if (c = se.x, d = ae.x, v = se.y, h6 = ae.y, c > d) { var ue = c; c = d, d = ue; } if (v > h6) { var te = v; v = h6, h6 = te; } c -= _, d += _, v -= _, h6 += _, Br(o, c, v, d, h6); } if (a && r.includeEdges && l && (Qo(o, e, "mid-source"), Qo(o, e, "mid-target"), Qo(o, e, "source"), Qo(o, e, "target")), a) { var $ = e.pstyle("ghost").value === "yes"; if ($) { var G = e.pstyle("ghost-offset-x").pfValue, Q = e.pstyle("ghost-offset-y").pfValue; Br(o, o.x1 + G, o.y1 + Q, o.x2 + G, o.y2 + Q); } } var ge = s.bodyBounds = s.bodyBounds || {}; uf(ge, o), cs(ge, g), us(ge, 1), a && (c = o.x1, d = o.x2, v = o.y1, h6 = o.y2, Br(o, c - T, v - T, d + T, h6 + T)); var Ee = s.overlayBounds = s.overlayBounds || {}; uf(Ee, o), cs(Ee, g), us(Ee, 1); var fe = s.labelBounds = s.labelBounds || {}; fe.all != null ? K5(fe.all) : fe.all = pr(), a && r.includeLabels && (r.includeMainLabels && zl(o, e, null), l && (r.includeSourceLabels && zl(o, e, "source"), r.includeTargetLabels && zl(o, e, "target"))); } return o.x1 = Er(o.x1), o.y1 = Er(o.y1), o.x2 = Er(o.x2), o.y2 = Er(o.y2), o.w = Er(o.x2 - o.x1), o.h = Er(o.y2 - o.y1), o.w > 0 && o.h > 0 && b && (cs(o, g), us(o, 1)), o; }; var Rp = function(e) { var r = 0, n = function(o) { return (o ? 1 : 0) << r++; }, a = 0; return a += n(e.incudeNodes), a += n(e.includeEdges), a += n(e.includeLabels), a += n(e.includeMainLabels), a += n(e.includeSourceLabels), a += n(e.includeTargetLabels), a += n(e.includeOverlays), a += n(e.includeOutlines), a; }; var zp = function(e) { if (e.isEdge()) { var r = e.source().position(), n = e.target().position(), a = function(o) { return Math.round(o); }; return d5([a(r.x), a(r.y), a(n.x), a(n.y)]); } else return 0; }; var Lf = function(e, r) { var n = e._private, a, i = e.isEdge(), o = r == null ? Ff : Rp(r), s = o === Ff, u = zp(e), l = n.bbCachePosKey === u, c = r.useCache && l, d = function(p) { return p._private.bbCache == null || p._private.styleDirty; }, v = !c || d(e) || i && d(e.source()) || d(e.target()); if (v ? (l || e.recalculateRenderedStyle(c), a = SD(e, uo), n.bbCache = a, n.bbCachePosKey = u) : a = n.bbCache, !s) { var h6 = e.isNode(); a = pr(), (r.includeNodes && h6 || r.includeEdges && !h6) && (r.includeOverlays ? ra(a, n.overlayBounds) : ra(a, n.bodyBounds)), r.includeLabels && (r.includeMainLabels && (!i || r.includeSourceLabels && r.includeTargetLabels) ? ra(a, n.labelBounds.all) : (r.includeMainLabels && ra(a, n.labelBounds.mainRot), r.includeSourceLabels && ra(a, n.labelBounds.sourceRot), r.includeTargetLabels && ra(a, n.labelBounds.targetRot))), a.w = a.x2 - a.x1, a.h = a.y2 - a.y1; } return a; }; var uo = { includeNodes: true, includeEdges: true, includeLabels: true, includeMainLabels: true, includeSourceLabels: true, includeTargetLabels: true, includeOverlays: true, includeUnderlays: true, includeOutlines: true, useCache: true }; var Ff = Rp(uo); var If = Wt(uo); Xn.boundingBox = function(t13) { var e; if (this.length === 1 && this[0]._private.bbCache != null && !this[0]._private.styleDirty && (t13 === void 0 || t13.useCache === void 0 || t13.useCache === true)) t13 === void 0 ? t13 = uo : t13 = If(t13), e = Lf(this[0], t13); else { e = pr(), t13 = t13 || uo; var r = If(t13), n = this, a = n.cy(), i = a.styleEnabled(); if (i) for (var o = 0; o < n.length; o++) { var s = n[o], u = s._private, l = zp(s), c = u.bbCachePosKey === l, d = r.useCache && c && !u.styleDirty; s.recalculateRenderedStyle(d); } this.updateCompoundBounds(!t13.useCache); for (var v = 0; v < n.length; v++) { var h6 = n[v]; ra(e, Lf(h6, r)); } } return e.x1 = Er(e.x1), e.y1 = Er(e.y1), e.x2 = Er(e.x2), e.y2 = Er(e.y2), e.w = Er(e.x2 - e.x1), e.h = Er(e.y2 - e.y1), e; }; Xn.dirtyBoundingBoxCache = function() { for (var t13 = 0; t13 < this.length; t13++) { var e = this[t13]._private; e.bbCache = null, e.bbCachePosKey = null, e.bodyBounds = null, e.overlayBounds = null, e.labelBounds.all = null, e.labelBounds.source = null, e.labelBounds.target = null, e.labelBounds.main = null, e.labelBounds.sourceRot = null, e.labelBounds.targetRot = null, e.labelBounds.mainRot = null, e.arrowBounds.source = null, e.arrowBounds.target = null, e.arrowBounds["mid-source"] = null, e.arrowBounds["mid-target"] = null; } return this.emitAndNotify("bounds"), this; }; Xn.boundingBoxAt = function(t13) { var e = this.nodes(), r = this.cy(), n = r.hasCompoundNodes(), a = r.collection(); if (n && (a = e.filter(function(l) { return l.isParent(); }), e = e.not(a)), Xe(t13)) { var i = t13; t13 = function() { return i; }; } var o = function(c, d) { return c._private.bbAtOldPos = t13(c, d); }, s = function(c) { return c._private.bbAtOldPos; }; r.startBatch(), e.forEach(o).silentPositions(t13), n && (a.dirtyCompoundBoundsCache(), a.dirtyBoundingBoxCache(), a.updateCompoundBounds(true)); var u = q5(this.boundingBox({ useCache: false })); return e.silentPositions(s), n && (a.dirtyCompoundBoundsCache(), a.dirtyBoundingBoxCache(), a.updateCompoundBounds(true)), r.endBatch(), u; }; Za.boundingbox = Za.bb = Za.boundingBox; Za.renderedBoundingbox = Za.renderedBoundingBox; var TD = Xn; var $i; var Lo; $i = Lo = {}; var Vp = function(e) { e.uppercaseName = tf(e.name), e.autoName = "auto" + e.uppercaseName, e.labelName = "label" + e.uppercaseName, e.outerName = "outer" + e.uppercaseName, e.uppercaseOuterName = tf(e.outerName), $i[e.name] = function() { var n = this[0], a = n._private, i = a.cy, o = i._private.styleEnabled; if (n) if (o) { if (n.isParent()) return n.updateCompoundBounds(), a[e.autoName] || 0; var s = n.pstyle(e.name); switch (s.strValue) { case "label": return n.recalculateRenderedStyle(), a.rstyle[e.labelName] || 0; default: return s.pfValue; } } else return 1; }, $i["outer" + e.uppercaseName] = function() { var n = this[0], a = n._private, i = a.cy, o = i._private.styleEnabled; if (n) if (o) { var s = n[e.name](), u = n.pstyle("border-width").pfValue, l = 2 * n.padding(); return s + u + l; } else return 1; }, $i["rendered" + e.uppercaseName] = function() { var n = this[0]; if (n) { var a = n[e.name](); return a * this.cy().zoom(); } }, $i["rendered" + e.uppercaseOuterName] = function() { var n = this[0]; if (n) { var a = n[e.outerName](); return a * this.cy().zoom(); } }; }; Vp({ name: "width" }); Vp({ name: "height" }); Lo.padding = function() { var t13 = this[0], e = t13._private; return t13.isParent() ? (t13.updateCompoundBounds(), e.autoPadding !== void 0 ? e.autoPadding : t13.pstyle("padding").pfValue) : t13.pstyle("padding").pfValue; }; Lo.paddedHeight = function() { var t13 = this[0]; return t13.height() + 2 * t13.padding(); }; Lo.paddedWidth = function() { var t13 = this[0]; return t13.width() + 2 * t13.padding(); }; var _D = Lo; var DD = function(e, r) { if (e.isEdge()) return r(e); }; var PD = function(e, r) { if (e.isEdge()) { var n = e.cy(); return nl(r(e), n.zoom(), n.pan()); } }; var OD = function(e, r) { if (e.isEdge()) { var n = e.cy(), a = n.pan(), i = n.zoom(); return r(e).map(function(o) { return nl(o, i, a); }); } }; var LD = function(e) { return e.renderer().getControlPoints(e); }; var FD = function(e) { return e.renderer().getSegmentPoints(e); }; var ID = function(e) { return e.renderer().getSourceEndpoint(e); }; var AD = function(e) { return e.renderer().getTargetEndpoint(e); }; var MD = function(e) { return e.renderer().getEdgeMidpoint(e); }; var Af = { controlPoints: { get: LD, mult: true }, segmentPoints: { get: FD, mult: true }, sourceEndpoint: { get: ID }, targetEndpoint: { get: AD }, midpoint: { get: MD } }; var BD = function(e) { return "rendered" + e[0].toUpperCase() + e.substr(1); }; var ND = Object.keys(Af).reduce(function(t13, e) { var r = Af[e], n = BD(e); return t13[e] = function() { return DD(this, r.get); }, r.mult ? t13[n] = function() { return OD(this, r.get); } : t13[n] = function() { return PD(this, r.get); }, t13; }, {}); var $D = Re({}, ED, TD, _D, ND); var Hp = function(e, r) { this.recycle(e, r); }; function Fi() { return false; } function Jo() { return true; } Hp.prototype = { instanceString: function() { return "event"; }, recycle: function(e, r) { if (this.isImmediatePropagationStopped = this.isPropagationStopped = this.isDefaultPrevented = Fi, e != null && e.preventDefault ? (this.type = e.type, this.isDefaultPrevented = e.defaultPrevented ? Jo : Fi) : e != null && e.type ? r = e : this.type = e, r != null && (this.originalEvent = r.originalEvent, this.type = r.type != null ? r.type : this.type, this.cy = r.cy, this.target = r.target, this.position = r.position, this.renderedPosition = r.renderedPosition, this.namespace = r.namespace, this.layout = r.layout), this.cy != null && this.position != null && this.renderedPosition == null) { var n = this.position, a = this.cy.zoom(), i = this.cy.pan(); this.renderedPosition = { x: n.x * a + i.x, y: n.y * a + i.y }; } this.timeStamp = e && e.timeStamp || Date.now(); }, preventDefault: function() { this.isDefaultPrevented = Jo; var e = this.originalEvent; e && e.preventDefault && e.preventDefault(); }, stopPropagation: function() { this.isPropagationStopped = Jo; var e = this.originalEvent; e && e.stopPropagation && e.stopPropagation(); }, stopImmediatePropagation: function() { this.isImmediatePropagationStopped = Jo, this.stopPropagation(); }, isDefaultPrevented: Fi, isPropagationStopped: Fi, isImmediatePropagationStopped: Fi }; var qp = /^([^.]+)(\.(?:[^.]+))?$/; var RD = ".*"; var Kp = { qualifierCompare: function(e, r) { return e === r; }, eventMatches: function() { return true; }, addEventFields: function() { }, callbackContext: function(e) { return e; }, beforeEmit: function() { }, afterEmit: function() { }, bubble: function() { return false; }, parent: function() { return null; }, context: null }; var Mf = Object.keys(Kp); var zD = {}; function ul() { for (var t13 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : zD, e = arguments.length > 1 ? arguments[1] : void 0, r = 0; r < Mf.length; r++) { var n = Mf[r]; this[n] = t13[n] || Kp[n]; } this.context = e || this.context, this.listeners = [], this.emitting = 0; } var Wn = ul.prototype; var Up = function(e, r, n, a, i, o, s) { pt(a) && (i = a, a = null), s && (o == null ? o = s : o = Re({}, o, s)); for (var u = st(n) ? n : n.split(/\s+/), l = 0; l < u.length; l++) { var c = u[l]; if (!qn(c)) { var d = c.match(qp); if (d) { var v = d[1], h6 = d[2] ? d[2] : null, f = r(e, c, v, h6, a, i, o); if (f === false) break; } } } }; var Bf = function(e, r) { return e.addEventFields(e.context, r), new Hp(r.type, r); }; var VD = function(e, r, n) { if (sT(n)) { r(e, n); return; } else if (Xe(n)) { r(e, Bf(e, n)); return; } for (var a = st(n) ? n : n.split(/\s+/), i = 0; i < a.length; i++) { var o = a[i]; if (!qn(o)) { var s = o.match(qp); if (s) { var u = s[1], l = s[2] ? s[2] : null, c = Bf(e, { type: u, namespace: l, target: e.context }); r(e, c); } } } }; Wn.on = Wn.addListener = function(t13, e, r, n, a) { return Up(this, function(i, o, s, u, l, c, d) { pt(c) && i.listeners.push({ event: o, // full event string callback: c, // callback to run type: s, // the event type (e.g. 'click') namespace: u, // the event namespace (e.g. ".foo") qualifier: l, // a restriction on whether to match this emitter conf: d // additional configuration }); }, t13, e, r, n, a), this; }; Wn.one = function(t13, e, r, n) { return this.on(t13, e, r, n, { one: true }); }; Wn.removeListener = Wn.off = function(t13, e, r, n) { var a = this; this.emitting !== 0 && (this.listeners = g5(this.listeners)); for (var i = this.listeners, o = function(l) { var c = i[l]; Up(a, function(d, v, h6, f, p, m) { if ((c.type === h6 || t13 === "*") && (!f && c.namespace !== ".*" || c.namespace === f) && (!p || d.qualifierCompare(c.qualifier, p)) && (!m || c.callback === m)) return i.splice(l, 1), false; }, t13, e, r, n); }, s = i.length - 1; s >= 0; s--) o(s); return this; }; Wn.removeAllListeners = function() { return this.removeListener("*"); }; Wn.emit = Wn.trigger = function(t13, e, r) { var n = this.listeners, a = n.length; return this.emitting++, st(e) || (e = [e]), VD(this, function(i, o) { r != null && (n = [{ event: o.event, type: o.type, namespace: o.namespace, callback: r }], a = n.length); for (var s = function(c) { var d = n[c]; if (d.type === o.type && (!d.namespace || d.namespace === o.namespace || d.namespace === RD) && i.eventMatches(i.context, d, o)) { var v = [o]; e != null && y5(v, e), i.beforeEmit(i.context, d, o), d.conf && d.conf.one && (i.listeners = i.listeners.filter(function(p) { return p !== d; })); var h6 = i.callbackContext(i.context, d, o), f = d.callback.apply(h6, v); i.afterEmit(i.context, d, o), f === false && (o.stopPropagation(), o.preventDefault()); } }, u = 0; u < a; u++) s(u); i.bubble(i.context) && !o.isPropagationStopped() && i.parent(i.context).emit(o, e); }, t13), this.emitting--, this; }; var HD = { qualifierCompare: function(e, r) { return e == null || r == null ? e == null && r == null : e.sameText(r); }, eventMatches: function(e, r, n) { var a = r.qualifier; return a != null ? e !== n.target && Do(n.target) && a.matches(n.target) : true; }, addEventFields: function(e, r) { r.cy = e.cy(), r.target = e; }, callbackContext: function(e, r, n) { return r.qualifier != null ? n.target : e; }, beforeEmit: function(e, r) { r.conf && r.conf.once && r.conf.onceCollection.removeListener(r.event, r.qualifier, r.callback); }, bubble: function() { return true; }, parent: function(e) { return e.isChild() ? e.parent() : e.cy(); } }; var es = function(e) { return Ie(e) ? new Un(e) : e; }; var Gp = { createEmitter: function() { for (var e = 0; e < this.length; e++) { var r = this[e], n = r._private; n.emitter || (n.emitter = new ul(HD, r)); } return this; }, emitter: function() { return this._private.emitter; }, on: function(e, r, n) { for (var a = es(r), i = 0; i < this.length; i++) { var o = this[i]; o.emitter().on(e, a, n); } return this; }, removeListener: function(e, r, n) { for (var a = es(r), i = 0; i < this.length; i++) { var o = this[i]; o.emitter().removeListener(e, a, n); } return this; }, removeAllListeners: function() { for (var e = 0; e < this.length; e++) { var r = this[e]; r.emitter().removeAllListeners(); } return this; }, one: function(e, r, n) { for (var a = es(r), i = 0; i < this.length; i++) { var o = this[i]; o.emitter().one(e, a, n); } return this; }, once: function(e, r, n) { for (var a = es(r), i = 0; i < this.length; i++) { var o = this[i]; o.emitter().on(e, a, n, { once: true, onceCollection: this }); } }, emit: function(e, r) { for (var n = 0; n < this.length; n++) { var a = this[n]; a.emitter().emit(e, r); } return this; }, emitAndNotify: function(e, r) { if (this.length !== 0) return this.cy().notify(e, this), this.emit(e, r), this; } }; et.eventAliasesOn(Gp); var Wp = { nodes: function(e) { return this.filter(function(r) { return r.isNode(); }).filter(e); }, edges: function(e) { return this.filter(function(r) { return r.isEdge(); }).filter(e); }, // internal helper to get nodes and edges as separate collections with single iteration over elements byGroup: function() { for (var e = this.spawn(), r = this.spawn(), n = 0; n < this.length; n++) { var a = this[n]; a.isNode() ? e.push(a) : r.push(a); } return { nodes: e, edges: r }; }, filter: function(e, r) { if (e === void 0) return this; if (Ie(e) || yr(e)) return new Un(e).filter(this); if (pt(e)) { for (var n = this.spawn(), a = this, i = 0; i < a.length; i++) { var o = a[i], s = r ? e.apply(r, [o, i, a]) : e(o, i, a); s && n.push(o); } return n; } return this.spawn(); }, not: function(e) { if (e) { Ie(e) && (e = this.filter(e)); for (var r = this.spawn(), n = 0; n < this.length; n++) { var a = this[n], i = e.has(a); i || r.push(a); } return r; } else return this; }, absoluteComplement: function() { var e = this.cy(); return e.mutableElements().not(this); }, intersect: function(e) { if (Ie(e)) { var r = e; return this.filter(r); } for (var n = this.spawn(), a = this, i = e, o = this.length < e.length, s = o ? a : i, u = o ? i : a, l = 0; l < s.length; l++) { var c = s[l]; u.has(c) && n.push(c); } return n; }, xor: function(e) { var r = this._private.cy; Ie(e) && (e = r.$(e)); var n = this.spawn(), a = this, i = e, o = function(u, l) { for (var c = 0; c < u.length; c++) { var d = u[c], v = d._private.data.id, h6 = l.hasElementWithId(v); h6 || n.push(d); } }; return o(a, i), o(i, a), n; }, diff: function(e) { var r = this._private.cy; Ie(e) && (e = r.$(e)); var n = this.spawn(), a = this.spawn(), i = this.spawn(), o = this, s = e, u = function(c, d, v) { for (var h6 = 0; h6 < c.length; h6++) { var f = c[h6], p = f._private.data.id, m = d.hasElementWithId(p); m ? i.merge(f) : v.push(f); } }; return u(o, s, n), u(s, o, a), { left: n, right: a, both: i }; }, add: function(e) { var r = this._private.cy; if (!e) return this; if (Ie(e)) { var n = e; e = r.mutableElements().filter(n); } for (var a = this.spawnSelf(), i = 0; i < e.length; i++) { var o = e[i], s = !this.has(o); s && a.push(o); } return a; }, // in place merge on calling collection merge: function(e) { var r = this._private, n = r.cy; if (!e) return this; if (e && Ie(e)) { var a = e; e = n.mutableElements().filter(a); } for (var i = r.map, o = 0; o < e.length; o++) { var s = e[o], u = s._private.data.id, l = !i.has(u); if (l) { var c = this.length++; this[c] = s, i.set(u, { ele: s, index: c }); } } return this; }, unmergeAt: function(e) { var r = this[e], n = r.id(), a = this._private, i = a.map; this[e] = void 0, i.delete(n); var o = e === this.length - 1; if (this.length > 1 && !o) { var s = this.length - 1, u = this[s], l = u._private.data.id; this[s] = void 0, this[e] = u, i.set(l, { ele: u, index: e }); } return this.length--, this; }, // remove single ele in place in calling collection unmergeOne: function(e) { e = e[0]; var r = this._private, n = e._private.data.id, a = r.map, i = a.get(n); if (!i) return this; var o = i.index; return this.unmergeAt(o), this; }, // remove eles in place on calling collection unmerge: function(e) { var r = this._private.cy; if (!e) return this; if (e && Ie(e)) { var n = e; e = r.mutableElements().filter(n); } for (var a = 0; a < e.length; a++) this.unmergeOne(e[a]); return this; }, unmergeBy: function(e) { for (var r = this.length - 1; r >= 0; r--) { var n = this[r]; e(n) && this.unmergeAt(r); } return this; }, map: function(e, r) { for (var n = [], a = this, i = 0; i < a.length; i++) { var o = a[i], s = r ? e.apply(r, [o, i, a]) : e(o, i, a); n.push(s); } return n; }, reduce: function(e, r) { for (var n = r, a = this, i = 0; i < a.length; i++) n = e(n, a[i], i, a); return n; }, max: function(e, r) { for (var n = -1 / 0, a, i = this, o = 0; o < i.length; o++) { var s = i[o], u = r ? e.apply(r, [s, o, i]) : e(s, o, i); u > n && (n = u, a = s); } return { value: n, ele: a }; }, min: function(e, r) { for (var n = 1 / 0, a, i = this, o = 0; o < i.length; o++) { var s = i[o], u = r ? e.apply(r, [s, o, i]) : e(s, o, i); u < n && (n = u, a = s); } return { value: n, ele: a }; } }; var Je = Wp; Je.u = Je["|"] = Je["+"] = Je.union = Je.or = Je.add; Je["\\"] = Je["!"] = Je["-"] = Je.difference = Je.relativeComplement = Je.subtract = Je.not; Je.n = Je["&"] = Je["."] = Je.and = Je.intersection = Je.intersect; Je["^"] = Je["(+)"] = Je["(-)"] = Je.symmetricDifference = Je.symdiff = Je.xor; Je.fnFilter = Je.filterFn = Je.stdFilter = Je.filter; Je.complement = Je.abscomp = Je.absoluteComplement; var qD = { isNode: function() { return this.group() === "nodes"; }, isEdge: function() { return this.group() === "edges"; }, isLoop: function() { return this.isEdge() && this.source()[0] === this.target()[0]; }, isSimple: function() { return this.isEdge() && this.source()[0] !== this.target()[0]; }, group: function() { var e = this[0]; if (e) return e._private.group; } }; var Yp = function(e, r) { var n = e.cy(), a = n.hasCompoundNodes(); function i(c) { var d = c.pstyle("z-compound-depth"); return d.value === "auto" ? a ? c.zDepth() : 0 : d.value === "bottom" ? -1 : d.value === "top" ? lc : 0; } var o = i(e) - i(r); if (o !== 0) return o; function s(c) { var d = c.pstyle("z-index-compare"); return d.value === "auto" && c.isNode() ? 1 : 0; } var u = s(e) - s(r); if (u !== 0) return u; var l = e.pstyle("z-index").value - r.pstyle("z-index").value; return l !== 0 ? l : e.poolIndex() - r.poolIndex(); }; var As = { forEach: function(e, r) { if (pt(e)) for (var n = this.length, a = 0; a < n; a++) { var i = this[a], o = r ? e.apply(r, [i, a, this]) : e(i, a, this); if (o === false) break; } return this; }, toArray: function() { for (var e = [], r = 0; r < this.length; r++) e.push(this[r]); return e; }, slice: function(e, r) { var n = [], a = this.length; r == null && (r = a), e == null && (e = 0), e < 0 && (e = a + e), r < 0 && (r = a + r); for (var i = e; i >= 0 && i < r && i < a; i++) n.push(this[i]); return this.spawn(n); }, size: function() { return this.length; }, eq: function(e) { return this[e] || this.spawn(); }, first: function() { return this[0] || this.spawn(); }, last: function() { return this[this.length - 1] || this.spawn(); }, empty: function() { return this.length === 0; }, nonempty: function() { return !this.empty(); }, sort: function(e) { if (!pt(e)) return this; var r = this.toArray().sort(e); return this.spawn(r); }, sortByZIndex: function() { return this.sort(Yp); }, zDepth: function() { var e = this[0]; if (e) { var r = e._private, n = r.group; if (n === "nodes") { var a = r.data.parent ? e.parents().size() : 0; return e.isParent() ? a : lc - 1; } else { var i = r.source, o = r.target, s = i.zDepth(), u = o.zDepth(); return Math.max(s, u, 0); } } } }; As.each = As.forEach; var KD = function() { var e = "undefined", r = (typeof Symbol > "u" ? "undefined" : It(Symbol)) != e && It(Symbol.iterator) != e; r && (As[Symbol.iterator] = function() { var n = this, a = { value: void 0, done: false }, i = 0, o = this.length; return Kh({ next: function() { return i < o ? a.value = n[i++] : (a.value = void 0, a.done = true), a; } }, Symbol.iterator, function() { return this; }); }); }; KD(); var UD = Wt({ nodeDimensionsIncludeLabels: false }); var fs = { // Calculates and returns node dimensions { x, y } based on options given layoutDimensions: function(e) { e = UD(e); var r; if (!this.takesUpSpace()) r = { w: 0, h: 0 }; else if (e.nodeDimensionsIncludeLabels) { var n = this.boundingBox(); r = { w: n.w, h: n.h }; } else r = { w: this.outerWidth(), h: this.outerHeight() }; return (r.w === 0 || r.h === 0) && (r.w = r.h = 1), r; }, // using standard layout options, apply position function (w/ or w/o animation) layoutPositions: function(e, r, n) { var a = this.nodes().filter(function(C) { return !C.isParent(); }), i = this.cy(), o = r.eles, s = function(E) { return E.id(); }, u = to(n, s); e.emit({ type: "layoutstart", layout: e }), e.animations = []; var l = function(E, x, T) { var k = { x: x.x1 + x.w / 2, y: x.y1 + x.h / 2 }, _ = { // scale from center of bounding box (not necessarily 0,0) x: (T.x - k.x) * E, y: (T.y - k.y) * E }; return { x: k.x + _.x, y: k.y + _.y }; }, c = r.spacingFactor && r.spacingFactor !== 1, d = function() { if (!c) return null; for (var E = pr(), x = 0; x < a.length; x++) { var T = a[x], k = u(T, x); G5(E, k.x, k.y); } return E; }, v = d(), h6 = to(function(C, E) { var x = u(C, E); if (c) { var T = Math.abs(r.spacingFactor); x = l(T, v, x); } return r.transform != null && (x = r.transform(C, x)), x; }, s); if (r.animate) { for (var f = 0; f < a.length; f++) { var p = a[f], m = h6(p, f), g = r.animateFilter == null || r.animateFilter(p, f); if (g) { var y = p.animation({ position: m, duration: r.animationDuration, easing: r.animationEasing }); e.animations.push(y); } else p.position(m); } if (r.fit) { var b = i.animation({ fit: { boundingBox: o.boundingBoxAt(h6), padding: r.padding }, duration: r.animationDuration, easing: r.animationEasing }); e.animations.push(b); } else if (r.zoom !== void 0 && r.pan !== void 0) { var w = i.animation({ zoom: r.zoom, pan: r.pan, duration: r.animationDuration, easing: r.animationEasing }); e.animations.push(w); } e.animations.forEach(function(C) { return C.play(); }), e.one("layoutready", r.ready), e.emit({ type: "layoutready", layout: e }), hi.all(e.animations.map(function(C) { return C.promise(); })).then(function() { e.one("layoutstop", r.stop), e.emit({ type: "layoutstop", layout: e }); }); } else a.positions(h6), r.fit && i.fit(r.eles, r.padding), r.zoom != null && i.zoom(r.zoom), r.pan && i.pan(r.pan), e.one("layoutready", r.ready), e.emit({ type: "layoutready", layout: e }), e.one("layoutstop", r.stop), e.emit({ type: "layoutstop", layout: e }); return this; }, layout: function(e) { var r = this.cy(); return r.makeLayout(Re({}, e, { eles: this })); } }; fs.createLayout = fs.makeLayout = fs.layout; function Zp(t13, e, r) { var n = r._private, a = n.styleCache = n.styleCache || [], i; return (i = a[t13]) != null || (i = a[t13] = e(r)), i; } function cl(t13, e) { return t13 = ma(t13), function(n) { return Zp(t13, e, n); }; } function dl(t13, e) { t13 = ma(t13); var r = function(a) { return e.call(a); }; return function() { var a = this[0]; if (a) return Zp(t13, r, a); }; } var Ut = { recalculateRenderedStyle: function(e) { var r = this.cy(), n = r.renderer(), a = r.styleEnabled(); return n && a && n.recalculateRenderedStyle(this, e), this; }, dirtyStyleCache: function() { var e = this.cy(), r = function(i) { return i._private.styleCache = null; }; if (e.hasCompoundNodes()) { var n; n = this.spawnSelf().merge(this.descendants()).merge(this.parents()), n.merge(n.connectedEdges()), n.forEach(r); } else this.forEach(function(a) { r(a), a.connectedEdges().forEach(r); }); return this; }, // fully updates (recalculates) the style for the elements updateStyle: function(e) { var r = this._private.cy; if (!r.styleEnabled()) return this; if (r.batching()) { var n = r._private.batchStyleEles; return n.merge(this), this; } var a = r.hasCompoundNodes(), i = this; e = !!(e || e === void 0), a && (i = this.spawnSelf().merge(this.descendants()).merge(this.parents())); var o = i; return e ? o.emitAndNotify("style") : o.emit("style"), i.forEach(function(s) { return s._private.styleDirty = true; }), this; }, // private: clears dirty flag and recalculates style cleanStyle: function() { var e = this.cy(); if (e.styleEnabled()) for (var r = 0; r < this.length; r++) { var n = this[r]; n._private.styleDirty && (n._private.styleDirty = false, e.style().apply(n)); } }, // get the internal parsed style object for the specified property parsedStyle: function(e) { var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true, n = this[0], a = n.cy(); if (a.styleEnabled() && n) { this.cleanStyle(); var i = n._private.style[e]; return i ?? (r ? a.style().getDefaultProperty(e) : null); } }, numericStyle: function(e) { var r = this[0]; if (r.cy().styleEnabled() && r) { var n = r.pstyle(e); return n.pfValue !== void 0 ? n.pfValue : n.value; } }, numericStyleUnits: function(e) { var r = this[0]; if (r.cy().styleEnabled() && r) return r.pstyle(e).units; }, // get the specified css property as a rendered value (i.e. on-screen value) // or get the whole rendered style if no property specified (NB doesn't allow setting) renderedStyle: function(e) { var r = this.cy(); if (!r.styleEnabled()) return this; var n = this[0]; if (n) return r.style().getRenderedStyle(n, e); }, // read the calculated css style of the element or override the style (via a bypass) style: function(e, r) { var n = this.cy(); if (!n.styleEnabled()) return this; var a = false, i = n.style(); if (Xe(e)) { var o = e; i.applyBypass(this, o, a), this.emitAndNotify("style"); } else if (Ie(e)) if (r === void 0) { var s = this[0]; return s ? i.getStylePropertyValue(s, e) : void 0; } else i.applyBypass(this, e, r, a), this.emitAndNotify("style"); else if (e === void 0) { var u = this[0]; return u ? i.getRawStyle(u) : void 0; } return this; }, removeStyle: function(e) { var r = this.cy(); if (!r.styleEnabled()) return this; var n = false, a = r.style(), i = this; if (e === void 0) for (var o = 0; o < i.length; o++) { var s = i[o]; a.removeAllBypasses(s, n); } else { e = e.split(/\s+/); for (var u = 0; u < i.length; u++) { var l = i[u]; a.removeBypasses(l, e, n); } } return this.emitAndNotify("style"), this; }, show: function() { return this.css("display", "element"), this; }, hide: function() { return this.css("display", "none"), this; }, effectiveOpacity: function() { var e = this.cy(); if (!e.styleEnabled()) return 1; var r = e.hasCompoundNodes(), n = this[0]; if (n) { var a = n._private, i = n.pstyle("opacity").value; if (!r) return i; var o = a.data.parent ? n.parents() : null; if (o) for (var s = 0; s < o.length; s++) { var u = o[s], l = u.pstyle("opacity").value; i = l * i; } return i; } }, transparent: function() { var e = this.cy(); if (!e.styleEnabled()) return false; var r = this[0], n = r.cy().hasCompoundNodes(); if (r) return n ? r.effectiveOpacity() === 0 : r.pstyle("opacity").value === 0; }, backgrounding: function() { var e = this.cy(); if (!e.styleEnabled()) return false; var r = this[0]; return !!r._private.backgrounding; } }; function Vl(t13, e) { var r = t13._private, n = r.data.parent ? t13.parents() : null; if (n) for (var a = 0; a < n.length; a++) { var i = n[a]; if (!e(i)) return false; } return true; } function wc(t13) { var e = t13.ok, r = t13.edgeOkViaNode || t13.ok, n = t13.parentOk || t13.ok; return function() { var a = this.cy(); if (!a.styleEnabled()) return true; var i = this[0], o = a.hasCompoundNodes(); if (i) { var s = i._private; if (!e(i)) return false; if (i.isNode()) return !o || Vl(i, n); var u = s.source, l = s.target; return r(u) && (!o || Vl(u, r)) && (u === l || r(l) && (!o || Vl(l, r))); } }; } var yi = cl("eleTakesUpSpace", function(t13) { return t13.pstyle("display").value === "element" && t13.width() !== 0 && (t13.isNode() ? t13.height() !== 0 : true); }); Ut.takesUpSpace = dl("takesUpSpace", wc({ ok: yi })); var GD = cl("eleInteractive", function(t13) { return t13.pstyle("events").value === "yes" && t13.pstyle("visibility").value === "visible" && yi(t13); }); var WD = cl("parentInteractive", function(t13) { return t13.pstyle("visibility").value === "visible" && yi(t13); }); Ut.interactive = dl("interactive", wc({ ok: GD, parentOk: WD, edgeOkViaNode: yi })); Ut.noninteractive = function() { var t13 = this[0]; if (t13) return !t13.interactive(); }; var YD = cl("eleVisible", function(t13) { return t13.pstyle("visibility").value === "visible" && t13.pstyle("opacity").pfValue !== 0 && yi(t13); }); var ZD = yi; Ut.visible = dl("visible", wc({ ok: YD, edgeOkViaNode: ZD })); Ut.hidden = function() { var t13 = this[0]; if (t13) return !t13.visible(); }; Ut.isBundledBezier = dl("isBundledBezier", function() { return this.cy().styleEnabled() ? !this.removed() && this.pstyle("curve-style").value === "bezier" && this.takesUpSpace() : false; }); Ut.bypass = Ut.css = Ut.style; Ut.renderedCss = Ut.renderedStyle; Ut.removeBypass = Ut.removeCss = Ut.removeStyle; Ut.pstyle = Ut.parsedStyle; var zn = {}; function Nf(t13) { return function() { var e = arguments, r = []; if (e.length === 2) { var n = e[0], a = e[1]; this.on(t13.event, n, a); } else if (e.length === 1 && pt(e[0])) { var i = e[0]; this.on(t13.event, i); } else if (e.length === 0 || e.length === 1 && st(e[0])) { for (var o = e.length === 1 ? e[0] : null, s = 0; s < this.length; s++) { var u = this[s], l = !t13.ableField || u._private[t13.ableField], c = u._private[t13.field] != t13.value; if (t13.overrideAble) { var d = t13.overrideAble(u); if (d !== void 0 && (l = d, !d)) return this; } l && (u._private[t13.field] = t13.value, c && r.push(u)); } var v = this.spawn(r); v.updateStyle(), v.emit(t13.event), o && v.emit(o); } return this; }; } function bi(t13) { zn[t13.field] = function() { var e = this[0]; if (e) { if (t13.overrideField) { var r = t13.overrideField(e); if (r !== void 0) return r; } return e._private[t13.field]; } }, zn[t13.on] = Nf({ event: t13.on, field: t13.field, ableField: t13.ableField, overrideAble: t13.overrideAble, value: true }), zn[t13.off] = Nf({ event: t13.off, field: t13.field, ableField: t13.ableField, overrideAble: t13.overrideAble, value: false }); } bi({ field: "locked", overrideField: function(e) { return e.cy().autolock() ? true : void 0; }, on: "lock", off: "unlock" }); bi({ field: "grabbable", overrideField: function(e) { return e.cy().autoungrabify() || e.pannable() ? false : void 0; }, on: "grabify", off: "ungrabify" }); bi({ field: "selected", ableField: "selectable", overrideAble: function(e) { return e.cy().autounselectify() ? false : void 0; }, on: "select", off: "unselect" }); bi({ field: "selectable", overrideField: function(e) { return e.cy().autounselectify() ? false : void 0; }, on: "selectify", off: "unselectify" }); zn.deselect = zn.unselect; zn.grabbed = function() { var t13 = this[0]; if (t13) return t13._private.grabbed; }; bi({ field: "active", on: "activate", off: "unactivate" }); bi({ field: "pannable", on: "panify", off: "unpanify" }); zn.inactive = function() { var t13 = this[0]; if (t13) return !t13._private.active; }; var nr = {}; var $f = function(e) { return function(n) { for (var a = this, i = [], o = 0; o < a.length; o++) { var s = a[o]; if (s.isNode()) { for (var u = false, l = s.connectedEdges(), c = 0; c < l.length; c++) { var d = l[c], v = d.source(), h6 = d.target(); if (e.noIncomingEdges && h6 === s && v !== s || e.noOutgoingEdges && v === s && h6 !== s) { u = true; break; } } u || i.push(s); } } return this.spawn(i, true).filter(n); }; }; var Rf = function(e) { return function(r) { for (var n = this, a = [], i = 0; i < n.length; i++) { var o = n[i]; if (o.isNode()) for (var s = o.connectedEdges(), u = 0; u < s.length; u++) { var l = s[u], c = l.source(), d = l.target(); e.outgoing && c === o ? (a.push(l), a.push(d)) : e.incoming && d === o && (a.push(l), a.push(c)); } } return this.spawn(a, true).filter(r); }; }; var zf = function(e) { return function(r) { for (var n = this, a = [], i = {}; ; ) { var o = e.outgoing ? n.outgoers() : n.incomers(); if (o.length === 0) break; for (var s = false, u = 0; u < o.length; u++) { var l = o[u], c = l.id(); i[c] || (i[c] = true, a.push(l), s = true); } if (!s) break; n = o; } return this.spawn(a, true).filter(r); }; }; nr.clearTraversalCache = function() { for (var t13 = 0; t13 < this.length; t13++) this[t13]._private.traversalCache = null; }; Re(nr, { // get the root nodes in the DAG roots: $f({ noIncomingEdges: true }), // get the leaf nodes in the DAG leaves: $f({ noOutgoingEdges: true }), // normally called children in graph theory // these nodes =edges=> outgoing nodes outgoers: Sr(Rf({ outgoing: true }), "outgoers"), // aka DAG descendants successors: zf({ outgoing: true }), // normally called parents in graph theory // these nodes <=edges= incoming nodes incomers: Sr(Rf({ incoming: true }), "incomers"), // aka DAG ancestors predecessors: zf({ incoming: true }) }); Re(nr, { neighborhood: Sr(function(t13) { for (var e = [], r = this.nodes(), n = 0; n < r.length; n++) for (var a = r[n], i = a.connectedEdges(), o = 0; o < i.length; o++) { var s = i[o], u = s.source(), l = s.target(), c = a === u ? l : u; c.length > 0 && e.push(c[0]), e.push(s[0]); } return this.spawn(e, true).filter(t13); }, "neighborhood"), closedNeighborhood: function(e) { return this.neighborhood().add(this).filter(e); }, openNeighborhood: function(e) { return this.neighborhood(e); } }); nr.neighbourhood = nr.neighborhood; nr.closedNeighbourhood = nr.closedNeighborhood; nr.openNeighbourhood = nr.openNeighborhood; Re(nr, { source: Sr(function(e) { var r = this[0], n; return r && (n = r._private.source || r.cy().collection()), n && e ? n.filter(e) : n; }, "source"), target: Sr(function(e) { var r = this[0], n; return r && (n = r._private.target || r.cy().collection()), n && e ? n.filter(e) : n; }, "target"), sources: Vf({ attr: "source" }), targets: Vf({ attr: "target" }) }); function Vf(t13) { return function(r) { for (var n = [], a = 0; a < this.length; a++) { var i = this[a], o = i._private[t13.attr]; o && n.push(o); } return this.spawn(n, true).filter(r); }; } Re(nr, { edgesWith: Sr(Hf(), "edgesWith"), edgesTo: Sr(Hf({ thisIsSrc: true }), "edgesTo") }); function Hf(t13) { return function(r) { var n = [], a = this._private.cy, i = t13 || {}; Ie(r) && (r = a.$(r)); for (var o = 0; o < r.length; o++) for (var s = r[o]._private.edges, u = 0; u < s.length; u++) { var l = s[u], c = l._private.data, d = this.hasElementWithId(c.source) && r.hasElementWithId(c.target), v = r.hasElementWithId(c.source) && this.hasElementWithId(c.target), h6 = d || v; h6 && ((i.thisIsSrc || i.thisIsTgt) && (i.thisIsSrc && !d || i.thisIsTgt && !v) || n.push(l)); } return this.spawn(n, true); }; } Re(nr, { connectedEdges: Sr(function(t13) { for (var e = [], r = this, n = 0; n < r.length; n++) { var a = r[n]; if (a.isNode()) for (var i = a._private.edges, o = 0; o < i.length; o++) { var s = i[o]; e.push(s); } } return this.spawn(e, true).filter(t13); }, "connectedEdges"), connectedNodes: Sr(function(t13) { for (var e = [], r = this, n = 0; n < r.length; n++) { var a = r[n]; a.isEdge() && (e.push(a.source()[0]), e.push(a.target()[0])); } return this.spawn(e, true).filter(t13); }, "connectedNodes"), parallelEdges: Sr(qf(), "parallelEdges"), codirectedEdges: Sr(qf({ codirected: true }), "codirectedEdges") }); function qf(t13) { var e = { codirected: false }; return t13 = Re({}, e, t13), function(n) { for (var a = [], i = this.edges(), o = t13, s = 0; s < i.length; s++) for (var u = i[s], l = u._private, c = l.source, d = c._private.data.id, v = l.data.target, h6 = c._private.edges, f = 0; f < h6.length; f++) { var p = h6[f], m = p._private.data, g = m.target, y = m.source, b = g === v && y === d, w = d === g && v === y; (o.codirected && b || !o.codirected && (b || w)) && a.push(p); } return this.spawn(a, true).filter(n); }; } Re(nr, { components: function(e) { var r = this, n = r.cy(), a = n.collection(), i = e == null ? r.nodes() : e.nodes(), o = []; e != null && i.empty() && (i = e.sources()); var s = function(c, d) { a.merge(c), i.unmerge(c), d.merge(c); }; if (i.empty()) return r.spawn(); var u = function() { var c = n.collection(); o.push(c); var d = i[0]; s(d, c), r.bfs({ directed: false, roots: d, visit: function(h6) { return s(h6, c); } }), c.forEach(function(v) { v.connectedEdges().forEach(function(h6) { r.has(h6) && c.has(h6.source()) && c.has(h6.target()) && c.merge(h6); }); }); }; do u(); while (i.length > 0); return o; }, component: function() { var e = this[0]; return e.cy().mutableElements().components(e)[0]; } }); nr.componentsOf = nr.components; var Gt = function(e, r) { var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false, a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false; if (e === void 0) { yt("A collection must have a reference to the core"); return; } var i = new Xr(), o = false; if (!r) r = []; else if (r.length > 0 && Xe(r[0]) && !Do(r[0])) { o = true; for (var s = [], u = new vi(), l = 0, c = r.length; l < c; l++) { var d = r[l]; d.data == null && (d.data = {}); var v = d.data; if (v.id == null) v.id = lp(); else if (e.hasElementWithId(v.id) || u.has(v.id)) continue; var h6 = new rl(e, d, false); s.push(h6), u.add(v.id); } r = s; } this.length = 0; for (var f = 0, p = r.length; f < p; f++) { var m = r[f][0]; if (m != null) { var g = m._private.data.id; (!n || !i.has(g)) && (n && i.set(g, { index: this.length, ele: m }), this[this.length] = m, this.length++); } } this._private = { eles: this, cy: e, get map() { return this.lazyMap == null && this.rebuildMap(), this.lazyMap; }, set map(y) { this.lazyMap = y; }, rebuildMap: function() { for (var b = this.lazyMap = new Xr(), w = this.eles, C = 0; C < w.length; C++) { var E = w[C]; b.set(E.id(), { index: C, ele: E }); } } }, n && (this._private.map = i), o && !a && this.restore(); }; var dt = rl.prototype = Gt.prototype = Object.create(Array.prototype); dt.instanceString = function() { return "collection"; }; dt.spawn = function(t13, e) { return new Gt(this.cy(), t13, e); }; dt.spawnSelf = function() { return this.spawn(this); }; dt.cy = function() { return this._private.cy; }; dt.renderer = function() { return this._private.cy.renderer(); }; dt.element = function() { return this[0]; }; dt.collection = function() { return Yh(this) ? this : new Gt(this._private.cy, [this]); }; dt.unique = function() { return new Gt(this._private.cy, this, true); }; dt.hasElementWithId = function(t13) { return t13 = "" + t13, this._private.map.has(t13); }; dt.getElementById = function(t13) { t13 = "" + t13; var e = this._private.cy, r = this._private.map.get(t13); return r ? r.ele : new Gt(e); }; dt.$id = dt.getElementById; dt.poolIndex = function() { var t13 = this._private.cy, e = t13._private.elements, r = this[0]._private.data.id; return e._private.map.get(r).index; }; dt.indexOf = function(t13) { var e = t13[0]._private.data.id; return this._private.map.get(e).index; }; dt.indexOfId = function(t13) { return t13 = "" + t13, this._private.map.get(t13).index; }; dt.json = function(t13) { var e = this.element(), r = this.cy(); if (e == null && t13) return this; if (e != null) { var n = e._private; if (Xe(t13)) { if (r.startBatch(), t13.data) { e.data(t13.data); var a = n.data; if (e.isEdge()) { var i = false, o = {}, s = t13.data.source, u = t13.data.target; s != null && s != a.source && (o.source = "" + s, i = true), u != null && u != a.target && (o.target = "" + u, i = true), i && (e = e.move(o)); } else { var l = "parent" in t13.data, c = t13.data.parent; l && (c != null || a.parent != null) && c != a.parent && (c === void 0 && (c = null), c != null && (c = "" + c), e = e.move({ parent: c })); } } t13.position && e.position(t13.position); var d = function(p, m, g) { var y = t13[p]; y != null && y !== n[p] && (y ? e[m]() : e[g]()); }; return d("removed", "remove", "restore"), d("selected", "select", "unselect"), d("selectable", "selectify", "unselectify"), d("locked", "lock", "unlock"), d("grabbable", "grabify", "ungrabify"), d("pannable", "panify", "unpanify"), t13.classes != null && e.classes(t13.classes), r.endBatch(), this; } else if (t13 === void 0) { var v = { data: Zr(n.data), position: Zr(n.position), group: n.group, removed: n.removed, selected: n.selected, selectable: n.selectable, locked: n.locked, grabbable: n.grabbable, pannable: n.pannable, classes: null }; v.classes = ""; var h6 = 0; return n.classes.forEach(function(f) { return v.classes += h6++ === 0 ? f : " " + f; }), v; } } }; dt.jsons = function() { for (var t13 = [], e = 0; e < this.length; e++) { var r = this[e], n = r.json(); t13.push(n); } return t13; }; dt.clone = function() { for (var t13 = this.cy(), e = [], r = 0; r < this.length; r++) { var n = this[r], a = n.json(), i = new rl(t13, a, false); e.push(i); } return new Gt(t13, e); }; dt.copy = dt.clone; dt.restore = function() { for (var t13 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true, r = this, n = r.cy(), a = n._private, i = [], o = [], s, u = 0, l = r.length; u < l; u++) { var c = r[u]; e && !c.removed() || (c.isNode() ? i.push(c) : o.push(c)); } s = i.concat(o); var d, v = function() { s.splice(d, 1), d--; }; for (d = 0; d < s.length; d++) { var h6 = s[d], f = h6._private, p = f.data; if (h6.clearTraversalCache(), !(!e && !f.removed)) { if (p.id === void 0) p.id = lp(); else if (be(p.id)) p.id = "" + p.id; else if (qn(p.id) || !Ie(p.id)) { yt("Can not create element with invalid string ID `" + p.id + "`"), v(); continue; } else if (n.hasElementWithId(p.id)) { yt("Can not create second element with ID `" + p.id + "`"), v(); continue; } } var m = p.id; if (h6.isNode()) { var g = f.position; g.x == null && (g.x = 0), g.y == null && (g.y = 0); } if (h6.isEdge()) { for (var y = h6, b = ["source", "target"], w = b.length, C = false, E = 0; E < w; E++) { var x = b[E], T = p[x]; be(T) && (T = p[x] = "" + p[x]), T == null || T === "" ? (yt("Can not create edge `" + m + "` with unspecified " + x), C = true) : n.hasElementWithId(T) || (yt("Can not create edge `" + m + "` with nonexistant " + x + " `" + T + "`"), C = true); } if (C) { v(); continue; } var k = n.getElementById(p.source), _ = n.getElementById(p.target); k.same(_) ? k._private.edges.push(y) : (k._private.edges.push(y), _._private.edges.push(y)), y._private.source = k, y._private.target = _; } f.map = new Xr(), f.map.set(m, { ele: h6, index: 0 }), f.removed = false, e && n.addToPool(h6); } for (var D = 0; D < i.length; D++) { var O = i[D], I = O._private.data; be(I.parent) && (I.parent = "" + I.parent); var L = I.parent, B = L != null; if (B || O._private.parent) { var F = O._private.parent ? n.collection().merge(O._private.parent) : n.getElementById(L); if (F.empty()) I.parent = void 0; else if (F[0].removed()) tt("Node added with missing parent, reference to parent removed"), I.parent = void 0, O._private.parent = null; else { for (var M = false, A = F; !A.empty(); ) { if (O.same(A)) { M = true, I.parent = void 0; break; } A = A.parent(); } M || (F[0]._private.children.push(O), O._private.parent = F[0], a.hasCompoundNodes = true); } } } if (s.length > 0) { for (var R = s.length === r.length ? r : new Gt(n, s), K = 0; K < R.length; K++) { var H = R[K]; H.isNode() || (H.parallelEdges().clearTraversalCache(), H.source().clearTraversalCache(), H.target().clearTraversalCache()); } var q; a.hasCompoundNodes ? q = n.collection().merge(R).merge(R.connectedNodes()).merge(R.parent()) : q = R, q.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t13), t13 ? R.emitAndNotify("add") : e && R.emit("add"); } return r; }; dt.removed = function() { var t13 = this[0]; return t13 && t13._private.removed; }; dt.inside = function() { var t13 = this[0]; return t13 && !t13._private.removed; }; dt.remove = function() { var t13 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true, r = this, n = [], a = {}, i = r._private.cy; function o(L) { for (var B = L._private.edges, F = 0; F < B.length; F++) u(B[F]); } function s(L) { for (var B = L._private.children, F = 0; F < B.length; F++) u(B[F]); } function u(L) { var B = a[L.id()]; e && L.removed() || B || (a[L.id()] = true, L.isNode() ? (n.push(L), o(L), s(L)) : n.unshift(L)); } for (var l = 0, c = r.length; l < c; l++) { var d = r[l]; u(d); } function v(L, B) { var F = L._private.edges; Kn(F, B), L.clearTraversalCache(); } function h6(L) { L.clearTraversalCache(); } var f = []; f.ids = {}; function p(L, B) { B = B[0], L = L[0]; var F = L._private.children, M = L.id(); Kn(F, B), B._private.parent = null, f.ids[M] || (f.ids[M] = true, f.push(L)); } r.dirtyCompoundBoundsCache(), e && i.removeFromPool(n); for (var m = 0; m < n.length; m++) { var g = n[m]; if (g.isEdge()) { var y = g.source()[0], b = g.target()[0]; v(y, g), v(b, g); for (var w = g.parallelEdges(), C = 0; C < w.length; C++) { var E = w[C]; h6(E), E.isBundledBezier() && E.dirtyBoundingBoxCache(); } } else { var x = g.parent(); x.length !== 0 && p(x, g); } e && (g._private.removed = true); } var T = i._private.elements; i._private.hasCompoundNodes = false; for (var k = 0; k < T.length; k++) { var _ = T[k]; if (_.isParent()) { i._private.hasCompoundNodes = true; break; } } var D = new Gt(this.cy(), n); D.size() > 0 && (t13 ? D.emitAndNotify("remove") : e && D.emit("remove")); for (var O = 0; O < f.length; O++) { var I = f[O]; (!e || !I.removed()) && I.updateStyle(); } return D; }; dt.move = function(t13) { var e = this._private.cy, r = this, n = false, a = false, i = function(f) { return f == null ? f : "" + f; }; if (t13.source !== void 0 || t13.target !== void 0) { var o = i(t13.source), s = i(t13.target), u = o != null && e.hasElementWithId(o), l = s != null && e.hasElementWithId(s); (u || l) && (e.batch(function() { r.remove(n, a), r.emitAndNotify("moveout"); for (var h6 = 0; h6 < r.length; h6++) { var f = r[h6], p = f._private.data; f.isEdge() && (u && (p.source = o), l && (p.target = s)); } r.restore(n, a); }), r.emitAndNotify("move")); } else if (t13.parent !== void 0) { var c = i(t13.parent), d = c === null || e.hasElementWithId(c); if (d) { var v = c === null ? void 0 : c; e.batch(function() { var h6 = r.remove(n, a); h6.emitAndNotify("moveout"); for (var f = 0; f < r.length; f++) { var p = r[f], m = p._private.data; p.isNode() && (m.parent = v); } h6.restore(n, a); }), r.emitAndNotify("move"); } } return this; }; [xp, oD, ds, Rn, li, CD, ll, $D, Gp, Wp, qD, As, fs, Ut, zn, nr].forEach(function(t13) { Re(dt, t13); }); var XD = { add: function(e) { var r, n = this; if (yr(e)) { var a = e; if (a._private.cy === n) r = a.restore(); else { for (var i = [], o = 0; o < a.length; o++) { var s = a[o]; i.push(s.json()); } r = new Gt(n, i); } } else if (st(e)) { var u = e; r = new Gt(n, u); } else if (Xe(e) && (st(e.nodes) || st(e.edges))) { for (var l = e, c = [], d = ["nodes", "edges"], v = 0, h6 = d.length; v < h6; v++) { var f = d[v], p = l[f]; if (st(p)) for (var m = 0, g = p.length; m < g; m++) { var y = Re({ group: f }, p[m]); c.push(y); } } r = new Gt(n, c); } else { var b = e; r = new rl(n, b).collection(); } return r; }, remove: function(e) { if (!yr(e)) { if (Ie(e)) { var r = e; e = this.$(r); } } return e.remove(); } }; function jD(t13, e, r, n) { var a = 4, i = 1e-3, o = 1e-7, s = 10, u = 11, l = 1 / (u - 1), c = typeof Float32Array < "u"; if (arguments.length !== 4) return false; for (var d = 0; d < 4; ++d) if (typeof arguments[d] != "number" || isNaN(arguments[d]) || !isFinite(arguments[d])) return false; t13 = Math.min(t13, 1), r = Math.min(r, 1), t13 = Math.max(t13, 0), r = Math.max(r, 0); var v = c ? new Float32Array(u) : new Array(u); function h6(_, D) { return 1 - 3 * D + 3 * _; } function f(_, D) { return 3 * D - 6 * _; } function p(_) { return 3 * _; } function m(_, D, O) { return ((h6(D, O) * _ + f(D, O)) * _ + p(D)) * _; } function g(_, D, O) { return 3 * h6(D, O) * _ * _ + 2 * f(D, O) * _ + p(D); } function y(_, D) { for (var O = 0; O < a; ++O) { var I = g(D, t13, r); if (I === 0) return D; var L = m(D, t13, r) - _; D -= L / I; } return D; } function b() { for (var _ = 0; _ < u; ++_) v[_] = m(_ * l, t13, r); } function w(_, D, O) { var I, L, B = 0; do L = D + (O - D) / 2, I = m(L, t13, r) - _, I > 0 ? O = L : D = L; while (Math.abs(I) > o && ++B < s); return L; } function C(_) { for (var D = 0, O = 1, I = u - 1; O !== I && v[O] <= _; ++O) D += l; --O; var L = (_ - v[O]) / (v[O + 1] - v[O]), B = D + L * l, F = g(B, t13, r); return F >= i ? y(_, B) : F === 0 ? B : w(_, D, D + l); } var E = false; function x() { E = true, (t13 !== e || r !== n) && b(); } var T = function(D) { return E || x(), t13 === e && r === n ? D : D === 0 ? 0 : D === 1 ? 1 : m(C(D), e, n); }; T.getControlPoints = function() { return [{ x: t13, y: e }, { x: r, y: n }]; }; var k = "generateBezier(" + [t13, e, r, n] + ")"; return T.toString = function() { return k; }, T; } var QD = /* @__PURE__ */ function() { function t13(n) { return -n.tension * n.x - n.friction * n.v; } function e(n, a, i) { var o = { x: n.x + i.dx * a, v: n.v + i.dv * a, tension: n.tension, friction: n.friction }; return { dx: o.v, dv: t13(o) }; } function r(n, a) { var i = { dx: n.v, dv: t13(n) }, o = e(n, a * 0.5, i), s = e(n, a * 0.5, o), u = e(n, a, s), l = 1 / 6 * (i.dx + 2 * (o.dx + s.dx) + u.dx), c = 1 / 6 * (i.dv + 2 * (o.dv + s.dv) + u.dv); return n.x = n.x + l * a, n.v = n.v + c * a, n; } return function n(a, i, o) { var s = { x: -1, v: 0, tension: null, friction: null }, u = [0], l = 0, c = 1 / 1e4, d = 16 / 1e3, v, h6, f; for (a = parseFloat(a) || 500, i = parseFloat(i) || 20, o = o || null, s.tension = a, s.friction = i, v = o !== null, v ? (l = n(a, i), h6 = l / o * d) : h6 = d; f = r(f || s, h6), u.push(1 + f.x), l += 16, Math.abs(f.x) > c && Math.abs(f.v) > c; ) ; return v ? function(p) { return u[p * (u.length - 1) | 0]; } : l; }; }(); var ct = function(e, r, n, a) { var i = jD(e, r, n, a); return function(o, s, u) { return o + (s - o) * i(u); }; }; var vs = { linear: function(e, r, n) { return e + (r - e) * n; }, // default easings ease: ct(0.25, 0.1, 0.25, 1), "ease-in": ct(0.42, 0, 1, 1), "ease-out": ct(0, 0, 0.58, 1), "ease-in-out": ct(0.42, 0, 0.58, 1), // sine "ease-in-sine": ct(0.47, 0, 0.745, 0.715), "ease-out-sine": ct(0.39, 0.575, 0.565, 1), "ease-in-out-sine": ct(0.445, 0.05, 0.55, 0.95), // quad "ease-in-quad": ct(0.55, 0.085, 0.68, 0.53), "ease-out-quad": ct(0.25, 0.46, 0.45, 0.94), "ease-in-out-quad": ct(0.455, 0.03, 0.515, 0.955), // cubic "ease-in-cubic": ct(0.55, 0.055, 0.675, 0.19), "ease-out-cubic": ct(0.215, 0.61, 0.355, 1), "ease-in-out-cubic": ct(0.645, 0.045, 0.355, 1), // quart "ease-in-quart": ct(0.895, 0.03, 0.685, 0.22), "ease-out-quart": ct(0.165, 0.84, 0.44, 1), "ease-in-out-quart": ct(0.77, 0, 0.175, 1), // quint "ease-in-quint": ct(0.755, 0.05, 0.855, 0.06), "ease-out-quint": ct(0.23, 1, 0.32, 1), "ease-in-out-quint": ct(0.86, 0, 0.07, 1), // expo "ease-in-expo": ct(0.95, 0.05, 0.795, 0.035), "ease-out-expo": ct(0.19, 1, 0.22, 1), "ease-in-out-expo": ct(1, 0, 0, 1), // circ "ease-in-circ": ct(0.6, 0.04, 0.98, 0.335), "ease-out-circ": ct(0.075, 0.82, 0.165, 1), "ease-in-out-circ": ct(0.785, 0.135, 0.15, 0.86), // user param easings... spring: function(e, r, n) { if (n === 0) return vs.linear; var a = QD(e, r, n); return function(i, o, s) { return i + (o - i) * a(s); }; }, "cubic-bezier": ct }; function Kf(t13, e, r, n, a) { if (n === 1 || e === r) return r; var i = a(e, r, n); return t13 == null || ((t13.roundValue || t13.color) && (i = Math.round(i)), t13.min !== void 0 && (i = Math.max(i, t13.min)), t13.max !== void 0 && (i = Math.min(i, t13.max))), i; } function Uf(t13, e) { return t13.pfValue != null || t13.value != null ? t13.pfValue != null && (e == null || e.type.units !== "%") ? t13.pfValue : t13.value : t13; } function Ma(t13, e, r, n, a) { var i = a != null ? a.type : null; r < 0 ? r = 0 : r > 1 && (r = 1); var o = Uf(t13, a), s = Uf(e, a); if (be(o) && be(s)) return Kf(i, o, s, r, n); if (st(o) && st(s)) { for (var u = [], l = 0; l < s.length; l++) { var c = o[l], d = s[l]; if (c != null && d != null) { var v = Kf(i, c, d, r, n); u.push(v); } else u.push(d); } return u; } } function JD(t13, e, r, n) { var a = !n, i = t13._private, o = e._private, s = o.easing, u = o.startTime, l = n ? t13 : t13.cy(), c = l.style(); if (!o.easingImpl) if (s == null) o.easingImpl = vs.linear; else { var d; if (Ie(s)) { var v = c.parse("transition-timing-function", s); d = v.value; } else d = s; var h6, f; Ie(d) ? (h6 = d, f = []) : (h6 = d[1], f = d.slice(2).map(function(R) { return +R; })), f.length > 0 ? (h6 === "spring" && f.push(o.duration), o.easingImpl = vs[h6].apply(null, f)) : o.easingImpl = vs[h6]; } var p = o.easingImpl, m; if (o.duration === 0 ? m = 1 : m = (r - u) / o.duration, o.applying && (m = o.progress), m < 0 ? m = 0 : m > 1 && (m = 1), o.delay == null) { var g = o.startPosition, y = o.position; if (y && a && !t13.locked()) { var b = {}; Ii(g.x, y.x) && (b.x = Ma(g.x, y.x, m, p)), Ii(g.y, y.y) && (b.y = Ma(g.y, y.y, m, p)), t13.position(b); } var w = o.startPan, C = o.pan, E = i.pan, x = C != null && n; x && (Ii(w.x, C.x) && (E.x = Ma(w.x, C.x, m, p)), Ii(w.y, C.y) && (E.y = Ma(w.y, C.y, m, p)), t13.emit("pan")); var T = o.startZoom, k = o.zoom, _ = k != null && n; _ && (Ii(T, k) && (i.zoom = io(i.minZoom, Ma(T, k, m, p), i.maxZoom)), t13.emit("zoom")), (x || _) && t13.emit("viewport"); var D = o.style; if (D && D.length > 0 && a) { for (var O = 0; O < D.length; O++) { var I = D[O], L = I.name, B = I, F = o.startStyle[L], M = c.properties[F.name], A = Ma(F, B, m, p, M); c.overrideBypass(t13, L, A); } t13.emit("style"); } } return o.progress = m, m; } function Ii(t13, e) { return t13 == null || e == null ? false : be(t13) && be(e) ? true : !!(t13 && e); } function eP(t13, e, r, n) { var a = e._private; a.started = true, a.startTime = r - a.progress * a.duration; } function Gf(t13, e) { var r = e._private.aniEles, n = []; function a(c, d) { var v = c._private, h6 = v.animation.current, f = v.animation.queue, p = false; if (h6.length === 0) { var m = f.shift(); m && h6.push(m); } for (var g = function(E) { for (var x = E.length - 1; x >= 0; x--) { var T = E[x]; T(); } E.splice(0, E.length); }, y = h6.length - 1; y >= 0; y--) { var b = h6[y], w = b._private; if (w.stopped) { h6.splice(y, 1), w.hooked = false, w.playing = false, w.started = false, g(w.frames); continue; } !w.playing && !w.applying || (w.playing && w.applying && (w.applying = false), w.started || eP(c, b, t13), JD(c, b, t13, d), w.applying && (w.applying = false), g(w.frames), w.step != null && w.step(t13), b.completed() && (h6.splice(y, 1), w.hooked = false, w.playing = false, w.started = false, g(w.completes)), p = true); } return !d && h6.length === 0 && f.length === 0 && n.push(c), p; } for (var i = false, o = 0; o < r.length; o++) { var s = r[o], u = a(s); i = i || u; } var l = a(e, true); (i || l) && (r.length > 0 ? e.notify("draw", r) : e.notify("draw")), r.unmerge(n), e.emit("step"); } var tP = { // pull in animation functions animate: et.animate(), animation: et.animation(), animated: et.animated(), clearQueue: et.clearQueue(), delay: et.delay(), delayAnimation: et.delayAnimation(), stop: et.stop(), addToAnimationPool: function(e) { var r = this; r.styleEnabled() && r._private.aniEles.merge(e); }, stopAnimationLoop: function() { this._private.animationsRunning = false; }, startAnimationLoop: function() { var e = this; if (e._private.animationsRunning = true, !e.styleEnabled()) return; function r() { e._private.animationsRunning && Ps(function(i) { Gf(i, e), r(); }); } var n = e.renderer(); n && n.beforeRender ? n.beforeRender(function(i, o) { Gf(o, e); }, n.beforeRenderPriorities.animations) : r(); } }; var rP = { qualifierCompare: function(e, r) { return e == null || r == null ? e == null && r == null : e.sameText(r); }, eventMatches: function(e, r, n) { var a = r.qualifier; return a != null ? e !== n.target && Do(n.target) && a.matches(n.target) : true; }, addEventFields: function(e, r) { r.cy = e, r.target = e; }, callbackContext: function(e, r, n) { return r.qualifier != null ? n.target : e; } }; var ts = function(e) { return Ie(e) ? new Un(e) : e; }; var Xp = { createEmitter: function() { var e = this._private; return e.emitter || (e.emitter = new ul(rP, this)), this; }, emitter: function() { return this._private.emitter; }, on: function(e, r, n) { return this.emitter().on(e, ts(r), n), this; }, removeListener: function(e, r, n) { return this.emitter().removeListener(e, ts(r), n), this; }, removeAllListeners: function() { return this.emitter().removeAllListeners(), this; }, one: function(e, r, n) { return this.emitter().one(e, ts(r), n), this; }, once: function(e, r, n) { return this.emitter().one(e, ts(r), n), this; }, emit: function(e, r) { return this.emitter().emit(e, r), this; }, emitAndNotify: function(e, r) { return this.emit(e), this.notify(e, r), this; } }; et.eventAliasesOn(Xp); var vu = { png: function(e) { var r = this._private.renderer; return e = e || {}, r.png(e); }, jpg: function(e) { var r = this._private.renderer; return e = e || {}, e.bg = e.bg || "#fff", r.jpg(e); } }; vu.jpeg = vu.jpg; var hs = { layout: function(e) { var r = this; if (e == null) { yt("Layout options must be specified to make a layout"); return; } if (e.name == null) { yt("A `name` must be specified to make a layout"); return; } var n = e.name, a = r.extension("layout", n); if (a == null) { yt("No such layout `" + n + "` found. Did you forget to import it and `cytoscape.use()` it?"); return; } var i; Ie(e.eles) ? i = r.$(e.eles) : i = e.eles != null ? e.eles : r.$(); var o = new a(Re({}, e, { cy: r, eles: i })); return o; } }; hs.createLayout = hs.makeLayout = hs.layout; var nP = { notify: function(e, r) { var n = this._private; if (this.batching()) { n.batchNotifications = n.batchNotifications || {}; var a = n.batchNotifications[e] = n.batchNotifications[e] || this.collection(); r != null && a.merge(r); return; } if (n.notificationsEnabled) { var i = this.renderer(); this.destroyed() || !i || i.notify(e, r); } }, notifications: function(e) { var r = this._private; return e === void 0 ? r.notificationsEnabled : (r.notificationsEnabled = !!e, this); }, noNotifications: function(e) { this.notifications(false), e(), this.notifications(true); }, batching: function() { return this._private.batchCount > 0; }, startBatch: function() { var e = this._private; return e.batchCount == null && (e.batchCount = 0), e.batchCount === 0 && (e.batchStyleEles = this.collection(), e.batchNotifications = {}), e.batchCount++, this; }, endBatch: function() { var e = this._private; if (e.batchCount === 0) return this; if (e.batchCount--, e.batchCount === 0) { e.batchStyleEles.updateStyle(); var r = this.renderer(); Object.keys(e.batchNotifications).forEach(function(n) { var a = e.batchNotifications[n]; a.empty() ? r.notify(n) : r.notify(n, a); }); } return this; }, batch: function(e) { return this.startBatch(), e(), this.endBatch(), this; }, // for backwards compatibility batchData: function(e) { var r = this; return this.batch(function() { for (var n = Object.keys(e), a = 0; a < n.length; a++) { var i = n[a], o = e[i], s = r.getElementById(i); s.data(o); } }); } }; var aP = Wt({ hideEdgesOnViewport: false, textureOnViewport: false, motionBlur: false, motionBlurOpacity: 0.05, pixelRatio: void 0, desktopTapThreshold: 4, touchTapThreshold: 8, wheelSensitivity: 1, debug: false, showFps: false }); var hu = { renderTo: function(e, r, n, a) { var i = this._private.renderer; return i.renderTo(e, r, n, a), this; }, renderer: function() { return this._private.renderer; }, forceRender: function() { return this.notify("draw"), this; }, resize: function() { return this.invalidateSize(), this.emitAndNotify("resize"), this; }, initRenderer: function(e) { var r = this, n = r.extension("renderer", e.name); if (n == null) { yt("Can not initialise: No such renderer `".concat(e.name, "` found. Did you forget to import it and `cytoscape.use()` it?")); return; } e.wheelSensitivity !== void 0 && tt("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine."); var a = aP(e); a.cy = r, r._private.renderer = new n(a), this.notify("init"); }, destroyRenderer: function() { var e = this; e.notify("destroy"); var r = e.container(); if (r) for (r._cyreg = null; r.childNodes.length > 0; ) r.removeChild(r.childNodes[0]); e._private.renderer = null, e.mutableElements().forEach(function(n) { var a = n._private; a.rscratch = {}, a.rstyle = {}, a.animation.current = [], a.animation.queue = []; }); }, onRender: function(e) { return this.on("render", e); }, offRender: function(e) { return this.off("render", e); } }; hu.invalidateDimensions = hu.resize; var ps = { // get a collection // - empty collection on no args // - collection of elements in the graph on selector arg // - guarantee a returned collection when elements or collection specified collection: function(e, r) { return Ie(e) ? this.$(e) : yr(e) ? e.collection() : st(e) ? (r || (r = {}), new Gt(this, e, r.unique, r.removed)) : new Gt(this); }, nodes: function(e) { var r = this.$(function(n) { return n.isNode(); }); return e ? r.filter(e) : r; }, edges: function(e) { var r = this.$(function(n) { return n.isEdge(); }); return e ? r.filter(e) : r; }, // search the graph like jQuery $: function(e) { var r = this._private.elements; return e ? r.filter(e) : r.spawnSelf(); }, mutableElements: function() { return this._private.elements; } }; ps.elements = ps.filter = ps.$; var ir = {}; var Ki = "t"; var iP = "f"; ir.apply = function(t13) { for (var e = this, r = e._private, n = r.cy, a = n.collection(), i = 0; i < t13.length; i++) { var o = t13[i], s = e.getContextMeta(o); if (!s.empty) { var u = e.getContextStyle(s), l = e.applyContextStyle(s, u, o); o._private.appliedInitStyle ? e.updateTransitions(o, l.diffProps) : o._private.appliedInitStyle = true; var c = e.updateStyleHints(o); c && a.push(o); } } return a; }; ir.getPropertiesDiff = function(t13, e) { var r = this, n = r._private.propDiffs = r._private.propDiffs || {}, a = t13 + "-" + e, i = n[a]; if (i) return i; for (var o = [], s = {}, u = 0; u < r.length; u++) { var l = r[u], c = t13[u] === Ki, d = e[u] === Ki, v = c !== d, h6 = l.mappedProperties.length > 0; if (v || d && h6) { var f = void 0; v && h6 || v ? f = l.properties : h6 && (f = l.mappedProperties); for (var p = 0; p < f.length; p++) { for (var m = f[p], g = m.name, y = false, b = u + 1; b < r.length; b++) { var w = r[b], C = e[b] === Ki; if (C && (y = w.properties[m.name] != null, y)) break; } !s[g] && !y && (s[g] = true, o.push(g)); } } } return n[a] = o, o; }; ir.getContextMeta = function(t13) { for (var e = this, r = "", n, a = t13._private.styleCxtKey || "", i = 0; i < e.length; i++) { var o = e[i], s = o.selector && o.selector.matches(t13); s ? r += Ki : r += iP; } return n = e.getPropertiesDiff(a, r), t13._private.styleCxtKey = r, { key: r, diffPropNames: n, empty: n.length === 0 }; }; ir.getContextStyle = function(t13) { var e = t13.key, r = this, n = this._private.contextStyles = this._private.contextStyles || {}; if (n[e]) return n[e]; for (var a = { _private: { key: e } }, i = 0; i < r.length; i++) { var o = r[i], s = e[i] === Ki; if (s) for (var u = 0; u < o.properties.length; u++) { var l = o.properties[u]; a[l.name] = l; } } return n[e] = a, a; }; ir.applyContextStyle = function(t13, e, r) { for (var n = this, a = t13.diffPropNames, i = {}, o = n.types, s = 0; s < a.length; s++) { var u = a[s], l = e[u], c = r.pstyle(u); if (!l) if (c) c.bypass ? l = { name: u, deleteBypassed: true } : l = { name: u, delete: true }; else continue; if (c !== l) { if (l.mapped === o.fn && c != null && c.mapping != null && c.mapping.value === l.value) { var d = c.mapping, v = d.fnValue = l.value(r); if (v === d.prevFnValue) continue; } var h6 = i[u] = { prev: c }; n.applyParsedProperty(r, l), h6.next = r.pstyle(u), h6.next && h6.next.bypass && (h6.next = h6.next.bypassed); } } return { diffProps: i }; }; ir.updateStyleHints = function(t13) { var e = t13._private, r = this, n = r.propertyGroupNames, a = r.propertyGroupKeys, i = function(Q, ge, Ee) { return r.getPropertiesHash(Q, ge, Ee); }, o = e.styleKey; if (t13.removed()) return false; var s = e.group === "nodes", u = t13._private.style; n = Object.keys(u); for (var l = 0; l < a.length; l++) { var c = a[l]; e.styleKeys[c] = [Va, Bi]; } for (var d = function(Q, ge) { return e.styleKeys[ge][0] = ro(Q, e.styleKeys[ge][0]); }, v = function(Q, ge) { return e.styleKeys[ge][1] = no(Q, e.styleKeys[ge][1]); }, h6 = function(Q, ge) { d(Q, ge), v(Q, ge); }, f = function(Q, ge) { for (var Ee = 0; Ee < Q.length; Ee++) { var fe = Q.charCodeAt(Ee); d(fe, ge), v(fe, ge); } }, p = 2e9, m = function(Q) { return -128 < Q && Q < 128 && Math.floor(Q) !== Q ? p - (Q * 1024 | 0) : Q; }, g = 0; g < n.length; g++) { var y = n[g], b = u[y]; if (b != null) { var w = this.properties[y], C = w.type, E = w.groupKey, x = void 0; w.hashOverride != null ? x = w.hashOverride(t13, b) : b.pfValue != null && (x = b.pfValue); var T = w.enums == null ? b.value : null, k = x != null, _ = T != null, D = k || _, O = b.units; if (C.number && D && !C.multiple) { var I = k ? x : T; h6(m(I), E), !k && O != null && f(O, E); } else f(b.strValue, E); } } for (var L = [Va, Bi], B = 0; B < a.length; B++) { var F = a[B], M = e.styleKeys[F]; L[0] = ro(M[0], L[0]), L[1] = no(M[1], L[1]); } e.styleKey = c5(L[0], L[1]); var A = e.styleKeys; e.labelDimsKey = Dn(A.labelDimensions); var R = i(t13, ["label"], A.labelDimensions); if (e.labelKey = Dn(R), e.labelStyleKey = Dn(Go(A.commonLabel, R)), !s) { var K = i(t13, ["source-label"], A.labelDimensions); e.sourceLabelKey = Dn(K), e.sourceLabelStyleKey = Dn(Go(A.commonLabel, K)); var H = i(t13, ["target-label"], A.labelDimensions); e.targetLabelKey = Dn(H), e.targetLabelStyleKey = Dn(Go(A.commonLabel, H)); } if (s) { var q = e.styleKeys, ee = q.nodeBody, se = q.nodeBorder, oe = q.nodeOutline, ae = q.backgroundImage, ue = q.compound, te = q.pie, $ = [ee, se, oe, ae, ue, te].filter(function(G) { return G != null; }).reduce(Go, [Va, Bi]); e.nodeKey = Dn($), e.hasPie = te != null && te[0] !== Va && te[1] !== Bi; } return o !== e.styleKey; }; ir.clearStyleHints = function(t13) { var e = t13._private; e.styleCxtKey = "", e.styleKeys = {}, e.styleKey = null, e.labelKey = null, e.labelStyleKey = null, e.sourceLabelKey = null, e.sourceLabelStyleKey = null, e.targetLabelKey = null, e.targetLabelStyleKey = null, e.nodeKey = null, e.hasPie = null; }; ir.applyParsedProperty = function(t13, e) { var r = this, n = e, a = t13._private.style, i, o = r.types, s = r.properties[n.name].type, u = n.bypass, l = a[n.name], c = l && l.bypass, d = t13._private, v = "mapping", h6 = function(ee) { return ee == null ? null : ee.pfValue != null ? ee.pfValue : ee.value; }, f = function() { var ee = h6(l), se = h6(n); r.checkTriggers(t13, n.name, ee, se); }; if (e.name === "curve-style" && t13.isEdge() && // loops must be bundled beziers (e.value !== "bezier" && t13.isLoop() || // edges connected to compound nodes can not be haystacks e.value === "haystack" && (t13.source().isParent() || t13.target().isParent())) && (n = e = this.parse(e.name, "bezier", u)), n.delete) return a[n.name] = void 0, f(), true; if (n.deleteBypassed) return l ? l.bypass ? (l.bypassed = void 0, f(), true) : false : (f(), true); if (n.deleteBypass) return l ? l.bypass ? (a[n.name] = l.bypassed, f(), true) : false : (f(), true); var p = function() { tt("Do not assign mappings to elements without corresponding data (i.e. ele `" + t13.id() + "` has no mapping for property `" + n.name + "` with data field `" + n.field + "`); try a `[" + n.field + "]` selector to limit scope to elements with `" + n.field + "` defined"); }; switch (n.mapped) { case o.mapData: { for (var m = n.field.split("."), g = d.data, y = 0; y < m.length && g; y++) { var b = m[y]; g = g[b]; } if (g == null) return p(), false; var w; if (be(g)) { var C = n.fieldMax - n.fieldMin; C === 0 ? w = 0 : w = (g - n.fieldMin) / C; } else return tt("Do not use continuous mappers without specifying numeric data (i.e. `" + n.field + ": " + g + "` for `" + t13.id() + "` is non-numeric)"), false; if (w < 0 ? w = 0 : w > 1 && (w = 1), s.color) { var E = n.valueMin[0], x = n.valueMax[0], T = n.valueMin[1], k = n.valueMax[1], _ = n.valueMin[2], D = n.valueMax[2], O = n.valueMin[3] == null ? 1 : n.valueMin[3], I = n.valueMax[3] == null ? 1 : n.valueMax[3], L = [Math.round(E + (x - E) * w), Math.round(T + (k - T) * w), Math.round(_ + (D - _) * w), Math.round(O + (I - O) * w)]; i = { // colours are simple, so just create the flat property instead of expensive string parsing bypass: n.bypass, // we're a bypass if the mapping property is a bypass name: n.name, value: L, strValue: "rgb(" + L[0] + ", " + L[1] + ", " + L[2] + ")" }; } else if (s.number) { var B = n.valueMin + (n.valueMax - n.valueMin) * w; i = this.parse(n.name, B, n.bypass, v); } else return false; if (!i) return p(), false; i.mapping = n, n = i; break; } case o.data: { for (var F = n.field.split("."), M = d.data, A = 0; A < F.length && M; A++) { var R = F[A]; M = M[R]; } if (M != null && (i = this.parse(n.name, M, n.bypass, v)), !i) return p(), false; i.mapping = n, n = i; break; } case o.fn: { var K = n.value, H = n.fnValue != null ? n.fnValue : K(t13); if (n.prevFnValue = H, H == null) return tt("Custom function mappers may not return null (i.e. `" + n.name + "` for ele `" + t13.id() + "` is null)"), false; if (i = this.parse(n.name, H, n.bypass, v), !i) return tt("Custom function mappers may not return invalid values for the property type (i.e. `" + n.name + "` for ele `" + t13.id() + "` is invalid)"), false; i.mapping = Zr(n), n = i; break; } case void 0: break; default: return false; } return u ? (c ? n.bypassed = l.bypassed : n.bypassed = l, a[n.name] = n) : c ? l.bypassed = n : a[n.name] = n, f(), true; }; ir.cleanElements = function(t13, e) { for (var r = 0; r < t13.length; r++) { var n = t13[r]; if (this.clearStyleHints(n), n.dirtyCompoundBoundsCache(), n.dirtyBoundingBoxCache(), !e) n._private.style = {}; else for (var a = n._private.style, i = Object.keys(a), o = 0; o < i.length; o++) { var s = i[o], u = a[s]; u != null && (u.bypass ? u.bypassed = null : a[s] = null); } } }; ir.update = function() { var t13 = this._private.cy, e = t13.mutableElements(); e.updateStyle(); }; ir.updateTransitions = function(t13, e) { var r = this, n = t13._private, a = t13.pstyle("transition-property").value, i = t13.pstyle("transition-duration").pfValue, o = t13.pstyle("transition-delay").pfValue; if (a.length > 0 && i > 0) { for (var s = {}, u = false, l = 0; l < a.length; l++) { var c = a[l], d = t13.pstyle(c), v = e[c]; if (v) { var h6 = v.prev, f = h6, p = v.next != null ? v.next : d, m = false, g = void 0, y = 1e-6; f && (be(f.pfValue) && be(p.pfValue) ? (m = p.pfValue - f.pfValue, g = f.pfValue + y * m) : be(f.value) && be(p.value) ? (m = p.value - f.value, g = f.value + y * m) : st(f.value) && st(p.value) && (m = f.value[0] !== p.value[0] || f.value[1] !== p.value[1] || f.value[2] !== p.value[2], g = f.strValue), m && (s[c] = p.strValue, this.applyBypass(t13, c, g), u = true)); } } if (!u) return; n.transitioning = true, new hi(function(b) { o > 0 ? t13.delayAnimation(o).play().promise().then(b) : b(); }).then(function() { return t13.animation({ style: s, duration: i, easing: t13.pstyle("transition-timing-function").value, queue: false }).play().promise(); }).then(function() { r.removeBypasses(t13, a), t13.emitAndNotify("style"), n.transitioning = false; }); } else n.transitioning && (this.removeBypasses(t13, a), t13.emitAndNotify("style"), n.transitioning = false); }; ir.checkTrigger = function(t13, e, r, n, a, i) { var o = this.properties[e], s = a(o); s != null && s(r, n) && i(o); }; ir.checkZOrderTrigger = function(t13, e, r, n) { var a = this; this.checkTrigger(t13, e, r, n, function(i) { return i.triggersZOrder; }, function() { a._private.cy.notify("zorder", t13); }); }; ir.checkBoundsTrigger = function(t13, e, r, n) { this.checkTrigger(t13, e, r, n, function(a) { return a.triggersBounds; }, function(a) { t13.dirtyCompoundBoundsCache(), t13.dirtyBoundingBoxCache(), // only for beziers -- so performance of other edges isn't affected a.triggersBoundsOfParallelBeziers && e === "curve-style" && (r === "bezier" || n === "bezier") && t13.parallelEdges().forEach(function(i) { i.isBundledBezier() && i.dirtyBoundingBoxCache(); }), a.triggersBoundsOfConnectedEdges && e === "display" && (r === "none" || n === "none") && t13.connectedEdges().forEach(function(i) { i.dirtyBoundingBoxCache(); }); }); }; ir.checkTriggers = function(t13, e, r, n) { t13.dirtyStyleCache(), this.checkZOrderTrigger(t13, e, r, n), this.checkBoundsTrigger(t13, e, r, n); }; var Fo = {}; Fo.applyBypass = function(t13, e, r, n) { var a = this, i = [], o = true; if (e === "*" || e === "**") { if (r !== void 0) for (var s = 0; s < a.properties.length; s++) { var u = a.properties[s], l = u.name, c = this.parse(l, r, true); c && i.push(c); } } else if (Ie(e)) { var d = this.parse(e, r, true); d && i.push(d); } else if (Xe(e)) { var v = e; n = r; for (var h6 = Object.keys(v), f = 0; f < h6.length; f++) { var p = h6[f], m = v[p]; if (m === void 0 && (m = v[Js(p)]), m !== void 0) { var g = this.parse(p, m, true); g && i.push(g); } } } else return false; if (i.length === 0) return false; for (var y = false, b = 0; b < t13.length; b++) { for (var w = t13[b], C = {}, E = void 0, x = 0; x < i.length; x++) { var T = i[x]; if (n) { var k = w.pstyle(T.name); E = C[T.name] = { prev: k }; } y = this.applyParsedProperty(w, Zr(T)) || y, n && (E.next = w.pstyle(T.name)); } y && this.updateStyleHints(w), n && this.updateTransitions(w, C, o); } return y; }; Fo.overrideBypass = function(t13, e, r) { e = sc(e); for (var n = 0; n < t13.length; n++) { var a = t13[n], i = a._private.style[e], o = this.properties[e].type, s = o.color, u = o.mutiple, l = i ? i.pfValue != null ? i.pfValue : i.value : null; !i || !i.bypass ? this.applyBypass(a, e, r) : (i.value = r, i.pfValue != null && (i.pfValue = r), s ? i.strValue = "rgb(" + r.join(",") + ")" : u ? i.strValue = r.join(" ") : i.strValue = "" + r, this.updateStyleHints(a)), this.checkTriggers(a, e, l, r); } }; Fo.removeAllBypasses = function(t13, e) { return this.removeBypasses(t13, this.propertyNames, e); }; Fo.removeBypasses = function(t13, e, r) { for (var n = true, a = 0; a < t13.length; a++) { for (var i = t13[a], o = {}, s = 0; s < e.length; s++) { var u = e[s], l = this.properties[u], c = i.pstyle(l.name); if (!(!c || !c.bypass)) { var d = "", v = this.parse(u, d, true), h6 = o[l.name] = { prev: c }; this.applyParsedProperty(i, v), h6.next = i.pstyle(l.name); } } this.updateStyleHints(i), r && this.updateTransitions(i, o, n); } }; var xc = {}; xc.getEmSizeInPixels = function() { var t13 = this.containerCss("font-size"); return t13 != null ? parseFloat(t13) : 1; }; xc.containerCss = function(t13) { var e = this._private.cy, r = e.container(), n = e.window(); if (n && r && n.getComputedStyle) return n.getComputedStyle(r).getPropertyValue(t13); }; var rn = {}; rn.getRenderedStyle = function(t13, e) { return e ? this.getStylePropertyValue(t13, e, true) : this.getRawStyle(t13, true); }; rn.getRawStyle = function(t13, e) { var r = this; if (t13 = t13[0], t13) { for (var n = {}, a = 0; a < r.properties.length; a++) { var i = r.properties[a], o = r.getStylePropertyValue(t13, i.name, e); o != null && (n[i.name] = o, n[Js(i.name)] = o); } return n; } }; rn.getIndexedStyle = function(t13, e, r, n) { var a = t13.pstyle(e)[r][n]; return a ?? t13.cy().style().getDefaultProperty(e)[r][0]; }; rn.getStylePropertyValue = function(t13, e, r) { var n = this; if (t13 = t13[0], t13) { var a = n.properties[e]; a.alias && (a = a.pointsTo); var i = a.type, o = t13.pstyle(a.name); if (o) { var s = o.value, u = o.units, l = o.strValue; if (r && i.number && s != null && be(s)) { var c = t13.cy().zoom(), d = function(m) { return m * c; }, v = function(m, g) { return d(m) + g; }, h6 = st(s), f = h6 ? u.every(function(p) { return p != null; }) : u != null; return f ? h6 ? s.map(function(p, m) { return v(p, u[m]); }).join(" ") : v(s, u) : h6 ? s.map(function(p) { return Ie(p) ? p : "" + d(p); }).join(" ") : "" + d(s); } else if (l != null) return l; } return null; } }; rn.getAnimationStartStyle = function(t13, e) { for (var r = {}, n = 0; n < e.length; n++) { var a = e[n], i = a.name, o = t13.pstyle(i); o !== void 0 && (Xe(o) ? o = this.parse(i, o.strValue) : o = this.parse(i, o)), o && (r[i] = o); } return r; }; rn.getPropsList = function(t13) { var e = this, r = [], n = t13, a = e.properties; if (n) for (var i = Object.keys(n), o = 0; o < i.length; o++) { var s = i[o], u = n[s], l = a[s] || a[sc(s)], c = this.parse(l.name, u); c && r.push(c); } return r; }; rn.getNonDefaultPropertiesHash = function(t13, e, r) { var n = r.slice(), a, i, o, s, u, l; for (u = 0; u < e.length; u++) if (a = e[u], i = t13.pstyle(a, false), i != null) if (i.pfValue != null) n[0] = ro(s, n[0]), n[1] = no(s, n[1]); else for (o = i.strValue, l = 0; l < o.length; l++) s = o.charCodeAt(l), n[0] = ro(s, n[0]), n[1] = no(s, n[1]); return n; }; rn.getPropertiesHash = rn.getNonDefaultPropertiesHash; var fl = {}; fl.appendFromJson = function(t13) { for (var e = this, r = 0; r < t13.length; r++) { var n = t13[r], a = n.selector, i = n.style || n.css, o = Object.keys(i); e.selector(a); for (var s = 0; s < o.length; s++) { var u = o[s], l = i[u]; e.css(u, l); } } return e; }; fl.fromJson = function(t13) { var e = this; return e.resetToDefault(), e.appendFromJson(t13), e; }; fl.json = function() { for (var t13 = [], e = this.defaultLength; e < this.length; e++) { for (var r = this[e], n = r.selector, a = r.properties, i = {}, o = 0; o < a.length; o++) { var s = a[o]; i[s.name] = s.strValue; } t13.push({ selector: n ? n.toString() : "core", style: i }); } return t13; }; var Cc = {}; Cc.appendFromString = function(t13) { var e = this, r = this, n = "" + t13, a, i, o; n = n.replace(/[/][*](\s|.)+?[*][/]/g, ""); function s() { n.length > a.length ? n = n.substr(a.length) : n = ""; } function u() { i.length > o.length ? i = i.substr(o.length) : i = ""; } for (; ; ) { var l = n.match(/^\s*$/); if (l) break; var c = n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/); if (!c) { tt("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: " + n); break; } a = c[0]; var d = c[1]; if (d !== "core") { var v = new Un(d); if (v.invalid) { tt("Skipping parsing of block: Invalid selector found in string stylesheet: " + d), s(); continue; } } var h6 = c[2], f = false; i = h6; for (var p = []; ; ) { var m = i.match(/^\s*$/); if (m) break; var g = i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/); if (!g) { tt("Skipping parsing of block: Invalid formatting of style property and value definitions found in:" + h6), f = true; break; } o = g[0]; var y = g[1], b = g[2], w = e.properties[y]; if (!w) { tt("Skipping property: Invalid property name in: " + o), u(); continue; } var C = r.parse(y, b); if (!C) { tt("Skipping property: Invalid property definition in: " + o), u(); continue; } p.push({ name: y, val: b }), u(); } if (f) { s(); break; } r.selector(d); for (var E = 0; E < p.length; E++) { var x = p[E]; r.css(x.name, x.val); } s(); } return r; }; Cc.fromString = function(t13) { var e = this; return e.resetToDefault(), e.appendFromString(t13), e; }; var Rt = {}; (function() { var t13 = Ft, e = vT, r = pT, n = gT, a = mT, i = function($) { return "^" + $ + "\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"; }, o = function($) { var G = t13 + "|\\w+|" + e + "|" + r + "|" + n + "|" + a; return "^" + $ + "\\s*\\(([\\w\\.]+)\\s*\\,\\s*(" + t13 + ")\\s*\\,\\s*(" + t13 + ")\\s*,\\s*(" + G + ")\\s*\\,\\s*(" + G + ")\\)$"; }, s = [`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`, "^(none)$", "^(.+)$"]; Rt.types = { time: { number: true, min: 0, units: "s|ms", implicitUnits: "ms" }, percent: { number: true, min: 0, max: 100, units: "%", implicitUnits: "%" }, percentages: { number: true, min: 0, max: 100, units: "%", implicitUnits: "%", multiple: true }, zeroOneNumber: { number: true, min: 0, max: 1, unitless: true }, zeroOneNumbers: { number: true, min: 0, max: 1, unitless: true, multiple: true }, nOneOneNumber: { number: true, min: -1, max: 1, unitless: true }, nonNegativeInt: { number: true, min: 0, integer: true, unitless: true }, nonNegativeNumber: { number: true, min: 0, unitless: true }, position: { enums: ["parent", "origin"] }, nodeSize: { number: true, min: 0, enums: ["label"] }, number: { number: true, unitless: true }, numbers: { number: true, unitless: true, multiple: true }, positiveNumber: { number: true, unitless: true, min: 0, strictMin: true }, size: { number: true, min: 0 }, bidirectionalSize: { number: true }, // allows negative bidirectionalSizeMaybePercent: { number: true, allowPercent: true }, // allows negative bidirectionalSizes: { number: true, multiple: true }, // allows negative sizeMaybePercent: { number: true, min: 0, allowPercent: true }, axisDirection: { enums: ["horizontal", "leftward", "rightward", "vertical", "upward", "downward", "auto"] }, paddingRelativeTo: { enums: ["width", "height", "average", "min", "max"] }, bgWH: { number: true, min: 0, allowPercent: true, enums: ["auto"], multiple: true }, bgPos: { number: true, allowPercent: true, multiple: true }, bgRelativeTo: { enums: ["inner", "include-padding"], multiple: true }, bgRepeat: { enums: ["repeat", "repeat-x", "repeat-y", "no-repeat"], multiple: true }, bgFit: { enums: ["none", "contain", "cover"], multiple: true }, bgCrossOrigin: { enums: ["anonymous", "use-credentials", "null"], multiple: true }, bgClip: { enums: ["none", "node"], multiple: true }, bgContainment: { enums: ["inside", "over"], multiple: true }, color: { color: true }, colors: { color: true, multiple: true }, fill: { enums: ["solid", "linear-gradient", "radial-gradient"] }, bool: { enums: ["yes", "no"] }, bools: { enums: ["yes", "no"], multiple: true }, lineStyle: { enums: ["solid", "dotted", "dashed"] }, lineCap: { enums: ["butt", "round", "square"] }, linePosition: { enums: ["center", "inside", "outside"] }, lineJoin: { enums: ["round", "bevel", "miter"] }, borderStyle: { enums: ["solid", "dotted", "dashed", "double"] }, curveStyle: { enums: ["bezier", "unbundled-bezier", "haystack", "segments", "straight", "straight-triangle", "taxi", "round-segments", "round-taxi"] }, radiusType: { enums: ["arc-radius", "influence-radius"], multiple: true }, fontFamily: { regex: '^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$' }, fontStyle: { enums: ["italic", "normal", "oblique"] }, fontWeight: { enums: ["normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "800", "900", 100, 200, 300, 400, 500, 600, 700, 800, 900] }, textDecoration: { enums: ["none", "underline", "overline", "line-through"] }, textTransform: { enums: ["none", "uppercase", "lowercase"] }, textWrap: { enums: ["none", "wrap", "ellipsis"] }, textOverflowWrap: { enums: ["whitespace", "anywhere"] }, textBackgroundShape: { enums: ["rectangle", "roundrectangle", "round-rectangle"] }, nodeShape: { enums: ["rectangle", "roundrectangle", "round-rectangle", "cutrectangle", "cut-rectangle", "bottomroundrectangle", "bottom-round-rectangle", "barrel", "ellipse", "triangle", "round-triangle", "square", "pentagon", "round-pentagon", "hexagon", "round-hexagon", "concavehexagon", "concave-hexagon", "heptagon", "round-heptagon", "octagon", "round-octagon", "tag", "round-tag", "star", "diamond", "round-diamond", "vee", "rhomboid", "right-rhomboid", "polygon"] }, overlayShape: { enums: ["roundrectangle", "round-rectangle", "ellipse"] }, cornerRadius: { number: true, min: 0, units: "px|em", implicitUnits: "px", enums: ["auto"] }, compoundIncludeLabels: { enums: ["include", "exclude"] }, arrowShape: { enums: ["tee", "triangle", "triangle-tee", "circle-triangle", "triangle-cross", "triangle-backcurve", "vee", "square", "circle", "diamond", "chevron", "none"] }, arrowFill: { enums: ["filled", "hollow"] }, arrowWidth: { number: true, units: "%|px|em", implicitUnits: "px", enums: ["match-line"] }, display: { enums: ["element", "none"] }, visibility: { enums: ["hidden", "visible"] }, zCompoundDepth: { enums: ["bottom", "orphan", "auto", "top"] }, zIndexCompare: { enums: ["auto", "manual"] }, valign: { enums: ["top", "center", "bottom"] }, halign: { enums: ["left", "center", "right"] }, justification: { enums: ["left", "center", "right", "auto"] }, text: { string: true }, data: { mapping: true, regex: i("data") }, layoutData: { mapping: true, regex: i("layoutData") }, scratch: { mapping: true, regex: i("scratch") }, mapData: { mapping: true, regex: o("mapData") }, mapLayoutData: { mapping: true, regex: o("mapLayoutData") }, mapScratch: { mapping: true, regex: o("mapScratch") }, fn: { mapping: true, fn: true }, url: { regexes: s, singleRegexMatchValue: true }, urls: { regexes: s, singleRegexMatchValue: true, multiple: true }, propList: { propList: true }, angle: { number: true, units: "deg|rad", implicitUnits: "rad" }, textRotation: { number: true, units: "deg|rad", implicitUnits: "rad", enums: ["none", "autorotate"] }, polygonPointList: { number: true, multiple: true, evenMultiple: true, min: -1, max: 1, unitless: true }, edgeDistances: { enums: ["intersection", "node-position", "endpoints"] }, edgeEndpoint: { number: true, multiple: true, units: "%|px|em|deg|rad", implicitUnits: "px", enums: ["inside-to-node", "outside-to-node", "outside-to-node-or-label", "outside-to-line", "outside-to-line-or-label"], singleEnum: true, validate: function($, G) { switch ($.length) { case 2: return G[0] !== "deg" && G[0] !== "rad" && G[1] !== "deg" && G[1] !== "rad"; case 1: return Ie($[0]) || G[0] === "deg" || G[0] === "rad"; default: return false; } } }, easing: { regexes: ["^(spring)\\s*\\(\\s*(" + t13 + ")\\s*,\\s*(" + t13 + ")\\s*\\)$", "^(cubic-bezier)\\s*\\(\\s*(" + t13 + ")\\s*,\\s*(" + t13 + ")\\s*,\\s*(" + t13 + ")\\s*,\\s*(" + t13 + ")\\s*\\)$"], enums: ["linear", "ease", "ease-in", "ease-out", "ease-in-out", "ease-in-sine", "ease-out-sine", "ease-in-out-sine", "ease-in-quad", "ease-out-quad", "ease-in-out-quad", "ease-in-cubic", "ease-out-cubic", "ease-in-out-cubic", "ease-in-quart", "ease-out-quart", "ease-in-out-quart", "ease-in-quint", "ease-out-quint", "ease-in-out-quint", "ease-in-expo", "ease-out-expo", "ease-in-out-expo", "ease-in-circ", "ease-out-circ", "ease-in-out-circ"] }, gradientDirection: { enums: [ "to-bottom", "to-top", "to-left", "to-right", "to-bottom-right", "to-bottom-left", "to-top-right", "to-top-left", "to-right-bottom", "to-left-bottom", "to-right-top", "to-left-top" // different order ] }, boundsExpansion: { number: true, multiple: true, min: 0, validate: function($) { var G = $.length; return G === 1 || G === 2 || G === 4; } } }; var u = { zeroNonZero: function($, G) { return ($ == null || G == null) && $ !== G || $ == 0 && G != 0 ? true : $ != 0 && G == 0; }, any: function($, G) { return $ != G; }, emptyNonEmpty: function($, G) { var Q = qn($), ge = qn(G); return Q && !ge || !Q && ge; } }, l = Rt.types, c = [{ name: "label", type: l.text, triggersBounds: u.any, triggersZOrder: u.emptyNonEmpty }, { name: "text-rotation", type: l.textRotation, triggersBounds: u.any }, { name: "text-margin-x", type: l.bidirectionalSize, triggersBounds: u.any }, { name: "text-margin-y", type: l.bidirectionalSize, triggersBounds: u.any }], d = [{ name: "source-label", type: l.text, triggersBounds: u.any }, { name: "source-text-rotation", type: l.textRotation, triggersBounds: u.any }, { name: "source-text-margin-x", type: l.bidirectionalSize, triggersBounds: u.any }, { name: "source-text-margin-y", type: l.bidirectionalSize, triggersBounds: u.any }, { name: "source-text-offset", type: l.size, triggersBounds: u.any }], v = [{ name: "target-label", type: l.text, triggersBounds: u.any }, { name: "target-text-rotation", type: l.textRotation, triggersBounds: u.any }, { name: "target-text-margin-x", type: l.bidirectionalSize, triggersBounds: u.any }, { name: "target-text-margin-y", type: l.bidirectionalSize, triggersBounds: u.any }, { name: "target-text-offset", type: l.size, triggersBounds: u.any }], h6 = [{ name: "font-family", type: l.fontFamily, triggersBounds: u.any }, { name: "font-style", type: l.fontStyle, triggersBounds: u.any }, { name: "font-weight", type: l.fontWeight, triggersBounds: u.any }, { name: "font-size", type: l.size, triggersBounds: u.any }, { name: "text-transform", type: l.textTransform, triggersBounds: u.any }, { name: "text-wrap", type: l.textWrap, triggersBounds: u.any }, { name: "text-overflow-wrap", type: l.textOverflowWrap, triggersBounds: u.any }, { name: "text-max-width", type: l.size, triggersBounds: u.any }, { name: "text-outline-width", type: l.size, triggersBounds: u.any }, { name: "line-height", type: l.positiveNumber, triggersBounds: u.any }], f = [{ name: "text-valign", type: l.valign, triggersBounds: u.any }, { name: "text-halign", type: l.halign, triggersBounds: u.any }, { name: "color", type: l.color }, { name: "text-outline-color", type: l.color }, { name: "text-outline-opacity", type: l.zeroOneNumber }, { name: "text-background-color", type: l.color }, { name: "text-background-opacity", type: l.zeroOneNumber }, { name: "text-background-padding", type: l.size, triggersBounds: u.any }, { name: "text-border-opacity", type: l.zeroOneNumber }, { name: "text-border-color", type: l.color }, { name: "text-border-width", type: l.size, triggersBounds: u.any }, { name: "text-border-style", type: l.borderStyle, triggersBounds: u.any }, { name: "text-background-shape", type: l.textBackgroundShape, triggersBounds: u.any }, { name: "text-justification", type: l.justification }], p = [{ name: "events", type: l.bool, triggersZOrder: u.any }, { name: "text-events", type: l.bool, triggersZOrder: u.any }], m = [{ name: "display", type: l.display, triggersZOrder: u.any, triggersBounds: u.any, triggersBoundsOfConnectedEdges: true }, { name: "visibility", type: l.visibility, triggersZOrder: u.any }, { name: "opacity", type: l.zeroOneNumber, triggersZOrder: u.zeroNonZero }, { name: "text-opacity", type: l.zeroOneNumber }, { name: "min-zoomed-font-size", type: l.size }, { name: "z-compound-depth", type: l.zCompoundDepth, triggersZOrder: u.any }, { name: "z-index-compare", type: l.zIndexCompare, triggersZOrder: u.any }, { name: "z-index", type: l.number, triggersZOrder: u.any }], g = [{ name: "overlay-padding", type: l.size, triggersBounds: u.any }, { name: "overlay-color", type: l.color }, { name: "overlay-opacity", type: l.zeroOneNumber, triggersBounds: u.zeroNonZero }, { name: "overlay-shape", type: l.overlayShape, triggersBounds: u.any }, { name: "overlay-corner-radius", type: l.cornerRadius }], y = [{ name: "underlay-padding", type: l.size, triggersBounds: u.any }, { name: "underlay-color", type: l.color }, { name: "underlay-opacity", type: l.zeroOneNumber, triggersBounds: u.zeroNonZero }, { name: "underlay-shape", type: l.overlayShape, triggersBounds: u.any }, { name: "underlay-corner-radius", type: l.cornerRadius }], b = [{ name: "transition-property", type: l.propList }, { name: "transition-duration", type: l.time }, { name: "transition-delay", type: l.time }, { name: "transition-timing-function", type: l.easing }], w = function($, G) { return G.value === "label" ? -$.poolIndex() : G.pfValue; }, C = [{ name: "height", type: l.nodeSize, triggersBounds: u.any, hashOverride: w }, { name: "width", type: l.nodeSize, triggersBounds: u.any, hashOverride: w }, { name: "shape", type: l.nodeShape, triggersBounds: u.any }, { name: "shape-polygon-points", type: l.polygonPointList, triggersBounds: u.any }, { name: "corner-radius", type: l.cornerRadius }, { name: "background-color", type: l.color }, { name: "background-fill", type: l.fill }, { name: "background-opacity", type: l.zeroOneNumber }, { name: "background-blacken", type: l.nOneOneNumber }, { name: "background-gradient-stop-colors", type: l.colors }, { name: "background-gradient-stop-positions", type: l.percentages }, { name: "background-gradient-direction", type: l.gradientDirection }, { name: "padding", type: l.sizeMaybePercent, triggersBounds: u.any }, { name: "padding-relative-to", type: l.paddingRelativeTo, triggersBounds: u.any }, { name: "bounds-expansion", type: l.boundsExpansion, triggersBounds: u.any }], E = [{ name: "border-color", type: l.color }, { name: "border-opacity", type: l.zeroOneNumber }, { name: "border-width", type: l.size, triggersBounds: u.any }, { name: "border-style", type: l.borderStyle }, { name: "border-cap", type: l.lineCap }, { name: "border-join", type: l.lineJoin }, { name: "border-dash-pattern", type: l.numbers }, { name: "border-dash-offset", type: l.number }, { name: "border-position", type: l.linePosition }], x = [{ name: "outline-color", type: l.color }, { name: "outline-opacity", type: l.zeroOneNumber }, { name: "outline-width", type: l.size, triggersBounds: u.any }, { name: "outline-style", type: l.borderStyle }, { name: "outline-offset", type: l.size, triggersBounds: u.any }], T = [{ name: "background-image", type: l.urls }, { name: "background-image-crossorigin", type: l.bgCrossOrigin }, { name: "background-image-opacity", type: l.zeroOneNumbers }, { name: "background-image-containment", type: l.bgContainment }, { name: "background-image-smoothing", type: l.bools }, { name: "background-position-x", type: l.bgPos }, { name: "background-position-y", type: l.bgPos }, { name: "background-width-relative-to", type: l.bgRelativeTo }, { name: "background-height-relative-to", type: l.bgRelativeTo }, { name: "background-repeat", type: l.bgRepeat }, { name: "background-fit", type: l.bgFit }, { name: "background-clip", type: l.bgClip }, { name: "background-width", type: l.bgWH }, { name: "background-height", type: l.bgWH }, { name: "background-offset-x", type: l.bgPos }, { name: "background-offset-y", type: l.bgPos }], k = [{ name: "position", type: l.position, triggersBounds: u.any }, { name: "compound-sizing-wrt-labels", type: l.compoundIncludeLabels, triggersBounds: u.any }, { name: "min-width", type: l.size, triggersBounds: u.any }, { name: "min-width-bias-left", type: l.sizeMaybePercent, triggersBounds: u.any }, { name: "min-width-bias-right", type: l.sizeMaybePercent, triggersBounds: u.any }, { name: "min-height", type: l.size, triggersBounds: u.any }, { name: "min-height-bias-top", type: l.sizeMaybePercent, triggersBounds: u.any }, { name: "min-height-bias-bottom", type: l.sizeMaybePercent, triggersBounds: u.any }], _ = [{ name: "line-style", type: l.lineStyle }, { name: "line-color", type: l.color }, { name: "line-fill", type: l.fill }, { name: "line-cap", type: l.lineCap }, { name: "line-opacity", type: l.zeroOneNumber }, { name: "line-dash-pattern", type: l.numbers }, { name: "line-dash-offset", type: l.number }, { name: "line-outline-width", type: l.size }, { name: "line-outline-color", type: l.color }, { name: "line-gradient-stop-colors", type: l.colors }, { name: "line-gradient-stop-positions", type: l.percentages }, { name: "curve-style", type: l.curveStyle, triggersBounds: u.any, triggersBoundsOfParallelBeziers: true }, { name: "haystack-radius", type: l.zeroOneNumber, triggersBounds: u.any }, { name: "source-endpoint", type: l.edgeEndpoint, triggersBounds: u.any }, { name: "target-endpoint", type: l.edgeEndpoint, triggersBounds: u.any }, { name: "control-point-step-size", type: l.size, triggersBounds: u.any }, { name: "control-point-distances", type: l.bidirectionalSizes, triggersBounds: u.any }, { name: "control-point-weights", type: l.numbers, triggersBounds: u.any }, { name: "segment-distances", type: l.bidirectionalSizes, triggersBounds: u.any }, { name: "segment-weights", type: l.numbers, triggersBounds: u.any }, { name: "segment-radii", type: l.numbers, triggersBounds: u.any }, { name: "radius-type", type: l.radiusType, triggersBounds: u.any }, { name: "taxi-turn", type: l.bidirectionalSizeMaybePercent, triggersBounds: u.any }, { name: "taxi-turn-min-distance", type: l.size, triggersBounds: u.any }, { name: "taxi-direction", type: l.axisDirection, triggersBounds: u.any }, { name: "taxi-radius", type: l.number, triggersBounds: u.any }, { name: "edge-distances", type: l.edgeDistances, triggersBounds: u.any }, { name: "arrow-scale", type: l.positiveNumber, triggersBounds: u.any }, { name: "loop-direction", type: l.angle, triggersBounds: u.any }, { name: "loop-sweep", type: l.angle, triggersBounds: u.any }, { name: "source-distance-from-node", type: l.size, triggersBounds: u.any }, { name: "target-distance-from-node", type: l.size, triggersBounds: u.any }], D = [{ name: "ghost", type: l.bool, triggersBounds: u.any }, { name: "ghost-offset-x", type: l.bidirectionalSize, triggersBounds: u.any }, { name: "ghost-offset-y", type: l.bidirectionalSize, triggersBounds: u.any }, { name: "ghost-opacity", type: l.zeroOneNumber }], O = [{ name: "selection-box-color", type: l.color }, { name: "selection-box-opacity", type: l.zeroOneNumber }, { name: "selection-box-border-color", type: l.color }, { name: "selection-box-border-width", type: l.size }, { name: "active-bg-color", type: l.color }, { name: "active-bg-opacity", type: l.zeroOneNumber }, { name: "active-bg-size", type: l.size }, { name: "outside-texture-bg-color", type: l.color }, { name: "outside-texture-bg-opacity", type: l.zeroOneNumber }], I = []; Rt.pieBackgroundN = 16, I.push({ name: "pie-size", type: l.sizeMaybePercent }); for (var L = 1; L <= Rt.pieBackgroundN; L++) I.push({ name: "pie-" + L + "-background-color", type: l.color }), I.push({ name: "pie-" + L + "-background-size", type: l.percent }), I.push({ name: "pie-" + L + "-background-opacity", type: l.zeroOneNumber }); var B = [], F = Rt.arrowPrefixes = ["source", "mid-source", "target", "mid-target"]; [{ name: "arrow-shape", type: l.arrowShape, triggersBounds: u.any }, { name: "arrow-color", type: l.color }, { name: "arrow-fill", type: l.arrowFill }, { name: "arrow-width", type: l.arrowWidth }].forEach(function(te) { F.forEach(function($) { var G = $ + "-" + te.name, Q = te.type, ge = te.triggersBounds; B.push({ name: G, type: Q, triggersBounds: ge }); }); }, {}); var M = Rt.properties = [].concat(p, b, m, g, y, D, f, h6, c, d, v, C, E, x, T, I, k, _, B, O), A = Rt.propertyGroups = { // common to all eles behavior: p, transition: b, visibility: m, overlay: g, underlay: y, ghost: D, // labels commonLabel: f, labelDimensions: h6, mainLabel: c, sourceLabel: d, targetLabel: v, // node props nodeBody: C, nodeBorder: E, nodeOutline: x, backgroundImage: T, pie: I, compound: k, // edge props edgeLine: _, edgeArrow: B, core: O }, R = Rt.propertyGroupNames = {}, K = Rt.propertyGroupKeys = Object.keys(A); K.forEach(function(te) { R[te] = A[te].map(function($) { return $.name; }), A[te].forEach(function($) { return $.groupKey = te; }); }); var H = Rt.aliases = [{ name: "content", pointsTo: "label" }, { name: "control-point-distance", pointsTo: "control-point-distances" }, { name: "control-point-weight", pointsTo: "control-point-weights" }, { name: "segment-distance", pointsTo: "segment-distances" }, { name: "segment-weight", pointsTo: "segment-weights" }, { name: "segment-radius", pointsTo: "segment-radii" }, { name: "edge-text-rotation", pointsTo: "text-rotation" }, { name: "padding-left", pointsTo: "padding" }, { name: "padding-right", pointsTo: "padding" }, { name: "padding-top", pointsTo: "padding" }, { name: "padding-bottom", pointsTo: "padding" }]; Rt.propertyNames = M.map(function(te) { return te.name; }); for (var q = 0; q < M.length; q++) { var ee = M[q]; M[ee.name] = ee; } for (var se = 0; se < H.length; se++) { var oe = H[se], ae = M[oe.pointsTo], ue = { name: oe.name, alias: true, pointsTo: ae }; M.push(ue), M[oe.name] = ue; } })(); Rt.getDefaultProperty = function(t13) { return this.getDefaultProperties()[t13]; }; Rt.getDefaultProperties = function() { var t13 = this._private; if (t13.defaultProperties != null) return t13.defaultProperties; for (var e = Re({ // core props "selection-box-color": "#ddd", "selection-box-opacity": 0.65, "selection-box-border-color": "#aaa", "selection-box-border-width": 1, "active-bg-color": "black", "active-bg-opacity": 0.15, "active-bg-size": 30, "outside-texture-bg-color": "#000", "outside-texture-bg-opacity": 0.125, // common node/edge props events: "yes", "text-events": "no", "text-valign": "top", "text-halign": "center", "text-justification": "auto", "line-height": 1, color: "#000", "text-outline-color": "#000", "text-outline-width": 0, "text-outline-opacity": 1, "text-opacity": 1, "text-decoration": "none", "text-transform": "none", "text-wrap": "none", "text-overflow-wrap": "whitespace", "text-max-width": 9999, "text-background-color": "#000", "text-background-opacity": 0, "text-background-shape": "rectangle", "text-background-padding": 0, "text-border-opacity": 0, "text-border-width": 0, "text-border-style": "solid", "text-border-color": "#000", "font-family": "Helvetica Neue, Helvetica, sans-serif", "font-style": "normal", "font-weight": "normal", "font-size": 16, "min-zoomed-font-size": 0, "text-rotation": "none", "source-text-rotation": "none", "target-text-rotation": "none", visibility: "visible", display: "element", opacity: 1, "z-compound-depth": "auto", "z-index-compare": "auto", "z-index": 0, label: "", "text-margin-x": 0, "text-margin-y": 0, "source-label": "", "source-text-offset": 0, "source-text-margin-x": 0, "source-text-margin-y": 0, "target-label": "", "target-text-offset": 0, "target-text-margin-x": 0, "target-text-margin-y": 0, "overlay-opacity": 0, "overlay-color": "#000", "overlay-padding": 10, "overlay-shape": "round-rectangle", "overlay-corner-radius": "auto", "underlay-opacity": 0, "underlay-color": "#000", "underlay-padding": 10, "underlay-shape": "round-rectangle", "underlay-corner-radius": "auto", "transition-property": "none", "transition-duration": 0, "transition-delay": 0, "transition-timing-function": "linear", // node props "background-blacken": 0, "background-color": "#999", "background-fill": "solid", "background-opacity": 1, "background-image": "none", "background-image-crossorigin": "anonymous", "background-image-opacity": 1, "background-image-containment": "inside", "background-image-smoothing": "yes", "background-position-x": "50%", "background-position-y": "50%", "background-offset-x": 0, "background-offset-y": 0, "background-width-relative-to": "include-padding", "background-height-relative-to": "include-padding", "background-repeat": "no-repeat", "background-fit": "none", "background-clip": "node", "background-width": "auto", "background-height": "auto", "border-color": "#000", "border-opacity": 1, "border-width": 0, "border-style": "solid", "border-dash-pattern": [4, 2], "border-dash-offset": 0, "border-cap": "butt", "border-join": "miter", "border-position": "center", "outline-color": "#999", "outline-opacity": 1, "outline-width": 0, "outline-offset": 0, "outline-style": "solid", height: 30, width: 30, shape: "ellipse", "shape-polygon-points": "-1, -1, 1, -1, 1, 1, -1, 1", "corner-radius": "auto", "bounds-expansion": 0, // node gradient "background-gradient-direction": "to-bottom", "background-gradient-stop-colors": "#999", "background-gradient-stop-positions": "0%", // ghost props ghost: "no", "ghost-offset-y": 0, "ghost-offset-x": 0, "ghost-opacity": 0, // compound props padding: 0, "padding-relative-to": "width", position: "origin", "compound-sizing-wrt-labels": "include", "min-width": 0, "min-width-bias-left": 0, "min-width-bias-right": 0, "min-height": 0, "min-height-bias-top": 0, "min-height-bias-bottom": 0 }, { // node pie bg "pie-size": "100%" }, [{ name: "pie-{{i}}-background-color", value: "black" }, { name: "pie-{{i}}-background-size", value: "0%" }, { name: "pie-{{i}}-background-opacity", value: 1 }].reduce(function(u, l) { for (var c = 1; c <= Rt.pieBackgroundN; c++) { var d = l.name.replace("{{i}}", c), v = l.value; u[d] = v; } return u; }, {}), { // edge props "line-style": "solid", "line-color": "#999", "line-fill": "solid", "line-cap": "butt", "line-opacity": 1, "line-outline-width": 0, "line-outline-color": "#000", "line-gradient-stop-colors": "#999", "line-gradient-stop-positions": "0%", "control-point-step-size": 40, "control-point-weights": 0.5, "segment-weights": 0.5, "segment-distances": 20, "segment-radii": 15, "radius-type": "arc-radius", "taxi-turn": "50%", "taxi-radius": 15, "taxi-turn-min-distance": 10, "taxi-direction": "auto", "edge-distances": "intersection", "curve-style": "haystack", "haystack-radius": 0, "arrow-scale": 1, "loop-direction": "-45deg", "loop-sweep": "-90deg", "source-distance-from-node": 0, "target-distance-from-node": 0, "source-endpoint": "outside-to-node", "target-endpoint": "outside-to-node", "line-dash-pattern": [6, 3], "line-dash-offset": 0 }, [{ name: "arrow-shape", value: "none" }, { name: "arrow-color", value: "#999" }, { name: "arrow-fill", value: "filled" }, { name: "arrow-width", value: 1 }].reduce(function(u, l) { return Rt.arrowPrefixes.forEach(function(c) { var d = c + "-" + l.name, v = l.value; u[d] = v; }), u; }, {})), r = {}, n = 0; n < this.properties.length; n++) { var a = this.properties[n]; if (!a.pointsTo) { var i = a.name, o = e[i], s = this.parse(i, o); r[i] = s; } } return t13.defaultProperties = r, t13.defaultProperties; }; Rt.addDefaultStylesheet = function() { this.selector(":parent").css({ shape: "rectangle", padding: 10, "background-color": "#eee", "border-color": "#ccc", "border-width": 1 }).selector("edge").css({ width: 3 }).selector(":loop").css({ "curve-style": "bezier" }).selector("edge:compound").css({ "curve-style": "bezier", "source-endpoint": "outside-to-line", "target-endpoint": "outside-to-line" }).selector(":selected").css({ "background-color": "#0169D9", "line-color": "#0169D9", "source-arrow-color": "#0169D9", "target-arrow-color": "#0169D9", "mid-source-arrow-color": "#0169D9", "mid-target-arrow-color": "#0169D9" }).selector(":parent:selected").css({ "background-color": "#CCE1F9", "border-color": "#aec8e5" }).selector(":active").css({ "overlay-color": "black", "overlay-padding": 10, "overlay-opacity": 0.25 }), this.defaultLength = this.length; }; var vl = {}; vl.parse = function(t13, e, r, n) { var a = this; if (pt(e)) return a.parseImplWarn(t13, e, r, n); var i = n === "mapping" || n === true || n === false || n == null ? "dontcare" : n, o = r ? "t" : "f", s = "" + e, u = ip(t13, s, o, i), l = a.propCache = a.propCache || [], c; return (c = l[u]) || (c = l[u] = a.parseImplWarn(t13, e, r, n)), (r || n === "mapping") && (c = Zr(c), c && (c.value = Zr(c.value))), c; }; vl.parseImplWarn = function(t13, e, r, n) { var a = this.parseImpl(t13, e, r, n); return !a && e != null && tt("The style property `".concat(t13, ": ").concat(e, "` is invalid")), a && (a.name === "width" || a.name === "height") && e === "label" && tt("The style value of `label` is deprecated for `" + a.name + "`"), a; }; vl.parseImpl = function(t13, e, r, n) { var a = this; t13 = sc(t13); var i = a.properties[t13], o = e, s = a.types; if (!i || e === void 0) return null; i.alias && (i = i.pointsTo, t13 = i.name); var u = Ie(e); u && (e = e.trim()); var l = i.type; if (!l) return null; if (r && (e === "" || e === null)) return { name: t13, value: e, bypass: true, deleteBypass: true }; if (pt(e)) return { name: t13, value: e, strValue: "fn", mapped: s.fn, bypass: r }; var c, d; if (!(!u || n || e.length < 7 || e[1] !== "a")) { if (e.length >= 7 && e[0] === "d" && (c = new RegExp(s.data.regex).exec(e))) { if (r) return false; var v = s.data; return { name: t13, value: c, strValue: "" + e, mapped: v, field: c[1], bypass: r }; } else if (e.length >= 10 && e[0] === "m" && (d = new RegExp(s.mapData.regex).exec(e))) { if (r || l.multiple) return false; var h6 = s.mapData; if (!(l.color || l.number)) return false; var f = this.parse(t13, d[4]); if (!f || f.mapped) return false; var p = this.parse(t13, d[5]); if (!p || p.mapped) return false; if (f.pfValue === p.pfValue || f.strValue === p.strValue) return tt("`" + t13 + ": " + e + "` is not a valid mapper because the output range is zero; converting to `" + t13 + ": " + f.strValue + "`"), this.parse(t13, f.strValue); if (l.color) { var m = f.value, g = p.value, y = m[0] === g[0] && m[1] === g[1] && m[2] === g[2] && // optional alpha (m[3] === g[3] || (m[3] == null || m[3] === 1) && (g[3] == null || g[3] === 1)); if (y) return false; } return { name: t13, value: d, strValue: "" + e, mapped: h6, field: d[1], fieldMin: parseFloat(d[2]), // min & max are numeric fieldMax: parseFloat(d[3]), valueMin: f.value, valueMax: p.value, bypass: r }; } } if (l.multiple && n !== "multiple") { var b; if (u ? b = e.split(/\s+/) : st(e) ? b = e : b = [e], l.evenMultiple && b.length % 2 !== 0) return null; for (var w = [], C = [], E = [], x = "", T = false, k = 0; k < b.length; k++) { var _ = a.parse(t13, b[k], r, "multiple"); T = T || Ie(_.value), w.push(_.value), E.push(_.pfValue != null ? _.pfValue : _.value), C.push(_.units), x += (k > 0 ? " " : "") + _.strValue; } return l.validate && !l.validate(w, C) ? null : l.singleEnum && T ? w.length === 1 && Ie(w[0]) ? { name: t13, value: w[0], strValue: w[0], bypass: r } : null : { name: t13, value: w, pfValue: E, strValue: x, bypass: r, units: C }; } var D = function() { for (var $ = 0; $ < l.enums.length; $++) { var G = l.enums[$]; if (G === e) return { name: t13, value: e, strValue: "" + e, bypass: r }; } return null; }; if (l.number) { var O, I = "px"; if (l.units && (O = l.units), l.implicitUnits && (I = l.implicitUnits), !l.unitless) if (u) { var L = "px|em" + (l.allowPercent ? "|\\%" : ""); O && (L = O); var B = e.match("^(" + Ft + ")(" + L + ")?$"); B && (e = B[1], O = B[2] || I); } else (!O || l.implicitUnits) && (O = I); if (e = parseFloat(e), isNaN(e) && l.enums === void 0) return null; if (isNaN(e) && l.enums !== void 0) return e = o, D(); if (l.integer && !oT(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 F = { name: t13, value: e, strValue: "" + e + (O || ""), units: O, bypass: r }; return l.unitless || O !== "px" && O !== "em" ? F.pfValue = e : F.pfValue = O === "px" || !O ? e : this.getEmSizeInPixels() * e, (O === "ms" || O === "s") && (F.pfValue = O === "ms" ? e : 1e3 * e), (O === "deg" || O === "rad") && (F.pfValue = O === "rad" ? e : z5(e)), O === "%" && (F.pfValue = e / 100), F; } else if (l.propList) { var M = [], A = "" + e; if (A !== "none") { for (var R = A.split(/\s*,\s*|\s+/), K = 0; K < R.length; K++) { var H = R[K].trim(); a.properties[H] ? M.push(H) : tt("`" + H + "` is not a valid property name"); } if (M.length === 0) return null; } return { name: t13, value: M, strValue: M.length === 0 ? "none" : M.join(" "), bypass: r }; } else if (l.color) { var q = ET(e); return q ? { name: t13, value: q, pfValue: q, strValue: "rgb(" + q[0] + "," + q[1] + "," + q[2] + ")", // n.b. no spaces b/c of multiple support bypass: r } : null; } else if (l.regex || l.regexes) { if (l.enums) { var ee = D(); if (ee) return ee; } for (var se = l.regexes ? l.regexes : [l.regex], oe = 0; oe < se.length; oe++) { var ae = new RegExp(se[oe]), ue = ae.exec(e); if (ue) return { name: t13, value: l.singleRegexMatchValue ? ue[1] : ue, strValue: "" + e, bypass: r }; } return null; } else return l.string ? { name: t13, value: "" + e, strValue: "" + e, bypass: r } : l.enums ? D() : null; }; var rr = function t9(e) { if (!(this instanceof t9)) return new t9(e); if (!oc(e)) { yt("A style must have a core reference"); return; } this._private = { cy: e, coreStyle: {} }, this.length = 0, this.resetToDefault(); }; var ar = rr.prototype; ar.instanceString = function() { return "style"; }; ar.clear = function() { for (var t13 = this._private, e = t13.cy, r = e.elements(), n = 0; n < this.length; n++) this[n] = void 0; return this.length = 0, t13.contextStyles = {}, t13.propDiffs = {}, this.cleanElements(r, true), r.forEach(function(a) { var i = a[0]._private; i.styleDirty = true, i.appliedInitStyle = false; }), this; }; ar.resetToDefault = function() { return this.clear(), this.addDefaultStylesheet(), this; }; ar.core = function(t13) { return this._private.coreStyle[t13] || this.getDefaultProperty(t13); }; ar.selector = function(t13) { var e = t13 === "core" ? null : new Un(t13), r = this.length++; return this[r] = { selector: e, properties: [], mappedProperties: [], index: r }, this; }; ar.css = function() { var t13 = this, e = arguments; if (e.length === 1) for (var r = e[0], n = 0; n < t13.properties.length; n++) { var a = t13.properties[n], i = r[a.name]; i === void 0 && (i = r[Js(a.name)]), i !== void 0 && this.cssRule(a.name, i); } else e.length === 2 && this.cssRule(e[0], e[1]); return this; }; ar.style = ar.css; ar.cssRule = function(t13, e) { var r = this.parse(t13, e); if (r) { var n = this.length - 1; this[n].properties.push(r), this[n].properties[r.name] = r, r.name.match(/pie-(\d+)-background-size/) && r.value && (this._private.hasPie = true), r.mapped && this[n].mappedProperties.push(r); var a = !this[n].selector; a && (this._private.coreStyle[r.name] = r); } return this; }; ar.append = function(t13) { return Zh(t13) ? t13.appendToStyle(this) : st(t13) ? this.appendFromJson(t13) : Ie(t13) && this.appendFromString(t13), this; }; rr.fromJson = function(t13, e) { var r = new rr(t13); return r.fromJson(e), r; }; rr.fromString = function(t13, e) { return new rr(t13).fromString(e); }; [ir, Fo, xc, rn, fl, Cc, Rt, vl].forEach(function(t13) { Re(ar, t13); }); rr.types = ar.types; rr.properties = ar.properties; rr.propertyGroups = ar.propertyGroups; rr.propertyGroupNames = ar.propertyGroupNames; rr.propertyGroupKeys = ar.propertyGroupKeys; var oP = { style: function(e) { if (e) { var r = this.setStyle(e); r.update(); } return this._private.style; }, setStyle: function(e) { var r = this._private; return Zh(e) ? r.style = e.generateStyle(this) : st(e) ? r.style = rr.fromJson(this, e) : Ie(e) ? r.style = rr.fromString(this, e) : r.style = rr(this), r.style; }, // e.g. cy.data() changed => recalc ele mappers updateStyle: function() { this.mutableElements().updateStyle(); } }; var sP = "single"; var xa = { autolock: function(e) { if (e !== void 0) this._private.autolock = !!e; else return this._private.autolock; return this; }, autoungrabify: function(e) { if (e !== void 0) this._private.autoungrabify = !!e; else return this._private.autoungrabify; return this; }, autounselectify: function(e) { if (e !== void 0) this._private.autounselectify = !!e; else return this._private.autounselectify; return this; }, selectionType: function(e) { var r = this._private; if (r.selectionType == null && (r.selectionType = sP), e !== void 0) (e === "additive" || e === "single") && (r.selectionType = e); else return r.selectionType; return this; }, panningEnabled: function(e) { if (e !== void 0) this._private.panningEnabled = !!e; else return this._private.panningEnabled; return this; }, userPanningEnabled: function(e) { if (e !== void 0) this._private.userPanningEnabled = !!e; else return this._private.userPanningEnabled; return this; }, zoomingEnabled: function(e) { if (e !== void 0) this._private.zoomingEnabled = !!e; else return this._private.zoomingEnabled; return this; }, userZoomingEnabled: function(e) { if (e !== void 0) this._private.userZoomingEnabled = !!e; else return this._private.userZoomingEnabled; return this; }, boxSelectionEnabled: function(e) { if (e !== void 0) this._private.boxSelectionEnabled = !!e; else return this._private.boxSelectionEnabled; return this; }, pan: function() { var e = arguments, r = this._private.pan, n, a, i, o, s; switch (e.length) { case 0: return r; case 1: if (Ie(e[0])) return n = e[0], r[n]; if (Xe(e[0])) { if (!this._private.panningEnabled) return this; i = e[0], o = i.x, s = i.y, be(o) && (r.x = o), be(s) && (r.y = s), this.emit("pan viewport"); } break; case 2: if (!this._private.panningEnabled) return this; n = e[0], a = e[1], (n === "x" || n === "y") && be(a) && (r[n] = a), this.emit("pan viewport"); break; } return this.notify("viewport"), this; }, panBy: function(e, r) { var n = arguments, a = this._private.pan, i, o, s, u, l; if (!this._private.panningEnabled) return this; switch (n.length) { case 1: Xe(e) && (s = n[0], u = s.x, l = s.y, be(u) && (a.x += u), be(l) && (a.y += l), this.emit("pan viewport")); break; case 2: i = e, o = r, (i === "x" || i === "y") && be(o) && (a[i] += o), this.emit("pan viewport"); break; } return this.notify("viewport"), this; }, fit: function(e, r) { var n = this.getFitViewport(e, r); if (n) { var a = this._private; a.zoom = n.zoom, a.pan = n.pan, this.emit("pan zoom viewport"), this.notify("viewport"); } return this; }, getFitViewport: function(e, r) { if (be(e) && r === void 0 && (r = e, e = void 0), !(!this._private.panningEnabled || !this._private.zoomingEnabled)) { var n; if (Ie(e)) { var a = e; e = this.$(a); } else if (uT(e)) { var i = e; n = { x1: i.x1, y1: i.y1, x2: i.x2, y2: i.y2 }, n.w = n.x2 - n.x1, n.h = n.y2 - n.y1; } else yr(e) || (e = this.mutableElements()); if (!(yr(e) && e.empty())) { n = n || e.boundingBox(); var o = this.width(), s = this.height(), u; if (r = be(r) ? r : 0, !isNaN(o) && !isNaN(s) && o > 0 && s > 0 && !isNaN(n.w) && !isNaN(n.h) && n.w > 0 && n.h > 0) { u = Math.min((o - 2 * r) / n.w, (s - 2 * r) / n.h), u = u > this._private.maxZoom ? this._private.maxZoom : u, u = u < this._private.minZoom ? this._private.minZoom : u; var l = { // now pan to middle x: (o - u * (n.x1 + n.x2)) / 2, y: (s - u * (n.y1 + n.y2)) / 2 }; return { zoom: u, pan: l }; } } } }, zoomRange: function(e, r) { var n = this._private; if (r == null) { var a = e; e = a.min, r = a.max; } return be(e) && be(r) && e <= r ? (n.minZoom = e, n.maxZoom = r) : be(e) && r === void 0 && e <= n.maxZoom ? n.minZoom = e : be(r) && e === void 0 && r >= n.minZoom && (n.maxZoom = r), this; }, minZoom: function(e) { return e === void 0 ? this._private.minZoom : this.zoomRange({ min: e }); }, maxZoom: function(e) { return e === void 0 ? this._private.maxZoom : this.zoomRange({ max: e }); }, getZoomedViewport: function(e) { var r = this._private, n = r.pan, a = r.zoom, i, o, s = false; if (r.zoomingEnabled || (s = true), be(e) ? o = e : Xe(e) && (o = e.level, e.position != null ? i = nl(e.position, a, n) : e.renderedPosition != null && (i = e.renderedPosition), i != null && !r.panningEnabled && (s = true)), o = o > r.maxZoom ? r.maxZoom : o, o = o < r.minZoom ? r.minZoom : o, s || !be(o) || o === a || i != null && (!be(i.x) || !be(i.y))) return null; if (i != null) { var u = n, l = a, c = o, d = { x: -c / l * (i.x - u.x) + i.x, y: -c / l * (i.y - u.y) + i.y }; return { zoomed: true, panned: true, zoom: c, pan: d }; } else return { zoomed: true, panned: false, zoom: o, pan: n }; }, zoom: function(e) { if (e === void 0) return this._private.zoom; var r = this.getZoomedViewport(e), n = this._private; return r == null || !r.zoomed ? this : (n.zoom = r.zoom, r.panned && (n.pan.x = r.pan.x, n.pan.y = r.pan.y), this.emit("zoom" + (r.panned ? " pan" : "") + " viewport"), this.notify("viewport"), this); }, viewport: function(e) { var r = this._private, n = true, a = true, i = [], o = false, s = false; if (!e) return this; if (be(e.zoom) || (n = false), Xe(e.pan) || (a = false), !n && !a) return this; if (n) { var u = e.zoom; u < r.minZoom || u > r.maxZoom || !r.zoomingEnabled ? o = true : (r.zoom = u, i.push("zoom")); } if (a && (!o || !e.cancelOnFailedZoom) && r.panningEnabled) { var l = e.pan; be(l.x) && (r.pan.x = l.x, s = false), be(l.y) && (r.pan.y = l.y, s = false), s || i.push("pan"); } return i.length > 0 && (i.push("viewport"), this.emit(i.join(" ")), this.notify("viewport")), this; }, center: function(e) { var r = this.getCenterPan(e); return r && (this._private.pan = r, this.emit("pan viewport"), this.notify("viewport")), this; }, getCenterPan: function(e, r) { if (this._private.panningEnabled) { if (Ie(e)) { var n = e; e = this.mutableElements().filter(n); } else yr(e) || (e = this.mutableElements()); if (e.length !== 0) { var a = e.boundingBox(), i = this.width(), o = this.height(); r = r === void 0 ? this._private.zoom : r; var s = { // middle x: (i - r * (a.x1 + a.x2)) / 2, y: (o - r * (a.y1 + a.y2)) / 2 }; return s; } } }, reset: function() { return !this._private.panningEnabled || !this._private.zoomingEnabled ? this : (this.viewport({ pan: { x: 0, y: 0 }, zoom: 1 }), this); }, invalidateSize: function() { this._private.sizeCache = null; }, size: function() { var e = this._private, r = e.container, n = this; return e.sizeCache = e.sizeCache || (r ? function() { var a = n.window().getComputedStyle(r), i = function(s) { return parseFloat(a.getPropertyValue(s)); }; return { width: r.clientWidth - i("padding-left") - i("padding-right"), height: r.clientHeight - i("padding-top") - i("padding-bottom") }; }() : { // fallback if no container (not 0 b/c can be used for dividing etc) width: 1, height: 1 }); }, width: function() { return this.size().width; }, height: function() { return this.size().height; }, extent: function() { var e = this._private.pan, r = this._private.zoom, n = this.renderedExtent(), a = { x1: (n.x1 - e.x) / r, x2: (n.x2 - e.x) / r, y1: (n.y1 - e.y) / r, y2: (n.y2 - e.y) / r }; return a.w = a.x2 - a.x1, a.h = a.y2 - a.y1, a; }, renderedExtent: function() { var e = this.width(), r = this.height(); return { x1: 0, y1: 0, x2: e, y2: r, w: e, h: r }; }, multiClickDebounceTime: function(e) { if (e) this._private.multiClickDebounceTime = e; else return this._private.multiClickDebounceTime; return this; } }; xa.centre = xa.center; xa.autolockNodes = xa.autolock; xa.autoungrabifyNodes = xa.autoungrabify; var co = { data: et.data({ field: "data", bindingEvent: "data", allowBinding: true, allowSetting: true, settingEvent: "data", settingTriggersEvent: true, triggerFnName: "trigger", allowGetting: true, updateStyle: true }), removeData: et.removeData({ field: "data", event: "data", triggerFnName: "trigger", triggerEvent: true, updateStyle: true }), scratch: et.data({ field: "scratch", bindingEvent: "scratch", allowBinding: true, allowSetting: true, settingEvent: "scratch", settingTriggersEvent: true, triggerFnName: "trigger", allowGetting: true, updateStyle: true }), removeScratch: et.removeData({ field: "scratch", event: "scratch", triggerFnName: "trigger", triggerEvent: true, updateStyle: true }) }; co.attr = co.data; co.removeAttr = co.removeData; var fo = function(e) { var r = this; e = Re({}, e); var n = e.container; n && !Ds(n) && Ds(n[0]) && (n = n[0]); var a = n ? n._cyreg : null; a = a || {}, a && a.cy && (a.cy.destroy(), a = {}); var i = a.readies = a.readies || []; n && (n._cyreg = a), a.cy = r; var o = Ot !== void 0 && n !== void 0 && !e.headless, s = e; s.layout = Re({ name: o ? "grid" : "null" }, s.layout), s.renderer = Re({ name: o ? "canvas" : "null" }, s.renderer); var u = function(f, p, m) { return p !== void 0 ? p : m !== void 0 ? m : f; }, l = this._private = { container: n, // html dom ele container ready: false, // whether ready has been triggered options: s, // cached options elements: new Gt(this), // elements in the graph listeners: [], // list of listeners aniEles: new Gt(this), // elements being animated data: s.data || {}, // data for the core scratch: {}, // scratch object for core layout: null, renderer: null, destroyed: false, // whether destroy was called notificationsEnabled: true, // whether notifications are sent to the renderer minZoom: 1e-50, maxZoom: 1e50, zoomingEnabled: u(true, s.zoomingEnabled), userZoomingEnabled: u(true, s.userZoomingEnabled), panningEnabled: u(true, s.panningEnabled), userPanningEnabled: u(true, s.userPanningEnabled), boxSelectionEnabled: u(true, s.boxSelectionEnabled), autolock: u(false, s.autolock, s.autolockNodes), autoungrabify: u(false, s.autoungrabify, s.autoungrabifyNodes), autounselectify: u(false, s.autounselectify), styleEnabled: s.styleEnabled === void 0 ? o : s.styleEnabled, zoom: be(s.zoom) ? s.zoom : 1, pan: { x: Xe(s.pan) && be(s.pan.x) ? s.pan.x : 0, y: Xe(s.pan) && be(s.pan.y) ? s.pan.y : 0 }, animation: { // object for currently-running animations current: [], queue: [] }, hasCompoundNodes: false, multiClickDebounceTime: u(250, s.multiClickDebounceTime) }; this.createEmitter(), this.selectionType(s.selectionType), this.zoomRange({ min: s.minZoom, max: s.maxZoom }); var c = function(f, p) { var m = f.some(cT); if (m) return hi.all(f).then(p); p(f); }; l.styleEnabled && r.setStyle([]); var d = Re({}, s, s.renderer); r.initRenderer(d); var v = function(f, p, m) { r.notifications(false); var g = r.mutableElements(); g.length > 0 && g.remove(), f != null && (Xe(f) || st(f)) && r.add(f), r.one("layoutready", function(b) { r.notifications(true), r.emit(b), r.one("load", p), r.emitAndNotify("load"); }).one("layoutstop", function() { r.one("done", m), r.emit("done"); }); var y = Re({}, r._private.options.layout); y.eles = r.elements(), r.layout(y).run(); }; c([s.style, s.elements], function(h6) { var f = h6[0], p = h6[1]; l.styleEnabled && r.style().append(f), v(p, function() { r.startAnimationLoop(), l.ready = true, pt(s.ready) && r.on("ready", s.ready); for (var m = 0; m < i.length; m++) { var g = i[m]; r.on("ready", g); } a && (a.readies = []), r.emit("ready"); }, s.done); }); }; var Ms = fo.prototype; Re(Ms, { instanceString: function() { return "core"; }, isReady: function() { return this._private.ready; }, destroyed: function() { return this._private.destroyed; }, ready: function(e) { return this.isReady() ? this.emitter().emit("ready", [], e) : this.on("ready", e), this; }, destroy: function() { var e = this; if (!e.destroyed()) return e.stopAnimationLoop(), e.destroyRenderer(), this.emit("destroy"), e._private.destroyed = true, e; }, hasElementWithId: function(e) { return this._private.elements.hasElementWithId(e); }, getElementById: function(e) { return this._private.elements.getElementById(e); }, hasCompoundNodes: function() { return this._private.hasCompoundNodes; }, headless: function() { return this._private.renderer.isHeadless(); }, styleEnabled: function() { return this._private.styleEnabled; }, addToPool: function(e) { return this._private.elements.merge(e), this; }, removeFromPool: function(e) { return this._private.elements.unmerge(e), this; }, container: function() { return this._private.container || null; }, window: function() { var e = this._private.container; if (e == null) return Ot; var r = this._private.container.ownerDocument; return r === void 0 || r == null ? Ot : r.defaultView || Ot; }, mount: function(e) { if (e != null) { var r = this, n = r._private, a = n.options; return !Ds(e) && Ds(e[0]) && (e = e[0]), r.stopAnimationLoop(), r.destroyRenderer(), n.container = e, n.styleEnabled = true, r.invalidateSize(), r.initRenderer(Re({}, a, a.renderer, { // allow custom renderer name to be re-used, otherwise use canvas name: a.renderer.name === "null" ? "canvas" : a.renderer.name })), r.startAnimationLoop(), r.style(a.style), r.emit("mount"), r; } }, unmount: function() { var e = this; return e.stopAnimationLoop(), e.destroyRenderer(), e.initRenderer({ name: "null" }), e.emit("unmount"), e; }, options: function() { return Zr(this._private.options); }, json: function(e) { var r = this, n = r._private, a = r.mutableElements(), i = function(w) { return r.getElementById(w.id()); }; if (Xe(e)) { if (r.startBatch(), e.elements) { var o = {}, s = function(w, C) { for (var E = [], x = [], T = 0; T < w.length; T++) { var k = w[T]; if (!k.data.id) { tt("cy.json() cannot handle elements without an ID attribute"); continue; } var _ = "" + k.data.id, D = r.getElementById(_); o[_] = true, D.length !== 0 ? x.push({ ele: D, json: k }) : (C && (k.group = C), E.push(k)); } r.add(E); for (var O = 0; O < x.length; O++) { var I = x[O], L = I.ele, B = I.json; L.json(B); } }; if (st(e.elements)) s(e.elements); else for (var u = ["nodes", "edges"], l = 0; l < u.length; l++) { var c = u[l], d = e.elements[c]; st(d) && s(d, c); } var v = r.collection(); a.filter(function(b) { return !o[b.id()]; }).forEach(function(b) { b.isParent() ? v.merge(b) : b.remove(); }), v.forEach(function(b) { return b.children().move({ parent: null }); }), v.forEach(function(b) { return i(b).remove(); }); } e.style && r.style(e.style), e.zoom != null && e.zoom !== n.zoom && r.zoom(e.zoom), e.pan && (e.pan.x !== n.pan.x || e.pan.y !== n.pan.y) && r.pan(e.pan), e.data && r.data(e.data); for (var h6 = ["minZoom", "maxZoom", "zoomingEnabled", "userZoomingEnabled", "panningEnabled", "userPanningEnabled", "boxSelectionEnabled", "autolock", "autoungrabify", "autounselectify", "multiClickDebounceTime"], f = 0; f < h6.length; f++) { var p = h6[f]; e[p] != null && r[p](e[p]); } return r.endBatch(), this; } else { var m = !!e, g = {}; m ? g.elements = this.elements().map(function(b) { return b.json(); }) : (g.elements = {}, a.forEach(function(b) { var w = b.group(); g.elements[w] || (g.elements[w] = []), g.elements[w].push(b.json()); })), this._private.styleEnabled && (g.style = r.style().json()), g.data = Zr(r.data()); var y = n.options; return g.zoomingEnabled = n.zoomingEnabled, g.userZoomingEnabled = n.userZoomingEnabled, g.zoom = n.zoom, g.minZoom = n.minZoom, g.maxZoom = n.maxZoom, g.panningEnabled = n.panningEnabled, g.userPanningEnabled = n.userPanningEnabled, g.pan = Zr(n.pan), g.boxSelectionEnabled = n.boxSelectionEnabled, g.renderer = Zr(y.renderer), g.hideEdgesOnViewport = y.hideEdgesOnViewport, g.textureOnViewport = y.textureOnViewport, g.wheelSensitivity = y.wheelSensitivity, g.motionBlur = y.motionBlur, g.multiClickDebounceTime = y.multiClickDebounceTime, g; } } }); Ms.$id = Ms.getElementById; [XD, tP, Xp, vu, hs, nP, hu, ps, oP, xa, co].forEach(function(t13) { Re(Ms, t13); }); var lP = { fit: true, // whether to fit the viewport to the graph directed: false, // whether the tree is directed downwards (or edges can point in any direction if false) padding: 30, // padding on fit circle: false, // put depths in concentric circles if true, put depths top down if false grid: false, // whether to create an even grid into which the DAG is placed (circle:false only) spacingFactor: 1.75, // positive spacing factor, larger => more space between nodes (N.B. n/a if causes overlap) boundingBox: void 0, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } avoidOverlap: true, // prevents node overlap, may overflow boundingBox if not enough space nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm roots: void 0, // the roots of the trees depthSort: void 0, // a sorting function to order nodes at equal depth. e.g. function(a, b){ return a.data('weight') - b.data('weight') } animate: false, // whether to transition the node positions animationDuration: 500, // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled, animateFilter: function(e, r) { return true; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop transform: function(e, r) { return r; } // transform a given node position. Useful for changing flow direction in discrete layouts }; var uP = { maximal: false, // whether to shift nodes down their natural BFS depths in order to avoid upwards edges (DAGS only); setting acyclic to true sets maximal to true also acyclic: false // whether the tree is acyclic and thus a node could be shifted (due to the maximal option) multiple times without causing an infinite loop; setting to true sets maximal to true also; if you are uncertain whether a tree is acyclic, set to false to avoid potential infinite loops }; var Ba = function(e) { return e.scratch("breadthfirst"); }; var Wf = function(e, r) { return e.scratch("breadthfirst", r); }; function jp(t13) { this.options = Re({}, lP, uP, t13); } jp.prototype.run = function() { var t13 = this.options, e = t13, r = t13.cy, n = e.eles, a = n.nodes().filter(function(fe) { return !fe.isParent(); }), i = n, o = e.directed, s = e.acyclic || e.maximal || e.maximalAdjustments > 0, u = pr(e.boundingBox ? e.boundingBox : { x1: 0, y1: 0, w: r.width(), h: r.height() }), l; if (yr(e.roots)) l = e.roots; else if (st(e.roots)) { for (var c = [], d = 0; d < e.roots.length; d++) { var v = e.roots[d], h6 = r.getElementById(v); c.push(h6); } l = r.collection(c); } else if (Ie(e.roots)) l = r.$(e.roots); else if (o) l = a.roots(); else { var f = n.components(); l = r.collection(); for (var p = function(me) { var xe = f[me], ke = xe.maxDegree(false), Ce = xe.filter(function(De) { return De.degree(false) === ke; }); l = l.add(Ce); }, m = 0; m < f.length; m++) p(m); } var g = [], y = {}, b = function(me, xe) { g[xe] == null && (g[xe] = []); var ke = g[xe].length; g[xe].push(me), Wf(me, { index: ke, depth: xe }); }, w = function(me, xe) { var ke = Ba(me), Ce = ke.depth, De = ke.index; g[Ce][De] = null, b(me, xe); }; i.bfs({ roots: l, directed: e.directed, visit: function(me, xe, ke, Ce, De) { var qe = me[0], Ke = qe.id(); b(qe, De), y[Ke] = true; } }); for (var C = [], E = 0; E < a.length; E++) { var x = a[E]; y[x.id()] || C.push(x); } var T = function(me) { for (var xe = g[me], ke = 0; ke < xe.length; ke++) { var Ce = xe[ke]; if (Ce == null) { xe.splice(ke, 1), ke--; continue; } Wf(Ce, { depth: me, index: ke }); } }, k = function() { for (var me = 0; me < g.length; me++) T(me); }, _ = function(me, xe) { for (var ke = Ba(me), Ce = me.incomers().filter(function(S) { return S.isNode() && n.has(S); }), De = -1, qe = me.id(), Ke = 0; Ke < Ce.length; Ke++) { var Be = Ce[Ke], Ge = Ba(Be); De = Math.max(De, Ge.depth); } if (ke.depth <= De) { if (!e.acyclic && xe[qe]) return null; var le = De + 1; return w(me, le), xe[qe] = le, true; } return false; }; if (o && s) { var D = [], O = {}, I = function(me) { return D.push(me); }, L = function() { return D.shift(); }; for (a.forEach(function(fe) { return D.push(fe); }); D.length > 0; ) { var B = L(), F = _(B, O); if (F) B.outgoers().filter(function(fe) { return fe.isNode() && n.has(fe); }).forEach(I); else if (F === null) { tt("Detected double maximal shift for node `" + B.id() + "`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs."); break; } } } k(); var M = 0; if (e.avoidOverlap) for (var A = 0; A < a.length; A++) { var R = a[A], K = R.layoutDimensions(e), H = K.w, q = K.h; M = Math.max(M, H, q); } var ee = {}, se = function(me) { if (ee[me.id()]) return ee[me.id()]; for (var xe = Ba(me).depth, ke = me.neighborhood(), Ce = 0, De = 0, qe = 0; qe < ke.length; qe++) { var Ke = ke[qe]; if (!(Ke.isEdge() || Ke.isParent() || !a.has(Ke))) { var Be = Ba(Ke); if (Be != null) { var Ge = Be.index, le = Be.depth; if (!(Ge == null || le == null)) { var S = g[le].length; le < xe && (Ce += Ge / S, De++); } } } } return De = Math.max(1, De), Ce = Ce / De, De === 0 && (Ce = 0), ee[me.id()] = Ce, Ce; }, oe = function(me, xe) { var ke = se(me), Ce = se(xe), De = ke - Ce; return De === 0 ? jh(me.id(), xe.id()) : De; }; e.depthSort !== void 0 && (oe = e.depthSort); for (var ae = 0; ae < g.length; ae++) g[ae].sort(oe), T(ae); for (var ue = [], te = 0; te < C.length; te++) ue.push(C[te]); g.unshift(ue), k(); for (var $ = 0, G = 0; G < g.length; G++) $ = Math.max(g[G].length, $); var Q = { x: u.x1 + u.w / 2, y: u.x1 + u.h / 2 }, ge = g.reduce(function(fe, me) { return Math.max(fe, me.length); }, 0), Ee = function(me) { var xe = Ba(me), ke = xe.depth, Ce = xe.index, De = g[ke].length, qe = Math.max(u.w / ((e.grid ? ge : De) + 1), M), Ke = Math.max(u.h / (g.length + 1), M), Be = Math.min(u.w / 2 / g.length, u.h / 2 / g.length); if (Be = Math.max(Be, M), e.circle) { var le = Be * ke + Be - (g.length > 0 && g[0].length <= 3 ? Be / 2 : 0), S = 2 * Math.PI / g[ke].length * Ce; return ke === 0 && g[0].length === 1 && (le = 1), { x: Q.x + le * Math.cos(S), y: Q.y + le * Math.sin(S) }; } else { var Ge = { x: Q.x + (Ce + 1 - (De + 1) / 2) * qe, y: (ke + 1) * Ke }; return Ge; } }; return n.nodes().layoutPositions(this, e, Ee), this; }; var cP = { fit: true, // whether to fit the viewport to the graph padding: 30, // the padding on fit boundingBox: void 0, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } avoidOverlap: true, // prevents node overlap, may overflow boundingBox and radius if not enough space nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm spacingFactor: void 0, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up radius: void 0, // the radius of the circle startAngle: 3 / 2 * Math.PI, // where nodes start in radians sweep: void 0, // how many radians should be between the first and last node (defaults to full circle) clockwise: true, // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) sort: void 0, // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') } animate: false, // whether to transition the node positions animationDuration: 500, // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled animateFilter: function(e, r) { return true; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop transform: function(e, r) { return r; } // transform a given node position. Useful for changing flow direction in discrete layouts }; function Qp(t13) { this.options = Re({}, cP, t13); } Qp.prototype.run = function() { var t13 = this.options, e = t13, r = t13.cy, n = e.eles, a = e.counterclockwise !== void 0 ? !e.counterclockwise : e.clockwise, i = n.nodes().not(":parent"); e.sort && (i = i.sort(e.sort)); for (var o = pr(e.boundingBox ? e.boundingBox : { x1: 0, y1: 0, w: r.width(), h: r.height() }), s = { x: o.x1 + o.w / 2, y: o.y1 + o.h / 2 }, u = e.sweep === void 0 ? 2 * Math.PI - 2 * Math.PI / i.length : e.sweep, l = u / Math.max(1, i.length - 1), c, d = 0, v = 0; v < i.length; v++) { var h6 = i[v], f = h6.layoutDimensions(e), p = f.w, m = f.h; d = Math.max(d, p, m); } if (be(e.radius) ? c = e.radius : i.length <= 1 ? c = 0 : c = Math.min(o.h, o.w) / 2 - d, i.length > 1 && e.avoidOverlap) { d *= 1.75; var g = Math.cos(l) - Math.cos(0), y = Math.sin(l) - Math.sin(0), b = Math.sqrt(d * d / (g * g + y * y)); c = Math.max(b, c); } var w = function(E, x) { var T = e.startAngle + x * l * (a ? 1 : -1), k = c * Math.cos(T), _ = c * Math.sin(T), D = { x: s.x + k, y: s.y + _ }; return D; }; return n.nodes().layoutPositions(this, e, w), this; }; var dP = { fit: true, // whether to fit the viewport to the graph padding: 30, // the padding on fit startAngle: 3 / 2 * Math.PI, // where nodes start in radians sweep: void 0, // how many radians should be between the first and last node (defaults to full circle) clockwise: true, // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) equidistant: false, // whether levels have an equal radial distance betwen them, may cause bounding box overflow minNodeSpacing: 10, // min spacing between outside of nodes (used for radius adjustment) boundingBox: void 0, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } avoidOverlap: true, // prevents node overlap, may overflow boundingBox if not enough space nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm height: void 0, // height of layout area (overrides container height) width: void 0, // width of layout area (overrides container width) spacingFactor: void 0, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up concentric: function(e) { return e.degree(); }, levelWidth: function(e) { return e.maxDegree() / 4; }, animate: false, // whether to transition the node positions animationDuration: 500, // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled animateFilter: function(e, r) { return true; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop transform: function(e, r) { return r; } // transform a given node position. Useful for changing flow direction in discrete layouts }; function Jp(t13) { this.options = Re({}, dP, t13); } Jp.prototype.run = function() { for (var t13 = this.options, e = t13, r = e.counterclockwise !== void 0 ? !e.counterclockwise : e.clockwise, n = t13.cy, a = e.eles, i = a.nodes().not(":parent"), o = pr(e.boundingBox ? e.boundingBox : { x1: 0, y1: 0, w: n.width(), h: n.height() }), s = { x: o.x1 + o.w / 2, y: o.y1 + o.h / 2 }, u = [], l = 0, c = 0; c < i.length; c++) { var d = i[c], v = void 0; v = e.concentric(d), u.push({ value: v, node: d }), d._private.scratch.concentric = v; } i.updateStyle(); for (var h6 = 0; h6 < i.length; h6++) { var f = i[h6], p = f.layoutDimensions(e); l = Math.max(l, p.w, p.h); } u.sort(function(fe, me) { return me.value - fe.value; }); for (var m = e.levelWidth(i), g = [[]], y = g[0], b = 0; b < u.length; b++) { var w = u[b]; if (y.length > 0) { var C = Math.abs(y[0].value - w.value); C >= m && (y = [], g.push(y)); } y.push(w); } var E = l + e.minNodeSpacing; if (!e.avoidOverlap) { var x = g.length > 0 && g[0].length > 1, T = Math.min(o.w, o.h) / 2 - E, k = T / (g.length + x ? 1 : 0); E = Math.min(E, k); } for (var _ = 0, D = 0; D < g.length; D++) { var O = g[D], I = e.sweep === void 0 ? 2 * Math.PI - 2 * Math.PI / O.length : e.sweep, L = O.dTheta = I / Math.max(1, O.length - 1); if (O.length > 1 && e.avoidOverlap) { var B = Math.cos(L) - Math.cos(0), F = Math.sin(L) - Math.sin(0), M = Math.sqrt(E * E / (B * B + F * F)); _ = Math.max(M, _); } O.r = _, _ += E; } if (e.equidistant) { for (var A = 0, R = 0, K = 0; K < g.length; K++) { var H = g[K], q = H.r - R; A = Math.max(A, q); } R = 0; for (var ee = 0; ee < g.length; ee++) { var se = g[ee]; ee === 0 && (R = se.r), se.r = R, R += A; } } for (var oe = {}, ae = 0; ae < g.length; ae++) for (var ue = g[ae], te = ue.dTheta, $ = ue.r, G = 0; G < ue.length; G++) { var Q = ue[G], ge = e.startAngle + (r ? 1 : -1) * te * G, Ee = { x: s.x + $ * Math.cos(ge), y: s.y + $ * Math.sin(ge) }; oe[Q.node.id()] = Ee; } return a.nodes().layoutPositions(this, e, function(fe) { var me = fe.id(); return oe[me]; }), this; }; var Hl; var fP = { // Called on `layoutready` ready: function() { }, // Called on `layoutstop` stop: function() { }, // Whether to animate while running the layout // true : Animate continuously as the layout is running // false : Just show the end result // 'end' : Animate with the end result, from the initial positions to the end positions animate: true, // Easing of the animation for animate:'end' animationEasing: void 0, // The duration of the animation for animate:'end' animationDuration: void 0, // A function that determines whether the node should be animated // All nodes animated by default on animate enabled // Non-animated nodes are positioned immediately when the layout starts animateFilter: function(e, r) { return true; }, // The layout animates only after this many milliseconds for animate:true // (prevents flashing on fast runs) animationThreshold: 250, // Number of iterations between consecutive screen positions update refresh: 20, // Whether to fit the network view after when done fit: true, // Padding on fit padding: 30, // Constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } boundingBox: void 0, // Excludes the label when calculating node bounding boxes for the layout algorithm nodeDimensionsIncludeLabels: false, // Randomize the initial positions of the nodes (true) or use existing positions (false) randomize: false, // Extra spacing between components in non-compound graphs componentSpacing: 40, // Node repulsion (non overlapping) multiplier nodeRepulsion: function(e) { return 2048; }, // Node repulsion (overlapping) multiplier nodeOverlap: 4, // Ideal edge (non nested) length idealEdgeLength: function(e) { return 32; }, // Divisor to compute edge forces edgeElasticity: function(e) { return 32; }, // Nesting factor (multiplier) to compute ideal edge length for nested edges nestingFactor: 1.2, // Gravity force (constant) gravity: 1, // Maximum number of iterations to perform numIter: 1e3, // Initial temperature (maximum node displacement) initialTemp: 1e3, // Cooling factor (how the temperature is reduced between consecutive iterations coolingFactor: 0.99, // Lower temperature threshold (below this point the layout will end) minTemp: 1 }; function hl(t13) { this.options = Re({}, fP, t13), this.options.layout = this; var e = this.options.eles.nodes(), r = this.options.eles.edges(), n = r.filter(function(a) { var i = a.source().data("id"), o = a.target().data("id"), s = e.some(function(l) { return l.data("id") === i; }), u = e.some(function(l) { return l.data("id") === o; }); return !s || !u; }); this.options.eles = this.options.eles.not(n); } hl.prototype.run = function() { var t13 = this.options, e = t13.cy, r = this; r.stopped = false, (t13.animate === true || t13.animate === false) && r.emit({ type: "layoutstart", layout: r }), t13.debug === true ? Hl = true : Hl = false; var n = vP(e, r, t13); Hl && gP(n), t13.randomize && mP(n); var a = gn(), i = function() { yP(n, e, t13), t13.fit === true && e.fit(t13.padding); }, o = function(v) { return !(r.stopped || v >= t13.numIter || (bP(n, t13), n.temperature = n.temperature * t13.coolingFactor, n.temperature < t13.minTemp)); }, s = function() { if (t13.animate === true || t13.animate === false) i(), r.one("layoutstop", t13.stop), r.emit({ type: "layoutstop", layout: r }); else { var v = t13.eles.nodes(), h6 = eg(n, t13, v); v.layoutPositions(r, t13, h6); } }, u = 0, l = true; if (t13.animate === true) { var c = function d() { for (var v = 0; l && v < t13.refresh; ) l = o(u), u++, v++; if (!l) Zf(n, t13), s(); else { var h6 = gn(); h6 - a >= t13.animationThreshold && i(), Ps(d); } }; c(); } else { for (; l; ) l = o(u), u++; Zf(n, t13), s(); } return this; }; hl.prototype.stop = function() { return this.stopped = true, this.thread && this.thread.stop(), this.emit("layoutstop"), this; }; hl.prototype.destroy = function() { return this.thread && this.thread.stop(), this; }; var vP = function(e, r, n) { for (var a = n.eles.edges(), i = n.eles.nodes(), o = pr(n.boundingBox ? n.boundingBox : { x1: 0, y1: 0, w: e.width(), h: e.height() }), s = { isCompound: e.hasCompoundNodes(), layoutNodes: [], idToIndex: {}, nodeSize: i.size(), graphSet: [], indexToGraph: [], layoutEdges: [], edgeSize: a.size(), temperature: n.initialTemp, clientWidth: o.w, clientHeight: o.h, boundingBox: o }, u = n.eles.components(), l = {}, c = 0; c < u.length; c++) for (var d = u[c], v = 0; v < d.length; v++) { var h6 = d[v]; l[h6.id()] = c; } for (var c = 0; c < s.nodeSize; c++) { var f = i[c], p = f.layoutDimensions(n), m = {}; m.isLocked = f.locked(), m.id = f.data("id"), m.parentId = f.data("parent"), m.cmptId = l[f.id()], m.children = [], m.positionX = f.position("x"), m.positionY = f.position("y"), m.offsetX = 0, m.offsetY = 0, m.height = p.w, m.width = p.h, m.maxX = m.positionX + m.width / 2, m.minX = m.positionX - m.width / 2, m.maxY = m.positionY + m.height / 2, m.minY = m.positionY - m.height / 2, m.padLeft = parseFloat(f.style("padding")), m.padRight = parseFloat(f.style("padding")), m.padTop = parseFloat(f.style("padding")), m.padBottom = parseFloat(f.style("padding")), m.nodeRepulsion = pt(n.nodeRepulsion) ? n.nodeRepulsion(f) : n.nodeRepulsion, s.layoutNodes.push(m), s.idToIndex[m.id] = c; } for (var g = [], y = 0, b = -1, w = [], c = 0; c < s.nodeSize; c++) { var f = s.layoutNodes[c], C = f.parentId; C != null ? s.layoutNodes[s.idToIndex[C]].children.push(f.id) : (g[++b] = f.id, w.push(f.id)); } for (s.graphSet.push(w); y <= b; ) { var E = g[y++], x = s.idToIndex[E], h6 = s.layoutNodes[x], T = h6.children; if (T.length > 0) { s.graphSet.push(T); for (var c = 0; c < T.length; c++) g[++b] = T[c]; } } for (var c = 0; c < s.graphSet.length; c++) for (var k = s.graphSet[c], v = 0; v < k.length; v++) { var _ = s.idToIndex[k[v]]; s.indexToGraph[_] = c; } for (var c = 0; c < s.edgeSize; c++) { var D = a[c], O = {}; O.id = D.data("id"), O.sourceId = D.data("source"), O.targetId = D.data("target"); var I = pt(n.idealEdgeLength) ? n.idealEdgeLength(D) : n.idealEdgeLength, L = pt(n.edgeElasticity) ? n.edgeElasticity(D) : n.edgeElasticity, B = s.idToIndex[O.sourceId], F = s.idToIndex[O.targetId], M = s.indexToGraph[B], A = s.indexToGraph[F]; if (M != A) { for (var R = hP(O.sourceId, O.targetId, s), K = s.graphSet[R], H = 0, m = s.layoutNodes[B]; K.indexOf(m.id) === -1; ) m = s.layoutNodes[s.idToIndex[m.parentId]], H++; for (m = s.layoutNodes[F]; K.indexOf(m.id) === -1; ) m = s.layoutNodes[s.idToIndex[m.parentId]], H++; I *= H * n.nestingFactor; } O.idealLength = I, O.elasticity = L, s.layoutEdges.push(O); } return s; }; var hP = function(e, r, n) { var a = pP(e, r, 0, n); return 2 > a.count ? 0 : a.graph; }; var pP = function t10(e, r, n, a) { var i = a.graphSet[n]; if (-1 < i.indexOf(e) && -1 < i.indexOf(r)) return { count: 2, graph: n }; for (var o = 0, s = 0; s < i.length; s++) { var u = i[s], l = a.idToIndex[u], c = a.layoutNodes[l].children; if (c.length !== 0) { var d = a.indexToGraph[a.idToIndex[c[0]]], v = t10(e, r, d, a); if (v.count !== 0) if (v.count === 1) { if (o++, o === 2) break; } else return v; } } return { count: o, graph: n }; }; var gP; var mP = function(e, r) { for (var n = e.clientWidth, a = e.clientHeight, i = 0; i < e.nodeSize; i++) { var o = e.layoutNodes[i]; o.children.length === 0 && !o.isLocked && (o.positionX = Math.random() * n, o.positionY = Math.random() * a); } }; var eg = function(e, r, n) { var a = e.boundingBox, i = { x1: 1 / 0, x2: -1 / 0, y1: 1 / 0, y2: -1 / 0 }; return r.boundingBox && (n.forEach(function(o) { var s = e.layoutNodes[e.idToIndex[o.data("id")]]; i.x1 = Math.min(i.x1, s.positionX), i.x2 = Math.max(i.x2, s.positionX), i.y1 = Math.min(i.y1, s.positionY), i.y2 = Math.max(i.y2, s.positionY); }), i.w = i.x2 - i.x1, i.h = i.y2 - i.y1), function(o, s) { var u = e.layoutNodes[e.idToIndex[o.data("id")]]; if (r.boundingBox) { var l = (u.positionX - i.x1) / i.w, c = (u.positionY - i.y1) / i.h; return { x: a.x1 + l * a.w, y: a.y1 + c * a.h }; } else return { x: u.positionX, y: u.positionY }; }; }; var yP = function(e, r, n) { var a = n.layout, i = n.eles.nodes(), o = eg(e, n, i); i.positions(o), e.ready !== true && (e.ready = true, a.one("layoutready", n.ready), a.emit({ type: "layoutready", layout: this })); }; var bP = function(e, r, n) { wP(e, r), EP(e), kP(e, r), SP(e), TP(e); }; var wP = function(e, r) { for (var n = 0; n < e.graphSet.length; n++) for (var a = e.graphSet[n], i = a.length, o = 0; o < i; o++) for (var s = e.layoutNodes[e.idToIndex[a[o]]], u = o + 1; u < i; u++) { var l = e.layoutNodes[e.idToIndex[a[u]]]; xP(s, l, e, r); } }; var Yf = function(e) { return -e + 2 * e * Math.random(); }; var xP = function(e, r, n, a) { var i = e.cmptId, o = r.cmptId; if (!(i !== o && !n.isCompound)) { var s = r.positionX - e.positionX, u = r.positionY - e.positionY, l = 1; s === 0 && u === 0 && (s = Yf(l), u = Yf(l)); var c = CP(e, r, s, u); if (c > 0) var d = a.nodeOverlap * c, v = Math.sqrt(s * s + u * u), h6 = d * s / v, f = d * u / v; else var p = Bs(e, s, u), m = Bs(r, -1 * s, -1 * u), g = m.x - p.x, y = m.y - p.y, b = g * g + y * y, v = Math.sqrt(b), d = (e.nodeRepulsion + r.nodeRepulsion) / b, h6 = d * g / v, f = d * y / v; e.isLocked || (e.offsetX -= h6, e.offsetY -= f), r.isLocked || (r.offsetX += h6, r.offsetY += f); } }; var CP = function(e, r, n, a) { if (n > 0) var i = e.maxX - r.minX; else var i = r.maxX - e.minX; if (a > 0) var o = e.maxY - r.minY; else var o = r.maxY - e.minY; return i >= 0 && o >= 0 ? Math.sqrt(i * i + o * o) : 0; }; var Bs = function(e, r, n) { var a = e.positionX, i = e.positionY, o = e.height || 1, s = e.width || 1, u = n / r, l = o / s, c = {}; return r === 0 && 0 < n || r === 0 && 0 > n ? (c.x = a, c.y = i + o / 2, c) : 0 < r && -1 * l <= u && u <= l ? (c.x = a + s / 2, c.y = i + s * n / 2 / r, c) : 0 > r && -1 * l <= u && u <= l ? (c.x = a - s / 2, c.y = i - s * n / 2 / r, c) : 0 < n && (u <= -1 * l || u >= l) ? (c.x = a + o * r / 2 / n, c.y = i + o / 2, c) : (0 > n && (u <= -1 * l || u >= l) && (c.x = a - o * r / 2 / n, c.y = i - o / 2), c); }; var EP = function(e, r) { for (var n = 0; n < e.edgeSize; n++) { var a = e.layoutEdges[n], i = e.idToIndex[a.sourceId], o = e.layoutNodes[i], s = e.idToIndex[a.targetId], u = e.layoutNodes[s], l = u.positionX - o.positionX, c = u.positionY - o.positionY; if (!(l === 0 && c === 0)) { var d = Bs(o, l, c), v = Bs(u, -1 * l, -1 * c), h6 = v.x - d.x, f = v.y - d.y, p = Math.sqrt(h6 * h6 + f * f), m = Math.pow(a.idealLength - p, 2) / a.elasticity; if (p !== 0) var g = m * h6 / p, y = m * f / p; else var g = 0, y = 0; o.isLocked || (o.offsetX += g, o.offsetY += y), u.isLocked || (u.offsetX -= g, u.offsetY -= y); } } }; var kP = function(e, r) { if (r.gravity !== 0) for (var n = 1, a = 0; a < e.graphSet.length; a++) { var i = e.graphSet[a], o = i.length; if (a === 0) var s = e.clientHeight / 2, u = e.clientWidth / 2; else var l = e.layoutNodes[e.idToIndex[i[0]]], c = e.layoutNodes[e.idToIndex[l.parentId]], s = c.positionX, u = c.positionY; for (var d = 0; d < o; d++) { var v = e.layoutNodes[e.idToIndex[i[d]]]; if (!v.isLocked) { var h6 = s - v.positionX, f = u - v.positionY, p = Math.sqrt(h6 * h6 + f * f); if (p > n) { var m = r.gravity * h6 / p, g = r.gravity * f / p; v.offsetX += m, v.offsetY += g; } } } } }; var SP = function(e, r) { var n = [], a = 0, i = -1; for (n.push.apply(n, e.graphSet[0]), i += e.graphSet[0].length; a <= i; ) { var o = n[a++], s = e.idToIndex[o], u = e.layoutNodes[s], l = u.children; if (0 < l.length && !u.isLocked) { for (var c = u.offsetX, d = u.offsetY, v = 0; v < l.length; v++) { var h6 = e.layoutNodes[e.idToIndex[l[v]]]; h6.offsetX += c, h6.offsetY += d, n[++i] = l[v]; } u.offsetX = 0, u.offsetY = 0; } } }; var TP = function(e, r) { for (var n = 0; n < e.nodeSize; n++) { var a = e.layoutNodes[n]; 0 < a.children.length && (a.maxX = void 0, a.minX = void 0, a.maxY = void 0, a.minY = void 0); } for (var n = 0; n < e.nodeSize; n++) { var a = e.layoutNodes[n]; if (!(0 < a.children.length || a.isLocked)) { var i = _P(a.offsetX, a.offsetY, e.temperature); a.positionX += i.x, a.positionY += i.y, a.offsetX = 0, a.offsetY = 0, a.minX = a.positionX - a.width, a.maxX = a.positionX + a.width, a.minY = a.positionY - a.height, a.maxY = a.positionY + a.height, DP(a, e); } } for (var n = 0; n < e.nodeSize; n++) { var a = e.layoutNodes[n]; 0 < a.children.length && !a.isLocked && (a.positionX = (a.maxX + a.minX) / 2, a.positionY = (a.maxY + a.minY) / 2, a.width = a.maxX - a.minX, a.height = a.maxY - a.minY); } }; var _P = function(e, r, n) { var a = Math.sqrt(e * e + r * r); if (a > n) var i = { x: n * e / a, y: n * r / a }; else var i = { x: e, y: r }; return i; }; var DP = function t11(e, r) { var n = e.parentId; if (n != null) { var a = r.layoutNodes[r.idToIndex[n]], i = false; if ((a.maxX == null || e.maxX + a.padRight > a.maxX) && (a.maxX = e.maxX + a.padRight, i = true), (a.minX == null || e.minX - a.padLeft < a.minX) && (a.minX = e.minX - a.padLeft, i = true), (a.maxY == null || e.maxY + a.padBottom > a.maxY) && (a.maxY = e.maxY + a.padBottom, i = true), (a.minY == null || e.minY - a.padTop < a.minY) && (a.minY = e.minY - a.padTop, i = true), i) return t11(a, r); } }; var Zf = function(e, r) { for (var n = e.layoutNodes, a = [], i = 0; i < n.length; i++) { var o = n[i], s = o.cmptId, u = a[s] = a[s] || []; u.push(o); } for (var l = 0, i = 0; i < a.length; i++) { var c = a[i]; if (c) { c.x1 = 1 / 0, c.x2 = -1 / 0, c.y1 = 1 / 0, c.y2 = -1 / 0; for (var d = 0; d < c.length; d++) { var v = c[d]; c.x1 = Math.min(c.x1, v.positionX - v.width / 2), c.x2 = Math.max(c.x2, v.positionX + v.width / 2), c.y1 = Math.min(c.y1, v.positionY - v.height / 2), c.y2 = Math.max(c.y2, v.positionY + v.height / 2); } c.w = c.x2 - c.x1, c.h = c.y2 - c.y1, l += c.w * c.h; } } a.sort(function(y, b) { return b.w * b.h - y.w * y.h; }); for (var h6 = 0, f = 0, p = 0, m = 0, g = Math.sqrt(l) * e.clientWidth / e.clientHeight, i = 0; i < a.length; i++) { var c = a[i]; if (c) { for (var d = 0; d < c.length; d++) { var v = c[d]; v.isLocked || (v.positionX += h6 - c.x1, v.positionY += f - c.y1); } h6 += c.w + r.componentSpacing, p += c.w + r.componentSpacing, m = Math.max(m, c.h), p > g && (f += m + r.componentSpacing, h6 = 0, p = 0, m = 0); } } }; var PP = { fit: true, // whether to fit the viewport to the graph padding: 30, // padding used on fit boundingBox: void 0, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } avoidOverlap: true, // prevents node overlap, may overflow boundingBox if not enough space avoidOverlapPadding: 10, // extra spacing around nodes when avoidOverlap: true nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm spacingFactor: void 0, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up condense: false, // uses all available space on false, uses minimal space on true rows: void 0, // force num of rows in the grid cols: void 0, // force num of columns in the grid position: function(e) { }, // returns { row, col } for element sort: void 0, // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') } animate: false, // whether to transition the node positions animationDuration: 500, // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled animateFilter: function(e, r) { return true; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop transform: function(e, r) { return r; } // transform a given node position. Useful for changing flow direction in discrete layouts }; function tg(t13) { this.options = Re({}, PP, t13); } tg.prototype.run = function() { var t13 = this.options, e = t13, r = t13.cy, n = e.eles, a = n.nodes().not(":parent"); e.sort && (a = a.sort(e.sort)); var i = pr(e.boundingBox ? e.boundingBox : { x1: 0, y1: 0, w: r.width(), h: r.height() }); if (i.h === 0 || i.w === 0) n.nodes().layoutPositions(this, e, function(ee) { return { x: i.x1, y: i.y1 }; }); else { var o = a.size(), s = Math.sqrt(o * i.h / i.w), u = Math.round(s), l = Math.round(i.w / i.h * s), c = function(se) { if (se == null) return Math.min(u, l); var oe = Math.min(u, l); oe == u ? u = se : l = se; }, d = function(se) { if (se == null) return Math.max(u, l); var oe = Math.max(u, l); oe == u ? u = se : l = se; }, v = e.rows, h6 = e.cols != null ? e.cols : e.columns; if (v != null && h6 != null) u = v, l = h6; else if (v != null && h6 == null) u = v, l = Math.ceil(o / u); else if (v == null && h6 != null) l = h6, u = Math.ceil(o / l); else if (l * u > o) { var f = c(), p = d(); (f - 1) * p >= o ? c(f - 1) : (p - 1) * f >= o && d(p - 1); } else for (; l * u < o; ) { var m = c(), g = d(); (g + 1) * m >= o ? d(g + 1) : c(m + 1); } var y = i.w / l, b = i.h / u; if (e.condense && (y = 0, b = 0), e.avoidOverlap) for (var w = 0; w < a.length; w++) { var C = a[w], E = C._private.position; (E.x == null || E.y == null) && (E.x = 0, E.y = 0); var x = C.layoutDimensions(e), T = e.avoidOverlapPadding, k = x.w + T, _ = x.h + T; y = Math.max(y, k), b = Math.max(b, _); } for (var D = {}, O = function(se, oe) { return !!D["c-" + se + "-" + oe]; }, I = function(se, oe) { D["c-" + se + "-" + oe] = true; }, L = 0, B = 0, F = function() { B++, B >= l && (B = 0, L++); }, M = {}, A = 0; A < a.length; A++) { var R = a[A], K = e.position(R); if (K && (K.row !== void 0 || K.col !== void 0)) { var H = { row: K.row, col: K.col }; if (H.col === void 0) for (H.col = 0; O(H.row, H.col); ) H.col++; else if (H.row === void 0) for (H.row = 0; O(H.row, H.col); ) H.row++; M[R.id()] = H, I(H.row, H.col); } } var q = function(se, oe) { var ae, ue; if (se.locked() || se.isParent()) return false; var te = M[se.id()]; if (te) ae = te.col * y + y / 2 + i.x1, ue = te.row * b + b / 2 + i.y1; else { for (; O(L, B); ) F(); ae = B * y + y / 2 + i.x1, ue = L * b + b / 2 + i.y1, I(L, B), F(); } return { x: ae, y: ue }; }; a.layoutPositions(this, e, q); } return this; }; var OP = { ready: function() { }, // on layoutready stop: function() { } // on layoutstop }; function Ec(t13) { this.options = Re({}, OP, t13); } Ec.prototype.run = function() { var t13 = this.options, e = t13.eles, r = this; return t13.cy, r.emit("layoutstart"), e.nodes().positions(function() { return { x: 0, y: 0 }; }), r.one("layoutready", t13.ready), r.emit("layoutready"), r.one("layoutstop", t13.stop), r.emit("layoutstop"), this; }; Ec.prototype.stop = function() { return this; }; var LP = { positions: void 0, // map of (node id) => (position obj); or function(node){ return somPos; } zoom: void 0, // the zoom level to set (prob want fit = false if set) pan: void 0, // the pan level to set (prob want fit = false if set) fit: true, // whether to fit to viewport padding: 30, // padding on fit spacingFactor: void 0, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up animate: false, // whether to transition the node positions animationDuration: 500, // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled animateFilter: function(e, r) { return true; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop transform: function(e, r) { return r; } // transform a given node position. Useful for changing flow direction in discrete layouts }; function rg(t13) { this.options = Re({}, LP, t13); } rg.prototype.run = function() { var t13 = this.options, e = t13.eles, r = e.nodes(), n = pt(t13.positions); function a(i) { if (t13.positions == null) return M5(i.position()); if (n) return t13.positions(i); var o = t13.positions[i._private.data.id]; return o ?? null; } return r.layoutPositions(this, t13, function(i, o) { var s = a(i); return i.locked() || s == null ? false : s; }), this; }; var FP = { fit: true, // whether to fit to viewport padding: 30, // fit padding boundingBox: void 0, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } animate: false, // whether to transition the node positions animationDuration: 500, // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled animateFilter: function(e, r) { return true; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop transform: function(e, r) { return r; } // transform a given node position. Useful for changing flow direction in discrete layouts }; function ng(t13) { this.options = Re({}, FP, t13); } ng.prototype.run = function() { var t13 = this.options, e = t13.cy, r = t13.eles, n = pr(t13.boundingBox ? t13.boundingBox : { x1: 0, y1: 0, w: e.width(), h: e.height() }), a = function(o, s) { return { x: n.x1 + Math.round(Math.random() * n.w), y: n.y1 + Math.round(Math.random() * n.h) }; }; return r.nodes().layoutPositions(this, t13, a), this; }; var IP = [{ name: "breadthfirst", impl: jp }, { name: "circle", impl: Qp }, { name: "concentric", impl: Jp }, { name: "cose", impl: hl }, { name: "grid", impl: tg }, { name: "null", impl: Ec }, { name: "preset", impl: rg }, { name: "random", impl: ng }]; function ag(t13) { this.options = t13, this.notifications = 0; } var Xf = function() { }; var jf = function() { throw new Error("A headless instance can not render images"); }; ag.prototype = { recalculateRenderedStyle: Xf, notify: function() { this.notifications++; }, init: Xf, isHeadless: function() { return true; }, png: jf, jpg: jf }; var kc = {}; kc.arrowShapeWidth = 0.3; kc.registerArrowShapes = function() { var t13 = this.arrowShapes = {}, e = this, r = function(l, c, d, v, h6, f, p) { var m = h6.x - d / 2 - p, g = h6.x + d / 2 + p, y = h6.y - d / 2 - p, b = h6.y + d / 2 + p, w = m <= l && l <= g && y <= c && c <= b; return w; }, n = function(l, c, d, v, h6) { var f = l * Math.cos(v) - c * Math.sin(v), p = l * Math.sin(v) + c * Math.cos(v), m = f * d, g = p * d, y = m + h6.x, b = g + h6.y; return { x: y, y: b }; }, a = function(l, c, d, v) { for (var h6 = [], f = 0; f < l.length; f += 2) { var p = l[f], m = l[f + 1]; h6.push(n(p, m, c, d, v)); } return h6; }, i = function(l) { for (var c = [], d = 0; d < l.length; d++) { var v = l[d]; c.push(v.x, v.y); } return c; }, o = function(l) { return l.pstyle("width").pfValue * l.pstyle("arrow-scale").pfValue * 2; }, s = function(l, c) { Ie(c) && (c = t13[c]), t13[l] = Re({ name: l, points: [-0.15, -0.3, 0.15, -0.3, 0.15, 0.3, -0.15, 0.3], collide: function(v, h6, f, p, m, g) { var y = i(a(this.points, f + 2 * g, p, m)), b = dr(v, h6, y); return b; }, roughCollide: r, draw: function(v, h6, f, p) { var m = a(this.points, h6, f, p); e.arrowShapeImpl("polygon")(v, m); }, spacing: function(v) { return 0; }, gap: o }, c); }; s("none", { collide: Os, roughCollide: Os, draw: uc, spacing: sf, gap: sf }), s("triangle", { points: [-0.15, -0.3, 0, 0, 0.15, -0.3] }), s("arrow", "triangle"), s("triangle-backcurve", { points: t13.triangle.points, controlPoint: [0, -0.15], roughCollide: r, draw: function(l, c, d, v, h6) { var f = a(this.points, c, d, v), p = this.controlPoint, m = n(p[0], p[1], c, d, v); e.arrowShapeImpl(this.name)(l, f, m); }, gap: function(l) { return o(l) * 0.8; } }), s("triangle-tee", { points: [0, 0, 0.15, -0.3, -0.15, -0.3, 0, 0], pointsTee: [-0.15, -0.4, -0.15, -0.5, 0.15, -0.5, 0.15, -0.4], collide: function(l, c, d, v, h6, f, p) { var m = i(a(this.points, d + 2 * p, v, h6)), g = i(a(this.pointsTee, d + 2 * p, v, h6)), y = dr(l, c, m) || dr(l, c, g); return y; }, draw: function(l, c, d, v, h6) { var f = a(this.points, c, d, v), p = a(this.pointsTee, c, d, v); e.arrowShapeImpl(this.name)(l, f, p); } }), s("circle-triangle", { radius: 0.15, pointsTr: [0, -0.15, 0.15, -0.45, -0.15, -0.45, 0, -0.15], collide: function(l, c, d, v, h6, f, p) { var m = h6, g = Math.pow(m.x - l, 2) + Math.pow(m.y - c, 2) <= Math.pow((d + 2 * p) * this.radius, 2), y = i(a(this.points, d + 2 * p, v, h6)); return dr(l, c, y) || g; }, draw: function(l, c, d, v, h6) { var f = a(this.pointsTr, c, d, v); e.arrowShapeImpl(this.name)(l, f, v.x, v.y, this.radius * c); }, spacing: function(l) { return e.getArrowWidth(l.pstyle("width").pfValue, l.pstyle("arrow-scale").value) * this.radius; } }), s("triangle-cross", { points: [0, 0, 0.15, -0.3, -0.15, -0.3, 0, 0], baseCrossLinePts: [ -0.15, -0.4, // first half of the rectangle -0.15, -0.4, 0.15, -0.4, // second half of the rectangle 0.15, -0.4 ], crossLinePts: function(l, c) { var d = this.baseCrossLinePts.slice(), v = c / l, h6 = 3, f = 5; return d[h6] = d[h6] - v, d[f] = d[f] - v, d; }, collide: function(l, c, d, v, h6, f, p) { var m = i(a(this.points, d + 2 * p, v, h6)), g = i(a(this.crossLinePts(d, f), d + 2 * p, v, h6)), y = dr(l, c, m) || dr(l, c, g); return y; }, draw: function(l, c, d, v, h6) { var f = a(this.points, c, d, v), p = a(this.crossLinePts(c, h6), c, d, v); e.arrowShapeImpl(this.name)(l, f, p); } }), s("vee", { points: [-0.15, -0.3, 0, 0, 0.15, -0.3, 0, -0.15], gap: function(l) { return o(l) * 0.525; } }), s("circle", { radius: 0.15, collide: function(l, c, d, v, h6, f, p) { var m = h6, g = Math.pow(m.x - l, 2) + Math.pow(m.y - c, 2) <= Math.pow((d + 2 * p) * this.radius, 2); return g; }, draw: function(l, c, d, v, h6) { e.arrowShapeImpl(this.name)(l, v.x, v.y, this.radius * c); }, spacing: function(l) { return e.getArrowWidth(l.pstyle("width").pfValue, l.pstyle("arrow-scale").value) * this.radius; } }), s("tee", { points: [-0.15, 0, -0.15, -0.1, 0.15, -0.1, 0.15, 0], spacing: function(l) { return 1; }, gap: function(l) { return 1; } }), s("square", { points: [-0.15, 0, 0.15, 0, 0.15, -0.3, -0.15, -0.3] }), s("diamond", { points: [-0.15, -0.15, 0, -0.3, 0.15, -0.15, 0, 0], gap: function(l) { return l.pstyle("width").pfValue * l.pstyle("arrow-scale").value; } }), s("chevron", { points: [0, 0, -0.15, -0.15, -0.1, -0.2, 0, -0.1, 0.1, -0.2, 0.15, -0.15], gap: function(l) { return 0.95 * l.pstyle("width").pfValue * l.pstyle("arrow-scale").value; } }); }; var Da = {}; Da.projectIntoViewport = function(t13, e) { var r = this.cy, n = this.findContainerClientCoords(), a = n[0], i = n[1], o = n[4], s = r.pan(), u = r.zoom(), l = ((t13 - a) / o - s.x) / u, c = ((e - i) / o - s.y) / u; return [l, c]; }; Da.findContainerClientCoords = function() { if (this.containerBB) return this.containerBB; var t13 = this.container, e = t13.getBoundingClientRect(), r = this.cy.window().getComputedStyle(t13), n = function(g) { return parseFloat(r.getPropertyValue(g)); }, a = { left: n("padding-left"), right: n("padding-right"), top: n("padding-top"), bottom: n("padding-bottom") }, i = { left: n("border-left-width"), right: n("border-right-width"), top: n("border-top-width"), bottom: n("border-bottom-width") }, o = t13.clientWidth, s = t13.clientHeight, u = a.left + a.right, l = a.top + a.bottom, c = i.left + i.right, d = e.width / (o + c), v = o - u, h6 = s - l, f = e.left + a.left + i.left, p = e.top + a.top + i.top; return this.containerBB = [f, p, v, h6, d]; }; Da.invalidateContainerClientCoordsCache = function() { this.containerBB = null; }; Da.findNearestElement = function(t13, e, r, n) { return this.findNearestElements(t13, e, r, n)[0]; }; Da.findNearestElements = function(t13, e, r, n) { var a = this, i = this, o = i.getCachedZSortedEles(), s = [], u = i.cy.zoom(), l = i.cy.hasCompoundNodes(), c = (n ? 24 : 8) / u, d = (n ? 8 : 2) / u, v = (n ? 8 : 2) / u, h6 = 1 / 0, f, p; r && (o = o.interactive); function m(x, T) { if (x.isNode()) { if (p) return; p = x, s.push(x); } if (x.isEdge() && (T == null || T < h6)) if (f) { if (f.pstyle("z-compound-depth").value === x.pstyle("z-compound-depth").value && f.pstyle("z-compound-depth").value === x.pstyle("z-compound-depth").value) { for (var k = 0; k < s.length; k++) if (s[k].isEdge()) { s[k] = x, f = x, h6 = T ?? h6; break; } } } else s.push(x), f = x, h6 = T ?? h6; } function g(x) { var T = x.outerWidth() + 2 * d, k = x.outerHeight() + 2 * d, _ = T / 2, D = k / 2, O = x.position(), I = x.pstyle("corner-radius").value === "auto" ? "auto" : x.pstyle("corner-radius").pfValue, L = x._private.rscratch; if (O.x - _ <= t13 && t13 <= O.x + _ && O.y - D <= e && e <= O.y + D) { var B = i.nodeShapes[a.getNodeShape(x)]; if (B.checkPoint(t13, e, 0, T, k, O.x, O.y, I, L)) return m(x, 0), true; } } function y(x) { var T = x._private, k = T.rscratch, _ = x.pstyle("width").pfValue, D = x.pstyle("arrow-scale").value, O = _ / 2 + c, I = O * O, L = O * 2, A = T.source, R = T.target, B; if (k.edgeType === "segments" || k.edgeType === "straight" || k.edgeType === "haystack") { for (var F = k.allpts, M = 0; M + 3 < F.length; M += 2) if (Y5(t13, e, F[M], F[M + 1], F[M + 2], F[M + 3], L) && I > (B = J5(t13, e, F[M], F[M + 1], F[M + 2], F[M + 3]))) return m(x, B), true; } else if (k.edgeType === "bezier" || k.edgeType === "multibezier" || k.edgeType === "self" || k.edgeType === "compound") { for (var F = k.allpts, M = 0; M + 5 < k.allpts.length; M += 4) if (Z5(t13, e, F[M], F[M + 1], F[M + 2], F[M + 3], F[M + 4], F[M + 5], L) && I > (B = Q5(t13, e, F[M], F[M + 1], F[M + 2], F[M + 3], F[M + 4], F[M + 5]))) return m(x, B), true; } for (var A = A || T.source, R = R || T.target, K = a.getArrowWidth(_, D), H = [{ name: "source", x: k.arrowStartX, y: k.arrowStartY, angle: k.srcArrowAngle }, { name: "target", x: k.arrowEndX, y: k.arrowEndY, angle: k.tgtArrowAngle }, { name: "mid-source", x: k.midX, y: k.midY, angle: k.midsrcArrowAngle }, { name: "mid-target", x: k.midX, y: k.midY, angle: k.midtgtArrowAngle }], M = 0; M < H.length; M++) { var q = H[M], ee = i.arrowShapes[x.pstyle(q.name + "-arrow-shape").value], se = x.pstyle("width").pfValue; if (ee.roughCollide(t13, e, K, q.angle, { x: q.x, y: q.y }, se, c) && ee.collide(t13, e, K, q.angle, { x: q.x, y: q.y }, se, c)) return m(x), true; } l && s.length > 0 && (g(A), g(R)); } function b(x, T, k) { return Nr(x, T, k); } function w(x, T) { var k = x._private, _ = v, D; T ? D = T + "-" : D = "", x.boundingBox(); var O = k.labelBounds[T || "main"], I = x.pstyle(D + "label").value, L = x.pstyle("text-events").strValue === "yes"; if (!(!L || !I)) { var B = b(k.rscratch, "labelX", T), F = b(k.rscratch, "labelY", T), M = b(k.rscratch, "labelAngle", T), A = x.pstyle(D + "text-margin-x").pfValue, R = x.pstyle(D + "text-margin-y").pfValue, K = O.x1 - _ - A, H = O.x2 + _ - A, q = O.y1 - _ - R, ee = O.y2 + _ - R; if (M) { var se = Math.cos(M), oe = Math.sin(M), ae = function(Ee, fe) { return Ee = Ee - B, fe = fe - F, { x: Ee * se - fe * oe + B, y: Ee * oe + fe * se + F }; }, ue = ae(K, q), te = ae(K, ee), $ = ae(H, q), G = ae(H, ee), Q = [ // with the margin added after the rotation is applied ue.x + A, ue.y + R, $.x + A, $.y + R, G.x + A, G.y + R, te.x + A, te.y + R ]; if (dr(t13, e, Q)) return m(x), true; } else if (oi(O, t13, e)) return m(x), true; } } for (var C = o.length - 1; C >= 0; C--) { var E = o[C]; E.isNode() ? g(E) || w(E) : y(E) || w(E) || w(E, "source") || w(E, "target"); } return s; }; Da.getAllInBox = function(t13, e, r, n) { var a = this.getCachedZSortedEles().interactive, i = [], o = Math.min(t13, r), s = Math.max(t13, r), u = Math.min(e, n), l = Math.max(e, n); t13 = o, r = s, e = u, n = l; for (var c = pr({ x1: t13, y1: e, x2: r, y2: n }), d = 0; d < a.length; d++) { var v = a[d]; if (v.isNode()) { var h6 = v, f = h6.boundingBox({ includeNodes: true, includeEdges: false, includeLabels: false }); fc(c, f) && !vp(f, c) && i.push(h6); } else { var p = v, m = p._private, g = m.rscratch; if (g.startX != null && g.startY != null && !oi(c, g.startX, g.startY) || g.endX != null && g.endY != null && !oi(c, g.endX, g.endY)) continue; if (g.edgeType === "bezier" || g.edgeType === "multibezier" || g.edgeType === "self" || g.edgeType === "compound" || g.edgeType === "segments" || g.edgeType === "haystack") { for (var y = m.rstyle.bezierPts || m.rstyle.linePts || m.rstyle.haystackPts, b = true, w = 0; w < y.length; w++) if (!W5(c, y[w])) { b = false; break; } b && i.push(p); } else (g.edgeType === "haystack" || g.edgeType === "straight") && i.push(p); } } return i; }; var Ns = {}; Ns.calculateArrowAngles = function(t13) { var e = t13._private.rscratch, r = e.edgeType === "haystack", n = e.edgeType === "bezier", a = e.edgeType === "multibezier", i = e.edgeType === "segments", o = e.edgeType === "compound", s = e.edgeType === "self", u, l, c, d, v, h6, g, y; if (r ? (c = e.haystackPts[0], d = e.haystackPts[1], v = e.haystackPts[2], h6 = e.haystackPts[3]) : (c = e.arrowStartX, d = e.arrowStartY, v = e.arrowEndX, h6 = e.arrowEndY), g = e.midX, y = e.midY, i) u = c - e.segpts[0], l = d - e.segpts[1]; else if (a || o || s || n) { var f = e.allpts, p = Nt(f[0], f[2], f[4], 0.1), m = Nt(f[1], f[3], f[5], 0.1); u = c - p, l = d - m; } else u = c - g, l = d - y; e.srcArrowAngle = Wo(u, l); var g = e.midX, y = e.midY; if (r && (g = (c + v) / 2, y = (d + h6) / 2), u = v - c, l = h6 - d, i) { var f = e.allpts; if (f.length / 2 % 2 === 0) { var b = f.length / 2, w = b - 2; u = f[b] - f[w], l = f[b + 1] - f[w + 1]; } else if (e.isRound) u = e.midVector[1], l = -e.midVector[0]; else { var b = f.length / 2 - 1, w = b - 2; u = f[b] - f[w], l = f[b + 1] - f[w + 1]; } } else if (a || o || s) { var f = e.allpts, C = e.ctrlpts, E, x, T, k; if (C.length / 2 % 2 === 0) { var _ = f.length / 2 - 1, D = _ + 2, O = D + 2; E = Nt(f[_], f[D], f[O], 0), x = Nt(f[_ + 1], f[D + 1], f[O + 1], 0), T = Nt(f[_], f[D], f[O], 1e-4), k = Nt(f[_ + 1], f[D + 1], f[O + 1], 1e-4); } else { var D = f.length / 2 - 1, _ = D - 2, O = D + 2; E = Nt(f[_], f[D], f[O], 0.4999), x = Nt(f[_ + 1], f[D + 1], f[O + 1], 0.4999), T = Nt(f[_], f[D], f[O], 0.5), k = Nt(f[_ + 1], f[D + 1], f[O + 1], 0.5); } u = T - E, l = k - x; } if (e.midtgtArrowAngle = Wo(u, l), e.midDispX = u, e.midDispY = l, u *= -1, l *= -1, i) { var f = e.allpts; if (f.length / 2 % 2 !== 0) { if (!e.isRound) { var b = f.length / 2 - 1, I = b + 2; u = -(f[I] - f[b]), l = -(f[I + 1] - f[b + 1]); } } } if (e.midsrcArrowAngle = Wo(u, l), i) u = v - e.segpts[e.segpts.length - 2], l = h6 - e.segpts[e.segpts.length - 1]; else if (a || o || s || n) { var f = e.allpts, L = f.length, p = Nt(f[L - 6], f[L - 4], f[L - 2], 0.9), m = Nt(f[L - 5], f[L - 3], f[L - 1], 0.9); u = v - p, l = h6 - m; } else u = v - g, l = h6 - y; e.tgtArrowAngle = Wo(u, l); }; Ns.getArrowWidth = Ns.getArrowHeight = function(t13, e) { var r = this.arrowWidthCache = this.arrowWidthCache || {}, n = r[t13 + ", " + e]; return n || (n = Math.max(Math.pow(t13 * 13.37, 0.9), 29) * e, r[t13 + ", " + e] = n, n); }; var pu; var gu; var Yr = {}; var Cr = {}; var Qf; var Jf; var oa; var gs; var un; var ea; var na; var Wr; var Na; var rs; var ig; var og; var mu; var yu; var ev; var tv = function(e, r, n) { n.x = r.x - e.x, n.y = r.y - e.y, n.len = Math.sqrt(n.x * n.x + n.y * n.y), n.nx = n.x / n.len, n.ny = n.y / n.len, n.ang = Math.atan2(n.ny, n.nx); }; var AP = function(e, r) { r.x = e.x * -1, r.y = e.y * -1, r.nx = e.nx * -1, r.ny = e.ny * -1, r.ang = e.ang > 0 ? -(Math.PI - e.ang) : Math.PI + e.ang; }; var MP = function(e, r, n, a, i) { if (e !== ev ? tv(r, e, Yr) : AP(Cr, Yr), tv(r, n, Cr), Qf = Yr.nx * Cr.ny - Yr.ny * Cr.nx, Jf = Yr.nx * Cr.nx - Yr.ny * -Cr.ny, un = Math.asin(Math.max(-1, Math.min(1, Qf))), Math.abs(un) < 1e-6) { pu = r.x, gu = r.y, na = Na = 0; return; } oa = 1, gs = false, Jf < 0 ? un < 0 ? un = Math.PI + un : (un = Math.PI - un, oa = -1, gs = true) : un > 0 && (oa = -1, gs = true), r.radius !== void 0 ? Na = r.radius : Na = a, ea = un / 2, rs = Math.min(Yr.len / 2, Cr.len / 2), i ? (Wr = Math.abs(Math.cos(ea) * Na / Math.sin(ea)), Wr > rs ? (Wr = rs, na = Math.abs(Wr * Math.sin(ea) / Math.cos(ea))) : na = Na) : (Wr = Math.min(rs, Na), na = Math.abs(Wr * Math.sin(ea) / Math.cos(ea))), mu = r.x + Cr.nx * Wr, yu = r.y + Cr.ny * Wr, pu = mu - Cr.ny * na * oa, gu = yu + Cr.nx * na * oa, ig = r.x + Yr.nx * Wr, og = r.y + Yr.ny * Wr, ev = r; }; function sg(t13, e) { e.radius === 0 ? t13.lineTo(e.cx, e.cy) : t13.arc(e.cx, e.cy, e.radius, e.startAngle, e.endAngle, e.counterClockwise); } function Sc(t13, e, r, n) { var a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true; return n === 0 || e.radius === 0 ? { cx: e.x, cy: e.y, radius: 0, startX: e.x, startY: e.y, stopX: e.x, stopY: e.y, startAngle: void 0, endAngle: void 0, counterClockwise: void 0 } : (MP(t13, e, r, n, a), { cx: pu, cy: gu, radius: na, startX: ig, startY: og, stopX: mu, stopY: yu, startAngle: Yr.ang + Math.PI / 2 * oa, endAngle: Cr.ang - Math.PI / 2 * oa, counterClockwise: gs }); } var or = {}; or.findMidptPtsEtc = function(t13, e) { var r = e.posPts, n = e.intersectionPts, a = e.vectorNormInverse, i, o = t13.pstyle("source-endpoint"), s = t13.pstyle("target-endpoint"), u = o.units != null && s.units != null, l = function(C, E, x, T) { var k = T - E, _ = x - C, D = Math.sqrt(_ * _ + k * k); return { x: -k / D, y: _ / D }; }, c = t13.pstyle("edge-distances").value; switch (c) { case "node-position": i = r; break; case "intersection": i = n; break; case "endpoints": { if (u) { var d = this.manualEndptToPx(t13.source()[0], o), v = Mr(d, 2), h6 = v[0], f = v[1], p = this.manualEndptToPx(t13.target()[0], s), m = Mr(p, 2), g = m[0], y = m[1], b = { x1: h6, y1: f, x2: g, y2: y }; a = l(h6, f, g, y), i = b; } else tt("Edge ".concat(t13.id(), " has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")), i = n; break; } } return { midptPts: i, vectorNormInverse: a }; }; or.findHaystackPoints = function(t13) { for (var e = 0; e < t13.length; e++) { var r = t13[e], n = r._private, a = n.rscratch; if (!a.haystack) { var i = Math.random() * 2 * Math.PI; a.source = { x: Math.cos(i), y: Math.sin(i) }, i = Math.random() * 2 * Math.PI, a.target = { x: Math.cos(i), y: Math.sin(i) }; } var o = n.source, s = n.target, u = o.position(), l = s.position(), c = o.width(), d = s.width(), v = o.height(), h6 = s.height(), f = r.pstyle("haystack-radius").value, p = f / 2; a.haystackPts = a.allpts = [a.source.x * c * p + u.x, a.source.y * v * p + u.y, a.target.x * d * p + l.x, a.target.y * h6 * p + l.y], a.midX = (a.allpts[0] + a.allpts[2]) / 2, a.midY = (a.allpts[1] + a.allpts[3]) / 2, a.edgeType = "haystack", a.haystack = true, this.storeEdgeProjections(r), this.calculateArrowAngles(r), this.recalculateEdgeLabelProjections(r), this.calculateLabelAngles(r); } }; or.findSegmentsPoints = function(t13, e) { var r = t13._private.rscratch, n = t13.pstyle("segment-weights"), a = t13.pstyle("segment-distances"), i = t13.pstyle("segment-radii"), o = t13.pstyle("radius-type"), s = Math.min(n.pfValue.length, a.pfValue.length), u = i.pfValue[i.pfValue.length - 1], l = o.pfValue[o.pfValue.length - 1]; r.edgeType = "segments", r.segpts = [], r.radii = [], r.isArcRadius = []; for (var c = 0; c < s; c++) { var d = n.pfValue[c], v = a.pfValue[c], h6 = 1 - d, f = d, p = this.findMidptPtsEtc(t13, e), m = p.midptPts, g = p.vectorNormInverse, y = { x: m.x1 * h6 + m.x2 * f, y: m.y1 * h6 + m.y2 * f }; r.segpts.push(y.x + g.x * v, y.y + g.y * v), r.radii.push(i.pfValue[c] !== void 0 ? i.pfValue[c] : u), r.isArcRadius.push((o.pfValue[c] !== void 0 ? o.pfValue[c] : l) === "arc-radius"); } }; or.findLoopPoints = function(t13, e, r, n) { var a = t13._private.rscratch, i = e.dirCounts, o = e.srcPos, s = t13.pstyle("control-point-distances"), u = s ? s.pfValue[0] : void 0, l = t13.pstyle("loop-direction").pfValue, c = t13.pstyle("loop-sweep").pfValue, d = t13.pstyle("control-point-step-size").pfValue; a.edgeType = "self"; var v = r, h6 = d; n && (v = 0, h6 = u); var f = l - Math.PI / 2, p = f - c / 2, m = f + c / 2, g = l + "_" + c; v = i[g] === void 0 ? i[g] = 0 : ++i[g], a.ctrlpts = [o.x + Math.cos(p) * 1.4 * h6 * (v / 3 + 1), o.y + Math.sin(p) * 1.4 * h6 * (v / 3 + 1), o.x + Math.cos(m) * 1.4 * h6 * (v / 3 + 1), o.y + Math.sin(m) * 1.4 * h6 * (v / 3 + 1)]; }; or.findCompoundLoopPoints = function(t13, e, r, n) { var a = t13._private.rscratch; a.edgeType = "compound"; var i = e.srcPos, o = e.tgtPos, s = e.srcW, u = e.srcH, l = e.tgtW, c = e.tgtH, d = t13.pstyle("control-point-step-size").pfValue, v = t13.pstyle("control-point-distances"), h6 = v ? v.pfValue[0] : void 0, f = r, p = d; n && (f = 0, p = h6); var m = 50, g = { x: i.x - s / 2, y: i.y - u / 2 }, y = { x: o.x - l / 2, y: o.y - c / 2 }, b = { x: Math.min(g.x, y.x), y: Math.min(g.y, y.y) }, w = 0.5, C = Math.max(w, Math.log(s * 0.01)), E = Math.max(w, Math.log(l * 0.01)); a.ctrlpts = [b.x, b.y - (1 + Math.pow(m, 1.12) / 100) * p * (f / 3 + 1) * C, b.x - (1 + Math.pow(m, 1.12) / 100) * p * (f / 3 + 1) * E, b.y]; }; or.findStraightEdgePoints = function(t13) { t13._private.rscratch.edgeType = "straight"; }; or.findBezierPoints = function(t13, e, r, n, a) { var i = t13._private.rscratch, o = t13.pstyle("control-point-step-size").pfValue, s = t13.pstyle("control-point-distances"), u = t13.pstyle("control-point-weights"), l = s && u ? Math.min(s.value.length, u.value.length) : 1, c = s ? s.pfValue[0] : void 0, d = u.value[0], v = n; i.edgeType = v ? "multibezier" : "bezier", i.ctrlpts = []; for (var h6 = 0; h6 < l; h6++) { var f = (0.5 - e.eles.length / 2 + r) * o * (a ? -1 : 1), p = void 0, m = dp(f); v && (c = s ? s.pfValue[h6] : o, d = u.value[h6]), n ? p = c : p = c !== void 0 ? m * c : void 0; var g = p !== void 0 ? p : f, y = 1 - d, b = d, w = this.findMidptPtsEtc(t13, e), C = w.midptPts, E = w.vectorNormInverse, x = { x: C.x1 * y + C.x2 * b, y: C.y1 * y + C.y2 * b }; i.ctrlpts.push(x.x + E.x * g, x.y + E.y * g); } }; or.findTaxiPoints = function(t13, e) { var r = t13._private.rscratch; r.edgeType = "segments"; var n = "vertical", a = "horizontal", i = "leftward", o = "rightward", s = "downward", u = "upward", l = "auto", c = e.posPts, d = e.srcW, v = e.srcH, h6 = e.tgtW, f = e.tgtH, p = t13.pstyle("edge-distances").value, m = p !== "node-position", g = t13.pstyle("taxi-direction").value, y = g, b = t13.pstyle("taxi-turn"), w = b.units === "%", C = b.pfValue, E = C < 0, x = t13.pstyle("taxi-turn-min-distance").pfValue, T = m ? (d + h6) / 2 : 0, k = m ? (v + f) / 2 : 0, _ = c.x2 - c.x1, D = c.y2 - c.y1, O = function(Ae, Me) { return Ae > 0 ? Math.max(Ae - Me, 0) : Math.min(Ae + Me, 0); }, I = O(_, T), L = O(D, k), B = false; y === l ? g = Math.abs(I) > Math.abs(L) ? a : n : y === u || y === s ? (g = n, B = true) : (y === i || y === o) && (g = a, B = true); var F = g === n, M = F ? L : I, A = F ? D : _, R = dp(A), K = false; !(B && (w || E)) && (y === s && A < 0 || y === u && A > 0 || y === i && A > 0 || y === o && A < 0) && (R *= -1, M = R * Math.abs(M), K = true); var H; if (w) { var q = C < 0 ? 1 + C : C; H = q * M; } else { var ee = C < 0 ? M : 0; H = ee + C * R; } var se = function(Ae) { return Math.abs(Ae) < x || Math.abs(Ae) >= Math.abs(M); }, oe = se(H), ae = se(Math.abs(M) - Math.abs(H)), ue = oe || ae; if (ue && !K) if (F) { var te = Math.abs(A) <= v / 2, $ = Math.abs(_) <= h6 / 2; if (te) { var G = (c.x1 + c.x2) / 2, Q = c.y1, ge = c.y2; r.segpts = [G, Q, G, ge]; } else if ($) { var Ee = (c.y1 + c.y2) / 2, fe = c.x1, me = c.x2; r.segpts = [fe, Ee, me, Ee]; } else r.segpts = [c.x1, c.y2]; } else { var xe = Math.abs(A) <= d / 2, ke = Math.abs(D) <= f / 2; if (xe) { var Ce = (c.y1 + c.y2) / 2, De = c.x1, qe = c.x2; r.segpts = [De, Ce, qe, Ce]; } else if (ke) { var Ke = (c.x1 + c.x2) / 2, Be = c.y1, Ge = c.y2; r.segpts = [Ke, Be, Ke, Ge]; } else r.segpts = [c.x2, c.y1]; } else if (F) { var le = c.y1 + H + (m ? v / 2 * R : 0), S = c.x1, z = c.x2; r.segpts = [S, le, z, le]; } else { var ie = c.x1 + H + (m ? d / 2 * R : 0), j = c.y1, Y = c.y2; r.segpts = [ie, j, ie, Y]; } if (r.isRound) { var pe = t13.pstyle("taxi-radius").value, re = t13.pstyle("radius-type").value[0] === "arc-radius"; r.radii = new Array(r.segpts.length / 2).fill(pe), r.isArcRadius = new Array(r.segpts.length / 2).fill(re); } }; or.tryToCorrectInvalidPoints = function(t13, e) { var r = t13._private.rscratch; if (r.edgeType === "bezier") { var n = e.srcPos, a = e.tgtPos, i = e.srcW, o = e.srcH, s = e.tgtW, u = e.tgtH, l = e.srcShape, c = e.tgtShape, d = e.srcCornerRadius, v = e.tgtCornerRadius, h6 = e.srcRs, f = e.tgtRs, p = !be(r.startX) || !be(r.startY), m = !be(r.arrowStartX) || !be(r.arrowStartY), g = !be(r.endX) || !be(r.endY), y = !be(r.arrowEndX) || !be(r.arrowEndY), b = 3, w = this.getArrowWidth(t13.pstyle("width").pfValue, t13.pstyle("arrow-scale").value) * this.arrowShapeWidth, C = b * w, E = ya({ x: r.ctrlpts[0], y: r.ctrlpts[1] }, { x: r.startX, y: r.startY }), x = E < C, T = ya({ x: r.ctrlpts[0], y: r.ctrlpts[1] }, { x: r.endX, y: r.endY }), k = T < C, _ = false; if (p || m || x) { _ = true; var D = { // delta x: r.ctrlpts[0] - n.x, y: r.ctrlpts[1] - n.y }, O = Math.sqrt(D.x * D.x + D.y * D.y), I = { // normalised delta x: D.x / O, y: D.y / O }, L = Math.max(i, o), B = { // *2 radius guarantees outside shape x: r.ctrlpts[0] + I.x * 2 * L, y: r.ctrlpts[1] + I.y * 2 * L }, F = l.intersectLine(n.x, n.y, i, o, B.x, B.y, 0, d, h6); x ? (r.ctrlpts[0] = r.ctrlpts[0] + I.x * (C - E), r.ctrlpts[1] = r.ctrlpts[1] + I.y * (C - E)) : (r.ctrlpts[0] = F[0] + I.x * C, r.ctrlpts[1] = F[1] + I.y * C); } if (g || y || k) { _ = true; var M = { // delta x: r.ctrlpts[0] - a.x, y: r.ctrlpts[1] - a.y }, A = Math.sqrt(M.x * M.x + M.y * M.y), R = { // normalised delta x: M.x / A, y: M.y / A }, K = Math.max(i, o), H = { // *2 radius guarantees outside shape x: r.ctrlpts[0] + R.x * 2 * K, y: r.ctrlpts[1] + R.y * 2 * K }, q = c.intersectLine(a.x, a.y, s, u, H.x, H.y, 0, v, f); k ? (r.ctrlpts[0] = r.ctrlpts[0] + R.x * (C - T), r.ctrlpts[1] = r.ctrlpts[1] + R.y * (C - T)) : (r.ctrlpts[0] = q[0] + R.x * C, r.ctrlpts[1] = q[1] + R.y * C); } _ && this.findEndpoints(t13); } }; or.storeAllpts = function(t13) { var e = t13._private.rscratch; if (e.edgeType === "multibezier" || e.edgeType === "bezier" || e.edgeType === "self" || e.edgeType === "compound") { e.allpts = [], e.allpts.push(e.startX, e.startY); for (var r = 0; r + 1 < e.ctrlpts.length; r += 2) e.allpts.push(e.ctrlpts[r], e.ctrlpts[r + 1]), r + 3 < e.ctrlpts.length && e.allpts.push((e.ctrlpts[r] + e.ctrlpts[r + 2]) / 2, (e.ctrlpts[r + 1] + e.ctrlpts[r + 3]) / 2); e.allpts.push(e.endX, e.endY); var n, a; e.ctrlpts.length / 2 % 2 === 0 ? (n = e.allpts.length / 2 - 1, e.midX = e.allpts[n], e.midY = e.allpts[n + 1]) : (n = e.allpts.length / 2 - 3, a = 0.5, e.midX = Nt(e.allpts[n], e.allpts[n + 2], e.allpts[n + 4], a), e.midY = Nt(e.allpts[n + 1], e.allpts[n + 3], e.allpts[n + 5], a)); } else if (e.edgeType === "straight") e.allpts = [e.startX, e.startY, e.endX, e.endY], e.midX = (e.startX + e.endX + e.arrowStartX + e.arrowEndX) / 4, e.midY = (e.startY + e.endY + e.arrowStartY + e.arrowEndY) / 4; else if (e.edgeType === "segments") { if (e.allpts = [], e.allpts.push(e.startX, e.startY), e.allpts.push.apply(e.allpts, e.segpts), e.allpts.push(e.endX, e.endY), e.isRound) { e.roundCorners = []; for (var i = 2; i + 3 < e.allpts.length; i += 2) { var o = e.radii[i / 2 - 1], s = e.isArcRadius[i / 2 - 1]; e.roundCorners.push(Sc({ x: e.allpts[i - 2], y: e.allpts[i - 1] }, { x: e.allpts[i], y: e.allpts[i + 1], radius: o }, { x: e.allpts[i + 2], y: e.allpts[i + 3] }, o, s)); } } if (e.segpts.length % 4 === 0) { var u = e.segpts.length / 2, l = u - 2; e.midX = (e.segpts[l] + e.segpts[u]) / 2, e.midY = (e.segpts[l + 1] + e.segpts[u + 1]) / 2; } else { var c = e.segpts.length / 2 - 1; if (!e.isRound) e.midX = e.segpts[c], e.midY = e.segpts[c + 1]; else { var d = { x: e.segpts[c], y: e.segpts[c + 1] }, v = e.roundCorners[c / 2], h6 = [d.x - v.cx, d.y - v.cy], f = v.radius / Math.sqrt(Math.pow(h6[0], 2) + Math.pow(h6[1], 2)); h6 = h6.map(function(p) { return p * f; }), e.midX = v.cx + h6[0], e.midY = v.cy + h6[1], e.midVector = h6; } } } }; or.checkForInvalidEdgeWarning = function(t13) { var e = t13[0]._private.rscratch; e.nodesOverlap || be(e.startX) && be(e.startY) && be(e.endX) && be(e.endY) ? e.loggedErr = false : e.loggedErr || (e.loggedErr = true, tt("Edge `" + t13.id() + "` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap.")); }; or.findEdgeControlPoints = function(t13) { var e = this; if (!(!t13 || t13.length === 0)) { for (var r = this, n = r.cy, a = n.hasCompoundNodes(), i = { map: new Xr(), get: function(x) { var T = this.map.get(x[0]); return T != null ? T.get(x[1]) : null; }, set: function(x, T) { var k = this.map.get(x[0]); k == null && (k = new Xr(), this.map.set(x[0], k)), k.set(x[1], T); } }, o = [], s = [], u = 0; u < t13.length; u++) { var l = t13[u], c = l._private, d = l.pstyle("curve-style").value; if (!(l.removed() || !l.takesUpSpace())) { if (d === "haystack") { s.push(l); continue; } var v = d === "unbundled-bezier" || d.endsWith("segments") || d === "straight" || d === "straight-triangle" || d.endsWith("taxi"), h6 = d === "unbundled-bezier" || d === "bezier", f = c.source, p = c.target, m = f.poolIndex(), g = p.poolIndex(), y = [m, g].sort(), b = i.get(y); b == null && (b = { eles: [] }, i.set(y, b), o.push(y)), b.eles.push(l), v && (b.hasUnbundled = true), h6 && (b.hasBezier = true); } } for (var w = function(x) { var T = o[x], k = i.get(T), _ = void 0; if (!k.hasUnbundled) { var D = k.eles[0].parallelEdges().filter(function(ie) { return ie.isBundledBezier(); }); cc(k.eles), D.forEach(function(ie) { return k.eles.push(ie); }), k.eles.sort(function(ie, j) { return ie.poolIndex() - j.poolIndex(); }); } var O = k.eles[0], I = O.source(), L = O.target(); if (I.poolIndex() > L.poolIndex()) { var B = I; I = L, L = B; } var F = k.srcPos = I.position(), M = k.tgtPos = L.position(), A = k.srcW = I.outerWidth(), R = k.srcH = I.outerHeight(), K = k.tgtW = L.outerWidth(), H = k.tgtH = L.outerHeight(), q = k.srcShape = r.nodeShapes[e.getNodeShape(I)], ee = k.tgtShape = r.nodeShapes[e.getNodeShape(L)], se = k.srcCornerRadius = I.pstyle("corner-radius").value === "auto" ? "auto" : I.pstyle("corner-radius").pfValue, oe = k.tgtCornerRadius = L.pstyle("corner-radius").value === "auto" ? "auto" : L.pstyle("corner-radius").pfValue, ae = k.tgtRs = L._private.rscratch, ue = k.srcRs = I._private.rscratch; k.dirCounts = { north: 0, west: 0, south: 0, east: 0, northwest: 0, southwest: 0, northeast: 0, southeast: 0 }; for (var te = 0; te < k.eles.length; te++) { var $ = k.eles[te], G = $[0]._private.rscratch, Q = $.pstyle("curve-style").value, ge = Q === "unbundled-bezier" || Q.endsWith("segments") || Q.endsWith("taxi"), Ee = !I.same($.source()); if (!k.calculatedIntersection && I !== L && (k.hasBezier || k.hasUnbundled)) { k.calculatedIntersection = true; var fe = q.intersectLine(F.x, F.y, A, R, M.x, M.y, 0, se, ue), me = k.srcIntn = fe, xe = ee.intersectLine(M.x, M.y, K, H, F.x, F.y, 0, oe, ae), ke = k.tgtIntn = xe, Ce = k.intersectionPts = { x1: fe[0], x2: xe[0], y1: fe[1], y2: xe[1] }, De = k.posPts = { x1: F.x, x2: M.x, y1: F.y, y2: M.y }, qe = xe[1] - fe[1], Ke = xe[0] - fe[0], Be = Math.sqrt(Ke * Ke + qe * qe), Ge = k.vector = { x: Ke, y: qe }, le = k.vectorNorm = { x: Ge.x / Be, y: Ge.y / Be }, S = { x: -le.y, y: le.x }; k.nodesOverlap = !be(Be) || ee.checkPoint(fe[0], fe[1], 0, K, H, M.x, M.y, oe, ae) || q.checkPoint(xe[0], xe[1], 0, A, R, F.x, F.y, se, ue), k.vectorNormInverse = S, _ = { nodesOverlap: k.nodesOverlap, dirCounts: k.dirCounts, calculatedIntersection: true, hasBezier: k.hasBezier, hasUnbundled: k.hasUnbundled, eles: k.eles, srcPos: M, tgtPos: F, srcW: K, srcH: H, tgtW: A, tgtH: R, srcIntn: ke, tgtIntn: me, srcShape: ee, tgtShape: q, posPts: { x1: De.x2, y1: De.y2, x2: De.x1, y2: De.y1 }, intersectionPts: { x1: Ce.x2, y1: Ce.y2, x2: Ce.x1, y2: Ce.y1 }, vector: { x: -Ge.x, y: -Ge.y }, vectorNorm: { x: -le.x, y: -le.y }, vectorNormInverse: { x: -S.x, y: -S.y } }; } var z = Ee ? _ : k; G.nodesOverlap = z.nodesOverlap, G.srcIntn = z.srcIntn, G.tgtIntn = z.tgtIntn, G.isRound = Q.startsWith("round"), a && (I.isParent() || I.isChild() || L.isParent() || L.isChild()) && (I.parents().anySame(L) || L.parents().anySame(I) || I.same(L) && I.isParent()) ? e.findCompoundLoopPoints($, z, te, ge) : I === L ? e.findLoopPoints($, z, te, ge) : Q.endsWith("segments") ? e.findSegmentsPoints($, z) : Q.endsWith("taxi") ? e.findTaxiPoints($, z) : Q === "straight" || !ge && k.eles.length % 2 === 1 && te === Math.floor(k.eles.length / 2) ? e.findStraightEdgePoints($) : e.findBezierPoints($, z, te, ge, Ee), e.findEndpoints($), e.tryToCorrectInvalidPoints($, z), e.checkForInvalidEdgeWarning($), e.storeAllpts($), e.storeEdgeProjections($), e.calculateArrowAngles($), e.recalculateEdgeLabelProjections($), e.calculateLabelAngles($); } }, C = 0; C < o.length; C++) w(C); this.findHaystackPoints(s); } }; function lg(t13) { var e = []; if (t13 != null) { for (var r = 0; r < t13.length; r += 2) { var n = t13[r], a = t13[r + 1]; e.push({ x: n, y: a }); } return e; } } or.getSegmentPoints = function(t13) { var e = t13[0]._private.rscratch, r = e.edgeType; if (r === "segments") return this.recalculateRenderedStyle(t13), lg(e.segpts); }; or.getControlPoints = function(t13) { var e = t13[0]._private.rscratch, r = e.edgeType; if (r === "bezier" || r === "multibezier" || r === "self" || r === "compound") return this.recalculateRenderedStyle(t13), lg(e.ctrlpts); }; or.getEdgeMidpoint = function(t13) { var e = t13[0]._private.rscratch; return this.recalculateRenderedStyle(t13), { x: e.midX, y: e.midY }; }; var Io = {}; Io.manualEndptToPx = function(t13, e) { var r = this, n = t13.position(), a = t13.outerWidth(), i = t13.outerHeight(), o = t13._private.rscratch; if (e.value.length === 2) { var s = [e.pfValue[0], e.pfValue[1]]; return e.units[0] === "%" && (s[0] = s[0] * a), e.units[1] === "%" && (s[1] = s[1] * i), s[0] += n.x, s[1] += n.y, s; } else { var u = e.pfValue[0]; u = -Math.PI / 2 + u; var l = 2 * Math.max(a, i), c = [n.x + Math.cos(u) * l, n.y + Math.sin(u) * l]; return r.nodeShapes[this.getNodeShape(t13)].intersectLine(n.x, n.y, a, i, c[0], c[1], 0, t13.pstyle("corner-radius").value === "auto" ? "auto" : t13.pstyle("corner-radius").pfValue, o); } }; Io.findEndpoints = function(t13) { var e = this, r, n = t13.source()[0], a = t13.target()[0], i = n.position(), o = a.position(), s = t13.pstyle("target-arrow-shape").value, u = t13.pstyle("source-arrow-shape").value, l = t13.pstyle("target-distance-from-node").pfValue, c = t13.pstyle("source-distance-from-node").pfValue, d = n._private.rscratch, v = a._private.rscratch, h6 = t13.pstyle("curve-style").value, f = t13._private.rscratch, p = f.edgeType, m = h6 === "taxi", g = p === "self" || p === "compound", y = p === "bezier" || p === "multibezier" || g, b = p !== "bezier", w = p === "straight" || p === "segments", C = p === "segments", E = y || b || w, x = g || m, T = t13.pstyle("source-endpoint"), k = x ? "outside-to-node" : T.value, _ = n.pstyle("corner-radius").value === "auto" ? "auto" : n.pstyle("corner-radius").pfValue, D = t13.pstyle("target-endpoint"), O = x ? "outside-to-node" : D.value, I = a.pstyle("corner-radius").value === "auto" ? "auto" : a.pstyle("corner-radius").pfValue; f.srcManEndpt = T, f.tgtManEndpt = D; var L, B, F, M; if (y) { var A = [f.ctrlpts[0], f.ctrlpts[1]], R = b ? [f.ctrlpts[f.ctrlpts.length - 2], f.ctrlpts[f.ctrlpts.length - 1]] : A; L = R, B = A; } else if (w) { var K = C ? f.segpts.slice(0, 2) : [o.x, o.y], H = C ? f.segpts.slice(f.segpts.length - 2) : [i.x, i.y]; L = H, B = K; } if (O === "inside-to-node") r = [o.x, o.y]; else if (D.units) r = this.manualEndptToPx(a, D); else if (O === "outside-to-line") r = f.tgtIntn; else if (O === "outside-to-node" || O === "outside-to-node-or-label" ? F = L : (O === "outside-to-line" || O === "outside-to-line-or-label") && (F = [i.x, i.y]), r = e.nodeShapes[this.getNodeShape(a)].intersectLine(o.x, o.y, a.outerWidth(), a.outerHeight(), F[0], F[1], 0, I, v), O === "outside-to-node-or-label" || O === "outside-to-line-or-label") { var q = a._private.rscratch, ee = q.labelWidth, se = q.labelHeight, oe = q.labelX, ae = q.labelY, ue = ee / 2, te = se / 2, $ = a.pstyle("text-valign").value; $ === "top" ? ae -= te : $ === "bottom" && (ae += te); var G = a.pstyle("text-halign").value; G === "left" ? oe -= ue : G === "right" && (oe += ue); var Q = oo(F[0], F[1], [oe - ue, ae - te, oe + ue, ae - te, oe + ue, ae + te, oe - ue, ae + te], o.x, o.y); if (Q.length > 0) { var ge = i, Ee = ta(ge, Ha(r)), fe = ta(ge, Ha(Q)), me = Ee; if (fe < Ee && (r = Q, me = fe), Q.length > 2) { var xe = ta(ge, { x: Q[2], y: Q[3] }); xe < me && (r = [Q[2], Q[3]]); } } } var ke = Yo(r, L, e.arrowShapes[s].spacing(t13) + l), Ce = Yo(r, L, e.arrowShapes[s].gap(t13) + l); if (f.endX = Ce[0], f.endY = Ce[1], f.arrowEndX = ke[0], f.arrowEndY = ke[1], k === "inside-to-node") r = [i.x, i.y]; else if (T.units) r = this.manualEndptToPx(n, T); else if (k === "outside-to-line") r = f.srcIntn; else if (k === "outside-to-node" || k === "outside-to-node-or-label" ? M = B : (k === "outside-to-line" || k === "outside-to-line-or-label") && (M = [o.x, o.y]), r = e.nodeShapes[this.getNodeShape(n)].intersectLine(i.x, i.y, n.outerWidth(), n.outerHeight(), M[0], M[1], 0, _, d), k === "outside-to-node-or-label" || k === "outside-to-line-or-label") { var De = n._private.rscratch, qe = De.labelWidth, Ke = De.labelHeight, Be = De.labelX, Ge = De.labelY, le = qe / 2, S = Ke / 2, z = n.pstyle("text-valign").value; z === "top" ? Ge -= S : z === "bottom" && (Ge += S); var ie = n.pstyle("text-halign").value; ie === "left" ? Be -= le : ie === "right" && (Be += le); var j = oo(M[0], M[1], [Be - le, Ge - S, Be + le, Ge - S, Be + le, Ge + S, Be - le, Ge + S], i.x, i.y); if (j.length > 0) { var Y = o, pe = ta(Y, Ha(r)), re = ta(Y, Ha(j)), ve = pe; if (re < pe && (r = [j[0], j[1]], ve = re), j.length > 2) { var Ae = ta(Y, { x: j[2], y: j[3] }); Ae < ve && (r = [j[2], j[3]]); } } } var Me = Yo(r, B, e.arrowShapes[u].spacing(t13) + c), _e = Yo(r, B, e.arrowShapes[u].gap(t13) + c); f.startX = _e[0], f.startY = _e[1], f.arrowStartX = Me[0], f.arrowStartY = Me[1], E && (!be(f.startX) || !be(f.startY) || !be(f.endX) || !be(f.endY) ? f.badLine = true : f.badLine = false); }; Io.getSourceEndpoint = function(t13) { var e = t13[0]._private.rscratch; switch (this.recalculateRenderedStyle(t13), e.edgeType) { case "haystack": return { x: e.haystackPts[0], y: e.haystackPts[1] }; default: return { x: e.arrowStartX, y: e.arrowStartY }; } }; Io.getTargetEndpoint = function(t13) { var e = t13[0]._private.rscratch; switch (this.recalculateRenderedStyle(t13), e.edgeType) { case "haystack": return { x: e.haystackPts[2], y: e.haystackPts[3] }; default: return { x: e.arrowEndX, y: e.arrowEndY }; } }; var Tc = {}; function BP(t13, e, r) { for (var n = function(l, c, d, v) { return Nt(l, c, d, v); }, a = e._private, i = a.rstyle.bezierPts, o = 0; o < t13.bezierProjPcts.length; o++) { var s = t13.bezierProjPcts[o]; i.push({ x: n(r[0], r[2], r[4], s), y: n(r[1], r[3], r[5], s) }); } } Tc.storeEdgeProjections = function(t13) { var e = t13._private, r = e.rscratch, n = r.edgeType; if (e.rstyle.bezierPts = null, e.rstyle.linePts = null, e.rstyle.haystackPts = null, n === "multibezier" || n === "bezier" || n === "self" || n === "compound") { e.rstyle.bezierPts = []; for (var a = 0; a + 5 < r.allpts.length; a += 4) BP(this, t13, r.allpts.slice(a, a + 6)); } else if (n === "segments") for (var i = e.rstyle.linePts = [], a = 0; a + 1 < r.allpts.length; a += 2) i.push({ x: r.allpts[a], y: r.allpts[a + 1] }); else if (n === "haystack") { var o = r.haystackPts; e.rstyle.haystackPts = [{ x: o[0], y: o[1] }, { x: o[2], y: o[3] }]; } e.rstyle.arrowWidth = this.getArrowWidth(t13.pstyle("width").pfValue, t13.pstyle("arrow-scale").value) * this.arrowShapeWidth; }; Tc.recalculateEdgeProjections = function(t13) { this.findEdgeControlPoints(t13); }; var an = {}; an.recalculateNodeLabelProjection = function(t13) { var e = t13.pstyle("label").strValue; if (!qn(e)) { var r, n, a = t13._private, i = t13.width(), o = t13.height(), s = t13.padding(), u = t13.position(), l = t13.pstyle("text-halign").strValue, c = t13.pstyle("text-valign").strValue, d = a.rscratch, v = a.rstyle; switch (l) { case "left": r = u.x - i / 2 - s; break; case "right": r = u.x + i / 2 + s; break; default: r = u.x; } switch (c) { case "top": n = u.y - o / 2 - s; break; case "bottom": n = u.y + o / 2 + s; break; default: n = u.y; } d.labelX = r, d.labelY = n, v.labelX = r, v.labelY = n, this.calculateLabelAngles(t13), this.applyLabelDimensions(t13); } }; var ug = function(e, r) { var n = Math.atan(r / e); return e === 0 && n < 0 && (n = n * -1), n; }; var cg = function(e, r) { var n = r.x - e.x, a = r.y - e.y; return ug(n, a); }; var NP = function(e, r, n, a) { var i = io(0, a - 1e-3, 1), o = io(0, a + 1e-3, 1), s = Ga(e, r, n, i), u = Ga(e, r, n, o); return cg(s, u); }; an.recalculateEdgeLabelProjections = function(t13) { var e, r = t13._private, n = r.rscratch, a = this, i = { mid: t13.pstyle("label").strValue, source: t13.pstyle("source-label").strValue, target: t13.pstyle("target-label").strValue }; if (i.mid || i.source || i.target) { e = { x: n.midX, y: n.midY }; var o = function(d, v, h6) { An(r.rscratch, d, v, h6), An(r.rstyle, d, v, h6); }; o("labelX", null, e.x), o("labelY", null, e.y); var s = ug(n.midDispX, n.midDispY); o("labelAutoAngle", null, s); var u = function c() { if (c.cache) return c.cache; for (var d = [], v = 0; v + 5 < n.allpts.length; v += 4) { var h6 = { x: n.allpts[v], y: n.allpts[v + 1] }, f = { x: n.allpts[v + 2], y: n.allpts[v + 3] }, p = { x: n.allpts[v + 4], y: n.allpts[v + 5] }; d.push({ p0: h6, p1: f, p2: p, startDist: 0, length: 0, segments: [] }); } var m = r.rstyle.bezierPts, g = a.bezierProjPcts.length; function y(x, T, k, _, D) { var O = ya(T, k), I = x.segments[x.segments.length - 1], L = { p0: T, p1: k, t0: _, t1: D, startDist: I ? I.startDist + I.length : 0, length: O }; x.segments.push(L), x.length += O; } for (var b = 0; b < d.length; b++) { var w = d[b], C = d[b - 1]; C && (w.startDist = C.startDist + C.length), y(w, w.p0, m[b * g], 0, a.bezierProjPcts[0]); for (var E = 0; E < g - 1; E++) y(w, m[b * g + E], m[b * g + E + 1], a.bezierProjPcts[E], a.bezierProjPcts[E + 1]); y(w, m[b * g + g - 1], w.p2, a.bezierProjPcts[g - 1], 1); } return c.cache = d; }, l = function(d) { var v, h6 = d === "source"; if (i[d]) { var f = t13.pstyle(d + "-text-offset").pfValue; switch (n.edgeType) { case "self": case "compound": case "bezier": case "multibezier": { for (var p = u(), m, g = 0, y = 0, b = 0; b < p.length; b++) { for (var w = p[h6 ? b : p.length - 1 - b], C = 0; C < w.segments.length; C++) { var E = w.segments[h6 ? C : w.segments.length - 1 - C], x = b === p.length - 1 && C === w.segments.length - 1; if (g = y, y += E.length, y >= f || x) { m = { cp: w, segment: E }; break; } } if (m) break; } var T = m.cp, k = m.segment, _ = (f - g) / k.length, D = k.t1 - k.t0, O = h6 ? k.t0 + D * _ : k.t1 - D * _; O = io(0, O, 1), e = Ga(T.p0, T.p1, T.p2, O), v = NP(T.p0, T.p1, T.p2, O); break; } case "straight": case "segments": case "haystack": { for (var I = 0, L, B, F, M, A = n.allpts.length, R = 0; R + 3 < A && (h6 ? (F = { x: n.allpts[R], y: n.allpts[R + 1] }, M = { x: n.allpts[R + 2], y: n.allpts[R + 3] }) : (F = { x: n.allpts[A - 2 - R], y: n.allpts[A - 1 - R] }, M = { x: n.allpts[A - 4 - R], y: n.allpts[A - 3 - R] }), L = ya(F, M), B = I, I += L, !(I >= f)); R += 2) ; var K = f - B, H = K / L; H = io(0, H, 1), e = H5(F, M, H), v = cg(F, M); break; } } o("labelX", d, e.x), o("labelY", d, e.y), o("labelAutoAngle", d, v); } }; l("source"), l("target"), this.applyLabelDimensions(t13); } }; an.applyLabelDimensions = function(t13) { this.applyPrefixedLabelDimensions(t13), t13.isEdge() && (this.applyPrefixedLabelDimensions(t13, "source"), this.applyPrefixedLabelDimensions(t13, "target")); }; an.applyPrefixedLabelDimensions = function(t13, e) { var r = t13._private, n = this.getLabelText(t13, e), a = this.calculateLabelDimensions(t13, n), i = t13.pstyle("line-height").pfValue, o = t13.pstyle("text-wrap").strValue, s = Nr(r.rscratch, "labelWrapCachedLines", e) || [], u = o !== "wrap" ? 1 : Math.max(s.length, 1), l = a.height / u, c = l * i, d = a.width, v = a.height + (u - 1) * (i - 1) * l; An(r.rstyle, "labelWidth", e, d), An(r.rscratch, "labelWidth", e, d), An(r.rstyle, "labelHeight", e, v), An(r.rscratch, "labelHeight", e, v), An(r.rscratch, "labelLineHeight", e, c); }; an.getLabelText = function(t13, e) { var r = t13._private, n = e ? e + "-" : "", a = t13.pstyle(n + "label").strValue, i = t13.pstyle("text-transform").value, o = function(ee, se) { return se ? (An(r.rscratch, ee, e, se), se) : Nr(r.rscratch, ee, e); }; if (!a) return ""; i == "none" || (i == "uppercase" ? a = a.toUpperCase() : i == "lowercase" && (a = a.toLowerCase())); var s = t13.pstyle("text-wrap").value; if (s === "wrap") { var u = o("labelKey"); if (u != null && o("labelWrapKey") === u) return o("labelWrapCachedText"); for (var l = "​", c = a.split(` `), d = t13.pstyle("text-max-width").pfValue, v = t13.pstyle("text-overflow-wrap").value, h6 = v === "anywhere", f = [], p = /[\s\u200b]+|$/g, m = 0; m < c.length; m++) { var g = c[m], y = this.calculateLabelDimensions(t13, g), b = y.width; if (h6) { var w = g.split("").join(l); g = w; } if (b > d) { var C = g.matchAll(p), E = "", x = 0, T = Gh(C), k; try { for (T.s(); !(k = T.n()).done; ) { var _ = k.value, D = _[0], O = g.substring(x, _.index); x = _.index + D.length; var I = E.length === 0 ? O : E + O + D, L = this.calculateLabelDimensions(t13, I), B = L.width; B <= d ? E += O + D : (E && f.push(E), E = O + D); } } catch (q) { T.e(q); } finally { T.f(); } E.match(/^[\s\u200b]+$/) || f.push(E); } else f.push(g); } o("labelWrapCachedLines", f), a = o("labelWrapCachedText", f.join(` `)), o("labelWrapKey", u); } else if (s === "ellipsis") { var F = t13.pstyle("text-max-width").pfValue, M = "", A = "…", R = false; if (this.calculateLabelDimensions(t13, a).width < F) return a; for (var K = 0; K < a.length; K++) { var H = this.calculateLabelDimensions(t13, M + a[K] + A).width; if (H > F) break; M += a[K], K === a.length - 1 && (R = true); } return R || (M += A), M; } return a; }; an.getLabelJustification = function(t13) { var e = t13.pstyle("text-justification").strValue, r = t13.pstyle("text-halign").strValue; if (e === "auto") if (t13.isNode()) switch (r) { case "left": return "right"; case "right": return "left"; default: return "center"; } else return "center"; else return e; }; an.calculateLabelDimensions = function(t13, e) { var r = this, n = r.cy.window(), a = n.document, i = ma(e, t13._private.labelDimsKey), o = r.labelDimCache || (r.labelDimCache = []), s = o[i]; if (s != null) return s; var u = 0, l = t13.pstyle("font-style").strValue, c = t13.pstyle("font-size").pfValue, d = t13.pstyle("font-family").strValue, v = t13.pstyle("font-weight").strValue, h6 = this.labelCalcCanvas, f = this.labelCalcCanvasContext; if (!h6) { h6 = this.labelCalcCanvas = a.createElement("canvas"), f = this.labelCalcCanvasContext = h6.getContext("2d"); var p = h6.style; p.position = "absolute", p.left = "-9999px", p.top = "-9999px", p.zIndex = "-1", p.visibility = "hidden", p.pointerEvents = "none"; } f.font = "".concat(l, " ").concat(v, " ").concat(c, "px ").concat(d); for (var m = 0, g = 0, y = e.split(` `), b = 0; b < y.length; b++) { var w = y[b], C = f.measureText(w), E = Math.ceil(C.width), x = c; m = Math.max(E, m), g += x; } return m += u, g += u, o[i] = { width: m, height: g }; }; an.calculateLabelAngle = function(t13, e) { var r = t13._private, n = r.rscratch, a = t13.isEdge(), i = e ? e + "-" : "", o = t13.pstyle(i + "text-rotation"), s = o.strValue; return s === "none" ? 0 : a && s === "autorotate" ? n.labelAutoAngle : s === "autorotate" ? 0 : o.pfValue; }; an.calculateLabelAngles = function(t13) { var e = this, r = t13.isEdge(), n = t13._private, a = n.rscratch; a.labelAngle = e.calculateLabelAngle(t13), r && (a.sourceLabelAngle = e.calculateLabelAngle(t13, "source"), a.targetLabelAngle = e.calculateLabelAngle(t13, "target")); }; var dg = {}; var rv = 28; var nv = false; dg.getNodeShape = function(t13) { var e = this, r = t13.pstyle("shape").value; if (r === "cutrectangle" && (t13.width() < rv || t13.height() < rv)) return nv || (tt("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"), nv = true), "rectangle"; if (t13.isParent()) return r === "rectangle" || r === "roundrectangle" || r === "round-rectangle" || r === "cutrectangle" || r === "cut-rectangle" || r === "barrel" ? r : "rectangle"; if (r === "polygon") { var n = t13.pstyle("shape-polygon-points").value; return e.nodeShapes.makePolygon(n).name; } return r; }; var pl = {}; pl.registerCalculationListeners = function() { var t13 = this.cy, e = t13.collection(), r = this, n = function(o) { var s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; if (e.merge(o), s) for (var u = 0; u < o.length; u++) { var l = o[u], c = l._private, d = c.rstyle; d.clean = false, d.cleanConnected = false; } }; r.binder(t13).on("bounds.* dirty.*", function(o) { var s = o.target; n(s); }).on("style.* background.*", function(o) { var s = o.target; n(s, false); }); var a = function(o) { if (o) { var s = r.onUpdateEleCalcsFns; e.cleanStyle(); for (var u = 0; u < e.length; u++) { var l = e[u], c = l._private.rstyle; l.isNode() && !c.cleanConnected && (n(l.connectedEdges()), c.cleanConnected = true); } if (s) for (var d = 0; d < s.length; d++) { var v = s[d]; v(o, e); } r.recalculateRenderedStyle(e), e = t13.collection(); } }; r.flushRenderedStyleQueue = function() { a(true); }, r.beforeRender(a, r.beforeRenderPriorities.eleCalcs); }; pl.onUpdateEleCalcs = function(t13) { var e = this.onUpdateEleCalcsFns = this.onUpdateEleCalcsFns || []; e.push(t13); }; pl.recalculateRenderedStyle = function(t13, e) { var r = function(w) { return w._private.rstyle.cleanConnected; }, n = [], a = []; if (!this.destroyed) { e === void 0 && (e = true); for (var i = 0; i < t13.length; i++) { var o = t13[i], s = o._private, u = s.rstyle; o.isEdge() && (!r(o.source()) || !r(o.target())) && (u.clean = false), !(e && u.clean || o.removed()) && o.pstyle("display").value !== "none" && (s.group === "nodes" ? a.push(o) : n.push(o), u.clean = true); } for (var l = 0; l < a.length; l++) { var c = a[l], d = c._private, v = d.rstyle, h6 = c.position(); this.recalculateNodeLabelProjection(c), v.nodeX = h6.x, v.nodeY = h6.y, v.nodeW = c.pstyle("width").pfValue, v.nodeH = c.pstyle("height").pfValue; } this.recalculateEdgeProjections(n); for (var f = 0; f < n.length; f++) { var p = n[f], m = p._private, g = m.rstyle, y = m.rscratch; g.srcX = y.arrowStartX, g.srcY = y.arrowStartY, g.tgtX = y.arrowEndX, g.tgtY = y.arrowEndY, g.midX = y.midX, g.midY = y.midY, g.labelAngle = y.labelAngle, g.sourceLabelAngle = y.sourceLabelAngle, g.targetLabelAngle = y.targetLabelAngle; } } }; var gl = {}; gl.updateCachedGrabbedEles = function() { var t13 = this.cachedZSortedEles; if (t13) { t13.drag = [], t13.nondrag = []; for (var e = [], r = 0; r < t13.length; r++) { var n = t13[r], a = n._private.rscratch; n.grabbed() && !n.isParent() ? e.push(n) : a.inDragLayer ? t13.drag.push(n) : t13.nondrag.push(n); } for (var r = 0; r < e.length; r++) { var n = e[r]; t13.drag.push(n); } } }; gl.invalidateCachedZSortedEles = function() { this.cachedZSortedEles = null; }; gl.getCachedZSortedEles = function(t13) { if (t13 || !this.cachedZSortedEles) { var e = this.cy.mutableElements().toArray(); e.sort(Yp), e.interactive = e.filter(function(r) { return r.interactive(); }), this.cachedZSortedEles = e, this.updateCachedGrabbedEles(); } else e = this.cachedZSortedEles; return e; }; var fg = {}; [Da, Ns, or, Io, Tc, an, dg, pl, gl].forEach(function(t13) { Re(fg, t13); }); var vg = {}; vg.getCachedImage = function(t13, e, r) { var n = this, a = n.imageCache = n.imageCache || {}, i = a[t13]; if (i) return i.image.complete || i.image.addEventListener("load", r), i.image; i = a[t13] = a[t13] || {}; var o = i.image = new Image(); o.addEventListener("load", r), o.addEventListener("error", function() { o.error = true; }); var s = "data:", u = t13.substring(0, s.length).toLowerCase() === s; return u || (e = e === "null" ? null : e, o.crossOrigin = e), o.src = t13, o; }; var wi = {}; wi.registerBinding = function(t13, e, r, n) { var a = Array.prototype.slice.apply(arguments, [1]), i = this.binder(t13); return i.on.apply(i, a); }; wi.binder = function(t13) { var e = this, r = e.cy.window(), n = t13 === r || t13 === r.document || t13 === r.document.body || lT(t13); if (e.supportsPassiveEvents == null) { var a = false; try { var i = Object.defineProperty({}, "passive", { get: function() { return a = true, true; } }); r.addEventListener("test", null, i); } catch { } e.supportsPassiveEvents = a; } var o = function(u, l, c) { var d = Array.prototype.slice.call(arguments); return n && e.supportsPassiveEvents && (d[2] = { capture: c ?? false, passive: false, once: false }), e.bindings.push({ target: t13, args: d }), (t13.addEventListener || t13.on).apply(t13, d), this; }; return { on: o, addEventListener: o, addListener: o, bind: o }; }; wi.nodeIsDraggable = function(t13) { return t13 && t13.isNode() && !t13.locked() && t13.grabbable(); }; wi.nodeIsGrabbable = function(t13) { return this.nodeIsDraggable(t13) && t13.interactive(); }; wi.load = function() { var t13 = this, e = t13.cy.window(), r = function(S) { return S.selected(); }, n = function(S, z, ie, j) { S == null && (S = t13.cy); for (var Y = 0; Y < z.length; Y++) { var pe = z[Y]; S.emit({ originalEvent: ie, type: pe, position: j }); } }, a = function(S) { return S.shiftKey || S.metaKey || S.ctrlKey; }, i = function(S, z) { var ie = true; if (t13.cy.hasCompoundNodes() && S && S.pannable()) for (var j = 0; z && j < z.length; j++) { var S = z[j]; if (S.isNode() && S.isParent() && !S.pannable()) { ie = false; break; } } else ie = true; return ie; }, o = function(S) { S[0]._private.grabbed = true; }, s = function(S) { S[0]._private.grabbed = false; }, u = function(S) { S[0]._private.rscratch.inDragLayer = true; }, l = function(S) { S[0]._private.rscratch.inDragLayer = false; }, c = function(S) { S[0]._private.rscratch.isGrabTarget = true; }, d = function(S) { S[0]._private.rscratch.isGrabTarget = false; }, v = function(S, z) { var ie = z.addToList, j = ie.has(S); !j && S.grabbable() && !S.locked() && (ie.merge(S), o(S)); }, h6 = function(S, z) { if (S.cy().hasCompoundNodes() && !(z.inDragLayer == null && z.addToList == null)) { var ie = S.descendants(); z.inDragLayer && (ie.forEach(u), ie.connectedEdges().forEach(u)), z.addToList && v(ie, z); } }, f = function(S, z) { z = z || {}; var ie = S.cy().hasCompoundNodes(); z.inDragLayer && (S.forEach(u), S.neighborhood().stdFilter(function(j) { return !ie || j.isEdge(); }).forEach(u)), z.addToList && S.forEach(function(j) { v(j, z); }), h6(S, z), g(S, { inDragLayer: z.inDragLayer }), t13.updateCachedGrabbedEles(); }, p = f, m = function(S) { S && (t13.getCachedZSortedEles().forEach(function(z) { s(z), l(z), d(z); }), t13.updateCachedGrabbedEles()); }, g = function(S, z) { if (!(z.inDragLayer == null && z.addToList == null) && S.cy().hasCompoundNodes()) { var ie = S.ancestors().orphans(); if (!ie.same(S)) { var j = ie.descendants().spawnSelf().merge(ie).unmerge(S).unmerge(S.descendants()), Y = j.connectedEdges(); z.inDragLayer && (Y.forEach(u), j.forEach(u)), z.addToList && j.forEach(function(pe) { v(pe, z); }); } } }, y = function() { document.activeElement != null && document.activeElement.blur != null && document.activeElement.blur(); }, b = typeof MutationObserver < "u", w = typeof ResizeObserver < "u"; b ? (t13.removeObserver = new MutationObserver(function(le) { for (var S = 0; S < le.length; S++) { var z = le[S], ie = z.removedNodes; if (ie) for (var j = 0; j < ie.length; j++) { var Y = ie[j]; if (Y === t13.container) { t13.destroy(); break; } } } }), t13.container.parentNode && t13.removeObserver.observe(t13.container.parentNode, { childList: true })) : t13.registerBinding(t13.container, "DOMNodeRemoved", function(le) { t13.destroy(); }); var C = tl(function() { t13.cy.resize(); }, 100); b && (t13.styleObserver = new MutationObserver(C), t13.styleObserver.observe(t13.container, { attributes: true })), t13.registerBinding(e, "resize", C), w && (t13.resizeObserver = new ResizeObserver(C), t13.resizeObserver.observe(t13.container)); var E = function(S, z) { for (; S != null; ) z(S), S = S.parentNode; }, x = function() { t13.invalidateContainerClientCoordsCache(); }; E(t13.container, function(le) { t13.registerBinding(le, "transitionend", x), t13.registerBinding(le, "animationend", x), t13.registerBinding(le, "scroll", x); }), t13.registerBinding(t13.container, "contextmenu", function(le) { le.preventDefault(); }); var T = function() { return t13.selection[4] !== 0; }, k = function(S) { for (var z = t13.findContainerClientCoords(), ie = z[0], j = z[1], Y = z[2], pe = z[3], re = S.touches ? S.touches : [S], ve = false, Ae = 0; Ae < re.length; Ae++) { var Me = re[Ae]; if (ie <= Me.clientX && Me.clientX <= ie + Y && j <= Me.clientY && Me.clientY <= j + pe) { ve = true; break; } } if (!ve) return false; for (var _e = t13.container, Ne = S.target, Te = Ne.parentNode, Oe = false; Te; ) { if (Te === _e) { Oe = true; break; } Te = Te.parentNode; } return !!Oe; }; t13.registerBinding(t13.container, "mousedown", function(S) { if (k(S) && !(t13.hoverData.which === 1 && S.which !== 1)) { S.preventDefault(), y(), t13.hoverData.capture = true, t13.hoverData.which = S.which; var z = t13.cy, ie = [S.clientX, S.clientY], j = t13.projectIntoViewport(ie[0], ie[1]), Y = t13.selection, pe = t13.findNearestElements(j[0], j[1], true, false), re = pe[0], ve = t13.dragData.possibleDragElements; t13.hoverData.mdownPos = j, t13.hoverData.mdownGPos = ie; var Ae = function() { t13.hoverData.tapholdCancelled = false, clearTimeout(t13.hoverData.tapholdTimeout), t13.hoverData.tapholdTimeout = setTimeout(function() { if (!t13.hoverData.tapholdCancelled) { var ut = t13.hoverData.down; ut ? ut.emit({ originalEvent: S, type: "taphold", position: { x: j[0], y: j[1] } }) : z.emit({ originalEvent: S, type: "taphold", position: { x: j[0], y: j[1] } }); } }, t13.tapholdDuration); }; if (S.which == 3) { t13.hoverData.cxtStarted = true; var Me = { originalEvent: S, type: "cxttapstart", position: { x: j[0], y: j[1] } }; re ? (re.activate(), re.emit(Me), t13.hoverData.down = re) : z.emit(Me), t13.hoverData.downTime = (/* @__PURE__ */ new Date()).getTime(), t13.hoverData.cxtDragged = false; } else if (S.which == 1) { re && re.activate(); { if (re != null && t13.nodeIsGrabbable(re)) { var _e = function(ut) { return { originalEvent: S, type: ut, position: { x: j[0], y: j[1] } }; }, Ne = function(ut) { ut.emit(_e("grab")); }; if (c(re), !re.selected()) ve = t13.dragData.possibleDragElements = z.collection(), p(re, { addToList: ve }), re.emit(_e("grabon")).emit(_e("grab")); else { ve = t13.dragData.possibleDragElements = z.collection(); var Te = z.$(function(Oe) { return Oe.isNode() && Oe.selected() && t13.nodeIsGrabbable(Oe); }); f(Te, { addToList: ve }), re.emit(_e("grabon")), Te.forEach(Ne); } t13.redrawHint("eles", true), t13.redrawHint("drag", true); } t13.hoverData.down = re, t13.hoverData.downs = pe, t13.hoverData.downTime = (/* @__PURE__ */ new Date()).getTime(); } n(re, ["mousedown", "tapstart", "vmousedown"], S, { x: j[0], y: j[1] }), re == null ? (Y[4] = 1, t13.data.bgActivePosistion = { x: j[0], y: j[1] }, t13.redrawHint("select", true), t13.redraw()) : re.pannable() && (Y[4] = 1), Ae(); } Y[0] = Y[2] = j[0], Y[1] = Y[3] = j[1]; } }, false), t13.registerBinding(e, "mousemove", function(S) { var z = t13.hoverData.capture; if (!(!z && !k(S))) { var ie = false, j = t13.cy, Y = j.zoom(), pe = [S.clientX, S.clientY], re = t13.projectIntoViewport(pe[0], pe[1]), ve = t13.hoverData.mdownPos, Ae = t13.hoverData.mdownGPos, Me = t13.selection, _e = null; !t13.hoverData.draggingEles && !t13.hoverData.dragging && !t13.hoverData.selecting && (_e = t13.findNearestElement(re[0], re[1], true, false)); var Ne = t13.hoverData.last, Te = t13.hoverData.down, Oe = [re[0] - Me[2], re[1] - Me[3]], ut = t13.dragData.possibleDragElements, nt2; if (Ae) { var kt = pe[0] - Ae[0], St2 = kt * kt, wt = pe[1] - Ae[1], Zt = wt * wt, Pt2 = St2 + Zt; t13.hoverData.isOverThresholdDrag = nt2 = Pt2 >= t13.desktopTapThreshold2; } var Mt = a(S); nt2 && (t13.hoverData.tapholdCancelled = true); var gr2 = function() { var W = t13.hoverData.dragDelta = t13.hoverData.dragDelta || []; W.length === 0 ? (W.push(Oe[0]), W.push(Oe[1])) : (W[0] += Oe[0], W[1] += Oe[1]); }; ie = true, n(_e, ["mousemove", "vmousemove", "tapdrag"], S, { x: re[0], y: re[1] }); var Xt2 = function() { t13.data.bgActivePosistion = void 0, t13.hoverData.selecting || j.emit({ originalEvent: S, type: "boxstart", position: { x: re[0], y: re[1] } }), Me[4] = 1, t13.hoverData.selecting = true, t13.redrawHint("select", true), t13.redraw(); }; if (t13.hoverData.which === 3) { if (nt2) { var jt2 = { originalEvent: S, type: "cxtdrag", position: { x: re[0], y: re[1] } }; Te ? Te.emit(jt2) : j.emit(jt2), t13.hoverData.cxtDragged = true, (!t13.hoverData.cxtOver || _e !== t13.hoverData.cxtOver) && (t13.hoverData.cxtOver && t13.hoverData.cxtOver.emit({ originalEvent: S, type: "cxtdragout", position: { x: re[0], y: re[1] } }), t13.hoverData.cxtOver = _e, _e && _e.emit({ originalEvent: S, type: "cxtdragover", position: { x: re[0], y: re[1] } })); } } else if (t13.hoverData.dragging) { if (ie = true, j.panningEnabled() && j.userPanningEnabled()) { var wr2; if (t13.hoverData.justStartedPan) { var Pr2 = t13.hoverData.mdownPos; wr2 = { x: (re[0] - Pr2[0]) * Y, y: (re[1] - Pr2[1]) * Y }, t13.hoverData.justStartedPan = false; } else wr2 = { x: Oe[0] * Y, y: Oe[1] * Y }; j.panBy(wr2), j.emit("dragpan"), t13.hoverData.dragged = true; } re = t13.projectIntoViewport(S.clientX, S.clientY); } else if (Me[4] == 1 && (Te == null || Te.pannable())) { if (nt2) { if (!t13.hoverData.dragging && j.boxSelectionEnabled() && (Mt || !j.panningEnabled() || !j.userPanningEnabled())) Xt2(); else if (!t13.hoverData.selecting && j.panningEnabled() && j.userPanningEnabled()) { var ur2 = i(Te, t13.hoverData.downs); ur2 && (t13.hoverData.dragging = true, t13.hoverData.justStartedPan = true, Me[4] = 0, t13.data.bgActivePosistion = Ha(ve), t13.redrawHint("select", true), t13.redraw()); } Te && Te.pannable() && Te.active() && Te.unactivate(); } } else { if (Te && Te.pannable() && Te.active() && Te.unactivate(), (!Te || !Te.grabbed()) && _e != Ne && (Ne && n(Ne, ["mouseout", "tapdragout"], S, { x: re[0], y: re[1] }), _e && n(_e, ["mouseover", "tapdragover"], S, { x: re[0], y: re[1] }), t13.hoverData.last = _e), Te) if (nt2) { if (j.boxSelectionEnabled() && Mt) Te && Te.grabbed() && (m(ut), Te.emit("freeon"), ut.emit("free"), t13.dragData.didDrag && (Te.emit("dragfreeon"), ut.emit("dragfree"))), Xt2(); else if (Te && Te.grabbed() && t13.nodeIsDraggable(Te)) { var xt = !t13.dragData.didDrag; xt && t13.redrawHint("eles", true), t13.dragData.didDrag = true, t13.hoverData.draggingEles || f(ut, { inDragLayer: true }); var Tt = { x: 0, y: 0 }; if (be(Oe[0]) && be(Oe[1]) && (Tt.x += Oe[0], Tt.y += Oe[1], xt)) { var Bt2 = t13.hoverData.dragDelta; Bt2 && be(Bt2[0]) && be(Bt2[1]) && (Tt.x += Bt2[0], Tt.y += Bt2[1]); } t13.hoverData.draggingEles = true, ut.silentShift(Tt).emit("position drag"), t13.redrawHint("drag", true), t13.redraw(); } } else gr2(); ie = true; } if (Me[2] = re[0], Me[3] = re[1], ie) return S.stopPropagation && S.stopPropagation(), S.preventDefault && S.preventDefault(), false; } }, false); var _, D, O; t13.registerBinding(e, "mouseup", function(S) { if (!(t13.hoverData.which === 1 && S.which !== 1 && t13.hoverData.capture)) { var z = t13.hoverData.capture; if (z) { t13.hoverData.capture = false; var ie = t13.cy, j = t13.projectIntoViewport(S.clientX, S.clientY), Y = t13.selection, pe = t13.findNearestElement(j[0], j[1], true, false), re = t13.dragData.possibleDragElements, ve = t13.hoverData.down, Ae = a(S); if (t13.data.bgActivePosistion && (t13.redrawHint("select", true), t13.redraw()), t13.hoverData.tapholdCancelled = true, t13.data.bgActivePosistion = void 0, ve && ve.unactivate(), t13.hoverData.which === 3) { var Me = { originalEvent: S, type: "cxttapend", position: { x: j[0], y: j[1] } }; if (ve ? ve.emit(Me) : ie.emit(Me), !t13.hoverData.cxtDragged) { var _e = { originalEvent: S, type: "cxttap", position: { x: j[0], y: j[1] } }; ve ? ve.emit(_e) : ie.emit(_e); } t13.hoverData.cxtDragged = false, t13.hoverData.which = null; } else if (t13.hoverData.which === 1) { if (n(pe, ["mouseup", "tapend", "vmouseup"], S, { x: j[0], y: j[1] }), !t13.dragData.didDrag && // didn't move a node around !t13.hoverData.dragged && // didn't pan !t13.hoverData.selecting && // not box selection !t13.hoverData.isOverThresholdDrag && (n(ve, ["click", "tap", "vclick"], S, { x: j[0], y: j[1] }), D = false, S.timeStamp - O <= ie.multiClickDebounceTime() ? (_ && clearTimeout(_), D = true, O = null, n(ve, ["dblclick", "dbltap", "vdblclick"], S, { x: j[0], y: j[1] })) : (_ = setTimeout(function() { D || n(ve, ["oneclick", "onetap", "voneclick"], S, { x: j[0], y: j[1] }); }, ie.multiClickDebounceTime()), O = S.timeStamp)), ve == null && !t13.dragData.didDrag && !t13.hoverData.selecting && !t13.hoverData.dragged && !a(S) && (ie.$(r).unselect(["tapunselect"]), re.length > 0 && t13.redrawHint("eles", true), t13.dragData.possibleDragElements = re = ie.collection()), pe == ve && !t13.dragData.didDrag && !t13.hoverData.selecting && pe != null && pe._private.selectable && (t13.hoverData.dragging || (ie.selectionType() === "additive" || Ae ? pe.selected() ? pe.unselect(["tapunselect"]) : pe.select(["tapselect"]) : Ae || (ie.$(r).unmerge(pe).unselect(["tapunselect"]), pe.select(["tapselect"]))), t13.redrawHint("eles", true)), t13.hoverData.selecting) { var Ne = ie.collection(t13.getAllInBox(Y[0], Y[1], Y[2], Y[3])); t13.redrawHint("select", true), Ne.length > 0 && t13.redrawHint("eles", true), ie.emit({ type: "boxend", originalEvent: S, position: { x: j[0], y: j[1] } }); var Te = function(nt2) { return nt2.selectable() && !nt2.selected(); }; ie.selectionType() === "additive" || Ae || ie.$(r).unmerge(Ne).unselect(), Ne.emit("box").stdFilter(Te).select().emit("boxselect"), t13.redraw(); } if (t13.hoverData.dragging && (t13.hoverData.dragging = false, t13.redrawHint("select", true), t13.redrawHint("eles", true), t13.redraw()), !Y[4]) { t13.redrawHint("drag", true), t13.redrawHint("eles", true); var Oe = ve && ve.grabbed(); m(re), Oe && (ve.emit("freeon"), re.emit("free"), t13.dragData.didDrag && (ve.emit("dragfreeon"), re.emit("dragfree"))); } } Y[4] = 0, t13.hoverData.down = null, t13.hoverData.cxtStarted = false, t13.hoverData.draggingEles = false, t13.hoverData.selecting = false, t13.hoverData.isOverThresholdDrag = false, t13.dragData.didDrag = false, t13.hoverData.dragged = false, t13.hoverData.dragDelta = [], t13.hoverData.mdownPos = null, t13.hoverData.mdownGPos = null, t13.hoverData.which = null; } } }, false); var I = function(S) { if (!t13.scrollingPage) { var z = t13.cy, ie = z.zoom(), j = z.pan(), Y = t13.projectIntoViewport(S.clientX, S.clientY), pe = [Y[0] * ie + j.x, Y[1] * ie + j.y]; if (t13.hoverData.draggingEles || t13.hoverData.dragging || t13.hoverData.cxtStarted || T()) { S.preventDefault(); return; } if (z.panningEnabled() && z.userPanningEnabled() && z.zoomingEnabled() && z.userZoomingEnabled()) { S.preventDefault(), t13.data.wheelZooming = true, clearTimeout(t13.data.wheelTimeout), t13.data.wheelTimeout = setTimeout(function() { t13.data.wheelZooming = false, t13.redrawHint("eles", true), t13.redraw(); }, 150); var re; S.deltaY != null ? re = S.deltaY / -250 : S.wheelDeltaY != null ? re = S.wheelDeltaY / 1e3 : re = S.wheelDelta / 1e3, re = re * t13.wheelSensitivity; var ve = S.deltaMode === 1; ve && (re *= 33); var Ae = z.zoom() * Math.pow(10, re); S.type === "gesturechange" && (Ae = t13.gestureStartZoom * S.scale), z.zoom({ level: Ae, renderedPosition: { x: pe[0], y: pe[1] } }), z.emit(S.type === "gesturechange" ? "pinchzoom" : "scrollzoom"); } } }; t13.registerBinding(t13.container, "wheel", I, true), t13.registerBinding(e, "scroll", function(S) { t13.scrollingPage = true, clearTimeout(t13.scrollingPageTimeout), t13.scrollingPageTimeout = setTimeout(function() { t13.scrollingPage = false; }, 250); }, true), t13.registerBinding(t13.container, "gesturestart", function(S) { t13.gestureStartZoom = t13.cy.zoom(), t13.hasTouchStarted || S.preventDefault(); }, true), t13.registerBinding(t13.container, "gesturechange", function(le) { t13.hasTouchStarted || I(le); }, true), t13.registerBinding(t13.container, "mouseout", function(S) { var z = t13.projectIntoViewport(S.clientX, S.clientY); t13.cy.emit({ originalEvent: S, type: "mouseout", position: { x: z[0], y: z[1] } }); }, false), t13.registerBinding(t13.container, "mouseover", function(S) { var z = t13.projectIntoViewport(S.clientX, S.clientY); t13.cy.emit({ originalEvent: S, type: "mouseover", position: { x: z[0], y: z[1] } }); }, false); var L, B, F, M, A, R, K, H, q, ee, se, oe, ae, ue = function(S, z, ie, j) { return Math.sqrt((ie - S) * (ie - S) + (j - z) * (j - z)); }, te = function(S, z, ie, j) { return (ie - S) * (ie - S) + (j - z) * (j - z); }, $; t13.registerBinding(t13.container, "touchstart", $ = function(S) { if (t13.hasTouchStarted = true, !!k(S)) { y(), t13.touchData.capture = true, t13.data.bgActivePosistion = void 0; var z = t13.cy, ie = t13.touchData.now, j = t13.touchData.earlier; if (S.touches[0]) { var Y = t13.projectIntoViewport(S.touches[0].clientX, S.touches[0].clientY); ie[0] = Y[0], ie[1] = Y[1]; } if (S.touches[1]) { var Y = t13.projectIntoViewport(S.touches[1].clientX, S.touches[1].clientY); ie[2] = Y[0], ie[3] = Y[1]; } if (S.touches[2]) { var Y = t13.projectIntoViewport(S.touches[2].clientX, S.touches[2].clientY); ie[4] = Y[0], ie[5] = Y[1]; } if (S.touches[1]) { t13.touchData.singleTouchMoved = true, m(t13.dragData.touchDragEles); var pe = t13.findContainerClientCoords(); q = pe[0], ee = pe[1], se = pe[2], oe = pe[3], L = S.touches[0].clientX - q, B = S.touches[0].clientY - ee, F = S.touches[1].clientX - q, M = S.touches[1].clientY - ee, ae = 0 <= L && L <= se && 0 <= F && F <= se && 0 <= B && B <= oe && 0 <= M && M <= oe; var re = z.pan(), ve = z.zoom(); A = ue(L, B, F, M), R = te(L, B, F, M), K = [(L + F) / 2, (B + M) / 2], H = [(K[0] - re.x) / ve, (K[1] - re.y) / ve]; var Ae = 200, Me = Ae * Ae; if (R < Me && !S.touches[2]) { var _e = t13.findNearestElement(ie[0], ie[1], true, true), Ne = t13.findNearestElement(ie[2], ie[3], true, true); _e && _e.isNode() ? (_e.activate().emit({ originalEvent: S, type: "cxttapstart", position: { x: ie[0], y: ie[1] } }), t13.touchData.start = _e) : Ne && Ne.isNode() ? (Ne.activate().emit({ originalEvent: S, type: "cxttapstart", position: { x: ie[0], y: ie[1] } }), t13.touchData.start = Ne) : z.emit({ originalEvent: S, type: "cxttapstart", position: { x: ie[0], y: ie[1] } }), t13.touchData.start && (t13.touchData.start._private.grabbed = false), t13.touchData.cxt = true, t13.touchData.cxtDragged = false, t13.data.bgActivePosistion = void 0, t13.redraw(); return; } } if (S.touches[2]) z.boxSelectionEnabled() && S.preventDefault(); else if (!S.touches[1]) { if (S.touches[0]) { var Te = t13.findNearestElements(ie[0], ie[1], true, true), Oe = Te[0]; if (Oe != null && (Oe.activate(), t13.touchData.start = Oe, t13.touchData.starts = Te, t13.nodeIsGrabbable(Oe))) { var ut = t13.dragData.touchDragEles = z.collection(), nt2 = null; t13.redrawHint("eles", true), t13.redrawHint("drag", true), Oe.selected() ? (nt2 = z.$(function(Pt2) { return Pt2.selected() && t13.nodeIsGrabbable(Pt2); }), f(nt2, { addToList: ut })) : p(Oe, { addToList: ut }), c(Oe); var kt = function(Mt) { return { originalEvent: S, type: Mt, position: { x: ie[0], y: ie[1] } }; }; Oe.emit(kt("grabon")), nt2 ? nt2.forEach(function(Pt2) { Pt2.emit(kt("grab")); }) : Oe.emit(kt("grab")); } n(Oe, ["touchstart", "tapstart", "vmousedown"], S, { x: ie[0], y: ie[1] }), Oe == null && (t13.data.bgActivePosistion = { x: Y[0], y: Y[1] }, t13.redrawHint("select", true), t13.redraw()), t13.touchData.singleTouchMoved = false, t13.touchData.singleTouchStartTime = +/* @__PURE__ */ new Date(), clearTimeout(t13.touchData.tapholdTimeout), t13.touchData.tapholdTimeout = setTimeout(function() { t13.touchData.singleTouchMoved === false && !t13.pinching && !t13.touchData.selecting && n(t13.touchData.start, ["taphold"], S, { x: ie[0], y: ie[1] }); }, t13.tapholdDuration); } } if (S.touches.length >= 1) { for (var St2 = t13.touchData.startPosition = [null, null, null, null, null, null], wt = 0; wt < ie.length; wt++) St2[wt] = j[wt] = ie[wt]; var Zt = S.touches[0]; t13.touchData.startGPosition = [Zt.clientX, Zt.clientY]; } } }, false); var G; t13.registerBinding(e, "touchmove", G = function(S) { var z = t13.touchData.capture; if (!(!z && !k(S))) { var ie = t13.selection, j = t13.cy, Y = t13.touchData.now, pe = t13.touchData.earlier, re = j.zoom(); if (S.touches[0]) { var ve = t13.projectIntoViewport(S.touches[0].clientX, S.touches[0].clientY); Y[0] = ve[0], Y[1] = ve[1]; } if (S.touches[1]) { var ve = t13.projectIntoViewport(S.touches[1].clientX, S.touches[1].clientY); Y[2] = ve[0], Y[3] = ve[1]; } if (S.touches[2]) { var ve = t13.projectIntoViewport(S.touches[2].clientX, S.touches[2].clientY); Y[4] = ve[0], Y[5] = ve[1]; } var Ae = t13.touchData.startGPosition, Me; if (z && S.touches[0] && Ae) { for (var _e = [], Ne = 0; Ne < Y.length; Ne++) _e[Ne] = Y[Ne] - pe[Ne]; var Te = S.touches[0].clientX - Ae[0], Oe = Te * Te, ut = S.touches[0].clientY - Ae[1], nt2 = ut * ut, kt = Oe + nt2; Me = kt >= t13.touchTapThreshold2; } if (z && t13.touchData.cxt) { S.preventDefault(); var St2 = S.touches[0].clientX - q, wt = S.touches[0].clientY - ee, Zt = S.touches[1].clientX - q, Pt2 = S.touches[1].clientY - ee, Mt = te(St2, wt, Zt, Pt2), gr2 = Mt / R, Xt2 = 150, jt2 = Xt2 * Xt2, wr2 = 1.5, Pr2 = wr2 * wr2; if (gr2 >= Pr2 || Mt >= jt2) { t13.touchData.cxt = false, t13.data.bgActivePosistion = void 0, t13.redrawHint("select", true); var ur2 = { originalEvent: S, type: "cxttapend", position: { x: Y[0], y: Y[1] } }; t13.touchData.start ? (t13.touchData.start.unactivate().emit(ur2), t13.touchData.start = null) : j.emit(ur2); } } if (z && t13.touchData.cxt) { var ur2 = { originalEvent: S, type: "cxtdrag", position: { x: Y[0], y: Y[1] } }; t13.data.bgActivePosistion = void 0, t13.redrawHint("select", true), t13.touchData.start ? t13.touchData.start.emit(ur2) : j.emit(ur2), t13.touchData.start && (t13.touchData.start._private.grabbed = false), t13.touchData.cxtDragged = true; var xt = t13.findNearestElement(Y[0], Y[1], true, true); (!t13.touchData.cxtOver || xt !== t13.touchData.cxtOver) && (t13.touchData.cxtOver && t13.touchData.cxtOver.emit({ originalEvent: S, type: "cxtdragout", position: { x: Y[0], y: Y[1] } }), t13.touchData.cxtOver = xt, xt && xt.emit({ originalEvent: S, type: "cxtdragover", position: { x: Y[0], y: Y[1] } })); } else if (z && S.touches[2] && j.boxSelectionEnabled()) S.preventDefault(), t13.data.bgActivePosistion = void 0, this.lastThreeTouch = +/* @__PURE__ */ new Date(), t13.touchData.selecting || j.emit({ originalEvent: S, type: "boxstart", position: { x: Y[0], y: Y[1] } }), t13.touchData.selecting = true, t13.touchData.didSelect = true, ie[4] = 1, !ie || ie.length === 0 || ie[0] === void 0 ? (ie[0] = (Y[0] + Y[2] + Y[4]) / 3, ie[1] = (Y[1] + Y[3] + Y[5]) / 3, ie[2] = (Y[0] + Y[2] + Y[4]) / 3 + 1, ie[3] = (Y[1] + Y[3] + Y[5]) / 3 + 1) : (ie[2] = (Y[0] + Y[2] + Y[4]) / 3, ie[3] = (Y[1] + Y[3] + Y[5]) / 3), t13.redrawHint("select", true), t13.redraw(); else if (z && S.touches[1] && !t13.touchData.didSelect && j.zoomingEnabled() && j.panningEnabled() && j.userZoomingEnabled() && j.userPanningEnabled()) { S.preventDefault(), t13.data.bgActivePosistion = void 0, t13.redrawHint("select", true); var Tt = t13.dragData.touchDragEles; if (Tt) { t13.redrawHint("drag", true); for (var Bt2 = 0; Bt2 < Tt.length; Bt2++) { var kn2 = Tt[Bt2]._private; kn2.grabbed = false, kn2.rscratch.inDragLayer = false; } } var W = t13.touchData.start, St2 = S.touches[0].clientX - q, wt = S.touches[0].clientY - ee, Zt = S.touches[1].clientX - q, Pt2 = S.touches[1].clientY - ee, we = ue(St2, wt, Zt, Pt2), We2 = we / A; if (ae) { var at2 = St2 - L, Gr2 = wt - B, Sn2 = Zt - F, Oa2 = Pt2 - M, sn2 = (at2 + Sn2) / 2, xr2 = (Gr2 + Oa2) / 2, Tn = j.zoom(), ml2 = Tn * We2, Bo2 = j.pan(), Oc2 = H[0] * Tn + Bo2.x, Lc2 = H[1] * Tn + Bo2.y, d02 = { x: -ml2 / Tn * (Oc2 - Bo2.x - sn2) + Oc2, y: -ml2 / Tn * (Lc2 - Bo2.y - xr2) + Lc2 }; if (W && W.active()) { var Tt = t13.dragData.touchDragEles; m(Tt), t13.redrawHint("drag", true), t13.redrawHint("eles", true), W.unactivate().emit("freeon"), Tt.emit("free"), t13.dragData.didDrag && (W.emit("dragfreeon"), Tt.emit("dragfree")); } j.viewport({ zoom: ml2, pan: d02, cancelOnFailedZoom: true }), j.emit("pinchzoom"), A = we, L = St2, B = wt, F = Zt, M = Pt2, t13.pinching = true; } if (S.touches[0]) { var ve = t13.projectIntoViewport(S.touches[0].clientX, S.touches[0].clientY); Y[0] = ve[0], Y[1] = ve[1]; } if (S.touches[1]) { var ve = t13.projectIntoViewport(S.touches[1].clientX, S.touches[1].clientY); Y[2] = ve[0], Y[3] = ve[1]; } if (S.touches[2]) { var ve = t13.projectIntoViewport(S.touches[2].clientX, S.touches[2].clientY); Y[4] = ve[0], Y[5] = ve[1]; } } else if (S.touches[0] && !t13.touchData.didSelect) { var Or2 = t13.touchData.start, yl2 = t13.touchData.last, xt; if (!t13.hoverData.draggingEles && !t13.swipePanning && (xt = t13.findNearestElement(Y[0], Y[1], true, true)), z && Or2 != null && S.preventDefault(), z && Or2 != null && t13.nodeIsDraggable(Or2)) if (Me) { var Tt = t13.dragData.touchDragEles, Fc2 = !t13.dragData.didDrag; Fc2 && f(Tt, { inDragLayer: true }), t13.dragData.didDrag = true; var ki2 = { x: 0, y: 0 }; if (be(_e[0]) && be(_e[1]) && (ki2.x += _e[0], ki2.y += _e[1], Fc2)) { t13.redrawHint("eles", true); var Lr2 = t13.touchData.dragDelta; Lr2 && be(Lr2[0]) && be(Lr2[1]) && (ki2.x += Lr2[0], ki2.y += Lr2[1]); } t13.hoverData.draggingEles = true, Tt.silentShift(ki2).emit("position drag"), t13.redrawHint("drag", true), t13.touchData.startPosition[0] == pe[0] && t13.touchData.startPosition[1] == pe[1] && t13.redrawHint("eles", true), t13.redraw(); } else { var Lr2 = t13.touchData.dragDelta = t13.touchData.dragDelta || []; Lr2.length === 0 ? (Lr2.push(_e[0]), Lr2.push(_e[1])) : (Lr2[0] += _e[0], Lr2[1] += _e[1]); } if (n(Or2 || xt, ["touchmove", "tapdrag", "vmousemove"], S, { x: Y[0], y: Y[1] }), (!Or2 || !Or2.grabbed()) && xt != yl2 && (yl2 && yl2.emit({ originalEvent: S, type: "tapdragout", position: { x: Y[0], y: Y[1] } }), xt && xt.emit({ originalEvent: S, type: "tapdragover", position: { x: Y[0], y: Y[1] } })), t13.touchData.last = xt, z) for (var Bt2 = 0; Bt2 < Y.length; Bt2++) Y[Bt2] && t13.touchData.startPosition[Bt2] && Me && (t13.touchData.singleTouchMoved = true); if (z && (Or2 == null || Or2.pannable()) && j.panningEnabled() && j.userPanningEnabled()) { var f02 = i(Or2, t13.touchData.starts); f02 && (S.preventDefault(), t13.data.bgActivePosistion || (t13.data.bgActivePosistion = Ha(t13.touchData.startPosition)), t13.swipePanning ? (j.panBy({ x: _e[0] * re, y: _e[1] * re }), j.emit("dragpan")) : Me && (t13.swipePanning = true, j.panBy({ x: Te * re, y: ut * re }), j.emit("dragpan"), Or2 && (Or2.unactivate(), t13.redrawHint("select", true), t13.touchData.start = null))); var ve = t13.projectIntoViewport(S.touches[0].clientX, S.touches[0].clientY); Y[0] = ve[0], Y[1] = ve[1]; } } for (var Ne = 0; Ne < Y.length; Ne++) pe[Ne] = Y[Ne]; z && S.touches.length > 0 && !t13.hoverData.draggingEles && !t13.swipePanning && t13.data.bgActivePosistion != null && (t13.data.bgActivePosistion = void 0, t13.redrawHint("select", true), t13.redraw()); } }, false); var Q; t13.registerBinding(e, "touchcancel", Q = function(S) { var z = t13.touchData.start; t13.touchData.capture = false, z && z.unactivate(); }); var ge, Ee, fe, me; if (t13.registerBinding(e, "touchend", ge = function(S) { var z = t13.touchData.start, ie = t13.touchData.capture; if (ie) S.touches.length === 0 && (t13.touchData.capture = false), S.preventDefault(); else return; var j = t13.selection; t13.swipePanning = false, t13.hoverData.draggingEles = false; var Y = t13.cy, pe = Y.zoom(), re = t13.touchData.now, ve = t13.touchData.earlier; if (S.touches[0]) { var Ae = t13.projectIntoViewport(S.touches[0].clientX, S.touches[0].clientY); re[0] = Ae[0], re[1] = Ae[1]; } if (S.touches[1]) { var Ae = t13.projectIntoViewport(S.touches[1].clientX, S.touches[1].clientY); re[2] = Ae[0], re[3] = Ae[1]; } if (S.touches[2]) { var Ae = t13.projectIntoViewport(S.touches[2].clientX, S.touches[2].clientY); re[4] = Ae[0], re[5] = Ae[1]; } z && z.unactivate(); var Me; if (t13.touchData.cxt) { if (Me = { originalEvent: S, type: "cxttapend", position: { x: re[0], y: re[1] } }, z ? z.emit(Me) : Y.emit(Me), !t13.touchData.cxtDragged) { var _e = { originalEvent: S, type: "cxttap", position: { x: re[0], y: re[1] } }; z ? z.emit(_e) : Y.emit(_e); } t13.touchData.start && (t13.touchData.start._private.grabbed = false), t13.touchData.cxt = false, t13.touchData.start = null, t13.redraw(); return; } if (!S.touches[2] && Y.boxSelectionEnabled() && t13.touchData.selecting) { t13.touchData.selecting = false; var Ne = Y.collection(t13.getAllInBox(j[0], j[1], j[2], j[3])); j[0] = void 0, j[1] = void 0, j[2] = void 0, j[3] = void 0, j[4] = 0, t13.redrawHint("select", true), Y.emit({ type: "boxend", originalEvent: S, position: { x: re[0], y: re[1] } }); var Te = function(jt2) { return jt2.selectable() && !jt2.selected(); }; Ne.emit("box").stdFilter(Te).select().emit("boxselect"), Ne.nonempty() && t13.redrawHint("eles", true), t13.redraw(); } if (z != null && z.unactivate(), S.touches[2]) t13.data.bgActivePosistion = void 0, t13.redrawHint("select", true); else if (!S.touches[1]) { if (!S.touches[0]) { if (!S.touches[0]) { t13.data.bgActivePosistion = void 0, t13.redrawHint("select", true); var Oe = t13.dragData.touchDragEles; if (z != null) { var ut = z._private.grabbed; m(Oe), t13.redrawHint("drag", true), t13.redrawHint("eles", true), ut && (z.emit("freeon"), Oe.emit("free"), t13.dragData.didDrag && (z.emit("dragfreeon"), Oe.emit("dragfree"))), n(z, ["touchend", "tapend", "vmouseup", "tapdragout"], S, { x: re[0], y: re[1] }), z.unactivate(), t13.touchData.start = null; } else { var nt2 = t13.findNearestElement(re[0], re[1], true, true); n(nt2, ["touchend", "tapend", "vmouseup", "tapdragout"], S, { x: re[0], y: re[1] }); } var kt = t13.touchData.startPosition[0] - re[0], St2 = kt * kt, wt = t13.touchData.startPosition[1] - re[1], Zt = wt * wt, Pt2 = St2 + Zt, Mt = Pt2 * pe * pe; t13.touchData.singleTouchMoved || (z || Y.$(":selected").unselect(["tapunselect"]), n(z, ["tap", "vclick"], S, { x: re[0], y: re[1] }), Ee = false, S.timeStamp - me <= Y.multiClickDebounceTime() ? (fe && clearTimeout(fe), Ee = true, me = null, n(z, ["dbltap", "vdblclick"], S, { x: re[0], y: re[1] })) : (fe = setTimeout(function() { Ee || n(z, ["onetap", "voneclick"], S, { x: re[0], y: re[1] }); }, Y.multiClickDebounceTime()), me = S.timeStamp)), z != null && !t13.dragData.didDrag && z._private.selectable && Mt < t13.touchTapThreshold2 && !t13.pinching && (Y.selectionType() === "single" ? (Y.$(r).unmerge(z).unselect(["tapunselect"]), z.select(["tapselect"])) : z.selected() ? z.unselect(["tapunselect"]) : z.select(["tapselect"]), t13.redrawHint("eles", true)), t13.touchData.singleTouchMoved = true; } } } for (var gr2 = 0; gr2 < re.length; gr2++) ve[gr2] = re[gr2]; t13.dragData.didDrag = false, S.touches.length === 0 && (t13.touchData.dragDelta = [], t13.touchData.startPosition = [null, null, null, null, null, null], t13.touchData.startGPosition = null, t13.touchData.didSelect = false), S.touches.length < 2 && (S.touches.length === 1 && (t13.touchData.startGPosition = [S.touches[0].clientX, S.touches[0].clientY]), t13.pinching = false, t13.redrawHint("eles", true), t13.redraw()); }, false), typeof TouchEvent > "u") { var xe = [], ke = function(S) { return { clientX: S.clientX, clientY: S.clientY, force: 1, identifier: S.pointerId, pageX: S.pageX, pageY: S.pageY, radiusX: S.width / 2, radiusY: S.height / 2, screenX: S.screenX, screenY: S.screenY, target: S.target }; }, Ce = function(S) { return { event: S, touch: ke(S) }; }, De = function(S) { xe.push(Ce(S)); }, qe = function(S) { for (var z = 0; z < xe.length; z++) { var ie = xe[z]; if (ie.event.pointerId === S.pointerId) { xe.splice(z, 1); return; } } }, Ke = function(S) { var z = xe.filter(function(ie) { return ie.event.pointerId === S.pointerId; })[0]; z.event = S, z.touch = ke(S); }, Be = function(S) { S.touches = xe.map(function(z) { return z.touch; }); }, Ge = function(S) { return S.pointerType === "mouse" || S.pointerType === 4; }; t13.registerBinding(t13.container, "pointerdown", function(le) { Ge(le) || (le.preventDefault(), De(le), Be(le), $(le)); }), t13.registerBinding(t13.container, "pointerup", function(le) { Ge(le) || (qe(le), Be(le), ge(le)); }), t13.registerBinding(t13.container, "pointercancel", function(le) { Ge(le) || (qe(le), Be(le), Q(le)); }), t13.registerBinding(t13.container, "pointermove", function(le) { Ge(le) || (le.preventDefault(), Ke(le), Be(le), G(le)); }); } }; var Cn = {}; Cn.generatePolygon = function(t13, e) { return this.nodeShapes[t13] = { renderer: this, name: t13, points: e, draw: function(n, a, i, o, s, u) { this.renderer.nodeShapeImpl("polygon", n, a, i, o, s, this.points); }, intersectLine: function(n, a, i, o, s, u, l, c) { return oo(s, u, this.points, n, a, i / 2, o / 2, l); }, checkPoint: function(n, a, i, o, s, u, l, c) { return mn(n, a, this.points, u, l, o, s, [0, -1], i); } }; }; Cn.generateEllipse = function() { return this.nodeShapes.ellipse = { renderer: this, name: "ellipse", draw: function(e, r, n, a, i, o) { this.renderer.nodeShapeImpl(this.name, e, r, n, a, i); }, intersectLine: function(e, r, n, a, i, o, s, u) { return t4(i, o, e, r, n / 2 + s, a / 2 + s); }, checkPoint: function(e, r, n, a, i, o, s, u) { return la(e, r, a, i, o, s, n); } }; }; Cn.generateRoundPolygon = function(t13, e) { return this.nodeShapes[t13] = { renderer: this, name: t13, points: e, getOrCreateCorners: function(n, a, i, o, s, u, l) { if (u[l] !== void 0 && u[l + "-cx"] === n && u[l + "-cy"] === a) return u[l]; u[l] = new Array(e.length / 2), u[l + "-cx"] = n, u[l + "-cy"] = a; var c = i / 2, d = o / 2; s = s === "auto" ? gp(i, o) : s; for (var v = new Array(e.length / 2), h6 = 0; h6 < e.length / 2; h6++) v[h6] = { x: n + c * e[h6 * 2], y: a + d * e[h6 * 2 + 1] }; var f, p, m, g, y = v.length; for (p = v[y - 1], f = 0; f < y; f++) m = v[f % y], g = v[(f + 1) % y], u[l][f] = Sc(p, m, g, s), p = m, m = g; return u[l]; }, draw: function(n, a, i, o, s, u, l) { this.renderer.nodeShapeImpl("round-polygon", n, a, i, o, s, this.points, this.getOrCreateCorners(a, i, o, s, u, l, "drawCorners")); }, intersectLine: function(n, a, i, o, s, u, l, c, d) { return r4(s, u, this.points, n, a, i, o, l, this.getOrCreateCorners(n, a, i, o, c, d, "corners")); }, checkPoint: function(n, a, i, o, s, u, l, c, d) { return e4(n, a, this.points, u, l, o, s, this.getOrCreateCorners(u, l, o, s, c, d, "corners")); } }; }; Cn.generateRoundRectangle = function() { return this.nodeShapes["round-rectangle"] = this.nodeShapes.roundrectangle = { renderer: this, name: "round-rectangle", points: sr(4, 0), draw: function(e, r, n, a, i, o) { this.renderer.nodeShapeImpl(this.name, e, r, n, a, i, this.points, o); }, intersectLine: function(e, r, n, a, i, o, s, u) { return hp(i, o, e, r, n, a, s, u); }, checkPoint: function(e, r, n, a, i, o, s, u) { var l = a / 2, c = i / 2; u = u === "auto" ? ba(a, i) : u, u = Math.min(l, c, u); var d = u * 2; return !!(mn(e, r, this.points, o, s, a, i - d, [0, -1], n) || mn(e, r, this.points, o, s, a - d, i, [0, -1], n) || la(e, r, d, d, o - l + u, s - c + u, n) || la(e, r, d, d, o + l - u, s - c + u, n) || la(e, r, d, d, o + l - u, s + c - u, n) || la(e, r, d, d, o - l + u, s + c - u, n)); } }; }; Cn.generateCutRectangle = function() { return this.nodeShapes["cut-rectangle"] = this.nodeShapes.cutrectangle = { renderer: this, name: "cut-rectangle", cornerLength: vc(), points: sr(4, 0), draw: function(e, r, n, a, i, o) { this.renderer.nodeShapeImpl(this.name, e, r, n, a, i, null, o); }, generateCutTrianglePts: function(e, r, n, a, i) { var o = i === "auto" ? this.cornerLength : i, s = r / 2, u = e / 2, l = n - u, c = n + u, d = a - s, v = a + s; return { topLeft: [l, d + o, l + o, d, l + o, d + o], topRight: [c - o, d, c, d + o, c - o, d + o], bottomRight: [c, v - o, c - o, v, c - o, v - o], bottomLeft: [l + o, v, l, v - o, l + o, v - o] }; }, intersectLine: function(e, r, n, a, i, o, s, u) { var l = this.generateCutTrianglePts(n + 2 * s, a + 2 * s, e, r, u), c = [].concat.apply([], [l.topLeft.splice(0, 4), l.topRight.splice(0, 4), l.bottomRight.splice(0, 4), l.bottomLeft.splice(0, 4)]); return oo(i, o, c, e, r); }, checkPoint: function(e, r, n, a, i, o, s, u) { var l = u === "auto" ? this.cornerLength : u; if (mn(e, r, this.points, o, s, a, i - 2 * l, [0, -1], n) || mn(e, r, this.points, o, s, a - 2 * l, i, [0, -1], n)) return true; var c = this.generateCutTrianglePts(a, i, o, s); return dr(e, r, c.topLeft) || dr(e, r, c.topRight) || dr(e, r, c.bottomRight) || dr(e, r, c.bottomLeft); } }; }; Cn.generateBarrel = function() { return this.nodeShapes.barrel = { renderer: this, name: "barrel", points: sr(4, 0), draw: function(e, r, n, a, i, o) { this.renderer.nodeShapeImpl(this.name, e, r, n, a, i); }, intersectLine: function(e, r, n, a, i, o, s, u) { var l = 0.15, c = 0.5, d = 0.85, v = this.generateBarrelBezierPts(n + 2 * s, a + 2 * s, e, r), h6 = function(m) { var g = Ga({ x: m[0], y: m[1] }, { x: m[2], y: m[3] }, { x: m[4], y: m[5] }, l), y = Ga({ x: m[0], y: m[1] }, { x: m[2], y: m[3] }, { x: m[4], y: m[5] }, c), b = Ga({ x: m[0], y: m[1] }, { x: m[2], y: m[3] }, { x: m[4], y: m[5] }, d); return [m[0], m[1], g.x, g.y, y.x, y.y, b.x, b.y, m[4], m[5]]; }, f = [].concat(h6(v.topLeft), h6(v.topRight), h6(v.bottomRight), h6(v.bottomLeft)); return oo(i, o, f, e, r); }, generateBarrelBezierPts: function(e, r, n, a) { var i = r / 2, o = e / 2, s = n - o, u = n + o, l = a - i, c = a + i, d = lu(e, r), v = d.heightOffset, h6 = d.widthOffset, f = d.ctrlPtOffsetPct * e, p = { topLeft: [s, l + v, s + f, l, s + h6, l], topRight: [u - h6, l, u - f, l, u, l + v], bottomRight: [u, c - v, u - f, c, u - h6, c], bottomLeft: [s + h6, c, s + f, c, s, c - v] }; return p.topLeft.isTop = true, p.topRight.isTop = true, p.bottomLeft.isBottom = true, p.bottomRight.isBottom = true, p; }, checkPoint: function(e, r, n, a, i, o, s, u) { var l = lu(a, i), c = l.heightOffset, d = l.widthOffset; if (mn(e, r, this.points, o, s, a, i - 2 * c, [0, -1], n) || mn(e, r, this.points, o, s, a - 2 * d, i, [0, -1], n)) return true; for (var v = this.generateBarrelBezierPts(a, i, o, s), h6 = function(T, k, _) { var D = _[4], O = _[2], I = _[0], L = _[5], B = _[1], F = Math.min(D, I), M = Math.max(D, I), A = Math.min(L, B), R = Math.max(L, B); if (F <= T && T <= M && A <= k && k <= R) { var K = n4(D, O, I), H = X5(K[0], K[1], K[2], T), q = H.filter(function(ee) { return 0 <= ee && ee <= 1; }); if (q.length > 0) return q[0]; } return null; }, f = Object.keys(v), p = 0; p < f.length; p++) { var m = f[p], g = v[m], y = h6(e, r, g); if (y != null) { var b = g[5], w = g[3], C = g[1], E = Nt(b, w, C, y); if (g.isTop && E <= r || g.isBottom && r <= E) return true; } } return false; } }; }; Cn.generateBottomRoundrectangle = function() { return this.nodeShapes["bottom-round-rectangle"] = this.nodeShapes.bottomroundrectangle = { renderer: this, name: "bottom-round-rectangle", points: sr(4, 0), draw: function(e, r, n, a, i, o) { this.renderer.nodeShapeImpl(this.name, e, r, n, a, i, this.points, o); }, intersectLine: function(e, r, n, a, i, o, s, u) { var l = e - (n / 2 + s), c = r - (a / 2 + s), d = c, v = e + (n / 2 + s), h6 = Nn(i, o, e, r, l, c, v, d, false); return h6.length > 0 ? h6 : hp(i, o, e, r, n, a, s, u); }, checkPoint: function(e, r, n, a, i, o, s, u) { u = u === "auto" ? ba(a, i) : u; var l = 2 * u; if (mn(e, r, this.points, o, s, a, i - l, [0, -1], n) || mn(e, r, this.points, o, s, a - l, i, [0, -1], n)) return true; var c = a / 2 + 2 * n, d = i / 2 + 2 * n, v = [o - c, s - d, o - c, s, o + c, s, o + c, s - d]; return !!(dr(e, r, v) || la(e, r, l, l, o + a / 2 - u, s + i / 2 - u, n) || la(e, r, l, l, o - a / 2 + u, s + i / 2 - u, n)); } }; }; Cn.registerNodeShapes = function() { var t13 = this.nodeShapes = {}, e = this; this.generateEllipse(), this.generatePolygon("triangle", sr(3, 0)), this.generateRoundPolygon("round-triangle", sr(3, 0)), this.generatePolygon("rectangle", sr(4, 0)), t13.square = t13.rectangle, this.generateRoundRectangle(), this.generateCutRectangle(), this.generateBarrel(), this.generateBottomRoundrectangle(); { var r = [0, 1, 1, 0, 0, -1, -1, 0]; this.generatePolygon("diamond", r), this.generateRoundPolygon("round-diamond", r); } this.generatePolygon("pentagon", sr(5, 0)), this.generateRoundPolygon("round-pentagon", sr(5, 0)), this.generatePolygon("hexagon", sr(6, 0)), this.generateRoundPolygon("round-hexagon", sr(6, 0)), this.generatePolygon("heptagon", sr(7, 0)), this.generateRoundPolygon("round-heptagon", sr(7, 0)), this.generatePolygon("octagon", sr(8, 0)), this.generateRoundPolygon("round-octagon", sr(8, 0)); var n = new Array(20); { var a = su(5, 0), i = su(5, Math.PI / 5), o = 0.5 * (3 - Math.sqrt(5)); o *= 1.57; for (var s = 0; s < i.length / 2; s++) i[s * 2] *= o, i[s * 2 + 1] *= o; for (var s = 0; s < 20 / 4; s++) n[s * 4] = a[s * 2], n[s * 4 + 1] = a[s * 2 + 1], n[s * 4 + 2] = i[s * 2], n[s * 4 + 3] = i[s * 2 + 1]; } n = pp(n), this.generatePolygon("star", n), this.generatePolygon("vee", [-1, -1, 0, -0.333, 1, -1, 0, 1]), this.generatePolygon("rhomboid", [-1, -1, 0.333, -1, 1, 1, -0.333, 1]), this.generatePolygon("right-rhomboid", [-0.333, -1, 1, -1, 0.333, 1, -1, 1]), this.nodeShapes.concavehexagon = this.generatePolygon("concave-hexagon", [-1, -0.95, -0.75, 0, -1, 0.95, 1, 0.95, 0.75, 0, 1, -0.95]); { var u = [-1, -1, 0.25, -1, 1, 0, 0.25, 1, -1, 1]; this.generatePolygon("tag", u), this.generateRoundPolygon("round-tag", u); } t13.makePolygon = function(l) { var c = l.join("$"), d = "polygon-" + c, v; return (v = this[d]) ? v : e.generatePolygon(d, l); }; }; var Ao = {}; Ao.timeToRender = function() { return this.redrawTotalTime / this.redrawCount; }; Ao.redraw = function(t13) { t13 = t13 || up(); var e = this; e.averageRedrawTime === void 0 && (e.averageRedrawTime = 0), e.lastRedrawTime === void 0 && (e.lastRedrawTime = 0), e.lastDrawTime === void 0 && (e.lastDrawTime = 0), e.requestedFrame = true, e.renderOptions = t13; }; Ao.beforeRender = function(t13, e) { if (!this.destroyed) { e == null && yt("Priority is not optional for beforeRender"); var r = this.beforeRenderCallbacks; r.push({ fn: t13, priority: e }), r.sort(function(n, a) { return a.priority - n.priority; }); } }; var av = function(e, r, n) { for (var a = e.beforeRenderCallbacks, i = 0; i < a.length; i++) a[i].fn(r, n); }; Ao.startRenderLoop = function() { var t13 = this, e = t13.cy; if (!t13.renderLoopStarted) { t13.renderLoopStarted = true; var r = function n(a) { if (!t13.destroyed) { if (!e.batching()) if (t13.requestedFrame && !t13.skipFrame) { av(t13, true, a); var i = gn(); t13.render(t13.renderOptions); var o = t13.lastDrawTime = gn(); t13.averageRedrawTime === void 0 && (t13.averageRedrawTime = o - i), t13.redrawCount === void 0 && (t13.redrawCount = 0), t13.redrawCount++, t13.redrawTotalTime === void 0 && (t13.redrawTotalTime = 0); var s = o - i; t13.redrawTotalTime += s, t13.lastRedrawTime = s, t13.averageRedrawTime = t13.averageRedrawTime / 2 + s / 2, t13.requestedFrame = false; } else av(t13, false, a); t13.skipFrame = false, Ps(n); } }; Ps(r); } }; var $P = function(e) { this.init(e); }; var hg = $P; var xi = hg.prototype; xi.clientFunctions = ["redrawHint", "render", "renderTo", "matchCanvasSize", "nodeShapeImpl", "arrowShapeImpl"]; xi.init = function(t13) { var e = this; e.options = t13, e.cy = t13.cy; var r = e.container = t13.cy.container(), n = e.cy.window(); if (n) { var a = n.document, i = a.head, o = "__________cytoscape_stylesheet", s = "__________cytoscape_container", u = a.getElementById(o) != null; if (r.className.indexOf(s) < 0 && (r.className = (r.className || "") + " " + s), !u) { var l = a.createElement("style"); l.id = o, l.textContent = "." + s + " { position: relative; }", i.insertBefore(l, i.children[0]); } var c = n.getComputedStyle(r), d = c.getPropertyValue("position"); d === "static" && tt("A Cytoscape container has style position:static and so can not use UI extensions properly"); } e.selection = [void 0, void 0, void 0, void 0, 0], e.bezierProjPcts = [0.05, 0.225, 0.4, 0.5, 0.6, 0.775, 0.95], e.hoverData = { down: null, last: null, downTime: null, triggerMode: null, dragging: false, initialPan: [null, null], capture: false }, e.dragData = { possibleDragElements: [] }, e.touchData = { start: null, capture: false, // These 3 fields related to tap, taphold events startPosition: [null, null, null, null, null, null], singleTouchStartTime: null, singleTouchMoved: true, now: [null, null, null, null, null, null], earlier: [null, null, null, null, null, null] }, e.redraws = 0, e.showFps = t13.showFps, e.debug = t13.debug, e.hideEdgesOnViewport = t13.hideEdgesOnViewport, e.textureOnViewport = t13.textureOnViewport, e.wheelSensitivity = t13.wheelSensitivity, e.motionBlurEnabled = t13.motionBlur, e.forcedPixelRatio = be(t13.pixelRatio) ? t13.pixelRatio : null, e.motionBlur = t13.motionBlur, e.motionBlurOpacity = t13.motionBlurOpacity, e.motionBlurTransparency = 1 - e.motionBlurOpacity, e.motionBlurPxRatio = 1, e.mbPxRBlurry = 1, e.minMbLowQualFrames = 4, e.fullQualityMb = false, e.clearedForMotionBlur = [], e.desktopTapThreshold = t13.desktopTapThreshold, e.desktopTapThreshold2 = t13.desktopTapThreshold * t13.desktopTapThreshold, e.touchTapThreshold = t13.touchTapThreshold, e.touchTapThreshold2 = t13.touchTapThreshold * t13.touchTapThreshold, e.tapholdDuration = 500, e.bindings = [], e.beforeRenderCallbacks = [], e.beforeRenderPriorities = { // higher priority execs before lower one animations: 400, eleCalcs: 300, eleTxrDeq: 200, lyrTxrDeq: 150, lyrTxrSkip: 100 }, e.registerNodeShapes(), e.registerArrowShapes(), e.registerCalculationListeners(); }; xi.notify = function(t13, e) { var r = this, n = r.cy; if (!this.destroyed) { if (t13 === "init") { r.load(); return; } if (t13 === "destroy") { r.destroy(); return; } (t13 === "add" || t13 === "remove" || t13 === "move" && n.hasCompoundNodes() || t13 === "load" || t13 === "zorder" || t13 === "mount") && r.invalidateCachedZSortedEles(), t13 === "viewport" && r.redrawHint("select", true), (t13 === "load" || t13 === "resize" || t13 === "mount") && (r.invalidateContainerClientCoordsCache(), r.matchCanvasSize(r.container)), r.redrawHint("eles", true), r.redrawHint("drag", true), this.startRenderLoop(), this.redraw(); } }; xi.destroy = function() { var t13 = this; t13.destroyed = true, t13.cy.stopAnimationLoop(); for (var e = 0; e < t13.bindings.length; e++) { var r = t13.bindings[e], n = r, a = n.target; (a.off || a.removeEventListener).apply(a, n.args); } if (t13.bindings = [], t13.beforeRenderCallbacks = [], t13.onUpdateEleCalcsFns = [], t13.removeObserver && t13.removeObserver.disconnect(), t13.styleObserver && t13.styleObserver.disconnect(), t13.resizeObserver && t13.resizeObserver.disconnect(), t13.labelCalcDiv) try { document.body.removeChild(t13.labelCalcDiv); } catch { } }; xi.isHeadless = function() { return false; }; [kc, fg, vg, wi, Cn, Ao].forEach(function(t13) { Re(xi, t13); }); var ql = 1e3 / 60; var pg = { setupDequeueing: function(e) { return function() { var n = this, a = this.renderer; if (!n.dequeueingSetup) { n.dequeueingSetup = true; var i = tl(function() { a.redrawHint("eles", true), a.redrawHint("drag", true), a.redraw(); }, e.deqRedrawThreshold), o = function(l, c) { var d = gn(), v = a.averageRedrawTime, h6 = a.lastRedrawTime, f = [], p = a.cy.extent(), m = a.getPixelRatio(); for (l || a.flushRenderedStyleQueue(); ; ) { var g = gn(), y = g - d, b = g - c; if (h6 < ql) { var w = ql - (l ? v : 0); if (b >= e.deqFastCost * w) break; } else if (l) { if (y >= e.deqCost * h6 || y >= e.deqAvgCost * v) break; } else if (b >= e.deqNoDrawCost * ql) break; var C = e.deq(n, m, p); if (C.length > 0) for (var E = 0; E < C.length; E++) f.push(C[E]); else break; } f.length > 0 && (e.onDeqd(n, f), !l && e.shouldRedraw(n, f, m, p) && i()); }, s = e.priority || uc; a.beforeRender(o, s(n)); } }; } }; var RP = function() { function t13(e) { var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Os; ac(this, t13), this.idsByKey = new Xr(), this.keyForId = new Xr(), this.cachesByLvl = new Xr(), this.lvls = [], this.getKey = e, this.doesEleInvalidateKey = r; } return ic(t13, [{ key: "getIdsFor", value: function(r) { r == null && yt("Can not get id list for null key"); var n = this.idsByKey, a = this.idsByKey.get(r); return a || (a = new vi(), n.set(r, a)), a; } }, { key: "addIdForKey", value: function(r, n) { r != null && this.getIdsFor(r).add(n); } }, { key: "deleteIdForKey", value: function(r, n) { r != null && this.getIdsFor(r).delete(n); } }, { key: "getNumberOfIdsForKey", value: function(r) { return r == null ? 0 : this.getIdsFor(r).size; } }, { key: "updateKeyMappingFor", value: function(r) { var n = r.id(), a = this.keyForId.get(n), i = this.getKey(r); this.deleteIdForKey(a, n), this.addIdForKey(i, n), this.keyForId.set(n, i); } }, { key: "deleteKeyMappingFor", value: function(r) { var n = r.id(), a = this.keyForId.get(n); this.deleteIdForKey(a, n), this.keyForId.delete(n); } }, { key: "keyHasChangedFor", value: function(r) { var n = r.id(), a = this.keyForId.get(n), i = this.getKey(r); return a !== i; } }, { key: "isInvalid", value: function(r) { return this.keyHasChangedFor(r) || this.doesEleInvalidateKey(r); } }, { key: "getCachesAt", value: function(r) { var n = this.cachesByLvl, a = this.lvls, i = n.get(r); return i || (i = new Xr(), n.set(r, i), a.push(r)), i; } }, { key: "getCache", value: function(r, n) { return this.getCachesAt(n).get(r); } }, { key: "get", value: function(r, n) { var a = this.getKey(r), i = this.getCache(a, n); return i != null && this.updateKeyMappingFor(r), i; } }, { key: "getForCachedKey", value: function(r, n) { var a = this.keyForId.get(r.id()), i = this.getCache(a, n); return i; } }, { key: "hasCache", value: function(r, n) { return this.getCachesAt(n).has(r); } }, { key: "has", value: function(r, n) { var a = this.getKey(r); return this.hasCache(a, n); } }, { key: "setCache", value: function(r, n, a) { a.key = r, this.getCachesAt(n).set(r, a); } }, { key: "set", value: function(r, n, a) { var i = this.getKey(r); this.setCache(i, n, a), this.updateKeyMappingFor(r); } }, { key: "deleteCache", value: function(r, n) { this.getCachesAt(n).delete(r); } }, { key: "delete", value: function(r, n) { var a = this.getKey(r); this.deleteCache(a, n); } }, { key: "invalidateKey", value: function(r) { var n = this; this.lvls.forEach(function(a) { return n.deleteCache(r, a); }); } // returns true if no other eles reference the invalidated cache (n.b. other eles may need the cache with the same key) }, { key: "invalidate", value: function(r) { var n = r.id(), a = this.keyForId.get(n); this.deleteKeyMappingFor(r); var i = this.doesEleInvalidateKey(r); return i && this.invalidateKey(a), i || this.getNumberOfIdsForKey(a) === 0; } }]), t13; }(); var iv = 25; var ns = 50; var ms = -4; var bu = 3; var zP = 7.99; var VP = 8; var HP = 1024; var qP = 1024; var KP = 1024; var UP = 0.2; var GP = 0.8; var WP = 10; var YP = 0.15; var ZP = 0.1; var XP = 0.9; var jP = 0.9; var QP = 100; var JP = 1; var qa = { dequeue: "dequeue", downscale: "downscale", highQuality: "highQuality" }; var eO = Wt({ getKey: null, doesEleInvalidateKey: Os, drawElement: null, getBoundingBox: null, getRotationPoint: null, getRotationOffset: null, isVisible: op, allowEdgeTxrCaching: true, allowParentTxrCaching: true }); var Ri = function(e, r) { var n = this; n.renderer = e, n.onDequeues = []; var a = eO(r); Re(n, a), n.lookup = new RP(a.getKey, a.doesEleInvalidateKey), n.setupDequeueing(); }; var At = Ri.prototype; At.reasons = qa; At.getTextureQueue = function(t13) { var e = this; return e.eleImgCaches = e.eleImgCaches || {}, e.eleImgCaches[t13] = e.eleImgCaches[t13] || []; }; At.getRetiredTextureQueue = function(t13) { var e = this, r = e.eleImgCaches.retired = e.eleImgCaches.retired || {}, n = r[t13] = r[t13] || []; return n; }; At.getElementQueue = function() { var t13 = this, e = t13.eleCacheQueue = t13.eleCacheQueue || new Oo(function(r, n) { return n.reqs - r.reqs; }); return e; }; At.getElementKeyToQueue = function() { var t13 = this, e = t13.eleKeyToCacheQueue = t13.eleKeyToCacheQueue || {}; return e; }; At.getElement = function(t13, e, r, n, a) { var i = this, o = this.renderer, s = o.cy.zoom(), u = this.lookup; if (!e || e.w === 0 || e.h === 0 || isNaN(e.w) || isNaN(e.h) || !t13.visible() || t13.removed() || !i.allowEdgeTxrCaching && t13.isEdge() || !i.allowParentTxrCaching && t13.isParent()) return null; if (n == null && (n = Math.ceil(dc(s * r))), n < ms) n = ms; else if (s >= zP || n > bu) return null; var l = Math.pow(2, n), c = e.h * l, d = e.w * l, v = o.eleTextBiggerThanMin(t13, l); if (!this.isVisible(t13, v)) return null; var h6 = u.get(t13, n); if (h6 && h6.invalidated && (h6.invalidated = false, h6.texture.invalidatedWidth -= h6.width), h6) return h6; var f; if (c <= iv ? f = iv : c <= ns ? f = ns : f = Math.ceil(c / ns) * ns, c > KP || d > qP) return null; var p = i.getTextureQueue(f), m = p[p.length - 2], g = function() { return i.recycleTexture(f, d) || i.addTexture(f, d); }; m || (m = p[p.length - 1]), m || (m = g()), m.width - m.usedWidth < d && (m = g()); for (var y = function(F) { return F && F.scaledLabelShown === v; }, b = a && a === qa.dequeue, w = a && a === qa.highQuality, C = a && a === qa.downscale, E, x = n + 1; x <= bu; x++) { var T = u.get(t13, x); if (T) { E = T; break; } } var k = E && E.level === n + 1 ? E : null, _ = function() { m.context.drawImage(k.texture.canvas, k.x, 0, k.width, k.height, m.usedWidth, 0, d, c); }; if (m.context.setTransform(1, 0, 0, 1, 0, 0), m.context.clearRect(m.usedWidth, 0, d, f), y(k)) _(); else if (y(E)) if (w) { for (var D = E.level; D > n; D--) k = i.getElement(t13, e, r, D, qa.downscale); _(); } else return i.queueElement(t13, E.level - 1), E; else { var O; if (!b && !w && !C) for (var I = n - 1; I >= ms; I--) { var L = u.get(t13, I); if (L) { O = L; break; } } if (y(O)) return i.queueElement(t13, n), O; m.context.translate(m.usedWidth, 0), m.context.scale(l, l), this.drawElement(m.context, t13, e, v, false), m.context.scale(1 / l, 1 / l), m.context.translate(-m.usedWidth, 0); } return h6 = { x: m.usedWidth, texture: m, level: n, scale: l, width: d, height: c, scaledLabelShown: v }, m.usedWidth += Math.ceil(d + VP), m.eleCaches.push(h6), u.set(t13, n, h6), i.checkTextureFullness(m), h6; }; At.invalidateElements = function(t13) { for (var e = 0; e < t13.length; e++) this.invalidateElement(t13[e]); }; At.invalidateElement = function(t13) { var e = this, r = e.lookup, n = [], a = r.isInvalid(t13); if (a) { for (var i = ms; i <= bu; i++) { var o = r.getForCachedKey(t13, i); o && n.push(o); } var s = r.invalidate(t13); if (s) for (var u = 0; u < n.length; u++) { var l = n[u], c = l.texture; c.invalidatedWidth += l.width, l.invalidated = true, e.checkTextureUtility(c); } e.removeFromQueue(t13); } }; At.checkTextureUtility = function(t13) { t13.invalidatedWidth >= UP * t13.width && this.retireTexture(t13); }; At.checkTextureFullness = function(t13) { var e = this, r = e.getTextureQueue(t13.height); t13.usedWidth / t13.width > GP && t13.fullnessChecks >= WP ? Kn(r, t13) : t13.fullnessChecks++; }; At.retireTexture = function(t13) { var e = this, r = t13.height, n = e.getTextureQueue(r), a = this.lookup; Kn(n, t13), t13.retired = true; for (var i = t13.eleCaches, o = 0; o < i.length; o++) { var s = i[o]; a.deleteCache(s.key, s.level); } cc(i); var u = e.getRetiredTextureQueue(r); u.push(t13); }; At.addTexture = function(t13, e) { var r = this, n = r.getTextureQueue(t13), a = {}; return n.push(a), a.eleCaches = [], a.height = t13, a.width = Math.max(HP, e), a.usedWidth = 0, a.invalidatedWidth = 0, a.fullnessChecks = 0, a.canvas = r.renderer.makeOffscreenCanvas(a.width, a.height), a.context = a.canvas.getContext("2d"), a; }; At.recycleTexture = function(t13, e) { for (var r = this, n = r.getTextureQueue(t13), a = r.getRetiredTextureQueue(t13), i = 0; i < a.length; i++) { var o = a[i]; if (o.width >= e) return o.retired = false, o.usedWidth = 0, o.invalidatedWidth = 0, o.fullnessChecks = 0, cc(o.eleCaches), o.context.setTransform(1, 0, 0, 1, 0, 0), o.context.clearRect(0, 0, o.width, o.height), Kn(a, o), n.push(o), o; } }; At.queueElement = function(t13, e) { var r = this, n = r.getElementQueue(), a = r.getElementKeyToQueue(), i = this.getKey(t13), o = a[i]; if (o) o.level = Math.max(o.level, e), o.eles.merge(t13), o.reqs++, n.updateItem(o); else { var s = { eles: t13.spawn().merge(t13), level: e, reqs: 1, key: i }; n.push(s), a[i] = s; } }; At.dequeue = function(t13) { for (var e = this, r = e.getElementQueue(), n = e.getElementKeyToQueue(), a = [], i = e.lookup, o = 0; o < JP && r.size() > 0; o++) { var s = r.pop(), u = s.key, l = s.eles[0], c = i.hasCache(l, s.level); if (n[u] = null, c) continue; a.push(s); var d = e.getBoundingBox(l); e.getElement(l, d, t13, s.level, qa.dequeue); } return a; }; At.removeFromQueue = function(t13) { var e = this, r = e.getElementQueue(), n = e.getElementKeyToQueue(), a = this.getKey(t13), i = n[a]; i != null && (i.eles.length === 1 ? (i.reqs = lc, r.updateItem(i), r.pop(), n[a] = null) : i.eles.unmerge(t13)); }; At.onDequeue = function(t13) { this.onDequeues.push(t13); }; At.offDequeue = function(t13) { Kn(this.onDequeues, t13); }; At.setupDequeueing = pg.setupDequeueing({ deqRedrawThreshold: QP, deqCost: YP, deqAvgCost: ZP, deqNoDrawCost: XP, deqFastCost: jP, deq: function(e, r, n) { return e.dequeue(r, n); }, onDeqd: function(e, r) { for (var n = 0; n < e.onDequeues.length; n++) { var a = e.onDequeues[n]; a(r); } }, shouldRedraw: function(e, r, n, a) { for (var i = 0; i < r.length; i++) for (var o = r[i].eles, s = 0; s < o.length; s++) { var u = o[s].boundingBox(); if (fc(u, a)) return true; } return false; }, priority: function(e) { return e.renderer.beforeRenderPriorities.eleTxrDeq; } }); var tO = 1; var Ui = -4; var $s = 2; var rO = 3.99; var nO = 50; var aO = 50; var iO = 0.15; var oO = 0.1; var sO = 0.9; var lO = 0.9; var uO = 1; var ov = 250; var cO = 4e3 * 4e3; var dO = true; var gg = function(e) { var r = this, n = r.renderer = e, a = n.cy; r.layersByLevel = {}, r.firstGet = true, r.lastInvalidationTime = gn() - 2 * ov, r.skipping = false, r.eleTxrDeqs = a.collection(), r.scheduleElementRefinement = tl(function() { r.refineElementTextures(r.eleTxrDeqs), r.eleTxrDeqs.unmerge(r.eleTxrDeqs); }, aO), n.beforeRender(function(o, s) { s - r.lastInvalidationTime <= ov ? r.skipping = true : r.skipping = false; }, n.beforeRenderPriorities.lyrTxrSkip); var i = function(s, u) { return u.reqs - s.reqs; }; r.layersQueue = new Oo(i), r.setupDequeueing(); }; var Yt = gg.prototype; var sv = 0; var fO = Math.pow(2, 53) - 1; Yt.makeLayer = function(t13, e) { var r = Math.pow(2, e), n = Math.ceil(t13.w * r), a = Math.ceil(t13.h * r), i = this.renderer.makeOffscreenCanvas(n, a), o = { id: sv = ++sv % fO, bb: t13, level: e, width: n, height: a, canvas: i, context: i.getContext("2d"), eles: [], elesQueue: [], reqs: 0 }, s = o.context, u = -o.bb.x1, l = -o.bb.y1; return s.scale(r, r), s.translate(u, l), o; }; Yt.getLayers = function(t13, e, r) { var n = this, a = n.renderer, i = a.cy, o = i.zoom(), s = n.firstGet; if (n.firstGet = false, r == null) { if (r = Math.ceil(dc(o * e)), r < Ui) r = Ui; else if (o >= rO || r > $s) return null; } n.validateLayersElesOrdering(r, t13); var u = n.layersByLevel, l = Math.pow(2, r), c = u[r] = u[r] || [], d, v = n.levelIsComplete(r, t13), h6, f = function() { var _ = function(B) { if (n.validateLayersElesOrdering(B, t13), n.levelIsComplete(B, t13)) return h6 = u[B], true; }, D = function(B) { if (!h6) for (var F = r + B; Ui <= F && F <= $s && !_(F); F += B) ; }; D(1), D(-1); for (var O = c.length - 1; O >= 0; O--) { var I = c[O]; I.invalid && Kn(c, I); } }; if (!v) f(); else return c; var p = function() { if (!d) { d = pr(); for (var _ = 0; _ < t13.length; _++) fp(d, t13[_].boundingBox()); } return d; }, m = function(_) { _ = _ || {}; var D = _.after; p(); var O = d.w * l * (d.h * l); if (O > cO) return null; var I = n.makeLayer(d, r); if (D != null) { var L = c.indexOf(D) + 1; c.splice(L, 0, I); } else (_.insert === void 0 || _.insert) && c.unshift(I); return I; }; if (n.skipping && !s) return null; for (var g = null, y = t13.length / tO, b = !s, w = 0; w < t13.length; w++) { var C = t13[w], E = C._private.rscratch, x = E.imgLayerCaches = E.imgLayerCaches || {}, T = x[r]; if (T) { g = T; continue; } if ((!g || g.eles.length >= y || !vp(g.bb, C.boundingBox())) && (g = m({ insert: true, after: g }), !g)) return null; h6 || b ? n.queueLayer(g, C) : n.drawEleInLayer(g, C, r, e), g.eles.push(C), x[r] = g; } return h6 || (b ? null : c); }; Yt.getEleLevelForLayerLevel = function(t13, e) { return t13; }; Yt.drawEleInLayer = function(t13, e, r, n) { var a = this, i = this.renderer, o = t13.context, s = e.boundingBox(); s.w === 0 || s.h === 0 || !e.visible() || (r = a.getEleLevelForLayerLevel(r, n), i.setImgSmoothing(o, false), i.drawCachedElement(o, e, null, null, r, dO), i.setImgSmoothing(o, true)); }; Yt.levelIsComplete = function(t13, e) { var r = this, n = r.layersByLevel[t13]; if (!n || n.length === 0) return false; for (var a = 0, i = 0; i < n.length; i++) { var o = n[i]; if (o.reqs > 0 || o.invalid) return false; a += o.eles.length; } return a === e.length; }; Yt.validateLayersElesOrdering = function(t13, e) { var r = this.layersByLevel[t13]; if (r) for (var n = 0; n < r.length; n++) { for (var a = r[n], i = -1, o = 0; o < e.length; o++) if (a.eles[0] === e[o]) { i = o; break; } if (i < 0) { this.invalidateLayer(a); continue; } for (var s = i, o = 0; o < a.eles.length; o++) if (a.eles[o] !== e[s + o]) { this.invalidateLayer(a); break; } } }; Yt.updateElementsInLayers = function(t13, e) { for (var r = this, n = Do(t13[0]), a = 0; a < t13.length; a++) for (var i = n ? null : t13[a], o = n ? t13[a] : t13[a].ele, s = o._private.rscratch, u = s.imgLayerCaches = s.imgLayerCaches || {}, l = Ui; l <= $s; l++) { var c = u[l]; c && (i && r.getEleLevelForLayerLevel(c.level) !== i.level || e(c, o, i)); } }; Yt.haveLayers = function() { for (var t13 = this, e = false, r = Ui; r <= $s; r++) { var n = t13.layersByLevel[r]; if (n && n.length > 0) { e = true; break; } } return e; }; Yt.invalidateElements = function(t13) { var e = this; t13.length !== 0 && (e.lastInvalidationTime = gn(), !(t13.length === 0 || !e.haveLayers()) && e.updateElementsInLayers(t13, function(n, a, i) { e.invalidateLayer(n); })); }; Yt.invalidateLayer = function(t13) { if (this.lastInvalidationTime = gn(), !t13.invalid) { var e = t13.level, r = t13.eles, n = this.layersByLevel[e]; Kn(n, t13), t13.elesQueue = [], t13.invalid = true, t13.replacement && (t13.replacement.invalid = true); for (var a = 0; a < r.length; a++) { var i = r[a]._private.rscratch.imgLayerCaches; i && (i[e] = null); } } }; Yt.refineElementTextures = function(t13) { var e = this; e.updateElementsInLayers(t13, function(n, a, i) { var o = n.replacement; if (o || (o = n.replacement = e.makeLayer(n.bb, n.level), o.replaces = n, o.eles = n.eles), !o.reqs) for (var s = 0; s < o.eles.length; s++) e.queueLayer(o, o.eles[s]); }); }; Yt.enqueueElementRefinement = function(t13) { this.eleTxrDeqs.merge(t13), this.scheduleElementRefinement(); }; Yt.queueLayer = function(t13, e) { var r = this, n = r.layersQueue, a = t13.elesQueue, i = a.hasId = a.hasId || {}; if (!t13.replacement) { if (e) { if (i[e.id()]) return; a.push(e), i[e.id()] = true; } t13.reqs ? (t13.reqs++, n.updateItem(t13)) : (t13.reqs = 1, n.push(t13)); } }; Yt.dequeue = function(t13) { for (var e = this, r = e.layersQueue, n = [], a = 0; a < uO && r.size() !== 0; ) { var i = r.peek(); if (i.replacement) { r.pop(); continue; } if (i.replaces && i !== i.replaces.replacement) { r.pop(); continue; } if (i.invalid) { r.pop(); continue; } var o = i.elesQueue.shift(); o && (e.drawEleInLayer(i, o, i.level, t13), a++), n.length === 0 && n.push(true), i.elesQueue.length === 0 && (r.pop(), i.reqs = 0, i.replaces && e.applyLayerReplacement(i), e.requestRedraw()); } return n; }; Yt.applyLayerReplacement = function(t13) { var e = this, r = e.layersByLevel[t13.level], n = t13.replaces, a = r.indexOf(n); if (!(a < 0 || n.invalid)) { r[a] = t13; for (var i = 0; i < t13.eles.length; i++) { var o = t13.eles[i]._private, s = o.imgLayerCaches = o.imgLayerCaches || {}; s && (s[t13.level] = t13); } e.requestRedraw(); } }; Yt.requestRedraw = tl(function() { var t13 = this.renderer; t13.redrawHint("eles", true), t13.redrawHint("drag", true), t13.redraw(); }, 100); Yt.setupDequeueing = pg.setupDequeueing({ deqRedrawThreshold: nO, deqCost: iO, deqAvgCost: oO, deqNoDrawCost: sO, deqFastCost: lO, deq: function(e, r) { return e.dequeue(r); }, onDeqd: uc, shouldRedraw: op, priority: function(e) { return e.renderer.beforeRenderPriorities.lyrTxrDeq; } }); var mg = {}; var lv; function vO(t13, e) { for (var r = 0; r < e.length; r++) { var n = e[r]; t13.lineTo(n.x, n.y); } } function hO(t13, e, r) { for (var n, a = 0; a < e.length; a++) { var i = e[a]; a === 0 && (n = i), t13.lineTo(i.x, i.y); } t13.quadraticCurveTo(r.x, r.y, n.x, n.y); } function uv(t13, e, r) { t13.beginPath && t13.beginPath(); for (var n = e, a = 0; a < n.length; a++) { var i = n[a]; t13.lineTo(i.x, i.y); } var o = r, s = r[0]; t13.moveTo(s.x, s.y); for (var a = 1; a < o.length; a++) { var i = o[a]; t13.lineTo(i.x, i.y); } t13.closePath && t13.closePath(); } function pO(t13, e, r, n, a) { t13.beginPath && t13.beginPath(), t13.arc(r, n, a, 0, Math.PI * 2, false); var i = e, o = i[0]; t13.moveTo(o.x, o.y); for (var s = 0; s < i.length; s++) { var u = i[s]; t13.lineTo(u.x, u.y); } t13.closePath && t13.closePath(); } function gO(t13, e, r, n) { t13.arc(e, r, n, 0, Math.PI * 2, false); } mg.arrowShapeImpl = function(t13) { return (lv || (lv = { polygon: vO, "triangle-backcurve": hO, "triangle-tee": uv, "circle-triangle": pO, "triangle-cross": uv, circle: gO }))[t13]; }; var on = {}; on.drawElement = function(t13, e, r, n, a, i) { var o = this; e.isNode() ? o.drawNode(t13, e, r, n, a, i) : o.drawEdge(t13, e, r, n, a, i); }; on.drawElementOverlay = function(t13, e) { var r = this; e.isNode() ? r.drawNodeOverlay(t13, e) : r.drawEdgeOverlay(t13, e); }; on.drawElementUnderlay = function(t13, e) { var r = this; e.isNode() ? r.drawNodeUnderlay(t13, e) : r.drawEdgeUnderlay(t13, e); }; on.drawCachedElementPortion = function(t13, e, r, n, a, i, o, s) { var u = this, l = r.getBoundingBox(e); if (!(l.w === 0 || l.h === 0)) { var c = r.getElement(e, l, n, a, i); if (c != null) { var d = s(u, e); if (d === 0) return; var v = o(u, e), h6 = l.x1, f = l.y1, p = l.w, m = l.h, g, y, b, w, C; if (v !== 0) { var E = r.getRotationPoint(e); b = E.x, w = E.y, t13.translate(b, w), t13.rotate(v), C = u.getImgSmoothing(t13), C || u.setImgSmoothing(t13, true); var x = r.getRotationOffset(e); g = x.x, y = x.y; } else g = h6, y = f; var T; d !== 1 && (T = t13.globalAlpha, t13.globalAlpha = T * d), t13.drawImage(c.texture.canvas, c.x, 0, c.width, c.height, g, y, p, m), d !== 1 && (t13.globalAlpha = T), v !== 0 && (t13.rotate(-v), t13.translate(-b, -w), C || u.setImgSmoothing(t13, false)); } else r.drawElement(t13, e); } }; var mO = function() { return 0; }; var yO = function(e, r) { return e.getTextAngle(r, null); }; var bO = function(e, r) { return e.getTextAngle(r, "source"); }; var wO = function(e, r) { return e.getTextAngle(r, "target"); }; var xO = function(e, r) { return r.effectiveOpacity(); }; var Kl = function(e, r) { return r.pstyle("text-opacity").pfValue * r.effectiveOpacity(); }; on.drawCachedElement = function(t13, e, r, n, a, i) { var o = this, s = o.data, u = s.eleTxrCache, l = s.lblTxrCache, c = s.slbTxrCache, d = s.tlbTxrCache, v = e.boundingBox(), h6 = i === true ? u.reasons.highQuality : null; if (!(v.w === 0 || v.h === 0 || !e.visible()) && (!n || fc(v, n))) { var f = e.isEdge(), p = e.element()._private.rscratch.badLine; o.drawElementUnderlay(t13, e), o.drawCachedElementPortion(t13, e, u, r, a, h6, mO, xO), (!f || !p) && o.drawCachedElementPortion(t13, e, l, r, a, h6, yO, Kl), f && !p && (o.drawCachedElementPortion(t13, e, c, r, a, h6, bO, Kl), o.drawCachedElementPortion(t13, e, d, r, a, h6, wO, Kl)), o.drawElementOverlay(t13, e); } }; on.drawElements = function(t13, e) { for (var r = this, n = 0; n < e.length; n++) { var a = e[n]; r.drawElement(t13, a); } }; on.drawCachedElements = function(t13, e, r, n) { for (var a = this, i = 0; i < e.length; i++) { var o = e[i]; a.drawCachedElement(t13, o, r, n); } }; on.drawCachedNodes = function(t13, e, r, n) { for (var a = this, i = 0; i < e.length; i++) { var o = e[i]; o.isNode() && a.drawCachedElement(t13, o, r, n); } }; on.drawLayeredElements = function(t13, e, r, n) { var a = this, i = a.data.lyrTxrCache.getLayers(e, r); if (i) for (var o = 0; o < i.length; o++) { var s = i[o], u = s.bb; u.w === 0 || u.h === 0 || t13.drawImage(s.canvas, u.x1, u.y1, u.w, u.h); } else a.drawCachedElements(t13, e, r, n); }; var En = {}; En.drawEdge = function(t13, e, r) { var n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true, a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true, i = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true, o = this, s = e._private.rscratch; if (!(i && !e.visible()) && !(s.badLine || s.allpts == null || isNaN(s.allpts[0]))) { var u; r && (u = r, t13.translate(-u.x1, -u.y1)); var l = i ? e.pstyle("opacity").value : 1, c = i ? e.pstyle("line-opacity").value : 1, d = e.pstyle("curve-style").value, v = e.pstyle("line-style").value, h6 = e.pstyle("width").pfValue, f = e.pstyle("line-cap").value, p = e.pstyle("line-outline-width").value, m = e.pstyle("line-outline-color").value, g = l * c, y = l * c, b = function() { var B = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : g; d === "straight-triangle" ? (o.eleStrokeStyle(t13, e, B), o.drawEdgeTrianglePath(e, t13, s.allpts)) : (t13.lineWidth = h6, t13.lineCap = f, o.eleStrokeStyle(t13, e, B), o.drawEdgePath(e, t13, s.allpts, v), t13.lineCap = "butt"); }, w = function() { var B = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : g; if (t13.lineWidth = h6 + p, t13.lineCap = f, p > 0) o.colorStrokeStyle(t13, m[0], m[1], m[2], B); else { t13.lineCap = "butt"; return; } d === "straight-triangle" ? o.drawEdgeTrianglePath(e, t13, s.allpts) : (o.drawEdgePath(e, t13, s.allpts, v), t13.lineCap = "butt"); }, C = function() { a && o.drawEdgeOverlay(t13, e); }, E = function() { a && o.drawEdgeUnderlay(t13, e); }, x = function() { var B = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : y; o.drawArrowheads(t13, e, B); }, T = function() { o.drawElementText(t13, e, null, n); }; t13.lineJoin = "round"; var k = e.pstyle("ghost").value === "yes"; if (k) { var _ = e.pstyle("ghost-offset-x").pfValue, D = e.pstyle("ghost-offset-y").pfValue, O = e.pstyle("ghost-opacity").value, I = g * O; t13.translate(_, D), b(I), x(I), t13.translate(-_, -D); } else w(); E(), b(), x(), C(), T(), r && t13.translate(u.x1, u.y1); } }; var yg = function(e) { if (!["overlay", "underlay"].includes(e)) throw new Error("Invalid state"); return function(r, n) { if (n.visible()) { var a = n.pstyle("".concat(e, "-opacity")).value; if (a !== 0) { var i = this, o = i.usePaths(), s = n._private.rscratch, u = n.pstyle("".concat(e, "-padding")).pfValue, l = 2 * u, c = n.pstyle("".concat(e, "-color")).value; r.lineWidth = l, s.edgeType === "self" && !o ? r.lineCap = "butt" : r.lineCap = "round", i.colorStrokeStyle(r, c[0], c[1], c[2], a), i.drawEdgePath(n, r, s.allpts, "solid"); } } }; }; En.drawEdgeOverlay = yg("overlay"); En.drawEdgeUnderlay = yg("underlay"); En.drawEdgePath = function(t13, e, r, n) { var a = t13._private.rscratch, i = e, o, s = false, u = this.usePaths(), l = t13.pstyle("line-dash-pattern").pfValue, c = t13.pstyle("line-dash-offset").pfValue; if (u) { var d = r.join("$"), v = a.pathCacheKey && a.pathCacheKey === d; v ? (o = e = a.pathCache, s = true) : (o = e = new Path2D(), a.pathCacheKey = d, a.pathCache = o); } if (i.setLineDash) switch (n) { case "dotted": i.setLineDash([1, 1]); break; case "dashed": i.setLineDash(l), i.lineDashOffset = c; break; case "solid": i.setLineDash([]); break; } if (!s && !a.badLine) switch (e.beginPath && e.beginPath(), e.moveTo(r[0], r[1]), a.edgeType) { case "bezier": case "self": case "compound": case "multibezier": for (var h6 = 2; h6 + 3 < r.length; h6 += 4) e.quadraticCurveTo(r[h6], r[h6 + 1], r[h6 + 2], r[h6 + 3]); break; case "straight": case "haystack": for (var f = 2; f + 1 < r.length; f += 2) e.lineTo(r[f], r[f + 1]); break; case "segments": if (a.isRound) { var p = Gh(a.roundCorners), m; try { for (p.s(); !(m = p.n()).done; ) { var g = m.value; sg(e, g); } } catch (b) { p.e(b); } finally { p.f(); } e.lineTo(r[r.length - 2], r[r.length - 1]); } else for (var y = 2; y + 1 < r.length; y += 2) e.lineTo(r[y], r[y + 1]); break; } e = i, u ? e.stroke(o) : e.stroke(), e.setLineDash && e.setLineDash([]); }; En.drawEdgeTrianglePath = function(t13, e, r) { e.fillStyle = e.strokeStyle; for (var n = t13.pstyle("width").pfValue, a = 0; a + 1 < r.length; a += 2) { var i = [r[a + 2] - r[a], r[a + 3] - r[a + 1]], o = Math.sqrt(i[0] * i[0] + i[1] * i[1]), s = [i[1] / o, -i[0] / o], u = [s[0] * n / 2, s[1] * n / 2]; e.beginPath(), e.moveTo(r[a] - u[0], r[a + 1] - u[1]), e.lineTo(r[a] + u[0], r[a + 1] + u[1]), e.lineTo(r[a + 2], r[a + 3]), e.closePath(), e.fill(); } }; En.drawArrowheads = function(t13, e, r) { var n = e._private.rscratch, a = n.edgeType === "haystack"; a || this.drawArrowhead(t13, e, "source", n.arrowStartX, n.arrowStartY, n.srcArrowAngle, r), this.drawArrowhead(t13, e, "mid-target", n.midX, n.midY, n.midtgtArrowAngle, r), this.drawArrowhead(t13, e, "mid-source", n.midX, n.midY, n.midsrcArrowAngle, r), a || this.drawArrowhead(t13, e, "target", n.arrowEndX, n.arrowEndY, n.tgtArrowAngle, r); }; En.drawArrowhead = function(t13, e, r, n, a, i, o) { if (!(isNaN(n) || n == null || isNaN(a) || a == null || isNaN(i) || i == null)) { var s = this, u = e.pstyle(r + "-arrow-shape").value; if (u !== "none") { var l = e.pstyle(r + "-arrow-fill").value === "hollow" ? "both" : "filled", c = e.pstyle(r + "-arrow-fill").value, d = e.pstyle("width").pfValue, v = e.pstyle(r + "-arrow-width"), h6 = v.value === "match-line" ? d : v.pfValue; v.units === "%" && (h6 *= d); var f = e.pstyle("opacity").value; o === void 0 && (o = f); var p = t13.globalCompositeOperation; (o !== 1 || c === "hollow") && (t13.globalCompositeOperation = "destination-out", s.colorFillStyle(t13, 255, 255, 255, 1), s.colorStrokeStyle(t13, 255, 255, 255, 1), s.drawArrowShape(e, t13, l, d, u, h6, n, a, i), t13.globalCompositeOperation = p); var m = e.pstyle(r + "-arrow-color").value; s.colorFillStyle(t13, m[0], m[1], m[2], o), s.colorStrokeStyle(t13, m[0], m[1], m[2], o), s.drawArrowShape(e, t13, c, d, u, h6, n, a, i); } } }; En.drawArrowShape = function(t13, e, r, n, a, i, o, s, u) { var l = this, c = this.usePaths() && a !== "triangle-cross", d = false, v, h6 = e, f = { x: o, y: s }, p = t13.pstyle("arrow-scale").value, m = this.getArrowWidth(n, p), g = l.arrowShapes[a]; if (c) { var y = l.arrowPathCache = l.arrowPathCache || [], b = ma(a), w = y[b]; w != null ? (v = e = w, d = true) : (v = e = new Path2D(), y[b] = v); } d || (e.beginPath && e.beginPath(), c ? g.draw(e, 1, 0, { x: 0, y: 0 }, 1) : g.draw(e, m, u, f, n), e.closePath && e.closePath()), e = h6, c && (e.translate(o, s), e.rotate(u), e.scale(m, m)), (r === "filled" || r === "both") && (c ? e.fill(v) : e.fill()), (r === "hollow" || r === "both") && (e.lineWidth = i / (c ? m : 1), e.lineJoin = "miter", c ? e.stroke(v) : e.stroke()), c && (e.scale(1 / m, 1 / m), e.rotate(-u), e.translate(-o, -s)); }; var _c = {}; _c.safeDrawImage = function(t13, e, r, n, a, i, o, s, u, l) { if (!(a <= 0 || i <= 0 || u <= 0 || l <= 0)) try { t13.drawImage(e, r, n, a, i, o, s, u, l); } catch (c) { tt(c); } }; _c.drawInscribedImage = function(t13, e, r, n, a) { var i = this, o = r.position(), s = o.x, u = o.y, l = r.cy().style(), c = l.getIndexedStyle.bind(l), d = c(r, "background-fit", "value", n), v = c(r, "background-repeat", "value", n), h6 = r.width(), f = r.height(), p = r.padding() * 2, m = h6 + (c(r, "background-width-relative-to", "value", n) === "inner" ? 0 : p), g = f + (c(r, "background-height-relative-to", "value", n) === "inner" ? 0 : p), y = r._private.rscratch, b = c(r, "background-clip", "value", n), w = b === "node", C = c(r, "background-image-opacity", "value", n) * a, E = c(r, "background-image-smoothing", "value", n), x = r.pstyle("corner-radius").value; x !== "auto" && (x = r.pstyle("corner-radius").pfValue); var T = e.width || e.cachedW, k = e.height || e.cachedH; (T == null || k == null) && (document.body.appendChild(e), T = e.cachedW = e.width || e.offsetWidth, k = e.cachedH = e.height || e.offsetHeight, document.body.removeChild(e)); var _ = T, D = k; if (c(r, "background-width", "value", n) !== "auto" && (c(r, "background-width", "units", n) === "%" ? _ = c(r, "background-width", "pfValue", n) * m : _ = c(r, "background-width", "pfValue", n)), c(r, "background-height", "value", n) !== "auto" && (c(r, "background-height", "units", n) === "%" ? D = c(r, "background-height", "pfValue", n) * g : D = c(r, "background-height", "pfValue", n)), !(_ === 0 || D === 0)) { if (d === "contain") { var O = Math.min(m / _, g / D); _ *= O, D *= O; } else if (d === "cover") { var O = Math.max(m / _, g / D); _ *= O, D *= O; } var I = s - m / 2, L = c(r, "background-position-x", "units", n), B = c(r, "background-position-x", "pfValue", n); L === "%" ? I += (m - _) * B : I += B; var F = c(r, "background-offset-x", "units", n), M = c(r, "background-offset-x", "pfValue", n); F === "%" ? I += (m - _) * M : I += M; var A = u - g / 2, R = c(r, "background-position-y", "units", n), K = c(r, "background-position-y", "pfValue", n); R === "%" ? A += (g - D) * K : A += K; var H = c(r, "background-offset-y", "units", n), q = c(r, "background-offset-y", "pfValue", n); H === "%" ? A += (g - D) * q : A += q, y.pathCache && (I -= s, A -= u, s = 0, u = 0); var ee = t13.globalAlpha; t13.globalAlpha = C; var se = i.getImgSmoothing(t13), oe = false; if (E === "no" && se ? (i.setImgSmoothing(t13, false), oe = true) : E === "yes" && !se && (i.setImgSmoothing(t13, true), oe = true), v === "no-repeat") w && (t13.save(), y.pathCache ? t13.clip(y.pathCache) : (i.nodeShapes[i.getNodeShape(r)].draw(t13, s, u, m, g, x, y), t13.clip())), i.safeDrawImage(t13, e, 0, 0, T, k, I, A, _, D), w && t13.restore(); else { var ae = t13.createPattern(e, v); t13.fillStyle = ae, i.nodeShapes[i.getNodeShape(r)].draw(t13, s, u, m, g, x, y), t13.translate(I, A), t13.fill(), t13.translate(-I, -A); } t13.globalAlpha = ee, oe && i.setImgSmoothing(t13, se); } }; var Pa = {}; Pa.eleTextBiggerThanMin = function(t13, e) { if (!e) { var r = t13.cy().zoom(), n = this.getPixelRatio(), a = Math.ceil(dc(r * n)); e = Math.pow(2, a); } var i = t13.pstyle("font-size").pfValue * e, o = t13.pstyle("min-zoomed-font-size").pfValue; return !(i < o); }; Pa.drawElementText = function(t13, e, r, n, a) { var i = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true, o = this; if (n == null) { if (i && !o.eleTextBiggerThanMin(e)) return; } else if (n === false) return; if (e.isNode()) { var s = e.pstyle("label"); if (!s || !s.value) return; var u = o.getLabelJustification(e); t13.textAlign = u, t13.textBaseline = "bottom"; } else { var l = e.element()._private.rscratch.badLine, c = e.pstyle("label"), d = e.pstyle("source-label"), v = e.pstyle("target-label"); if (l || (!c || !c.value) && (!d || !d.value) && (!v || !v.value)) return; t13.textAlign = "center", t13.textBaseline = "bottom"; } var h6 = !r, f; r && (f = r, t13.translate(-f.x1, -f.y1)), a == null ? (o.drawText(t13, e, null, h6, i), e.isEdge() && (o.drawText(t13, e, "source", h6, i), o.drawText(t13, e, "target", h6, i))) : o.drawText(t13, e, a, h6, i), r && t13.translate(f.x1, f.y1); }; Pa.getFontCache = function(t13) { var e; this.fontCaches = this.fontCaches || []; for (var r = 0; r < this.fontCaches.length; r++) if (e = this.fontCaches[r], e.context === t13) return e; return e = { context: t13 }, this.fontCaches.push(e), e; }; Pa.setupTextStyle = function(t13, e) { var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true, n = e.pstyle("font-style").strValue, a = e.pstyle("font-size").pfValue + "px", i = e.pstyle("font-family").strValue, o = e.pstyle("font-weight").strValue, s = r ? e.effectiveOpacity() * e.pstyle("text-opacity").value : 1, u = e.pstyle("text-outline-opacity").value * s, l = e.pstyle("color").value, c = e.pstyle("text-outline-color").value; t13.font = n + " " + o + " " + a + " " + i, t13.lineJoin = "round", this.colorFillStyle(t13, l[0], l[1], l[2], s), this.colorStrokeStyle(t13, c[0], c[1], c[2], u); }; function Ul(t13, e, r, n, a) { var i = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : 5, o = arguments.length > 6 ? arguments[6] : void 0; t13.beginPath(), t13.moveTo(e + i, r), t13.lineTo(e + n - i, r), t13.quadraticCurveTo(e + n, r, e + n, r + i), t13.lineTo(e + n, r + a - i), t13.quadraticCurveTo(e + n, r + a, e + n - i, r + a), t13.lineTo(e + i, r + a), t13.quadraticCurveTo(e, r + a, e, r + a - i), t13.lineTo(e, r + i), t13.quadraticCurveTo(e, r, e + i, r), t13.closePath(), o ? t13.stroke() : t13.fill(); } Pa.getTextAngle = function(t13, e) { var r, n = t13._private, a = n.rscratch, i = e ? e + "-" : "", o = t13.pstyle(i + "text-rotation"), s = Nr(a, "labelAngle", e); return o.strValue === "autorotate" ? r = t13.isEdge() ? s : 0 : o.strValue === "none" ? r = 0 : r = o.pfValue, r; }; Pa.drawText = function(t13, e, r) { var n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true, a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true, i = e._private, o = i.rscratch, s = a ? e.effectiveOpacity() : 1; if (!(a && (s === 0 || e.pstyle("text-opacity").value === 0))) { r === "main" && (r = null); var u = Nr(o, "labelX", r), l = Nr(o, "labelY", r), c, d, v = this.getLabelText(e, r); if (v != null && v !== "" && !isNaN(u) && !isNaN(l)) { this.setupTextStyle(t13, e, a); var h6 = r ? r + "-" : "", f = Nr(o, "labelWidth", r), p = Nr(o, "labelHeight", r), m = e.pstyle(h6 + "text-margin-x").pfValue, g = e.pstyle(h6 + "text-margin-y").pfValue, y = e.isEdge(), b = e.pstyle("text-halign").value, w = e.pstyle("text-valign").value; y && (b = "center", w = "center"), u += m, l += g; var C; switch (n ? C = this.getTextAngle(e, r) : C = 0, C !== 0 && (c = u, d = l, t13.translate(c, d), t13.rotate(C), u = 0, l = 0), w) { case "top": break; case "center": l += p / 2; break; case "bottom": l += p; break; } var E = e.pstyle("text-background-opacity").value, x = e.pstyle("text-border-opacity").value, T = e.pstyle("text-border-width").pfValue, k = e.pstyle("text-background-padding").pfValue, _ = e.pstyle("text-background-shape").strValue, D = _.indexOf("round") === 0, O = 2; if (E > 0 || T > 0 && x > 0) { var I = u - k; switch (b) { case "left": I -= f; break; case "center": I -= f / 2; break; } var L = l - p - k, B = f + 2 * k, F = p + 2 * k; if (E > 0) { var M = t13.fillStyle, A = e.pstyle("text-background-color").value; t13.fillStyle = "rgba(" + A[0] + "," + A[1] + "," + A[2] + "," + E * s + ")", D ? Ul(t13, I, L, B, F, O) : t13.fillRect(I, L, B, F), t13.fillStyle = M; } if (T > 0 && x > 0) { var R = t13.strokeStyle, K = t13.lineWidth, H = e.pstyle("text-border-color").value, q = e.pstyle("text-border-style").value; if (t13.strokeStyle = "rgba(" + H[0] + "," + H[1] + "," + H[2] + "," + x * s + ")", t13.lineWidth = T, t13.setLineDash) switch (q) { case "dotted": t13.setLineDash([1, 1]); break; case "dashed": t13.setLineDash([4, 2]); break; case "double": t13.lineWidth = T / 4, t13.setLineDash([]); break; case "solid": t13.setLineDash([]); break; } if (D ? Ul(t13, I, L, B, F, O, "stroke") : t13.strokeRect(I, L, B, F), q === "double") { var ee = T / 2; D ? Ul(t13, I + ee, L + ee, B - ee * 2, F - ee * 2, O, "stroke") : t13.strokeRect(I + ee, L + ee, B - ee * 2, F - ee * 2); } t13.setLineDash && t13.setLineDash([]), t13.lineWidth = K, t13.strokeStyle = R; } } var se = 2 * e.pstyle("text-outline-width").pfValue; if (se > 0 && (t13.lineWidth = se), e.pstyle("text-wrap").value === "wrap") { var oe = Nr(o, "labelWrapCachedLines", r), ae = Nr(o, "labelLineHeight", r), ue = f / 2, te = this.getLabelJustification(e); switch (te === "auto" || (b === "left" ? te === "left" ? u += -f : te === "center" && (u += -ue) : b === "center" ? te === "left" ? u += -ue : te === "right" && (u += ue) : b === "right" && (te === "center" ? u += ue : te === "right" && (u += f))), w) { case "top": l -= (oe.length - 1) * ae; break; case "center": case "bottom": l -= (oe.length - 1) * ae; break; } for (var $ = 0; $ < oe.length; $++) se > 0 && t13.strokeText(oe[$], u, l), t13.fillText(oe[$], u, l), l += ae; } else se > 0 && t13.strokeText(v, u, l), t13.fillText(v, u, l); C !== 0 && (t13.rotate(-C), t13.translate(-c, -d)); } } }; var Ci = {}; Ci.drawNode = function(t13, e, r) { var n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true, a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true, i = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true, o = this, s, u, l = e._private, c = l.rscratch, d = e.position(); if (!(!be(d.x) || !be(d.y)) && !(i && !e.visible())) { var v = i ? e.effectiveOpacity() : 1, h6 = o.usePaths(), f, p = false, m = e.padding(); s = e.width() + 2 * m, u = e.height() + 2 * m; var g; r && (g = r, t13.translate(-g.x1, -g.y1)); for (var y = e.pstyle("background-image"), b = y.value, w = new Array(b.length), C = new Array(b.length), E = 0, x = 0; x < b.length; x++) { var T = b[x], k = w[x] = T != null && T !== "none"; if (k) { var _ = e.cy().style().getIndexedStyle(e, "background-image-crossorigin", "value", x); E++, C[x] = o.getCachedImage(T, _, function() { l.backgroundTimestamp = Date.now(), e.emitAndNotify("background"); }); } } var D = e.pstyle("background-blacken").value, O = e.pstyle("border-width").pfValue, I = e.pstyle("background-opacity").value * v, L = e.pstyle("border-color").value, B = e.pstyle("border-style").value, F = e.pstyle("border-join").value, M = e.pstyle("border-cap").value, A = e.pstyle("border-position").value, R = e.pstyle("border-dash-pattern").pfValue, K = e.pstyle("border-dash-offset").pfValue, H = e.pstyle("border-opacity").value * v, q = e.pstyle("outline-width").pfValue, ee = e.pstyle("outline-color").value, se = e.pstyle("outline-style").value, oe = e.pstyle("outline-opacity").value * v, ae = e.pstyle("outline-offset").value, ue = e.pstyle("corner-radius").value; ue !== "auto" && (ue = e.pstyle("corner-radius").pfValue); var te = function() { var pe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : I; o.eleFillStyle(t13, e, pe); }, $ = function() { var pe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : H; o.colorStrokeStyle(t13, L[0], L[1], L[2], pe); }, G = function() { var pe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : oe; o.colorStrokeStyle(t13, ee[0], ee[1], ee[2], pe); }, Q = function(pe, re, ve, Ae) { var Me = o.nodePathCache = o.nodePathCache || [], _e = ip(ve === "polygon" ? ve + "," + Ae.join(",") : ve, "" + re, "" + pe, "" + ue), Ne = Me[_e], Te, Oe = false; return Ne != null ? (Te = Ne, Oe = true, c.pathCache = Te) : (Te = new Path2D(), Me[_e] = c.pathCache = Te), { path: Te, cacheHit: Oe }; }, ge = e.pstyle("shape").strValue, Ee = e.pstyle("shape-polygon-points").pfValue; if (h6) { t13.translate(d.x, d.y); var fe = Q(s, u, ge, Ee); f = fe.path, p = fe.cacheHit; } var me = function() { if (!p) { var pe = d; h6 && (pe = { x: 0, y: 0 }), o.nodeShapes[o.getNodeShape(e)].draw(f || t13, pe.x, pe.y, s, u, ue, c); } h6 ? t13.fill(f) : t13.fill(); }, xe = function() { for (var pe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : v, re = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true, ve = l.backgrounding, Ae = 0, Me = 0; Me < C.length; Me++) { var _e = e.cy().style().getIndexedStyle(e, "background-image-containment", "value", Me); if (re && _e === "over" || !re && _e === "inside") { Ae++; continue; } w[Me] && C[Me].complete && !C[Me].error && (Ae++, o.drawInscribedImage(t13, C[Me], e, Me, pe)); } l.backgrounding = Ae !== E, ve !== l.backgrounding && e.updateStyle(false); }, ke = function() { var pe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false, re = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : v; o.hasPie(e) && (o.drawPie(t13, e, re), pe && (h6 || o.nodeShapes[o.getNodeShape(e)].draw(t13, d.x, d.y, s, u, ue, c))); }, Ce = function() { var pe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : v, re = (D > 0 ? D : -D) * pe, ve = D > 0 ? 0 : 255; D !== 0 && (o.colorFillStyle(t13, ve, ve, ve, re), h6 ? t13.fill(f) : t13.fill()); }, De = function() { if (O > 0) { if (t13.lineWidth = O, t13.lineCap = M, t13.lineJoin = F, t13.setLineDash) switch (B) { case "dotted": t13.setLineDash([1, 1]); break; case "dashed": t13.setLineDash(R), t13.lineDashOffset = K; break; case "solid": case "double": t13.setLineDash([]); break; } if (A !== "center") { if (t13.save(), t13.lineWidth *= 2, A === "inside") h6 ? t13.clip(f) : t13.clip(); else { var pe = new Path2D(); pe.rect(-s / 2 - O, -u / 2 - O, s + 2 * O, u + 2 * O), pe.addPath(f), t13.clip(pe, "evenodd"); } h6 ? t13.stroke(f) : t13.stroke(), t13.restore(); } else h6 ? t13.stroke(f) : t13.stroke(); if (B === "double") { t13.lineWidth = O / 3; var re = t13.globalCompositeOperation; t13.globalCompositeOperation = "destination-out", h6 ? t13.stroke(f) : t13.stroke(), t13.globalCompositeOperation = re; } t13.setLineDash && t13.setLineDash([]); } }, qe = function() { if (q > 0) { if (t13.lineWidth = q, t13.lineCap = "butt", t13.setLineDash) switch (se) { case "dotted": t13.setLineDash([1, 1]); break; case "dashed": t13.setLineDash([4, 2]); break; case "solid": case "double": t13.setLineDash([]); break; } var pe = d; h6 && (pe = { x: 0, y: 0 }); var re = o.getNodeShape(e), ve = O; A === "inside" && (ve = 0), A === "outside" && (ve *= 2); var Ae = (s + ve + (q + ae)) / s, Me = (u + ve + (q + ae)) / u, _e = s * Ae, Ne = u * Me, Te = o.nodeShapes[re].points, Oe; if (h6) { var ut = Q(_e, Ne, re, Te); Oe = ut.path; } if (re === "ellipse") o.drawEllipsePath(Oe || t13, pe.x, pe.y, _e, Ne); else if (["round-diamond", "round-heptagon", "round-hexagon", "round-octagon", "round-pentagon", "round-polygon", "round-triangle", "round-tag"].includes(re)) { var nt2 = 0, kt = 0, St2 = 0; re === "round-diamond" ? nt2 = (ve + ae + q) * 1.4 : re === "round-heptagon" ? (nt2 = (ve + ae + q) * 1.075, St2 = -(ve / 2 + ae + q) / 35) : re === "round-hexagon" ? nt2 = (ve + ae + q) * 1.12 : re === "round-pentagon" ? (nt2 = (ve + ae + q) * 1.13, St2 = -(ve / 2 + ae + q) / 15) : re === "round-tag" ? (nt2 = (ve + ae + q) * 1.12, kt = (ve / 2 + q + ae) * 0.07) : re === "round-triangle" && (nt2 = (ve + ae + q) * (Math.PI / 2), St2 = -(ve + ae / 2 + q) / Math.PI), nt2 !== 0 && (Ae = (s + nt2) / s, _e = s * Ae, ["round-hexagon", "round-tag"].includes(re) || (Me = (u + nt2) / u, Ne = u * Me)), ue = ue === "auto" ? gp(_e, Ne) : ue; for (var wt = _e / 2, Zt = Ne / 2, Pt2 = ue + (ve + q + ae) / 2, Mt = new Array(Te.length / 2), gr2 = new Array(Te.length / 2), Xt2 = 0; Xt2 < Te.length / 2; Xt2++) Mt[Xt2] = { x: pe.x + kt + wt * Te[Xt2 * 2], y: pe.y + St2 + Zt * Te[Xt2 * 2 + 1] }; var jt2, wr2, Pr2, ur2, xt = Mt.length; for (wr2 = Mt[xt - 1], jt2 = 0; jt2 < xt; jt2++) Pr2 = Mt[jt2 % xt], ur2 = Mt[(jt2 + 1) % xt], gr2[jt2] = Sc(wr2, Pr2, ur2, Pt2), wr2 = Pr2, Pr2 = ur2; o.drawRoundPolygonPath(Oe || t13, pe.x + kt, pe.y + St2, s * Ae, u * Me, Te, gr2); } else if (["roundrectangle", "round-rectangle"].includes(re)) ue = ue === "auto" ? ba(_e, Ne) : ue, o.drawRoundRectanglePath(Oe || t13, pe.x, pe.y, _e, Ne, ue + (ve + q + ae) / 2); else if (["cutrectangle", "cut-rectangle"].includes(re)) ue = ue === "auto" ? vc() : ue, o.drawCutRectanglePath(Oe || t13, pe.x, pe.y, _e, Ne, null, ue + (ve + q + ae) / 4); else if (["bottomroundrectangle", "bottom-round-rectangle"].includes(re)) ue = ue === "auto" ? ba(_e, Ne) : ue, o.drawBottomRoundRectanglePath(Oe || t13, pe.x, pe.y, _e, Ne, ue + (ve + q + ae) / 2); else if (re === "barrel") o.drawBarrelPath(Oe || t13, pe.x, pe.y, _e, Ne); else if (re.startsWith("polygon") || ["rhomboid", "right-rhomboid", "round-tag", "tag", "vee"].includes(re)) { var Tt = (ve + q + ae) / s; Te = Ls(Fs(Te, Tt)), o.drawPolygonPath(Oe || t13, pe.x, pe.y, s, u, Te); } else { var Bt2 = (ve + q + ae) / s; Te = Ls(Fs(Te, -Bt2)), o.drawPolygonPath(Oe || t13, pe.x, pe.y, s, u, Te); } if (h6 ? t13.stroke(Oe) : t13.stroke(), se === "double") { t13.lineWidth = ve / 3; var kn2 = t13.globalCompositeOperation; t13.globalCompositeOperation = "destination-out", h6 ? t13.stroke(Oe) : t13.stroke(), t13.globalCompositeOperation = kn2; } t13.setLineDash && t13.setLineDash([]); } }, Ke = function() { a && o.drawNodeOverlay(t13, e, d, s, u); }, Be = function() { a && o.drawNodeUnderlay(t13, e, d, s, u); }, Ge = function() { o.drawElementText(t13, e, null, n); }, le = e.pstyle("ghost").value === "yes"; if (le) { var S = e.pstyle("ghost-offset-x").pfValue, z = e.pstyle("ghost-offset-y").pfValue, ie = e.pstyle("ghost-opacity").value, j = ie * v; t13.translate(S, z), G(), qe(), te(ie * I), me(), xe(j, true), $(ie * H), De(), ke(D !== 0 || O !== 0), xe(j, false), Ce(j), t13.translate(-S, -z); } h6 && t13.translate(-d.x, -d.y), Be(), h6 && t13.translate(d.x, d.y), G(), qe(), te(), me(), xe(v, true), $(), De(), ke(D !== 0 || O !== 0), xe(v, false), Ce(), h6 && t13.translate(-d.x, -d.y), Ge(), Ke(), r && t13.translate(g.x1, g.y1); } }; var bg = function(e) { if (!["overlay", "underlay"].includes(e)) throw new Error("Invalid state"); return function(r, n, a, i, o) { var s = this; if (n.visible()) { var u = n.pstyle("".concat(e, "-padding")).pfValue, l = n.pstyle("".concat(e, "-opacity")).value, c = n.pstyle("".concat(e, "-color")).value, d = n.pstyle("".concat(e, "-shape")).value, v = n.pstyle("".concat(e, "-corner-radius")).value; if (l > 0) { if (a = a || n.position(), i == null || o == null) { var h6 = n.padding(); i = n.width() + 2 * h6, o = n.height() + 2 * h6; } s.colorFillStyle(r, c[0], c[1], c[2], l), s.nodeShapes[d].draw(r, a.x, a.y, i + u * 2, o + u * 2, v), r.fill(); } } }; }; Ci.drawNodeOverlay = bg("overlay"); Ci.drawNodeUnderlay = bg("underlay"); Ci.hasPie = function(t13) { return t13 = t13[0], t13._private.hasPie; }; Ci.drawPie = function(t13, e, r, n) { e = e[0], n = n || e.position(); var a = e.cy().style(), i = e.pstyle("pie-size"), o = n.x, s = n.y, u = e.width(), l = e.height(), c = Math.min(u, l) / 2, d = 0, v = this.usePaths(); v && (o = 0, s = 0), i.units === "%" ? c = c * i.pfValue : i.pfValue !== void 0 && (c = i.pfValue / 2); for (var h6 = 1; h6 <= a.pieBackgroundN; h6++) { var f = e.pstyle("pie-" + h6 + "-background-size").value, p = e.pstyle("pie-" + h6 + "-background-color").value, m = e.pstyle("pie-" + h6 + "-background-opacity").value * r, g = f / 100; g + d > 1 && (g = 1 - d); var y = 1.5 * Math.PI + 2 * Math.PI * d, b = 2 * Math.PI * g, w = y + b; f === 0 || d >= 1 || d + g > 1 || (t13.beginPath(), t13.moveTo(o, s), t13.arc(o, s, c, y, w), t13.closePath(), this.colorFillStyle(t13, p[0], p[1], p[2], m), t13.fill(), d += g); } }; var br = {}; var CO = 100; br.getPixelRatio = function() { var t13 = this.data.contexts[0]; if (this.forcedPixelRatio != null) return this.forcedPixelRatio; var e = this.cy.window(), r = t13.backingStorePixelRatio || t13.webkitBackingStorePixelRatio || t13.mozBackingStorePixelRatio || t13.msBackingStorePixelRatio || t13.oBackingStorePixelRatio || t13.backingStorePixelRatio || 1; return (e.devicePixelRatio || 1) / r; }; br.paintCache = function(t13) { for (var e = this.paintCaches = this.paintCaches || [], r = true, n, a = 0; a < e.length; a++) if (n = e[a], n.context === t13) { r = false; break; } return r && (n = { context: t13 }, e.push(n)), n; }; br.createGradientStyleFor = function(t13, e, r, n, a) { var i, o = this.usePaths(), s = r.pstyle(e + "-gradient-stop-colors").value, u = r.pstyle(e + "-gradient-stop-positions").pfValue; if (n === "radial-gradient") if (r.isEdge()) { var l = r.sourceEndpoint(), c = r.targetEndpoint(), d = r.midpoint(), v = ya(l, d), h6 = ya(c, d); i = t13.createRadialGradient(d.x, d.y, 0, d.x, d.y, Math.max(v, h6)); } else { var f = o ? { x: 0, y: 0 } : r.position(), p = r.paddedWidth(), m = r.paddedHeight(); i = t13.createRadialGradient(f.x, f.y, 0, f.x, f.y, Math.max(p, m)); } else if (r.isEdge()) { var g = r.sourceEndpoint(), y = r.targetEndpoint(); i = t13.createLinearGradient(g.x, g.y, y.x, y.y); } else { var b = o ? { x: 0, y: 0 } : r.position(), w = r.paddedWidth(), C = r.paddedHeight(), E = w / 2, x = C / 2, T = r.pstyle("background-gradient-direction").value; switch (T) { case "to-bottom": i = t13.createLinearGradient(b.x, b.y - x, b.x, b.y + x); break; case "to-top": i = t13.createLinearGradient(b.x, b.y + x, b.x, b.y - x); break; case "to-left": i = t13.createLinearGradient(b.x + E, b.y, b.x - E, b.y); break; case "to-right": i = t13.createLinearGradient(b.x - E, b.y, b.x + E, b.y); break; case "to-bottom-right": case "to-right-bottom": i = t13.createLinearGradient(b.x - E, b.y - x, b.x + E, b.y + x); break; case "to-top-right": case "to-right-top": i = t13.createLinearGradient(b.x - E, b.y + x, b.x + E, b.y - x); break; case "to-bottom-left": case "to-left-bottom": i = t13.createLinearGradient(b.x + E, b.y - x, b.x - E, b.y + x); break; case "to-top-left": case "to-left-top": i = t13.createLinearGradient(b.x + E, b.y + x, b.x - E, b.y - x); break; } } if (!i) return null; for (var k = u.length === s.length, _ = s.length, D = 0; D < _; D++) i.addColorStop(k ? u[D] : D / (_ - 1), "rgba(" + s[D][0] + "," + s[D][1] + "," + s[D][2] + "," + a + ")"); return i; }; br.gradientFillStyle = function(t13, e, r, n) { var a = this.createGradientStyleFor(t13, "background", e, r, n); if (!a) return null; t13.fillStyle = a; }; br.colorFillStyle = function(t13, e, r, n, a) { t13.fillStyle = "rgba(" + e + "," + r + "," + n + "," + a + ")"; }; br.eleFillStyle = function(t13, e, r) { var n = e.pstyle("background-fill").value; if (n === "linear-gradient" || n === "radial-gradient") this.gradientFillStyle(t13, e, n, r); else { var a = e.pstyle("background-color").value; this.colorFillStyle(t13, a[0], a[1], a[2], r); } }; br.gradientStrokeStyle = function(t13, e, r, n) { var a = this.createGradientStyleFor(t13, "line", e, r, n); if (!a) return null; t13.strokeStyle = a; }; br.colorStrokeStyle = function(t13, e, r, n, a) { t13.strokeStyle = "rgba(" + e + "," + r + "," + n + "," + a + ")"; }; br.eleStrokeStyle = function(t13, e, r) { var n = e.pstyle("line-fill").value; if (n === "linear-gradient" || n === "radial-gradient") this.gradientStrokeStyle(t13, e, n, r); else { var a = e.pstyle("line-color").value; this.colorStrokeStyle(t13, a[0], a[1], a[2], r); } }; br.matchCanvasSize = function(t13) { var e = this, r = e.data, n = e.findContainerClientCoords(), a = n[2], i = n[3], o = e.getPixelRatio(), s = e.motionBlurPxRatio; (t13 === e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE] || t13 === e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG]) && (o = s); var u = a * o, l = i * o, c; if (!(u === e.canvasWidth && l === e.canvasHeight)) { e.fontCaches = null; var d = r.canvasContainer; d.style.width = a + "px", d.style.height = i + "px"; for (var v = 0; v < e.CANVAS_LAYERS; v++) c = r.canvases[v], c.width = u, c.height = l, c.style.width = a + "px", c.style.height = i + "px"; for (var v = 0; v < e.BUFFER_COUNT; v++) c = r.bufferCanvases[v], c.width = u, c.height = l, c.style.width = a + "px", c.style.height = i + "px"; e.textureMult = 1, o <= 1 && (c = r.bufferCanvases[e.TEXTURE_BUFFER], e.textureMult = 2, c.width = u * e.textureMult, c.height = l * e.textureMult), e.canvasWidth = u, e.canvasHeight = l; } }; br.renderTo = function(t13, e, r, n) { this.render({ forcedContext: t13, forcedZoom: e, forcedPan: r, drawAllLayers: true, forcedPxRatio: n }); }; br.render = function(t13) { t13 = t13 || up(); var e = t13.forcedContext, r = t13.drawAllLayers, n = t13.drawOnlyNodeLayer, a = t13.forcedZoom, i = t13.forcedPan, o = this, s = t13.forcedPxRatio === void 0 ? this.getPixelRatio() : t13.forcedPxRatio, u = o.cy, l = o.data, c = l.canvasNeedsRedraw, d = o.textureOnViewport && !e && (o.pinching || o.hoverData.dragging || o.swipePanning || o.data.wheelZooming), v = t13.motionBlur !== void 0 ? t13.motionBlur : o.motionBlur, h6 = o.motionBlurPxRatio, f = u.hasCompoundNodes(), p = o.hoverData.draggingEles, m = !!(o.hoverData.selecting || o.touchData.selecting); v = v && !e && o.motionBlurEnabled && !m; var g = v; e || (o.prevPxRatio !== s && (o.invalidateContainerClientCoordsCache(), o.matchCanvasSize(o.container), o.redrawHint("eles", true), o.redrawHint("drag", true)), o.prevPxRatio = s), !e && o.motionBlurTimeout && clearTimeout(o.motionBlurTimeout), v && (o.mbFrames == null && (o.mbFrames = 0), o.mbFrames++, o.mbFrames < 3 && (g = false), o.mbFrames > o.minMbLowQualFrames && (o.motionBlurPxRatio = o.mbPxRBlurry)), o.clearingMotionBlur && (o.motionBlurPxRatio = 1), o.textureDrawLastFrame && !d && (c[o.NODE] = true, c[o.SELECT_BOX] = true); var y = u.style(), b = u.zoom(), w = a !== void 0 ? a : b, C = u.pan(), E = { x: C.x, y: C.y }, x = { zoom: b, pan: { x: C.x, y: C.y } }, T = o.prevViewport, k = T === void 0 || x.zoom !== T.zoom || x.pan.x !== T.pan.x || x.pan.y !== T.pan.y; !k && !(p && !f) && (o.motionBlurPxRatio = 1), i && (E = i), w *= s, E.x *= s, E.y *= s; var _ = o.getCachedZSortedEles(); function D(fe, me, xe, ke, Ce) { var De = fe.globalCompositeOperation; fe.globalCompositeOperation = "destination-out", o.colorFillStyle(fe, 255, 255, 255, o.motionBlurTransparency), fe.fillRect(me, xe, ke, Ce), fe.globalCompositeOperation = De; } function O(fe, me) { var xe, ke, Ce, De; !o.clearingMotionBlur && (fe === l.bufferContexts[o.MOTIONBLUR_BUFFER_NODE] || fe === l.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]) ? (xe = { x: C.x * h6, y: C.y * h6 }, ke = b * h6, Ce = o.canvasWidth * h6, De = o.canvasHeight * h6) : (xe = E, ke = w, Ce = o.canvasWidth, De = o.canvasHeight), fe.setTransform(1, 0, 0, 1, 0, 0), me === "motionBlur" ? D(fe, 0, 0, Ce, De) : !e && (me === void 0 || me) && fe.clearRect(0, 0, Ce, De), r || (fe.translate(xe.x, xe.y), fe.scale(ke, ke)), i && fe.translate(i.x, i.y), a && fe.scale(a, a); } if (d || (o.textureDrawLastFrame = false), d) { if (o.textureDrawLastFrame = true, !o.textureCache) { o.textureCache = {}, o.textureCache.bb = u.mutableElements().boundingBox(), o.textureCache.texture = o.data.bufferCanvases[o.TEXTURE_BUFFER]; var I = o.data.bufferContexts[o.TEXTURE_BUFFER]; I.setTransform(1, 0, 0, 1, 0, 0), I.clearRect(0, 0, o.canvasWidth * o.textureMult, o.canvasHeight * o.textureMult), o.render({ forcedContext: I, drawOnlyNodeLayer: true, forcedPxRatio: s * o.textureMult }); var x = o.textureCache.viewport = { zoom: u.zoom(), pan: u.pan(), width: o.canvasWidth, height: o.canvasHeight }; x.mpan = { x: (0 - x.pan.x) / x.zoom, y: (0 - x.pan.y) / x.zoom }; } c[o.DRAG] = false, c[o.NODE] = false; var L = l.contexts[o.NODE], B = o.textureCache.texture, x = o.textureCache.viewport; L.setTransform(1, 0, 0, 1, 0, 0), v ? D(L, 0, 0, x.width, x.height) : L.clearRect(0, 0, x.width, x.height); var F = y.core("outside-texture-bg-color").value, M = y.core("outside-texture-bg-opacity").value; o.colorFillStyle(L, F[0], F[1], F[2], M), L.fillRect(0, 0, x.width, x.height); var b = u.zoom(); O(L, false), L.clearRect(x.mpan.x, x.mpan.y, x.width / x.zoom / s, x.height / x.zoom / s), L.drawImage(B, x.mpan.x, x.mpan.y, x.width / x.zoom / s, x.height / x.zoom / s); } else o.textureOnViewport && !e && (o.textureCache = null); var A = u.extent(), R = o.pinching || o.hoverData.dragging || o.swipePanning || o.data.wheelZooming || o.hoverData.draggingEles || o.cy.animated(), K = o.hideEdgesOnViewport && R, H = []; if (H[o.NODE] = !c[o.NODE] && v && !o.clearedForMotionBlur[o.NODE] || o.clearingMotionBlur, H[o.NODE] && (o.clearedForMotionBlur[o.NODE] = true), H[o.DRAG] = !c[o.DRAG] && v && !o.clearedForMotionBlur[o.DRAG] || o.clearingMotionBlur, H[o.DRAG] && (o.clearedForMotionBlur[o.DRAG] = true), c[o.NODE] || r || n || H[o.NODE]) { var q = v && !H[o.NODE] && h6 !== 1, L = e || (q ? o.data.bufferContexts[o.MOTIONBLUR_BUFFER_NODE] : l.contexts[o.NODE]), ee = v && !q ? "motionBlur" : void 0; O(L, ee), K ? o.drawCachedNodes(L, _.nondrag, s, A) : o.drawLayeredElements(L, _.nondrag, s, A), o.debug && o.drawDebugPoints(L, _.nondrag), !r && !v && (c[o.NODE] = false); } if (!n && (c[o.DRAG] || r || H[o.DRAG])) { var q = v && !H[o.DRAG] && h6 !== 1, L = e || (q ? o.data.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG] : l.contexts[o.DRAG]); O(L, v && !q ? "motionBlur" : void 0), K ? o.drawCachedNodes(L, _.drag, s, A) : o.drawCachedElements(L, _.drag, s, A), o.debug && o.drawDebugPoints(L, _.drag), !r && !v && (c[o.DRAG] = false); } if (o.showFps || !n && c[o.SELECT_BOX] && !r) { var L = e || l.contexts[o.SELECT_BOX]; if (O(L), o.selection[4] == 1 && (o.hoverData.selecting || o.touchData.selecting)) { var b = o.cy.zoom(), se = y.core("selection-box-border-width").value / b; L.lineWidth = se, L.fillStyle = "rgba(" + y.core("selection-box-color").value[0] + "," + y.core("selection-box-color").value[1] + "," + y.core("selection-box-color").value[2] + "," + y.core("selection-box-opacity").value + ")", L.fillRect(o.selection[0], o.selection[1], o.selection[2] - o.selection[0], o.selection[3] - o.selection[1]), se > 0 && (L.strokeStyle = "rgba(" + y.core("selection-box-border-color").value[0] + "," + y.core("selection-box-border-color").value[1] + "," + y.core("selection-box-border-color").value[2] + "," + y.core("selection-box-opacity").value + ")", L.strokeRect(o.selection[0], o.selection[1], o.selection[2] - o.selection[0], o.selection[3] - o.selection[1])); } if (l.bgActivePosistion && !o.hoverData.selecting) { var b = o.cy.zoom(), oe = l.bgActivePosistion; L.fillStyle = "rgba(" + y.core("active-bg-color").value[0] + "," + y.core("active-bg-color").value[1] + "," + y.core("active-bg-color").value[2] + "," + y.core("active-bg-opacity").value + ")", L.beginPath(), L.arc(oe.x, oe.y, y.core("active-bg-size").pfValue / b, 0, 2 * Math.PI), L.fill(); } var ae = o.lastRedrawTime; if (o.showFps && ae) { ae = Math.round(ae); var ue = Math.round(1e3 / ae); L.setTransform(1, 0, 0, 1, 0, 0), L.fillStyle = "rgba(255, 0, 0, 0.75)", L.strokeStyle = "rgba(255, 0, 0, 0.75)", L.lineWidth = 1, L.fillText("1 frame = " + ae + " ms = " + ue + " fps", 0, 20); var te = 60; L.strokeRect(0, 30, 250, 20), L.fillRect(0, 30, 250 * Math.min(ue / te, 1), 20); } r || (c[o.SELECT_BOX] = false); } if (v && h6 !== 1) { var $ = l.contexts[o.NODE], G = o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_NODE], Q = l.contexts[o.DRAG], ge = o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_DRAG], Ee = function(me, xe, ke) { me.setTransform(1, 0, 0, 1, 0, 0), ke || !g ? me.clearRect(0, 0, o.canvasWidth, o.canvasHeight) : D(me, 0, 0, o.canvasWidth, o.canvasHeight); var Ce = h6; me.drawImage( xe, // img 0, 0, // sx, sy o.canvasWidth * Ce, o.canvasHeight * Ce, // sw, sh 0, 0, // x, y o.canvasWidth, o.canvasHeight // w, h ); }; (c[o.NODE] || H[o.NODE]) && (Ee($, G, H[o.NODE]), c[o.NODE] = false), (c[o.DRAG] || H[o.DRAG]) && (Ee(Q, ge, H[o.DRAG]), c[o.DRAG] = false); } o.prevViewport = x, o.clearingMotionBlur && (o.clearingMotionBlur = false, o.motionBlurCleared = true, o.motionBlur = true), v && (o.motionBlurTimeout = setTimeout(function() { o.motionBlurTimeout = null, o.clearedForMotionBlur[o.NODE] = false, o.clearedForMotionBlur[o.DRAG] = false, o.motionBlur = false, o.clearingMotionBlur = !d, o.mbFrames = 0, c[o.NODE] = true, c[o.DRAG] = true, o.redraw(); }, CO)), e || u.emit("render"); }; var jn = {}; jn.drawPolygonPath = function(t13, e, r, n, a, i) { var o = n / 2, s = a / 2; t13.beginPath && t13.beginPath(), t13.moveTo(e + o * i[0], r + s * i[1]); for (var u = 1; u < i.length / 2; u++) t13.lineTo(e + o * i[u * 2], r + s * i[u * 2 + 1]); t13.closePath(); }; jn.drawRoundPolygonPath = function(t13, e, r, n, a, i, o) { o.forEach(function(s) { return sg(t13, s); }), t13.closePath(); }; jn.drawRoundRectanglePath = function(t13, e, r, n, a, i) { var o = n / 2, s = a / 2, u = i === "auto" ? ba(n, a) : Math.min(i, s, o); t13.beginPath && t13.beginPath(), t13.moveTo(e, r - s), t13.arcTo(e + o, r - s, e + o, r, u), t13.arcTo(e + o, r + s, e, r + s, u), t13.arcTo(e - o, r + s, e - o, r, u), t13.arcTo(e - o, r - s, e, r - s, u), t13.lineTo(e, r - s), t13.closePath(); }; jn.drawBottomRoundRectanglePath = function(t13, e, r, n, a, i) { var o = n / 2, s = a / 2, u = i === "auto" ? ba(n, a) : i; t13.beginPath && t13.beginPath(), t13.moveTo(e, r - s), t13.lineTo(e + o, r - s), t13.lineTo(e + o, r), t13.arcTo(e + o, r + s, e, r + s, u), t13.arcTo(e - o, r + s, e - o, r, u), t13.lineTo(e - o, r - s), t13.lineTo(e, r - s), t13.closePath(); }; jn.drawCutRectanglePath = function(t13, e, r, n, a, i, o) { var s = n / 2, u = a / 2, l = o === "auto" ? vc() : o; t13.beginPath && t13.beginPath(), t13.moveTo(e - s + l, r - u), t13.lineTo(e + s - l, r - u), t13.lineTo(e + s, r - u + l), t13.lineTo(e + s, r + u - l), t13.lineTo(e + s - l, r + u), t13.lineTo(e - s + l, r + u), t13.lineTo(e - s, r + u - l), t13.lineTo(e - s, r - u + l), t13.closePath(); }; jn.drawBarrelPath = function(t13, e, r, n, a) { var i = n / 2, o = a / 2, s = e - i, u = e + i, l = r - o, c = r + o, d = lu(n, a), v = d.widthOffset, h6 = d.heightOffset, f = d.ctrlPtOffsetPct * v; t13.beginPath && t13.beginPath(), t13.moveTo(s, l + h6), t13.lineTo(s, c - h6), t13.quadraticCurveTo(s + f, c, s + v, c), t13.lineTo(u - v, c), t13.quadraticCurveTo(u - f, c, u, c - h6), t13.lineTo(u, l + h6), t13.quadraticCurveTo(u - f, l, u - v, l), t13.lineTo(s + v, l), t13.quadraticCurveTo(s + f, l, s, l + h6), t13.closePath(); }; var cv = Math.sin(0); var dv = Math.cos(0); var wu = {}; var xu = {}; var wg = Math.PI / 40; for ($a2 = 0 * Math.PI; $a2 < 2 * Math.PI; $a2 += wg) wu[$a2] = Math.sin($a2), xu[$a2] = Math.cos($a2); var $a2; jn.drawEllipsePath = function(t13, e, r, n, a) { if (t13.beginPath && t13.beginPath(), t13.ellipse) t13.ellipse(e, r, n / 2, a / 2, 0, 0, 2 * Math.PI); else for (var i, o, s = n / 2, u = a / 2, l = 0 * Math.PI; l < 2 * Math.PI; l += wg) i = e - s * wu[l] * cv + s * xu[l] * dv, o = r + u * xu[l] * cv + u * wu[l] * dv, l === 0 ? t13.moveTo(i, o) : t13.lineTo(i, o); t13.closePath(); }; var Mo = {}; Mo.createBuffer = function(t13, e) { var r = document.createElement("canvas"); return r.width = t13, r.height = e, [r, r.getContext("2d")]; }; Mo.bufferCanvasImage = function(t13) { var e = this.cy, r = e.mutableElements(), n = r.boundingBox(), a = this.findContainerClientCoords(), i = t13.full ? Math.ceil(n.w) : a[2], o = t13.full ? Math.ceil(n.h) : a[3], s = be(t13.maxWidth) || be(t13.maxHeight), u = this.getPixelRatio(), l = 1; if (t13.scale !== void 0) i *= t13.scale, o *= t13.scale, l = t13.scale; else if (s) { var c = 1 / 0, d = 1 / 0; be(t13.maxWidth) && (c = l * t13.maxWidth / i), be(t13.maxHeight) && (d = l * t13.maxHeight / o), l = Math.min(c, d), i *= l, o *= l; } s || (i *= u, o *= u, l *= u); var v = document.createElement("canvas"); v.width = i, v.height = o, v.style.width = i + "px", v.style.height = o + "px"; var h6 = v.getContext("2d"); if (i > 0 && o > 0) { h6.clearRect(0, 0, i, o), h6.globalCompositeOperation = "source-over"; var f = this.getCachedZSortedEles(); if (t13.full) h6.translate(-n.x1 * l, -n.y1 * l), h6.scale(l, l), this.drawElements(h6, f), h6.scale(1 / l, 1 / l), h6.translate(n.x1 * l, n.y1 * l); else { var p = e.pan(), m = { x: p.x * l, y: p.y * l }; l *= e.zoom(), h6.translate(m.x, m.y), h6.scale(l, l), this.drawElements(h6, f), h6.scale(1 / l, 1 / l), h6.translate(-m.x, -m.y); } t13.bg && (h6.globalCompositeOperation = "destination-over", h6.fillStyle = t13.bg, h6.rect(0, 0, i, o), h6.fill()); } return v; }; function EO(t13, e) { for (var r = atob(t13), n = new ArrayBuffer(r.length), a = new Uint8Array(n), i = 0; i < r.length; i++) a[i] = r.charCodeAt(i); return new Blob([n], { type: e }); } function fv(t13) { var e = t13.indexOf(","); return t13.substr(e + 1); } function xg(t13, e, r) { var n = function() { return e.toDataURL(r, t13.quality); }; switch (t13.output) { case "blob-promise": return new hi(function(a, i) { try { e.toBlob(function(o) { o != null ? a(o) : i(new Error("`canvas.toBlob()` sent a null value in its callback")); }, r, t13.quality); } catch (o) { i(o); } }); case "blob": return EO(fv(n()), r); case "base64": return fv(n()); case "base64uri": default: return n(); } } Mo.png = function(t13) { return xg(t13, this.bufferCanvasImage(t13), "image/png"); }; Mo.jpg = function(t13) { return xg(t13, this.bufferCanvasImage(t13), "image/jpeg"); }; var Cg = {}; Cg.nodeShapeImpl = function(t13, e, r, n, a, i, o, s) { switch (t13) { case "ellipse": return this.drawEllipsePath(e, r, n, a, i); case "polygon": return this.drawPolygonPath(e, r, n, a, i, o); case "round-polygon": return this.drawRoundPolygonPath(e, r, n, a, i, o, s); case "roundrectangle": case "round-rectangle": return this.drawRoundRectanglePath(e, r, n, a, i, s); case "cutrectangle": case "cut-rectangle": return this.drawCutRectanglePath(e, r, n, a, i, o, s); case "bottomroundrectangle": case "bottom-round-rectangle": return this.drawBottomRoundRectanglePath(e, r, n, a, i, s); case "barrel": return this.drawBarrelPath(e, r, n, a, i); } }; var kO = Eg; var je = Eg.prototype; je.CANVAS_LAYERS = 3; je.SELECT_BOX = 0; je.DRAG = 1; je.NODE = 2; je.BUFFER_COUNT = 3; je.TEXTURE_BUFFER = 0; je.MOTIONBLUR_BUFFER_NODE = 1; je.MOTIONBLUR_BUFFER_DRAG = 2; function Eg(t13) { var e = this, r = e.cy.window(), n = r.document; e.data = { canvases: new Array(je.CANVAS_LAYERS), contexts: new Array(je.CANVAS_LAYERS), canvasNeedsRedraw: new Array(je.CANVAS_LAYERS), bufferCanvases: new Array(je.BUFFER_COUNT), bufferContexts: new Array(je.CANVAS_LAYERS) }; var a = "-webkit-tap-highlight-color", i = "rgba(0,0,0,0)"; e.data.canvasContainer = n.createElement("div"); var o = e.data.canvasContainer.style; e.data.canvasContainer.style[a] = i, o.position = "relative", o.zIndex = "0", o.overflow = "hidden"; var s = t13.cy.container(); s.appendChild(e.data.canvasContainer), s.style[a] = i; var u = { "-webkit-user-select": "none", "-moz-user-select": "-moz-none", "user-select": "none", "-webkit-tap-highlight-color": "rgba(0,0,0,0)", "outline-style": "none" }; dT() && (u["-ms-touch-action"] = "none", u["touch-action"] = "none"); for (var l = 0; l < je.CANVAS_LAYERS; l++) { var c = e.data.canvases[l] = n.createElement("canvas"); e.data.contexts[l] = c.getContext("2d"), Object.keys(u).forEach(function(te) { c.style[te] = u[te]; }), c.style.position = "absolute", c.setAttribute("data-id", "layer" + l), c.style.zIndex = String(je.CANVAS_LAYERS - l), e.data.canvasContainer.appendChild(c), e.data.canvasNeedsRedraw[l] = false; } e.data.topCanvas = e.data.canvases[0], e.data.canvases[je.NODE].setAttribute("data-id", "layer" + je.NODE + "-node"), e.data.canvases[je.SELECT_BOX].setAttribute("data-id", "layer" + je.SELECT_BOX + "-selectbox"), e.data.canvases[je.DRAG].setAttribute("data-id", "layer" + je.DRAG + "-drag"); for (var l = 0; l < je.BUFFER_COUNT; l++) e.data.bufferCanvases[l] = n.createElement("canvas"), e.data.bufferContexts[l] = e.data.bufferCanvases[l].getContext("2d"), e.data.bufferCanvases[l].style.position = "absolute", e.data.bufferCanvases[l].setAttribute("data-id", "buffer" + l), e.data.bufferCanvases[l].style.zIndex = String(-l - 1), e.data.bufferCanvases[l].style.visibility = "hidden"; e.pathsEnabled = true; var d = pr(), v = function($) { return { x: ($.x1 + $.x2) / 2, y: ($.y1 + $.y2) / 2 }; }, h6 = function($) { return { x: -$.w / 2, y: -$.h / 2 }; }, f = function($) { var G = $[0]._private, Q = G.oldBackgroundTimestamp === G.backgroundTimestamp; return !Q; }, p = function($) { return $[0]._private.nodeKey; }, m = function($) { return $[0]._private.labelStyleKey; }, g = function($) { return $[0]._private.sourceLabelStyleKey; }, y = function($) { return $[0]._private.targetLabelStyleKey; }, b = function($, G, Q, ge, Ee) { return e.drawElement($, G, Q, false, false, Ee); }, w = function($, G, Q, ge, Ee) { return e.drawElementText($, G, Q, ge, "main", Ee); }, C = function($, G, Q, ge, Ee) { return e.drawElementText($, G, Q, ge, "source", Ee); }, E = function($, G, Q, ge, Ee) { return e.drawElementText($, G, Q, ge, "target", Ee); }, x = function($) { return $.boundingBox(), $[0]._private.bodyBounds; }, T = function($) { return $.boundingBox(), $[0]._private.labelBounds.main || d; }, k = function($) { return $.boundingBox(), $[0]._private.labelBounds.source || d; }, _ = function($) { return $.boundingBox(), $[0]._private.labelBounds.target || d; }, D = function($, G) { return G; }, O = function($) { return v(x($)); }, I = function($, G, Q) { var ge = $ ? $ + "-" : ""; return { x: G.x + Q.pstyle(ge + "text-margin-x").pfValue, y: G.y + Q.pstyle(ge + "text-margin-y").pfValue }; }, L = function($, G, Q) { var ge = $[0]._private.rscratch; return { x: ge[G], y: ge[Q] }; }, B = function($) { return I("", L($, "labelX", "labelY"), $); }, F = function($) { return I("source", L($, "sourceLabelX", "sourceLabelY"), $); }, M = function($) { return I("target", L($, "targetLabelX", "targetLabelY"), $); }, A = function($) { return h6(x($)); }, R = function($) { return h6(k($)); }, K = function($) { return h6(_($)); }, H = function($) { var G = T($), Q = h6(T($)); if ($.isNode()) { switch ($.pstyle("text-halign").value) { case "left": Q.x = -G.w; break; case "right": Q.x = 0; break; } switch ($.pstyle("text-valign").value) { case "top": Q.y = -G.h; break; case "bottom": Q.y = 0; break; } } return Q; }, q = e.data.eleTxrCache = new Ri(e, { getKey: p, doesEleInvalidateKey: f, drawElement: b, getBoundingBox: x, getRotationPoint: O, getRotationOffset: A, allowEdgeTxrCaching: false, allowParentTxrCaching: false }), ee = e.data.lblTxrCache = new Ri(e, { getKey: m, drawElement: w, getBoundingBox: T, getRotationPoint: B, getRotationOffset: H, isVisible: D }), se = e.data.slbTxrCache = new Ri(e, { getKey: g, drawElement: C, getBoundingBox: k, getRotationPoint: F, getRotationOffset: R, isVisible: D }), oe = e.data.tlbTxrCache = new Ri(e, { getKey: y, drawElement: E, getBoundingBox: _, getRotationPoint: M, getRotationOffset: K, isVisible: D }), ae = e.data.lyrTxrCache = new gg(e); e.onUpdateEleCalcs(function($, G) { q.invalidateElements(G), ee.invalidateElements(G), se.invalidateElements(G), oe.invalidateElements(G), ae.invalidateElements(G); for (var Q = 0; Q < G.length; Q++) { var ge = G[Q]._private; ge.oldBackgroundTimestamp = ge.backgroundTimestamp; } }); var ue = function($) { for (var G = 0; G < $.length; G++) ae.enqueueElementRefinement($[G].ele); }; q.onDequeue(ue), ee.onDequeue(ue), se.onDequeue(ue), oe.onDequeue(ue); } je.redrawHint = function(t13, e) { var r = this; switch (t13) { case "eles": r.data.canvasNeedsRedraw[je.NODE] = e; break; case "drag": r.data.canvasNeedsRedraw[je.DRAG] = e; break; case "select": r.data.canvasNeedsRedraw[je.SELECT_BOX] = e; break; } }; var SO = typeof Path2D < "u"; je.path2dEnabled = function(t13) { if (t13 === void 0) return this.pathsEnabled; this.pathsEnabled = !!t13; }; je.usePaths = function() { return SO && this.pathsEnabled; }; je.setImgSmoothing = function(t13, e) { t13.imageSmoothingEnabled != null ? t13.imageSmoothingEnabled = e : (t13.webkitImageSmoothingEnabled = e, t13.mozImageSmoothingEnabled = e, t13.msImageSmoothingEnabled = e); }; je.getImgSmoothing = function(t13) { return t13.imageSmoothingEnabled != null ? t13.imageSmoothingEnabled : t13.webkitImageSmoothingEnabled || t13.mozImageSmoothingEnabled || t13.msImageSmoothingEnabled; }; je.makeOffscreenCanvas = function(t13, e) { var r; if ((typeof OffscreenCanvas > "u" ? "undefined" : It(OffscreenCanvas)) !== "undefined") r = new OffscreenCanvas(t13, e); else { var n = this.cy.window(), a = n.document; r = a.createElement("canvas"), r.width = t13, r.height = e; } return r; }; [mg, on, En, _c, Pa, Ci, br, jn, Mo, Cg].forEach(function(t13) { Re(je, t13); }); var TO = [{ name: "null", impl: ag }, { name: "base", impl: hg }, { name: "canvas", impl: kO }]; var _O = [{ type: "layout", extensions: IP }, { type: "renderer", extensions: TO }]; var kg = {}; var Sg = {}; function Tg(t13, e, r) { var n = r, a = function(T) { tt("Can not register `" + e + "` for `" + t13 + "` since `" + T + "` already exists in the prototype and can not be overridden"); }; if (t13 === "core") { if (fo.prototype[e]) return a(e); fo.prototype[e] = r; } else if (t13 === "collection") { if (Gt.prototype[e]) return a(e); Gt.prototype[e] = r; } else if (t13 === "layout") { for (var i = function(T) { this.options = T, r.call(this, T), Xe(this._private) || (this._private = {}), this._private.cy = T.cy, this._private.listeners = [], this.createEmitter(); }, o = i.prototype = Object.create(r.prototype), s = [], u = 0; u < s.length; u++) { var l = s[u]; o[l] = o[l] || function() { return this; }; } o.start && !o.run ? o.run = function() { return this.start(), this; } : !o.start && o.run && (o.start = function() { return this.run(), this; }); var c = r.prototype.stop; o.stop = function() { var x = this.options; if (x && x.animate) { var T = this.animations; if (T) for (var k = 0; k < T.length; k++) T[k].stop(); } return c ? c.call(this) : this.emit("layoutstop"), this; }, o.destroy || (o.destroy = function() { return this; }), o.cy = function() { return this._private.cy; }; var d = function(T) { return T._private.cy; }, v = { addEventFields: function(T, k) { k.layout = T, k.cy = d(T), k.target = T; }, bubble: function() { return true; }, parent: function(T) { return d(T); } }; Re(o, { createEmitter: function() { return this._private.emitter = new ul(v, this), this; }, emitter: function() { return this._private.emitter; }, on: function(T, k) { return this.emitter().on(T, k), this; }, one: function(T, k) { return this.emitter().one(T, k), this; }, once: function(T, k) { return this.emitter().one(T, k), this; }, removeListener: function(T, k) { return this.emitter().removeListener(T, k), this; }, removeAllListeners: function() { return this.emitter().removeAllListeners(), this; }, emit: function(T, k) { return this.emitter().emit(T, k), this; } }), et.eventAliasesOn(o), n = i; } else if (t13 === "renderer" && e !== "null" && e !== "base") { var h6 = _g("renderer", "base"), f = h6.prototype, p = r, m = r.prototype, g = function() { h6.apply(this, arguments), p.apply(this, arguments); }, y = g.prototype; for (var b in f) { var w = f[b], C = m[b] != null; if (C) return a(b); y[b] = w; } for (var E in m) y[E] = m[E]; f.clientFunctions.forEach(function(x) { y[x] = y[x] || function() { yt("Renderer does not implement `renderer." + x + "()` on its prototype"); }; }), n = g; } else if (t13 === "__proto__" || t13 === "constructor" || t13 === "prototype") return yt(t13 + " is an illegal type to be registered, possibly lead to prototype pollutions"); return Qh({ map: kg, keys: [t13, e], value: n }); } function _g(t13, e) { return Jh({ map: kg, keys: [t13, e] }); } function DO(t13, e, r, n, a) { return Qh({ map: Sg, keys: [t13, e, r, n], value: a }); } function PO(t13, e, r, n) { return Jh({ map: Sg, keys: [t13, e, r, n] }); } var Cu = function() { if (arguments.length === 2) return _g.apply(null, arguments); if (arguments.length === 3) return Tg.apply(null, arguments); if (arguments.length === 4) return PO.apply(null, arguments); if (arguments.length === 5) return DO.apply(null, arguments); yt("Invalid extension access syntax"); }; fo.prototype.extension = Cu; _O.forEach(function(t13) { t13.extensions.forEach(function(e) { Tg(t13.type, e.name, e.impl); }); }); var Dg = function t12() { if (!(this instanceof t12)) return new t12(); this.length = 0; }; var Ca = Dg.prototype; Ca.instanceString = function() { return "stylesheet"; }; Ca.selector = function(t13) { var e = this.length++; return this[e] = { selector: t13, properties: [] }, this; }; Ca.css = function(t13, e) { var r = this.length - 1; if (Ie(t13)) this[r].properties.push({ name: t13, value: e }); else if (Xe(t13)) for (var n = t13, a = Object.keys(n), i = 0; i < a.length; i++) { var o = a[i], s = n[o]; if (s != null) { var u = rr.properties[o] || rr.properties[Js(o)]; if (u != null) { var l = u.name, c = s; this[r].properties.push({ name: l, value: c }); } } } return this; }; Ca.style = Ca.css; Ca.generateStyle = function(t13) { var e = new rr(t13); return this.appendToStyle(e); }; Ca.appendToStyle = function(t13) { for (var e = 0; e < this.length; e++) { var r = this[e], n = r.selector, a = r.properties; t13.selector(n); for (var i = 0; i < a.length; i++) { var o = a[i]; t13.css(o.name, o.value); } } return t13; }; var OO = "3.30.2"; var Ea = function(e) { if (e === void 0 && (e = {}), Xe(e)) return new fo(e); if (Ie(e)) return Cu.apply(Cu, arguments); }; Ea.use = function(t13) { var e = Array.prototype.slice.call(arguments, 1); return e.unshift(Ea), t13.apply(null, e), this; }; Ea.warnings = function(t13) { return sp(t13); }; Ea.version = OO; Ea.stylesheet = Ea.Stylesheet = Dg; var LO = class extends EventTarget { constructor(r, n) { super(); Fr(this, "cyg", null); Fr(this, "nodes", []); Fr(this, "edges", []); Fr(this, "axons", []); Fr(this, "dendrites", []); Fr(this, "somas", []); Fr(this, "labelCache", /* @__PURE__ */ new Map()); Fr(this, "graphCanvas", null); this.labelCache = r, this.graphCanvas = n; } async addConnectivity(r) { var n; if (this.axons = r.axons.map((a) => JSON.stringify(a)), this.dendrites = r.dendrites.map((a) => JSON.stringify(a)), (n = r.somas) != null && n.length && (this.somas = r.somas.map((a) => JSON.stringify(a))), r.connectivity.length) for (const a of r.connectivity) { const i = await this.graphNode(a[0]), o = await this.graphNode(a[1]); this.nodes.push(i), this.nodes.push(o), this.edges.push({ id: `${i.id}_${o.id}`, source: i.id, target: o.id }); } else this.nodes.push({ id: "MISSING", label: "NO PATHS" }); } showConnectivity(r) { this.cyg = new MO(this, r), this.cyg.on("tap-node", (n) => { const a = new CustomEvent("tap-node", { detail: n.detail }); this.dispatchEvent(a); }); } clearConnectivity() { var r; (r = this.cyg) != null && r.cy && (this.cyg.cy.remove(), this.cyg.cy = null); } reset() { var r; (r = this.cyg) != null && r.cy && this.cyg.cy.reset(); } zoom(r) { var n; if ((n = this.cyg) != null && n.cy) { const a = this.cyg.cy.zoom(), i = this.cyg.cy.width(), o = this.cyg.cy.height(), s = { x: i / 2, y: o / 2 }; this.cyg.cy.zoom({ level: a + r, renderedPosition: s }); } } enableZoom(r) { var n; (n = this.cyg) != null && n.cy && this.cyg.cy.userZoomingEnabled(r); } get elements() { return [ ...this.nodes.map((r) => ({ data: r })), ...this.edges.map((r) => ({ data: r })) ]; } get roots() { return [ ...this.dendrites, ...this.somas ]; } async graphNode(r) { const n = JSON.stringify(r), a = [r[0], ...r[1]], i = []; for (const s of a) { const u = this.labelCache.has(s) ? this.labelCache.get(s) : ""; i.push(u); } a.push(...i); const o = { id: n, label: a.join(` `) }; return this.axons.includes(n) ? this.dendrites.includes(n) || this.somas.includes(n) ? o["both-a-d"] = true : o.axon = true : (this.dendrites.includes(n) || this.somas.includes(n)) && (o.dendrite = true), o; } on(r, n) { this.addEventListener(r, n); } }; var FO = [ { selector: "node", style: { label: function(t13) { return IO(t13.data("label")); }, // 'background-color': '#80F0F0', "background-color": "transparent", "background-opacity": "0", "text-valign": "center", "text-wrap": "wrap", width: "80px", height: "80px", "text-max-width": "80px", "font-size": "6px", shape: "round-rectangle", "border-width": 1, "border-style": "solid", "border-color": "gray" } }, { selector: "node[axon]", style: { // 'background-color': 'green', shape: "round-diamond", width: "100px", height: "100px" } }, { selector: "node[dendrite]", style: { // 'background-color': 'red', shape: "ellipse" } }, { selector: "node[both-a-d]", style: { // 'background-color': 'gray', shape: "round-rectangle" } }, { selector: "edge", style: { width: 1, "line-color": "dimgray", "target-arrow-color": "dimgray", "target-arrow-shape": "triangle", "curve-style": "bezier" } } ]; function IO(t13) { const e = t13.split(` `), r = e.length / 2; return e.slice(r).join(` `); } function AO(t13) { return t13.split(` `).map((e) => e && e[0] >= "a" && e[0] <= "z" ? e.charAt(0).toUpperCase() + e.slice(1) : e).join(` `); } var MO = class extends EventTarget { constructor(r, n) { var a; super(); Fr(this, "cy"); Fr(this, "tooltip"); this.cy = Ea({ container: n, elements: r.elements, layout: { name: "breadthfirst", circle: false, roots: r.roots }, directed: true, style: FO, minZoom: 0.5, maxZoom: 10, wheelSensitivity: 0.4 }).on("mouseover", "node", this.overNode.bind(this)).on("mouseout", "node", this.exitNode.bind(this)).on("position", "node", this.moveNode.bind(this)).on("tap", this.tapNode.bind(this)), this.tooltip = document.createElement("div"), this.tooltip.className = "cy-graph-tooltip", this.tooltip.hidden = true, (a = n == null ? void 0 : n.lastChild) == null || a.appendChild(this.tooltip); } remove() { this.cy && this.cy.destroy(); } checkRightBoundary(r) { var n; r + this.tooltip.offsetWidth >= ((n = this.tooltip.parentElement) == null ? void 0 : n.offsetWidth) && (this.tooltip.style.left = `${r - this.tooltip.offsetWidth}px`); } overNode(r) { const n = r.target, a = AO(n.data().label); this.tooltip.innerText = a, this.tooltip.style.left = `${r.renderedPosition.x}px`, this.tooltip.style.top = `${r.renderedPosition.y}px`, this.tooltip.style.maxWidth = "240px", this.tooltip.hidden = false, this.checkRightBoundary(r.renderedPosition.x); } moveNode(r) { const n = r.target; this.tooltip.style.left = `${n.renderedPosition().x}px`, this.tooltip.style.top = `${n.renderedPosition().y}px`, this.checkRightBoundary(n.renderedPosition().x); } exitNode(r) { this.tooltip.hidden = true; } tapNode(r) { const a = r.target.data(), i = new CustomEvent("tap-node", { detail: a }); this.dispatchEvent(i); } on(r, n) { this.addEventListener(r, n); } }; var BO = 1.3; var NO = 24 * 60 * 60 * 1e3; var $O = "Reset position"; var vv = "Lock zoom"; var RO = "Unlock zoom"; var zO = "Zoom in"; var VO = "Zoom out"; var hv = 0.25; var HO = "#8300bf"; var qO = { name: "ConnectivityGraph", props: { /** * Entity to load its connectivity graph. */ entry: { type: String, default: "" }, mapServer: { type: String, default: "" } }, data: function() { return { loading: true, connectivityGraph: null, selectedSource: "", pathList: [], schemaVersion: "", knowledgeByPath: /* @__PURE__ */ new Map(), labelledTerms: /* @__PURE__ */ new Set(), labelCache: /* @__PURE__ */ new Map(), resetLabel: $O, zoomLockLabel: vv, zoomInLabel: zO, zoomOutLabel: VO, iconColor: HO, zoomEnabled: false, errorMessage: "" }; }, mounted() { this.refreshCache(), this.loadCacheData(), this.run().then((t13) => { this.showGraph(this.entry); }); }, methods: { loadCacheData: function() { const t13 = sessionStorage.getItem("connectivity-graph-source"), e = sessionStorage.getItem("connectivity-graph-labels"), r = sessionStorage.getItem("connectivity-graph-pathlist"), n = sessionStorage.getItem("connectivity-graph-schema-version"); if (t13 && (this.selectedSource = t13), r && (this.pathList = JSON.parse(r)), e) { const a = JSON.parse(e); this.labelCache = new Map(Object.entries(a)); } n && (this.schemaVersion = n); }, removeAllCacheData: function() { [ "connectivity-graph-expiry", "connectivity-graph-source", "connectivity-graph-labels", "connectivity-graph-pathlist", "connectivity-graph-schema-version" ].forEach((e) => { sessionStorage.removeItem(e); }); }, refreshCache: function() { const t13 = sessionStorage.getItem("connectivity-graph-expiry"); (/* @__PURE__ */ new Date()).getTime() > t13 && this.removeAllCacheData(); }, updateCacheExpiry: function() { const e = (/* @__PURE__ */ new Date()).getTime() + NO; sessionStorage.setItem("connectivity-graph-expiry", e); }, run: async function() { if (this.schemaVersion || (this.schemaVersion = await this.getSchemaVersion(), sessionStorage.setItem("connectivity-graph-schema-version", this.schemaVersion), this.updateCacheExpiry()), this.schemaVersion < BO) { console.warn("No Server!"); return; } this.showSpinner(), this.selectedSource || (this.selectedSource = await this.setSourceList(), sessionStorage.setItem("connectivity-graph-source", this.selectedSource), this.updateCacheExpiry()), await this.setPathList(this.selectedSource), this.hideSpinner(); }, showGraph: async function(t13) { const e = this.$refs.graphCanvas; this.showSpinner(), this.connectivityGraph = new LO(this.labelCache, e), await this.connectivityGraph.addConnectivity(this.knowledgeByPath.get(t13)), this.hideSpinner(), this.connectivityGraph.showConnectivity(e), this.connectivityGraph.on("tap-node", (r) => { const { label: n } = r.detail, a = n ? n.split(` `) : []; this.$emit("tap-node", a); }); }, query: async function(t13, e) { const r = `${this.mapServer}knowledge/query/`, n = { sql: t13, params: e }; try { const a = await fetch(r, { method: "POST", headers: { Accept: "application/json; charset=utf-8", "Cache-Control": "no-store", "Content-Type": "application/json" }, body: JSON.stringify(n) }); if (!a.ok) throw new Error(`Cannot access ${r}`); return await a.json(); } catch { return { values: [] }; } }, setSourceList: async function() { const t13 = await this.getJsonData(`${this.mapServer}knowledge/sources`), e = t13 ? t13.sources || [] : []; let r = ""; for (const n of e) n && r === "" && (r = n); return r; }, loadPathData: async function(t13) { const e = await this.query( `select entity, knowledge from knowledge where entity like 'ilxtr:%' and source=? order by entity`, [t13] ); return e ? e.values : []; }, setPathList: async function(t13) { this.pathList.length || (this.pathList = await this.loadPathData(t13), sessionStorage.setItem("connectivity-graph-pathlist", JSON.stringify(this.pathList)), this.updateCacheExpiry()), this.knowledgeByPath.clear(), this.labelledTerms = /* @__PURE__ */ new Set(); for (const [e, r] of this.pathList) { const n = JSON.parse(r); "connectivity" in n && (this.knowledgeByPath.set(e, n), this.cacheLabels(n)); } return this.labelCache.size || await this.getCachedTermLabels(), ""; }, getSchemaVersion: async function() { const t13 = await this.getJsonData(`${this.mapServer}knowledge/schema-version`); return t13 && +t13.version || 0; }, getJsonData: async function(t13) { try { const e = await fetch(t13, { method: "GET", headers: { Accept: "application/json; charset=utf-8", "Cache-Control": "no-store", "Content-Type": "application/json" } }); return e.ok || console.error(`Cannot access ${t13}`), await e.json(); } catch { return null; } }, getCachedTermLabels: async function() { if (this.labelledTerms.size) { const t13 = await this.query( `select entity, knowledge from knowledge where entity in (?${", ?".repeat(this.labelledTerms.size - 1)}) order by source desc`, [...this.labelledTerms.values()] ); let e = null; for (const [n, a] of t13.values) if (n !== e) { const i = JSON.parse(a); this.labelCache.set(n, i.label || n), e = n; } const r = Object.fromEntries(this.labelCache); sessionStorage.setItem("connectivity-graph-labels", JSON.stringify(r)), this.updateCacheExpiry(); } }, cacheNodeLabels: function(t13) { for (const e of [t13[0], ...t13[1]]) this.labelledTerms.add(e); }, cacheLabels: async function(t13) { for (const e of t13.connectivity) this.cacheNodeLabels(e[0]), this.cacheNodeLabels(e[1]); }, showSpinner: function() { this.loading = true; }, hideSpinner: function() { this.loading = false; }, reset: function() { this.connectivityGraph.reset(); }, zoomIn: function() { this.connectivityGraph.zoom(hv); }, zoomOut: function() { this.connectivityGraph.zoom(-hv); }, /** * Enable/disable user zoom for scrolling */ toggleZoom: function() { this.zoomEnabled = !this.zoomEnabled, this.zoomLockLabel = this.zoomEnabled ? RO : vv, this.connectivityGraph.enableZoom(!this.zoomEnabled); }, showErrorMessage: function(t13) { this.errorMessage = t13, setTimeout(() => { this.errorMessage = ""; }, 3e3); } } }; var KO = { class: "connectivity-graph" }; var UO = { ref: "graphCanvas", class: "graph-canvas" }; var GO = { class: "control-panel control-panel-tools" }; var WO = { class: "visually-hidden" }; var YO = { class: "visually-hidden" }; var ZO = { class: "visually-hidden" }; var XO = { class: "visually-hidden" }; var jO = createStaticVNode('
Origin
Components
Destination
', 1); var QO = { key: 0, class: "connectivity-graph-error" }; function JO(t13, e, r, n, a, i) { const o = Jb, s = Vt, u = Hr, l = ko, c = w2, d = k2, v = O2, h6 = F2, f = nc; return withDirectives((openBlock(), createElementBlock("div", KO, [ createBaseVNode("div", UO, null, 512), createBaseVNode("div", GO, [ createBaseVNode("div", { class: normalizeClass(["tools", { "zoom-locked": t13.zoomEnabled }]) }, [ createVNode(l, { content: t13.resetLabel, placement: "top", effect: "control-tooltip" }, { default: withCtx(() => [ createVNode(u, { class: normalizeClass(["control-button", t13.theme]), size: "small", onClick: i.reset }, { default: withCtx(() => [ createVNode(s, { color: "white" }, { default: withCtx(() => [ createVNode(o) ]), _: 1 }), createBaseVNode("span", WO, toDisplayString(t13.resetLabel), 1) ]), _: 1 }, 8, ["class", "onClick"]) ]), _: 1 }, 8, ["content"]), createVNode(l, { content: t13.zoomLockLabel, placement: "top", effect: "control-tooltip" }, { default: withCtx(() => [ createVNode(u, { class: normalizeClass(["control-button", t13.theme]), size: "small", onClick: i.toggleZoom }, { default: withCtx(() => [ createVNode(s, { color: "white" }, { default: withCtx(() => [ t13.zoomEnabled ? (openBlock(), createBlock(c, { key: 0 })) : (openBlock(), createBlock(d, { key: 1 })) ]), _: 1 }), createBaseVNode("span", YO, toDisplayString(t13.zoomLockLabel), 1) ]), _: 1 }, 8, ["class", "onClick"]) ]), _: 1 }, 8, ["content"]), createVNode(l, { content: t13.zoomInLabel, placement: "left", effect: "control-tooltip" }, { default: withCtx(() => [ createVNode(u, { class: normalizeClass(["control-button", t13.theme]), size: "small", onClick: i.zoomIn }, { default: withCtx(() => [ createVNode(s, { color: "white" }, { default: withCtx(() => [ createVNode(v) ]), _: 1 }), createBaseVNode("span", ZO, toDisplayString(t13.zoomInLabel), 1) ]), _: 1 }, 8, ["class", "onClick"]) ]), _: 1 }, 8, ["content"]), createVNode(l, { content: t13.zoomOutLabel, placement: "left", effect: "control-tooltip" }, { default: withCtx(() => [ createVNode(u, { class: normalizeClass(["control-button", t13.theme]), size: "small", onClick: i.zoomOut }, { default: withCtx(() => [ createVNode(s, { color: "white" }, { default: withCtx(() => [ createVNode(h6) ]), _: 1 }), createBaseVNode("span", XO, toDisplayString(t13.zoomOutLabel), 1) ]), _: 1 }, 8, ["class", "onClick"]) ]), _: 1 }, 8, ["content"]) ], 2) ]), jO, t13.errorMessage ? (openBlock(), createElementBlock("div", QO, toDisplayString(t13.errorMessage), 1)) : createCommentVNode("", true) ])), [ [f, t13.loading] ]); } var MF = Ur(qO, [["render", JO], ["__scopeId", "data-v-aead960f"]]); var pv = "Copy to clipboard"; var eL = "Copied!"; var tL = "#8300bf"; var rL = { name: "CopyToClipboard", props: { content: { type: String, default: "" }, /** * `theme: light` will show white button, * to use when the button is over other readable text content. * Default button is transparent. */ theme: { type: String, default: "" } }, data: function() { return { textLabel: pv, autoHideTimeout: 0, iconColor: tL }; }, methods: { copyToClipboard: async function() { let t13 = true; this.autoHideTimeout = 600; try { const e = this.content.replaceAll(` `, ""), r = document.createElement("div"); r.innerHTML = this.content; const n = r.textContent || r.innerText || "", a = new Blob([e], { type: "text/html" }), i = new Blob([n], { type: "text/plain" }), o = new ClipboardItem({ "text/html": a, "text/plain": i }); await navigator.clipboard.write([o]); } catch (e) { console.error( "Error when trying to use navigator.clipboard.write()", e ), t13 = false; } t13 ? this.textLabel = eL : this.textLabel = "Error trying to copy to clipboard!"; }, resetSettings: function() { this.autoHideTimeout = 0, this.textLabel = pv; } } }; var nL = { class: "visually-hidden" }; function aL(t13, e, r, n, a, i) { const o = u2, s = Vt, u = Hr, l = ko; return openBlock(), createBlock(l, { content: t13.textLabel, placement: "bottom", "hide-after": t13.autoHideTimeout, effect: "clipboard-tooltip", onHide: i.resetSettings }, { default: withCtx(() => [ createVNode(u, { class: normalizeClass(["copy-clipboard-button", r.theme]), size: "small", onClick: i.copyToClipboard }, { default: withCtx(() => [ createVNode(s, { color: t13.iconColor }, { default: withCtx(() => [ createVNode(o) ]), _: 1 }, 8, ["color"]), createBaseVNode("span", nL, toDisplayString(t13.textLabel), 1) ]), _: 1 }, 8, ["class", "onClick"]) ]), _: 1 }, 8, ["content", "hide-after", "onHide"]); } var BF = Ur(rL, [["render", aL], ["__scopeId", "data-v-de3b5311"]]); var iL = function(t13) { return t13 ? t13.charAt(0).toUpperCase() + t13.slice(1) : ""; }; var oL = { name: "ConnectionDialog", props: { connectionEntry: { type: Object, default: {} }, inDrawing: { type: Boolean, default: false }, connectionExist: { type: Boolean, default: false } }, data: function() { return { tooltipId: void 0 }; }, methods: { shadowDisplay: function(t13) { return this.tooltipId === t13 ? "always" : "hover"; }, capitalise: function(t13) { return iL(t13); }, handleTooltip: function(t13) { this.tooltipId = this.tooltipId === t13 ? void 0 : t13, this.$emit("featureTooltip", this.tooltipId); } } }; var Dc = (t13) => (pushScopeId("data-v-8168ee98"), t13 = t13(), popScopeId(), t13); var sL = { class: "dialog-container" }; var lL = Dc(() => createBaseVNode("span", { class: "dialog-title" }, "Finalise drawing", -1)); var uL = Dc(() => createBaseVNode("span", { class: "dialog-title" }, "Visualise connection", -1)); var cL = Dc(() => createBaseVNode("b", null, [ createBaseVNode("span", null, "Related Features") ], -1)); function dL(t13, e, r, n, a, i) { const o = Hr, s = gE, u = Qs, l = So, c = xE; return openBlock(), createElementBlock("div", sL, [ createVNode(u, null, { default: withCtx(() => [ createVNode(l, null, { default: withCtx(() => [ r.inDrawing ? (openBlock(), createBlock(u, { key: 0 }, { default: withCtx(() => [ lL, createVNode(s, null, { default: withCtx(() => [ createVNode(o, { type: "primary", plain: "", onClick: e[0] || (e[0] = (d) => t13.$emit("confirmDrawn", true)) }, { default: withCtx(() => [ createTextVNode(" Confirm ") ]), _: 1 }), createVNode(o, { type: "primary", plain: "", onClick: e[1] || (e[1] = (d) => t13.$emit("cancelDrawn", true)) }, { default: withCtx(() => [ createTextVNode(" Cancel ") ]), _: 1 }) ]), _: 1 }) ]), _: 1 })) : (openBlock(), createBlock(u, { key: 1 }, { default: withCtx(() => [ uL, createVNode(o, { type: "primary", plain: "", onClick: e[2] || (e[2] = (d) => t13.$emit("dialogDisplay", false)) }, { default: withCtx(() => [ createTextVNode(" Close ") ]), _: 1 }) ]), _: 1 })) ]), _: 1 }) ]), _: 1 }), r.connectionExist ? (openBlock(), createBlock(u, { key: 0 }, { default: withCtx(() => [ createVNode(l, null, { default: withCtx(() => [ cL, (openBlock(true), createElementBlock(Fragment, null, renderList(r.connectionEntry, (d, v) => (openBlock(), createBlock(u, { key: v }, { default: withCtx(() => [ createVNode(c, { shadow: i.shadowDisplay(v), onClick: (h6) => i.handleTooltip(v) }, { default: withCtx(() => [ createBaseVNode("span", null, toDisplayString(i.capitalise(d.label)), 1) ]), _: 2 }, 1032, ["shadow", "onClick"]) ]), _: 2 }, 1024))), 128)) ]), _: 1 }) ]), _: 1 })) : createCommentVNode("", true) ]); } var fL = Ur(oL, [["render", dL], ["__scopeId", "data-v-8168ee98"]]); var Pg = (t13, e) => { const r = t13.__vccOpts || t13; for (const [n, a] of e) r[n] = a; return r; }; var vL = ["xlink:href"]; var hL = { __name: "SvgIcon", props: { /** * The svg icon to show. */ icon: { type: String, required: true }, /** * The option to spin the icon. */ spin: { type: Boolean, default: false } }, setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { class: normalizeClass(["map-icon", { "map-icon-spin": t13.spin }]) }, [ createBaseVNode("use", { "xlink:href": `#${t13.icon}` }, null, 8, vL) ], 2)); } }; var pL = Pg(hL, [["__scopeId", "data-v-e172d5ff"]]); var Og = ` 2horpanel ? `; var Lg = ` 2vertpanel ? `; var Fg = ` 3panel ? `; var Ig = ` 4panel ? `; var Ag = ` 2horpanel ? `; var Mg = ` 2horpanel ? `; var Bg = ` 4panel ? `; var Ng = ` changeBckgd `; var $g = ` close no bk `; var Rg = ` close `; var zg = ` closeFullScreen `; var Vg = ` Comment `; var Hg = ` Connection `; var qg = ` dock `; var Kg = ` drawLine `; var Ug = ` drawPoint `; var Gg = ` drawPolygon `; var Wg = ` drawTrash `; var Yg = ` fitWindow `; var Zg = ` fullScreen `; var Xg = 'DataPortal-Icons'; var jg = ` magnifyingGlass `; var Qg = `Created by Wahyu Prihantorofrom the Noun Project`; var Jg = ` openMap `; var e0 = ` Artboard Copy 6 `; var t0 = ` permalink `; var r0 = ` play `; var n0 = ` resetZoom `; var a0 = ` singlepanel ? `; var i0 = ` tooltips ? `; var o0 = ` undock `; var s0 = ` zoomIn `; var l0 = ` zoomOut `; var u0 = (t13, e, r, n) => { const a = ["title", "desc", "defs", "style"], i = ["width", "height"], o = n || []; let s = document.createElement("div"); s.innerHTML = t13, a.map((l) => { const c = s.querySelector(l); c && c.remove(); }), i.map((l) => { s.querySelector("svg").removeAttribute(l); }), n && o.map((l) => { Object.values(s.querySelectorAll(`[${l}]`)).map((c) => { c.removeAttribute(l); }); }); const u = s.innerHTML; return s = null, u; }; var c0 = (t13) => [ // Remove XML stuffs and comments [/<\?xml[\s\S]*?>/gi, ""], [//gi, ""], [//gi, ""], // SVG XML -> HTML5 [/\<([A-Za-z]+)([^\>]*)\/\>/g, "<$1$2>"], // convert self-closing XML SVG nodes to explicitly closed HTML5 SVG nodes [/\s+/g, " "], // replace whitespace sequences with a single space [/\> \<"] // remove whitespace between tags ].reduce((e, r) => "".replace.apply(e, r), t13).trim(); var gL = true; var mL = true; var yL = ["fill"]; var Eu = Object.assign({ "/assets/icons/2horpanel.svg": Og, "/assets/icons/2vertpanel.svg": Lg, "/assets/icons/3panel.svg": Fg, "/assets/icons/4panel.svg": Ig, "/assets/icons/5panel.svg": Ag, "/assets/icons/6panel.svg": Mg, "/assets/icons/6panelVertical.svg": Bg, "/assets/icons/changeBckgd.svg": Ng, "/assets/icons/close-no-bk.svg": $g, "/assets/icons/close.svg": Rg, "/assets/icons/closeFullScreen.svg": zg, "/assets/icons/comment.svg": Vg, "/assets/icons/connection.svg": Hg, "/assets/icons/dock.svg": qg, "/assets/icons/drawLine.svg": Kg, "/assets/icons/drawPoint.svg": Ug, "/assets/icons/drawPolygon.svg": Gg, "/assets/icons/drawTrash.svg": Wg, "/assets/icons/fitWindow.svg": Yg, "/assets/icons/fullScreen.svg": Zg, "/assets/icons/help.svg": Xg, "/assets/icons/magnifyingGlass.svg": jg, "/assets/icons/noun-filter.svg": Qg, "/assets/icons/openMap.svg": Jg, "/assets/icons/pause.svg": e0, "/assets/icons/permalink.svg": t0, "/assets/icons/play.svg": r0, "/assets/icons/resetZoom.svg": n0, "/assets/icons/singlepanel.svg": a0, "/assets/icons/tooltips.svg": i0, "/assets/icons/undock.svg": o0, "/assets/icons/zoomIn.svg": s0, "/assets/icons/zoomOut.svg": l0 }); var bL = Object.keys(Eu).map((t13) => { const e = u0(Eu[t13], gL, mL, yL), r = t13.replace(/^.+\/(\w+).svg$/, "$1"); return c0(e).replace("", "symbol>"); }); bL.join(` `); var ku = Object.assign({ "/assets/icons/2horpanel.svg": Og, "/assets/icons/2vertpanel.svg": Lg, "/assets/icons/3panel.svg": Fg, "/assets/icons/4panel.svg": Ig, "/assets/icons/5panel.svg": Ag, "/assets/icons/6panel.svg": Mg, "/assets/icons/6panelVertical.svg": Bg, "/assets/icons/changeBckgd.svg": Ng, "/assets/icons/close-no-bk.svg": $g, "/assets/icons/close.svg": Rg, "/assets/icons/closeFullScreen.svg": zg, "/assets/icons/comment.svg": Vg, "/assets/icons/connection.svg": Hg, "/assets/icons/dock.svg": qg, "/assets/icons/drawLine.svg": Kg, "/assets/icons/drawPoint.svg": Ug, "/assets/icons/drawPolygon.svg": Gg, "/assets/icons/drawTrash.svg": Wg, "/assets/icons/fitWindow.svg": Yg, "/assets/icons/fullScreen.svg": Zg, "/assets/icons/help.svg": Xg, "/assets/icons/magnifyingGlass.svg": jg, "/assets/icons/noun-filter.svg": Qg, "/assets/icons/openMap.svg": Jg, "/assets/icons/pause.svg": e0, "/assets/icons/permalink.svg": t0, "/assets/icons/play.svg": r0, "/assets/icons/resetZoom.svg": n0, "/assets/icons/singlepanel.svg": a0, "/assets/icons/tooltips.svg": i0, "/assets/icons/undock.svg": o0, "/assets/icons/zoomIn.svg": s0, "/assets/icons/zoomOut.svg": l0 }); var wL = Object.keys(ku).map((t13) => { const e = u0(ku[t13]), r = t13.replace(/^.+\/(\w+).svg$/, "$1"); return c0(e).replace("", "symbol>"); }); var xL = { name: "MapSvgSpriteColor", svgContext: ku, svgSprite: wL.join(` `) // concatenate all symbols into $options.svgSprite }; var CL = ["innerHTML"]; function EL(t13, e, r, n, a, i) { return openBlock(), createElementBlock("svg", { width: "0", height: "0", style: { display: "none" }, innerHTML: t13.$options.svgSprite }, null, 8, CL); } var kL = Pg(xL, [["render", EL]]); var SL = (t13, e) => { let r, n, a, i, o, s; e.style.left = "", e.style.top = "", e.addEventListener( "mousedown", (l) => { l.preventDefault(), r = e.offsetLeft, n = e.offsetTop, a = l.clientX, i = l.clientY, e.addEventListener("mousemove", u, false), document.addEventListener( "mouseup", () => { e.removeEventListener("mousemove", u, false); }, false ); }, false ); function u(l) { l.preventDefault(), o = r - (a - l.clientX), s = n - (i - l.clientY), e.style.left = `${o}px`, e.style.top = `${s}px`; } }; var TL = { name: "DrawToolbar", components: { MapSvgIcon: pL, MapSvgSpriteColor: kL }, props: { /** * Optional * * Associated with the Connection dialog. * This is needed to display the dialog and provides the additional drag capability to the dialog. * * e.g. * :mapCanvas="{ * containerHTML: appRef, // Reference to the map canvas container. * class: '.maplibregl-canvas', // CSS selector for the map canvas. * }" */ mapCanvas: { type: Object, default: void 0 }, /** * Array of toolbar options to display. * 'Connection' requires 'LineString' is included in the toolbar options. */ toolbarOptions: { type: Array, default: [ "Edit", "Delete", "Point", "LineString", "Polygon", "Connection" ] }, /** * Optional * * To update the toolbar icons or filter the features based on the tool type. * e.g. "All tools", "Point", "LineString", "Polygon" or "None". */ drawnType: { type: String, default: "All tools" }, activeDrawTool: { required: true }, activeDrawMode: { required: true }, /** * Optional * * Associated with the Connection dialog. * This will popup a dialog if new feature is drawn and map canvas exists. */ newlyDrawnEntry: { type: Object, default: {} }, /** * Optional * * Associated with the Connection dialog. * This will add entries to the dialog. */ connectionEntry: { type: Object, default: {} }, /** * Add following to the top hoverVisibilities array to enable tooltips for each icon. * [ * { value: false, refs: 'toolbarPopover', ref: 'editPopover' }, * { value: false, refs: 'toolbarPopover', ref: 'deletePopover' }, * { value: false, refs: 'toolbarPopover', ref: 'pointPopover' }, * { value: false, refs: 'toolbarPopover', ref: 'lineStringPopover' }, * { value: false, refs: 'toolbarPopover', ref: 'polygonPopover' }, * { value: false, refs: 'toolbarPopover', ref: 'connectionPopover' }, * ] */ hoverVisibilities: { type: Array, required: true, default: [ { value: false, ref: "editPopover" }, { value: false, ref: "deletePopover" }, { value: false, ref: "pointPopover" }, { value: false, ref: "lineStringPopover" }, { value: false, ref: "polygonPopover" }, { value: false, ref: "connectionPopover" } ] } }, data: function() { return { toolbarIcons: [ { name: "Edit", active: false, disabled: false }, { name: "Delete", active: false, disabled: false }, { name: "Point", active: false, disabled: false }, { name: "LineString", active: false, disabled: false }, { name: "Polygon", active: false, disabled: false }, { name: "Connection", active: false, disabled: true } ], connectionDisplay: false, dialogPosition: { offsetX: 0, offsetY: 0, x: void 0, y: void 0 } }; }, computed: { showAllToolIcons: function() { return this.drawnType === "All tools" || this.drawnType === "None"; }, showEditModeIcon: function() { return this.toolbarOptions.includes("Edit"); }, showDeleteModeIcon: function() { return this.toolbarOptions.includes("Delete"); }, showDrawPointIcon: function() { return this.toolbarOptions.includes("Point") && (this.showAllToolIcons || this.drawnType === "Point"); }, showDrawLineStringIcon: function() { return this.toolbarOptions.includes("LineString") && (this.showAllToolIcons || this.drawnType === "LineString"); }, showDrawPolygonIcon: function() { return this.toolbarOptions.includes("Polygon") && (this.showAllToolIcons || this.drawnType === "Polygon"); }, showConnectionIcon: function() { return this.toolbarOptions.includes("Connection") && this.toolbarOptions.includes("LineString") && (this.showAllToolIcons || this.drawnType === "LineString"); }, inDrawing: function() { return this.activeDrawTool !== void 0; }, newlyDrawnExist: function() { return Object.keys(this.newlyDrawnEntry).length > 0; }, connectionExist: function() { return Object.keys(this.connectionEntry).length > 0; } }, watch: { drawnType: function() { this.disabledToolbarConnectionIcon(true); }, activeDrawMode: function(t13) { this.updateToolbarIcons(t13), t13 === "Delete" && (this.connectionDisplay = false); }, activeDrawTool: function(t13) { this.updateToolbarIcons(t13), t13 || (this.connectionDisplay = false); }, newlyDrawnExist: function(t13) { t13 && (this.connectionDisplay = true); }, connectionExist: function(t13) { this.disabledToolbarConnectionIcon(!t13), t13 || (this.connectionDisplay = false); }, connectionDisplay: function(t13) { this.activeToolbarConnectionIcon(t13), t13 ? this.dialogCssHacks() : this.$emit("featureTooltip", void 0); }, dialogPosition: { handler: function() { const t13 = this.$el.getBoundingClientRect(); this.dialogPosition.offsetX = t13.x, this.dialogPosition.offsetY = t13.y; }, deep: true, once: true } }, methods: { iconDisabled: function(t13) { return this.toolbarIcons.filter((e) => e.name === t13)[0].disabled; }, modeClickEvent: function(t13) { if (!this.iconDisabled(t13)) { const e = this.activeDrawMode === t13 ? void 0 : t13; this.$emit("clickToolbar", "mode", e); } }, toolClickEvent: function(t13) { if (!this.iconDisabled(t13)) { const e = this.activeDrawTool === t13 ? void 0 : t13; this.$emit("clickToolbar", "tool", e); } }, connectionClickEvent: function() { !this.iconDisabled("Connection") && !this.newlyDrawnExist && (this.connectionDisplay = !this.connectionDisplay); }, updateToolbarIcons: function(t13) { this.toolbarIcons.map((e) => { e.name === t13 ? e.active = true : e.active = false; }), this.toolbarIcons.filter((e) => e.name !== "Connection" && e.name !== t13).map((e) => { t13 ? e.disabled = true : e.disabled = false; }), this.toolbarCssHacks(); }, disabledToolbarConnectionIcon: function(t13) { this.toolbarIcons.filter((e) => e.name === "Connection").map((e) => { t13 ? e.disabled = true : e.disabled = false, this.activeDrawMode === "Delete" && (e.disabled = true); }), this.toolbarCssHacks(); }, activeToolbarConnectionIcon: function(t13) { this.toolbarIcons.filter((e) => e.name === "Connection").map((e) => { t13 ? e.active = true : e.active = false; }), this.toolbarCssHacks(); }, toolbarCssHacks: function() { this.$nextTick(() => { this.toolbarIcons.map((t13) => { const e = this.$el.querySelector(`.draw${t13.name}`); e && (t13.active ? e.classList.add("active") : e.classList.remove("active"), t13.disabled ? e.classList.add("disabled") : e.classList.remove("disabled")); }); }); }, dialogCssHacks: function() { this.$nextTick(() => { const t13 = this.$el.querySelector(".connection-dialog"); SL(this.mapCanvas.containerHTML, t13); let e, r; const n = this.mapCanvas.containerHTML.getBoundingClientRect(), a = t13.getBoundingClientRect(); this.dialogPosition.x > n.width / 2 ? e = this.dialogPosition.x - a.width : e = this.dialogPosition.x, this.dialogPosition.y > n.height / 2 ? r = this.dialogPosition.y - a.height : r = this.dialogPosition.y, t13.style.transform = `translate(${e - this.dialogPosition.offsetX}px, ${r - this.dialogPosition.offsetY}px)`; }); }, hoverIndex: function(t13) { return this.hoverVisibilities.findIndex((e) => e.ref === t13); }, showTooltip: function(t13) { this.$emit("showTooltip", t13); }, hideTooltip: function(t13) { this.$emit("hideTooltip", t13); }, dialogPopUpPositionHandler: function(t13) { t13.preventDefault(), this.dialogPosition.x = t13.clientX, this.dialogPosition.y = t13.clientY, this.activeDrawTool === "Point" && this.dialogCssHacks(); } }, mounted: function() { this.$nextTick(() => { this.toolbarCssHacks(), this.mapCanvas && this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).addEventListener("click", this.dialogPopUpPositionHandler, false); }); }, destroyed: function() { this.mapCanvas && this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).removeEventListener("click", this.dialogPopUpPositionHandler, false); } }; var _L = { class: "toolbar-container" }; var DL = { class: "toolbar-icons" }; function PL(t13, e, r, n, a, i) { const o = resolveComponent("map-svg-sprite-color"), s = resolveComponent("map-svg-icon"), u = tc, l = fL; return openBlock(), createElementBlock("div", _L, [ createVNode(o), createBaseVNode("div", DL, [ i.showEditModeIcon ? (openBlock(), createBlock(u, { key: 0, content: "Edit Mode", placement: "top", teleported: false, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[i.hoverIndex("editPopover")].value, ref: "editPopover" }, { reference: withCtx(() => [ createVNode(s, { icon: "comment", class: "icon-button drawEdit", onClick: e[0] || (e[0] = (c) => i.modeClickEvent("Edit")), onMouseover: e[1] || (e[1] = (c) => i.showTooltip(i.hoverIndex("editPopover"))), onMouseout: e[2] || (e[2] = (c) => i.hideTooltip(i.hoverIndex("editPopover"))) }) ]), _: 1 }, 8, ["visible"])) : createCommentVNode("", true), i.showDeleteModeIcon ? (openBlock(), createBlock(u, { key: 1, content: "Delete Mode", placement: "top", teleported: false, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[i.hoverIndex("deletePopover")].value, ref: "deletePopover" }, { reference: withCtx(() => [ createVNode(s, { icon: "drawTrash", class: "icon-button drawDelete", onClick: e[3] || (e[3] = (c) => i.modeClickEvent("Delete")), onMouseover: e[4] || (e[4] = (c) => i.showTooltip(i.hoverIndex("deletePopover"))), onMouseout: e[5] || (e[5] = (c) => i.hideTooltip(i.hoverIndex("deletePopover"))) }) ]), _: 1 }, 8, ["visible"])) : createCommentVNode("", true), i.showDrawPointIcon ? (openBlock(), createBlock(u, { key: 2, content: "Draw Point", placement: "top", teleported: false, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[i.hoverIndex("pointPopover")].value, ref: "pointPopover" }, { reference: withCtx(() => [ createVNode(s, { icon: "drawPoint", class: "icon-button drawPoint", onClick: e[6] || (e[6] = (c) => i.toolClickEvent("Point")), onMouseover: e[7] || (e[7] = (c) => i.showTooltip(i.hoverIndex("pointPopover"))), onMouseout: e[8] || (e[8] = (c) => i.hideTooltip(i.hoverIndex("pointPopover"))) }) ]), _: 1 }, 8, ["visible"])) : createCommentVNode("", true), i.showDrawLineStringIcon ? (openBlock(), createBlock(u, { key: 3, content: "Draw LineString", placement: "top", teleported: false, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[i.hoverIndex("lineStringPopover")].value, ref: "drawLinePopover" }, { reference: withCtx(() => [ createVNode(s, { icon: "drawLine", class: "icon-button drawLineString", onClick: e[9] || (e[9] = (c) => i.toolClickEvent("LineString")), onMouseover: e[10] || (e[10] = (c) => i.showTooltip(i.hoverIndex("lineStringPopover"))), onMouseout: e[11] || (e[11] = (c) => i.hideTooltip(i.hoverIndex("lineStringPopover"))) }) ]), _: 1 }, 8, ["visible"])) : createCommentVNode("", true), i.showDrawPolygonIcon ? (openBlock(), createBlock(u, { key: 4, content: "Draw Polygon", placement: "top", teleported: false, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[i.hoverIndex("polygonPopover")].value, ref: "polygonPopover" }, { reference: withCtx(() => [ createVNode(s, { icon: "drawPolygon", class: "icon-button drawPolygon", onClick: e[12] || (e[12] = (c) => i.toolClickEvent("Polygon")), onMouseover: e[13] || (e[13] = (c) => i.showTooltip(i.hoverIndex("polygonPopover"))), onMouseout: e[14] || (e[14] = (c) => i.hideTooltip(i.hoverIndex("polygonPopover"))) }) ]), _: 1 }, 8, ["visible"])) : createCommentVNode("", true), i.showConnectionIcon ? (openBlock(), createBlock(u, { key: 5, content: "Connectivity", placement: "top", teleported: false, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[i.hoverIndex("connectionPopover")].value, ref: "connectionPopover" }, { reference: withCtx(() => [ createVNode(s, { icon: "connection", class: "icon-button drawConnection", onClick: e[15] || (e[15] = (c) => i.connectionClickEvent()), onMouseover: e[16] || (e[16] = (c) => i.showTooltip(i.hoverIndex("connectionPopover"))), onMouseout: e[17] || (e[17] = (c) => i.hideTooltip(i.hoverIndex("connectionPopover"))) }) ]), _: 1 }, 8, ["visible"])) : createCommentVNode("", true) ]), r.mapCanvas ? withDirectives((openBlock(), createBlock(l, { key: 0, class: "connection-dialog", connectionEntry: r.connectionEntry, inDrawing: i.inDrawing, connectionExist: i.connectionExist, onDialogDisplay: e[18] || (e[18] = (c) => i.connectionClickEvent()), onConfirmDrawn: e[19] || (e[19] = (c) => t13.$emit("confirmDrawn", c)), onCancelDrawn: e[20] || (e[20] = (c) => t13.$emit("cancelDrawn", c)), onFeatureTooltip: e[21] || (e[21] = (c) => t13.$emit("featureTooltip", c)) }, null, 8, ["connectionEntry", "inDrawing", "connectionExist"])), [ [vShow, t13.connectionDisplay] ]) : createCommentVNode("", true) ]); } var NF = Ur(TL, [["render", PL], ["__scopeId", "data-v-6ac1a744"]]); var OL = { name: "HelpModeDialog", props: { /** * MultiFlatmapRef from multiflatmapvuer. Provide this when using with MultiFlatmap. */ multiflatmapRef: { type: Object, default: null }, /** * FlatmapRef from flatmapvuer. Provide this when using with Flatmap. */ flatmapRef: { type: Object, default: null }, /** * ScaffoldRef from scaffoldvuer. Provide this when using with Scaffold. */ scaffoldRef: { type: Object, default: null }, /** * The flag for last tooltip item. */ lastItem: { type: Boolean, default: false, required: false } }, mounted: function() { this.toggleHelpModeHighlight(true), this.toggleTooltipHighlight(); }, unmounted: function() { this.toggleHelpModeHighlight(false); }, watch: { lastItem: function(t13) { t13 && this.toggleTooltipHighlight(); } }, methods: { /** * This function will be called on clicking Next button. * * @public */ showNext: function() { this.$emit("show-next"); }, /** * This function will be called on clicking Finish button. * * @public */ finishHelpMode: function() { this.$emit("finish-help-mode"); }, /** * This function must be called on 'shown-map-tooltip' event. * * @public */ toggleTooltipPinHighlight: function() { const t13 = this.getCurrentFlatmap(); this.resetHighlightedItems(), this.$nextTick(() => { var i; const e = t13.querySelectorAll(".maplibregl-marker"), r = t13.querySelector( ".flatmap-popup-popper" ), n = ((i = r == null ? void 0 : r.style) == null ? void 0 : i.transform) || "", a = this.extractMarkerPosition(n); e.forEach((o) => { const s = o.style.transform; this.extractMarkerPosition(s) === a && o.classList.add("in-help-highlight"); }); }); }, /** * This function must be called on 'shown-tooltip' event. * * @public */ toggleTooltipHighlight: function() { this.resetHighlightedItems(), this.$nextTick(() => { document.querySelectorAll( '.el-popper:not([style*="none"])' ).forEach((e) => { const r = e.classList.contains("flatmap-popper"), n = e.classList.contains( "el-fade-in-linear-enter-active" ); (r || n) && this.toggleHighlight(e); }); }); }, toggleHighlight: function(t13) { const e = (t13 == null ? void 0 : t13.id) || "", r = document.querySelector( `[aria-describedby="${e}"]` ); r && r.classList.add("in-help-highlight"); }, resetHighlightedItems: function() { document.querySelectorAll(".in-help-highlight").forEach((e) => { e.classList.remove("in-help-highlight"); }); }, getCurrentScaffold: function() { var e; return ((e = this.scaffoldRef) == null ? void 0 : e.$el) || null; }, getCurrentMultiflatmap: function() { var e; return ((e = this.multiflatmapRef) == null ? void 0 : e.$el) || null; }, getCurrentFlatmap: function() { var r; const t13 = this.flatmapRef || ((r = this.multiflatmapRef) == null ? void 0 : r.getCurrentFlatmap()); return (t13 == null ? void 0 : t13.$el) || null; }, toggleHelpModeHighlight: function(t13) { const e = this.getCurrentMultiflatmap(), r = this.getCurrentFlatmap(), n = this.getCurrentScaffold(), a = document.querySelectorAll(".in-help-highlight"); e && (t13 ? e.classList.add("in-help") : e.classList.remove("in-help")), r && (t13 ? r.classList.add("in-help") : r.classList.remove("in-help")), n && (t13 ? n.classList.add("in-help") : n.classList.remove("in-help")), t13 || a.forEach((i) => { i.classList.remove("in-help-highlight"); }); }, /** * Temporary solution to find the position of map marker from popover */ extractMarkerPosition: function(t13) { const e = /translate\((.*?)\)/g, r = t13.match(e); return r ? r[r.length - 1].slice(10, -1) : ""; } } }; var Pc = (t13) => (pushScopeId("data-v-3efb89fb"), t13 = t13(), popScopeId(), t13); var LL = Pc(() => createBaseVNode("h4", null, "Help Mode", -1)); var FL = Pc(() => createBaseVNode("p", null, [ createTextVNode(" All caught up! "), createBaseVNode("br"), createTextVNode(" Click 'Help' to restart. ") ], -1)); var IL = Pc(() => createBaseVNode("p", null, 'Click "Next" to see the next item.', -1)); function AL(t13, e, r, n, a, i) { const o = Hr; return openBlock(), createElementBlock("div", { class: normalizeClass(["help-mode-dialog", { finish: r.lastItem }]) }, [ LL, r.lastItem ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ FL, createBaseVNode("div", null, [ createVNode(o, { class: "button", onClick: i.finishHelpMode }, { default: withCtx(() => [ createTextVNode(" Finish ") ]), _: 1 }, 8, ["onClick"]) ]) ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [ IL, createBaseVNode("div", null, [ createVNode(o, { class: "button", onClick: i.showNext }, { default: withCtx(() => [ createTextVNode(" Next ") ]), _: 1 }, 8, ["onClick"]), createVNode(o, { class: "button secondary", onClick: i.finishHelpMode }, { default: withCtx(() => [ createTextVNode(" Exit Help Mode ") ]), _: 1 }, 8, ["onClick"]) ]) ], 64)) ], 2); } var $F = Ur(OL, [["render", AL], ["__scopeId", "data-v-3efb89fb"]]); function ML(t13) { return { all: t13 = t13 || /* @__PURE__ */ new Map(), on: function(e, r) { var n = t13.get(e); n ? n.push(r) : t13.set(e, [r]); }, off: function(e, r) { var n = t13.get(e); n && (r ? n.splice(n.indexOf(r) >>> 0, 1) : t13.set(e, [])); }, emit: function(e, r) { var n = t13.get(e); n && n.slice().map(function(a) { a(r); }), (n = t13.get("*")) && n.slice().map(function(a) { a(e, r); }); } }; } var Gi = new ML(); var BL = { name: "ExternalResourceCard", props: { resources: { type: Array, default: () => [] } }, data: function() { return { pubmeds: [], pubmedIds: [], ElIconNotebook: shallowRef(C2) }; }, methods: { capitalise: function(t13) { return t13.charAt(0).toUpperCase() + t13.slice(1); }, openUrl: function(t13) { Gi.emit("open-pubmed-url", t13), window.open(t13, "_blank"); } } }; var NL = { class: "resource-container" }; function $L(t13, e, r, n, a, i) { const o = Hr; return openBlock(), createElementBlock("div", NL, [ (openBlock(true), createElementBlock(Fragment, null, renderList(r.resources, (s) => (openBlock(), createElementBlock("div", { key: s.id, class: "resource" }, [ s.id === "pubmed" ? (openBlock(), createBlock(o, { key: 0, class: "button", id: "open-pubmed-button", icon: t13.ElIconNotebook, onClick: (u) => i.openUrl(s.url) }, { default: withCtx(() => [ createTextVNode(" Open publications in PubMed ") ]), _: 2 }, 1032, ["icon", "onClick"])) : createCommentVNode("", true) ]))), 128)) ]); } var RL = Ur(BL, [["render", $L], ["__scopeId", "data-v-4f8d8b0f"]]); var zL = (t13) => t13.replace(/\w\S*/g, (e) => e.charAt(0).toUpperCase() + e.substr(1).toLowerCase()); var VL = function(t13) { return t13 ? t13.charAt(0).toUpperCase() + t13.slice(1) : ""; }; var HL = { name: "ProvenancePopup", props: { tooltipEntry: { type: Object, default: () => ({ destinations: [], origins: [], components: [], destinationsWithDatasets: [], originsWithDatasets: [], componentsWithDatasets: [], resource: void 0 }) } }, inject: ["getFeaturesAlert"], data: function() { return { controller: void 0, activeSpecies: void 0, pubmedSearchUrl: "", loading: false, showToolip: false, showDetails: false, originDescriptions: { motor: "is the location of the initial cell body of the circuit", sensory: "is the location of the initial cell body in the PNS circuit" }, componentsWithDatasets: [], uberons: [{ id: void 0, name: void 0 }] }; }, computed: { featuresAlert() { return this.getFeaturesAlert(); }, resources: function() { let t13 = []; return this.tooltipEntry && this.tooltipEntry.hyperlinks && (t13 = this.tooltipEntry.hyperlinks), t13; }, originDescription: function() { return this.tooltipEntry && this.tooltipEntry.title && this.tooltipEntry.title.toLowerCase().includes("motor") ? this.originDescriptions.motor : this.originDescriptions.sensory; }, provSpeciesDescription: function() { let t13 = "Studied in"; return this.tooltipEntry.provenanceTaxonomyLabel.forEach((e) => { t13 += ` ${e},`; }), t13 = t13.slice(0, -1), t13 += " species", t13; } }, methods: { titleCase: function(t13) { return zL(t13); }, capitalise: function(t13) { return VL(t13); }, openUrl: function(t13) { window.open(t13, "_blank"); }, openAll: function() { Gi.emit("onActionClick", { type: "Facets", labels: this.tooltipEntry.componentsWithDatasets.map((t13) => t13.name) }); }, openAxons: function() { Gi.emit("onActionClick", { type: "Facets", labels: this.tooltipEntry.destinationsWithDatasets.map((t13) => t13.name) }); }, openDendrites: function() { Gi.emit("onActionClick", { type: "Facets", labels: this.tooltipEntry.originsWithDatasets.map((t13) => t13.name) }); }, pubmedSearchUrlUpdate: function(t13) { this.pubmedSearchUrl = t13; } } }; var Ei = (t13) => (pushScopeId("data-v-ef9a0f6d"), t13 = t13(), popScopeId(), t13); var qL = { key: 0, class: "main" }; var KL = { key: 0, class: "block" }; var UL = { class: "title" }; var GL = { key: 0, class: "subtitle" }; var WL = { key: 1, class: "block" }; var YL = { class: "title" }; var ZL = { key: 2, class: "attribute-title-container" }; var XL = Ei(() => createBaseVNode("span", { class: "attribute-title" }, "Alert", -1)); var jL = { style: { "word-break": "keep-all" } }; var QL = { class: "content-container scrollbar" }; var JL = { key: 0, class: "block" }; var eF = { class: "attribute-title-container" }; var tF = Ei(() => createBaseVNode("span", { class: "attribute-title" }, "Origin", -1)); var rF = { style: { "word-break": "keep-all" } }; var nF = Ei(() => createBaseVNode("i", null, "Origin", -1)); var aF = ["origin-item-label"]; var iF = { key: 0, class: "separator" }; var oF = { key: 1, class: "block" }; var sF = Ei(() => createBaseVNode("div", { class: "attribute-title-container" }, [ createBaseVNode("div", { class: "attribute-title" }, "Components") ], -1)); var lF = ["component-item-label"]; var uF = { key: 0, class: "separator" }; var cF = { key: 2, class: "block" }; var dF = { class: "attribute-title-container" }; var fF = Ei(() => createBaseVNode("span", { class: "attribute-title" }, "Destination", -1)); var vF = Ei(() => createBaseVNode("span", { style: { "word-break": "keep-all" } }, [ createBaseVNode("i", null, "Destination"), createTextVNode(" is where the axons terminate ") ], -1)); var hF = ["destination-item-label"]; var pF = { key: 0, class: "separator" }; function gF(t13, e, r, n, a, i) { const o = D2, s = Vt, u = tc, l = Hv, c = Gs, d = Hr, v = RL, h6 = nc; return r.tooltipEntry ? withDirectives((openBlock(), createElementBlock("div", qL, [ r.tooltipEntry.title ? (openBlock(), createElementBlock("div", KL, [ createBaseVNode("div", UL, toDisplayString(i.capitalise(r.tooltipEntry.title)), 1), r.tooltipEntry.provenanceTaxonomyLabel && r.tooltipEntry.provenanceTaxonomyLabel.length > 0 ? (openBlock(), createElementBlock("div", GL, toDisplayString(i.provSpeciesDescription), 1)) : createCommentVNode("", true) ])) : (openBlock(), createElementBlock("div", WL, [ createBaseVNode("div", YL, toDisplayString(r.tooltipEntry.featureId), 1) ])), i.featuresAlert ? (openBlock(), createElementBlock("div", ZL, [ XL, createVNode(u, { width: "250", trigger: "hover", teleported: false, "popper-class": "popover-origin-help" }, { reference: withCtx(() => [ createVNode(s, { class: "info" }, { default: withCtx(() => [ createVNode(o) ]), _: 1 }) ]), default: withCtx(() => [ createBaseVNode("span", jL, toDisplayString(i.featuresAlert), 1) ]), _: 1 }) ])) : createCommentVNode("", true), withDirectives(createBaseVNode("div", { class: "hide", id: "hide-path-info", onClick: e[0] || (e[0] = (f) => t13.showDetails = false) }, [ createTextVNode(" Hide path information "), createVNode(s, null, { default: withCtx(() => [ createVNode(l) ]), _: 1 }) ], 512), [ [vShow, t13.showDetails] ]), withDirectives(createBaseVNode("div", { class: "hide", id: "show-path-info", onClick: e[1] || (e[1] = (f) => t13.showDetails = true) }, [ createTextVNode(" Show path information "), createVNode(s, null, { default: withCtx(() => [ createVNode(c) ]), _: 1 }) ], 512), [ [vShow, !t13.showDetails] ]), createVNode(Transition, { name: "slide-fade" }, { default: withCtx(() => [ withDirectives(createBaseVNode("div", QL, [ createTextVNode(toDisplayString(r.tooltipEntry.paths) + " ", 1), r.tooltipEntry.origins && r.tooltipEntry.origins.length > 0 ? (openBlock(), createElementBlock("div", JL, [ createBaseVNode("div", eF, [ tF, createVNode(u, { width: "250", trigger: "hover", teleported: false, "popper-class": "popover-origin-help" }, { reference: withCtx(() => [ createVNode(s, { class: "info" }, { default: withCtx(() => [ createVNode(o) ]), _: 1 }) ]), default: withCtx(() => [ createBaseVNode("span", rF, [ nF, createTextVNode(" " + toDisplayString(i.originDescription), 1) ]) ]), _: 1 }) ]), (openBlock(true), createElementBlock(Fragment, null, renderList(r.tooltipEntry.origins, (f, p) => (openBlock(), createElementBlock("div", { class: "attribute-content", "origin-item-label": f, key: f }, [ createTextVNode(toDisplayString(i.capitalise(f)) + " ", 1), p != r.tooltipEntry.origins.length - 1 ? (openBlock(), createElementBlock("div", iF)) : createCommentVNode("", true) ], 8, aF))), 128)), withDirectives(createVNode(d, { class: "button", id: "open-dendrites-button", onClick: i.openDendrites }, { default: withCtx(() => [ createTextVNode(" Explore origin data ") ]), _: 1 }, 8, ["onClick"]), [ [ vShow, r.tooltipEntry.originsWithDatasets && r.tooltipEntry.originsWithDatasets.length > 0 ] ]) ])) : createCommentVNode("", true), r.tooltipEntry.components && r.tooltipEntry.components.length > 0 ? (openBlock(), createElementBlock("div", oF, [ sF, (openBlock(true), createElementBlock(Fragment, null, renderList(r.tooltipEntry.components, (f, p) => (openBlock(), createElementBlock("div", { class: "attribute-content", "component-item-label": f, key: f }, [ createTextVNode(toDisplayString(i.capitalise(f)) + " ", 1), p != r.tooltipEntry.components.length - 1 ? (openBlock(), createElementBlock("div", uF)) : createCommentVNode("", true) ], 8, lF))), 128)) ])) : createCommentVNode("", true), r.tooltipEntry.destinations && r.tooltipEntry.destinations.length > 0 ? (openBlock(), createElementBlock("div", cF, [ createBaseVNode("div", dF, [ fF, createVNode(u, { width: "250", trigger: "hover", teleported: false, "popper-class": "popover-origin-help" }, { reference: withCtx(() => [ createVNode(s, { class: "info" }, { default: withCtx(() => [ createVNode(o) ]), _: 1 }) ]), default: withCtx(() => [ vF ]), _: 1 }) ]), (openBlock(true), createElementBlock(Fragment, null, renderList(r.tooltipEntry.destinations, (f, p) => (openBlock(), createElementBlock("div", { class: "attribute-content", "destination-item-label": f, key: f }, [ createTextVNode(toDisplayString(i.capitalise(f)) + " ", 1), p != r.tooltipEntry.destinations.length - 1 ? (openBlock(), createElementBlock("div", pF)) : createCommentVNode("", true) ], 8, hF))), 128)), withDirectives(createVNode(d, { class: "button", onClick: i.openAxons }, { default: withCtx(() => [ createTextVNode(" Explore destination data ") ]), _: 1 }, 8, ["onClick"]), [ [ vShow, r.tooltipEntry.destinationsWithDatasets && r.tooltipEntry.destinationsWithDatasets.length > 0 ] ]) ])) : createCommentVNode("", true), withDirectives(createVNode(d, { class: "button", onClick: i.openAll }, { default: withCtx(() => [ createTextVNode(" Search for data on components ") ]), _: 1 }, 8, ["onClick"]), [ [ vShow, r.tooltipEntry.componentsWithDatasets && r.tooltipEntry.componentsWithDatasets.length > 0 ] ]), createVNode(v, { resources: i.resources }, null, 8, ["resources"]) ], 512), [ [vShow, t13.showDetails] ]) ]), _: 1 }) ])), [ [h6, t13.loading] ]) : createCommentVNode("", true); } var mF = Ur(HL, [["render", gF], ["__scopeId", "data-v-ef9a0f6d"]]); var yF = { name: "Tooltip", props: { tooltipEntry: { type: Object }, annotationDisplay: { type: Boolean, default: false }, annotationEntry: { type: Object } }, mounted: function() { Gi.on("onActionClick", (t13) => { this.$emit("onActionClick", t13); }); } }; var bF = { class: "tooltip-container", id: "tooltip-container" }; function wF(t13, e, r, n, a, i) { const o = WS, s = mF; return openBlock(), createElementBlock("div", bF, [ r.annotationDisplay ? (openBlock(), createBlock(o, { key: 0, annotationEntry: r.annotationEntry, onAnnotation: e[0] || (e[0] = (u) => t13.$emit("annotation", u)) }, null, 8, ["annotationEntry"])) : (openBlock(), createBlock(s, { key: 1, tooltipEntry: r.tooltipEntry }, null, 8, ["tooltipEntry"])) ]); } var RF = Ur(yF, [["render", wF], ["__scopeId", "data-v-229b3988"]]); var xF = { name: "TreeControls", props: { /** * The type of map that the TreeControls is used. Either "flatmap" or "scaffold". */ mapType: { type: String, required: true }, isReady: { type: Boolean, default: true }, /** * The title of the TreeControls. */ title: { type: String }, /** * The data of the tree. */ treeData: { type: Array, default: function() { return []; } }, showColourPicker: { type: Boolean, default: false }, /** * The active node of the tree. */ active: { type: [String, Array], required: true }, /** * The hover node of the tree. */ hover: { type: [String, Array], required: true }, enableFilter: { type: Boolean, default: true } }, data: function() { return { defaultExpandedKeys: ["All"], filterText: "", myPopperClass: "hide-scaffold-colour-popup", tooltipVisible: false, tooltipLabel: "", tooltipAtBottom: false }; }, computed: { isFlatmap: function() { return this.mapType === "flatmap"; }, isScaffold: function() { return this.mapType === "scaffold"; }, nodeKey: function() { if (this.isFlatmap) return "key"; if (this.isScaffold) return "id"; }, expandedKeys: function() { if (this.isFlatmap) return this.defaultExpandedKeys; if (this.isScaffold) return []; } }, watch: { showColourPicker: { immediate: true, handler: function() { this.showColourPicker ? this.myPopperClass = "showPicker" : this.myPopperClass = "hide-scaffold-colour-popup"; } }, filterText: { handler: function(t13) { this.$refs.regionTree && this.$refs.regionTree.filter(t13); } } }, methods: { filterNode: function(t13, e) { return t13 ? e.label ? e.label.toLowerCase().includes(t13.toLowerCase()) : false : true; }, setColour: function(t13, e) { this.$emit("setColour", t13, e); }, getBackgroundStyles: function(t13) { return "colour" in t13 ? { background: t13.colour } : {}; }, nodeIsActive: function(t13) { return this.active === t13.models; }, nodeIsHover: function(t13) { return this.hover === t13.models; }, changeActiveByNode: function(t13, e = false) { this.isFlatmap ? t13.models && this.$emit("changeActive", t13.models) : this.isScaffold && (t13.isPrimitives || t13.isRegion) && this.$emit("changeActive", t13, e); }, changeHoverByNode: function(t13, e = false) { this.isFlatmap ? t13.models && this.$emit("changeHover", t13.models) : this.isScaffold && t13.isPrimitives && this.$emit("changeHover", t13, e); }, checkChanged: function(t13, e) { if (this.isFlatmap) { const r = e.checkedKeys.includes(t13.key); t13.key === "All" ? this.$emit("checkAll", r) : this.$emit("checkChanged", { key: t13.key, value: r }); } else this.isScaffold && this.$emit("checkChanged", t13, e); }, displayTooltip: function(t13, e, r) { const a = r.target.closest(".el-tree-node__content"), i = a.clientWidth, o = a.getBoundingClientRect().x, s = a.querySelector(".lastChildInItem"); let u = 0; if (s) { const c = s.getBoundingClientRect(); u = c.x + c.width - o; } const l = u > i; this.tooltipVisible = l && e, this.tooltipLabel = t13, this.tooltipAtBottom = 0.5 > r.layerY / this.$refs.treeContainer.clientHeight; } }, unmounted: function() { this.sortedPrimitiveGroups = void 0; }, mounted: function() { this.$refs.regionTree && this.$refs.regionTree.filter(this.filterText); } }; var CF = { class: "selections-container" }; var EF = { class: "title-text" }; var kF = { class: "tree-container", ref: "treeContainer" }; var SF = { class: "tooltip-text" }; var TF = ["onClick", "onMouseover", "onMouseenter"]; var _F = ["onClick", "onMouseover", "onMouseenter"]; var DF = { class: "lastChildInItem" }; var PF = { key: 0, class: "node-options" }; function OF(t13, e, r, n, a, i) { const o = So, s = Eo, u = Qs, l = tc, c = Sk, d = PS, v = nc; return openBlock(), createElementBlock("div", CF, [ r.title ? (openBlock(), createBlock(u, { key: 0 }, { default: withCtx(() => [ createVNode(o, { span: 12 }, { default: withCtx(() => [ createBaseVNode("div", EF, toDisplayString(r.title), 1) ]), _: 1 }), r.enableFilter ? (openBlock(), createBlock(o, { key: 0, span: 12 }, { default: withCtx(() => [ createBaseVNode("div", null, [ createVNode(s, { class: "tree-filter-input", modelValue: t13.filterText, "onUpdate:modelValue": e[0] || (e[0] = (h6) => t13.filterText = h6), placeholder: "Filter keyword" }, null, 8, ["modelValue"]) ]) ]), _: 1 })) : createCommentVNode("", true) ]), _: 1 })) : createCommentVNode("", true), createBaseVNode("div", kF, [ createBaseVNode("div", { class: normalizeClass(["tree-tooltip", t13.tooltipAtBottom ? "bottom" : ""]) }, [ createVNode(l, { ref: "tooltip", visible: t13.tooltipVisible && t13.tooltipLabel !== "", placement: "top", "show-arrow": false, teleported: false, trigger: "manual", "popper-class": "tree-tooltip-popper", "virtual-triggering": "", width: 260 }, { default: withCtx(() => [ createBaseVNode("div", SF, toDisplayString(t13.tooltipLabel), 1) ]), _: 1 }, 8, ["visible"]) ], 2), withDirectives((openBlock(), createBlock(d, { ref: "regionTree", "element-loading-background": "rgba(0, 0, 0, 0.3)", "show-checkbox": "", "node-key": i.nodeKey, data: r.treeData, "check-strictly": false, "expand-on-click-node": false, "render-after-expand": false, "default-expanded-keys": i.expandedKeys, onCheck: i.checkChanged, indent: 8, "filter-node-method": i.filterNode, class: normalizeClass([r.mapType === "flatmap" ? "hide_grandchildren_checkbox" : ""]) }, { default: withCtx(({ node: h6, data: f }) => [ r.mapType === "flatmap" ? (openBlock(), createElementBlock("span", { key: 0, class: normalizeClass(["region-tree-node", { activeItem: i.nodeIsActive(f), hoverItem: i.nodeIsHover(f) }]), onClick: (p) => i.changeActiveByNode(f), onMouseover: (p) => i.changeHoverByNode(f, false), onMouseenter: (p) => i.displayTooltip(h6.label, true, p), onMouseleave: e[1] || (e[1] = (p) => i.displayTooltip("", false, p)) }, [ createBaseVNode("div", { style: normalizeStyle(i.getBackgroundStyles(f)), class: "lastChildInItem" }, toDisplayString(h6.label), 5) ], 42, TF)) : r.mapType === "scaffold" ? (openBlock(), createElementBlock("span", { key: 1, class: normalizeClass(["region-tree-node", { activeItem: r.active.includes(f.id), hoverItem: r.hover.includes(f.id) }]), onClick: (p) => i.changeActiveByNode(f, true), onMouseover: (p) => i.changeHoverByNode(f, true, p), onMouseenter: (p) => i.displayTooltip(h6.label, true, p), onMouseleave: e[2] || (e[2] = (p) => i.displayTooltip("", false, p)) }, [ f.isPrimitives ? (openBlock(), createBlock(c, { key: 0, class: normalizeClass({ "show-picker": r.showColourPicker }), modelValue: f.activeColour, "onUpdate:modelValue": (p) => f.activeColour = p, size: "small", "popper-class": t13.myPopperClass, onChange: (p) => i.setColour(f, p) }, null, 8, ["class", "modelValue", "onUpdate:modelValue", "popper-class", "onChange"])) : createCommentVNode("", true), createBaseVNode("div", DF, [ createBaseVNode("span", null, toDisplayString(h6.label), 1), f.isTextureSlides ? (openBlock(), createElementBlock("span", PF, " (Texture) ")) : createCommentVNode("", true) ]) ], 42, _F)) : createCommentVNode("", true) ]), _: 1 }, 8, ["node-key", "data", "default-expanded-keys", "onCheck", "filter-node-method", "class"])), [ [v, !r.isReady] ]) ], 512) ]); } var zF = Ur(xF, [["render", OF], ["__scopeId", "data-v-3713bced"]]); // node_modules/@abi-software/scaffoldvuer/dist/scaffoldvuer.js var Qi2 = (n, e, { checkForDefaultPrevented: t13 = true } = {}) => (r) => { const s = n == null ? void 0 : n(r); if (t13 === false || !s) return e == null ? void 0 : e(r); }; var M12 = Object.defineProperty; var S12 = Object.defineProperties; var _12 = Object.getOwnPropertyDescriptors; var Gp2 = Object.getOwnPropertySymbols; var T12 = Object.prototype.hasOwnProperty; var E12 = Object.prototype.propertyIsEnumerable; var Hp2 = (n, e, t13) => e in n ? M12(n, e, { enumerable: true, configurable: true, writable: true, value: t13 }) : n[e] = t13; var A12 = (n, e) => { for (var t13 in e || (e = {})) T12.call(e, t13) && Hp2(n, t13, e[t13]); if (Gp2) for (var t13 of Gp2(e)) E12.call(e, t13) && Hp2(n, t13, e[t13]); return n; }; var C12 = (n, e) => S12(n, _12(e)); function Wp2(n, e) { var t13; const i = shallowRef(); return watchEffect(() => { i.value = n(); }, C12(A12({}, e), { flush: (t13 = void 0) != null ? t13 : "sync" })), readonly(i); } var jp2; var rn2 = typeof window < "u"; var L12 = (n) => typeof n == "string"; var h02 = () => { }; var td2 = rn2 && ((jp2 = window == null ? void 0 : window.navigator) == null ? void 0 : jp2.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent); function d0(n) { return typeof n == "function" ? n() : unref(n); } function R12(n) { return n; } function au2(n) { return getCurrentScope() ? (onScopeDispose(n), true) : false; } function P12(n, e = true) { getCurrentInstance() ? onMounted(n) : e ? n() : nextTick(n); } function ir2(n) { var e; const t13 = d0(n); return (e = t13 == null ? void 0 : t13.$el) != null ? e : t13; } var dl2 = rn2 ? window : void 0; var I12 = rn2 ? window.document : void 0; function pn2(...n) { let e, t13, i, r; if (L12(n[0]) || Array.isArray(n[0]) ? ([t13, i, r] = n, e = dl2) : [e, t13, i, r] = n, !e) return h02; Array.isArray(t13) || (t13 = [t13]), Array.isArray(i) || (i = [i]); const s = [], o = () => { s.forEach((d) => d()), s.length = 0; }, a = (d, h6, p, g) => (d.addEventListener(h6, p, g), () => d.removeEventListener(h6, p, g)), c = watch(() => [ir2(e), d0(r)], ([d, h6]) => { o(), d && s.push(...t13.flatMap((p) => i.map((g) => a(d, p, g, h6)))); }, { immediate: true, flush: "post" }), l = () => { c(), o(); }; return au2(l), l; } var $p2 = false; function O12(n, e, t13 = {}) { const { window: i = dl2, ignore: r = [], capture: s = true, detectIframe: o = false } = t13; if (!i) return; td2 && !$p2 && ($p2 = true, Array.from(i.document.body.children).forEach((p) => p.addEventListener("click", h02))); let a = true; const c = (p) => r.some((g) => { if (typeof g == "string") return Array.from(i.document.querySelectorAll(g)).some((f) => f === p.target || p.composedPath().includes(f)); { const f = ir2(g); return f && (p.target === f || p.composedPath().includes(f)); } }), d = [ pn2(i, "click", (p) => { const g = ir2(n); if (!(!g || g === p.target || p.composedPath().includes(g))) { if (p.detail === 0 && (a = !c(p)), !a) { a = true; return; } e(p); } }, { passive: true, capture: s }), pn2(i, "pointerdown", (p) => { const g = ir2(n); g && (a = !p.composedPath().includes(g) && !c(p)); }, { passive: true }), o && pn2(i, "blur", (p) => { var g; const f = ir2(n); ((g = i.document.activeElement) == null ? void 0 : g.tagName) === "IFRAME" && !(f != null && f.contains(i.document.activeElement)) && e(p); }) ].filter(Boolean); return () => d.forEach((p) => p()); } function f0(n, e = false) { const t13 = ref(), i = () => t13.value = !!n(); return i(), P12(i, e), t13; } var Zp2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; var Xp2 = "__vueuse_ssr_handlers__"; Zp2[Xp2] = Zp2[Xp2] || {}; function D12({ document: n = I12 } = {}) { if (!n) return ref("visible"); const e = ref(n.visibilityState); return pn2(n, "visibilitychange", () => { e.value = n.visibilityState; }), e; } var Yp2 = Object.getOwnPropertySymbols; var N12 = Object.prototype.hasOwnProperty; var F12 = Object.prototype.propertyIsEnumerable; var B12 = (n, e) => { var t13 = {}; for (var i in n) N12.call(n, i) && e.indexOf(i) < 0 && (t13[i] = n[i]); if (n != null && Yp2) for (var i of Yp2(n)) e.indexOf(i) < 0 && F12.call(n, i) && (t13[i] = n[i]); return t13; }; function ii2(n, e, t13 = {}) { const i = t13, { window: r = dl2 } = i, s = B12(i, ["window"]); let o; const a = f0(() => r && "ResizeObserver" in r), c = () => { o && (o.disconnect(), o = void 0); }, l = watch(() => ir2(n), (h6) => { c(), a.value && r && h6 && (o = new ResizeObserver(e), o.observe(h6, s)); }, { immediate: true, flush: "post" }), d = () => { c(), l(); }; return au2(d), { isSupported: a, stop: d }; } var Jp2 = Object.getOwnPropertySymbols; var z12 = Object.prototype.hasOwnProperty; var U12 = Object.prototype.propertyIsEnumerable; var V12 = (n, e) => { var t13 = {}; for (var i in n) z12.call(n, i) && e.indexOf(i) < 0 && (t13[i] = n[i]); if (n != null && Jp2) for (var i of Jp2(n)) e.indexOf(i) < 0 && U12.call(n, i) && (t13[i] = n[i]); return t13; }; function k12(n, e, t13 = {}) { const i = t13, { window: r = dl2 } = i, s = V12(i, ["window"]); let o; const a = f0(() => r && "MutationObserver" in r), c = () => { o && (o.disconnect(), o = void 0); }, l = watch(() => ir2(n), (h6) => { c(), a.value && r && h6 && (o = new MutationObserver(e), o.observe(h6, s)); }, { immediate: true }), d = () => { c(), l(); }; return au2(d), { isSupported: a, stop: d }; } var qp2; (function(n) { n.UP = "UP", n.RIGHT = "RIGHT", n.DOWN = "DOWN", n.LEFT = "LEFT", n.NONE = "NONE"; })(qp2 || (qp2 = {})); var G12 = Object.defineProperty; var Kp2 = Object.getOwnPropertySymbols; var H12 = Object.prototype.hasOwnProperty; var W12 = Object.prototype.propertyIsEnumerable; var Qp2 = (n, e, t13) => e in n ? G12(n, e, { enumerable: true, configurable: true, writable: true, value: t13 }) : n[e] = t13; var j12 = (n, e) => { for (var t13 in e || (e = {})) H12.call(e, t13) && Qp2(n, t13, e[t13]); if (Kp2) for (var t13 of Kp2(e)) W12.call(e, t13) && Qp2(n, t13, e[t13]); return n; }; var $12 = { 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] }; j12({ linear: R12 }, $12); function Z12({ window: n = dl2 } = {}) { if (!n) return ref(false); const e = ref(n.document.hasFocus()); return pn2(n, "blur", () => { e.value = false; }), pn2(n, "focus", () => { e.value = true; }), e; } var X12 = () => rn2 && /firefox/i.test(window.navigator.userAgent); Object.freeze({}); Object.freeze([]); var $a = () => { }; var Y12 = Object.prototype.hasOwnProperty; var em2 = (n, e) => Y12.call(n, e); var Un2 = Array.isArray; var Ln2 = (n) => typeof n == "function"; var On2 = (n) => typeof n == "string"; var Pn2 = (n) => n !== null && typeof n == "object"; var J12 = Object.prototype.toString; var q12 = (n) => J12.call(n); var ju2 = (n) => q12(n).slice(8, -1); var lf2 = (n) => { const e = /* @__PURE__ */ Object.create(null); return (t13) => e[t13] || (e[t13] = n(t13)); }; var K12 = /-(\w)/g; var Q12 = lf2( (n) => n.replace(K12, (e, t13) => t13 ? t13.toUpperCase() : "") ); var eM = /\B([A-Z])/g; var tM = lf2( (n) => n.replace(eM, "-$1").toLowerCase() ); var nM = lf2((n) => n.charAt(0).toUpperCase() + n.slice(1)); var p0 = typeof global == "object" && global && global.Object === Object && global; var iM = typeof self == "object" && self && self.Object === Object && self; var Gi2 = p0 || iM || Function("return this")(); var Bi2 = Gi2.Symbol; var m0 = Object.prototype; var rM = m0.hasOwnProperty; var sM = m0.toString; var ga2 = Bi2 ? Bi2.toStringTag : void 0; function oM(n) { var e = rM.call(n, ga2), t13 = n[ga2]; try { n[ga2] = void 0; var i = true; } catch { } var r = sM.call(n); return i && (e ? n[ga2] = t13 : delete n[ga2]), r; } var aM = Object.prototype; var lM = aM.toString; function cM(n) { return lM.call(n); } var uM = "[object Null]"; var hM = "[object Undefined]"; var tm2 = Bi2 ? Bi2.toStringTag : void 0; function ta2(n) { return n == null ? n === void 0 ? hM : uM : tm2 && tm2 in Object(n) ? oM(n) : cM(n); } function Co2(n) { return n != null && typeof n == "object"; } var dM = "[object Symbol]"; function lu2(n) { return typeof n == "symbol" || Co2(n) && ta2(n) == dM; } function fM(n, e) { for (var t13 = -1, i = n == null ? 0 : n.length, r = Array(i); ++t13 < i; ) r[t13] = e(n[t13], t13, n); return r; } var xi2 = Array.isArray; var pM = 1 / 0; var nm2 = Bi2 ? Bi2.prototype : void 0; var im2 = nm2 ? nm2.toString : void 0; function g0(n) { if (typeof n == "string") return n; if (xi2(n)) return fM(n, g0) + ""; if (lu2(n)) return im2 ? im2.call(n) : ""; var e = n + ""; return e == "0" && 1 / n == -pM ? "-0" : e; } var mM = /\s/; function gM(n) { for (var e = n.length; e-- && mM.test(n.charAt(e)); ) ; return e; } var vM = /^\s+/; function yM(n) { return n && n.slice(0, gM(n) + 1).replace(vM, ""); } function Wr2(n) { var e = typeof n; return n != null && (e == "object" || e == "function"); } var rm2 = NaN; var bM = /^[-+]0x[0-9a-f]+$/i; var xM = /^0b[01]+$/i; var wM = /^0o[0-7]+$/i; var MM = parseInt; function sm2(n) { if (typeof n == "number") return n; if (lu2(n)) return rm2; if (Wr2(n)) { var e = typeof n.valueOf == "function" ? n.valueOf() : n; n = Wr2(e) ? e + "" : e; } if (typeof n != "string") return n === 0 ? n : +n; n = yM(n); var t13 = xM.test(n); return t13 || wM.test(n) ? MM(n.slice(2), t13 ? 2 : 8) : bM.test(n) ? rm2 : +n; } function v02(n) { return n; } var SM = "[object AsyncFunction]"; var _M = "[object Function]"; var TM = "[object GeneratorFunction]"; var EM = "[object Proxy]"; function y0(n) { if (!Wr2(n)) return false; var e = ta2(n); return e == _M || e == TM || e == SM || e == EM; } var $u2 = Gi2["__core-js_shared__"]; var om2 = function() { var n = /[^.]+$/.exec($u2 && $u2.keys && $u2.keys.IE_PROTO || ""); return n ? "Symbol(src)_1." + n : ""; }(); function AM(n) { return !!om2 && om2 in n; } var CM = Function.prototype; var LM = CM.toString; function Vs2(n) { if (n != null) { try { return LM.call(n); } catch { } try { return n + ""; } catch { } } return ""; } var RM = /[\\^$.*+?()[\]{}|]/g; var PM = /^\[object .+?Constructor\]$/; var IM = Function.prototype; var OM = Object.prototype; var DM = IM.toString; var NM = OM.hasOwnProperty; var FM = RegExp( "^" + DM.call(NM).replace(RM, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); function BM(n) { if (!Wr2(n) || AM(n)) return false; var e = y0(n) ? FM : PM; return e.test(Vs2(n)); } function zM(n, e) { return n == null ? void 0 : n[e]; } function ks2(n, e) { var t13 = zM(n, e); return BM(t13) ? t13 : void 0; } var nd2 = ks2(Gi2, "WeakMap"); function UM(n, e, t13) { switch (t13.length) { case 0: return n.call(e); case 1: return n.call(e, t13[0]); case 2: return n.call(e, t13[0], t13[1]); case 3: return n.call(e, t13[0], t13[1], t13[2]); } return n.apply(e, t13); } var VM = 800; var kM = 16; var GM = Date.now; function HM(n) { var e = 0, t13 = 0; return function() { var i = GM(), r = kM - (i - t13); if (t13 = i, r > 0) { if (++e >= VM) return arguments[0]; } else e = 0; return n.apply(void 0, arguments); }; } function WM(n) { return function() { return n; }; } var Hc2 = function() { try { var n = ks2(Object, "defineProperty"); return n({}, "", {}), n; } catch { } }(); var jM = Hc2 ? function(n, e) { return Hc2(n, "toString", { configurable: true, enumerable: false, value: WM(e), writable: true }); } : v02; var $M = HM(jM); function ZM(n, e, t13, i) { n.length; for (var r = t13 + 1; r--; ) if (e(n[r], r, n)) return r; return -1; } var XM = 9007199254740991; var YM = /^(?:0|[1-9]\d*)$/; function cf2(n, e) { var t13 = typeof n; return e = e ?? XM, !!e && (t13 == "number" || t13 != "symbol" && YM.test(n)) && n > -1 && n % 1 == 0 && n < e; } function JM(n, e, t13) { e == "__proto__" && Hc2 ? Hc2(n, e, { configurable: true, enumerable: true, value: t13, writable: true }) : n[e] = t13; } function uf2(n, e) { return n === e || n !== n && e !== e; } var qM = Object.prototype; var KM = qM.hasOwnProperty; function QM(n, e, t13) { var i = n[e]; (!(KM.call(n, e) && uf2(i, t13)) || t13 === void 0 && !(e in n)) && JM(n, e, t13); } var am2 = Math.max; function eS2(n, e, t13) { return e = am2(e === void 0 ? n.length - 1 : e, 0), function() { for (var i = arguments, r = -1, s = am2(i.length - e, 0), o = Array(s); ++r < s; ) o[r] = i[e + r]; r = -1; for (var a = Array(e + 1); ++r < e; ) a[r] = i[r]; return a[e] = t13(o), UM(n, this, a); }; } var tS2 = 9007199254740991; function hf2(n) { return typeof n == "number" && n > -1 && n % 1 == 0 && n <= tS2; } function nS2(n) { return n != null && hf2(n.length) && !y0(n); } var iS2 = Object.prototype; function rS2(n) { var e = n && n.constructor, t13 = typeof e == "function" && e.prototype || iS2; return n === t13; } function sS2(n, e) { for (var t13 = -1, i = Array(n); ++t13 < n; ) i[t13] = e(t13); return i; } var oS2 = "[object Arguments]"; function lm2(n) { return Co2(n) && ta2(n) == oS2; } var b0 = Object.prototype; var aS2 = b0.hasOwnProperty; var lS2 = b0.propertyIsEnumerable; var df2 = lm2(/* @__PURE__ */ function() { return arguments; }()) ? lm2 : function(n) { return Co2(n) && aS2.call(n, "callee") && !lS2.call(n, "callee"); }; function cS2() { return false; } var x0 = typeof exports == "object" && exports && !exports.nodeType && exports; var cm2 = x0 && typeof module == "object" && module && !module.nodeType && module; var uS2 = cm2 && cm2.exports === x0; var um2 = uS2 ? Gi2.Buffer : void 0; var hS2 = um2 ? um2.isBuffer : void 0; var id2 = hS2 || cS2; var dS2 = "[object Arguments]"; var fS2 = "[object Array]"; var pS2 = "[object Boolean]"; var mS2 = "[object Date]"; var gS2 = "[object Error]"; var vS2 = "[object Function]"; var yS2 = "[object Map]"; var bS2 = "[object Number]"; var xS2 = "[object Object]"; var wS2 = "[object RegExp]"; var MS2 = "[object Set]"; var SS2 = "[object String]"; var _S2 = "[object WeakMap]"; var TS2 = "[object ArrayBuffer]"; var ES2 = "[object DataView]"; var AS2 = "[object Float32Array]"; var CS2 = "[object Float64Array]"; var LS2 = "[object Int8Array]"; var RS2 = "[object Int16Array]"; var PS2 = "[object Int32Array]"; var IS2 = "[object Uint8Array]"; var OS2 = "[object Uint8ClampedArray]"; var DS2 = "[object Uint16Array]"; var NS2 = "[object Uint32Array]"; var Pt = {}; Pt[AS2] = Pt[CS2] = Pt[LS2] = Pt[RS2] = Pt[PS2] = Pt[IS2] = Pt[OS2] = Pt[DS2] = Pt[NS2] = true; Pt[dS2] = Pt[fS2] = Pt[TS2] = Pt[pS2] = Pt[ES2] = Pt[mS2] = Pt[gS2] = Pt[vS2] = Pt[yS2] = Pt[bS2] = Pt[xS2] = Pt[wS2] = Pt[MS2] = Pt[SS2] = Pt[_S2] = false; function FS2(n) { return Co2(n) && hf2(n.length) && !!Pt[ta2(n)]; } function BS2(n) { return function(e) { return n(e); }; } var w0 = typeof exports == "object" && exports && !exports.nodeType && exports; var Ba2 = w0 && typeof module == "object" && module && !module.nodeType && module; var zS2 = Ba2 && Ba2.exports === w0; var Zu2 = zS2 && p0.process; var hm2 = function() { try { var n = Ba2 && Ba2.require && Ba2.require("util").types; return n || Zu2 && Zu2.binding && Zu2.binding("util"); } catch { } }(); var dm2 = hm2 && hm2.isTypedArray; var M02 = dm2 ? BS2(dm2) : FS2; var US2 = Object.prototype; var VS2 = US2.hasOwnProperty; function kS2(n, e) { var t13 = xi2(n), i = !t13 && df2(n), r = !t13 && !i && id2(n), s = !t13 && !i && !r && M02(n), o = t13 || i || r || s, a = o ? sS2(n.length, String) : [], c = a.length; for (var l in n) VS2.call(n, l) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode. (l == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. r && (l == "offset" || l == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. s && (l == "buffer" || l == "byteLength" || l == "byteOffset") || // Skip index properties. cf2(l, c))) && a.push(l); return a; } function GS2(n, e) { return function(t13) { return n(e(t13)); }; } var HS2 = GS2(Object.keys, Object); var WS2 = Object.prototype; var jS2 = WS2.hasOwnProperty; function $S2(n) { if (!rS2(n)) return HS2(n); var e = []; for (var t13 in Object(n)) jS2.call(n, t13) && t13 != "constructor" && e.push(t13); return e; } function S0(n) { return nS2(n) ? kS2(n) : $S2(n); } var ZS2 = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/; var XS2 = /^\w*$/; function ff2(n, e) { if (xi2(n)) return false; var t13 = typeof n; return t13 == "number" || t13 == "symbol" || t13 == "boolean" || n == null || lu2(n) ? true : XS2.test(n) || !ZS2.test(n) || e != null && n in Object(e); } var Za2 = ks2(Object, "create"); function YS2() { this.__data__ = Za2 ? Za2(null) : {}, this.size = 0; } function JS2(n) { var e = this.has(n) && delete this.__data__[n]; return this.size -= e ? 1 : 0, e; } var qS2 = "__lodash_hash_undefined__"; var KS2 = Object.prototype; var QS2 = KS2.hasOwnProperty; function e_2(n) { var e = this.__data__; if (Za2) { var t13 = e[n]; return t13 === qS2 ? void 0 : t13; } return QS2.call(e, n) ? e[n] : void 0; } var t_2 = Object.prototype; var n_2 = t_2.hasOwnProperty; function i_2(n) { var e = this.__data__; return Za2 ? e[n] !== void 0 : n_2.call(e, n); } var r_2 = "__lodash_hash_undefined__"; function s_2(n, e) { var t13 = this.__data__; return this.size += this.has(n) ? 0 : 1, t13[n] = Za2 && e === void 0 ? r_2 : e, this; } function Rs2(n) { var e = -1, t13 = n == null ? 0 : n.length; for (this.clear(); ++e < t13; ) { var i = n[e]; this.set(i[0], i[1]); } } Rs2.prototype.clear = YS2; Rs2.prototype.delete = JS2; Rs2.prototype.get = e_2; Rs2.prototype.has = i_2; Rs2.prototype.set = s_2; function o_2() { this.__data__ = [], this.size = 0; } function cu2(n, e) { for (var t13 = n.length; t13--; ) if (uf2(n[t13][0], e)) return t13; return -1; } var a_2 = Array.prototype; var l_2 = a_2.splice; function c_2(n) { var e = this.__data__, t13 = cu2(e, n); if (t13 < 0) return false; var i = e.length - 1; return t13 == i ? e.pop() : l_2.call(e, t13, 1), --this.size, true; } function u_2(n) { var e = this.__data__, t13 = cu2(e, n); return t13 < 0 ? void 0 : e[t13][1]; } function h_2(n) { return cu2(this.__data__, n) > -1; } function d_2(n, e) { var t13 = this.__data__, i = cu2(t13, n); return i < 0 ? (++this.size, t13.push([n, e])) : t13[i][1] = e, this; } function pr2(n) { var e = -1, t13 = n == null ? 0 : n.length; for (this.clear(); ++e < t13; ) { var i = n[e]; this.set(i[0], i[1]); } } pr2.prototype.clear = o_2; pr2.prototype.delete = c_2; pr2.prototype.get = u_2; pr2.prototype.has = h_2; pr2.prototype.set = d_2; var Xa = ks2(Gi2, "Map"); function f_2() { this.size = 0, this.__data__ = { hash: new Rs2(), map: new (Xa || pr2)(), string: new Rs2() }; } function p_2(n) { var e = typeof n; return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? n !== "__proto__" : n === null; } function uu2(n, e) { var t13 = n.__data__; return p_2(e) ? t13[typeof e == "string" ? "string" : "hash"] : t13.map; } function m_2(n) { var e = uu2(this, n).delete(n); return this.size -= e ? 1 : 0, e; } function g_2(n) { return uu2(this, n).get(n); } function v_2(n) { return uu2(this, n).has(n); } function y_2(n, e) { var t13 = uu2(this, n), i = t13.size; return t13.set(n, e), this.size += t13.size == i ? 0 : 1, this; } function mr2(n) { var e = -1, t13 = n == null ? 0 : n.length; for (this.clear(); ++e < t13; ) { var i = n[e]; this.set(i[0], i[1]); } } mr2.prototype.clear = f_2; mr2.prototype.delete = m_2; mr2.prototype.get = g_2; mr2.prototype.has = v_2; mr2.prototype.set = y_2; var b_2 = "Expected a function"; function pf2(n, e) { if (typeof n != "function" || e != null && typeof e != "function") throw new TypeError(b_2); var t13 = function() { var i = arguments, r = e ? e.apply(this, i) : i[0], s = t13.cache; if (s.has(r)) return s.get(r); var o = n.apply(this, i); return t13.cache = s.set(r, o) || s, o; }; return t13.cache = new (pf2.Cache || mr2)(), t13; } pf2.Cache = mr2; var x_2 = 500; function w_2(n) { var e = pf2(n, function(i) { return t13.size === x_2 && t13.clear(), i; }), t13 = e.cache; return e; } var M_2 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; var S_2 = /\\(\\)?/g; var __2 = w_2(function(n) { var e = []; return n.charCodeAt(0) === 46 && e.push(""), n.replace(M_2, function(t13, i, r, s) { e.push(r ? s.replace(S_2, "$1") : i || t13); }), e; }); function T_2(n) { return n == null ? "" : g0(n); } function hu2(n, e) { return xi2(n) ? n : ff2(n, e) ? [n] : __2(T_2(n)); } var E_2 = 1 / 0; function fl2(n) { if (typeof n == "string" || lu2(n)) return n; var e = n + ""; return e == "0" && 1 / n == -E_2 ? "-0" : e; } function mf2(n, e) { e = hu2(e, n); for (var t13 = 0, i = e.length; n != null && t13 < i; ) n = n[fl2(e[t13++])]; return t13 && t13 == i ? n : void 0; } function er(n, e, t13) { var i = n == null ? void 0 : mf2(n, e); return i === void 0 ? t13 : i; } function _0(n, e) { for (var t13 = -1, i = e.length, r = n.length; ++t13 < i; ) n[r + t13] = e[t13]; return n; } var fm2 = Bi2 ? Bi2.isConcatSpreadable : void 0; function A_2(n) { return xi2(n) || df2(n) || !!(fm2 && n && n[fm2]); } function C_2(n, e, t13, i, r) { var s = -1, o = n.length; for (t13 || (t13 = A_2), r || (r = []); ++s < o; ) { var a = n[s]; t13(a) ? _0(r, a) : r[r.length] = a; } return r; } function L_2(n) { var e = n == null ? 0 : n.length; return e ? C_2(n) : []; } function R_2(n) { return $M(eS2(n, void 0, L_2), n + ""); } function Ri2() { if (!arguments.length) return []; var n = arguments[0]; return xi2(n) ? n : [n]; } function P_2() { this.__data__ = new pr2(), this.size = 0; } function I_2(n) { var e = this.__data__, t13 = e.delete(n); return this.size = e.size, t13; } function O_2(n) { return this.__data__.get(n); } function D_2(n) { return this.__data__.has(n); } var N_2 = 200; function F_2(n, e) { var t13 = this.__data__; if (t13 instanceof pr2) { var i = t13.__data__; if (!Xa || i.length < N_2 - 1) return i.push([n, e]), this.size = ++t13.size, this; t13 = this.__data__ = new mr2(i); } return t13.set(n, e), this.size = t13.size, this; } function rr2(n) { var e = this.__data__ = new pr2(n); this.size = e.size; } rr2.prototype.clear = P_2; rr2.prototype.delete = I_2; rr2.prototype.get = O_2; rr2.prototype.has = D_2; rr2.prototype.set = F_2; function B_2(n, e) { for (var t13 = -1, i = n == null ? 0 : n.length, r = 0, s = []; ++t13 < i; ) { var o = n[t13]; e(o, t13, n) && (s[r++] = o); } return s; } function z_2() { return []; } var U_2 = Object.prototype; var V_2 = U_2.propertyIsEnumerable; var pm2 = Object.getOwnPropertySymbols; var k_2 = pm2 ? function(n) { return n == null ? [] : (n = Object(n), B_2(pm2(n), function(e) { return V_2.call(n, e); })); } : z_2; function G_2(n, e, t13) { var i = e(n); return xi2(n) ? i : _0(i, t13(n)); } function mm2(n) { return G_2(n, S0, k_2); } var rd2 = ks2(Gi2, "DataView"); var sd2 = ks2(Gi2, "Promise"); var od2 = ks2(Gi2, "Set"); var gm2 = "[object Map]"; var H_2 = "[object Object]"; var vm2 = "[object Promise]"; var ym2 = "[object Set]"; var bm2 = "[object WeakMap]"; var xm2 = "[object DataView]"; var W_2 = Vs2(rd2); var j_2 = Vs2(Xa); var $_2 = Vs2(sd2); var Z_2 = Vs2(od2); var X_2 = Vs2(nd2); var Nr2 = ta2; (rd2 && Nr2(new rd2(new ArrayBuffer(1))) != xm2 || Xa && Nr2(new Xa()) != gm2 || sd2 && Nr2(sd2.resolve()) != vm2 || od2 && Nr2(new od2()) != ym2 || nd2 && Nr2(new nd2()) != bm2) && (Nr2 = function(n) { var e = ta2(n), t13 = e == H_2 ? n.constructor : void 0, i = t13 ? Vs2(t13) : ""; if (i) switch (i) { case W_2: return xm2; case j_2: return gm2; case $_2: return vm2; case Z_2: return ym2; case X_2: return bm2; } return e; }); var wm2 = Gi2.Uint8Array; var Y_2 = "__lodash_hash_undefined__"; function J_2(n) { return this.__data__.set(n, Y_2), this; } function q_2(n) { return this.__data__.has(n); } function Wc2(n) { var e = -1, t13 = n == null ? 0 : n.length; for (this.__data__ = new mr2(); ++e < t13; ) this.add(n[e]); } Wc2.prototype.add = Wc2.prototype.push = J_2; Wc2.prototype.has = q_2; function K_2(n, e) { for (var t13 = -1, i = n == null ? 0 : n.length; ++t13 < i; ) if (e(n[t13], t13, n)) return true; return false; } function Q_2(n, e) { return n.has(e); } var eT2 = 1; var tT2 = 2; function T0(n, e, t13, i, r, s) { var o = t13 & eT2, a = n.length, c = e.length; if (a != c && !(o && c > a)) return false; var l = s.get(n), d = s.get(e); if (l && d) return l == e && d == n; var h6 = -1, p = true, g = t13 & tT2 ? new Wc2() : void 0; for (s.set(n, e), s.set(e, n); ++h6 < a; ) { var f = n[h6], u = e[h6]; if (i) var y = o ? i(u, f, h6, e, n, s) : i(f, u, h6, n, e, s); if (y !== void 0) { if (y) continue; p = false; break; } if (g) { if (!K_2(e, function(v, m) { if (!Q_2(g, m) && (f === v || r(f, v, t13, i, s))) return g.push(m); })) { p = false; break; } } else if (!(f === u || r(f, u, t13, i, s))) { p = false; break; } } return s.delete(n), s.delete(e), p; } function nT2(n) { var e = -1, t13 = Array(n.size); return n.forEach(function(i, r) { t13[++e] = [r, i]; }), t13; } function iT2(n) { var e = -1, t13 = Array(n.size); return n.forEach(function(i) { t13[++e] = i; }), t13; } var rT2 = 1; var sT2 = 2; var oT2 = "[object Boolean]"; var aT2 = "[object Date]"; var lT2 = "[object Error]"; var cT2 = "[object Map]"; var uT2 = "[object Number]"; var hT2 = "[object RegExp]"; var dT2 = "[object Set]"; var fT2 = "[object String]"; var pT2 = "[object Symbol]"; var mT2 = "[object ArrayBuffer]"; var gT2 = "[object DataView]"; var Mm2 = Bi2 ? Bi2.prototype : void 0; var Xu2 = Mm2 ? Mm2.valueOf : void 0; function vT2(n, e, t13, i, r, s, o) { switch (t13) { case gT2: if (n.byteLength != e.byteLength || n.byteOffset != e.byteOffset) return false; n = n.buffer, e = e.buffer; case mT2: return !(n.byteLength != e.byteLength || !s(new wm2(n), new wm2(e))); case oT2: case aT2: case uT2: return uf2(+n, +e); case lT2: return n.name == e.name && n.message == e.message; case hT2: case fT2: return n == e + ""; case cT2: var a = nT2; case dT2: var c = i & rT2; if (a || (a = iT2), n.size != e.size && !c) return false; var l = o.get(n); if (l) return l == e; i |= sT2, o.set(n, e); var d = T0(a(n), a(e), i, r, s, o); return o.delete(n), d; case pT2: if (Xu2) return Xu2.call(n) == Xu2.call(e); } return false; } var yT2 = 1; var bT2 = Object.prototype; var xT2 = bT2.hasOwnProperty; function wT2(n, e, t13, i, r, s) { var o = t13 & yT2, a = mm2(n), c = a.length, l = mm2(e), d = l.length; if (c != d && !o) return false; for (var h6 = c; h6--; ) { var p = a[h6]; if (!(o ? p in e : xT2.call(e, p))) return false; } var g = s.get(n), f = s.get(e); if (g && f) return g == e && f == n; var u = true; s.set(n, e), s.set(e, n); for (var y = o; ++h6 < c; ) { p = a[h6]; var v = n[p], m = e[p]; if (i) var w = o ? i(m, v, p, e, n, s) : i(v, m, p, n, e, s); if (!(w === void 0 ? v === m || r(v, m, t13, i, s) : w)) { u = false; break; } y || (y = p == "constructor"); } if (u && !y) { var S = n.constructor, T = e.constructor; S != T && "constructor" in n && "constructor" in e && !(typeof S == "function" && S instanceof S && typeof T == "function" && T instanceof T) && (u = false); } return s.delete(n), s.delete(e), u; } var MT2 = 1; var Sm2 = "[object Arguments]"; var _m2 = "[object Array]"; var Nl2 = "[object Object]"; var ST2 = Object.prototype; var Tm2 = ST2.hasOwnProperty; function _T2(n, e, t13, i, r, s) { var o = xi2(n), a = xi2(e), c = o ? _m2 : Nr2(n), l = a ? _m2 : Nr2(e); c = c == Sm2 ? Nl2 : c, l = l == Sm2 ? Nl2 : l; var d = c == Nl2, h6 = l == Nl2, p = c == l; if (p && id2(n)) { if (!id2(e)) return false; o = true, d = false; } if (p && !d) return s || (s = new rr2()), o || M02(n) ? T0(n, e, t13, i, r, s) : vT2(n, e, c, t13, i, r, s); if (!(t13 & MT2)) { var g = d && Tm2.call(n, "__wrapped__"), f = h6 && Tm2.call(e, "__wrapped__"); if (g || f) { var u = g ? n.value() : n, y = f ? e.value() : e; return s || (s = new rr2()), r(u, y, t13, i, s); } } return p ? (s || (s = new rr2()), wT2(n, e, t13, i, r, s)) : false; } function du2(n, e, t13, i, r) { return n === e ? true : n == null || e == null || !Co2(n) && !Co2(e) ? n !== n && e !== e : _T2(n, e, t13, i, du2, r); } var TT2 = 1; var ET2 = 2; function AT2(n, e, t13, i) { var r = t13.length, s = r; if (n == null) return !s; for (n = Object(n); r--; ) { var o = t13[r]; if (o[2] ? o[1] !== n[o[0]] : !(o[0] in n)) return false; } for (; ++r < s; ) { o = t13[r]; var a = o[0], c = n[a], l = o[1]; if (o[2]) { if (c === void 0 && !(a in n)) return false; } else { var d = new rr2(), h6; if (!(h6 === void 0 ? du2(l, c, TT2 | ET2, i, d) : h6)) return false; } } return true; } function E0(n) { return n === n && !Wr2(n); } function CT2(n) { for (var e = S0(n), t13 = e.length; t13--; ) { var i = e[t13], r = n[i]; e[t13] = [i, r, E0(r)]; } return e; } function A02(n, e) { return function(t13) { return t13 == null ? false : t13[n] === e && (e !== void 0 || n in Object(t13)); }; } function LT2(n) { var e = CT2(n); return e.length == 1 && e[0][2] ? A02(e[0][0], e[0][1]) : function(t13) { return t13 === n || AT2(t13, n, e); }; } function RT2(n, e) { return n != null && e in Object(n); } function PT2(n, e, t13) { e = hu2(e, n); for (var i = -1, r = e.length, s = false; ++i < r; ) { var o = fl2(e[i]); if (!(s = n != null && t13(n, o))) break; n = n[o]; } return s || ++i != r ? s : (r = n == null ? 0 : n.length, !!r && hf2(r) && cf2(o, r) && (xi2(n) || df2(n))); } function C0(n, e) { return n != null && PT2(n, e, RT2); } var IT2 = 1; var OT2 = 2; function DT2(n, e) { return ff2(n) && E0(e) ? A02(fl2(n), e) : function(t13) { var i = er(t13, n); return i === void 0 && i === e ? C0(t13, n) : du2(e, i, IT2 | OT2); }; } function NT2(n) { return function(e) { return e == null ? void 0 : e[n]; }; } function FT2(n) { return function(e) { return mf2(e, n); }; } function BT2(n) { return ff2(n) ? NT2(fl2(n)) : FT2(n); } function zT2(n) { return typeof n == "function" ? n : n == null ? v02 : typeof n == "object" ? xi2(n) ? DT2(n[0], n[1]) : LT2(n) : BT2(n); } var Yu2 = function() { return Gi2.Date.now(); }; var UT2 = "Expected a function"; var VT2 = Math.max; var kT2 = Math.min; function ad2(n, e, t13) { var i, r, s, o, a, c, l = 0, d = false, h6 = false, p = true; if (typeof n != "function") throw new TypeError(UT2); e = sm2(e) || 0, Wr2(t13) && (d = !!t13.leading, h6 = "maxWait" in t13, s = h6 ? VT2(sm2(t13.maxWait) || 0, e) : s, p = "trailing" in t13 ? !!t13.trailing : p); function g(M) { var x = i, _ = r; return i = r = void 0, l = M, o = n.apply(_, x), o; } function f(M) { return l = M, a = setTimeout(v, e), d ? g(M) : o; } function u(M) { var x = M - c, _ = M - l, E = e - x; return h6 ? kT2(E, s - _) : E; } function y(M) { var x = M - c, _ = M - l; return c === void 0 || x >= e || x < 0 || h6 && _ >= s; } function v() { var M = Yu2(); if (y(M)) return m(M); a = setTimeout(v, u(M)); } function m(M) { return a = void 0, p && i ? g(M) : (i = r = void 0, o); } function w() { a !== void 0 && clearTimeout(a), l = 0, i = c = r = a = void 0; } function S() { return a === void 0 ? o : m(Yu2()); } function T() { var M = Yu2(), x = y(M); if (i = arguments, r = this, c = M, x) { if (a === void 0) return f(c); if (h6) return clearTimeout(a), a = setTimeout(v, e), g(c); } return a === void 0 && (a = setTimeout(v, e)), o; } return T.cancel = w, T.flush = S, T; } function GT2(n, e, t13) { var i = n == null ? 0 : n.length; if (!i) return -1; var r = i - 1; return ZM(n, zT2(e), r); } function jc2(n) { for (var e = -1, t13 = n == null ? 0 : n.length, i = {}; ++e < t13; ) { var r = n[e]; i[r[0]] = r[1]; } return i; } function ld2(n, e) { return du2(n, e); } function sr2(n) { return n == null; } function HT2(n) { return n === void 0; } function WT2(n, e, t13, i) { if (!Wr2(n)) return n; e = hu2(e, n); for (var r = -1, s = e.length, o = s - 1, a = n; a != null && ++r < s; ) { var c = fl2(e[r]), l = t13; if (c === "__proto__" || c === "constructor" || c === "prototype") return n; if (r != o) { var d = a[c]; l = void 0, l === void 0 && (l = Wr2(d) ? d : cf2(e[r + 1]) ? [] : {}); } QM(a, c, l), a = a[c]; } return n; } function jT2(n, e, t13) { for (var i = -1, r = e.length, s = {}; ++i < r; ) { var o = e[i], a = mf2(n, o); t13(a, o) && WT2(s, hu2(o, n), a); } return s; } function $T2(n, e) { return jT2(n, e, function(t13, i) { return C0(n, i); }); } var ZT2 = R_2(function(n, e) { return n == null ? {} : $T2(n, e); }); var yi2 = (n) => n === void 0; var gf2 = (n) => typeof n == "boolean"; var St = (n) => typeof n == "number"; var Ms2 = (n) => typeof Element > "u" ? false : n instanceof Element; var XT2 = (n) => On2(n) ? !Number.isNaN(Number(n)) : false; var YT2 = (n = "") => n.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); var Br2 = (n) => nM(n); var Em2 = (n) => Object.keys(n); var L0 = class extends Error { constructor(e) { super(e), this.name = "ElementPlusError"; } }; function na2(n, e) { throw new L0(`[${n}] ${e}`); } function en2(n, e) { if (true) { const t13 = On2(n) ? new L0(`[${n}] ${e}`) : n; console.warn(t13); } } var JT2 = "utils/dom/style"; var R02 = (n = "") => n.split(" ").filter((e) => !!e.trim()); var Am2 = (n, e) => { !n || !e.trim() || n.classList.add(...R02(e)); }; var $c2 = (n, e) => { !n || !e.trim() || n.classList.remove(...R02(e)); }; var va2 = (n, e) => { var t13; if (!rn2 || !n || !e) return ""; let i = Q12(e); i === "float" && (i = "cssFloat"); try { const r = n.style[i]; if (r) return r; const s = (t13 = document.defaultView) == null ? void 0 : t13.getComputedStyle(n, ""); return s ? s[i] : ""; } catch { return n.style[i]; } }; function Zc2(n, e = "px") { if (!n) return ""; if (St(n) || XT2(n)) return `${n}${e}`; if (On2(n)) return n; en2(JT2, "binding value must be a string or number"); } function qT2(n, e) { if (!rn2) return; if (!e) { n.scrollTop = 0; return; } const t13 = []; let i = e.offsetParent; for (; i !== null && n !== i && n.contains(i); ) t13.push(i), i = i.offsetParent; const r = e.offsetTop + t13.reduce((c, l) => c + l.offsetTop, 0), s = r + e.offsetHeight, o = n.scrollTop, a = o + n.clientHeight; r < o ? n.scrollTop = r : s > a && (n.scrollTop = s - n.clientHeight); } var KT2 = defineComponent({ name: "ArrowDown", __name: "arrow-down", setup(n) { return (e, t13) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z" }) ])); } }); var vf2 = KT2; var QT2 = defineComponent({ name: "ArrowLeft", __name: "arrow-left", setup(n) { return (e, t13) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("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" }) ])); } }); var jr = QT2; var eE2 = defineComponent({ name: "ArrowRight", __name: "arrow-right", setup(n) { return (e, t13) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("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" }) ])); } }); var $r = eE2; var tE2 = defineComponent({ name: "ArrowUp", __name: "arrow-up", setup(n) { return (e, t13) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0" }) ])); } }); var nE2 = tE2; var iE2 = defineComponent({ name: "CircleCheck", __name: "circle-check", setup(n) { return (e, t13) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }), createBaseVNode("path", { fill: "currentColor", d: "M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z" }) ])); } }); var rE2 = iE2; var sE2 = defineComponent({ name: "CircleClose", __name: "circle-close", setup(n) { return (e, t13) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z" }), createBaseVNode("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }) ])); } }); var yf2 = sE2; var oE2 = defineComponent({ name: "Close", __name: "close", setup(n) { return (e, t13) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z" }) ])); } }); var cd2 = oE2; var aE2 = defineComponent({ name: "Delete", __name: "delete", setup(n) { return (e, t13) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32" }) ])); } }); var Xc2 = aE2; var lE2 = defineComponent({ name: "Hide", __name: "hide", setup(n) { return (e, t13) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z" }), createBaseVNode("path", { fill: "currentColor", d: "M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z" }) ])); } }); var cE2 = lE2; var uE2 = defineComponent({ name: "Loading", __name: "loading", setup(n) { return (e, t13) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z" }) ])); } }); var P0 = uE2; var hE2 = defineComponent({ name: "Minus", __name: "minus", setup(n) { return (e, t13) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64" }) ])); } }); var dE2 = hE2; var fE2 = defineComponent({ name: "Plus", __name: "plus", setup(n) { return (e, t13) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("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" }) ])); } }); var fu2 = fE2; var pE2 = defineComponent({ name: "View", __name: "view", setup(n) { return (e, t13) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160" }) ])); } }); var mE2 = pE2; var gE2 = defineComponent({ name: "WarningFilled", __name: "warning-filled", setup(n) { return (e, t13) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 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" }) ])); } }); var I02 = gE2; var O0 = "__epPropKey"; var Ye2 = (n) => n; var vE2 = (n) => Pn2(n) && !!n[O0]; var pu2 = (n, e) => { if (!Pn2(n) || vE2(n)) return n; const { values: t13, required: i, default: r, type: s, validator: o } = n, c = { type: s, required: !!i, validator: t13 || o ? (l) => { let d = false, h6 = []; if (t13 && (h6 = Array.from(t13), em2(n, "default") && h6.push(r), d || (d = h6.includes(l))), o && (d || (d = o(l))), !d && h6.length > 0) { const p = [...new Set(h6)].map((g) => JSON.stringify(g)).join(", "); warn(`Invalid prop: validation failed${e ? ` for prop "${e}"` : ""}. Expected one of [${p}], got value ${JSON.stringify(l)}.`); } return d; } : void 0, [O0]: true }; return em2(n, "default") && (c.default = r), c; }; var dt2 = (n) => jc2(Object.entries(n).map(([e, t13]) => [ e, pu2(t13, e) ])); var Zr2 = Ye2([ String, Object, Function ]); var D0 = { validating: P0, success: rE2, error: yf2 }; var vn2 = (n, e) => { if (n.install = (t13) => { for (const i of [n, ...Object.values(e ?? {})]) t13.component(i.name, i); }, e) for (const [t13, i] of Object.entries(e)) n[t13] = i; return n; }; var yE2 = (n, e) => (n.install = (t13) => { t13.directive(e, n); }, n); var gr = (n) => (n.install = $a, n); var Di2 = { tab: "Tab", enter: "Enter", space: "Space", left: "ArrowLeft", up: "ArrowUp", right: "ArrowRight", down: "ArrowDown", esc: "Escape", delete: "Delete", backspace: "Backspace", numpadEnter: "NumpadEnter", pageUp: "PageUp", pageDown: "PageDown", home: "Home", end: "End" }; var Dt2 = "update:modelValue"; var Qr2 = "change"; var Ss2 = "input"; var N02 = ["", "default", "small", "large"]; var Fc = (n) => { const e = Un2(n) ? n : [n], t13 = []; return e.forEach((i) => { var r; Un2(i) ? t13.push(...Fc(i)) : isVNode(i) && Un2(i.children) ? t13.push(...Fc(i.children)) : (t13.push(i), isVNode(i) && ((r = i.component) != null && r.subTree) && t13.push(...Fc(i.component.subTree))); }), t13; }; var bE2 = (n) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(n); var tr2 = (n) => n; var xE2 = ["class", "style"]; var wE2 = /^on[A-Z]/; var ME2 = (n = {}) => { const { excludeListeners: e = false, excludeKeys: t13 } = n, i = computed(() => ((t13 == null ? void 0 : t13.value) || []).concat(xE2)), r = getCurrentInstance(); return r ? computed(() => { var s; return jc2(Object.entries((s = r.proxy) == null ? void 0 : s.$attrs).filter(([o]) => !i.value.includes(o) && !(e && wE2.test(o)))); }) : (en2("use-attrs", "getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"), computed(() => ({}))); }; var SE2 = ({ from: n, replacement: e, scope: t13, version: i, ref: r, type: s = "API" }, o) => { watch(() => unref(o), (a) => { a && en2(t13, `[${s}] ${n} is about to be deprecated in version ${i}, please use ${e} instead. For more detail, please visit: ${r} `); }, { immediate: true }); }; var _E2 = { name: "en", el: { breadcrumb: { label: "Breadcrumb" }, colorpicker: { confirm: "OK", clear: "Clear", defaultLabel: "color picker", description: "current color is {color}. press enter to select a new color.", alphaLabel: "pick alpha value" }, datepicker: { now: "Now", today: "Today", cancel: "Cancel", clear: "Clear", confirm: "OK", dateTablePrompt: "Use the arrow keys and enter to select the day of the month", monthTablePrompt: "Use the arrow keys and enter to select the month", yearTablePrompt: "Use the arrow keys and enter to select the year", selectedDate: "Selected date", selectDate: "Select date", selectTime: "Select time", startDate: "Start Date", startTime: "Start Time", endDate: "End Date", endTime: "End Time", prevYear: "Previous Year", nextYear: "Next Year", prevMonth: "Previous Month", nextMonth: "Next Month", year: "", month1: "January", month2: "February", month3: "March", month4: "April", month5: "May", month6: "June", month7: "July", month8: "August", month9: "September", month10: "October", month11: "November", month12: "December", week: "week", weeks: { sun: "Sun", mon: "Mon", tue: "Tue", wed: "Wed", thu: "Thu", fri: "Fri", sat: "Sat" }, weeksFull: { sun: "Sunday", mon: "Monday", tue: "Tuesday", wed: "Wednesday", thu: "Thursday", fri: "Friday", sat: "Saturday" }, months: { jan: "Jan", feb: "Feb", mar: "Mar", apr: "Apr", may: "May", jun: "Jun", jul: "Jul", aug: "Aug", sep: "Sep", oct: "Oct", nov: "Nov", dec: "Dec" } }, inputNumber: { decrease: "decrease number", increase: "increase number" }, select: { loading: "Loading", noMatch: "No matching data", noData: "No data", placeholder: "Select" }, mention: { loading: "Loading" }, dropdown: { toggleDropdown: "Toggle Dropdown" }, cascader: { noMatch: "No matching data", loading: "Loading", placeholder: "Select", noData: "No data" }, pagination: { goto: "Go to", pagesize: "/page", total: "Total {total}", pageClassifier: "", page: "Page", prev: "Go to previous page", next: "Go to next page", currentPage: "page {pager}", prevPages: "Previous {pager} pages", nextPages: "Next {pager} pages", deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details" }, dialog: { close: "Close this dialog" }, drawer: { close: "Close this dialog" }, messagebox: { title: "Message", confirm: "OK", cancel: "Cancel", error: "Illegal input", close: "Close this dialog" }, upload: { deleteTip: "press delete to remove", delete: "Delete", preview: "Preview", continue: "Continue" }, slider: { defaultLabel: "slider between {min} and {max}", defaultRangeStartLabel: "pick start value", defaultRangeEndLabel: "pick end value" }, table: { emptyText: "No Data", confirmFilter: "Confirm", resetFilter: "Reset", clearFilter: "All", sumText: "Sum" }, tour: { next: "Next", previous: "Previous", finish: "Finish" }, tree: { emptyText: "No Data" }, transfer: { noMatch: "No matching data", noData: "No data", titles: ["List 1", "List 2"], filterPlaceholder: "Enter keyword", noCheckedFormat: "{total} items", hasCheckedFormat: "{checked}/{total} checked" }, image: { error: "FAILED" }, pageHeader: { title: "Back" }, popconfirm: { confirmButtonText: "Yes", cancelButtonText: "No" }, carousel: { leftArrow: "Carousel arrow left", rightArrow: "Carousel arrow right", indicator: "Carousel switch to index {index}" } } }; var TE2 = (n) => (e, t13) => EE2(e, t13, unref(n)); var EE2 = (n, e, t13) => er(t13, n, n).replace(/\{(\w+)\}/g, (i, r) => { var s; return `${(s = e == null ? void 0 : e[r]) != null ? s : `{${r}}`}`; }); var AE2 = (n) => { const e = computed(() => unref(n).name), t13 = isRef(n) ? n : ref(n); return { lang: e, locale: t13, t: TE2(n) }; }; var F0 = Symbol("localeContextKey"); var mu2 = (n) => { const e = n || inject(F0, ref()); return AE2(computed(() => e.value || _E2)); }; var Bc2 = "el"; var CE2 = "is-"; var ls2 = (n, e, t13, i, r) => { let s = `${n}-${e}`; return t13 && (s += `-${t13}`), i && (s += `__${i}`), r && (s += `--${r}`), s; }; var B02 = Symbol("namespaceContextKey"); var bf2 = (n) => { const e = n || (getCurrentInstance() ? inject(B02, ref(Bc2)) : ref(Bc2)); return computed(() => unref(e) || Bc2); }; var it2 = (n, e) => { const t13 = bf2(e); return { namespace: t13, b: (u = "") => ls2(t13.value, n, u, "", ""), e: (u) => u ? ls2(t13.value, n, "", u, "") : "", m: (u) => u ? ls2(t13.value, n, "", "", u) : "", be: (u, y) => u && y ? ls2(t13.value, n, u, y, "") : "", em: (u, y) => u && y ? ls2(t13.value, n, "", u, y) : "", bm: (u, y) => u && y ? ls2(t13.value, n, u, "", y) : "", bem: (u, y, v) => u && y && v ? ls2(t13.value, n, u, y, v) : "", is: (u, ...y) => { const v = y.length >= 1 ? y[0] : true; return u && v ? `${CE2}${u}` : ""; }, cssVar: (u) => { const y = {}; for (const v in u) u[v] && (y[`--${t13.value}-${v}`] = u[v]); return y; }, cssVarName: (u) => `--${t13.value}-${u}`, cssVarBlock: (u) => { const y = {}; for (const v in u) u[v] && (y[`--${t13.value}-${n}-${v}`] = u[v]); return y; }, cssVarBlockName: (u) => `--${t13.value}-${n}-${u}` }; }; var LE2 = pu2({ type: Ye2(Boolean), default: null }); var RE2 = pu2({ type: Ye2(Function) }); var PE2 = (n) => { const e = `update:${n}`, t13 = `onUpdate:${n}`, i = [e], r = { [n]: LE2, [t13]: RE2 }; return { useModelToggle: ({ indicator: o, toggleReason: a, shouldHideWhenRouteChanges: c, shouldProceed: l, onShow: d, onHide: h6 }) => { const p = getCurrentInstance(), { emit: g } = p, f = p.props, u = computed(() => Ln2(f[t13])), y = computed(() => f[n] === null), v = (x) => { o.value !== true && (o.value = true, a && (a.value = x), Ln2(d) && d(x)); }, m = (x) => { o.value !== false && (o.value = false, a && (a.value = x), Ln2(h6) && h6(x)); }, w = (x) => { if (f.disabled === true || Ln2(l) && !l()) return; const _ = u.value && rn2; _ && g(e, true), (y.value || !_) && v(x); }, S = (x) => { if (f.disabled === true || !rn2) return; const _ = u.value && rn2; _ && g(e, false), (y.value || !_) && m(x); }, T = (x) => { gf2(x) && (f.disabled && x ? u.value && g(e, false) : o.value !== x && (x ? v() : m())); }, M = () => { o.value ? S() : w(); }; return watch(() => f[n], T), c && p.appContext.config.globalProperties.$route !== void 0 && watch(() => ({ ...p.proxy.$route }), () => { c.value && o.value && S(); }), onMounted(() => { T(f[n]); }), { hide: S, show: w, toggle: M, hasUpdateHandler: u }; }, useModelToggleProps: r, useModelToggleEmits: i }; }; var z02 = (n) => { const e = getCurrentInstance(); return computed(() => { var t13, i; return (i = (t13 = e == null ? void 0 : e.proxy) == null ? void 0 : t13.$props) == null ? void 0 : i[n]; }); }; var kn = "top"; var oi2 = "bottom"; var ai2 = "right"; var Gn2 = "left"; var xf2 = "auto"; var pl2 = [kn, oi2, ai2, Gn2]; var Lo2 = "start"; var Ya2 = "end"; var IE2 = "clippingParents"; var U02 = "viewport"; var ya2 = "popper"; var OE2 = "reference"; var Cm2 = pl2.reduce(function(n, e) { return n.concat([e + "-" + Lo2, e + "-" + Ya2]); }, []); var ia = [].concat(pl2, [xf2]).reduce(function(n, e) { return n.concat([e, e + "-" + Lo2, e + "-" + Ya2]); }, []); var DE2 = "beforeRead"; var NE2 = "read"; var FE2 = "afterRead"; var BE2 = "beforeMain"; var zE2 = "main"; var UE2 = "afterMain"; var VE2 = "beforeWrite"; var kE2 = "write"; var GE2 = "afterWrite"; var HE2 = [DE2, NE2, FE2, BE2, zE2, UE2, VE2, kE2, GE2]; function zi2(n) { return n ? (n.nodeName || "").toLowerCase() : null; } function Si2(n) { if (n == null) return window; if (n.toString() !== "[object Window]") { var e = n.ownerDocument; return e && e.defaultView || window; } return n; } function Ro2(n) { var e = Si2(n).Element; return n instanceof e || n instanceof Element; } function si2(n) { var e = Si2(n).HTMLElement; return n instanceof e || n instanceof HTMLElement; } function wf2(n) { if (typeof ShadowRoot > "u") return false; var e = Si2(n).ShadowRoot; return n instanceof e || n instanceof ShadowRoot; } function WE2(n) { var e = n.state; Object.keys(e.elements).forEach(function(t13) { var i = e.styles[t13] || {}, r = e.attributes[t13] || {}, s = e.elements[t13]; !si2(s) || !zi2(s) || (Object.assign(s.style, i), Object.keys(r).forEach(function(o) { var a = r[o]; a === false ? s.removeAttribute(o) : s.setAttribute(o, a === true ? "" : a); })); }); } function jE2(n) { var e = n.state, t13 = { popper: { position: e.options.strategy, left: "0", top: "0", margin: "0" }, arrow: { position: "absolute" }, reference: {} }; return Object.assign(e.elements.popper.style, t13.popper), e.styles = t13, e.elements.arrow && Object.assign(e.elements.arrow.style, t13.arrow), function() { Object.keys(e.elements).forEach(function(i) { var r = e.elements[i], s = e.attributes[i] || {}, o = Object.keys(e.styles.hasOwnProperty(i) ? e.styles[i] : t13[i]), a = o.reduce(function(c, l) { return c[l] = "", c; }, {}); !si2(r) || !zi2(r) || (Object.assign(r.style, a), Object.keys(s).forEach(function(c) { r.removeAttribute(c); })); }); }; } var V02 = { name: "applyStyles", enabled: true, phase: "write", fn: WE2, effect: jE2, requires: ["computeStyles"] }; function Ni2(n) { return n.split("-")[0]; } var _s2 = Math.max; var Yc2 = Math.min; var Po2 = Math.round; function Io2(n, e) { e === void 0 && (e = false); var t13 = n.getBoundingClientRect(), i = 1, r = 1; if (si2(n) && e) { var s = n.offsetHeight, o = n.offsetWidth; o > 0 && (i = Po2(t13.width) / o || 1), s > 0 && (r = Po2(t13.height) / s || 1); } return { width: t13.width / i, height: t13.height / r, top: t13.top / r, right: t13.right / i, bottom: t13.bottom / r, left: t13.left / i, x: t13.left / i, y: t13.top / r }; } function Mf2(n) { var e = Io2(n), t13 = n.offsetWidth, i = n.offsetHeight; return Math.abs(e.width - t13) <= 1 && (t13 = e.width), Math.abs(e.height - i) <= 1 && (i = e.height), { x: n.offsetLeft, y: n.offsetTop, width: t13, height: i }; } function k0(n, e) { var t13 = e.getRootNode && e.getRootNode(); if (n.contains(e)) return true; if (t13 && wf2(t13)) { var i = e; do { if (i && n.isSameNode(i)) return true; i = i.parentNode || i.host; } while (i); } return false; } function ur(n) { return Si2(n).getComputedStyle(n); } function $E2(n) { return ["table", "td", "th"].indexOf(zi2(n)) >= 0; } function es2(n) { return ((Ro2(n) ? n.ownerDocument : n.document) || window.document).documentElement; } function gu2(n) { return zi2(n) === "html" ? n : n.assignedSlot || n.parentNode || (wf2(n) ? n.host : null) || es2(n); } function Lm2(n) { return !si2(n) || ur(n).position === "fixed" ? null : n.offsetParent; } function ZE2(n) { var e = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1, t13 = navigator.userAgent.indexOf("Trident") !== -1; if (t13 && si2(n)) { var i = ur(n); if (i.position === "fixed") return null; } var r = gu2(n); for (wf2(r) && (r = r.host); si2(r) && ["html", "body"].indexOf(zi2(r)) < 0; ) { var s = ur(r); if (s.transform !== "none" || s.perspective !== "none" || s.contain === "paint" || ["transform", "perspective"].indexOf(s.willChange) !== -1 || e && s.willChange === "filter" || e && s.filter && s.filter !== "none") return r; r = r.parentNode; } return null; } function ml(n) { for (var e = Si2(n), t13 = Lm2(n); t13 && $E2(t13) && ur(t13).position === "static"; ) t13 = Lm2(t13); return t13 && (zi2(t13) === "html" || zi2(t13) === "body" && ur(t13).position === "static") ? e : t13 || ZE2(n) || e; } function Sf2(n) { return ["top", "bottom"].indexOf(n) >= 0 ? "x" : "y"; } function za2(n, e, t13) { return _s2(n, Yc2(e, t13)); } function XE2(n, e, t13) { var i = za2(n, e, t13); return i > t13 ? t13 : i; } function G02() { return { top: 0, right: 0, bottom: 0, left: 0 }; } function H02(n) { return Object.assign({}, G02(), n); } function W02(n, e) { return e.reduce(function(t13, i) { return t13[i] = n, t13; }, {}); } var YE2 = function(n, e) { return n = typeof n == "function" ? n(Object.assign({}, e.rects, { placement: e.placement })) : n, H02(typeof n != "number" ? n : W02(n, pl2)); }; function JE2(n) { var e, t13 = n.state, i = n.name, r = n.options, s = t13.elements.arrow, o = t13.modifiersData.popperOffsets, a = Ni2(t13.placement), c = Sf2(a), l = [Gn2, ai2].indexOf(a) >= 0, d = l ? "height" : "width"; if (!(!s || !o)) { var h6 = YE2(r.padding, t13), p = Mf2(s), g = c === "y" ? kn : Gn2, f = c === "y" ? oi2 : ai2, u = t13.rects.reference[d] + t13.rects.reference[c] - o[c] - t13.rects.popper[d], y = o[c] - t13.rects.reference[c], v = ml(s), m = v ? c === "y" ? v.clientHeight || 0 : v.clientWidth || 0 : 0, w = u / 2 - y / 2, S = h6[g], T = m - p[d] - h6[f], M = m / 2 - p[d] / 2 + w, x = za2(S, M, T), _ = c; t13.modifiersData[i] = (e = {}, e[_] = x, e.centerOffset = x - M, e); } } function qE2(n) { var e = n.state, t13 = n.options, i = t13.element, r = i === void 0 ? "[data-popper-arrow]" : i; r != null && (typeof r == "string" && (r = e.elements.popper.querySelector(r), !r) || !k0(e.elements.popper, r) || (e.elements.arrow = r)); } var KE2 = { name: "arrow", enabled: true, phase: "main", fn: JE2, effect: qE2, requires: ["popperOffsets"], requiresIfExists: ["preventOverflow"] }; function Oo2(n) { return n.split("-")[1]; } var QE2 = { top: "auto", right: "auto", bottom: "auto", left: "auto" }; function eA(n) { var e = n.x, t13 = n.y, i = window, r = i.devicePixelRatio || 1; return { x: Po2(e * r) / r || 0, y: Po2(t13 * r) / r || 0 }; } function Rm2(n) { var e, t13 = n.popper, i = n.popperRect, r = n.placement, s = n.variation, o = n.offsets, a = n.position, c = n.gpuAcceleration, l = n.adaptive, d = n.roundOffsets, h6 = n.isFixed, p = o.x, g = p === void 0 ? 0 : p, f = o.y, u = f === void 0 ? 0 : f, y = typeof d == "function" ? d({ x: g, y: u }) : { x: g, y: u }; g = y.x, u = y.y; var v = o.hasOwnProperty("x"), m = o.hasOwnProperty("y"), w = Gn2, S = kn, T = window; if (l) { var M = ml(t13), x = "clientHeight", _ = "clientWidth"; if (M === Si2(t13) && (M = es2(t13), ur(M).position !== "static" && a === "absolute" && (x = "scrollHeight", _ = "scrollWidth")), M = M, r === kn || (r === Gn2 || r === ai2) && s === Ya2) { S = oi2; var E = h6 && M === T && T.visualViewport ? T.visualViewport.height : M[x]; u -= E - i.height, u *= c ? 1 : -1; } if (r === Gn2 || (r === kn || r === oi2) && s === Ya2) { w = ai2; var L = h6 && M === T && T.visualViewport ? T.visualViewport.width : M[_]; g -= L - i.width, g *= c ? 1 : -1; } } var R = Object.assign({ position: a }, l && QE2), C = d === true ? eA({ x: g, y: u }) : { x: g, y: u }; if (g = C.x, u = C.y, c) { var A; return Object.assign({}, R, (A = {}, A[S] = m ? "0" : "", A[w] = v ? "0" : "", A.transform = (T.devicePixelRatio || 1) <= 1 ? "translate(" + g + "px, " + u + "px)" : "translate3d(" + g + "px, " + u + "px, 0)", A)); } return Object.assign({}, R, (e = {}, e[S] = m ? u + "px" : "", e[w] = v ? g + "px" : "", e.transform = "", e)); } function tA(n) { var e = n.state, t13 = n.options, i = t13.gpuAcceleration, r = i === void 0 ? true : i, s = t13.adaptive, o = s === void 0 ? true : s, a = t13.roundOffsets, c = a === void 0 ? true : a, l = { placement: Ni2(e.placement), variation: Oo2(e.placement), popper: e.elements.popper, popperRect: e.rects.popper, gpuAcceleration: r, isFixed: e.options.strategy === "fixed" }; e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, Rm2(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, Rm2(Object.assign({}, l, { offsets: e.modifiersData.arrow, position: "absolute", adaptive: false, roundOffsets: c })))), e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-placement": e.placement }); } var j02 = { name: "computeStyles", enabled: true, phase: "beforeWrite", fn: tA, data: {} }; var Fl2 = { passive: true }; function nA(n) { var e = n.state, t13 = n.instance, i = n.options, r = i.scroll, s = r === void 0 ? true : r, o = i.resize, a = o === void 0 ? true : o, c = Si2(e.elements.popper), l = [].concat(e.scrollParents.reference, e.scrollParents.popper); return s && l.forEach(function(d) { d.addEventListener("scroll", t13.update, Fl2); }), a && c.addEventListener("resize", t13.update, Fl2), function() { s && l.forEach(function(d) { d.removeEventListener("scroll", t13.update, Fl2); }), a && c.removeEventListener("resize", t13.update, Fl2); }; } var $02 = { name: "eventListeners", enabled: true, phase: "write", fn: function() { }, effect: nA, data: {} }; var iA = { left: "right", right: "left", bottom: "top", top: "bottom" }; function zc2(n) { return n.replace(/left|right|bottom|top/g, function(e) { return iA[e]; }); } var rA = { start: "end", end: "start" }; function Pm2(n) { return n.replace(/start|end/g, function(e) { return rA[e]; }); } function _f2(n) { var e = Si2(n), t13 = e.pageXOffset, i = e.pageYOffset; return { scrollLeft: t13, scrollTop: i }; } function Tf2(n) { return Io2(es2(n)).left + _f2(n).scrollLeft; } function sA(n) { var e = Si2(n), t13 = es2(n), i = e.visualViewport, r = t13.clientWidth, s = t13.clientHeight, o = 0, a = 0; return i && (r = i.width, s = i.height, /^((?!chrome|android).)*safari/i.test(navigator.userAgent) || (o = i.offsetLeft, a = i.offsetTop)), { width: r, height: s, x: o + Tf2(n), y: a }; } function oA(n) { var e, t13 = es2(n), i = _f2(n), r = (e = n.ownerDocument) == null ? void 0 : e.body, s = _s2(t13.scrollWidth, t13.clientWidth, r ? r.scrollWidth : 0, r ? r.clientWidth : 0), o = _s2(t13.scrollHeight, t13.clientHeight, r ? r.scrollHeight : 0, r ? r.clientHeight : 0), a = -i.scrollLeft + Tf2(n), c = -i.scrollTop; return ur(r || t13).direction === "rtl" && (a += _s2(t13.clientWidth, r ? r.clientWidth : 0) - s), { width: s, height: o, x: a, y: c }; } function Ef2(n) { var e = ur(n), t13 = e.overflow, i = e.overflowX, r = e.overflowY; return /auto|scroll|overlay|hidden/.test(t13 + r + i); } function Z02(n) { return ["html", "body", "#document"].indexOf(zi2(n)) >= 0 ? n.ownerDocument.body : si2(n) && Ef2(n) ? n : Z02(gu2(n)); } function Ua2(n, e) { var t13; e === void 0 && (e = []); var i = Z02(n), r = i === ((t13 = n.ownerDocument) == null ? void 0 : t13.body), s = Si2(i), o = r ? [s].concat(s.visualViewport || [], Ef2(i) ? i : []) : i, a = e.concat(o); return r ? a : a.concat(Ua2(gu2(o))); } function ud2(n) { return Object.assign({}, n, { left: n.x, top: n.y, right: n.x + n.width, bottom: n.y + n.height }); } function aA(n) { var e = Io2(n); return e.top = e.top + n.clientTop, e.left = e.left + n.clientLeft, e.bottom = e.top + n.clientHeight, e.right = e.left + n.clientWidth, e.width = n.clientWidth, e.height = n.clientHeight, e.x = e.left, e.y = e.top, e; } function Im2(n, e) { return e === U02 ? ud2(sA(n)) : Ro2(e) ? aA(e) : ud2(oA(es2(n))); } function lA(n) { var e = Ua2(gu2(n)), t13 = ["absolute", "fixed"].indexOf(ur(n).position) >= 0, i = t13 && si2(n) ? ml(n) : n; return Ro2(i) ? e.filter(function(r) { return Ro2(r) && k0(r, i) && zi2(r) !== "body"; }) : []; } function cA(n, e, t13) { var i = e === "clippingParents" ? lA(n) : [].concat(e), r = [].concat(i, [t13]), s = r[0], o = r.reduce(function(a, c) { var l = Im2(n, c); return a.top = _s2(l.top, a.top), a.right = Yc2(l.right, a.right), a.bottom = Yc2(l.bottom, a.bottom), a.left = _s2(l.left, a.left), a; }, Im2(n, s)); return o.width = o.right - o.left, o.height = o.bottom - o.top, o.x = o.left, o.y = o.top, o; } function X02(n) { var e = n.reference, t13 = n.element, i = n.placement, r = i ? Ni2(i) : null, s = i ? Oo2(i) : null, o = e.x + e.width / 2 - t13.width / 2, a = e.y + e.height / 2 - t13.height / 2, c; switch (r) { case kn: c = { x: o, y: e.y - t13.height }; break; case oi2: c = { x: o, y: e.y + e.height }; break; case ai2: c = { x: e.x + e.width, y: a }; break; case Gn2: c = { x: e.x - t13.width, y: a }; break; default: c = { x: e.x, y: e.y }; } var l = r ? Sf2(r) : null; if (l != null) { var d = l === "y" ? "height" : "width"; switch (s) { case Lo2: c[l] = c[l] - (e[d] / 2 - t13[d] / 2); break; case Ya2: c[l] = c[l] + (e[d] / 2 - t13[d] / 2); break; } } return c; } function Ja2(n, e) { e === void 0 && (e = {}); var t13 = e, i = t13.placement, r = i === void 0 ? n.placement : i, s = t13.boundary, o = s === void 0 ? IE2 : s, a = t13.rootBoundary, c = a === void 0 ? U02 : a, l = t13.elementContext, d = l === void 0 ? ya2 : l, h6 = t13.altBoundary, p = h6 === void 0 ? false : h6, g = t13.padding, f = g === void 0 ? 0 : g, u = H02(typeof f != "number" ? f : W02(f, pl2)), y = d === ya2 ? OE2 : ya2, v = n.rects.popper, m = n.elements[p ? y : d], w = cA(Ro2(m) ? m : m.contextElement || es2(n.elements.popper), o, c), S = Io2(n.elements.reference), T = X02({ reference: S, element: v, strategy: "absolute", placement: r }), M = ud2(Object.assign({}, v, T)), x = d === ya2 ? M : S, _ = { top: w.top - x.top + u.top, bottom: x.bottom - w.bottom + u.bottom, left: w.left - x.left + u.left, right: x.right - w.right + u.right }, E = n.modifiersData.offset; if (d === ya2 && E) { var L = E[r]; Object.keys(_).forEach(function(R) { var C = [ai2, oi2].indexOf(R) >= 0 ? 1 : -1, A = [kn, oi2].indexOf(R) >= 0 ? "y" : "x"; _[R] += L[A] * C; }); } return _; } function uA(n, e) { e === void 0 && (e = {}); var t13 = e, i = t13.placement, r = t13.boundary, s = t13.rootBoundary, o = t13.padding, a = t13.flipVariations, c = t13.allowedAutoPlacements, l = c === void 0 ? ia : c, d = Oo2(i), h6 = d ? a ? Cm2 : Cm2.filter(function(f) { return Oo2(f) === d; }) : pl2, p = h6.filter(function(f) { return l.indexOf(f) >= 0; }); p.length === 0 && (p = h6); var g = p.reduce(function(f, u) { return f[u] = Ja2(n, { placement: u, boundary: r, rootBoundary: s, padding: o })[Ni2(u)], f; }, {}); return Object.keys(g).sort(function(f, u) { return g[f] - g[u]; }); } function hA(n) { if (Ni2(n) === xf2) return []; var e = zc2(n); return [Pm2(n), e, Pm2(e)]; } function dA(n) { var e = n.state, t13 = n.options, i = n.name; if (!e.modifiersData[i]._skip) { for (var r = t13.mainAxis, s = r === void 0 ? true : r, o = t13.altAxis, a = o === void 0 ? true : o, c = t13.fallbackPlacements, l = t13.padding, d = t13.boundary, h6 = t13.rootBoundary, p = t13.altBoundary, g = t13.flipVariations, f = g === void 0 ? true : g, u = t13.allowedAutoPlacements, y = e.options.placement, v = Ni2(y), m = v === y, w = c || (m || !f ? [zc2(y)] : hA(y)), S = [y].concat(w).reduce(function(ie, j) { return ie.concat(Ni2(j) === xf2 ? uA(e, { placement: j, boundary: d, rootBoundary: h6, padding: l, flipVariations: f, allowedAutoPlacements: u }) : j); }, []), T = e.rects.reference, M = e.rects.popper, x = /* @__PURE__ */ new Map(), _ = true, E = S[0], L = 0; L < S.length; L++) { var R = S[L], C = Ni2(R), A = Oo2(R) === Lo2, P = [kn, oi2].indexOf(C) >= 0, I = P ? "width" : "height", b = Ja2(e, { placement: R, boundary: d, rootBoundary: h6, altBoundary: p, padding: l }), O = P ? A ? ai2 : Gn2 : A ? oi2 : kn; T[I] > M[I] && (O = zc2(O)); var N = zc2(O), D = []; if (s && D.push(b[C] <= 0), a && D.push(b[O] <= 0, b[N] <= 0), D.every(function(ie) { return ie; })) { E = R, _ = false; break; } x.set(R, D); } if (_) for (var B = f ? 3 : 1, U = function(ie) { var j = S.find(function(G) { var W = x.get(G); if (W) return W.slice(0, ie).every(function(q) { return q; }); }); if (j) return E = j, "break"; }, k = B; k > 0; k--) { var K = U(k); if (K === "break") break; } e.placement !== E && (e.modifiersData[i]._skip = true, e.placement = E, e.reset = true); } } var fA = { name: "flip", enabled: true, phase: "main", fn: dA, requiresIfExists: ["offset"], data: { _skip: false } }; function Om2(n, e, t13) { return t13 === void 0 && (t13 = { x: 0, y: 0 }), { top: n.top - e.height - t13.y, right: n.right - e.width + t13.x, bottom: n.bottom - e.height + t13.y, left: n.left - e.width - t13.x }; } function Dm2(n) { return [kn, ai2, oi2, Gn2].some(function(e) { return n[e] >= 0; }); } function pA(n) { var e = n.state, t13 = n.name, i = e.rects.reference, r = e.rects.popper, s = e.modifiersData.preventOverflow, o = Ja2(e, { elementContext: "reference" }), a = Ja2(e, { altBoundary: true }), c = Om2(o, i), l = Om2(a, r, s), d = Dm2(c), h6 = Dm2(l); e.modifiersData[t13] = { referenceClippingOffsets: c, popperEscapeOffsets: l, isReferenceHidden: d, hasPopperEscaped: h6 }, e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-reference-hidden": d, "data-popper-escaped": h6 }); } var mA = { name: "hide", enabled: true, phase: "main", requiresIfExists: ["preventOverflow"], fn: pA }; function gA(n, e, t13) { var i = Ni2(n), r = [Gn2, kn].indexOf(i) >= 0 ? -1 : 1, s = typeof t13 == "function" ? t13(Object.assign({}, e, { placement: n })) : t13, o = s[0], a = s[1]; return o = o || 0, a = (a || 0) * r, [Gn2, ai2].indexOf(i) >= 0 ? { x: a, y: o } : { x: o, y: a }; } function vA(n) { var e = n.state, t13 = n.options, i = n.name, r = t13.offset, s = r === void 0 ? [0, 0] : r, o = ia.reduce(function(d, h6) { return d[h6] = gA(h6, e.rects, s), d; }, {}), a = o[e.placement], c = a.x, l = a.y; e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += c, e.modifiersData.popperOffsets.y += l), e.modifiersData[i] = o; } var yA = { name: "offset", enabled: true, phase: "main", requires: ["popperOffsets"], fn: vA }; function bA(n) { var e = n.state, t13 = n.name; e.modifiersData[t13] = X02({ reference: e.rects.reference, element: e.rects.popper, strategy: "absolute", placement: e.placement }); } var Y02 = { name: "popperOffsets", enabled: true, phase: "read", fn: bA, data: {} }; function xA(n) { return n === "x" ? "y" : "x"; } function wA(n) { var e = n.state, t13 = n.options, i = n.name, r = t13.mainAxis, s = r === void 0 ? true : r, o = t13.altAxis, a = o === void 0 ? false : o, c = t13.boundary, l = t13.rootBoundary, d = t13.altBoundary, h6 = t13.padding, p = t13.tether, g = p === void 0 ? true : p, f = t13.tetherOffset, u = f === void 0 ? 0 : f, y = Ja2(e, { boundary: c, rootBoundary: l, padding: h6, altBoundary: d }), v = Ni2(e.placement), m = Oo2(e.placement), w = !m, S = Sf2(v), T = xA(S), M = e.modifiersData.popperOffsets, x = e.rects.reference, _ = e.rects.popper, E = typeof u == "function" ? u(Object.assign({}, e.rects, { placement: e.placement })) : u, L = typeof E == "number" ? { mainAxis: E, altAxis: E } : Object.assign({ mainAxis: 0, altAxis: 0 }, E), R = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, C = { x: 0, y: 0 }; if (M) { if (s) { var A, P = S === "y" ? kn : Gn2, I = S === "y" ? oi2 : ai2, b = S === "y" ? "height" : "width", O = M[S], N = O + y[P], D = O - y[I], B = g ? -_[b] / 2 : 0, U = m === Lo2 ? x[b] : _[b], k = m === Lo2 ? -_[b] : -x[b], K = e.elements.arrow, ie = g && K ? Mf2(K) : { width: 0, height: 0 }, j = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : G02(), G = j[P], W = j[I], q = za2(0, x[b], ie[b]), Q = w ? x[b] / 2 - B - q - G - L.mainAxis : U - q - G - L.mainAxis, ee = w ? -x[b] / 2 + B + q + W + L.mainAxis : k + q + W + L.mainAxis, ne = e.elements.arrow && ml(e.elements.arrow), Y = ne ? S === "y" ? ne.clientTop || 0 : ne.clientLeft || 0 : 0, te = (A = R == null ? void 0 : R[S]) != null ? A : 0, F = O + Q - te - Y, $ = O + ee - te, J = za2(g ? Yc2(N, F) : N, O, g ? _s2(D, $) : D); M[S] = J, C[S] = J - O; } if (a) { var z, V = S === "x" ? kn : Gn2, oe = S === "x" ? oi2 : ai2, ue = M[T], le = T === "y" ? "height" : "width", ve = ue + y[V], xe = ue - y[oe], Te = [kn, Gn2].indexOf(v) !== -1, de = (z = R == null ? void 0 : R[T]) != null ? z : 0, we = Te ? ve : ue - x[le] - _[le] - de + L.altAxis, se = Te ? ue + x[le] + _[le] - de - L.altAxis : xe, Se2 = g && Te ? XE2(we, ue, se) : za2(g ? we : ve, ue, g ? se : xe); M[T] = Se2, C[T] = Se2 - ue; } e.modifiersData[i] = C; } } var MA = { name: "preventOverflow", enabled: true, phase: "main", fn: wA, requiresIfExists: ["offset"] }; function SA(n) { return { scrollLeft: n.scrollLeft, scrollTop: n.scrollTop }; } function _A(n) { return n === Si2(n) || !si2(n) ? _f2(n) : SA(n); } function TA(n) { var e = n.getBoundingClientRect(), t13 = Po2(e.width) / n.offsetWidth || 1, i = Po2(e.height) / n.offsetHeight || 1; return t13 !== 1 || i !== 1; } function EA(n, e, t13) { t13 === void 0 && (t13 = false); var i = si2(e), r = si2(e) && TA(e), s = es2(e), o = Io2(n, r), a = { scrollLeft: 0, scrollTop: 0 }, c = { x: 0, y: 0 }; return (i || !i && !t13) && ((zi2(e) !== "body" || Ef2(s)) && (a = _A(e)), si2(e) ? (c = Io2(e, true), c.x += e.clientLeft, c.y += e.clientTop) : s && (c.x = Tf2(s))), { x: o.left + a.scrollLeft - c.x, y: o.top + a.scrollTop - c.y, width: o.width, height: o.height }; } function AA(n) { var e = /* @__PURE__ */ new Map(), t13 = /* @__PURE__ */ new Set(), i = []; n.forEach(function(s) { e.set(s.name, s); }); function r(s) { t13.add(s.name); var o = [].concat(s.requires || [], s.requiresIfExists || []); o.forEach(function(a) { if (!t13.has(a)) { var c = e.get(a); c && r(c); } }), i.push(s); } return n.forEach(function(s) { t13.has(s.name) || r(s); }), i; } function CA(n) { var e = AA(n); return HE2.reduce(function(t13, i) { return t13.concat(e.filter(function(r) { return r.phase === i; })); }, []); } function LA(n) { var e; return function() { return e || (e = new Promise(function(t13) { Promise.resolve().then(function() { e = void 0, t13(n()); }); })), e; }; } function RA(n) { var e = n.reduce(function(t13, i) { var r = t13[i.name]; return t13[i.name] = r ? Object.assign({}, r, i, { options: Object.assign({}, r.options, i.options), data: Object.assign({}, r.data, i.data) }) : i, t13; }, {}); return Object.keys(e).map(function(t13) { return e[t13]; }); } var Nm2 = { placement: "bottom", modifiers: [], strategy: "absolute" }; function Fm2() { for (var n = arguments.length, e = new Array(n), t13 = 0; t13 < n; t13++) e[t13] = arguments[t13]; return !e.some(function(i) { return !(i && typeof i.getBoundingClientRect == "function"); }); } function Af2(n) { n === void 0 && (n = {}); var e = n, t13 = e.defaultModifiers, i = t13 === void 0 ? [] : t13, r = e.defaultOptions, s = r === void 0 ? Nm2 : r; return function(o, a, c) { c === void 0 && (c = s); var l = { placement: "bottom", orderedModifiers: [], options: Object.assign({}, Nm2, s), modifiersData: {}, elements: { reference: o, popper: a }, attributes: {}, styles: {} }, d = [], h6 = false, p = { state: l, setOptions: function(u) { var y = typeof u == "function" ? u(l.options) : u; f(), l.options = Object.assign({}, s, l.options, y), l.scrollParents = { reference: Ro2(o) ? Ua2(o) : o.contextElement ? Ua2(o.contextElement) : [], popper: Ua2(a) }; var v = CA(RA([].concat(i, l.options.modifiers))); return l.orderedModifiers = v.filter(function(m) { return m.enabled; }), g(), p.update(); }, forceUpdate: function() { if (!h6) { var u = l.elements, y = u.reference, v = u.popper; if (Fm2(y, v)) { l.rects = { reference: EA(y, ml(v), l.options.strategy === "fixed"), popper: Mf2(v) }, l.reset = false, l.placement = l.options.placement, l.orderedModifiers.forEach(function(_) { return l.modifiersData[_.name] = Object.assign({}, _.data); }); for (var m = 0; m < l.orderedModifiers.length; m++) { if (l.reset === true) { l.reset = false, m = -1; continue; } var w = l.orderedModifiers[m], S = w.fn, T = w.options, M = T === void 0 ? {} : T, x = w.name; typeof S == "function" && (l = S({ state: l, options: M, name: x, instance: p }) || l); } } } }, update: LA(function() { return new Promise(function(u) { p.forceUpdate(), u(l); }); }), destroy: function() { f(), h6 = true; } }; if (!Fm2(o, a)) return p; p.setOptions(c).then(function(u) { !h6 && c.onFirstUpdate && c.onFirstUpdate(u); }); function g() { l.orderedModifiers.forEach(function(u) { var y = u.name, v = u.options, m = v === void 0 ? {} : v, w = u.effect; if (typeof w == "function") { var S = w({ state: l, name: y, instance: p, options: m }), T = function() { }; d.push(S || T); } }); } function f() { d.forEach(function(u) { return u(); }), d = []; } return p; }; } Af2(); var PA = [$02, Y02, j02, V02]; Af2({ defaultModifiers: PA }); var IA = [$02, Y02, j02, V02, yA, fA, MA, KE2, mA]; var OA = Af2({ defaultModifiers: IA }); var DA = (n, e, t13 = {}) => { const i = { name: "updateState", enabled: true, phase: "write", fn: ({ state: c }) => { const l = NA(c); Object.assign(o.value, l); }, requires: ["computeStyles"] }, r = computed(() => { const { onFirstUpdate: c, placement: l, strategy: d, modifiers: h6 } = unref(t13); return { onFirstUpdate: c, placement: l || "bottom", strategy: d || "absolute", modifiers: [ ...h6 || [], i, { name: "applyStyles", enabled: false } ] }; }), s = shallowRef(), o = ref({ styles: { popper: { position: unref(r).strategy, left: "0", top: "0" }, arrow: { position: "absolute" } }, attributes: {} }), a = () => { s.value && (s.value.destroy(), s.value = void 0); }; return watch(r, (c) => { const l = unref(s); l && l.setOptions(c); }, { deep: true }), watch([n, e], ([c, l]) => { a(), !(!c || !l) && (s.value = OA(c, l, unref(r))); }), onBeforeUnmount(() => { a(); }), { state: computed(() => { var c; return { ...((c = unref(s)) == null ? void 0 : c.state) || {} }; }), styles: computed(() => unref(o).styles), attributes: computed(() => unref(o).attributes), update: () => { var c; return (c = unref(s)) == null ? void 0 : c.update(); }, forceUpdate: () => { var c; return (c = unref(s)) == null ? void 0 : c.forceUpdate(); }, instanceRef: computed(() => unref(s)) }; }; function NA(n) { const e = Object.keys(n.elements), t13 = jc2(e.map((r) => [r, n.styles[r] || {}])), i = jc2(e.map((r) => [r, n.attributes[r]])); return { styles: t13, attributes: i }; } function Bm2() { let n; const e = (i, r) => { t13(), n = window.setTimeout(i, r); }, t13 = () => window.clearTimeout(n); return au2(() => t13()), { registerTimeout: e, cancelTimeout: t13 }; } var hd2 = { prefix: Math.floor(Math.random() * 1e4), current: 0 }; var FA = Symbol("elIdInjection"); var Cf2 = () => getCurrentInstance() ? inject(FA, hd2) : hd2; var vu2 = (n) => { const e = Cf2(); !rn2 && e === hd2 && en2("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 t13 = bf2(); return computed(() => unref(n) || `${t13.value}-id-${e.prefix}-${e.current++}`); }; var xo2 = []; var zm2 = (n) => { const e = n; e.key === Di2.esc && xo2.forEach((t13) => t13(e)); }; var BA = (n) => { onMounted(() => { xo2.length === 0 && document.addEventListener("keydown", zm2), rn2 && xo2.push(n); }), onBeforeUnmount(() => { xo2 = xo2.filter((e) => e !== n), xo2.length === 0 && rn2 && document.removeEventListener("keydown", zm2); }); }; var Um2; var J02 = () => { const n = bf2(), e = Cf2(), t13 = computed(() => `${n.value}-popper-container-${e.prefix}`), i = computed(() => `#${t13.value}`); return { id: t13, selector: i }; }; var zA = (n) => { const e = document.createElement("div"); return e.id = n, document.body.appendChild(e), e; }; var UA = () => { const { id: n, selector: e } = J02(); return onBeforeMount(() => { rn2 && (!Um2 || !document.body.querySelector(e.value)) && (Um2 = zA(n.value)); }), { id: n, selector: e }; }; var VA = dt2({ showAfter: { type: Number, default: 0 }, hideAfter: { type: Number, default: 200 }, autoClose: { type: Number, default: 0 } }); var kA = ({ showAfter: n, hideAfter: e, autoClose: t13, open: i, close: r }) => { const { registerTimeout: s } = Bm2(), { registerTimeout: o, cancelTimeout: a } = Bm2(); return { onOpen: (d) => { s(() => { i(d); const h6 = unref(t13); St(h6) && h6 > 0 && o(() => { r(d); }, h6); }, unref(n)); }, onClose: (d) => { a(), s(() => { r(d); }, unref(e)); } }; }; var q02 = Symbol("elForwardRef"); var GA = (n) => { provide(q02, { setForwardRef: (t13) => { n.value = t13; } }); }; var HA = (n) => ({ mounted(e) { n(e); }, updated(e) { n(e); }, unmounted() { n(null); } }); var Vm2 = { current: 0 }; var km2 = ref(0); var K02 = 2e3; var Gm2 = Symbol("elZIndexContextKey"); var Q02 = Symbol("zIndexContextKey"); var ey2 = (n) => { const e = getCurrentInstance() ? inject(Gm2, Vm2) : Vm2, t13 = n || (getCurrentInstance() ? inject(Q02, void 0) : void 0), i = computed(() => { const o = unref(t13); return St(o) ? o : K02; }), r = computed(() => i.value + km2.value), s = () => (e.current++, km2.value = e.current, r.value); return !rn2 && !inject(Gm2) && en2("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: r, nextZIndex: s }; }; function WA(n) { let e; function t13() { if (n.value == null) return; const { selectionStart: r, selectionEnd: s, value: o } = n.value; if (r == null || s == null) return; const a = o.slice(0, Math.max(0, r)), c = o.slice(Math.max(0, s)); e = { selectionStart: r, selectionEnd: s, value: o, beforeTxt: a, afterTxt: c }; } function i() { if (n.value == null || e == null) return; const { value: r } = n.value, { beforeTxt: s, afterTxt: o, selectionStart: a } = e; if (s == null || o == null || a == null) return; let c = r.length; if (r.endsWith(o)) c = r.length - o.length; else if (r.startsWith(s)) c = s.length; else { const l = s[a - 1], d = r.indexOf(l, a - 1); d !== -1 && (c = d + 1); } n.value.setSelectionRange(c, c); } return [t13, i]; } var jA = (n, e, t13) => Fc(n.subTree).filter((s) => { var o; return isVNode(s) && ((o = s.type) == null ? void 0 : o.name) === e && !!s.component; }).map((s) => s.component.uid).map((s) => t13[s]).filter((s) => !!s); var $A = (n, e) => { const t13 = {}, i = shallowRef([]); return { children: i, addChild: (o) => { t13[o.uid] = o, i.value = jA(n, e, t13); }, removeChild: (o) => { delete t13[o], i.value = i.value.filter((a) => a.uid !== o); } }; }; var Do2 = pu2({ type: String, values: N02, required: false }); var ty2 = Symbol("size"); var ZA = () => { const n = inject(ty2, {}); return computed(() => unref(n.size) || ""); }; function ny2(n, { beforeFocus: e, afterFocus: t13, beforeBlur: i, afterBlur: r } = {}) { const s = getCurrentInstance(), { emit: o } = s, a = shallowRef(), c = ref(false), l = (p) => { Ln2(e) && e(p) || c.value || (c.value = true, o("focus", p), t13 == null || t13()); }, d = (p) => { var g; Ln2(i) && i(p) || p.relatedTarget && ((g = a.value) != null && g.contains(p.relatedTarget)) || (c.value = false, o("blur", p), r == null || r()); }, h6 = () => { var p, g; (p = a.value) != null && p.contains(document.activeElement) && a.value !== document.activeElement || (g = n.value) == null || g.focus(); }; return watch(a, (p) => { p && p.setAttribute("tabindex", "-1"); }), pn2(a, "focus", l, true), pn2(a, "blur", d, true), pn2(a, "click", h6, true), false, { isFocused: c, wrapperRef: a, handleFocus: l, handleBlur: d }; } function iy2({ afterComposition: n, emit: e }) { const t13 = ref(false), i = (a) => { e == null || e("compositionstart", a), t13.value = true; }, r = (a) => { var c; e == null || e("compositionupdate", a); const l = (c = a.target) == null ? void 0 : c.value, d = l[l.length - 1] || ""; t13.value = !bE2(d); }, s = (a) => { e == null || e("compositionend", a), t13.value && (t13.value = false, nextTick(() => n(a))); }; return { isComposing: t13, handleComposition: (a) => { a.type === "compositionend" ? s(a) : r(a); }, handleCompositionStart: i, handleCompositionUpdate: r, handleCompositionEnd: s }; } var ry2 = Symbol("emptyValuesContextKey"); var XA = "use-empty-values"; var YA = ["", void 0, null]; var JA = void 0; var qA = dt2({ emptyValues: Array, valueOnClear: { type: [String, Number, Boolean, Function], default: void 0, validator: (n) => Ln2(n) ? !n() : !n } }); var KA = (n, e) => { const t13 = getCurrentInstance() ? inject(ry2, ref({})) : ref({}), i = computed(() => n.emptyValues || t13.value.emptyValues || YA), r = computed(() => Ln2(n.valueOnClear) ? n.valueOnClear() : n.valueOnClear !== void 0 ? n.valueOnClear : Ln2(t13.value.valueOnClear) ? t13.value.valueOnClear() : t13.value.valueOnClear !== void 0 ? t13.value.valueOnClear : JA), s = (o) => i.value.includes(o); return i.value.includes(r.value) || en2(XA, "value-on-clear should be a value of empty-values"), { emptyValues: i, valueOnClear: r, isEmptyValue: s }; }; var QA = dt2({ ariaLabel: String, ariaOrientation: { type: String, values: ["horizontal", "vertical", "undefined"] }, ariaControls: String }); var Gs2 = (n) => ZT2(QA, n); var sy2 = Symbol(); var Jc2 = ref(); function Lf2(n, e = void 0) { const t13 = getCurrentInstance() ? inject(sy2, Jc2) : Jc2; return n ? computed(() => { var i, r; return (r = (i = t13.value) == null ? void 0 : i[n]) != null ? r : e; }) : t13; } function eC2(n, e) { const t13 = Lf2(), i = it2(n, computed(() => { var a; return ((a = t13.value) == null ? void 0 : a.namespace) || Bc2; })), r = mu2(computed(() => { var a; return (a = t13.value) == null ? void 0 : a.locale; })), s = ey2(computed(() => { var a; return ((a = t13.value) == null ? void 0 : a.zIndex) || K02; })), o = computed(() => { var a; return unref(e) || ((a = t13.value) == null ? void 0 : a.size) || ""; }); return tC2(computed(() => unref(t13) || {})), { ns: i, locale: r, zIndex: s, size: o }; } var tC2 = (n, e, t13 = false) => { var i; const r = !!getCurrentInstance(), s = r ? Lf2() : void 0, o = (i = void 0) != null ? i : r ? provide : void 0; if (!o) { en2("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup()."); return; } const a = computed(() => { const c = unref(n); return s != null && s.value ? nC2(s.value, c) : c; }); return o(sy2, a), o(F0, computed(() => a.value.locale)), o(B02, computed(() => a.value.namespace)), o(Q02, computed(() => a.value.zIndex)), o(ty2, { size: computed(() => a.value.size || "") }), o(ry2, computed(() => ({ emptyValues: a.value.emptyValues, valueOnClear: a.value.valueOnClear }))), (t13 || !Jc2.value) && (Jc2.value = a.value), a; }; var nC2 = (n, e) => { const t13 = [.../* @__PURE__ */ new Set([...Em2(n), ...Em2(e)])], i = {}; for (const r of t13) i[r] = e[r] !== void 0 ? e[r] : n[r]; return i; }; var at = (n, e) => { const t13 = n.__vccOpts || n; for (const [i, r] of e) t13[i] = r; return t13; }; var iC2 = dt2({ size: { type: Ye2([Number, String]) }, color: { type: String } }); var rC2 = defineComponent({ name: "ElIcon", inheritAttrs: false }); var sC2 = defineComponent({ ...rC2, props: iC2, setup(n) { const e = n, t13 = it2("icon"), i = computed(() => { const { size: r, color: s } = e; return !r && !s ? {} : { fontSize: yi2(r) ? void 0 : Zc2(r), "--color": s }; }); return (r, s) => (openBlock(), createElementBlock("i", mergeProps({ class: unref(t13).b(), style: unref(i) }, r.$attrs), [ renderSlot(r.$slots, "default") ], 16)); } }); var oC2 = at(sC2, [["__file", "icon.vue"]]); var Bt = vn2(oC2); var Rf2 = Symbol("formContextKey"); var qc2 = Symbol("formItemContextKey"); var ra2 = (n, e = {}) => { const t13 = ref(void 0), i = e.prop ? t13 : z02("size"), r = e.global ? t13 : ZA(), s = e.form ? { size: void 0 } : inject(Rf2, void 0), o = e.formItem ? { size: void 0 } : inject(qc2, void 0); return computed(() => i.value || unref(n) || (o == null ? void 0 : o.size) || (s == null ? void 0 : s.size) || r.value || ""); }; var yu2 = (n) => { const e = z02("disabled"), t13 = inject(Rf2, void 0); return computed(() => e.value || unref(n) || (t13 == null ? void 0 : t13.disabled) || false); }; var gl2 = () => { const n = inject(Rf2, void 0), e = inject(qc2, void 0); return { form: n, formItem: e }; }; var Pf2 = (n, { formItemContext: e, disableIdGeneration: t13, disableIdManagement: i }) => { t13 || (t13 = ref(false)), i || (i = ref(false)); const r = ref(); let s; const o = computed(() => { var a; return !!(!(n.label || n.ariaLabel) && e && e.inputIds && ((a = e.inputIds) == null ? void 0 : a.length) <= 1); }); return onMounted(() => { s = watch([toRef(n, "id"), t13], ([a, c]) => { const l = a ?? (c ? void 0 : vu2().value); l !== r.value && (e != null && e.removeInputId && (r.value && e.removeInputId(r.value), !(i != null && i.value) && !c && l && e.addInputId(l)), r.value = l); }, { immediate: true }); }), onUnmounted(() => { s && s(), e != null && e.removeInputId && r.value && e.removeInputId(r.value); }), { isLabeledByFormItem: o, inputId: r }; }; var ui; var aC2 = ` height:0 !important; visibility:hidden !important; ${X12() ? "" : "overflow:hidden !important;"} position:absolute !important; z-index:-1000 !important; top:0 !important; right:0 !important; `; var lC2 = [ "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 cC2(n) { const e = window.getComputedStyle(n), t13 = e.getPropertyValue("box-sizing"), i = Number.parseFloat(e.getPropertyValue("padding-bottom")) + Number.parseFloat(e.getPropertyValue("padding-top")), r = Number.parseFloat(e.getPropertyValue("border-bottom-width")) + Number.parseFloat(e.getPropertyValue("border-top-width")); return { contextStyle: lC2.map((o) => `${o}:${e.getPropertyValue(o)}`).join(";"), paddingSize: i, borderSize: r, boxSizing: t13 }; } function Hm2(n, e = 1, t13) { var i; ui || (ui = document.createElement("textarea"), document.body.appendChild(ui)); const { paddingSize: r, borderSize: s, boxSizing: o, contextStyle: a } = cC2(n); ui.setAttribute("style", `${a};${aC2}`), ui.value = n.value || n.placeholder || ""; let c = ui.scrollHeight; const l = {}; o === "border-box" ? c = c + s : o === "content-box" && (c = c - r), ui.value = ""; const d = ui.scrollHeight - r; if (St(e)) { let h6 = d * e; o === "border-box" && (h6 = h6 + r + s), c = Math.max(h6, c), l.minHeight = `${h6}px`; } if (St(t13)) { let h6 = d * t13; o === "border-box" && (h6 = h6 + r + s), c = Math.min(h6, c); } return l.height = `${c}px`, (i = ui.parentNode) == null || i.removeChild(ui), ui = void 0, l; } var uC2 = dt2({ id: { type: String, default: void 0 }, size: Do2, disabled: Boolean, modelValue: { type: Ye2([ 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: Ye2([Boolean, Object]), default: false }, autocomplete: { type: String, default: "off" }, formatter: { type: Function }, parser: { type: Function }, placeholder: { type: String }, form: { type: String }, readonly: Boolean, clearable: Boolean, showPassword: Boolean, showWordLimit: Boolean, suffixIcon: { type: Zr2 }, prefixIcon: { type: Zr2 }, containerRole: { type: String, default: void 0 }, tabindex: { type: [String, Number], default: 0 }, validateEvent: { type: Boolean, default: true }, inputStyle: { type: Ye2([Object, Array, String]), default: () => tr2({}) }, autofocus: Boolean, rows: { type: Number, default: 2 }, ...Gs2(["ariaLabel"]) }); var hC2 = { [Dt2]: (n) => On2(n), input: (n) => On2(n), change: (n) => On2(n), focus: (n) => n instanceof FocusEvent, blur: (n) => n instanceof FocusEvent, clear: () => true, mouseleave: (n) => n instanceof MouseEvent, mouseenter: (n) => n instanceof MouseEvent, keydown: (n) => n instanceof Event, compositionstart: (n) => n instanceof CompositionEvent, compositionupdate: (n) => n instanceof CompositionEvent, compositionend: (n) => n instanceof CompositionEvent }; var dC2 = defineComponent({ name: "ElInput", inheritAttrs: false }); var fC2 = defineComponent({ ...dC2, props: uC2, emits: hC2, setup(n, { expose: e, emit: t13 }) { const i = n, r = useAttrs(), s = useSlots(), o = computed(() => { const de = {}; return i.containerRole === "combobox" && (de["aria-haspopup"] = r["aria-haspopup"], de["aria-owns"] = r["aria-owns"], de["aria-expanded"] = r["aria-expanded"]), de; }), a = computed(() => [ i.type === "textarea" ? y.b() : u.b(), u.m(g.value), u.is("disabled", f.value), u.is("exceed", K.value), { [u.b("group")]: s.prepend || s.append, [u.m("prefix")]: s.prefix || i.prefixIcon, [u.m("suffix")]: s.suffix || i.suffixIcon || i.clearable || i.showPassword, [u.bm("suffix", "password-clear")]: D.value && B.value, [u.b("hidden")]: i.type === "hidden" }, r.class ]), c = computed(() => [ u.e("wrapper"), u.is("focus", E.value) ]), l = ME2({ excludeKeys: computed(() => Object.keys(o.value)) }), { form: d, formItem: h6 } = gl2(), { inputId: p } = Pf2(i, { formItemContext: h6 }), g = ra2(), f = yu2(), u = it2("input"), y = it2("textarea"), v = shallowRef(), m = shallowRef(), w = ref(false), S = ref(false), T = ref(), M = shallowRef(i.inputStyle), x = computed(() => v.value || m.value), { wrapperRef: _, isFocused: E, handleFocus: L, handleBlur: R } = ny2(x, { beforeFocus() { return f.value; }, afterBlur() { var de; i.validateEvent && ((de = h6 == null ? void 0 : h6.validate) == null || de.call(h6, "blur").catch((we) => en2(we))); } }), C = computed(() => { var de; return (de = d == null ? void 0 : d.statusIcon) != null ? de : false; }), A = computed(() => (h6 == null ? void 0 : h6.validateState) || ""), P = computed(() => A.value && D0[A.value]), I = computed(() => S.value ? mE2 : cE2), b = computed(() => [ r.style ]), O = computed(() => [ i.inputStyle, M.value, { resize: i.resize } ]), N = computed(() => sr2(i.modelValue) ? "" : String(i.modelValue)), D = computed(() => i.clearable && !f.value && !i.readonly && !!N.value && (E.value || w.value)), B = computed(() => i.showPassword && !f.value && !i.readonly && !!N.value && (!!N.value || E.value)), U = computed(() => i.showWordLimit && !!i.maxlength && (i.type === "text" || i.type === "textarea") && !f.value && !i.readonly && !i.showPassword), k = computed(() => N.value.length), K = computed(() => !!U.value && k.value > Number(i.maxlength)), ie = computed(() => !!s.suffix || !!i.suffixIcon || D.value || i.showPassword || U.value || !!A.value && C.value), [j, G] = WA(v); ii2(m, (de) => { if (Q(), !U.value || i.resize !== "both") return; const we = de[0], { width: se } = we.contentRect; T.value = { right: `calc(100% - ${se + 15 + 6}px)` }; }); const W = () => { const { type: de, autosize: we } = i; if (!(!rn2 || de !== "textarea" || !m.value)) if (we) { const se = Pn2(we) ? we.minRows : void 0, Se2 = Pn2(we) ? we.maxRows : void 0, ge = Hm2(m.value, se, Se2); M.value = { overflowY: "hidden", ...ge }, nextTick(() => { m.value.offsetHeight, M.value = ge; }); } else M.value = { minHeight: Hm2(m.value).minHeight }; }, Q = /* @__PURE__ */ ((de) => { let we = false; return () => { var se; if (we || !i.autosize) return; ((se = m.value) == null ? void 0 : se.offsetParent) === null || (de(), we = true); }; })(W), ee = () => { const de = x.value, we = i.formatter ? i.formatter(N.value) : N.value; !de || de.value === we || (de.value = we); }, ne = async (de) => { j(); let { value: we } = de.target; if (i.formatter && (we = i.parser ? i.parser(we) : we), !te.value) { if (we === N.value) { ee(); return; } t13(Dt2, we), t13("input", we), await nextTick(), ee(), G(); } }, Y = (de) => { t13("change", de.target.value); }, { isComposing: te, handleCompositionStart: F, handleCompositionUpdate: $, handleCompositionEnd: J } = iy2({ emit: t13, afterComposition: ne }), z = () => { S.value = !S.value, V(); }, V = async () => { var de; await nextTick(), (de = x.value) == null || de.focus(); }, oe = () => { var de; return (de = x.value) == null ? void 0 : de.blur(); }, ue = (de) => { w.value = false, t13("mouseleave", de); }, le = (de) => { w.value = true, t13("mouseenter", de); }, ve = (de) => { t13("keydown", de); }, xe = () => { var de; (de = x.value) == null || de.select(); }, Te = () => { t13(Dt2, ""), t13("change", ""), t13("clear"), t13("input", ""); }; return watch(() => i.modelValue, () => { var de; nextTick(() => W()), i.validateEvent && ((de = h6 == null ? void 0 : h6.validate) == null || de.call(h6, "change").catch((we) => en2(we))); }), watch(N, () => ee()), watch(() => i.type, async () => { await nextTick(), ee(), W(); }), onMounted(() => { !i.formatter && i.parser && en2("ElInput", "If you set the parser, you also need to set the formatter."), ee(), nextTick(W); }), e({ input: v, textarea: m, ref: x, textareaStyle: O, autosize: toRef(i, "autosize"), isComposing: te, focus: V, blur: oe, select: xe, clear: Te, resizeTextarea: W }), (de, we) => (openBlock(), createElementBlock("div", mergeProps(unref(o), { class: [ unref(a), { [unref(u).bm("group", "append")]: de.$slots.append, [unref(u).bm("group", "prepend")]: de.$slots.prepend } ], style: unref(b), role: de.containerRole, onMouseenter: le, onMouseleave: ue }), [ createCommentVNode(" input "), de.type !== "textarea" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ createCommentVNode(" prepend slot "), de.$slots.prepend ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(u).be("group", "prepend")) }, [ renderSlot(de.$slots, "prepend") ], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { ref_key: "wrapperRef", ref: _, class: normalizeClass(unref(c)) }, [ createCommentVNode(" prefix slot "), de.$slots.prefix || de.prefixIcon ? (openBlock(), createElementBlock("span", { key: 0, class: normalizeClass(unref(u).e("prefix")) }, [ createBaseVNode("span", { class: normalizeClass(unref(u).e("prefix-inner")) }, [ renderSlot(de.$slots, "prefix"), de.prefixIcon ? (openBlock(), createBlock(unref(Bt), { key: 0, class: normalizeClass(unref(u).e("icon")) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(de.prefixIcon))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true) ], 2) ], 2)) : createCommentVNode("v-if", true), createBaseVNode("input", mergeProps({ id: unref(p), ref_key: "input", ref: v, class: unref(u).e("inner") }, unref(l), { minlength: de.minlength, maxlength: de.maxlength, type: de.showPassword ? S.value ? "text" : "password" : de.type, disabled: unref(f), readonly: de.readonly, autocomplete: de.autocomplete, tabindex: de.tabindex, "aria-label": de.ariaLabel, placeholder: de.placeholder, style: de.inputStyle, form: de.form, autofocus: de.autofocus, onCompositionstart: unref(F), onCompositionupdate: unref($), onCompositionend: unref(J), onInput: ne, onChange: Y, onKeydown: ve }), null, 16, ["id", "minlength", "maxlength", "type", "disabled", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form", "autofocus", "onCompositionstart", "onCompositionupdate", "onCompositionend"]), createCommentVNode(" suffix slot "), unref(ie) ? (openBlock(), createElementBlock("span", { key: 1, class: normalizeClass(unref(u).e("suffix")) }, [ createBaseVNode("span", { class: normalizeClass(unref(u).e("suffix-inner")) }, [ !unref(D) || !unref(B) || !unref(U) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ renderSlot(de.$slots, "suffix"), de.suffixIcon ? (openBlock(), createBlock(unref(Bt), { key: 0, class: normalizeClass(unref(u).e("icon")) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(de.suffixIcon))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true) ], 64)) : createCommentVNode("v-if", true), unref(D) ? (openBlock(), createBlock(unref(Bt), { key: 1, class: normalizeClass([unref(u).e("icon"), unref(u).e("clear")]), onMousedown: withModifiers(unref($a), ["prevent"]), onClick: Te }, { default: withCtx(() => [ createVNode(unref(yf2)) ]), _: 1 }, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true), unref(B) ? (openBlock(), createBlock(unref(Bt), { key: 2, class: normalizeClass([unref(u).e("icon"), unref(u).e("password")]), onClick: z }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(unref(I)))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true), unref(U) ? (openBlock(), createElementBlock("span", { key: 3, class: normalizeClass(unref(u).e("count")) }, [ createBaseVNode("span", { class: normalizeClass(unref(u).e("count-inner")) }, toDisplayString(unref(k)) + " / " + toDisplayString(de.maxlength), 3) ], 2)) : createCommentVNode("v-if", true), unref(A) && unref(P) && unref(C) ? (openBlock(), createBlock(unref(Bt), { key: 4, class: normalizeClass([ unref(u).e("icon"), unref(u).e("validateIcon"), unref(u).is("loading", unref(A) === "validating") ]) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(unref(P)))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true) ], 2) ], 2)) : createCommentVNode("v-if", true) ], 2), createCommentVNode(" append slot "), de.$slots.append ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(unref(u).be("group", "append")) }, [ renderSlot(de.$slots, "append") ], 2)) : createCommentVNode("v-if", true) ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [ createCommentVNode(" textarea "), createBaseVNode("textarea", mergeProps({ id: unref(p), ref_key: "textarea", ref: m, class: [unref(y).e("inner"), unref(u).is("focus", unref(E))] }, unref(l), { minlength: de.minlength, maxlength: de.maxlength, tabindex: de.tabindex, disabled: unref(f), readonly: de.readonly, autocomplete: de.autocomplete, style: unref(O), "aria-label": de.ariaLabel, placeholder: de.placeholder, form: de.form, autofocus: de.autofocus, rows: de.rows, onCompositionstart: unref(F), onCompositionupdate: unref($), onCompositionend: unref(J), onInput: ne, onFocus: unref(L), onBlur: unref(R), onChange: Y, onKeydown: ve }), null, 16, ["id", "minlength", "maxlength", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form", "autofocus", "rows", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onFocus", "onBlur"]), unref(U) ? (openBlock(), createElementBlock("span", { key: 0, style: normalizeStyle(T.value), class: normalizeClass(unref(u).e("count")) }, toDisplayString(unref(k)) + " / " + toDisplayString(de.maxlength), 7)) : createCommentVNode("v-if", true) ], 64)) ], 16, ["role"])); } }); var pC2 = at(fC2, [["__file", "input.vue"]]); var mC2 = vn2(pC2); var Ys2 = 4; var gC2 = { vertical: { offset: "offsetHeight", scroll: "scrollTop", scrollSize: "scrollHeight", size: "height", key: "vertical", axis: "Y", client: "clientY", direction: "top" }, horizontal: { offset: "offsetWidth", scroll: "scrollLeft", scrollSize: "scrollWidth", size: "width", key: "horizontal", axis: "X", client: "clientX", direction: "left" } }; var vC2 = ({ move: n, size: e, bar: t13 }) => ({ [t13.size]: e, transform: `translate${t13.axis}(${n}%)` }); var If2 = Symbol("scrollbarContextKey"); var yC2 = dt2({ vertical: Boolean, size: String, move: Number, ratio: { type: Number, required: true }, always: Boolean }); var bC2 = "Thumb"; var xC2 = defineComponent({ __name: "thumb", props: yC2, setup(n) { const e = n, t13 = inject(If2), i = it2("scrollbar"); t13 || na2(bC2, "can not inject scrollbar context"); const r = ref(), s = ref(), o = ref({}), a = ref(false); let c = false, l = false, d = rn2 ? document.onselectstart : null; const h6 = computed(() => gC2[e.vertical ? "vertical" : "horizontal"]), p = computed(() => vC2({ size: e.size, move: e.move, bar: h6.value })), g = computed(() => r.value[h6.value.offset] ** 2 / t13.wrapElement[h6.value.scrollSize] / e.ratio / s.value[h6.value.offset]), f = (M) => { var x; if (M.stopPropagation(), M.ctrlKey || [1, 2].includes(M.button)) return; (x = window.getSelection()) == null || x.removeAllRanges(), y(M); const _ = M.currentTarget; _ && (o.value[h6.value.axis] = _[h6.value.offset] - (M[h6.value.client] - _.getBoundingClientRect()[h6.value.direction])); }, u = (M) => { if (!s.value || !r.value || !t13.wrapElement) return; const x = Math.abs(M.target.getBoundingClientRect()[h6.value.direction] - M[h6.value.client]), _ = s.value[h6.value.offset] / 2, E = (x - _) * 100 * g.value / r.value[h6.value.offset]; t13.wrapElement[h6.value.scroll] = E * t13.wrapElement[h6.value.scrollSize] / 100; }, y = (M) => { M.stopImmediatePropagation(), c = true, document.addEventListener("mousemove", v), document.addEventListener("mouseup", m), d = document.onselectstart, document.onselectstart = () => false; }, v = (M) => { if (!r.value || !s.value || c === false) return; const x = o.value[h6.value.axis]; if (!x) return; const _ = (r.value.getBoundingClientRect()[h6.value.direction] - M[h6.value.client]) * -1, E = s.value[h6.value.offset] - x, L = (_ - E) * 100 * g.value / r.value[h6.value.offset]; t13.wrapElement[h6.value.scroll] = L * t13.wrapElement[h6.value.scrollSize] / 100; }, m = () => { c = false, o.value[h6.value.axis] = 0, document.removeEventListener("mousemove", v), document.removeEventListener("mouseup", m), T(), l && (a.value = false); }, w = () => { l = false, a.value = !!e.size; }, S = () => { l = true, a.value = c; }; onBeforeUnmount(() => { T(), document.removeEventListener("mouseup", m); }); const T = () => { document.onselectstart !== d && (document.onselectstart = d); }; return pn2(toRef(t13, "scrollbarElement"), "mousemove", w), pn2(toRef(t13, "scrollbarElement"), "mouseleave", S), (M, x) => (openBlock(), createBlock(Transition, { name: unref(i).b("fade"), persisted: "" }, { default: withCtx(() => [ withDirectives(createBaseVNode("div", { ref_key: "instance", ref: r, class: normalizeClass([unref(i).e("bar"), unref(i).is(unref(h6).key)]), onMousedown: u }, [ createBaseVNode("div", { ref_key: "thumb", ref: s, class: normalizeClass(unref(i).e("thumb")), style: normalizeStyle(unref(p)), onMousedown: f }, null, 38) ], 34), [ [vShow, M.always || a.value] ]) ]), _: 1 }, 8, ["name"])); } }); var Wm2 = at(xC2, [["__file", "thumb.vue"]]); var wC2 = dt2({ always: { type: Boolean, default: true }, minSize: { type: Number, required: true } }); var MC2 = defineComponent({ __name: "bar", props: wC2, setup(n, { expose: e }) { const t13 = n, i = inject(If2), r = ref(0), s = ref(0), o = ref(""), a = ref(""), c = ref(1), l = ref(1); return e({ handleScroll: (p) => { if (p) { const g = p.offsetHeight - Ys2, f = p.offsetWidth - Ys2; s.value = p.scrollTop * 100 / g * c.value, r.value = p.scrollLeft * 100 / f * l.value; } }, update: () => { const p = i == null ? void 0 : i.wrapElement; if (!p) return; const g = p.offsetHeight - Ys2, f = p.offsetWidth - Ys2, u = g ** 2 / p.scrollHeight, y = f ** 2 / p.scrollWidth, v = Math.max(u, t13.minSize), m = Math.max(y, t13.minSize); c.value = u / (g - u) / (v / (g - v)), l.value = y / (f - y) / (m / (f - m)), a.value = v + Ys2 < g ? `${v}px` : "", o.value = m + Ys2 < f ? `${m}px` : ""; } }), (p, g) => (openBlock(), createElementBlock(Fragment, null, [ createVNode(Wm2, { move: r.value, ratio: l.value, size: o.value, always: p.always }, null, 8, ["move", "ratio", "size", "always"]), createVNode(Wm2, { move: s.value, ratio: c.value, size: a.value, vertical: "", always: p.always }, null, 8, ["move", "ratio", "size", "always"]) ], 64)); } }); var SC2 = at(MC2, [["__file", "bar.vue"]]); var _C2 = dt2({ height: { type: [String, Number], default: "" }, maxHeight: { type: [String, Number], default: "" }, native: { type: Boolean, default: false }, wrapStyle: { type: Ye2([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, ...Gs2(["ariaLabel", "ariaOrientation"]) }); var TC2 = { scroll: ({ scrollTop: n, scrollLeft: e }) => [n, e].every(St) }; var dd2 = "ElScrollbar"; var EC2 = defineComponent({ name: dd2 }); var AC2 = defineComponent({ ...EC2, props: _C2, emits: TC2, setup(n, { expose: e, emit: t13 }) { const i = n, r = it2("scrollbar"); let s, o, a = 0, c = 0; const l = ref(), d = ref(), h6 = ref(), p = ref(), g = computed(() => { const T = {}; return i.height && (T.height = Zc2(i.height)), i.maxHeight && (T.maxHeight = Zc2(i.maxHeight)), [i.wrapStyle, T]; }), f = computed(() => [ i.wrapClass, r.e("wrap"), { [r.em("wrap", "hidden-default")]: !i.native } ]), u = computed(() => [r.e("view"), i.viewClass]), y = () => { var T; d.value && ((T = p.value) == null || T.handleScroll(d.value), a = d.value.scrollTop, c = d.value.scrollLeft, t13("scroll", { scrollTop: d.value.scrollTop, scrollLeft: d.value.scrollLeft })); }; function v(T, M) { Pn2(T) ? d.value.scrollTo(T) : St(T) && St(M) && d.value.scrollTo(T, M); } const m = (T) => { if (!St(T)) { en2(dd2, "value must be a number"); return; } d.value.scrollTop = T; }, w = (T) => { if (!St(T)) { en2(dd2, "value must be a number"); return; } d.value.scrollLeft = T; }, S = () => { var T; (T = p.value) == null || T.update(); }; return watch(() => i.noresize, (T) => { T ? (s == null || s(), o == null || o()) : ({ stop: s } = ii2(h6, S), o = pn2("resize", S)); }, { immediate: true }), watch(() => [i.maxHeight, i.height], () => { i.native || nextTick(() => { var T; S(), d.value && ((T = p.value) == null || T.handleScroll(d.value)); }); }), provide(If2, reactive({ scrollbarElement: l, wrapElement: d })), onActivated(() => { d.value && (d.value.scrollTop = a, d.value.scrollLeft = c); }), onMounted(() => { i.native || nextTick(() => { S(); }); }), onUpdated(() => S()), e({ wrapRef: d, update: S, scrollTo: v, setScrollTop: m, setScrollLeft: w, handleScroll: y }), (T, M) => (openBlock(), createElementBlock("div", { ref_key: "scrollbarRef", ref: l, class: normalizeClass(unref(r).b()) }, [ createBaseVNode("div", { ref_key: "wrapRef", ref: d, class: normalizeClass(unref(f)), style: normalizeStyle(unref(g)), tabindex: T.tabindex, onScroll: y }, [ (openBlock(), createBlock(resolveDynamicComponent(T.tag), { id: T.id, ref_key: "resizeRef", ref: h6, class: normalizeClass(unref(u)), style: normalizeStyle(T.viewStyle), role: T.role, "aria-label": T.ariaLabel, "aria-orientation": T.ariaOrientation }, { default: withCtx(() => [ renderSlot(T.$slots, "default") ]), _: 3 }, 8, ["id", "class", "style", "role", "aria-label", "aria-orientation"])) ], 46, ["tabindex"]), T.native ? createCommentVNode("v-if", true) : (openBlock(), createBlock(SC2, { key: 0, ref_key: "barRef", ref: p, always: T.always, "min-size": T.minSize }, null, 8, ["always", "min-size"])) ], 2)); } }); var CC2 = at(AC2, [["__file", "scrollbar.vue"]]); var LC2 = vn2(CC2); var Of2 = Symbol("popper"); var oy2 = Symbol("popperContent"); var RC2 = [ "dialog", "grid", "group", "listbox", "menu", "navigation", "tooltip", "tree" ]; var ay2 = dt2({ role: { type: String, values: RC2, default: "tooltip" } }); var PC2 = defineComponent({ name: "ElPopper", inheritAttrs: false }); var IC2 = defineComponent({ ...PC2, props: ay2, setup(n, { expose: e }) { const t13 = n, i = ref(), r = ref(), s = ref(), o = ref(), a = computed(() => t13.role), c = { triggerRef: i, popperInstanceRef: r, contentRef: s, referenceRef: o, role: a }; return e(c), provide(Of2, c), (l, d) => renderSlot(l.$slots, "default"); } }); var OC2 = at(IC2, [["__file", "popper.vue"]]); var ly2 = dt2({ arrowOffset: { type: Number, default: 5 } }); var DC2 = defineComponent({ name: "ElPopperArrow", inheritAttrs: false }); var NC2 = defineComponent({ ...DC2, props: ly2, setup(n, { expose: e }) { const t13 = n, i = it2("popper"), { arrowOffset: r, arrowRef: s, arrowStyle: o } = inject(oy2, void 0); return watch(() => t13.arrowOffset, (a) => { r.value = a; }), onBeforeUnmount(() => { s.value = void 0; }), e({ arrowRef: s }), (a, c) => (openBlock(), createElementBlock("span", { ref_key: "arrowRef", ref: s, class: normalizeClass(unref(i).e("arrow")), style: normalizeStyle(unref(o)), "data-popper-arrow": "" }, null, 6)); } }); var FC2 = at(NC2, [["__file", "arrow.vue"]]); var Ju2 = "ElOnlyChild"; var BC2 = defineComponent({ name: Ju2, setup(n, { slots: e, attrs: t13 }) { var i; const r = inject(q02), s = HA((i = r == null ? void 0 : r.setForwardRef) != null ? i : $a); return () => { var o; const a = (o = e.default) == null ? void 0 : o.call(e, t13); if (!a) return null; if (a.length > 1) return en2(Ju2, "requires exact only one valid child."), null; const c = cy2(a); return c ? withDirectives(cloneVNode(c, t13), [[s]]) : (en2(Ju2, "no valid child node found"), null); }; } }); function cy2(n) { if (!n) return null; const e = n; for (const t13 of e) { if (Pn2(t13)) switch (t13.type) { case Comment: continue; case Text: case "svg": return jm2(t13); case Fragment: return cy2(t13.children); default: return t13; } return jm2(t13); } return null; } function jm2(n) { const e = it2("only-child"); return createVNode("span", { class: e.e("content") }, [n]); } var uy2 = dt2({ virtualRef: { type: Ye2(Object) }, virtualTriggering: Boolean, onMouseenter: { type: Ye2(Function) }, onMouseleave: { type: Ye2(Function) }, onClick: { type: Ye2(Function) }, onKeydown: { type: Ye2(Function) }, onFocus: { type: Ye2(Function) }, onBlur: { type: Ye2(Function) }, onContextmenu: { type: Ye2(Function) }, id: String, open: Boolean }); var zC2 = defineComponent({ name: "ElPopperTrigger", inheritAttrs: false }); var UC2 = defineComponent({ ...zC2, props: uy2, setup(n, { expose: e }) { const t13 = n, { role: i, triggerRef: r } = inject(Of2, void 0); GA(r); const s = computed(() => a.value ? t13.id : void 0), o = computed(() => { if (i && i.value === "tooltip") return t13.open && t13.id ? t13.id : void 0; }), a = computed(() => { if (i && i.value !== "tooltip") return i.value; }), c = computed(() => a.value ? `${t13.open}` : void 0); let l; const d = [ "onMouseenter", "onMouseleave", "onClick", "onKeydown", "onFocus", "onBlur", "onContextmenu" ]; return onMounted(() => { watch(() => t13.virtualRef, (h6) => { h6 && (r.value = ir2(h6)); }, { immediate: true }), watch(r, (h6, p) => { l == null || l(), l = void 0, Ms2(h6) && (d.forEach((g) => { var f; const u = t13[g]; u && (h6.addEventListener(g.slice(2).toLowerCase(), u), (f = p == null ? void 0 : p.removeEventListener) == null || f.call(p, g.slice(2).toLowerCase(), u)); }), l = watch([s, o, a, c], (g) => { [ "aria-controls", "aria-describedby", "aria-haspopup", "aria-expanded" ].forEach((f, u) => { sr2(g[u]) ? h6.removeAttribute(f) : h6.setAttribute(f, g[u]); }); }, { immediate: true })), Ms2(p) && [ "aria-controls", "aria-describedby", "aria-haspopup", "aria-expanded" ].forEach((g) => p.removeAttribute(g)); }, { immediate: true }); }), onBeforeUnmount(() => { if (l == null || l(), l = void 0, r.value && Ms2(r.value)) { const h6 = r.value; d.forEach((p) => { const g = t13[p]; g && h6.removeEventListener(p.slice(2).toLowerCase(), g); }), r.value = void 0; } }), e({ triggerRef: r }), (h6, p) => h6.virtualTriggering ? createCommentVNode("v-if", true) : (openBlock(), createBlock(unref(BC2), mergeProps({ key: 0 }, h6.$attrs, { "aria-controls": unref(s), "aria-describedby": unref(o), "aria-expanded": unref(c), "aria-haspopup": unref(a) }), { default: withCtx(() => [ renderSlot(h6.$slots, "default") ]), _: 3 }, 16, ["aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup"])); } }); var VC2 = at(UC2, [["__file", "trigger.vue"]]); var qu2 = "focus-trap.focus-after-trapped"; var Ku2 = "focus-trap.focus-after-released"; var kC2 = "focus-trap.focusout-prevented"; var $m2 = { cancelable: true, bubbles: false }; var GC2 = { cancelable: true, bubbles: false }; var Zm2 = "focusAfterTrapped"; var Xm2 = "focusAfterReleased"; var HC2 = Symbol("elFocusTrap"); var Df2 = ref(); var bu2 = ref(0); var Nf2 = ref(0); var Bl2 = 0; var hy2 = (n) => { const e = [], t13 = document.createTreeWalker(n, NodeFilter.SHOW_ELEMENT, { acceptNode: (i) => { const r = i.tagName === "INPUT" && i.type === "hidden"; return i.disabled || i.hidden || r ? NodeFilter.FILTER_SKIP : i.tabIndex >= 0 || i === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; } }); for (; t13.nextNode(); ) e.push(t13.currentNode); return e; }; var Ym2 = (n, e) => { for (const t13 of n) if (!WC2(t13, e)) return t13; }; var WC2 = (n, e) => { if (false) return false; if (getComputedStyle(n).visibility === "hidden") return true; for (; n; ) { if (e && n === e) return false; if (getComputedStyle(n).display === "none") return true; n = n.parentElement; } return false; }; var jC2 = (n) => { const e = hy2(n), t13 = Ym2(e, n), i = Ym2(e.reverse(), n); return [t13, i]; }; var $C2 = (n) => n instanceof HTMLInputElement && "select" in n; var Ir2 = (n, e) => { if (n && n.focus) { const t13 = document.activeElement; n.focus({ preventScroll: true }), Nf2.value = window.performance.now(), n !== t13 && $C2(n) && e && n.select(); } }; function Jm2(n, e) { const t13 = [...n], i = n.indexOf(e); return i !== -1 && t13.splice(i, 1), t13; } var ZC2 = () => { let n = []; return { push: (i) => { const r = n[0]; r && i !== r && r.pause(), n = Jm2(n, i), n.unshift(i); }, remove: (i) => { var r, s; n = Jm2(n, i), (s = (r = n[0]) == null ? void 0 : r.resume) == null || s.call(r); } }; }; var XC2 = (n, e = false) => { const t13 = document.activeElement; for (const i of n) if (Ir2(i, e), document.activeElement !== t13) return; }; var qm2 = ZC2(); var YC2 = () => bu2.value > Nf2.value; var zl2 = () => { Df2.value = "pointer", bu2.value = window.performance.now(); }; var Km2 = () => { Df2.value = "keyboard", bu2.value = window.performance.now(); }; var JC2 = () => (onMounted(() => { Bl2 === 0 && (document.addEventListener("mousedown", zl2), document.addEventListener("touchstart", zl2), document.addEventListener("keydown", Km2)), Bl2++; }), onBeforeUnmount(() => { Bl2--, Bl2 <= 0 && (document.removeEventListener("mousedown", zl2), document.removeEventListener("touchstart", zl2), document.removeEventListener("keydown", Km2)); }), { focusReason: Df2, lastUserFocusTimestamp: bu2, lastAutomatedFocusTimestamp: Nf2 }); var Ul2 = (n) => new CustomEvent(kC2, { ...GC2, detail: n }); var qC2 = defineComponent({ name: "ElFocusTrap", inheritAttrs: false, props: { loop: Boolean, trapped: Boolean, focusTrapEl: Object, focusStartEl: { type: [Object, String], default: "first" } }, emits: [ Zm2, Xm2, "focusin", "focusout", "focusout-prevented", "release-requested" ], setup(n, { emit: e }) { const t13 = ref(); let i, r; const { focusReason: s } = JC2(); BA((f) => { n.trapped && !o.paused && e("release-requested", f); }); const o = { paused: false, pause() { this.paused = true; }, resume() { this.paused = false; } }, a = (f) => { if (!n.loop && !n.trapped || o.paused) return; const { key: u, altKey: y, ctrlKey: v, metaKey: m, currentTarget: w, shiftKey: S } = f, { loop: T } = n, M = u === Di2.tab && !y && !v && !m, x = document.activeElement; if (M && x) { const _ = w, [E, L] = jC2(_); if (E && L) { if (!S && x === L) { const C = Ul2({ focusReason: s.value }); e("focusout-prevented", C), C.defaultPrevented || (f.preventDefault(), T && Ir2(E, true)); } else if (S && [E, _].includes(x)) { const C = Ul2({ focusReason: s.value }); e("focusout-prevented", C), C.defaultPrevented || (f.preventDefault(), T && Ir2(L, true)); } } else if (x === _) { const C = Ul2({ focusReason: s.value }); e("focusout-prevented", C), C.defaultPrevented || f.preventDefault(); } } }; provide(HC2, { focusTrapRef: t13, onKeydown: a }), watch(() => n.focusTrapEl, (f) => { f && (t13.value = f); }, { immediate: true }), watch([t13], ([f], [u]) => { f && (f.addEventListener("keydown", a), f.addEventListener("focusin", d), f.addEventListener("focusout", h6)), u && (u.removeEventListener("keydown", a), u.removeEventListener("focusin", d), u.removeEventListener("focusout", h6)); }); const c = (f) => { e(Zm2, f); }, l = (f) => e(Xm2, f), d = (f) => { const u = unref(t13); if (!u) return; const y = f.target, v = f.relatedTarget, m = y && u.contains(y); n.trapped || v && u.contains(v) || (i = v), m && e("focusin", f), !o.paused && n.trapped && (m ? r = y : Ir2(r, true)); }, h6 = (f) => { const u = unref(t13); if (!(o.paused || !u)) if (n.trapped) { const y = f.relatedTarget; !sr2(y) && !u.contains(y) && setTimeout(() => { if (!o.paused && n.trapped) { const v = Ul2({ focusReason: s.value }); e("focusout-prevented", v), v.defaultPrevented || Ir2(r, true); } }, 0); } else { const y = f.target; y && u.contains(y) || e("focusout", f); } }; async function p() { await nextTick(); const f = unref(t13); if (f) { qm2.push(o); const u = f.contains(document.activeElement) ? i : document.activeElement; if (i = u, !f.contains(u)) { const v = new Event(qu2, $m2); f.addEventListener(qu2, c), f.dispatchEvent(v), v.defaultPrevented || nextTick(() => { let m = n.focusStartEl; On2(m) || (Ir2(m), document.activeElement !== m && (m = "first")), m === "first" && XC2(hy2(f), true), (document.activeElement === u || m === "container") && Ir2(f); }); } } } function g() { const f = unref(t13); if (f) { f.removeEventListener(qu2, c); const u = new CustomEvent(Ku2, { ...$m2, detail: { focusReason: s.value } }); f.addEventListener(Ku2, l), f.dispatchEvent(u), !u.defaultPrevented && (s.value == "keyboard" || !YC2() || f.contains(document.activeElement)) && Ir2(i ?? document.body), f.removeEventListener(Ku2, l), qm2.remove(o); } } return onMounted(() => { n.trapped && p(), watch(() => n.trapped, (f) => { f ? p() : g(); }); }), onBeforeUnmount(() => { n.trapped && g(), t13.value && (t13.value.removeEventListener("keydown", a), t13.value.removeEventListener("focusin", d), t13.value.removeEventListener("focusout", h6), t13.value = void 0); }), { onKeydown: a }; } }); function KC2(n, e, t13, i, r, s) { return renderSlot(n.$slots, "default", { handleKeydown: n.onKeydown }); } var QC2 = at(qC2, [["render", KC2], ["__file", "focus-trap.vue"]]); var e22 = ["fixed", "absolute"]; var t22 = dt2({ boundariesPadding: { type: Number, default: 0 }, fallbackPlacements: { type: Ye2(Array), default: void 0 }, gpuAcceleration: { type: Boolean, default: true }, offset: { type: Number, default: 12 }, placement: { type: String, values: ia, default: "bottom" }, popperOptions: { type: Ye2(Object), default: () => ({}) }, strategy: { type: String, values: e22, default: "absolute" } }); var dy2 = dt2({ ...t22, id: String, style: { type: Ye2([String, Array, Object]) }, className: { type: Ye2([String, Array, Object]) }, effect: { type: Ye2(String), default: "dark" }, visible: Boolean, enterable: { type: Boolean, default: true }, pure: Boolean, focusOnShow: { type: Boolean, default: false }, trapping: { type: Boolean, default: false }, popperClass: { type: Ye2([String, Array, Object]) }, popperStyle: { type: Ye2([String, Array, Object]) }, referenceEl: { type: Ye2(Object) }, triggerTargetEl: { type: Ye2(Object) }, stopPopperMouseEvent: { type: Boolean, default: true }, virtualTriggering: Boolean, zIndex: Number, ...Gs2(["ariaLabel"]) }); var n22 = { mouseenter: (n) => n instanceof MouseEvent, mouseleave: (n) => n instanceof MouseEvent, focus: () => true, blur: () => true, close: () => true }; var i22 = (n, e = []) => { const { placement: t13, strategy: i, popperOptions: r } = n, s = { placement: t13, strategy: i, ...r, modifiers: [...s22(n), ...e] }; return o22(s, r == null ? void 0 : r.modifiers), s; }; var r22 = (n) => { if (rn2) return ir2(n); }; function s22(n) { const { offset: e, gpuAcceleration: t13, fallbackPlacements: i } = n; 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: t13 } } ]; } function o22(n, e) { e && (n.modifiers = [...n.modifiers, ...e ?? []]); } var a22 = 0; var l22 = (n) => { const { popperInstanceRef: e, contentRef: t13, triggerRef: i, role: r } = inject(Of2, void 0), s = ref(), o = ref(), a = computed(() => ({ name: "eventListeners", enabled: !!n.visible })), c = computed(() => { var v; const m = unref(s), w = (v = unref(o)) != null ? v : a22; return { name: "arrow", enabled: !HT2(m), options: { element: m, padding: w } }; }), l = computed(() => ({ onFirstUpdate: () => { f(); }, ...i22(n, [ unref(c), unref(a) ]) })), d = computed(() => r22(n.referenceEl) || unref(i)), { attributes: h6, state: p, styles: g, update: f, forceUpdate: u, instanceRef: y } = DA(d, t13, l); return watch(y, (v) => e.value = v), onMounted(() => { watch(() => { var v; return (v = unref(d)) == null ? void 0 : v.getBoundingClientRect(); }, () => { f(); }); }), { attributes: h6, arrowRef: s, contentRef: t13, instanceRef: y, state: p, styles: g, role: r, forceUpdate: u, update: f }; }; var c22 = (n, { attributes: e, styles: t13, role: i }) => { const { nextZIndex: r } = ey2(), s = it2("popper"), o = computed(() => unref(e).popper), a = ref(St(n.zIndex) ? n.zIndex : r()), c = computed(() => [ s.b(), s.is("pure", n.pure), s.is(n.effect), n.popperClass ]), l = computed(() => [ { zIndex: unref(a) }, unref(t13).popper, n.popperStyle || {} ]), d = computed(() => i.value === "dialog" ? "false" : void 0), h6 = computed(() => unref(t13).arrow || {}); return { ariaModal: d, arrowStyle: h6, contentAttrs: o, contentClass: c, contentStyle: l, contentZIndex: a, updateZIndex: () => { a.value = St(n.zIndex) ? n.zIndex : r(); } }; }; var u22 = (n, e) => { const t13 = ref(false), i = ref(); return { focusStartRef: i, trapped: t13, onFocusAfterReleased: (l) => { var d; ((d = l.detail) == null ? void 0 : d.focusReason) !== "pointer" && (i.value = "first", e("blur")); }, onFocusAfterTrapped: () => { e("focus"); }, onFocusInTrap: (l) => { n.visible && !t13.value && (l.target && (i.value = l.target), t13.value = true); }, onFocusoutPrevented: (l) => { n.trapping || (l.detail.focusReason === "pointer" && l.preventDefault(), t13.value = false); }, onReleaseRequested: () => { t13.value = false, e("close"); } }; }; var h22 = defineComponent({ name: "ElPopperContent" }); var d22 = defineComponent({ ...h22, props: dy2, emits: n22, setup(n, { expose: e, emit: t13 }) { const i = n, { focusStartRef: r, trapped: s, onFocusAfterReleased: o, onFocusAfterTrapped: a, onFocusInTrap: c, onFocusoutPrevented: l, onReleaseRequested: d } = u22(i, t13), { attributes: h6, arrowRef: p, contentRef: g, styles: f, instanceRef: u, role: y, update: v } = l22(i), { ariaModal: m, arrowStyle: w, contentAttrs: S, contentClass: T, contentStyle: M, updateZIndex: x } = c22(i, { styles: f, attributes: h6, role: y }), _ = inject(qc2, void 0), E = ref(); provide(oy2, { arrowStyle: w, arrowRef: p, arrowOffset: E }), _ && provide(qc2, { ..._, addInputId: $a, removeInputId: $a }); let L; const R = (A = true) => { v(), A && x(); }, C = () => { R(false), i.visible && i.focusOnShow ? s.value = true : i.visible === false && (s.value = false); }; return onMounted(() => { watch(() => i.triggerTargetEl, (A, P) => { L == null || L(), L = void 0; const I = unref(A || g.value), b = unref(P || g.value); Ms2(I) && (L = watch([y, () => i.ariaLabel, m, () => i.id], (O) => { ["role", "aria-label", "aria-modal", "id"].forEach((N, D) => { sr2(O[D]) ? I.removeAttribute(N) : I.setAttribute(N, O[D]); }); }, { immediate: true })), b !== I && Ms2(b) && ["role", "aria-label", "aria-modal", "id"].forEach((O) => { b.removeAttribute(O); }); }, { immediate: true }), watch(() => i.visible, C, { immediate: true }); }), onBeforeUnmount(() => { L == null || L(), L = void 0; }), e({ popperContentRef: g, popperInstanceRef: u, updatePopper: R, contentStyle: M }), (A, P) => (openBlock(), createElementBlock("div", mergeProps({ ref_key: "contentRef", ref: g }, unref(S), { style: unref(M), class: unref(T), tabindex: "-1", onMouseenter: (I) => A.$emit("mouseenter", I), onMouseleave: (I) => A.$emit("mouseleave", I) }), [ createVNode(unref(QC2), { trapped: unref(s), "trap-on-focus-in": true, "focus-trap-el": unref(g), "focus-start-el": unref(r), onFocusAfterTrapped: unref(a), onFocusAfterReleased: unref(o), onFocusin: unref(c), onFocusoutPrevented: unref(l), onReleaseRequested: unref(d) }, { default: withCtx(() => [ renderSlot(A.$slots, "default") ]), _: 3 }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested"]) ], 16, ["onMouseenter", "onMouseleave"])); } }); var f22 = at(d22, [["__file", "content.vue"]]); var p22 = vn2(OC2); var Ff2 = Symbol("elTooltip"); var Zn2 = dt2({ ...VA, ...dy2, appendTo: { type: Ye2([String, Object]) }, content: { type: String, default: "" }, rawContent: Boolean, persistent: Boolean, visible: { type: Ye2(Boolean), default: null }, transition: String, teleported: { type: Boolean, default: true }, disabled: Boolean, ...Gs2(["ariaLabel"]) }); var qa2 = dt2({ ...uy2, disabled: Boolean, trigger: { type: Ye2([String, Array]), default: "hover" }, triggerKeys: { type: Ye2(Array), default: () => [Di2.enter, Di2.space] } }); var { useModelToggleProps: m22, useModelToggleEmits: g22, useModelToggle: v22 } = PE2("visible"); var y22 = dt2({ ...ay2, ...m22, ...Zn2, ...qa2, ...ly2, showArrow: { type: Boolean, default: true } }); var b22 = [ ...g22, "before-show", "before-hide", "show", "hide", "open", "close" ]; var x22 = (n, e) => Un2(n) ? n.includes(e) : n === e; var Js2 = (n, e, t13) => (i) => { x22(unref(n), e) && t13(i); }; var w22 = defineComponent({ name: "ElTooltipTrigger" }); var M22 = defineComponent({ ...w22, props: qa2, setup(n, { expose: e }) { const t13 = n, i = it2("tooltip"), { controlled: r, id: s, open: o, onOpen: a, onClose: c, onToggle: l } = inject(Ff2, void 0), d = ref(null), h6 = () => { if (unref(r) || t13.disabled) return true; }, p = toRef(t13, "trigger"), g = Qi2(h6, Js2(p, "hover", a)), f = Qi2(h6, Js2(p, "hover", c)), u = Qi2(h6, Js2(p, "click", (S) => { S.button === 0 && l(S); })), y = Qi2(h6, Js2(p, "focus", a)), v = Qi2(h6, Js2(p, "focus", c)), m = Qi2(h6, Js2(p, "contextmenu", (S) => { S.preventDefault(), l(S); })), w = Qi2(h6, (S) => { const { code: T } = S; t13.triggerKeys.includes(T) && (S.preventDefault(), l(S)); }); return e({ triggerRef: d }), (S, T) => (openBlock(), createBlock(unref(VC2), { id: unref(s), "virtual-ref": S.virtualRef, open: unref(o), "virtual-triggering": S.virtualTriggering, class: normalizeClass(unref(i).e("trigger")), onBlur: unref(v), onClick: unref(u), onContextmenu: unref(m), onFocus: unref(y), onMouseenter: unref(g), onMouseleave: unref(f), onKeydown: unref(w) }, { default: withCtx(() => [ renderSlot(S.$slots, "default") ]), _: 3 }, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"])); } }); var S22 = at(M22, [["__file", "trigger.vue"]]); var _22 = dt2({ to: { type: Ye2([String, Object]), required: true }, disabled: Boolean }); var T22 = defineComponent({ __name: "teleport", props: _22, setup(n) { return (e, t13) => e.disabled ? renderSlot(e.$slots, "default", { key: 0 }) : (openBlock(), createBlock(Teleport, { key: 1, to: e.to }, [ renderSlot(e.$slots, "default") ], 8, ["to"])); } }); var E22 = at(T22, [["__file", "teleport.vue"]]); var A22 = vn2(E22); var C22 = defineComponent({ name: "ElTooltipContent", inheritAttrs: false }); var L22 = defineComponent({ ...C22, props: Zn2, setup(n, { expose: e }) { const t13 = n, { selector: i } = J02(), r = it2("tooltip"), s = ref(null); let o; const { controlled: a, id: c, open: l, trigger: d, onClose: h6, onOpen: p, onShow: g, onHide: f, onBeforeShow: u, onBeforeHide: y } = inject(Ff2, void 0), v = computed(() => t13.transition || `${r.namespace.value}-fade-in-linear`), m = computed(() => false ? true : t13.persistent); onBeforeUnmount(() => { o == null || o(); }); const w = computed(() => unref(m) ? true : unref(l)), S = computed(() => t13.disabled ? false : unref(l)), T = computed(() => t13.appendTo || i.value), M = computed(() => { var b; return (b = t13.style) != null ? b : {}; }), x = ref(true), _ = () => { f(), x.value = true; }, E = () => { if (unref(a)) return true; }, L = Qi2(E, () => { t13.enterable && unref(d) === "hover" && p(); }), R = Qi2(E, () => { unref(d) === "hover" && h6(); }), C = () => { var b, O; (O = (b = s.value) == null ? void 0 : b.updatePopper) == null || O.call(b), u == null || u(); }, A = () => { y == null || y(); }, P = () => { g(), o = O12(computed(() => { var b; return (b = s.value) == null ? void 0 : b.popperContentRef; }), () => { if (unref(a)) return; unref(d) !== "hover" && h6(); }); }, I = () => { t13.virtualTriggering || h6(); }; return watch(() => unref(l), (b) => { b ? x.value = false : o == null || o(); }, { flush: "post" }), watch(() => t13.content, () => { var b, O; (O = (b = s.value) == null ? void 0 : b.updatePopper) == null || O.call(b); }), e({ contentRef: s }), (b, O) => (openBlock(), createBlock(unref(A22), { disabled: !b.teleported, to: unref(T) }, { default: withCtx(() => [ createVNode(Transition, { name: unref(v), onAfterLeave: _, onBeforeEnter: C, onAfterEnter: P, onBeforeLeave: A }, { default: withCtx(() => [ unref(w) ? withDirectives((openBlock(), createBlock(unref(f22), mergeProps({ key: 0, id: unref(c), ref_key: "contentRef", ref: s }, b.$attrs, { "aria-label": b.ariaLabel, "aria-hidden": x.value, "boundaries-padding": b.boundariesPadding, "fallback-placements": b.fallbackPlacements, "gpu-acceleration": b.gpuAcceleration, offset: b.offset, placement: b.placement, "popper-options": b.popperOptions, strategy: b.strategy, effect: b.effect, enterable: b.enterable, pure: b.pure, "popper-class": b.popperClass, "popper-style": [b.popperStyle, unref(M)], "reference-el": b.referenceEl, "trigger-target-el": b.triggerTargetEl, visible: unref(S), "z-index": b.zIndex, onMouseenter: unref(L), onMouseleave: unref(R), onBlur: I, onClose: unref(h6) }), { default: withCtx(() => [ renderSlot(b.$slots, "default") ]), _: 3 }, 16, ["id", "aria-label", "aria-hidden", "boundaries-padding", "fallback-placements", "gpu-acceleration", "offset", "placement", "popper-options", "strategy", "effect", "enterable", "pure", "popper-class", "popper-style", "reference-el", "trigger-target-el", "visible", "z-index", "onMouseenter", "onMouseleave", "onClose"])), [ [vShow, unref(S)] ]) : createCommentVNode("v-if", true) ]), _: 3 }, 8, ["name"]) ]), _: 3 }, 8, ["disabled", "to"])); } }); var R22 = at(L22, [["__file", "content.vue"]]); var P22 = defineComponent({ name: "ElTooltip" }); var I22 = defineComponent({ ...P22, props: y22, emits: b22, setup(n, { expose: e, emit: t13 }) { const i = n; UA(); const r = vu2(), s = ref(), o = ref(), a = () => { var v; const m = unref(s); m && ((v = m.popperInstanceRef) == null || v.update()); }, c = ref(false), l = ref(), { show: d, hide: h6, hasUpdateHandler: p } = v22({ indicator: c, toggleReason: l }), { onOpen: g, onClose: f } = kA({ showAfter: toRef(i, "showAfter"), hideAfter: toRef(i, "hideAfter"), autoClose: toRef(i, "autoClose"), open: d, close: h6 }), u = computed(() => gf2(i.visible) && !p.value); provide(Ff2, { controlled: u, id: r, open: readonly(c), trigger: toRef(i, "trigger"), onOpen: (v) => { g(v); }, onClose: (v) => { f(v); }, onToggle: (v) => { unref(c) ? f(v) : g(v); }, onShow: () => { t13("show", l.value); }, onHide: () => { t13("hide", l.value); }, onBeforeShow: () => { t13("before-show", l.value); }, onBeforeHide: () => { t13("before-hide", l.value); }, updatePopper: a }), watch(() => i.disabled, (v) => { v && c.value && (c.value = false); }); const y = (v) => { var m, w; const S = (w = (m = o.value) == null ? void 0 : m.contentRef) == null ? void 0 : w.popperContentRef, T = (v == null ? void 0 : v.relatedTarget) || document.activeElement; return S && S.contains(T); }; return onDeactivated(() => c.value && h6()), e({ popperRef: s, contentRef: o, isFocusInsideContent: y, updatePopper: a, onOpen: g, onClose: f, hide: h6 }), (v, m) => (openBlock(), createBlock(unref(p22), { ref_key: "popperRef", ref: s, role: v.role }, { default: withCtx(() => [ createVNode(S22, { disabled: v.disabled, trigger: v.trigger, "trigger-keys": v.triggerKeys, "virtual-ref": v.virtualRef, "virtual-triggering": v.virtualTriggering }, { default: withCtx(() => [ v.$slots.default ? renderSlot(v.$slots, "default", { key: 0 }) : createCommentVNode("v-if", true) ]), _: 3 }, 8, ["disabled", "trigger", "trigger-keys", "virtual-ref", "virtual-triggering"]), createVNode(R22, { ref_key: "contentRef", ref: o, "aria-label": v.ariaLabel, "boundaries-padding": v.boundariesPadding, content: v.content, disabled: v.disabled, effect: v.effect, enterable: v.enterable, "fallback-placements": v.fallbackPlacements, "hide-after": v.hideAfter, "gpu-acceleration": v.gpuAcceleration, offset: v.offset, persistent: v.persistent, "popper-class": v.popperClass, "popper-style": v.popperStyle, placement: v.placement, "popper-options": v.popperOptions, pure: v.pure, "raw-content": v.rawContent, "reference-el": v.referenceEl, "trigger-target-el": v.triggerTargetEl, "show-after": v.showAfter, strategy: v.strategy, teleported: v.teleported, transition: v.transition, "virtual-triggering": v.virtualTriggering, "z-index": v.zIndex, "append-to": v.appendTo }, { default: withCtx(() => [ renderSlot(v.$slots, "content", {}, () => [ v.rawContent ? (openBlock(), createElementBlock("span", { key: 0, innerHTML: v.content }, null, 8, ["innerHTML"])) : (openBlock(), createElementBlock("span", { key: 1 }, toDisplayString(v.content), 1)) ]), v.showArrow ? (openBlock(), createBlock(unref(FC2), { key: 0, "arrow-offset": v.arrowOffset }, null, 8, ["arrow-offset"])) : createCommentVNode("v-if", true) ]), _: 3 }, 8, ["aria-label", "boundaries-padding", "content", "disabled", "effect", "enterable", "fallback-placements", "hide-after", "gpu-acceleration", "offset", "persistent", "popper-class", "popper-style", "placement", "popper-options", "pure", "raw-content", "reference-el", "trigger-target-el", "show-after", "strategy", "teleported", "transition", "virtual-triggering", "z-index", "append-to"]) ]), _: 3 }, 8, ["role"])); } }); var O22 = at(I22, [["__file", "tooltip.vue"]]); var Bf2 = vn2(O22); var fy2 = Symbol("buttonGroupContextKey"); var D22 = (n, e) => { SE2({ from: "type.text", replacement: "link", version: "3.0.0", scope: "props", ref: "https://element-plus.org/en-US/component/button.html#button-attributes" }, computed(() => n.type === "text")); const t13 = inject(fy2, void 0), i = Lf2("button"), { form: r } = gl2(), s = ra2(computed(() => t13 == null ? void 0 : t13.size)), o = yu2(), a = ref(), c = useSlots(), l = computed(() => n.type || (t13 == null ? void 0 : t13.type) || ""), d = computed(() => { var f, u, y; return (y = (u = n.autoInsertSpace) != null ? u : (f = i.value) == null ? void 0 : f.autoInsertSpace) != null ? y : false; }), h6 = computed(() => n.tag === "button" ? { ariaDisabled: o.value || n.loading, disabled: o.value || n.loading, autofocus: n.autofocus, type: n.nativeType } : {}), p = computed(() => { var f; const u = (f = c.default) == null ? void 0 : f.call(c); if (d.value && (u == null ? void 0 : u.length) === 1) { const y = u[0]; if ((y == null ? void 0 : y.type) === Text) { const v = y.children; return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(v.trim()); } } return false; }); return { _disabled: o, _size: s, _type: l, _ref: a, _props: h6, shouldAddSpace: p, handleClick: (f) => { if (o.value || n.loading) { f.stopPropagation(); return; } n.nativeType === "reset" && (r == null || r.resetFields()), e("click", f); } }; }; var N22 = [ "default", "primary", "success", "warning", "info", "danger", "text", "" ]; var F22 = ["button", "submit", "reset"]; var fd2 = dt2({ size: Do2, disabled: Boolean, type: { type: String, values: N22, default: "" }, icon: { type: Zr2 }, nativeType: { type: String, values: F22, default: "button" }, loading: Boolean, loadingIcon: { type: Zr2, default: () => P0 }, 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: Ye2([String, Object]), default: "button" } }); var B22 = { click: (n) => n instanceof MouseEvent }; function Mn2(n, e) { z22(n) && (n = "100%"); var t13 = U22(n); return n = e === 360 ? n : Math.min(e, Math.max(0, parseFloat(n))), t13 && (n = parseInt(String(n * e), 10) / 100), Math.abs(n - e) < 1e-6 ? 1 : (e === 360 ? n = (n < 0 ? n % e + e : n % e) / parseFloat(String(e)) : n = n % e / parseFloat(String(e)), n); } function Vl2(n) { return Math.min(1, Math.max(0, n)); } function z22(n) { return typeof n == "string" && n.indexOf(".") !== -1 && parseFloat(n) === 1; } function U22(n) { return typeof n == "string" && n.indexOf("%") !== -1; } function py2(n) { return n = parseFloat(n), (isNaN(n) || n < 0 || n > 1) && (n = 1), n; } function kl2(n) { return n <= 1 ? "".concat(Number(n) * 100, "%") : n; } function bs(n) { return n.length === 1 ? "0" + n : String(n); } function V22(n, e, t13) { return { r: Mn2(n, 255) * 255, g: Mn2(e, 255) * 255, b: Mn2(t13, 255) * 255 }; } function Qm2(n, e, t13) { n = Mn2(n, 255), e = Mn2(e, 255), t13 = Mn2(t13, 255); var i = Math.max(n, e, t13), r = Math.min(n, e, t13), s = 0, o = 0, a = (i + r) / 2; if (i === r) o = 0, s = 0; else { var c = i - r; switch (o = a > 0.5 ? c / (2 - i - r) : c / (i + r), i) { case n: s = (e - t13) / c + (e < t13 ? 6 : 0); break; case e: s = (t13 - n) / c + 2; break; case t13: s = (n - e) / c + 4; break; } s /= 6; } return { h: s, s: o, l: a }; } function Qu2(n, e, t13) { return t13 < 0 && (t13 += 1), t13 > 1 && (t13 -= 1), t13 < 1 / 6 ? n + (e - n) * (6 * t13) : t13 < 1 / 2 ? e : t13 < 2 / 3 ? n + (e - n) * (2 / 3 - t13) * 6 : n; } function k22(n, e, t13) { var i, r, s; if (n = Mn2(n, 360), e = Mn2(e, 100), t13 = Mn2(t13, 100), e === 0) r = t13, s = t13, i = t13; else { var o = t13 < 0.5 ? t13 * (1 + e) : t13 + e - t13 * e, a = 2 * t13 - o; i = Qu2(a, o, n + 1 / 3), r = Qu2(a, o, n), s = Qu2(a, o, n - 1 / 3); } return { r: i * 255, g: r * 255, b: s * 255 }; } function eg2(n, e, t13) { n = Mn2(n, 255), e = Mn2(e, 255), t13 = Mn2(t13, 255); var i = Math.max(n, e, t13), r = Math.min(n, e, t13), s = 0, o = i, a = i - r, c = i === 0 ? 0 : a / i; if (i === r) s = 0; else { switch (i) { case n: s = (e - t13) / a + (e < t13 ? 6 : 0); break; case e: s = (t13 - n) / a + 2; break; case t13: s = (n - e) / a + 4; break; } s /= 6; } return { h: s, s: c, v: o }; } function G22(n, e, t13) { n = Mn2(n, 360) * 6, e = Mn2(e, 100), t13 = Mn2(t13, 100); var i = Math.floor(n), r = n - i, s = t13 * (1 - e), o = t13 * (1 - r * e), a = t13 * (1 - (1 - r) * e), c = i % 6, l = [t13, o, s, s, a, t13][c], d = [a, t13, t13, o, s, s][c], h6 = [s, s, a, t13, t13, o][c]; return { r: l * 255, g: d * 255, b: h6 * 255 }; } function tg2(n, e, t13, i) { var r = [ bs(Math.round(n).toString(16)), bs(Math.round(e).toString(16)), bs(Math.round(t13).toString(16)) ]; return i && r[0].startsWith(r[0].charAt(1)) && r[1].startsWith(r[1].charAt(1)) && r[2].startsWith(r[2].charAt(1)) ? r[0].charAt(0) + r[1].charAt(0) + r[2].charAt(0) : r.join(""); } function H22(n, e, t13, i, r) { var s = [ bs(Math.round(n).toString(16)), bs(Math.round(e).toString(16)), bs(Math.round(t13).toString(16)), bs(W22(i)) ]; return r && s[0].startsWith(s[0].charAt(1)) && s[1].startsWith(s[1].charAt(1)) && s[2].startsWith(s[2].charAt(1)) && s[3].startsWith(s[3].charAt(1)) ? s[0].charAt(0) + s[1].charAt(0) + s[2].charAt(0) + s[3].charAt(0) : s.join(""); } function W22(n) { return Math.round(parseFloat(n) * 255).toString(16); } function ng2(n) { return $n2(n) / 255; } function $n2(n) { return parseInt(n, 16); } function j22(n) { return { r: n >> 16, g: (n & 65280) >> 8, b: n & 255 }; } var pd2 = { 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 $22(n) { var e = { r: 0, g: 0, b: 0 }, t13 = 1, i = null, r = null, s = null, o = false, a = false; return typeof n == "string" && (n = Y22(n)), typeof n == "object" && (ji2(n.r) && ji2(n.g) && ji2(n.b) ? (e = V22(n.r, n.g, n.b), o = true, a = String(n.r).substr(-1) === "%" ? "prgb" : "rgb") : ji2(n.h) && ji2(n.s) && ji2(n.v) ? (i = kl2(n.s), r = kl2(n.v), e = G22(n.h, i, r), o = true, a = "hsv") : ji2(n.h) && ji2(n.s) && ji2(n.l) && (i = kl2(n.s), s = kl2(n.l), e = k22(n.h, i, s), o = true, a = "hsl"), Object.prototype.hasOwnProperty.call(n, "a") && (t13 = n.a)), t13 = py2(t13), { ok: o, format: n.format || a, 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: t13 }; } var Z22 = "[-\\+]?\\d+%?"; var X22 = "[-\\+]?\\d*\\.\\d+%?"; var zr2 = "(?:".concat(X22, ")|(?:").concat(Z22, ")"); var eh2 = "[\\s|\\(]+(".concat(zr2, ")[,|\\s]+(").concat(zr2, ")[,|\\s]+(").concat(zr2, ")\\s*\\)?"); var th2 = "[\\s|\\(]+(".concat(zr2, ")[,|\\s]+(").concat(zr2, ")[,|\\s]+(").concat(zr2, ")[,|\\s]+(").concat(zr2, ")\\s*\\)?"); var mi2 = { CSS_UNIT: new RegExp(zr2), rgb: new RegExp("rgb" + eh2), rgba: new RegExp("rgba" + th2), hsl: new RegExp("hsl" + eh2), hsla: new RegExp("hsla" + th2), hsv: new RegExp("hsv" + eh2), hsva: new RegExp("hsva" + th2), 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 Y22(n) { if (n = n.trim().toLowerCase(), n.length === 0) return false; var e = false; if (pd2[n]) n = pd2[n], e = true; else if (n === "transparent") return { r: 0, g: 0, b: 0, a: 0, format: "name" }; var t13 = mi2.rgb.exec(n); return t13 ? { r: t13[1], g: t13[2], b: t13[3] } : (t13 = mi2.rgba.exec(n), t13 ? { r: t13[1], g: t13[2], b: t13[3], a: t13[4] } : (t13 = mi2.hsl.exec(n), t13 ? { h: t13[1], s: t13[2], l: t13[3] } : (t13 = mi2.hsla.exec(n), t13 ? { h: t13[1], s: t13[2], l: t13[3], a: t13[4] } : (t13 = mi2.hsv.exec(n), t13 ? { h: t13[1], s: t13[2], v: t13[3] } : (t13 = mi2.hsva.exec(n), t13 ? { h: t13[1], s: t13[2], v: t13[3], a: t13[4] } : (t13 = mi2.hex8.exec(n), t13 ? { r: $n2(t13[1]), g: $n2(t13[2]), b: $n2(t13[3]), a: ng2(t13[4]), format: e ? "name" : "hex8" } : (t13 = mi2.hex6.exec(n), t13 ? { r: $n2(t13[1]), g: $n2(t13[2]), b: $n2(t13[3]), format: e ? "name" : "hex" } : (t13 = mi2.hex4.exec(n), t13 ? { r: $n2(t13[1] + t13[1]), g: $n2(t13[2] + t13[2]), b: $n2(t13[3] + t13[3]), a: ng2(t13[4] + t13[4]), format: e ? "name" : "hex8" } : (t13 = mi2.hex3.exec(n), t13 ? { r: $n2(t13[1] + t13[1]), g: $n2(t13[2] + t13[2]), b: $n2(t13[3] + t13[3]), format: e ? "name" : "hex" } : false))))))))); } function ji2(n) { return !!mi2.CSS_UNIT.exec(String(n)); } var J22 = ( /** @class */ function() { function n(e, t13) { e === void 0 && (e = ""), t13 === void 0 && (t13 = {}); var i; if (e instanceof n) return e; typeof e == "number" && (e = j22(e)), this.originalInput = e; var r = $22(e); this.originalInput = e, this.r = r.r, this.g = r.g, this.b = r.b, this.a = r.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (i = t13.format) !== null && i !== void 0 ? i : r.format, this.gradientType = t13.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 = r.ok; } return n.prototype.isDark = function() { return this.getBrightness() < 128; }, n.prototype.isLight = function() { return !this.isDark(); }, n.prototype.getBrightness = function() { var e = this.toRgb(); return (e.r * 299 + e.g * 587 + e.b * 114) / 1e3; }, n.prototype.getLuminance = function() { var e = this.toRgb(), t13, i, r, s = e.r / 255, o = e.g / 255, a = e.b / 255; return s <= 0.03928 ? t13 = s / 12.92 : t13 = Math.pow((s + 0.055) / 1.055, 2.4), o <= 0.03928 ? i = o / 12.92 : i = Math.pow((o + 0.055) / 1.055, 2.4), a <= 0.03928 ? r = a / 12.92 : r = Math.pow((a + 0.055) / 1.055, 2.4), 0.2126 * t13 + 0.7152 * i + 0.0722 * r; }, n.prototype.getAlpha = function() { return this.a; }, n.prototype.setAlpha = function(e) { return this.a = py2(e), this.roundA = Math.round(100 * this.a) / 100, this; }, n.prototype.isMonochrome = function() { var e = this.toHsl().s; return e === 0; }, n.prototype.toHsv = function() { var e = eg2(this.r, this.g, this.b); return { h: e.h * 360, s: e.s, v: e.v, a: this.a }; }, n.prototype.toHsvString = function() { var e = eg2(this.r, this.g, this.b), t13 = Math.round(e.h * 360), i = Math.round(e.s * 100), r = Math.round(e.v * 100); return this.a === 1 ? "hsv(".concat(t13, ", ").concat(i, "%, ").concat(r, "%)") : "hsva(".concat(t13, ", ").concat(i, "%, ").concat(r, "%, ").concat(this.roundA, ")"); }, n.prototype.toHsl = function() { var e = Qm2(this.r, this.g, this.b); return { h: e.h * 360, s: e.s, l: e.l, a: this.a }; }, n.prototype.toHslString = function() { var e = Qm2(this.r, this.g, this.b), t13 = Math.round(e.h * 360), i = Math.round(e.s * 100), r = Math.round(e.l * 100); return this.a === 1 ? "hsl(".concat(t13, ", ").concat(i, "%, ").concat(r, "%)") : "hsla(".concat(t13, ", ").concat(i, "%, ").concat(r, "%, ").concat(this.roundA, ")"); }, n.prototype.toHex = function(e) { return e === void 0 && (e = false), tg2(this.r, this.g, this.b, e); }, n.prototype.toHexString = function(e) { return e === void 0 && (e = false), "#" + this.toHex(e); }, n.prototype.toHex8 = function(e) { return e === void 0 && (e = false), H22(this.r, this.g, this.b, this.a, e); }, n.prototype.toHex8String = function(e) { return e === void 0 && (e = false), "#" + this.toHex8(e); }, n.prototype.toHexShortString = function(e) { return e === void 0 && (e = false), this.a === 1 ? this.toHexString(e) : this.toHex8String(e); }, n.prototype.toRgb = function() { return { r: Math.round(this.r), g: Math.round(this.g), b: Math.round(this.b), a: this.a }; }, n.prototype.toRgbString = function() { var e = Math.round(this.r), t13 = Math.round(this.g), i = Math.round(this.b); return this.a === 1 ? "rgb(".concat(e, ", ").concat(t13, ", ").concat(i, ")") : "rgba(".concat(e, ", ").concat(t13, ", ").concat(i, ", ").concat(this.roundA, ")"); }, n.prototype.toPercentageRgb = function() { var e = function(t13) { return "".concat(Math.round(Mn2(t13, 255) * 100), "%"); }; return { r: e(this.r), g: e(this.g), b: e(this.b), a: this.a }; }, n.prototype.toPercentageRgbString = function() { var e = function(t13) { return Math.round(Mn2(t13, 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, ")"); }, n.prototype.toName = function() { if (this.a === 0) return "transparent"; if (this.a < 1) return false; for (var e = "#" + tg2(this.r, this.g, this.b, false), t13 = 0, i = Object.entries(pd2); t13 < i.length; t13++) { var r = i[t13], s = r[0], o = r[1]; if (e === o) return s; } return false; }, n.prototype.toString = function(e) { var t13 = !!e; e = e ?? this.format; var i = false, r = this.a < 1 && this.a >= 0, s = !t13 && r && (e.startsWith("hex") || e === "name"); return s ? 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(true)), e === "hex4" && (i = this.toHex8String(true)), e === "hex8" && (i = this.toHex8String()), e === "name" && (i = this.toName()), e === "hsl" && (i = this.toHslString()), e === "hsv" && (i = this.toHsvString()), i || this.toHexString()); }, n.prototype.toNumber = function() { return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b); }, n.prototype.clone = function() { return new n(this.toString()); }, n.prototype.lighten = function(e) { e === void 0 && (e = 10); var t13 = this.toHsl(); return t13.l += e / 100, t13.l = Vl2(t13.l), new n(t13); }, n.prototype.brighten = function(e) { e === void 0 && (e = 10); var t13 = this.toRgb(); return t13.r = Math.max(0, Math.min(255, t13.r - Math.round(255 * -(e / 100)))), t13.g = Math.max(0, Math.min(255, t13.g - Math.round(255 * -(e / 100)))), t13.b = Math.max(0, Math.min(255, t13.b - Math.round(255 * -(e / 100)))), new n(t13); }, n.prototype.darken = function(e) { e === void 0 && (e = 10); var t13 = this.toHsl(); return t13.l -= e / 100, t13.l = Vl2(t13.l), new n(t13); }, n.prototype.tint = function(e) { return e === void 0 && (e = 10), this.mix("white", e); }, n.prototype.shade = function(e) { return e === void 0 && (e = 10), this.mix("black", e); }, n.prototype.desaturate = function(e) { e === void 0 && (e = 10); var t13 = this.toHsl(); return t13.s -= e / 100, t13.s = Vl2(t13.s), new n(t13); }, n.prototype.saturate = function(e) { e === void 0 && (e = 10); var t13 = this.toHsl(); return t13.s += e / 100, t13.s = Vl2(t13.s), new n(t13); }, n.prototype.greyscale = function() { return this.desaturate(100); }, n.prototype.spin = function(e) { var t13 = this.toHsl(), i = (t13.h + e) % 360; return t13.h = i < 0 ? 360 + i : i, new n(t13); }, n.prototype.mix = function(e, t13) { t13 === void 0 && (t13 = 50); var i = this.toRgb(), r = new n(e).toRgb(), s = t13 / 100, o = { r: (r.r - i.r) * s + i.r, g: (r.g - i.g) * s + i.g, b: (r.b - i.b) * s + i.b, a: (r.a - i.a) * s + i.a }; return new n(o); }, n.prototype.analogous = function(e, t13) { e === void 0 && (e = 6), t13 === void 0 && (t13 = 30); var i = this.toHsl(), r = 360 / t13, s = [this]; for (i.h = (i.h - (r * e >> 1) + 720) % 360; --e; ) i.h = (i.h + r) % 360, s.push(new n(i)); return s; }, n.prototype.complement = function() { var e = this.toHsl(); return e.h = (e.h + 180) % 360, new n(e); }, n.prototype.monochromatic = function(e) { e === void 0 && (e = 6); for (var t13 = this.toHsv(), i = t13.h, r = t13.s, s = t13.v, o = [], a = 1 / e; e--; ) o.push(new n({ h: i, s: r, v: s })), s = (s + a) % 1; return o; }, n.prototype.splitcomplement = function() { var e = this.toHsl(), t13 = e.h; return [ this, new n({ h: (t13 + 72) % 360, s: e.s, l: e.l }), new n({ h: (t13 + 216) % 360, s: e.s, l: e.l }) ]; }, n.prototype.onBackground = function(e) { var t13 = this.toRgb(), i = new n(e).toRgb(), r = t13.a + i.a * (1 - t13.a); return new n({ r: (t13.r * t13.a + i.r * i.a * (1 - t13.a)) / r, g: (t13.g * t13.a + i.g * i.a * (1 - t13.a)) / r, b: (t13.b * t13.a + i.b * i.a * (1 - t13.a)) / r, a: r }); }, n.prototype.triad = function() { return this.polyad(3); }, n.prototype.tetrad = function() { return this.polyad(4); }, n.prototype.polyad = function(e) { for (var t13 = this.toHsl(), i = t13.h, r = [this], s = 360 / e, o = 1; o < e; o++) r.push(new n({ h: (i + o * s) % 360, s: t13.s, l: t13.l })); return r; }, n.prototype.equals = function(e) { return this.toRgbString() === new n(e).toRgbString(); }, n; }() ); function Mr2(n, e = 20) { return n.mix("#141414", e).toString(); } function q22(n) { const e = yu2(), t13 = it2("button"); return computed(() => { let i = {}, r = n.color; if (r) { const s = r.match(/var\((.*?)\)/); s && (r = window.getComputedStyle(window.document.documentElement).getPropertyValue(s[1])); const o = new J22(r), a = n.dark ? o.tint(20).toString() : Mr2(o, 20); if (n.plain) i = t13.cssVarBlock({ "bg-color": n.dark ? Mr2(o, 90) : o.tint(90).toString(), "text-color": r, "border-color": n.dark ? Mr2(o, 50) : o.tint(50).toString(), "hover-text-color": `var(${t13.cssVarName("color-white")})`, "hover-bg-color": r, "hover-border-color": r, "active-bg-color": a, "active-text-color": `var(${t13.cssVarName("color-white")})`, "active-border-color": a }), e.value && (i[t13.cssVarBlockName("disabled-bg-color")] = n.dark ? Mr2(o, 90) : o.tint(90).toString(), i[t13.cssVarBlockName("disabled-text-color")] = n.dark ? Mr2(o, 50) : o.tint(50).toString(), i[t13.cssVarBlockName("disabled-border-color")] = n.dark ? Mr2(o, 80) : o.tint(80).toString()); else { const c = n.dark ? Mr2(o, 30) : o.tint(30).toString(), l = o.isDark() ? `var(${t13.cssVarName("color-white")})` : `var(${t13.cssVarName("color-black")})`; if (i = t13.cssVarBlock({ "bg-color": r, "text-color": l, "border-color": r, "hover-bg-color": c, "hover-text-color": l, "hover-border-color": c, "active-bg-color": a, "active-border-color": a }), e.value) { const d = n.dark ? Mr2(o, 50) : o.tint(50).toString(); i[t13.cssVarBlockName("disabled-bg-color")] = d, i[t13.cssVarBlockName("disabled-text-color")] = n.dark ? "rgba(255, 255, 255, 0.5)" : `var(${t13.cssVarName("color-white")})`, i[t13.cssVarBlockName("disabled-border-color")] = d; } } } return i; }); } var K22 = defineComponent({ name: "ElButton" }); var Q22 = defineComponent({ ...K22, props: fd2, emits: B22, setup(n, { expose: e, emit: t13 }) { const i = n, r = q22(i), s = it2("button"), { _ref: o, _size: a, _type: c, _disabled: l, _props: d, shouldAddSpace: h6, handleClick: p } = D22(i, t13), g = computed(() => [ s.b(), s.m(c.value), s.m(a.value), s.is("disabled", l.value), s.is("loading", i.loading), s.is("plain", i.plain), s.is("round", i.round), s.is("circle", i.circle), s.is("text", i.text), s.is("link", i.link), s.is("has-bg", i.bg) ]); return e({ ref: o, size: a, type: c, disabled: l, shouldAddSpace: h6 }), (f, u) => (openBlock(), createBlock(resolveDynamicComponent(f.tag), mergeProps({ ref_key: "_ref", ref: o }, unref(d), { class: unref(g), style: unref(r), onClick: unref(p) }), { default: withCtx(() => [ f.loading ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ f.$slots.loading ? renderSlot(f.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(unref(Bt), { key: 1, class: normalizeClass(unref(s).is("loading")) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(f.loadingIcon))) ]), _: 1 }, 8, ["class"])) ], 64)) : f.icon || f.$slots.icon ? (openBlock(), createBlock(unref(Bt), { key: 1 }, { default: withCtx(() => [ f.icon ? (openBlock(), createBlock(resolveDynamicComponent(f.icon), { key: 0 })) : renderSlot(f.$slots, "icon", { key: 1 }) ]), _: 3 })) : createCommentVNode("v-if", true), f.$slots.default ? (openBlock(), createElementBlock("span", { key: 2, class: normalizeClass({ [unref(s).em("text", "expand")]: unref(h6) }) }, [ renderSlot(f.$slots, "default") ], 2)) : createCommentVNode("v-if", true) ]), _: 3 }, 16, ["class", "style", "onClick"])); } }); var eL2 = at(Q22, [["__file", "button.vue"]]); var tL2 = { size: fd2.size, type: fd2.type }; var nL2 = defineComponent({ name: "ElButtonGroup" }); var iL2 = defineComponent({ ...nL2, props: tL2, setup(n) { const e = n; provide(fy2, reactive({ size: toRef(e, "size"), type: toRef(e, "type") })); const t13 = it2("button"); return (i, r) => (openBlock(), createElementBlock("div", { class: normalizeClass(unref(t13).b("group")) }, [ renderSlot(i.$slots, "default") ], 2)); } }); var my2 = at(iL2, [["__file", "button-group.vue"]]); var sa2 = vn2(eL2, { ButtonGroup: my2 }); gr(my2); var Fr2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function rL2(n) { return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n; } function xu2(n) { if (n.__esModule) return n; var e = n.default; if (typeof e == "function") { var t13 = function i() { return this instanceof i ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments); }; t13.prototype = e.prototype; } else t13 = {}; return Object.defineProperty(t13, "__esModule", { value: true }), Object.keys(n).forEach(function(i) { var r = Object.getOwnPropertyDescriptor(n, i); Object.defineProperty(t13, i, r.get ? r : { enumerable: true, get: function() { return n[i]; } }); }), t13; } var Or = /* @__PURE__ */ new Map(); if (rn2) { let n; document.addEventListener("mousedown", (e) => n = e), document.addEventListener("mouseup", (e) => { if (n) { for (const t13 of Or.values()) for (const { documentHandler: i } of t13) i(e, n); n = void 0; } }); } function ig2(n, e) { let t13 = []; return Array.isArray(e.arg) ? t13 = e.arg : Ms2(e.arg) && t13.push(e.arg), function(i, r) { const s = e.instance.popperRef, o = i.target, a = r == null ? void 0 : r.target, c = !e || !e.instance, l = !o || !a, d = n.contains(o) || n.contains(a), h6 = n === o, p = t13.length && t13.some((f) => f == null ? void 0 : f.contains(o)) || t13.length && t13.includes(a), g = s && (s.contains(o) || s.contains(a)); c || l || d || h6 || p || g || e.value(i, r); }; } var sL2 = { beforeMount(n, e) { Or.has(n) || Or.set(n, []), Or.get(n).push({ documentHandler: ig2(n, e), bindingFn: e.value }); }, updated(n, e) { Or.has(n) || Or.set(n, []); const t13 = Or.get(n), i = t13.findIndex((s) => s.bindingFn === e.oldValue), r = { documentHandler: ig2(n, e), bindingFn: e.value }; i >= 0 ? t13.splice(i, 1, r) : t13.push(r); }, unmounted(n) { Or.delete(n); } }; var oL2 = 100; var aL2 = 600; var rg2 = { beforeMount(n, e) { const t13 = e.value, { interval: i = oL2, delay: r = aL2 } = Ln2(t13) ? {} : t13; let s, o; const a = () => Ln2(t13) ? t13() : t13.handler(), c = () => { o && (clearTimeout(o), o = void 0), s && (clearInterval(s), s = void 0); }; n.addEventListener("mousedown", (l) => { l.button === 0 && (c(), a(), document.addEventListener("mouseup", () => c(), { once: true }), o = setTimeout(() => { s = setInterval(() => { a(); }, i); }, r)); }); } }; var md2 = dt2({ type: { type: String, values: ["primary", "success", "info", "warning", "danger"], default: "primary" }, closable: Boolean, disableTransitions: Boolean, hit: Boolean, color: String, size: { type: String, values: N02 }, effect: { type: String, values: ["dark", "light", "plain"], default: "light" }, round: Boolean }); var lL2 = { close: (n) => n instanceof MouseEvent, click: (n) => n instanceof MouseEvent }; var cL2 = defineComponent({ name: "ElTag" }); var uL2 = defineComponent({ ...cL2, props: md2, emits: lL2, setup(n, { emit: e }) { const t13 = n, i = ra2(), r = it2("tag"), s = computed(() => { const { type: l, hit: d, effect: h6, closable: p, round: g } = t13; return [ r.b(), r.is("closable", p), r.m(l || "primary"), r.m(i.value), r.m(h6), r.is("hit", d), r.is("round", g) ]; }), o = (l) => { e("close", l); }, a = (l) => { e("click", l); }, c = (l) => { l.component.subTree.component.bum = null; }; return (l, d) => l.disableTransitions ? (openBlock(), createElementBlock("span", { key: 0, class: normalizeClass(unref(s)), style: normalizeStyle({ backgroundColor: l.color }), onClick: a }, [ createBaseVNode("span", { class: normalizeClass(unref(r).e("content")) }, [ renderSlot(l.$slots, "default") ], 2), l.closable ? (openBlock(), createBlock(unref(Bt), { key: 0, class: normalizeClass(unref(r).e("close")), onClick: withModifiers(o, ["stop"]) }, { default: withCtx(() => [ createVNode(unref(cd2)) ]), _: 1 }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true) ], 6)) : (openBlock(), createBlock(Transition, { key: 1, name: `${unref(r).namespace.value}-zoom-in-center`, appear: "", onVnodeMounted: c }, { default: withCtx(() => [ createBaseVNode("span", { class: normalizeClass(unref(s)), style: normalizeStyle({ backgroundColor: l.color }), onClick: a }, [ createBaseVNode("span", { class: normalizeClass(unref(r).e("content")) }, [ renderSlot(l.$slots, "default") ], 2), l.closable ? (openBlock(), createBlock(unref(Bt), { key: 0, class: normalizeClass(unref(r).e("close")), onClick: withModifiers(o, ["stop"]) }, { default: withCtx(() => [ createVNode(unref(cd2)) ]), _: 1 }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true) ], 6) ]), _: 3 }, 8, ["name"])); } }); var hL2 = at(uL2, [["__file", "tag.vue"]]); var dL2 = vn2(hL2); var gy2 = Symbol("rowContextKey"); var fL2 = [ "start", "center", "end", "space-around", "space-between", "space-evenly" ]; var pL2 = ["top", "middle", "bottom"]; var mL2 = dt2({ tag: { type: String, default: "div" }, gutter: { type: Number, default: 0 }, justify: { type: String, values: fL2, default: "start" }, align: { type: String, values: pL2 } }); var gL2 = defineComponent({ name: "ElRow" }); var vL2 = defineComponent({ ...gL2, props: mL2, setup(n) { const e = n, t13 = it2("row"), i = computed(() => e.gutter); provide(gy2, { gutter: i }); const r = computed(() => { const o = {}; return e.gutter && (o.marginRight = o.marginLeft = `-${e.gutter / 2}px`), o; }), s = computed(() => [ t13.b(), t13.is(`justify-${e.justify}`, e.justify !== "start"), t13.is(`align-${e.align}`, !!e.align) ]); return (o, a) => (openBlock(), createBlock(resolveDynamicComponent(o.tag), { class: normalizeClass(unref(s)), style: normalizeStyle(unref(r)) }, { default: withCtx(() => [ renderSlot(o.$slots, "default") ]), _: 3 }, 8, ["class", "style"])); } }); var yL2 = at(vL2, [["__file", "row.vue"]]); var Hi2 = vn2(yL2); var bL2 = dt2({ 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: Ye2([Number, Object]), default: () => tr2({}) }, sm: { type: Ye2([Number, Object]), default: () => tr2({}) }, md: { type: Ye2([Number, Object]), default: () => tr2({}) }, lg: { type: Ye2([Number, Object]), default: () => tr2({}) }, xl: { type: Ye2([Number, Object]), default: () => tr2({}) } }); var xL2 = defineComponent({ name: "ElCol" }); var wL2 = defineComponent({ ...xL2, props: bL2, setup(n) { const e = n, { gutter: t13 } = inject(gy2, { gutter: computed(() => 0) }), i = it2("col"), r = computed(() => { const o = {}; return t13.value && (o.paddingLeft = o.paddingRight = `${t13.value / 2}px`), o; }), s = computed(() => { const o = []; return ["span", "offset", "pull", "push"].forEach((l) => { const d = e[l]; St(d) && (l === "span" ? o.push(i.b(`${e[l]}`)) : d > 0 && o.push(i.b(`${l}-${e[l]}`))); }), ["xs", "sm", "md", "lg", "xl"].forEach((l) => { St(e[l]) ? o.push(i.b(`${l}-${e[l]}`)) : Pn2(e[l]) && Object.entries(e[l]).forEach(([d, h6]) => { o.push(d !== "span" ? i.b(`${l}-${d}-${h6}`) : i.b(`${l}-${h6}`)); }); }), t13.value && o.push(i.is("guttered")), [i.b(), o]; }); return (o, a) => (openBlock(), createBlock(resolveDynamicComponent(o.tag), { class: normalizeClass(unref(s)), style: normalizeStyle(unref(r)) }, { default: withCtx(() => [ renderSlot(o.$slots, "default") ]), _: 3 }, 8, ["class", "style"])); } }); var ML2 = at(wL2, [["__file", "col.vue"]]); var _i2 = vn2(ML2); var sg2 = (n) => St(n) || On2(n) || Un2(n); var SL2 = dt2({ accordion: Boolean, modelValue: { type: Ye2([Array, String, Number]), default: () => tr2([]) } }); var _L2 = { [Dt2]: sg2, [Qr2]: sg2 }; var vy2 = Symbol("collapseContextKey"); var TL2 = (n, e) => { const t13 = ref(Ri2(n.modelValue)), i = (s) => { t13.value = s; const o = n.accordion ? t13.value[0] : t13.value; e(Dt2, o), e(Qr2, o); }, r = (s) => { if (n.accordion) i([t13.value[0] === s ? "" : s]); else { const o = [...t13.value], a = o.indexOf(s); a > -1 ? o.splice(a, 1) : o.push(s), i(o); } }; return watch(() => n.modelValue, () => t13.value = Ri2(n.modelValue), { deep: true }), provide(vy2, { activeNames: t13, handleItemClick: r }), { activeNames: t13, setActiveNames: i }; }; var EL2 = () => { const n = it2("collapse"); return { rootKls: computed(() => n.b()) }; }; var AL2 = defineComponent({ name: "ElCollapse" }); var CL2 = defineComponent({ ...AL2, props: SL2, emits: _L2, setup(n, { expose: e, emit: t13 }) { const i = n, { activeNames: r, setActiveNames: s } = TL2(i, t13), { rootKls: o } = EL2(); return e({ activeNames: r, setActiveNames: s }), (a, c) => (openBlock(), createElementBlock("div", { class: normalizeClass(unref(o)) }, [ renderSlot(a.$slots, "default") ], 2)); } }); var LL2 = at(CL2, [["__file", "collapse.vue"]]); var RL2 = defineComponent({ name: "ElCollapseTransition" }); var PL2 = defineComponent({ ...RL2, setup(n) { const e = it2("collapse-transition"), t13 = (r) => { r.style.maxHeight = "", r.style.overflow = r.dataset.oldOverflow, r.style.paddingTop = r.dataset.oldPaddingTop, r.style.paddingBottom = r.dataset.oldPaddingBottom; }, i = { beforeEnter(r) { r.dataset || (r.dataset = {}), r.dataset.oldPaddingTop = r.style.paddingTop, r.dataset.oldPaddingBottom = r.style.paddingBottom, r.style.height && (r.dataset.elExistsHeight = r.style.height), r.style.maxHeight = 0, r.style.paddingTop = 0, r.style.paddingBottom = 0; }, enter(r) { requestAnimationFrame(() => { r.dataset.oldOverflow = r.style.overflow, r.dataset.elExistsHeight ? r.style.maxHeight = r.dataset.elExistsHeight : r.scrollHeight !== 0 ? r.style.maxHeight = `${r.scrollHeight}px` : r.style.maxHeight = 0, r.style.paddingTop = r.dataset.oldPaddingTop, r.style.paddingBottom = r.dataset.oldPaddingBottom, r.style.overflow = "hidden"; }); }, afterEnter(r) { r.style.maxHeight = "", r.style.overflow = r.dataset.oldOverflow; }, enterCancelled(r) { t13(r); }, beforeLeave(r) { r.dataset || (r.dataset = {}), r.dataset.oldPaddingTop = r.style.paddingTop, r.dataset.oldPaddingBottom = r.style.paddingBottom, r.dataset.oldOverflow = r.style.overflow, r.style.maxHeight = `${r.scrollHeight}px`, r.style.overflow = "hidden"; }, leave(r) { r.scrollHeight !== 0 && (r.style.maxHeight = 0, r.style.paddingTop = 0, r.style.paddingBottom = 0); }, afterLeave(r) { t13(r); }, leaveCancelled(r) { t13(r); } }; return (r, s) => (openBlock(), createBlock(Transition, mergeProps({ name: unref(e).b() }, toHandlers(i)), { default: withCtx(() => [ renderSlot(r.$slots, "default") ]), _: 3 }, 16, ["name"])); } }); var IL2 = at(PL2, [["__file", "collapse-transition.vue"]]); var OL2 = vn2(IL2); var DL2 = dt2({ title: { type: String, default: "" }, name: { type: Ye2([String, Number]), default: void 0 }, icon: { type: Zr2, default: $r }, disabled: Boolean }); var NL2 = (n) => { const e = inject(vy2), { namespace: t13 } = it2("collapse"), i = ref(false), r = ref(false), s = Cf2(), o = computed(() => s.current++), a = computed(() => { var p; return (p = n.name) != null ? p : `${t13.value}-id-${s.prefix}-${unref(o)}`; }), c = computed(() => e == null ? void 0 : e.activeNames.value.includes(unref(a))); return { focusing: i, id: o, isActive: c, handleFocus: () => { setTimeout(() => { r.value ? r.value = false : i.value = true; }, 50); }, handleHeaderClick: () => { n.disabled || (e == null || e.handleItemClick(unref(a)), i.value = false, r.value = true); }, handleEnterClick: () => { e == null || e.handleItemClick(unref(a)); } }; }; var FL2 = (n, { focusing: e, isActive: t13, id: i }) => { const r = it2("collapse"), s = computed(() => [ r.b("item"), r.is("active", unref(t13)), r.is("disabled", n.disabled) ]), o = computed(() => [ r.be("item", "header"), r.is("active", unref(t13)), { focusing: unref(e) && !n.disabled } ]), a = computed(() => [ r.be("item", "arrow"), r.is("active", unref(t13)) ]), c = computed(() => r.be("item", "wrap")), l = computed(() => r.be("item", "content")), d = computed(() => r.b(`content-${unref(i)}`)), h6 = computed(() => r.b(`head-${unref(i)}`)); return { arrowKls: a, headKls: o, rootKls: s, itemWrapperKls: c, itemContentKls: l, scopedContentId: d, scopedHeadId: h6 }; }; var BL2 = defineComponent({ name: "ElCollapseItem" }); var zL2 = defineComponent({ ...BL2, props: DL2, setup(n, { expose: e }) { const t13 = n, { focusing: i, id: r, isActive: s, handleFocus: o, handleHeaderClick: a, handleEnterClick: c } = NL2(t13), { arrowKls: l, headKls: d, rootKls: h6, itemWrapperKls: p, itemContentKls: g, scopedContentId: f, scopedHeadId: u } = FL2(t13, { focusing: i, isActive: s, id: r }); return e({ isActive: s }), (y, v) => (openBlock(), createElementBlock("div", { class: normalizeClass(unref(h6)) }, [ createBaseVNode("button", { id: unref(u), class: normalizeClass(unref(d)), "aria-expanded": unref(s), "aria-controls": unref(f), "aria-describedby": unref(f), tabindex: y.disabled ? -1 : 0, type: "button", onClick: unref(a), onKeydown: withKeys(withModifiers(unref(c), ["stop", "prevent"]), ["space", "enter"]), onFocus: unref(o), onBlur: (m) => i.value = false }, [ renderSlot(y.$slots, "title", {}, () => [ createTextVNode(toDisplayString(y.title), 1) ]), renderSlot(y.$slots, "icon", { isActive: unref(s) }, () => [ createVNode(unref(Bt), { class: normalizeClass(unref(l)) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(y.icon))) ]), _: 1 }, 8, ["class"]) ]) ], 42, ["id", "aria-expanded", "aria-controls", "aria-describedby", "tabindex", "onClick", "onKeydown", "onFocus", "onBlur"]), createVNode(unref(OL2), null, { default: withCtx(() => [ withDirectives(createBaseVNode("div", { id: unref(f), role: "region", class: normalizeClass(unref(p)), "aria-hidden": !unref(s), "aria-labelledby": unref(u) }, [ createBaseVNode("div", { class: normalizeClass(unref(g)) }, [ renderSlot(y.$slots, "default") ], 2) ], 10, ["id", "aria-hidden", "aria-labelledby"]), [ [vShow, unref(s)] ]) ]), _: 3 }) ], 2)); } }); var yy2 = at(zL2, [["__file", "collapse-item.vue"]]); var by2 = vn2(LL2, { CollapseItem: yy2 }); var xy2 = gr(yy2); var UL2 = defineComponent({ name: "ElContainer" }); var VL2 = defineComponent({ ...UL2, props: { direction: { type: String } }, setup(n) { const e = n, t13 = useSlots(), i = it2("container"), r = computed(() => e.direction === "vertical" ? true : e.direction === "horizontal" ? false : t13 && t13.default ? t13.default().some((o) => { const a = o.type.name; return a === "ElHeader" || a === "ElFooter"; }) : false); return (s, o) => (openBlock(), createElementBlock("section", { class: normalizeClass([unref(i).b(), unref(i).is("vertical", unref(r))]) }, [ renderSlot(s.$slots, "default") ], 2)); } }); var kL2 = at(VL2, [["__file", "container.vue"]]); var GL2 = defineComponent({ name: "ElAside" }); var HL2 = defineComponent({ ...GL2, props: { width: { type: String, default: null } }, setup(n) { const e = n, t13 = it2("aside"), i = computed(() => e.width ? t13.cssVarBlock({ width: e.width }) : {}); return (r, s) => (openBlock(), createElementBlock("aside", { class: normalizeClass(unref(t13).b()), style: normalizeStyle(unref(i)) }, [ renderSlot(r.$slots, "default") ], 6)); } }); var wy2 = at(HL2, [["__file", "aside.vue"]]); var WL2 = defineComponent({ name: "ElFooter" }); var jL2 = defineComponent({ ...WL2, props: { height: { type: String, default: null } }, setup(n) { const e = n, t13 = it2("footer"), i = computed(() => e.height ? t13.cssVarBlock({ height: e.height }) : {}); return (r, s) => (openBlock(), createElementBlock("footer", { class: normalizeClass(unref(t13).b()), style: normalizeStyle(unref(i)) }, [ renderSlot(r.$slots, "default") ], 6)); } }); var My2 = at(jL2, [["__file", "footer.vue"]]); var $L2 = defineComponent({ name: "ElHeader" }); var ZL2 = defineComponent({ ...$L2, props: { height: { type: String, default: null } }, setup(n) { const e = n, t13 = it2("header"), i = computed(() => e.height ? t13.cssVarBlock({ height: e.height }) : {}); return (r, s) => (openBlock(), createElementBlock("header", { class: normalizeClass(unref(t13).b()), style: normalizeStyle(unref(i)) }, [ renderSlot(r.$slots, "default") ], 6)); } }); var Sy2 = at(ZL2, [["__file", "header.vue"]]); var XL2 = defineComponent({ name: "ElMain" }); var YL2 = defineComponent({ ...XL2, setup(n) { const e = it2("main"); return (t13, i) => (openBlock(), createElementBlock("main", { class: normalizeClass(unref(e).b()) }, [ renderSlot(t13.$slots, "default") ], 2)); } }); var _y2 = at(YL2, [["__file", "main.vue"]]); var Wi2 = vn2(kL2, { Aside: wy2, Footer: My2, Header: Sy2, Main: _y2 }); gr(wy2); var Ty2 = gr(My2); var JL2 = gr(Sy2); var vr2 = gr(_y2); var qL2 = defineComponent({ inheritAttrs: false }); function KL2(n, e, t13, i, r, s) { return renderSlot(n.$slots, "default"); } var QL2 = at(qL2, [["render", KL2], ["__file", "collection.vue"]]); var eR = defineComponent({ name: "ElCollectionItem", inheritAttrs: false }); function tR(n, e, t13, i, r, s) { return renderSlot(n.$slots, "default"); } var nR = at(eR, [["render", tR], ["__file", "collection-item.vue"]]); var iR = "data-el-collection-item"; var rR = (n) => { const e = `El${n}Collection`, t13 = `${e}Item`, i = Symbol(e), r = Symbol(t13), s = { ...QL2, name: e, setup() { const a = ref(null), c = /* @__PURE__ */ new Map(); provide(i, { itemMap: c, getItems: () => { const d = unref(a); if (!d) return []; const h6 = Array.from(d.querySelectorAll(`[${iR}]`)); return [...c.values()].sort((g, f) => h6.indexOf(g.ref) - h6.indexOf(f.ref)); }, collectionRef: a }); } }, o = { ...nR, name: t13, setup(a, { attrs: c }) { const l = ref(null), d = inject(i, void 0); provide(r, { collectionItemRef: l }), onMounted(() => { const h6 = unref(l); h6 && d.itemMap.set(h6, { ref: h6, ...c }); }), onBeforeUnmount(() => { const h6 = unref(l); d.itemMap.delete(h6); }); } }; return { COLLECTION_INJECTION_KEY: i, COLLECTION_ITEM_INJECTION_KEY: r, ElCollection: s, ElCollectionItem: o }; }; var nh2 = dt2({ trigger: qa2.trigger, effect: { ...Zn2.effect, default: "light" }, type: { type: Ye2(String) }, placement: { type: Ye2(String), default: "bottom" }, popperOptions: { type: Ye2(Object), default: () => ({}) }, id: String, size: { type: String, default: "" }, splitButton: Boolean, hideOnClick: { type: Boolean, default: true }, loop: { type: Boolean, default: true }, showTimeout: { type: Number, default: 150 }, hideTimeout: { type: Number, default: 150 }, tabindex: { type: Ye2([Number, String]), default: 0 }, maxHeight: { type: Ye2([Number, String]), default: "" }, popperClass: { type: String, default: "" }, disabled: Boolean, role: { type: String, default: "menu" }, buttonProps: { type: Ye2(Object) }, teleported: Zn2.teleported }); dt2({ command: { type: [Object, String, Number], default: () => ({}) }, disabled: Boolean, divided: Boolean, textValue: String, icon: { type: Zr2 } }); dt2({ onKeydown: { type: Ye2(Function) } }); rR("Dropdown"); var sR = dt2({ 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: Do2, controls: { type: Boolean, default: true }, controlsPosition: { type: String, default: "", values: ["", "right"] }, valueOnClear: { type: [String, Number, null], validator: (n) => n === null || St(n) || ["min", "max"].includes(n), default: null }, name: String, placeholder: String, precision: { type: Number, validator: (n) => n >= 0 && n === Number.parseInt(`${n}`, 10) }, validateEvent: { type: Boolean, default: true }, ...Gs2(["ariaLabel"]) }); var oR = { [Qr2]: (n, e) => e !== n, blur: (n) => n instanceof FocusEvent, focus: (n) => n instanceof FocusEvent, [Ss2]: (n) => St(n) || sr2(n), [Dt2]: (n) => St(n) || sr2(n) }; var aR = defineComponent({ name: "ElInputNumber" }); var lR = defineComponent({ ...aR, props: sR, emits: oR, setup(n, { expose: e, emit: t13 }) { const i = n, { t: r } = mu2(), s = it2("input-number"), o = ref(), a = reactive({ currentValue: i.modelValue, userInput: null }), { formItem: c } = gl2(), l = computed(() => St(i.modelValue) && i.modelValue <= i.min), d = computed(() => St(i.modelValue) && i.modelValue >= i.max), h6 = computed(() => { const I = v(i.step); return yi2(i.precision) ? Math.max(v(i.modelValue), I) : (I > i.precision && en2("InputNumber", "precision should not be less than the decimal places of step"), i.precision); }), p = computed(() => i.controls && i.controlsPosition === "right"), g = ra2(), f = yu2(), u = computed(() => { if (a.userInput !== null) return a.userInput; let I = a.currentValue; if (sr2(I)) return ""; if (St(I)) { if (Number.isNaN(I)) return ""; yi2(i.precision) || (I = I.toFixed(i.precision)); } return I; }), y = (I, b) => { if (yi2(b) && (b = h6.value), b === 0) return Math.round(I); let O = String(I); const N = O.indexOf("."); if (N === -1 || !O.replace(".", "").split("")[N + b]) return I; const U = O.length; return O.charAt(U - 1) === "5" && (O = `${O.slice(0, Math.max(0, U - 1))}6`), Number.parseFloat(Number(O).toFixed(b)); }, v = (I) => { if (sr2(I)) return 0; const b = I.toString(), O = b.indexOf("."); let N = 0; return O !== -1 && (N = b.length - O - 1), N; }, m = (I, b = 1) => St(I) ? y(I + i.step * b) : a.currentValue, w = () => { if (i.readonly || f.value || d.value) return; const I = Number(u.value) || 0, b = m(I); M(b), t13(Ss2, a.currentValue), A(); }, S = () => { if (i.readonly || f.value || l.value) return; const I = Number(u.value) || 0, b = m(I, -1); M(b), t13(Ss2, a.currentValue), A(); }, T = (I, b) => { const { max: O, min: N, step: D, precision: B, stepStrictly: U, valueOnClear: k } = i; O < N && na2("InputNumber", "min should not be greater than max."); let K = Number(I); if (sr2(I) || Number.isNaN(K)) return null; if (I === "") { if (k === null) return null; K = On2(k) ? { min: N, max: O }[k] : k; } return U && (K = y(Math.round(K / D) * D, B), K !== I && b && t13(Dt2, K)), yi2(B) || (K = y(K, B)), (K > O || K < N) && (K = K > O ? O : N, b && t13(Dt2, K)), K; }, M = (I, b = true) => { var O; const N = a.currentValue, D = T(I); if (!b) { t13(Dt2, D); return; } N === D && I || (a.userInput = null, t13(Dt2, D), N !== D && t13(Qr2, D, N), i.validateEvent && ((O = c == null ? void 0 : c.validate) == null || O.call(c, "change").catch((B) => en2(B))), a.currentValue = D); }, x = (I) => { a.userInput = I; const b = I === "" ? null : Number(I); t13(Ss2, b), M(b, false); }, _ = (I) => { const b = I !== "" ? Number(I) : ""; (St(b) && !Number.isNaN(b) || I === "") && M(b), A(), a.userInput = null; }, E = () => { var I, b; (b = (I = o.value) == null ? void 0 : I.focus) == null || b.call(I); }, L = () => { var I, b; (b = (I = o.value) == null ? void 0 : I.blur) == null || b.call(I); }, R = (I) => { t13("focus", I); }, C = (I) => { var b; a.userInput = null, t13("blur", I), i.validateEvent && ((b = c == null ? void 0 : c.validate) == null || b.call(c, "blur").catch((O) => en2(O))); }, A = () => { a.currentValue !== i.modelValue && (a.currentValue = i.modelValue); }, P = (I) => { document.activeElement === I.target && I.preventDefault(); }; return watch(() => i.modelValue, (I, b) => { const O = T(I, true); a.userInput === null && O !== b && (a.currentValue = O); }, { immediate: true }), onMounted(() => { var I; const { min: b, max: O, modelValue: N } = i, D = (I = o.value) == null ? void 0 : I.input; if (D.setAttribute("role", "spinbutton"), Number.isFinite(O) ? D.setAttribute("aria-valuemax", String(O)) : D.removeAttribute("aria-valuemax"), Number.isFinite(b) ? D.setAttribute("aria-valuemin", String(b)) : D.removeAttribute("aria-valuemin"), D.setAttribute("aria-valuenow", a.currentValue || a.currentValue === 0 ? String(a.currentValue) : ""), D.setAttribute("aria-disabled", String(f.value)), !St(N) && N != null) { let B = Number(N); Number.isNaN(B) && (B = null), t13(Dt2, B); } D.addEventListener("wheel", P, { passive: false }); }), onUpdated(() => { var I, b; const O = (I = o.value) == null ? void 0 : I.input; O == null || O.setAttribute("aria-valuenow", `${(b = a.currentValue) != null ? b : ""}`); }), e({ focus: E, blur: L }), (I, b) => (openBlock(), createElementBlock("div", { class: normalizeClass([ unref(s).b(), unref(s).m(unref(g)), unref(s).is("disabled", unref(f)), unref(s).is("without-controls", !I.controls), unref(s).is("controls-right", unref(p)) ]), onDragstart: withModifiers(() => { }, ["prevent"]) }, [ I.controls ? withDirectives((openBlock(), createElementBlock("span", { key: 0, role: "button", "aria-label": unref(r)("el.inputNumber.decrease"), class: normalizeClass([unref(s).e("decrease"), unref(s).is("disabled", unref(l))]), onKeydown: withKeys(S, ["enter"]) }, [ renderSlot(I.$slots, "decrease-icon", {}, () => [ createVNode(unref(Bt), null, { default: withCtx(() => [ unref(p) ? (openBlock(), createBlock(unref(vf2), { key: 0 })) : (openBlock(), createBlock(unref(dE2), { key: 1 })) ]), _: 1 }) ]) ], 42, ["aria-label", "onKeydown"])), [ [unref(rg2), S] ]) : createCommentVNode("v-if", true), I.controls ? withDirectives((openBlock(), createElementBlock("span", { key: 1, role: "button", "aria-label": unref(r)("el.inputNumber.increase"), class: normalizeClass([unref(s).e("increase"), unref(s).is("disabled", unref(d))]), onKeydown: withKeys(w, ["enter"]) }, [ renderSlot(I.$slots, "increase-icon", {}, () => [ createVNode(unref(Bt), null, { default: withCtx(() => [ unref(p) ? (openBlock(), createBlock(unref(nE2), { key: 0 })) : (openBlock(), createBlock(unref(fu2), { key: 1 })) ]), _: 1 }) ]) ], 42, ["aria-label", "onKeydown"])), [ [unref(rg2), w] ]) : createCommentVNode("v-if", true), createVNode(unref(mC2), { id: I.id, ref_key: "input", ref: o, type: "number", step: I.step, "model-value": unref(u), placeholder: I.placeholder, readonly: I.readonly, disabled: unref(f), size: unref(g), max: I.max, min: I.min, name: I.name, "aria-label": I.ariaLabel, "validate-event": false, onKeydown: [ withKeys(withModifiers(w, ["prevent"]), ["up"]), withKeys(withModifiers(S, ["prevent"]), ["down"]) ], onBlur: C, onFocus: R, onInput: x, onChange: _ }, createSlots({ _: 2 }, [ I.$slots.prefix ? { name: "prefix", fn: withCtx(() => [ renderSlot(I.$slots, "prefix") ]) } : void 0, I.$slots.suffix ? { name: "suffix", fn: withCtx(() => [ renderSlot(I.$slots, "suffix") ]) } : void 0 ]), 1032, ["id", "step", "model-value", "placeholder", "readonly", "disabled", "size", "max", "min", "name", "aria-label", "onKeydown"]) ], 42, ["onDragstart"])); } }); var cR = at(lR, [["__file", "input-number.vue"]]); var yr2 = vn2(cR); var Ey2 = Symbol("ElSelectGroup"); var wu2 = Symbol("ElSelect"); function uR(n, e) { const t13 = inject(wu2), i = inject(Ey2, { disabled: false }), r = computed(() => d(Ri2(t13.props.modelValue), n.value)), s = computed(() => { var g; if (t13.props.multiple) { const f = Ri2((g = t13.props.modelValue) != null ? g : []); return !r.value && f.length >= t13.props.multipleLimit && t13.props.multipleLimit > 0; } else return false; }), o = computed(() => n.label || (Pn2(n.value) ? "" : n.value)), a = computed(() => n.value || n.label || ""), c = computed(() => n.disabled || e.groupDisabled || s.value), l = getCurrentInstance(), d = (g = [], f) => { if (Pn2(n.value)) { const u = t13.props.valueKey; return g && g.some((y) => toRaw(er(y, u)) === er(f, u)); } else return g && g.includes(f); }, h6 = () => { !n.disabled && !i.disabled && (t13.states.hoveringIndex = t13.optionsArray.indexOf(l.proxy)); }, p = (g) => { const f = new RegExp(YT2(g), "i"); e.visible = f.test(o.value) || n.created; }; return watch(() => o.value, () => { !n.created && !t13.props.remote && t13.setSelected(); }), watch(() => n.value, (g, f) => { const { remote: u, valueKey: y } = t13.props; if (g !== f && (t13.onOptionDestroy(f, l.proxy), t13.onOptionCreate(l.proxy)), !n.created && !u) { if (y && Pn2(g) && Pn2(f) && g[y] === f[y]) return; t13.setSelected(); } }), watch(() => i.disabled, () => { e.groupDisabled = i.disabled; }, { immediate: true }), { select: t13, currentLabel: o, currentValue: a, itemSelected: r, isDisabled: c, hoverItem: h6, updateOption: p }; } var hR = defineComponent({ name: "ElOption", componentName: "ElOption", props: { value: { required: true, type: [String, Number, Boolean, Object] }, label: [String, Number], created: Boolean, disabled: Boolean }, setup(n) { const e = it2("select"), t13 = vu2(), i = computed(() => [ e.be("dropdown", "item"), e.is("disabled", unref(a)), e.is("selected", unref(o)), e.is("hovering", unref(p)) ]), r = reactive({ index: -1, groupDisabled: false, visible: true, hover: false }), { currentLabel: s, itemSelected: o, isDisabled: a, select: c, hoverItem: l, updateOption: d } = uR(n, r), { visible: h6, hover: p } = toRefs(r), g = getCurrentInstance().proxy; c.onOptionCreate(g), onBeforeUnmount(() => { const u = g.value, { selected: y } = c.states, m = (c.props.multiple ? y : [y]).some((w) => w.value === g.value); nextTick(() => { c.states.cachedOptions.get(u) === g && !m && c.states.cachedOptions.delete(u); }), c.onOptionDestroy(u, g); }); function f() { a.value || c.handleOptionSelect(g); } return { ns: e, id: t13, containerKls: i, currentLabel: s, itemSelected: o, isDisabled: a, select: c, hoverItem: l, updateOption: d, visible: h6, hover: p, selectOptionClick: f, states: r }; } }); function dR(n, e, t13, i, r, s) { return withDirectives((openBlock(), createElementBlock("li", { id: n.id, class: normalizeClass(n.containerKls), role: "option", "aria-disabled": n.isDisabled || void 0, "aria-selected": n.itemSelected, onMouseenter: n.hoverItem, onClick: withModifiers(n.selectOptionClick, ["stop"]) }, [ renderSlot(n.$slots, "default", {}, () => [ createBaseVNode("span", null, toDisplayString(n.currentLabel), 1) ]) ], 42, ["id", "aria-disabled", "aria-selected", "onMouseenter", "onClick"])), [ [vShow, n.visible] ]); } var zf2 = at(hR, [["render", dR], ["__file", "option.vue"]]); var fR = defineComponent({ name: "ElSelectDropdown", componentName: "ElSelectDropdown", setup() { const n = inject(wu2), e = it2("select"), t13 = computed(() => n.props.popperClass), i = computed(() => n.props.multiple), r = computed(() => n.props.fitInputWidth), s = ref(""); function o() { var a; s.value = `${(a = n.selectRef) == null ? void 0 : a.offsetWidth}px`; } return onMounted(() => { o(), ii2(n.selectRef, o); }), { ns: e, minWidth: s, popperClass: t13, isMultiple: i, isFitInputWidth: r }; } }); function pR(n, e, t13, i, r, s) { return openBlock(), createElementBlock("div", { class: normalizeClass([n.ns.b("dropdown"), n.ns.is("multiple", n.isMultiple), n.popperClass]), style: normalizeStyle({ [n.isFitInputWidth ? "width" : "minWidth"]: n.minWidth }) }, [ n.$slots.header ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(n.ns.be("dropdown", "header")) }, [ renderSlot(n.$slots, "header") ], 2)) : createCommentVNode("v-if", true), renderSlot(n.$slots, "default"), n.$slots.footer ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(n.ns.be("dropdown", "footer")) }, [ renderSlot(n.$slots, "footer") ], 2)) : createCommentVNode("v-if", true) ], 6); } var mR = at(fR, [["render", pR], ["__file", "select-dropdown.vue"]]); var gR = 11; var vR = (n, e) => { const { t: t13 } = mu2(), i = vu2(), r = it2("select"), s = it2("input"), o = reactive({ inputValue: "", options: /* @__PURE__ */ new Map(), cachedOptions: /* @__PURE__ */ new Map(), disabledOptions: /* @__PURE__ */ new Map(), optionValues: [], selected: [], selectionWidth: 0, calculatorWidth: 0, collapseItemWidth: 0, selectedLabel: "", hoveringIndex: -1, previousQuery: null, inputHovering: false, menuVisibleOnFocus: false, isBeforeHide: false }), a = ref(null), c = ref(null), l = ref(null), d = ref(null), h6 = ref(null), p = ref(null), g = ref(null), f = ref(null), u = ref(null), y = ref(null), v = ref(null), m = ref(null), { isComposing: w, handleCompositionStart: S, handleCompositionUpdate: T, handleCompositionEnd: M } = iy2({ afterComposition: (he) => se(he) }), { wrapperRef: x, isFocused: _ } = ny2(h6, { beforeFocus() { return b.value; }, afterFocus() { n.automaticDropdown && !E.value && (E.value = true, o.menuVisibleOnFocus = true); }, beforeBlur(he) { var _e, Ce; return ((_e = l.value) == null ? void 0 : _e.isFocusInsideContent(he)) || ((Ce = d.value) == null ? void 0 : Ce.isFocusInsideContent(he)); }, afterBlur() { E.value = false, o.menuVisibleOnFocus = false; } }), E = ref(false), L = ref(), { form: R, formItem: C } = gl2(), { inputId: A } = Pf2(n, { formItemContext: C }), { valueOnClear: P, isEmptyValue: I } = KA(n), b = computed(() => n.disabled || (R == null ? void 0 : R.disabled)), O = computed(() => Un2(n.modelValue) ? n.modelValue.length > 0 : !I(n.modelValue)), N = computed(() => n.clearable && !b.value && o.inputHovering && O.value), D = computed(() => n.remote && n.filterable && !n.remoteShowSuffix ? "" : n.suffixIcon), B = computed(() => r.is("reverse", D.value && E.value)), U = computed(() => (C == null ? void 0 : C.validateState) || ""), k = computed(() => D0[U.value]), K = computed(() => n.remote ? 300 : 0), ie = computed(() => n.loading ? n.loadingText || t13("el.select.loading") : n.remote && !o.inputValue && o.options.size === 0 ? false : n.filterable && o.inputValue && o.options.size > 0 && j.value === 0 ? n.noMatchText || t13("el.select.noMatch") : o.options.size === 0 ? n.noDataText || t13("el.select.noData") : null), j = computed(() => G.value.filter((he) => he.visible).length), G = computed(() => { const he = Array.from(o.options.values()), _e = []; return o.optionValues.forEach((Ce) => { const ke = he.findIndex((Ze) => Ze.value === Ce); ke > -1 && _e.push(he[ke]); }), _e.length >= he.length ? _e : he; }), W = computed(() => Array.from(o.cachedOptions.values())), q = computed(() => { const he = G.value.filter((_e) => !_e.created).some((_e) => _e.currentLabel === o.inputValue); return n.filterable && n.allowCreate && o.inputValue !== "" && !he; }), Q = () => { n.filterable && Ln2(n.filterMethod) || n.filterable && n.remote && Ln2(n.remoteMethod) || G.value.forEach((he) => { var _e; (_e = he.updateOption) == null || _e.call(he, o.inputValue); }); }, ee = ra2(), ne = computed(() => ["small"].includes(ee.value) ? "small" : "default"), Y = computed({ get() { return E.value && ie.value !== false; }, set(he) { E.value = he; } }), te = computed(() => { if (n.multiple && !yi2(n.modelValue)) return Ri2(n.modelValue).length === 0 && !o.inputValue; const he = Un2(n.modelValue) ? n.modelValue[0] : n.modelValue; return n.filterable || yi2(he) ? !o.inputValue : true; }), F = computed(() => { var he; const _e = (he = n.placeholder) != null ? he : t13("el.select.placeholder"); return n.multiple || !O.value ? _e : o.selectedLabel; }), $ = computed(() => td2 ? null : "mouseenter"); watch(() => n.modelValue, (he, _e) => { n.multiple && n.filterable && !n.reserveKeyword && (o.inputValue = "", J("")), V(), !ld2(he, _e) && n.validateEvent && (C == null || C.validate("change").catch((Ce) => en2(Ce))); }, { flush: "post", deep: true }), watch(() => E.value, (he) => { he ? J(o.inputValue) : (o.inputValue = "", o.previousQuery = null, o.isBeforeHide = true), e("visible-change", he); }), watch(() => o.options.entries(), () => { var he; if (!rn2) return; const _e = ((he = a.value) == null ? void 0 : he.querySelectorAll("input")) || []; (!n.filterable && !n.defaultFirstOption && !yi2(n.modelValue) || !Array.from(_e).includes(document.activeElement)) && V(), n.defaultFirstOption && (n.filterable || n.remote) && j.value && z(); }, { flush: "post" }), watch(() => o.hoveringIndex, (he) => { St(he) && he > -1 ? L.value = G.value[he] || {} : L.value = {}, G.value.forEach((_e) => { _e.hover = L.value === _e; }); }), watchEffect(() => { o.isBeforeHide || Q(); }); const J = (he) => { o.previousQuery === he || w.value || (o.previousQuery = he, n.filterable && Ln2(n.filterMethod) ? n.filterMethod(he) : n.filterable && n.remote && Ln2(n.remoteMethod) && n.remoteMethod(he), n.defaultFirstOption && (n.filterable || n.remote) && j.value ? nextTick(z) : nextTick(ue)); }, z = () => { const he = G.value.filter((ke) => ke.visible && !ke.disabled && !ke.states.groupDisabled), _e = he.find((ke) => ke.created), Ce = he[0]; o.hoveringIndex = bt2(G.value, _e || Ce); }, V = () => { if (n.multiple) o.selectedLabel = ""; else { const _e = Un2(n.modelValue) ? n.modelValue[0] : n.modelValue, Ce = oe(_e); o.selectedLabel = Ce.currentLabel, o.selected = [Ce]; return; } const he = []; yi2(n.modelValue) || Ri2(n.modelValue).forEach((_e) => { he.push(oe(_e)); }), o.selected = he; }, oe = (he) => { let _e; const Ce = ju2(he).toLowerCase() === "object", ke = ju2(he).toLowerCase() === "null", Ze = ju2(he).toLowerCase() === "undefined"; for (let ut = o.cachedOptions.size - 1; ut >= 0; ut--) { const Zt = W.value[ut]; if (Ce ? er(Zt.value, n.valueKey) === er(he, n.valueKey) : Zt.value === he) { _e = { value: he, currentLabel: Zt.currentLabel, get isDisabled() { return Zt.isDisabled; } }; break; } } if (_e) return _e; const Qe = Ce ? he.label : !ke && !Ze ? he : ""; return { value: he, currentLabel: Qe }; }, ue = () => { o.hoveringIndex = G.value.findIndex((he) => o.selected.some((_e) => gt(_e) === gt(he))); }, le = () => { o.selectionWidth = c.value.getBoundingClientRect().width; }, ve = () => { o.calculatorWidth = p.value.getBoundingClientRect().width; }, xe = () => { o.collapseItemWidth = v.value.getBoundingClientRect().width; }, Te = () => { var he, _e; (_e = (he = l.value) == null ? void 0 : he.updatePopper) == null || _e.call(he); }, de = () => { var he, _e; (_e = (he = d.value) == null ? void 0 : he.updatePopper) == null || _e.call(he); }, we = () => { o.inputValue.length > 0 && !E.value && (E.value = true), J(o.inputValue); }, se = (he) => { if (o.inputValue = he.target.value, n.remote) Se2(); else return we(); }, Se2 = ad2(() => { we(); }, K.value), ge = (he) => { ld2(n.modelValue, he) || e(Qr2, he); }, be2 = (he) => GT2(he, (_e) => !o.disabledOptions.has(_e)), Ie2 = (he) => { if (n.multiple && he.code !== Di2.delete && he.target.value.length <= 0) { const _e = Ri2(n.modelValue).slice(), Ce = be2(_e); if (Ce < 0) return; const ke = _e[Ce]; _e.splice(Ce, 1), e(Dt2, _e), ge(_e), e("remove-tag", ke); } }, et2 = (he, _e) => { const Ce = o.selected.indexOf(_e); if (Ce > -1 && !b.value) { const ke = Ri2(n.modelValue).slice(); ke.splice(Ce, 1), e(Dt2, ke), ge(ke), e("remove-tag", _e.value); } he.stopPropagation(), Vt2(); }, mt = (he) => { he.stopPropagation(); const _e = n.multiple ? [] : P.value; if (n.multiple) for (const Ce of o.selected) Ce.isDisabled && _e.push(Ce.value); e(Dt2, _e), ge(_e), o.hoveringIndex = -1, E.value = false, e("clear"), Vt2(); }, Ue = (he) => { var _e; if (n.multiple) { const Ce = Ri2((_e = n.modelValue) != null ? _e : []).slice(), ke = bt2(Ce, he.value); ke > -1 ? Ce.splice(ke, 1) : (n.multipleLimit <= 0 || Ce.length < n.multipleLimit) && Ce.push(he.value), e(Dt2, Ce), ge(Ce), he.created && J(""), n.filterable && !n.reserveKeyword && (o.inputValue = ""); } else e(Dt2, he.value), ge(he.value), E.value = false; Vt2(), !E.value && nextTick(() => { Ve(he); }); }, bt2 = (he = [], _e) => { if (!Pn2(_e)) return he.indexOf(_e); const Ce = n.valueKey; let ke = -1; return he.some((Ze, Qe) => toRaw(er(Ze, Ce)) === er(_e, Ce) ? (ke = Qe, true) : false), ke; }, Ve = (he) => { var _e, Ce, ke, Ze, Qe; const qe = Un2(he) ? he[0] : he; let ut = null; if (qe != null && qe.value) { const Zt = G.value.filter((hn3) => hn3.value === qe.value); Zt.length > 0 && (ut = Zt[0].$el); } if (l.value && ut) { const Zt = (Ze = (ke = (Ce = (_e = l.value) == null ? void 0 : _e.popperRef) == null ? void 0 : Ce.contentRef) == null ? void 0 : ke.querySelector) == null ? void 0 : Ze.call(ke, `.${r.be("dropdown", "wrap")}`); Zt && qT2(Zt, ut); } (Qe = m.value) == null || Qe.handleScroll(); }, lt = (he) => { o.options.set(he.value, he), o.cachedOptions.set(he.value, he), he.disabled && o.disabledOptions.set(he.value, he); }, tt2 = (he, _e) => { o.options.get(he) === _e && o.options.delete(he); }, xt = computed(() => { var he, _e; return (_e = (he = l.value) == null ? void 0 : he.popperRef) == null ? void 0 : _e.contentRef; }), pt2 = () => { o.isBeforeHide = false, nextTick(() => Ve(o.selected)); }, Vt2 = () => { var he; (he = h6.value) == null || he.focus(); }, Nt2 = () => { var he; (he = h6.value) == null || he.blur(); }, re = (he) => { mt(he); }, Ee = () => { E.value = false, _.value && Nt2(); }, Ne = () => { o.inputValue.length > 0 ? o.inputValue = "" : E.value = false; }, je2 = () => { b.value || (td2 && (o.inputHovering = true), o.menuVisibleOnFocus ? o.menuVisibleOnFocus = false : E.value = !E.value); }, rt2 = () => { E.value ? G.value[o.hoveringIndex] && Ue(G.value[o.hoveringIndex]) : je2(); }, gt = (he) => Pn2(he.value) ? er(he.value, n.valueKey) : he.value, Tt = computed(() => G.value.filter((he) => he.visible).every((he) => he.disabled)), Lt2 = computed(() => n.multiple ? n.collapseTags ? o.selected.slice(0, n.maxCollapseTags) : o.selected : []), kt = computed(() => n.multiple ? n.collapseTags ? o.selected.slice(n.maxCollapseTags) : [] : []), Z = (he) => { if (!E.value) { E.value = true; return; } if (!(o.options.size === 0 || o.filteredOptionsCount === 0 || w.value) && !Tt.value) { he === "next" ? (o.hoveringIndex++, o.hoveringIndex === o.options.size && (o.hoveringIndex = 0)) : he === "prev" && (o.hoveringIndex--, o.hoveringIndex < 0 && (o.hoveringIndex = o.options.size - 1)); const _e = G.value[o.hoveringIndex]; (_e.disabled === true || _e.states.groupDisabled === true || !_e.visible) && Z(he), nextTick(() => Ve(L.value)); } }, ye = () => { if (!c.value) return 0; const he = window.getComputedStyle(c.value); return Number.parseFloat(he.gap || "6px"); }, me = computed(() => { const he = ye(); return { maxWidth: `${v.value && n.maxCollapseTags === 1 ? o.selectionWidth - o.collapseItemWidth - he : o.selectionWidth}px` }; }), Me = computed(() => ({ maxWidth: `${o.selectionWidth}px` })), Oe = computed(() => ({ width: `${Math.max(o.calculatorWidth, gR)}px` })); return ii2(c, le), ii2(p, ve), ii2(u, Te), ii2(x, Te), ii2(y, de), ii2(v, xe), onMounted(() => { V(); }), { inputId: A, contentId: i, nsSelect: r, nsInput: s, states: o, isFocused: _, expanded: E, optionsArray: G, hoverOption: L, selectSize: ee, filteredOptionsCount: j, resetCalculatorWidth: ve, updateTooltip: Te, updateTagTooltip: de, debouncedOnInputChange: Se2, onInput: se, deletePrevTag: Ie2, deleteTag: et2, deleteSelected: mt, handleOptionSelect: Ue, scrollToOption: Ve, hasModelValue: O, shouldShowPlaceholder: te, currentPlaceholder: F, mouseEnterEventName: $, showClose: N, iconComponent: D, iconReverse: B, validateState: U, validateIcon: k, showNewOption: q, updateOptions: Q, collapseTagSize: ne, setSelected: V, selectDisabled: b, emptyText: ie, handleCompositionStart: S, handleCompositionUpdate: T, handleCompositionEnd: M, onOptionCreate: lt, onOptionDestroy: tt2, handleMenuEnter: pt2, focus: Vt2, blur: Nt2, handleClearClick: re, handleClickOutside: Ee, handleEsc: Ne, toggleMenu: je2, selectOption: rt2, getValueKey: gt, navigateOptions: Z, dropdownMenuVisible: Y, showTagList: Lt2, collapseTagList: kt, tagStyle: me, collapseTagStyle: Me, inputStyle: Oe, popperRef: xt, inputRef: h6, tooltipRef: l, tagTooltipRef: d, calculatorRef: p, prefixRef: g, suffixRef: f, selectRef: a, wrapperRef: x, selectionRef: c, scrollbarRef: m, menuRef: u, tagMenuRef: y, collapseItemRef: v }; }; var yR = defineComponent({ name: "ElOptions", setup(n, { slots: e }) { const t13 = inject(wu2); let i = []; return () => { var r, s; const o = (r = e.default) == null ? void 0 : r.call(e), a = []; function c(l) { Un2(l) && l.forEach((d) => { var h6, p, g, f; const u = (h6 = (d == null ? void 0 : d.type) || {}) == null ? void 0 : h6.name; u === "ElOptionGroup" ? c(!On2(d.children) && !Un2(d.children) && Ln2((p = d.children) == null ? void 0 : p.default) ? (g = d.children) == null ? void 0 : g.default() : d.children) : u === "ElOption" ? a.push((f = d.props) == null ? void 0 : f.value) : Un2(d.children) && c(d.children); }); } return o.length && c((s = o[0]) == null ? void 0 : s.children), ld2(a, i) || (i = a, t13 && (t13.states.optionValues = a)), o; }; } }); var bR = dt2({ name: String, id: String, modelValue: { type: [Array, String, Number, Boolean, Object], default: void 0 }, autocomplete: { type: String, default: "off" }, automaticDropdown: Boolean, size: Do2, effect: { type: Ye2(String), default: "light" }, disabled: Boolean, clearable: Boolean, filterable: Boolean, allowCreate: Boolean, loading: Boolean, popperClass: { type: String, default: "" }, popperOptions: { type: Ye2(Object), default: () => ({}) }, remote: Boolean, loadingText: String, noMatchText: String, noDataText: String, remoteMethod: Function, filterMethod: Function, multiple: Boolean, multipleLimit: { type: Number, default: 0 }, placeholder: { type: String }, defaultFirstOption: Boolean, reserveKeyword: { type: Boolean, default: true }, valueKey: { type: String, default: "value" }, collapseTags: Boolean, collapseTagsTooltip: Boolean, maxCollapseTags: { type: Number, default: 1 }, teleported: Zn2.teleported, persistent: { type: Boolean, default: true }, clearIcon: { type: Zr2, default: yf2 }, fitInputWidth: Boolean, suffixIcon: { type: Zr2, default: vf2 }, tagType: { ...md2.type, default: "info" }, tagEffect: { ...md2.effect, default: "light" }, validateEvent: { type: Boolean, default: true }, remoteShowSuffix: Boolean, placement: { type: Ye2(String), values: ia, default: "bottom-start" }, fallbackPlacements: { type: Ye2(Array), default: ["bottom-start", "top-start", "right", "left"] }, appendTo: String, ...qA, ...Gs2(["ariaLabel"]) }); var og2 = "ElSelect"; var xR = defineComponent({ name: og2, componentName: og2, components: { ElSelectMenu: mR, ElOption: zf2, ElOptions: yR, ElTag: dL2, ElScrollbar: LC2, ElTooltip: Bf2, ElIcon: Bt }, directives: { ClickOutside: sL2 }, props: bR, emits: [ Dt2, Qr2, "remove-tag", "clear", "visible-change", "focus", "blur" ], setup(n, { emit: e }) { const t13 = computed(() => { const { modelValue: s, multiple: o } = n, a = o ? [] : void 0; return Un2(s) ? o ? s : a : o ? a : s; }), i = reactive({ ...toRefs(n), modelValue: t13 }), r = vR(i, e); return provide(wu2, reactive({ props: i, states: r.states, optionsArray: r.optionsArray, handleOptionSelect: r.handleOptionSelect, onOptionCreate: r.onOptionCreate, onOptionDestroy: r.onOptionDestroy, selectRef: r.selectRef, setSelected: r.setSelected })), { ...r, modelValue: t13 }; } }); function wR(n, e, t13, i, r, s) { const o = resolveComponent("el-tag"), a = resolveComponent("el-tooltip"), c = resolveComponent("el-icon"), l = resolveComponent("el-option"), d = resolveComponent("el-options"), h6 = resolveComponent("el-scrollbar"), p = resolveComponent("el-select-menu"), g = resolveDirective("click-outside"); return withDirectives((openBlock(), createElementBlock("div", { ref: "selectRef", class: normalizeClass([n.nsSelect.b(), n.nsSelect.m(n.selectSize)]), [toHandlerKey(n.mouseEnterEventName)]: (f) => n.states.inputHovering = true, onMouseleave: (f) => n.states.inputHovering = false }, [ createVNode(a, { ref: "tooltipRef", visible: n.dropdownMenuVisible, placement: n.placement, teleported: n.teleported, "popper-class": [n.nsSelect.e("popper"), n.popperClass], "popper-options": n.popperOptions, "fallback-placements": n.fallbackPlacements, effect: n.effect, pure: "", trigger: "click", transition: `${n.nsSelect.namespace.value}-zoom-in-top`, "stop-popper-mouse-event": false, "gpu-acceleration": false, persistent: n.persistent, "append-to": n.appendTo, onBeforeShow: n.handleMenuEnter, onHide: (f) => n.states.isBeforeHide = false }, { default: withCtx(() => { var f; return [ createBaseVNode("div", { ref: "wrapperRef", class: normalizeClass([ n.nsSelect.e("wrapper"), n.nsSelect.is("focused", n.isFocused), n.nsSelect.is("hovering", n.states.inputHovering), n.nsSelect.is("filterable", n.filterable), n.nsSelect.is("disabled", n.selectDisabled) ]), onClick: withModifiers(n.toggleMenu, ["prevent"]) }, [ n.$slots.prefix ? (openBlock(), createElementBlock("div", { key: 0, ref: "prefixRef", class: normalizeClass(n.nsSelect.e("prefix")) }, [ renderSlot(n.$slots, "prefix") ], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { ref: "selectionRef", class: normalizeClass([ n.nsSelect.e("selection"), n.nsSelect.is("near", n.multiple && !n.$slots.prefix && !!n.states.selected.length) ]) }, [ n.multiple ? renderSlot(n.$slots, "tag", { key: 0 }, () => [ (openBlock(true), createElementBlock(Fragment, null, renderList(n.showTagList, (u) => (openBlock(), createElementBlock("div", { key: n.getValueKey(u), class: normalizeClass(n.nsSelect.e("selected-item")) }, [ createVNode(o, { closable: !n.selectDisabled && !u.isDisabled, size: n.collapseTagSize, type: n.tagType, effect: n.tagEffect, "disable-transitions": "", style: normalizeStyle(n.tagStyle), onClose: (y) => n.deleteTag(y, u) }, { default: withCtx(() => [ createBaseVNode("span", { class: normalizeClass(n.nsSelect.e("tags-text")) }, [ renderSlot(n.$slots, "label", { label: u.currentLabel, value: u.value }, () => [ createTextVNode(toDisplayString(u.currentLabel), 1) ]) ], 2) ]), _: 2 }, 1032, ["closable", "size", "type", "effect", "style", "onClose"]) ], 2))), 128)), n.collapseTags && n.states.selected.length > n.maxCollapseTags ? (openBlock(), createBlock(a, { key: 0, ref: "tagTooltipRef", disabled: n.dropdownMenuVisible || !n.collapseTagsTooltip, "fallback-placements": ["bottom", "top", "right", "left"], effect: n.effect, placement: "bottom", teleported: n.teleported }, { default: withCtx(() => [ createBaseVNode("div", { ref: "collapseItemRef", class: normalizeClass(n.nsSelect.e("selected-item")) }, [ createVNode(o, { closable: false, size: n.collapseTagSize, type: n.tagType, effect: n.tagEffect, "disable-transitions": "", style: normalizeStyle(n.collapseTagStyle) }, { default: withCtx(() => [ createBaseVNode("span", { class: normalizeClass(n.nsSelect.e("tags-text")) }, " + " + toDisplayString(n.states.selected.length - n.maxCollapseTags), 3) ]), _: 1 }, 8, ["size", "type", "effect", "style"]) ], 2) ]), content: withCtx(() => [ createBaseVNode("div", { ref: "tagMenuRef", class: normalizeClass(n.nsSelect.e("selection")) }, [ (openBlock(true), createElementBlock(Fragment, null, renderList(n.collapseTagList, (u) => (openBlock(), createElementBlock("div", { key: n.getValueKey(u), class: normalizeClass(n.nsSelect.e("selected-item")) }, [ createVNode(o, { class: "in-tooltip", closable: !n.selectDisabled && !u.isDisabled, size: n.collapseTagSize, type: n.tagType, effect: n.tagEffect, "disable-transitions": "", onClose: (y) => n.deleteTag(y, u) }, { default: withCtx(() => [ createBaseVNode("span", { class: normalizeClass(n.nsSelect.e("tags-text")) }, [ renderSlot(n.$slots, "label", { label: u.currentLabel, value: u.value }, () => [ createTextVNode(toDisplayString(u.currentLabel), 1) ]) ], 2) ]), _: 2 }, 1032, ["closable", "size", "type", "effect", "onClose"]) ], 2))), 128)) ], 2) ]), _: 3 }, 8, ["disabled", "effect", "teleported"])) : createCommentVNode("v-if", true) ]) : createCommentVNode("v-if", true), n.selectDisabled ? createCommentVNode("v-if", true) : (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass([ n.nsSelect.e("selected-item"), n.nsSelect.e("input-wrapper"), n.nsSelect.is("hidden", !n.filterable) ]) }, [ withDirectives(createBaseVNode("input", { id: n.inputId, ref: "inputRef", "onUpdate:modelValue": (u) => n.states.inputValue = u, type: "text", name: n.name, class: normalizeClass([n.nsSelect.e("input"), n.nsSelect.is(n.selectSize)]), disabled: n.selectDisabled, autocomplete: n.autocomplete, style: normalizeStyle(n.inputStyle), role: "combobox", readonly: !n.filterable, spellcheck: "false", "aria-activedescendant": ((f = n.hoverOption) == null ? void 0 : f.id) || "", "aria-controls": n.contentId, "aria-expanded": n.dropdownMenuVisible, "aria-label": n.ariaLabel, "aria-autocomplete": "none", "aria-haspopup": "listbox", onKeydown: [ withKeys(withModifiers((u) => n.navigateOptions("next"), ["stop", "prevent"]), ["down"]), withKeys(withModifiers((u) => n.navigateOptions("prev"), ["stop", "prevent"]), ["up"]), withKeys(withModifiers(n.handleEsc, ["stop", "prevent"]), ["esc"]), withKeys(withModifiers(n.selectOption, ["stop", "prevent"]), ["enter"]), withKeys(withModifiers(n.deletePrevTag, ["stop"]), ["delete"]) ], onCompositionstart: n.handleCompositionStart, onCompositionupdate: n.handleCompositionUpdate, onCompositionend: n.handleCompositionEnd, onInput: n.onInput, onClick: withModifiers(n.toggleMenu, ["stop"]) }, null, 46, ["id", "onUpdate:modelValue", "name", "disabled", "autocomplete", "readonly", "aria-activedescendant", "aria-controls", "aria-expanded", "aria-label", "onKeydown", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onInput", "onClick"]), [ [vModelText, n.states.inputValue] ]), n.filterable ? (openBlock(), createElementBlock("span", { key: 0, ref: "calculatorRef", "aria-hidden": "true", class: normalizeClass(n.nsSelect.e("input-calculator")), textContent: toDisplayString(n.states.inputValue) }, null, 10, ["textContent"])) : createCommentVNode("v-if", true) ], 2)), n.shouldShowPlaceholder ? (openBlock(), createElementBlock("div", { key: 2, class: normalizeClass([ n.nsSelect.e("selected-item"), n.nsSelect.e("placeholder"), n.nsSelect.is("transparent", !n.hasModelValue || n.expanded && !n.states.inputValue) ]) }, [ n.hasModelValue ? renderSlot(n.$slots, "label", { key: 0, label: n.currentPlaceholder, value: n.modelValue }, () => [ createBaseVNode("span", null, toDisplayString(n.currentPlaceholder), 1) ]) : (openBlock(), createElementBlock("span", { key: 1 }, toDisplayString(n.currentPlaceholder), 1)) ], 2)) : createCommentVNode("v-if", true) ], 2), createBaseVNode("div", { ref: "suffixRef", class: normalizeClass(n.nsSelect.e("suffix")) }, [ n.iconComponent && !n.showClose ? (openBlock(), createBlock(c, { key: 0, class: normalizeClass([n.nsSelect.e("caret"), n.nsSelect.e("icon"), n.iconReverse]) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(n.iconComponent))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true), n.showClose && n.clearIcon ? (openBlock(), createBlock(c, { key: 1, class: normalizeClass([ n.nsSelect.e("caret"), n.nsSelect.e("icon"), n.nsSelect.e("clear") ]), onClick: n.handleClearClick }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(n.clearIcon))) ]), _: 1 }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true), n.validateState && n.validateIcon ? (openBlock(), createBlock(c, { key: 2, class: normalizeClass([n.nsInput.e("icon"), n.nsInput.e("validateIcon")]) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(n.validateIcon))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true) ], 2) ], 10, ["onClick"]) ]; }), content: withCtx(() => [ createVNode(p, { ref: "menuRef" }, { default: withCtx(() => [ n.$slots.header ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(n.nsSelect.be("dropdown", "header")), onClick: withModifiers(() => { }, ["stop"]) }, [ renderSlot(n.$slots, "header") ], 10, ["onClick"])) : createCommentVNode("v-if", true), withDirectives(createVNode(h6, { id: n.contentId, ref: "scrollbarRef", tag: "ul", "wrap-class": n.nsSelect.be("dropdown", "wrap"), "view-class": n.nsSelect.be("dropdown", "list"), class: normalizeClass([n.nsSelect.is("empty", n.filteredOptionsCount === 0)]), role: "listbox", "aria-label": n.ariaLabel, "aria-orientation": "vertical" }, { default: withCtx(() => [ n.showNewOption ? (openBlock(), createBlock(l, { key: 0, value: n.states.inputValue, created: true }, null, 8, ["value"])) : createCommentVNode("v-if", true), createVNode(d, null, { default: withCtx(() => [ renderSlot(n.$slots, "default") ]), _: 3 }) ]), _: 3 }, 8, ["id", "wrap-class", "view-class", "class", "aria-label"]), [ [vShow, n.states.options.size > 0 && !n.loading] ]), n.$slots.loading && n.loading ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(n.nsSelect.be("dropdown", "loading")) }, [ renderSlot(n.$slots, "loading") ], 2)) : n.loading || n.filteredOptionsCount === 0 ? (openBlock(), createElementBlock("div", { key: 2, class: normalizeClass(n.nsSelect.be("dropdown", "empty")) }, [ renderSlot(n.$slots, "empty", {}, () => [ createBaseVNode("span", null, toDisplayString(n.emptyText), 1) ]) ], 2)) : createCommentVNode("v-if", true), n.$slots.footer ? (openBlock(), createElementBlock("div", { key: 3, class: normalizeClass(n.nsSelect.be("dropdown", "footer")), onClick: withModifiers(() => { }, ["stop"]) }, [ renderSlot(n.$slots, "footer") ], 10, ["onClick"])) : createCommentVNode("v-if", true) ]), _: 3 }, 512) ]), _: 3 }, 8, ["visible", "placement", "teleported", "popper-class", "popper-options", "fallback-placements", "effect", "transition", "persistent", "append-to", "onBeforeShow", "onHide"]) ], 16, ["onMouseleave"])), [ [g, n.handleClickOutside, n.popperRef] ]); } var MR = at(xR, [["render", wR], ["__file", "select.vue"]]); var SR = defineComponent({ name: "ElOptionGroup", componentName: "ElOptionGroup", props: { label: String, disabled: Boolean }, setup(n) { const e = it2("select"), t13 = ref(null), i = getCurrentInstance(), r = ref([]); provide(Ey2, reactive({ ...toRefs(n) })); const s = computed(() => r.value.some((l) => l.visible === true)), o = (l) => { var d, h6; return ((d = l.type) == null ? void 0 : d.name) === "ElOption" && !!((h6 = l.component) != null && h6.proxy); }, a = (l) => { const d = Ri2(l), h6 = []; return d.forEach((p) => { var g, f; o(p) ? h6.push(p.component.proxy) : (g = p.children) != null && g.length ? h6.push(...a(p.children)) : (f = p.component) != null && f.subTree && h6.push(...a(p.component.subTree)); }), h6; }, c = () => { r.value = a(i.subTree); }; return onMounted(() => { c(); }), k12(t13, c, { attributes: true, subtree: true, childList: true }), { groupRef: t13, visible: s, ns: e }; } }); function _R(n, e, t13, i, r, s) { return withDirectives((openBlock(), createElementBlock("ul", { ref: "groupRef", class: normalizeClass(n.ns.be("group", "wrap")) }, [ createBaseVNode("li", { class: normalizeClass(n.ns.be("group", "title")) }, toDisplayString(n.label), 3), createBaseVNode("li", null, [ createBaseVNode("ul", { class: normalizeClass(n.ns.b("group")) }, [ renderSlot(n.$slots, "default") ], 2) ]) ], 2)), [ [vShow, n.visible] ]); } var Ay2 = at(SR, [["render", _R], ["__file", "option-group.vue"]]); var oa2 = vn2(MR, { Option: zf2, OptionGroup: Ay2 }); var aa = gr(zf2); gr(Ay2); var TR = dt2({ trigger: qa2.trigger, placement: nh2.placement, disabled: qa2.disabled, visible: Zn2.visible, transition: Zn2.transition, popperOptions: nh2.popperOptions, tabindex: nh2.tabindex, content: Zn2.content, popperStyle: Zn2.popperStyle, popperClass: Zn2.popperClass, enterable: { ...Zn2.enterable, default: true }, effect: { ...Zn2.effect, default: "light" }, teleported: Zn2.teleported, title: String, width: { type: [String, Number], default: 150 }, offset: { type: Number, default: void 0 }, showAfter: { type: Number, default: 0 }, hideAfter: { type: Number, default: 200 }, autoClose: { type: Number, default: 0 }, showArrow: { type: Boolean, default: true }, persistent: { type: Boolean, default: true }, "onUpdate:visible": { type: Function } }); var ER = { "update:visible": (n) => gf2(n), "before-enter": () => true, "before-leave": () => true, "after-enter": () => true, "after-leave": () => true }; var AR = "onUpdate:visible"; var CR = defineComponent({ name: "ElPopover" }); var LR = defineComponent({ ...CR, props: TR, emits: ER, setup(n, { expose: e, emit: t13 }) { const i = n, r = computed(() => i[AR]), s = it2("popover"), o = ref(), a = computed(() => { var y; return (y = unref(o)) == null ? void 0 : y.popperRef; }), c = computed(() => [ { width: Zc2(i.width) }, i.popperStyle ]), l = computed(() => [s.b(), i.popperClass, { [s.m("plain")]: !!i.content }]), d = computed(() => i.transition === `${s.namespace.value}-fade-in-linear`), h6 = () => { var y; (y = o.value) == null || y.hide(); }, p = () => { t13("before-enter"); }, g = () => { t13("before-leave"); }, f = () => { t13("after-enter"); }, u = () => { t13("update:visible", false), t13("after-leave"); }; return e({ popperRef: a, hide: h6 }), (y, v) => (openBlock(), createBlock(unref(Bf2), mergeProps({ 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": unref(l), "popper-style": unref(c), teleported: y.teleported, persistent: y.persistent, "gpu-acceleration": unref(d), "onUpdate:visible": unref(r), onBeforeShow: p, onBeforeHide: g, onShow: f, onHide: u }), { content: withCtx(() => [ y.title ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(s).e("title")), role: "title" }, toDisplayString(y.title), 3)) : createCommentVNode("v-if", true), renderSlot(y.$slots, "default", {}, () => [ createTextVNode(toDisplayString(y.content), 1) ]) ]), default: withCtx(() => [ y.$slots.reference ? renderSlot(y.$slots, "reference", { key: 0 }) : createCommentVNode("v-if", true) ]), _: 3 }, 16, ["trigger", "placement", "disabled", "visible", "transition", "popper-options", "tabindex", "content", "offset", "show-after", "hide-after", "auto-close", "show-arrow", "aria-label", "effect", "enterable", "popper-class", "popper-style", "teleported", "persistent", "gpu-acceleration", "onUpdate:visible"])); } }); var RR = at(LR, [["__file", "popover.vue"]]); var ag2 = (n, e) => { const t13 = e.arg || e.value, i = t13 == null ? void 0 : t13.popperRef; i && (i.triggerRef = n); }; var PR = { mounted(n, e) { ag2(n, e); }, updated(n, e) { ag2(n, e); } }; var IR = "popover"; var OR = yE2(PR, IR); var Mu2 = vn2(RR, { directive: OR }); var Cy2 = Symbol("sliderContextKey"); var DR = dt2({ modelValue: { type: Ye2([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: true }, size: Do2, inputSize: Do2, showStops: Boolean, showTooltip: { type: Boolean, default: true }, formatTooltip: { type: Ye2(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: Ye2(Function), default: void 0 }, tooltipClass: { type: String, default: void 0 }, placement: { type: String, values: ia, default: "top" }, marks: { type: Ye2(Object) }, validateEvent: { type: Boolean, default: true }, ...Gs2(["ariaLabel"]) }); var ih2 = (n) => St(n) || Un2(n) && n.every(St); var NR = { [Dt2]: ih2, [Ss2]: ih2, [Qr2]: ih2 }; var FR = (n, e, t13) => { const i = ref(); return onMounted(async () => { n.range ? (Array.isArray(n.modelValue) ? (e.firstValue = Math.max(n.min, n.modelValue[0]), e.secondValue = Math.min(n.max, n.modelValue[1])) : (e.firstValue = n.min, e.secondValue = n.max), e.oldValue = [e.firstValue, e.secondValue]) : (typeof n.modelValue != "number" || Number.isNaN(n.modelValue) ? e.firstValue = n.min : e.firstValue = Math.min(n.max, Math.max(n.min, n.modelValue)), e.oldValue = e.firstValue), pn2(window, "resize", t13), await nextTick(), t13(); }), { sliderWrapper: i }; }; var BR = (n) => computed(() => n.marks ? Object.keys(n.marks).map(Number.parseFloat).sort((t13, i) => t13 - i).filter((t13) => t13 <= n.max && t13 >= n.min).map((t13) => ({ point: t13, position: (t13 - n.min) * 100 / (n.max - n.min), mark: n.marks[t13] })) : []); var zR = (n, e, t13) => { const { form: i, formItem: r } = gl2(), s = shallowRef(), o = ref(), a = ref(), c = { firstButton: o, secondButton: a }, l = computed(() => n.disabled || (i == null ? void 0 : i.disabled) || false), d = computed(() => Math.min(e.firstValue, e.secondValue)), h6 = computed(() => Math.max(e.firstValue, e.secondValue)), p = computed(() => n.range ? `${100 * (h6.value - d.value) / (n.max - n.min)}%` : `${100 * (e.firstValue - n.min) / (n.max - n.min)}%`), g = computed(() => n.range ? `${100 * (d.value - n.min) / (n.max - n.min)}%` : "0%"), f = computed(() => n.vertical ? { height: n.height } : {}), u = computed(() => n.vertical ? { height: p.value, bottom: g.value } : { width: p.value, left: g.value }), y = () => { s.value && (e.sliderSize = s.value[`client${n.vertical ? "Height" : "Width"}`]); }, v = (C) => { const A = n.min + C * (n.max - n.min) / 100; if (!n.range) return o; let P; return Math.abs(d.value - A) < Math.abs(h6.value - A) ? P = e.firstValue < e.secondValue ? "firstButton" : "secondButton" : P = e.firstValue > e.secondValue ? "firstButton" : "secondButton", c[P]; }, m = (C) => { const A = v(C); return A.value.setPosition(C), A; }, w = (C) => { e.firstValue = C ?? n.min, T(n.range ? [d.value, h6.value] : C ?? n.min); }, S = (C) => { e.secondValue = C, n.range && T([d.value, h6.value]); }, T = (C) => { t13(Dt2, C), t13(Ss2, C); }, M = async () => { await nextTick(), t13(Qr2, n.range ? [d.value, h6.value] : n.modelValue); }, x = (C) => { var A, P, I, b, O, N; if (l.value || e.dragging) return; y(); let D = 0; if (n.vertical) { const B = (I = (P = (A = C.touches) == null ? void 0 : A.item(0)) == null ? void 0 : P.clientY) != null ? I : C.clientY; D = (s.value.getBoundingClientRect().bottom - B) / e.sliderSize * 100; } else { const B = (N = (O = (b = C.touches) == null ? void 0 : b.item(0)) == null ? void 0 : O.clientX) != null ? N : C.clientX, U = s.value.getBoundingClientRect().left; D = (B - U) / e.sliderSize * 100; } if (!(D < 0 || D > 100)) return m(D); }; return { elFormItem: r, slider: s, firstButton: o, secondButton: a, sliderDisabled: l, minValue: d, maxValue: h6, runwayStyle: f, barStyle: u, resetSize: y, setPosition: m, emitChange: M, onSliderWrapperPrevent: (C) => { var A, P; ((A = c.firstButton.value) != null && A.dragging || (P = c.secondButton.value) != null && P.dragging) && C.preventDefault(); }, onSliderClick: (C) => { x(C) && M(); }, onSliderDown: async (C) => { const A = x(C); A && (await nextTick(), A.value.onButtonDown(C)); }, onSliderMarkerDown: (C) => { l.value || e.dragging || m(C); }, setFirstValue: w, setSecondValue: S }; }; var { left: UR, down: VR, right: kR, up: GR, home: HR, end: WR, pageUp: jR, pageDown: $R } = Di2; var ZR = (n, e, t13) => { const i = ref(), r = ref(false), s = computed(() => e.value instanceof Function), o = computed(() => s.value && e.value(n.modelValue) || n.modelValue), a = ad2(() => { t13.value && (r.value = true); }, 50), c = ad2(() => { t13.value && (r.value = false); }, 50); return { tooltip: i, tooltipVisible: r, formatValue: o, displayTooltip: a, hideTooltip: c }; }; var XR = (n, e, t13) => { const { disabled: i, min: r, max: s, step: o, showTooltip: a, precision: c, sliderSize: l, formatTooltip: d, emitChange: h6, resetSize: p, updateDragging: g } = inject(Cy2), { tooltip: f, tooltipVisible: u, formatValue: y, displayTooltip: v, hideTooltip: m } = ZR(n, d, a), w = ref(), S = computed(() => `${(n.modelValue - r.value) / (s.value - r.value) * 100}%`), T = computed(() => n.vertical ? { bottom: S.value } : { left: S.value }), M = () => { e.hovering = true, v(); }, x = () => { e.hovering = false, e.dragging || m(); }, _ = (k) => { i.value || (k.preventDefault(), N(k), window.addEventListener("mousemove", D), window.addEventListener("touchmove", D), window.addEventListener("mouseup", B), window.addEventListener("touchend", B), window.addEventListener("contextmenu", B), w.value.focus()); }, E = (k) => { i.value || (e.newPosition = Number.parseFloat(S.value) + k / (s.value - r.value) * 100, U(e.newPosition), h6()); }, L = () => { E(-o.value); }, R = () => { E(o.value); }, C = () => { E(-o.value * 4); }, A = () => { E(o.value * 4); }, P = () => { i.value || (U(0), h6()); }, I = () => { i.value || (U(100), h6()); }, b = (k) => { let K = true; [UR, VR].includes(k.key) ? L() : [kR, GR].includes(k.key) ? R() : k.key === HR ? P() : k.key === WR ? I() : k.key === $R ? C() : k.key === jR ? A() : K = false, K && k.preventDefault(); }, O = (k) => { let K, ie; return k.type.startsWith("touch") ? (ie = k.touches[0].clientY, K = k.touches[0].clientX) : (ie = k.clientY, K = k.clientX), { clientX: K, clientY: ie }; }, N = (k) => { e.dragging = true, e.isClick = true; const { clientX: K, clientY: ie } = O(k); n.vertical ? e.startY = ie : e.startX = K, e.startPosition = Number.parseFloat(S.value), e.newPosition = e.startPosition; }, D = (k) => { if (e.dragging) { e.isClick = false, v(), p(); let K; const { clientX: ie, clientY: j } = O(k); n.vertical ? (e.currentY = j, K = (e.startY - e.currentY) / l.value * 100) : (e.currentX = ie, K = (e.currentX - e.startX) / l.value * 100), e.newPosition = e.startPosition + K, U(e.newPosition); } }, B = () => { e.dragging && (setTimeout(() => { e.dragging = false, e.hovering || m(), e.isClick || U(e.newPosition), h6(); }, 0), window.removeEventListener("mousemove", D), window.removeEventListener("touchmove", D), window.removeEventListener("mouseup", B), window.removeEventListener("touchend", B), window.removeEventListener("contextmenu", B)); }, U = async (k) => { if (k === null || Number.isNaN(+k)) return; k < 0 ? k = 0 : k > 100 && (k = 100); const K = 100 / ((s.value - r.value) / o.value); let j = Math.round(k / K) * K * (s.value - r.value) * 0.01 + r.value; j = Number.parseFloat(j.toFixed(c.value)), j !== n.modelValue && t13(Dt2, j), !e.dragging && n.modelValue !== e.oldValue && (e.oldValue = n.modelValue), await nextTick(), e.dragging && v(), f.value.updatePopper(); }; return watch(() => e.dragging, (k) => { g(k); }), pn2(w, "touchstart", _, { passive: false }), { disabled: i, button: w, tooltip: f, tooltipVisible: u, showTooltip: a, wrapperStyle: T, formatValue: y, handleMouseEnter: M, handleMouseLeave: x, onButtonDown: _, onKeyDown: b, setPosition: U }; }; var YR = (n, e, t13, i) => ({ stops: computed(() => { if (!n.showStops || n.min > n.max) return []; if (n.step === 0) return en2("ElSlider", "step should not be 0."), []; const o = (n.max - n.min) / n.step, a = 100 * n.step / (n.max - n.min), c = Array.from({ length: o - 1 }).map((l, d) => (d + 1) * a); return n.range ? c.filter((l) => l < 100 * (t13.value - n.min) / (n.max - n.min) || l > 100 * (i.value - n.min) / (n.max - n.min)) : c.filter((l) => l > 100 * (e.firstValue - n.min) / (n.max - n.min)); }), getStopStyle: (o) => n.vertical ? { bottom: `${o}%` } : { left: `${o}%` } }); var JR = (n, e, t13, i, r, s) => { const o = (l) => { r(Dt2, l), r(Ss2, l); }, a = () => n.range ? ![t13.value, i.value].every((l, d) => l === e.oldValue[d]) : n.modelValue !== e.oldValue, c = () => { var l, d; n.min > n.max && na2("Slider", "min should not be greater than max."); const h6 = n.modelValue; n.range && Array.isArray(h6) ? h6[1] < n.min ? o([n.min, n.min]) : h6[0] > n.max ? o([n.max, n.max]) : h6[0] < n.min ? o([n.min, h6[1]]) : h6[1] > n.max ? o([h6[0], n.max]) : (e.firstValue = h6[0], e.secondValue = h6[1], a() && (n.validateEvent && ((l = s == null ? void 0 : s.validate) == null || l.call(s, "change").catch((p) => en2(p))), e.oldValue = h6.slice())) : !n.range && typeof h6 == "number" && !Number.isNaN(h6) && (h6 < n.min ? o(n.min) : h6 > n.max ? o(n.max) : (e.firstValue = h6, a() && (n.validateEvent && ((d = s == null ? void 0 : s.validate) == null || d.call(s, "change").catch((p) => en2(p))), e.oldValue = h6))); }; c(), watch(() => e.dragging, (l) => { l || c(); }), watch(() => n.modelValue, (l, d) => { e.dragging || Array.isArray(l) && Array.isArray(d) && l.every((h6, p) => h6 === d[p]) && e.firstValue === l[0] && e.secondValue === l[1] || c(); }, { deep: true }), watch(() => [n.min, n.max], () => { c(); }); }; var qR = dt2({ modelValue: { type: Number, default: 0 }, vertical: Boolean, tooltipClass: String, placement: { type: String, values: ia, default: "top" } }); var KR = { [Dt2]: (n) => St(n) }; var QR = defineComponent({ name: "ElSliderButton" }); var eP2 = defineComponent({ ...QR, props: qR, emits: KR, setup(n, { expose: e, emit: t13 }) { const i = n, r = it2("slider"), s = reactive({ hovering: false, dragging: false, isClick: false, startX: 0, currentX: 0, startY: 0, currentY: 0, startPosition: 0, newPosition: 0, oldValue: i.modelValue }), { disabled: o, button: a, tooltip: c, showTooltip: l, tooltipVisible: d, wrapperStyle: h6, formatValue: p, handleMouseEnter: g, handleMouseLeave: f, onButtonDown: u, onKeyDown: y, setPosition: v } = XR(i, s, t13), { hovering: m, dragging: w } = toRefs(s); return e({ onButtonDown: u, onKeyDown: y, setPosition: v, hovering: m, dragging: w }), (S, T) => (openBlock(), createElementBlock("div", { ref_key: "button", ref: a, class: normalizeClass([unref(r).e("button-wrapper"), { hover: unref(m), dragging: unref(w) }]), style: normalizeStyle(unref(h6)), tabindex: unref(o) ? -1 : 0, onMouseenter: unref(g), onMouseleave: unref(f), onMousedown: unref(u), onFocus: unref(g), onBlur: unref(f), onKeydown: unref(y) }, [ createVNode(unref(Bf2), { ref_key: "tooltip", ref: c, visible: unref(d), placement: S.placement, "fallback-placements": ["top", "bottom", "right", "left"], "stop-popper-mouse-event": false, "popper-class": S.tooltipClass, disabled: !unref(l), persistent: "" }, { content: withCtx(() => [ createBaseVNode("span", null, toDisplayString(unref(p)), 1) ]), default: withCtx(() => [ createBaseVNode("div", { class: normalizeClass([unref(r).e("button"), { hover: unref(m), dragging: unref(w) }]) }, null, 2) ]), _: 1 }, 8, ["visible", "placement", "popper-class", "disabled"]) ], 46, ["tabindex", "onMouseenter", "onMouseleave", "onMousedown", "onFocus", "onBlur", "onKeydown"])); } }); var lg2 = at(eP2, [["__file", "button.vue"]]); var tP2 = dt2({ mark: { type: Ye2([String, Object]), default: void 0 } }); var nP2 = defineComponent({ name: "ElSliderMarker", props: tP2, setup(n) { const e = it2("slider"), t13 = computed(() => On2(n.mark) ? n.mark : n.mark.label), i = computed(() => On2(n.mark) ? void 0 : n.mark.style); return () => h("div", { class: e.e("marks-text"), style: i.value }, t13.value); } }); var iP2 = defineComponent({ name: "ElSlider" }); var rP2 = defineComponent({ ...iP2, props: DR, emits: NR, setup(n, { expose: e, emit: t13 }) { const i = n, r = it2("slider"), { t: s } = mu2(), o = reactive({ firstValue: 0, secondValue: 0, oldValue: 0, dragging: false, sliderSize: 1 }), { elFormItem: a, slider: c, firstButton: l, secondButton: d, sliderDisabled: h6, minValue: p, maxValue: g, runwayStyle: f, barStyle: u, resetSize: y, emitChange: v, onSliderWrapperPrevent: m, onSliderClick: w, onSliderDown: S, onSliderMarkerDown: T, setFirstValue: M, setSecondValue: x } = zR(i, o, t13), { stops: _, getStopStyle: E } = YR(i, o, p, g), { inputId: L, isLabeledByFormItem: R } = Pf2(i, { formItemContext: a }), C = ra2(), A = computed(() => i.inputSize || C.value), P = computed(() => i.ariaLabel || s("el.slider.defaultLabel", { min: i.min, max: i.max })), I = computed(() => i.range ? i.rangeStartLabel || s("el.slider.defaultRangeStartLabel") : P.value), b = computed(() => i.formatValueText ? i.formatValueText(K.value) : `${K.value}`), O = computed(() => i.rangeEndLabel || s("el.slider.defaultRangeEndLabel")), N = computed(() => i.formatValueText ? i.formatValueText(ie.value) : `${ie.value}`), D = computed(() => [ r.b(), r.m(C.value), r.is("vertical", i.vertical), { [r.m("with-input")]: i.showInput } ]), B = BR(i); JR(i, o, p, g, t13, a); const U = computed(() => { const W = [i.min, i.max, i.step].map((q) => { const Q = `${q}`.split(".")[1]; return Q ? Q.length : 0; }); return Math.max.apply(null, W); }), { sliderWrapper: k } = FR(i, o, y), { firstValue: K, secondValue: ie, sliderSize: j } = toRefs(o), G = (W) => { o.dragging = W; }; return pn2(k, "touchstart", m, { passive: false }), pn2(k, "touchmove", m, { passive: false }), provide(Cy2, { ...toRefs(i), sliderSize: j, disabled: h6, precision: U, emitChange: v, resetSize: y, updateDragging: G }), e({ onSliderClick: w }), (W, q) => { var Q, ee; return openBlock(), createElementBlock("div", { id: W.range ? unref(L) : void 0, ref_key: "sliderWrapper", ref: k, class: normalizeClass(unref(D)), role: W.range ? "group" : void 0, "aria-label": W.range && !unref(R) ? unref(P) : void 0, "aria-labelledby": W.range && unref(R) ? (Q = unref(a)) == null ? void 0 : Q.labelId : void 0 }, [ createBaseVNode("div", { ref_key: "slider", ref: c, class: normalizeClass([ unref(r).e("runway"), { "show-input": W.showInput && !W.range }, unref(r).is("disabled", unref(h6)) ]), style: normalizeStyle(unref(f)), onMousedown: unref(S), onTouchstartPassive: unref(S) }, [ createBaseVNode("div", { class: normalizeClass(unref(r).e("bar")), style: normalizeStyle(unref(u)) }, null, 6), createVNode(lg2, { id: W.range ? void 0 : unref(L), ref_key: "firstButton", ref: l, "model-value": unref(K), vertical: W.vertical, "tooltip-class": W.tooltipClass, placement: W.placement, role: "slider", "aria-label": W.range || !unref(R) ? unref(I) : void 0, "aria-labelledby": !W.range && unref(R) ? (ee = unref(a)) == null ? void 0 : ee.labelId : void 0, "aria-valuemin": W.min, "aria-valuemax": W.range ? unref(ie) : W.max, "aria-valuenow": unref(K), "aria-valuetext": unref(b), "aria-orientation": W.vertical ? "vertical" : "horizontal", "aria-disabled": unref(h6), "onUpdate:modelValue": unref(M) }, 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"]), W.range ? (openBlock(), createBlock(lg2, { key: 0, ref_key: "secondButton", ref: d, "model-value": unref(ie), vertical: W.vertical, "tooltip-class": W.tooltipClass, placement: W.placement, role: "slider", "aria-label": unref(O), "aria-valuemin": unref(K), "aria-valuemax": W.max, "aria-valuenow": unref(ie), "aria-valuetext": unref(N), "aria-orientation": W.vertical ? "vertical" : "horizontal", "aria-disabled": unref(h6), "onUpdate:modelValue": unref(x) }, null, 8, ["model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue"])) : createCommentVNode("v-if", true), W.showStops ? (openBlock(), createElementBlock("div", { key: 1 }, [ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(_), (ne, Y) => (openBlock(), createElementBlock("div", { key: Y, class: normalizeClass(unref(r).e("stop")), style: normalizeStyle(unref(E)(ne)) }, null, 6))), 128)) ])) : createCommentVNode("v-if", true), unref(B).length > 0 ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [ createBaseVNode("div", null, [ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(B), (ne, Y) => (openBlock(), createElementBlock("div", { key: Y, style: normalizeStyle(unref(E)(ne.position)), class: normalizeClass([unref(r).e("stop"), unref(r).e("marks-stop")]) }, null, 6))), 128)) ]), createBaseVNode("div", { class: normalizeClass(unref(r).e("marks")) }, [ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(B), (ne, Y) => (openBlock(), createBlock(unref(nP2), { key: Y, mark: ne.mark, style: normalizeStyle(unref(E)(ne.position)), onMousedown: withModifiers((te) => unref(T)(ne.position), ["stop"]) }, null, 8, ["mark", "style", "onMousedown"]))), 128)) ], 2) ], 64)) : createCommentVNode("v-if", true) ], 46, ["onMousedown", "onTouchstartPassive"]), W.showInput && !W.range ? (openBlock(), createBlock(unref(yr2), { key: 0, ref: "input", "model-value": unref(K), class: normalizeClass(unref(r).e("input")), step: W.step, disabled: unref(h6), controls: W.showInputControls, min: W.min, max: W.max, precision: unref(U), debounce: W.debounce, size: unref(A), "onUpdate:modelValue": unref(M), onChange: unref(v) }, null, 8, ["model-value", "class", "step", "disabled", "controls", "min", "max", "precision", "debounce", "size", "onUpdate:modelValue", "onChange"])) : createCommentVNode("v-if", true) ], 10, ["id", "role", "aria-label", "aria-labelledby"]); }; } }); var sP2 = at(rP2, [["__file", "slider.vue"]]); var ci2 = vn2(sP2); var Su2 = Symbol("tabsRootContextKey"); var oP2 = dt2({ tabs: { type: Ye2(Array), default: () => tr2([]) } }); var Ly2 = "ElTabBar"; var aP2 = defineComponent({ name: Ly2 }); var lP2 = defineComponent({ ...aP2, props: oP2, setup(n, { expose: e }) { const t13 = n, i = getCurrentInstance(), r = inject(Su2); r || na2(Ly2, ""); const s = it2("tabs"), o = ref(), a = ref(), c = () => { let g = 0, f = 0; const u = ["top", "bottom"].includes(r.props.tabPosition) ? "width" : "height", y = u === "width" ? "x" : "y", v = y === "x" ? "left" : "top"; return t13.tabs.every((m) => { var w, S; const T = (S = (w = i.parent) == null ? void 0 : w.refs) == null ? void 0 : S[`tab-${m.uid}`]; if (!T) return false; if (!m.active) return true; g = T[`offset${Br2(v)}`], f = T[`client${Br2(u)}`]; const M = window.getComputedStyle(T); return u === "width" && (f -= Number.parseFloat(M.paddingLeft) + Number.parseFloat(M.paddingRight), g += Number.parseFloat(M.paddingLeft)), false; }), { [u]: `${f}px`, transform: `translate${Br2(y)}(${g}px)` }; }, l = () => a.value = c(), d = [], h6 = () => { var g; d.forEach((u) => u.stop()), d.length = 0; const f = (g = i.parent) == null ? void 0 : g.refs; if (f) { for (const u in f) if (u.startsWith("tab-")) { const y = f[u]; y && d.push(ii2(y, l)); } } }; watch(() => t13.tabs, async () => { await nextTick(), l(), h6(); }, { immediate: true }); const p = ii2(o, () => l()); return onBeforeUnmount(() => { d.forEach((g) => g.stop()), d.length = 0, p.stop(); }), e({ ref: o, update: l }), (g, f) => (openBlock(), createElementBlock("div", { ref_key: "barRef", ref: o, class: normalizeClass([unref(s).e("active-bar"), unref(s).is(unref(r).props.tabPosition)]), style: normalizeStyle(a.value) }, null, 6)); } }); var cP2 = at(lP2, [["__file", "tab-bar.vue"]]); var uP2 = dt2({ panes: { type: Ye2(Array), default: () => tr2([]) }, currentName: { type: [String, Number], default: "" }, editable: Boolean, type: { type: String, values: ["card", "border-card", ""], default: "" }, stretch: Boolean }); var hP2 = { tabClick: (n, e, t13) => t13 instanceof Event, tabRemove: (n, e) => e instanceof Event }; var cg2 = "ElTabNav"; var dP2 = defineComponent({ name: cg2, props: uP2, emits: hP2, setup(n, { expose: e, emit: t13 }) { const i = inject(Su2); i || na2(cg2, ""); const r = it2("tabs"), s = D12(), o = Z12(), a = ref(), c = ref(), l = ref(), d = ref(), h6 = ref(false), p = ref(0), g = ref(false), f = ref(true), u = computed(() => ["top", "bottom"].includes(i.props.tabPosition) ? "width" : "height"), y = computed(() => ({ transform: `translate${u.value === "width" ? "X" : "Y"}(-${p.value}px)` })), v = () => { if (!a.value) return; const _ = a.value[`offset${Br2(u.value)}`], E = p.value; if (!E) return; const L = E > _ ? E - _ : 0; p.value = L; }, m = () => { if (!a.value || !c.value) return; const _ = c.value[`offset${Br2(u.value)}`], E = a.value[`offset${Br2(u.value)}`], L = p.value; if (_ - L <= E) return; const R = _ - L > E * 2 ? L + E : _ - E; p.value = R; }, w = async () => { const _ = c.value; if (!h6.value || !l.value || !a.value || !_) return; await nextTick(); const E = l.value.querySelector(".is-active"); if (!E) return; const L = a.value, R = ["top", "bottom"].includes(i.props.tabPosition), C = E.getBoundingClientRect(), A = L.getBoundingClientRect(), P = R ? _.offsetWidth - A.width : _.offsetHeight - A.height, I = p.value; let b = I; R ? (C.left < A.left && (b = I - (A.left - C.left)), C.right > A.right && (b = I + C.right - A.right)) : (C.top < A.top && (b = I - (A.top - C.top)), C.bottom > A.bottom && (b = I + (C.bottom - A.bottom))), b = Math.max(b, 0), p.value = Math.min(b, P); }, S = () => { var _; if (!c.value || !a.value) return; n.stretch && ((_ = d.value) == null || _.update()); const E = c.value[`offset${Br2(u.value)}`], L = a.value[`offset${Br2(u.value)}`], R = p.value; L < E ? (h6.value = h6.value || {}, h6.value.prev = R, h6.value.next = R + L < E, E - R < L && (p.value = E - L)) : (h6.value = false, R > 0 && (p.value = 0)); }, T = (_) => { const E = _.code, { up: L, down: R, left: C, right: A } = Di2; if (![L, R, C, A].includes(E)) return; const P = Array.from(_.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")), I = P.indexOf(_.target); let b; E === C || E === L ? I === 0 ? b = P.length - 1 : b = I - 1 : I < P.length - 1 ? b = I + 1 : b = 0, P[b].focus({ preventScroll: true }), P[b].click(), M(); }, M = () => { f.value && (g.value = true); }, x = () => g.value = false; return watch(s, (_) => { _ === "hidden" ? f.value = false : _ === "visible" && setTimeout(() => f.value = true, 50); }), watch(o, (_) => { _ ? setTimeout(() => f.value = true, 50) : f.value = false; }), ii2(l, S), onMounted(() => setTimeout(() => w(), 0)), onUpdated(() => S()), e({ scrollToActiveTab: w, removeFocus: x }), () => { const _ = h6.value ? [createVNode("span", { class: [r.e("nav-prev"), r.is("disabled", !h6.value.prev)], onClick: v }, [createVNode(Bt, null, { default: () => [createVNode(jr, null, null)] })]), createVNode("span", { class: [r.e("nav-next"), r.is("disabled", !h6.value.next)], onClick: m }, [createVNode(Bt, null, { default: () => [createVNode($r, null, null)] })])] : null, E = n.panes.map((L, R) => { var C, A, P, I; const b = L.uid, O = L.props.disabled, N = (A = (C = L.props.name) != null ? C : L.index) != null ? A : `${R}`, D = !O && (L.isClosable || n.editable); L.index = `${R}`; const B = D ? createVNode(Bt, { class: "is-icon-close", onClick: (K) => t13("tabRemove", L, K) }, { default: () => [createVNode(cd2, null, null)] }) : null, U = ((I = (P = L.slots).label) == null ? void 0 : I.call(P)) || L.props.label, k = !O && L.active ? 0 : -1; return createVNode("div", { ref: `tab-${b}`, class: [r.e("item"), r.is(i.props.tabPosition), r.is("active", L.active), r.is("disabled", O), r.is("closable", D), r.is("focus", g.value)], id: `tab-${N}`, key: `tab-${b}`, "aria-controls": `pane-${N}`, role: "tab", "aria-selected": L.active, tabindex: k, onFocus: () => M(), onBlur: () => x(), onClick: (K) => { x(), t13("tabClick", L, N, K); }, onKeydown: (K) => { D && (K.code === Di2.delete || K.code === Di2.backspace) && t13("tabRemove", L, K); } }, [U, B]); }); return createVNode("div", { ref: l, class: [r.e("nav-wrap"), r.is("scrollable", !!h6.value), r.is(i.props.tabPosition)] }, [_, createVNode("div", { class: r.e("nav-scroll"), ref: a }, [createVNode("div", { class: [r.e("nav"), r.is(i.props.tabPosition), r.is("stretch", n.stretch && ["top", "bottom"].includes(i.props.tabPosition))], ref: c, style: y.value, role: "tablist", onKeydown: T }, [n.type ? null : createVNode(cP2, { ref: d, tabs: [...n.panes] }, null), E])])]); }; } }); var fP2 = dt2({ 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: Ye2(Function), default: () => true }, stretch: Boolean }); var rh2 = (n) => On2(n) || St(n); var pP2 = { [Dt2]: (n) => rh2(n), tabClick: (n, e) => e instanceof Event, tabChange: (n) => rh2(n), edit: (n, e) => ["remove", "add"].includes(e), tabRemove: (n) => rh2(n), tabAdd: () => true }; var mP2 = defineComponent({ name: "ElTabs", props: fP2, emits: pP2, setup(n, { emit: e, slots: t13, expose: i }) { var r; const s = it2("tabs"), o = computed(() => ["left", "right"].includes(n.tabPosition)), { children: a, addChild: c, removeChild: l } = $A(getCurrentInstance(), "ElTabPane"), d = ref(), h6 = ref((r = n.modelValue) != null ? r : "0"), p = async (v, m = false) => { var w, S, T; if (!(h6.value === v || yi2(v))) try { await ((w = n.beforeLeave) == null ? void 0 : w.call(n, v, h6.value)) !== false && (h6.value = v, m && (e(Dt2, v), e("tabChange", v)), (T = (S = d.value) == null ? void 0 : S.removeFocus) == null || T.call(S)); } catch { } }, g = (v, m, w) => { v.props.disabled || (p(m, true), e("tabClick", v, w)); }, f = (v, m) => { v.props.disabled || yi2(v.props.name) || (m.stopPropagation(), e("edit", v.props.name, "remove"), e("tabRemove", v.props.name)); }, u = () => { e("edit", void 0, "add"), e("tabAdd"); }; watch(() => n.modelValue, (v) => p(v)), watch(h6, async () => { var v; await nextTick(), (v = d.value) == null || v.scrollToActiveTab(); }), provide(Su2, { props: n, currentName: h6, registerPane: (v) => { a.value.push(v); }, sortPane: c, unregisterPane: l }), i({ currentName: h6 }); const y = ({ render: v }) => v(); return () => { const v = t13["add-icon"], m = n.editable || n.addable ? createVNode("div", { class: [s.e("new-tab"), o.value && s.e("new-tab-vertical")], tabindex: "0", onClick: u, onKeydown: (T) => { T.code === Di2.enter && u(); } }, [v ? renderSlot(t13, "add-icon") : createVNode(Bt, { class: s.is("icon-plus") }, { default: () => [createVNode(fu2, null, null)] })]) : null, w = createVNode("div", { class: [s.e("header"), o.value && s.e("header-vertical"), s.is(n.tabPosition)] }, [createVNode(y, { render: () => { const T = a.value.some((M) => M.slots.label); return createVNode(dP2, { ref: d, currentName: h6.value, editable: n.editable, type: n.type, panes: a.value, stretch: n.stretch, onTabClick: g, onTabRemove: f }, { $stable: !T }); } }, null), m]), S = createVNode("div", { class: s.e("content") }, [renderSlot(t13, "default")]); return createVNode("div", { class: [s.b(), s.m(n.tabPosition), { [s.m("card")]: n.type === "card", [s.m("border-card")]: n.type === "border-card" }] }, [S, w]); }; } }); var gP2 = dt2({ label: { type: String, default: "" }, name: { type: [String, Number] }, closable: Boolean, disabled: Boolean, lazy: Boolean }); var Ry2 = "ElTabPane"; var vP2 = defineComponent({ name: Ry2 }); var yP2 = defineComponent({ ...vP2, props: gP2, setup(n) { const e = n, t13 = getCurrentInstance(), i = useSlots(), r = inject(Su2); r || na2(Ry2, "usage: "); const s = it2("tab-pane"), o = ref(), a = computed(() => e.closable || r.props.closable), c = Wp2(() => { var g; return r.currentName.value === ((g = e.name) != null ? g : o.value); }), l = ref(c.value), d = computed(() => { var g; return (g = e.name) != null ? g : o.value; }), h6 = Wp2(() => !e.lazy || l.value || c.value); watch(c, (g) => { g && (l.value = true); }); const p = reactive({ uid: t13.uid, slots: i, props: e, paneName: d, active: c, index: o, isClosable: a }); return r.registerPane(p), onMounted(() => { r.sortPane(p); }), onUnmounted(() => { r.unregisterPane(p.uid); }), (g, f) => unref(h6) ? withDirectives((openBlock(), createElementBlock("div", { key: 0, id: `pane-${unref(d)}`, class: normalizeClass(unref(s).b()), role: "tabpanel", "aria-hidden": !unref(c), "aria-labelledby": `tab-${unref(d)}` }, [ renderSlot(g.$slots, "default") ], 10, ["id", "aria-hidden", "aria-labelledby"])), [ [vShow, unref(c)] ]) : createCommentVNode("v-if", true); } }); var Py2 = at(yP2, [["__file", "tab-pane.vue"]]); var Iy2 = vn2(mP2, { TabPane: Py2 }); var Oy2 = gr(Py2); function bP2(n) { let e; const t13 = ref(false), i = reactive({ ...n, originalPosition: "", originalOverflow: "", visible: false }); function r(p) { i.text = p; } function s() { const p = i.parent, g = h6.ns; if (!p.vLoadingAddClassList) { let f = p.getAttribute("loading-number"); f = Number.parseInt(f) - 1, f ? p.setAttribute("loading-number", f.toString()) : ($c2(p, g.bm("parent", "relative")), p.removeAttribute("loading-number")), $c2(p, g.bm("parent", "hidden")); } o(), d.unmount(); } function o() { var p, g; (g = (p = h6.$el) == null ? void 0 : p.parentNode) == null || g.removeChild(h6.$el); } function a() { var p; n.beforeClose && !n.beforeClose() || (t13.value = true, clearTimeout(e), e = setTimeout(c, 400), i.visible = false, (p = n.closed) == null || p.call(n)); } function c() { if (!t13.value) return; const p = i.parent; t13.value = false, p.vLoadingAddClassList = void 0, s(); } const l = defineComponent({ name: "ElLoading", setup(p, { expose: g }) { const { ns: f, zIndex: u } = eC2("loading"); return g({ ns: f, zIndex: u }), () => { const y = i.spinner || i.svg, v = h("svg", { class: "circular", viewBox: i.svgViewBox ? i.svgViewBox : "0 0 50 50", ...y ? { innerHTML: y } : {} }, [ h("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none" }) ]), m = i.text ? h("p", { class: f.b("text") }, [i.text]) : void 0; return h(Transition, { name: f.b("fade"), onAfterLeave: c }, { default: withCtx(() => [ withDirectives(createVNode("div", { style: { backgroundColor: i.background || "" }, class: [ f.b("mask"), i.customClass, i.fullscreen ? "is-fullscreen" : "" ] }, [ h("div", { class: f.b("spinner") }, [v, m]) ]), [[vShow, i.visible]]) ]) }); }; } }), d = createApp(l), h6 = d.mount(document.createElement("div")); return { ...toRefs(i), setText: r, removeElLoadingChild: o, close: a, handleAfterLeave: c, vm: h6, get $el() { return h6.$el; } }; } var Gl2; var gd2 = function(n = {}) { if (!rn2) return; const e = xP2(n); if (e.fullscreen && Gl2) return Gl2; const t13 = bP2({ ...e, closed: () => { var r; (r = e.closed) == null || r.call(e), e.fullscreen && (Gl2 = void 0); } }); wP2(e, e.parent, t13), ug2(e, e.parent, t13), e.parent.vLoadingAddClassList = () => ug2(e, e.parent, t13); 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(t13.$el), nextTick(() => t13.visible.value = e.visible), e.fullscreen && (Gl2 = t13), t13; }; var xP2 = (n) => { var e, t13, i, r; let s; return On2(n.target) ? s = (e = document.querySelector(n.target)) != null ? e : document.body : s = n.target || document.body, { parent: s === document.body || n.body ? document.body : s, background: n.background || "", svg: n.svg || "", svgViewBox: n.svgViewBox || "", spinner: n.spinner || false, text: n.text || "", fullscreen: s === document.body && ((t13 = n.fullscreen) != null ? t13 : true), lock: (i = n.lock) != null ? i : false, customClass: n.customClass || "", visible: (r = n.visible) != null ? r : true, beforeClose: n.beforeClose, closed: n.closed, target: s }; }; var wP2 = async (n, e, t13) => { const { nextZIndex: i } = t13.vm.zIndex || t13.vm._.exposed.zIndex, r = {}; if (n.fullscreen) t13.originalPosition.value = va2(document.body, "position"), t13.originalOverflow.value = va2(document.body, "overflow"), r.zIndex = i(); else if (n.parent === document.body) { t13.originalPosition.value = va2(document.body, "position"), await nextTick(); for (const s of ["top", "left"]) { const o = s === "top" ? "scrollTop" : "scrollLeft"; r[s] = `${n.target.getBoundingClientRect()[s] + document.body[o] + document.documentElement[o] - Number.parseInt(va2(document.body, `margin-${s}`), 10)}px`; } for (const s of ["height", "width"]) r[s] = `${n.target.getBoundingClientRect()[s]}px`; } else t13.originalPosition.value = va2(e, "position"); for (const [s, o] of Object.entries(r)) t13.$el.style[s] = o; }; var ug2 = (n, e, t13) => { const i = t13.vm.ns || t13.vm._.exposed.ns; ["absolute", "fixed", "sticky"].includes(t13.originalPosition.value) ? $c2(e, i.bm("parent", "relative")) : Am2(e, i.bm("parent", "relative")), n.fullscreen && n.lock ? Am2(e, i.bm("parent", "hidden")) : $c2(e, i.bm("parent", "hidden")); }; var Uc2 = Symbol("ElLoading"); var hg2 = (n, e) => { var t13, i, r, s; const o = e.instance, a = (p) => Pn2(e.value) ? e.value[p] : void 0, c = (p) => { const g = On2(p) && (o == null ? void 0 : o[p]) || p; return g && ref(g); }, l = (p) => c(a(p) || n.getAttribute(`element-loading-${tM(p)}`)), d = (t13 = a("fullscreen")) != null ? t13 : e.modifiers.fullscreen, h6 = { text: l("text"), svg: l("svg"), svgViewBox: l("svgViewBox"), spinner: l("spinner"), background: l("background"), customClass: l("customClass"), fullscreen: d, target: (i = a("target")) != null ? i : d ? void 0 : n, body: (r = a("body")) != null ? r : e.modifiers.body, lock: (s = a("lock")) != null ? s : e.modifiers.lock }; n[Uc2] = { options: h6, instance: gd2(h6) }; }; var MP2 = (n, e) => { for (const t13 of Object.keys(e)) isRef(e[t13]) && (e[t13].value = n[t13]); }; var vd2 = { mounted(n, e) { e.value && hg2(n, e); }, updated(n, e) { const t13 = n[Uc2]; e.oldValue !== e.value && (e.value && !e.oldValue ? hg2(n, e) : e.value && e.oldValue ? Pn2(e.value) && MP2(e.value, t13.options) : t13 == null || t13.instance.close()); }, unmounted(n) { var e; (e = n[Uc2]) == null || e.instance.close(), n[Uc2] = null; } }; var SP2 = { install(n) { n.directive("loading", vd2), n.config.globalProperties.$loading = gd2; }, directive: vd2, service: gd2 }; var Dy2 = { exports: {} }; var dg2 = {}; var fg2; function _P2() { return fg2 || (fg2 = 1, function(n) { var e = function() { try { return !!Symbol.iterator; } catch { return false; } }, t13 = e(), i = function(l) { var d = { next: function() { var h6 = l.shift(); return { done: h6 === void 0, value: h6 }; } }; return t13 && (d[Symbol.iterator] = function() { return d; }), d; }, r = function(l) { return encodeURIComponent(l).replace(/%20/g, "+"); }, s = function(l) { return decodeURIComponent(String(l).replace(/\+/g, " ")); }, o = function() { var l = function(h6) { Object.defineProperty(this, "_entries", { writable: true, value: {} }); var p = typeof h6; if (p !== "undefined") if (p === "string") h6 !== "" && this._fromString(h6); else if (h6 instanceof l) { var g = this; h6.forEach(function(v, m) { g.append(m, v); }); } else if (h6 !== null && p === "object") if (Object.prototype.toString.call(h6) === "[object Array]") for (var f = 0; f < h6.length; f++) { var u = h6[f]; if (Object.prototype.toString.call(u) === "[object Array]" || u.length !== 2) this.append(u[0], u[1]); else throw new TypeError("Expected [string, any] as entry at index " + f + " of URLSearchParams's input"); } else for (var y in h6) h6.hasOwnProperty(y) && this.append(y, h6[y]); else throw new TypeError("Unsupported input's type for URLSearchParams"); }, d = l.prototype; d.append = function(h6, p) { h6 in this._entries ? this._entries[h6].push(String(p)) : this._entries[h6] = [String(p)]; }, d.delete = function(h6) { delete this._entries[h6]; }, d.get = function(h6) { return h6 in this._entries ? this._entries[h6][0] : null; }, d.getAll = function(h6) { return h6 in this._entries ? this._entries[h6].slice(0) : []; }, d.has = function(h6) { return h6 in this._entries; }, d.set = function(h6, p) { this._entries[h6] = [String(p)]; }, d.forEach = function(h6, p) { var g; for (var f in this._entries) if (this._entries.hasOwnProperty(f)) { g = this._entries[f]; for (var u = 0; u < g.length; u++) h6.call(p, g[u], f, this); } }, d.keys = function() { var h6 = []; return this.forEach(function(p, g) { h6.push(g); }), i(h6); }, d.values = function() { var h6 = []; return this.forEach(function(p) { h6.push(p); }), i(h6); }, d.entries = function() { var h6 = []; return this.forEach(function(p, g) { h6.push([g, p]); }), i(h6); }, t13 && (d[Symbol.iterator] = d.entries), d.toString = function() { var h6 = []; return this.forEach(function(p, g) { h6.push(r(g) + "=" + r(p)); }), h6.join("&"); }, n.URLSearchParams = l; }, a = function() { try { var l = n.URLSearchParams; return new l("?a=1").toString() === "a=1" && typeof l.prototype.set == "function" && typeof l.prototype.entries == "function"; } catch { return false; } }; a() || o(); var c = n.URLSearchParams.prototype; typeof c.sort != "function" && (c.sort = function() { var l = this, d = []; this.forEach(function(p, g) { d.push([g, p]), l._entries || l.delete(g); }), d.sort(function(p, g) { return p[0] < g[0] ? -1 : p[0] > g[0] ? 1 : 0; }), l._entries && (l._entries = {}); for (var h6 = 0; h6 < d.length; h6++) this.append(d[h6][0], d[h6][1]); }), typeof c._fromString != "function" && Object.defineProperty(c, "_fromString", { enumerable: false, configurable: false, writable: false, value: function(l) { if (this._entries) this._entries = {}; else { var d = []; this.forEach(function(f, u) { d.push(u); }); for (var h6 = 0; h6 < d.length; h6++) this.delete(d[h6]); } l = l.replace(/^\?/, ""); for (var p = l.split("&"), g, h6 = 0; h6 < p.length; h6++) g = p[h6].split("="), this.append( s(g[0]), g.length > 1 ? s(g[1]) : "" ); } }); }( typeof Fr2 < "u" ? Fr2 : typeof window < "u" ? window : typeof self < "u" ? self : Fr2 ), function(n) { var e = function() { try { var r = new n.URL("b", "http://a"); return r.pathname = "c d", r.href === "http://a/c%20d" && r.searchParams; } catch { return false; } }, t13 = function() { var r = n.URL, s = function(c, l) { typeof c != "string" && (c = String(c)), l && typeof l != "string" && (l = String(l)); var d = document, h6; if (l && (n.location === void 0 || l !== n.location.href)) { l = l.toLowerCase(), d = document.implementation.createHTMLDocument(""), h6 = d.createElement("base"), h6.href = l, d.head.appendChild(h6); try { if (h6.href.indexOf(l) !== 0) throw new Error(h6.href); } catch (w) { throw new Error("URL unable to set base " + l + " due to " + w); } } var p = d.createElement("a"); p.href = c, h6 && (d.body.appendChild(p), p.href = p.href); var g = d.createElement("input"); if (g.type = "url", g.value = c, p.protocol === ":" || !/:/.test(p.href) || !g.checkValidity() && !l) throw new TypeError("Invalid URL"); Object.defineProperty(this, "_anchorElement", { value: p }); var f = new n.URLSearchParams(this.search), u = true, y = true, v = this; ["append", "delete", "set"].forEach(function(w) { var S = f[w]; f[w] = function() { S.apply(f, arguments), u && (y = false, v.search = f.toString(), y = true); }; }), Object.defineProperty(this, "searchParams", { value: f, enumerable: true }); var m = void 0; Object.defineProperty(this, "_updateSearchParams", { enumerable: false, configurable: false, writable: false, value: function() { this.search !== m && (m = this.search, y && (u = false, this.searchParams._fromString(this.search), u = true)); } }); }, o = s.prototype, a = function(c) { Object.defineProperty(o, c, { get: function() { return this._anchorElement[c]; }, set: function(l) { this._anchorElement[c] = l; }, enumerable: true }); }; ["hash", "host", "hostname", "port", "protocol"].forEach(function(c) { a(c); }), Object.defineProperty(o, "search", { get: function() { return this._anchorElement.search; }, set: function(c) { this._anchorElement.search = c, this._updateSearchParams(); }, enumerable: true }), 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: true }, pathname: { get: function() { return this._anchorElement.pathname.replace(/(^\/?)/, "/"); }, set: function(c) { this._anchorElement.pathname = c; }, enumerable: true }, 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: true }, password: { // TODO get: function() { return ""; }, set: function(c) { }, enumerable: true }, username: { // TODO get: function() { return ""; }, set: function(c) { }, enumerable: true } }), s.createObjectURL = function(c) { return r.createObjectURL.apply(r, arguments); }, s.revokeObjectURL = function(c) { return r.revokeObjectURL.apply(r, arguments); }, n.URL = s; }; if (e() || t13(), n.location !== void 0 && !("origin" in n.location)) { var i = function() { return n.location.protocol + "//" + n.location.hostname + (n.location.port ? ":" + n.location.port : ""); }; try { Object.defineProperty(n.location, "origin", { get: i, enumerable: true }); } catch { setInterval(function() { n.location.origin = i(); }, 100); } } }( typeof Fr2 < "u" ? Fr2 : typeof window < "u" ? window : typeof self < "u" ? self : Fr2 )), dg2; } var Uf2 = "130"; var TP2 = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 }; var EP2 = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 }; var Ny2 = 0; var yd2 = 1; var Fy2 = 2; var AP2 = 3; var CP2 = 0; var Vf2 = 1; var By2 = 2; var wo2 = 3; var Xr2 = 0; var qt2 = 1; var Yr2 = 2; var kf2 = 1; var LP2 = 2; var or2 = 0; var _o2 = 1; var bd2 = 2; var xd2 = 3; var wd2 = 4; var zy2 = 5; var ys = 100; var Uy2 = 101; var Vy2 = 102; var Md2 = 103; var Sd2 = 104; var ky2 = 200; var Gy2 = 201; var Hy2 = 202; var Wy2 = 203; var Gf2 = 204; var Hf2 = 205; var jy2 = 206; var $y2 = 207; var Zy2 = 208; var Xy2 = 209; var Yy2 = 210; var Jy2 = 0; var qy2 = 1; var Ky2 = 2; var Kc2 = 3; var Qy2 = 4; var eb2 = 5; var tb2 = 6; var nb2 = 7; var vl2 = 0; var ib2 = 1; var rb2 = 2; var Vr2 = 0; var sb2 = 1; var ob2 = 2; var ab2 = 3; var lb2 = 4; var cb2 = 5; var _u2 = 300; var yl = 301; var bl2 = 302; var Qc2 = 303; var eu2 = 304; var la2 = 306; var xl2 = 307; var Jr = 1e3; var mn2 = 1001; var No2 = 1002; var Kt2 = 1003; var Ka2 = 1004; var RP2 = 1004; var Qa2 = 1005; var PP2 = 1005; var jt = 1006; var Tu2 = 1007; var IP2 = 1007; var br2 = 1008; var OP2 = 1008; var Ps2 = 1009; var ub2 = 1010; var hb2 = 1011; var el2 = 1012; var db2 = 1013; var Va2 = 1014; var nr2 = 1015; var Ts2 = 1016; var fb2 = 1017; var pb2 = 1018; var mb2 = 1019; var To2 = 1020; var gb2 = 1021; var ar2 = 1022; var Yn2 = 1023; var vb2 = 1024; var yb2 = 1025; var bb2 = Yn2; var Es2 = 1026; var Fo2 = 1027; var xb2 = 1028; var wb2 = 1029; var Mb2 = 1030; var Sb2 = 1031; var _b2 = 1032; var Tb2 = 1033; var _d2 = 33776; var Td2 = 33777; var Ed2 = 33778; var Ad2 = 33779; var Cd2 = 35840; var Ld2 = 35841; var Rd2 = 35842; var Pd2 = 35843; var Eb2 = 36196; var Id2 = 37492; var Od2 = 37496; var Ab2 = 37808; var Cb2 = 37809; var Lb2 = 37810; var Rb2 = 37811; var Pb2 = 37812; var Ib2 = 37813; var Ob2 = 37814; var Db2 = 37815; var Nb2 = 37816; var Fb2 = 37817; var Bb2 = 37818; var zb2 = 37819; var Ub2 = 37820; var Vb2 = 37821; var kb2 = 36492; var Gb2 = 37840; var Hb2 = 37841; var Wb2 = 37842; var jb2 = 37843; var $b2 = 37844; var Zb2 = 37845; var Xb2 = 37846; var Yb2 = 37847; var Jb2 = 37848; var qb2 = 37849; var Kb2 = 37850; var Qb2 = 37851; var ex2 = 37852; var tx2 = 37853; var nx2 = 2200; var ix2 = 2201; var rx2 = 2202; var Bo = 2300; var Is2 = 2301; var Vc2 = 2302; var xs2 = 2400; var ws2 = 2401; var tl2 = 2402; var Eu2 = 2500; var Wf2 = 2501; var sx2 = 0; var ox2 = 1; var jf2 = 2; var Dn2 = 3e3; var Os2 = 3001; var Au2 = 3007; var Cu2 = 3002; var ax2 = 3003; var $f2 = 3004; var Zf2 = 3005; var Xf2 = 3006; var lx2 = 3200; var cx2 = 3201; var ts2 = 0; var ux2 = 1; var DP2 = 0; var kc2 = 7680; var NP2 = 7681; var FP2 = 7682; var BP2 = 7683; var zP2 = 34055; var UP2 = 34056; var VP2 = 5386; var kP2 = 512; var GP2 = 513; var HP2 = 514; var WP2 = 515; var jP2 = 516; var $P2 = 517; var ZP2 = 518; var hx2 = 519; var zo2 = 35044; var Uo2 = 35048; var XP2 = 35040; var YP2 = 35045; var JP2 = 35049; var qP2 = 35041; var KP2 = 35046; var QP2 = 35050; var eI = 35042; var tI = "100"; var Dd2 = "300 es"; var ns2 = class { addEventListener(e, t13) { this._listeners === void 0 && (this._listeners = {}); const i = this._listeners; i[e] === void 0 && (i[e] = []), i[e].indexOf(t13) === -1 && i[e].push(t13); } hasEventListener(e, t13) { if (this._listeners === void 0) return false; const i = this._listeners; return i[e] !== void 0 && i[e].indexOf(t13) !== -1; } removeEventListener(e, t13) { if (this._listeners === void 0) return; const r = this._listeners[e]; if (r !== void 0) { const s = r.indexOf(t13); s !== -1 && r.splice(s, 1); } } dispatchEvent(e) { if (this._listeners === void 0) return; const i = this._listeners[e.type]; if (i !== void 0) { e.target = this; const r = i.slice(0); for (let s = 0, o = r.length; s < o; s++) r[s].call(this, e); e.target = null; } } }; var yn2 = []; for (let n = 0; n < 256; n++) yn2[n] = (n < 16 ? "0" : "") + n.toString(16); var Hl2 = 1234567; var As2 = Math.PI / 180; var nl2 = 180 / Math.PI; function Jn2() { const n = Math.random() * 4294967295 | 0, e = Math.random() * 4294967295 | 0, t13 = Math.random() * 4294967295 | 0, i = Math.random() * 4294967295 | 0; return (yn2[n & 255] + yn2[n >> 8 & 255] + yn2[n >> 16 & 255] + yn2[n >> 24 & 255] + "-" + yn2[e & 255] + yn2[e >> 8 & 255] + "-" + yn2[e >> 16 & 15 | 64] + yn2[e >> 24 & 255] + "-" + yn2[t13 & 63 | 128] + yn2[t13 >> 8 & 255] + "-" + yn2[t13 >> 16 & 255] + yn2[t13 >> 24 & 255] + yn2[i & 255] + yn2[i >> 8 & 255] + yn2[i >> 16 & 255] + yn2[i >> 24 & 255]).toUpperCase(); } function wn3(n, e, t13) { return Math.max(e, Math.min(t13, n)); } function Yf2(n, e) { return (n % e + e) % e; } function nI(n, e, t13, i, r) { return i + (n - e) * (r - i) / (t13 - e); } function iI(n, e, t13) { return n !== e ? (t13 - n) / (e - n) : 0; } function ka2(n, e, t13) { return (1 - t13) * n + t13 * e; } function rI(n, e, t13, i) { return ka2(n, e, 1 - Math.exp(-t13 * i)); } function sI(n, e = 1) { return e - Math.abs(Yf2(n, e * 2) - e); } function oI(n, e, t13) { return n <= e ? 0 : n >= t13 ? 1 : (n = (n - e) / (t13 - e), n * n * (3 - 2 * n)); } function aI(n, e, t13) { return n <= e ? 0 : n >= t13 ? 1 : (n = (n - e) / (t13 - e), n * n * n * (n * (n * 6 - 15) + 10)); } function lI(n, e) { return n + Math.floor(Math.random() * (e - n + 1)); } function cI(n, e) { return n + Math.random() * (e - n); } function uI(n) { return n * (0.5 - Math.random()); } function hI(n) { return n !== void 0 && (Hl2 = n % 2147483647), Hl2 = Hl2 * 16807 % 2147483647, (Hl2 - 1) / 2147483646; } function dI(n) { return n * As2; } function fI(n) { return n * nl2; } function Nd2(n) { return (n & n - 1) === 0 && n !== 0; } function dx2(n) { return Math.pow(2, Math.ceil(Math.log(n) / Math.LN2)); } function fx2(n) { return Math.pow(2, Math.floor(Math.log(n) / Math.LN2)); } function pI(n, e, t13, i, r) { const s = Math.cos, o = Math.sin, a = s(t13 / 2), c = o(t13 / 2), l = s((e + i) / 2), d = o((e + i) / 2), h6 = s((e - i) / 2), p = o((e - i) / 2), g = s((i - e) / 2), f = o((i - e) / 2); switch (r) { case "XYX": n.set(a * d, c * h6, c * p, a * l); break; case "YZY": n.set(c * p, a * d, c * h6, a * l); break; case "ZXZ": n.set(c * h6, c * p, a * d, a * l); break; case "XZX": n.set(a * d, c * f, c * g, a * l); break; case "YXY": n.set(c * g, a * d, c * f, a * l); break; case "ZYZ": n.set(c * f, c * g, a * d, a * l); break; default: console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: " + r); } } var Fd2 = Object.freeze({ __proto__: null, DEG2RAD: As2, RAD2DEG: nl2, generateUUID: Jn2, clamp: wn3, euclideanModulo: Yf2, mapLinear: nI, inverseLerp: iI, lerp: ka2, damp: rI, pingpong: sI, smoothstep: oI, smootherstep: aI, randInt: lI, randFloat: cI, randFloatSpread: uI, seededRandom: hI, degToRad: dI, radToDeg: fI, isPowerOfTwo: Nd2, ceilPowerOfTwo: dx2, floorPowerOfTwo: fx2, setQuaternionFromProperEuler: pI }); var Pe = class { constructor(e = 0, t13 = 0) { this.x = e, this.y = t13; } get width() { return this.x; } set width(e) { this.x = e; } get height() { return this.y; } set height(e) { this.y = e; } set(e, t13) { return this.x = e, this.y = t13, 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, t13) { switch (e) { case 0: this.x = t13; break; case 1: this.y = t13; 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, t13) { return t13 !== void 0 ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(e, t13)) : (this.x += e.x, this.y += e.y, this); } addScalar(e) { return this.x += e, this.y += e, this; } addVectors(e, t13) { return this.x = e.x + t13.x, this.y = e.y + t13.y, this; } addScaledVector(e, t13) { return this.x += e.x * t13, this.y += e.y * t13, this; } sub(e, t13) { return t13 !== void 0 ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(e, t13)) : (this.x -= e.x, this.y -= e.y, this); } subScalar(e) { return this.x -= e, this.y -= e, this; } subVectors(e, t13) { return this.x = e.x - t13.x, this.y = e.y - t13.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 t13 = this.x, i = this.y, r = e.elements; return this.x = r[0] * t13 + r[3] * i + r[6], this.y = r[1] * t13 + r[4] * i + r[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, t13) { return this.x = Math.max(e.x, Math.min(t13.x, this.x)), this.y = Math.max(e.y, Math.min(t13.y, this.y)), this; } clampScalar(e, t13) { return this.x = Math.max(e, Math.min(t13, this.x)), this.y = Math.max(e, Math.min(t13, this.y)), this; } clampLength(e, t13) { const i = this.length(); return this.divideScalar(i || 1).multiplyScalar(Math.max(e, Math.min(t13, 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 t13 = this.x - e.x, i = this.y - e.y; return t13 * t13 + 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, t13) { return this.x += (e.x - this.x) * t13, this.y += (e.y - this.y) * t13, this; } lerpVectors(e, t13, i) { return this.x = e.x + (t13.x - e.x) * i, this.y = e.y + (t13.y - e.y) * i, this; } equals(e) { return e.x === this.x && e.y === this.y; } fromArray(e, t13 = 0) { return this.x = e[t13], this.y = e[t13 + 1], this; } toArray(e = [], t13 = 0) { return e[t13] = this.x, e[t13 + 1] = this.y, e; } fromBufferAttribute(e, t13, i) { return i !== void 0 && console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."), this.x = e.getX(t13), this.y = e.getY(t13), this; } rotateAround(e, t13) { const i = Math.cos(t13), r = Math.sin(t13), s = this.x - e.x, o = this.y - e.y; return this.x = s * i - o * r + e.x, this.y = s * r + o * i + e.y, this; } random() { return this.x = Math.random(), this.y = Math.random(), this; } }; Pe.prototype.isVector2 = true; var ln2 = class { 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, t13, i, r, s, o, a, c, l) { const d = this.elements; return d[0] = e, d[1] = r, d[2] = a, d[3] = t13, d[4] = s, d[5] = c, d[6] = i, d[7] = o, d[8] = l, this; } identity() { return this.set( 1, 0, 0, 0, 1, 0, 0, 0, 1 ), this; } copy(e) { const t13 = this.elements, i = e.elements; return t13[0] = i[0], t13[1] = i[1], t13[2] = i[2], t13[3] = i[3], t13[4] = i[4], t13[5] = i[5], t13[6] = i[6], t13[7] = i[7], t13[8] = i[8], this; } extractBasis(e, t13, i) { return e.setFromMatrix3Column(this, 0), t13.setFromMatrix3Column(this, 1), i.setFromMatrix3Column(this, 2), this; } setFromMatrix4(e) { const t13 = e.elements; return this.set( t13[0], t13[4], t13[8], t13[1], t13[5], t13[9], t13[2], t13[6], t13[10] ), this; } multiply(e) { return this.multiplyMatrices(this, e); } premultiply(e) { return this.multiplyMatrices(e, this); } multiplyMatrices(e, t13) { const i = e.elements, r = t13.elements, s = this.elements, o = i[0], a = i[3], c = i[6], l = i[1], d = i[4], h6 = i[7], p = i[2], g = i[5], f = i[8], u = r[0], y = r[3], v = r[6], m = r[1], w = r[4], S = r[7], T = r[2], M = r[5], x = r[8]; return s[0] = o * u + a * m + c * T, s[3] = o * y + a * w + c * M, s[6] = o * v + a * S + c * x, s[1] = l * u + d * m + h6 * T, s[4] = l * y + d * w + h6 * M, s[7] = l * v + d * S + h6 * x, s[2] = p * u + g * m + f * T, s[5] = p * y + g * w + f * M, s[8] = p * v + g * S + f * x, this; } multiplyScalar(e) { const t13 = this.elements; return t13[0] *= e, t13[3] *= e, t13[6] *= e, t13[1] *= e, t13[4] *= e, t13[7] *= e, t13[2] *= e, t13[5] *= e, t13[8] *= e, this; } determinant() { const e = this.elements, t13 = e[0], i = e[1], r = e[2], s = e[3], o = e[4], a = e[5], c = e[6], l = e[7], d = e[8]; return t13 * o * d - t13 * a * l - i * s * d + i * a * c + r * s * l - r * o * c; } invert() { const e = this.elements, t13 = e[0], i = e[1], r = e[2], s = e[3], o = e[4], a = e[5], c = e[6], l = e[7], d = e[8], h6 = d * o - a * l, p = a * c - d * s, g = l * s - o * c, f = t13 * h6 + i * p + r * g; if (f === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0); const u = 1 / f; return e[0] = h6 * u, e[1] = (r * l - d * i) * u, e[2] = (a * i - r * o) * u, e[3] = p * u, e[4] = (d * t13 - r * c) * u, e[5] = (r * s - a * t13) * u, e[6] = g * u, e[7] = (i * c - l * t13) * u, e[8] = (o * t13 - i * s) * u, this; } transpose() { let e; const t13 = this.elements; return e = t13[1], t13[1] = t13[3], t13[3] = e, e = t13[2], t13[2] = t13[6], t13[6] = e, e = t13[5], t13[5] = t13[7], t13[7] = e, this; } getNormalMatrix(e) { return this.setFromMatrix4(e).invert().transpose(); } transposeIntoArray(e) { const t13 = this.elements; return e[0] = t13[0], e[1] = t13[3], e[2] = t13[6], e[3] = t13[1], e[4] = t13[4], e[5] = t13[7], e[6] = t13[2], e[7] = t13[5], e[8] = t13[8], this; } setUvTransform(e, t13, i, r, s, o, a) { const c = Math.cos(s), l = Math.sin(s); return this.set( i * c, i * l, -i * (c * o + l * a) + o + e, -r * l, r * c, -r * (-l * o + c * a) + a + t13, 0, 0, 1 ), this; } scale(e, t13) { const i = this.elements; return i[0] *= e, i[3] *= e, i[6] *= e, i[1] *= t13, i[4] *= t13, i[7] *= t13, this; } rotate(e) { const t13 = Math.cos(e), i = Math.sin(e), r = this.elements, s = r[0], o = r[3], a = r[6], c = r[1], l = r[4], d = r[7]; return r[0] = t13 * s + i * c, r[3] = t13 * o + i * l, r[6] = t13 * a + i * d, r[1] = -i * s + t13 * c, r[4] = -i * o + t13 * l, r[7] = -i * a + t13 * d, this; } translate(e, t13) { const i = this.elements; return i[0] += e * i[2], i[3] += e * i[5], i[6] += e * i[8], i[1] += t13 * i[2], i[4] += t13 * i[5], i[7] += t13 * i[8], this; } equals(e) { const t13 = this.elements, i = e.elements; for (let r = 0; r < 9; r++) if (t13[r] !== i[r]) return false; return true; } fromArray(e, t13 = 0) { for (let i = 0; i < 9; i++) this.elements[i] = e[i + t13]; return this; } toArray(e = [], t13 = 0) { const i = this.elements; return e[t13] = i[0], e[t13 + 1] = i[1], e[t13 + 2] = i[2], e[t13 + 3] = i[3], e[t13 + 4] = i[4], e[t13 + 5] = i[5], e[t13 + 6] = i[6], e[t13 + 7] = i[7], e[t13 + 8] = i[8], e; } clone() { return new this.constructor().fromArray(this.elements); } }; ln2.prototype.isMatrix3 = true; var qs2; var Hs2 = class { static getDataURL(e) { if (/^data:/i.test(e.src) || typeof HTMLCanvasElement > "u") return e.src; let t13; if (e instanceof HTMLCanvasElement) t13 = e; else { qs2 === void 0 && (qs2 = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas")), qs2.width = e.width, qs2.height = e.height; const i = qs2.getContext("2d"); e instanceof ImageData ? i.putImageData(e, 0, 0) : i.drawImage(e, 0, 0, e.width, e.height), t13 = qs2; } return t13.width > 2048 || t13.height > 2048 ? (console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons", e), t13.toDataURL("image/jpeg", 0.6)) : t13.toDataURL("image/png"); } }; var mI = 0; var nn2 = class _nn extends ns2 { constructor(e = _nn.DEFAULT_IMAGE, t13 = _nn.DEFAULT_MAPPING, i = mn2, r = mn2, s = jt, o = br2, a = Yn2, c = Ps2, l = 1, d = Dn2) { super(), Object.defineProperty(this, "id", { value: mI++ }), this.uuid = Jn2(), this.name = "", this.image = e, this.mipmaps = [], this.mapping = t13, this.wrapS = i, this.wrapT = r, this.magFilter = s, this.minFilter = o, this.anisotropy = l, this.format = a, this.internalFormat = null, this.type = c, this.offset = new Pe(0, 0), this.repeat = new Pe(1, 1), this.center = new Pe(0, 0), this.rotation = 0, this.matrixAutoUpdate = true, this.matrix = new ln2(), this.generateMipmaps = true, this.premultiplyAlpha = false, this.flipY = true, this.unpackAlignment = 4, this.encoding = d, 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 t13 = e === void 0 || typeof e == "string"; if (!t13 && 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 r = this.image; if (r.uuid === void 0 && (r.uuid = Jn2()), !t13 && e.images[r.uuid] === void 0) { let s; if (Array.isArray(r)) { s = []; for (let o = 0, a = r.length; o < a; o++) r[o].isDataTexture ? s.push(sh2(r[o].image)) : s.push(sh2(r[o])); } else s = sh2(r); e.images[r.uuid] = { uuid: r.uuid, url: s }; } i.image = r.uuid; } return t13 || (e.textures[this.uuid] = i), i; } dispose() { this.dispatchEvent({ type: "dispose" }); } transformUv(e) { if (this.mapping !== _u2) return e; if (e.applyMatrix3(this.matrix), e.x < 0 || e.x > 1) switch (this.wrapS) { case Jr: e.x = e.x - Math.floor(e.x); break; case mn2: e.x = e.x < 0 ? 0 : 1; break; case No2: 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 Jr: e.y = e.y - Math.floor(e.y); break; case mn2: e.y = e.y < 0 ? 0 : 1; break; case No2: 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 === true && this.version++; } }; nn2.DEFAULT_IMAGE = void 0; nn2.DEFAULT_MAPPING = _u2; nn2.prototype.isTexture = true; function sh2(n) { return typeof HTMLImageElement < "u" && n instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && n instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && n instanceof ImageBitmap ? Hs2.getDataURL(n) : n.data ? { data: Array.prototype.slice.call(n.data), width: n.width, height: n.height, type: n.data.constructor.name } : (console.warn("THREE.Texture: Unable to serialize Texture."), {}); } var _t2 = class { constructor(e = 0, t13 = 0, i = 0, r = 1) { this.x = e, this.y = t13, this.z = i, this.w = r; } get width() { return this.z; } set width(e) { this.z = e; } get height() { return this.w; } set height(e) { this.w = e; } set(e, t13, i, r) { return this.x = e, this.y = t13, this.z = i, this.w = r, 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, t13) { switch (e) { case 0: this.x = t13; break; case 1: this.y = t13; break; case 2: this.z = t13; break; case 3: this.w = t13; 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, t13) { return t13 !== void 0 ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(e, t13)) : (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, t13) { return this.x = e.x + t13.x, this.y = e.y + t13.y, this.z = e.z + t13.z, this.w = e.w + t13.w, this; } addScaledVector(e, t13) { return this.x += e.x * t13, this.y += e.y * t13, this.z += e.z * t13, this.w += e.w * t13, this; } sub(e, t13) { return t13 !== void 0 ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(e, t13)) : (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, t13) { return this.x = e.x - t13.x, this.y = e.y - t13.y, this.z = e.z - t13.z, this.w = e.w - t13.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 t13 = this.x, i = this.y, r = this.z, s = this.w, o = e.elements; return this.x = o[0] * t13 + o[4] * i + o[8] * r + o[12] * s, this.y = o[1] * t13 + o[5] * i + o[9] * r + o[13] * s, this.z = o[2] * t13 + o[6] * i + o[10] * r + o[14] * s, this.w = o[3] * t13 + o[7] * i + o[11] * r + o[15] * s, this; } divideScalar(e) { return this.multiplyScalar(1 / e); } setAxisAngleFromQuaternion(e) { this.w = 2 * Math.acos(e.w); const t13 = Math.sqrt(1 - e.w * e.w); return t13 < 1e-4 ? (this.x = 1, this.y = 0, this.z = 0) : (this.x = e.x / t13, this.y = e.y / t13, this.z = e.z / t13), this; } setAxisAngleFromRotationMatrix(e) { let t13, i, r, s; const c = e.elements, l = c[0], d = c[4], h6 = c[8], p = c[1], g = c[5], f = c[9], u = c[2], y = c[6], v = c[10]; if (Math.abs(d - p) < 0.01 && Math.abs(h6 - u) < 0.01 && Math.abs(f - y) < 0.01) { if (Math.abs(d + p) < 0.1 && Math.abs(h6 + u) < 0.1 && Math.abs(f + y) < 0.1 && Math.abs(l + g + v - 3) < 0.1) return this.set(1, 0, 0, 0), this; t13 = Math.PI; const w = (l + 1) / 2, S = (g + 1) / 2, T = (v + 1) / 2, M = (d + p) / 4, x = (h6 + u) / 4, _ = (f + y) / 4; return w > S && w > T ? w < 0.01 ? (i = 0, r = 0.707106781, s = 0.707106781) : (i = Math.sqrt(w), r = M / i, s = x / i) : S > T ? S < 0.01 ? (i = 0.707106781, r = 0, s = 0.707106781) : (r = Math.sqrt(S), i = M / r, s = _ / r) : T < 0.01 ? (i = 0.707106781, r = 0.707106781, s = 0) : (s = Math.sqrt(T), i = x / s, r = _ / s), this.set(i, r, s, t13), this; } let m = Math.sqrt((y - f) * (y - f) + (h6 - u) * (h6 - u) + (p - d) * (p - d)); return Math.abs(m) < 1e-3 && (m = 1), this.x = (y - f) / m, this.y = (h6 - u) / m, this.z = (p - d) / m, this.w = Math.acos((l + g + v - 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, t13) { return this.x = Math.max(e.x, Math.min(t13.x, this.x)), this.y = Math.max(e.y, Math.min(t13.y, this.y)), this.z = Math.max(e.z, Math.min(t13.z, this.z)), this.w = Math.max(e.w, Math.min(t13.w, this.w)), this; } clampScalar(e, t13) { return this.x = Math.max(e, Math.min(t13, this.x)), this.y = Math.max(e, Math.min(t13, this.y)), this.z = Math.max(e, Math.min(t13, this.z)), this.w = Math.max(e, Math.min(t13, this.w)), this; } clampLength(e, t13) { const i = this.length(); return this.divideScalar(i || 1).multiplyScalar(Math.max(e, Math.min(t13, 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, t13) { return this.x += (e.x - this.x) * t13, this.y += (e.y - this.y) * t13, this.z += (e.z - this.z) * t13, this.w += (e.w - this.w) * t13, this; } lerpVectors(e, t13, i) { return this.x = e.x + (t13.x - e.x) * i, this.y = e.y + (t13.y - e.y) * i, this.z = e.z + (t13.z - e.z) * i, this.w = e.w + (t13.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, t13 = 0) { return this.x = e[t13], this.y = e[t13 + 1], this.z = e[t13 + 2], this.w = e[t13 + 3], this; } toArray(e = [], t13 = 0) { return e[t13] = this.x, e[t13 + 1] = this.y, e[t13 + 2] = this.z, e[t13 + 3] = this.w, e; } fromBufferAttribute(e, t13, i) { return i !== void 0 && console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."), this.x = e.getX(t13), this.y = e.getY(t13), this.z = e.getZ(t13), this.w = e.getW(t13), this; } random() { return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this.w = Math.random(), this; } }; _t2.prototype.isVector4 = true; var bi2 = class extends ns2 { constructor(e, t13, i = {}) { super(), this.width = e, this.height = t13, this.depth = 1, this.scissor = new _t2(0, 0, e, t13), this.scissorTest = false, this.viewport = new _t2(0, 0, e, t13), this.texture = new nn2(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: t13, depth: 1 }, this.texture.generateMipmaps = i.generateMipmaps !== void 0 ? i.generateMipmaps : false, this.texture.minFilter = i.minFilter !== void 0 ? i.minFilter : jt, this.depthBuffer = i.depthBuffer !== void 0 ? i.depthBuffer : true, this.stencilBuffer = i.stencilBuffer !== void 0 ? i.stencilBuffer : false, 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, t13, i = 1) { (this.width !== e || this.height !== t13 || this.depth !== i) && (this.width = e, this.height = t13, this.depth = i, this.texture.image.width = e, this.texture.image.height = t13, this.texture.image.depth = i, this.dispose()), this.viewport.set(0, 0, e, t13), this.scissor.set(0, 0, e, t13); } 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" }); } }; bi2.prototype.isWebGLRenderTarget = true; var px2 = class extends bi2 { constructor(e, t13, i) { super(e, t13); const r = this.texture; this.texture = []; for (let s = 0; s < i; s++) this.texture[s] = r.clone(); } setSize(e, t13, i = 1) { if (this.width !== e || this.height !== t13 || this.depth !== i) { this.width = e, this.height = t13, this.depth = i; for (let r = 0, s = this.texture.length; r < s; r++) this.texture[r].image.width = e, this.texture[r].image.height = t13, this.texture[r].image.depth = i; this.dispose(); } return this.viewport.set(0, 0, e, t13), this.scissor.set(0, 0, e, t13), 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 t13 = 0, i = e.texture.length; t13 < i; t13++) this.texture[t13] = e.texture[t13].clone(); return this; } }; px2.prototype.isWebGLMultipleRenderTargets = true; var Jf2 = class extends bi2 { constructor(e, t13, i) { super(e, t13, i), this.samples = 4; } copy(e) { return super.copy.call(this, e), this.samples = e.samples, this; } }; Jf2.prototype.isWebGLMultisampleRenderTarget = true; var Sn = class { constructor(e = 0, t13 = 0, i = 0, r = 1) { this._x = e, this._y = t13, this._z = i, this._w = r; } static slerp(e, t13, i, r) { return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."), i.slerpQuaternions(e, t13, r); } static slerpFlat(e, t13, i, r, s, o, a) { let c = i[r + 0], l = i[r + 1], d = i[r + 2], h6 = i[r + 3]; const p = s[o + 0], g = s[o + 1], f = s[o + 2], u = s[o + 3]; if (a === 0) { e[t13 + 0] = c, e[t13 + 1] = l, e[t13 + 2] = d, e[t13 + 3] = h6; return; } if (a === 1) { e[t13 + 0] = p, e[t13 + 1] = g, e[t13 + 2] = f, e[t13 + 3] = u; return; } if (h6 !== u || c !== p || l !== g || d !== f) { let y = 1 - a; const v = c * p + l * g + d * f + h6 * u, m = v >= 0 ? 1 : -1, w = 1 - v * v; if (w > Number.EPSILON) { const T = Math.sqrt(w), M = Math.atan2(T, v * m); y = Math.sin(y * M) / T, a = Math.sin(a * M) / T; } const S = a * m; if (c = c * y + p * S, l = l * y + g * S, d = d * y + f * S, h6 = h6 * y + u * S, y === 1 - a) { const T = 1 / Math.sqrt(c * c + l * l + d * d + h6 * h6); c *= T, l *= T, d *= T, h6 *= T; } } e[t13] = c, e[t13 + 1] = l, e[t13 + 2] = d, e[t13 + 3] = h6; } static multiplyQuaternionsFlat(e, t13, i, r, s, o) { const a = i[r], c = i[r + 1], l = i[r + 2], d = i[r + 3], h6 = s[o], p = s[o + 1], g = s[o + 2], f = s[o + 3]; return e[t13] = a * f + d * h6 + c * g - l * p, e[t13 + 1] = c * f + d * p + l * h6 - a * g, e[t13 + 2] = l * f + d * g + a * p - c * h6, e[t13 + 3] = d * f - a * h6 - c * p - l * g, 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, t13, i, r) { return this._x = e, this._y = t13, this._z = i, this._w = r, 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, t13) { 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, r = e._y, s = e._z, o = e._order, a = Math.cos, c = Math.sin, l = a(i / 2), d = a(r / 2), h6 = a(s / 2), p = c(i / 2), g = c(r / 2), f = c(s / 2); switch (o) { case "XYZ": this._x = p * d * h6 + l * g * f, this._y = l * g * h6 - p * d * f, this._z = l * d * f + p * g * h6, this._w = l * d * h6 - p * g * f; break; case "YXZ": this._x = p * d * h6 + l * g * f, this._y = l * g * h6 - p * d * f, this._z = l * d * f - p * g * h6, this._w = l * d * h6 + p * g * f; break; case "ZXY": this._x = p * d * h6 - l * g * f, this._y = l * g * h6 + p * d * f, this._z = l * d * f + p * g * h6, this._w = l * d * h6 - p * g * f; break; case "ZYX": this._x = p * d * h6 - l * g * f, this._y = l * g * h6 + p * d * f, this._z = l * d * f - p * g * h6, this._w = l * d * h6 + p * g * f; break; case "YZX": this._x = p * d * h6 + l * g * f, this._y = l * g * h6 + p * d * f, this._z = l * d * f - p * g * h6, this._w = l * d * h6 - p * g * f; break; case "XZY": this._x = p * d * h6 - l * g * f, this._y = l * g * h6 - p * d * f, this._z = l * d * f + p * g * h6, this._w = l * d * h6 + p * g * f; break; default: console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + o); } return t13 !== false && this._onChangeCallback(), this; } setFromAxisAngle(e, t13) { const i = t13 / 2, r = Math.sin(i); return this._x = e.x * r, this._y = e.y * r, this._z = e.z * r, this._w = Math.cos(i), this._onChangeCallback(), this; } setFromRotationMatrix(e) { const t13 = e.elements, i = t13[0], r = t13[4], s = t13[8], o = t13[1], a = t13[5], c = t13[9], l = t13[2], d = t13[6], h6 = t13[10], p = i + a + h6; if (p > 0) { const g = 0.5 / Math.sqrt(p + 1); this._w = 0.25 / g, this._x = (d - c) * g, this._y = (s - l) * g, this._z = (o - r) * g; } else if (i > a && i > h6) { const g = 2 * Math.sqrt(1 + i - a - h6); this._w = (d - c) / g, this._x = 0.25 * g, this._y = (r + o) / g, this._z = (s + l) / g; } else if (a > h6) { const g = 2 * Math.sqrt(1 + a - i - h6); this._w = (s - l) / g, this._x = (r + o) / g, this._y = 0.25 * g, this._z = (c + d) / g; } else { const g = 2 * Math.sqrt(1 + h6 - i - a); this._w = (o - r) / g, this._x = (s + l) / g, this._y = (c + d) / g, this._z = 0.25 * g; } return this._onChangeCallback(), this; } setFromUnitVectors(e, t13) { let i = e.dot(t13) + 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 * t13.z - e.z * t13.y, this._y = e.z * t13.x - e.x * t13.z, this._z = e.x * t13.y - e.y * t13.x, this._w = i), this.normalize(); } angleTo(e) { return 2 * Math.acos(Math.abs(wn3(this.dot(e), -1, 1))); } rotateTowards(e, t13) { const i = this.angleTo(e); if (i === 0) return this; const r = Math.min(1, t13 / i); return this.slerp(e, r), 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, t13) { return t13 !== void 0 ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."), this.multiplyQuaternions(e, t13)) : this.multiplyQuaternions(this, e); } premultiply(e) { return this.multiplyQuaternions(e, this); } multiplyQuaternions(e, t13) { const i = e._x, r = e._y, s = e._z, o = e._w, a = t13._x, c = t13._y, l = t13._z, d = t13._w; return this._x = i * d + o * a + r * l - s * c, this._y = r * d + o * c + s * a - i * l, this._z = s * d + o * l + i * c - r * a, this._w = o * d - i * a - r * c - s * l, this._onChangeCallback(), this; } slerp(e, t13) { if (t13 === 0) return this; if (t13 === 1) return this.copy(e); const i = this._x, r = this._y, s = this._z, o = this._w; let a = o * e._w + i * e._x + r * e._y + s * e._z; if (a < 0 ? (this._w = -e._w, this._x = -e._x, this._y = -e._y, this._z = -e._z, a = -a) : this.copy(e), a >= 1) return this._w = o, this._x = i, this._y = r, this._z = s, this; const c = 1 - a * a; if (c <= Number.EPSILON) { const g = 1 - t13; return this._w = g * o + t13 * this._w, this._x = g * i + t13 * this._x, this._y = g * r + t13 * this._y, this._z = g * s + t13 * this._z, this.normalize(), this._onChangeCallback(), this; } const l = Math.sqrt(c), d = Math.atan2(l, a), h6 = Math.sin((1 - t13) * d) / l, p = Math.sin(t13 * d) / l; return this._w = o * h6 + this._w * p, this._x = i * h6 + this._x * p, this._y = r * h6 + this._y * p, this._z = s * h6 + this._z * p, this._onChangeCallback(), this; } slerpQuaternions(e, t13, i) { this.copy(e).slerp(t13, i); } equals(e) { return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w; } fromArray(e, t13 = 0) { return this._x = e[t13], this._y = e[t13 + 1], this._z = e[t13 + 2], this._w = e[t13 + 3], this._onChangeCallback(), this; } toArray(e = [], t13 = 0) { return e[t13] = this._x, e[t13 + 1] = this._y, e[t13 + 2] = this._z, e[t13 + 3] = this._w, e; } fromBufferAttribute(e, t13) { return this._x = e.getX(t13), this._y = e.getY(t13), this._z = e.getZ(t13), this._w = e.getW(t13), this; } _onChange(e) { return this._onChangeCallback = e, this; } _onChangeCallback() { } }; Sn.prototype.isQuaternion = true; var X = class { constructor(e = 0, t13 = 0, i = 0) { this.x = e, this.y = t13, this.z = i; } set(e, t13, i) { return i === void 0 && (i = this.z), this.x = e, this.y = t13, 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, t13) { switch (e) { case 0: this.x = t13; break; case 1: this.y = t13; break; case 2: this.z = t13; 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, t13) { return t13 !== void 0 ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(e, t13)) : (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, t13) { return this.x = e.x + t13.x, this.y = e.y + t13.y, this.z = e.z + t13.z, this; } addScaledVector(e, t13) { return this.x += e.x * t13, this.y += e.y * t13, this.z += e.z * t13, this; } sub(e, t13) { return t13 !== void 0 ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(e, t13)) : (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, t13) { return this.x = e.x - t13.x, this.y = e.y - t13.y, this.z = e.z - t13.z, this; } multiply(e, t13) { return t13 !== void 0 ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."), this.multiplyVectors(e, t13)) : (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, t13) { return this.x = e.x * t13.x, this.y = e.y * t13.y, this.z = e.z * t13.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(pg2.setFromEuler(e)); } applyAxisAngle(e, t13) { return this.applyQuaternion(pg2.setFromAxisAngle(e, t13)); } applyMatrix3(e) { const t13 = this.x, i = this.y, r = this.z, s = e.elements; return this.x = s[0] * t13 + s[3] * i + s[6] * r, this.y = s[1] * t13 + s[4] * i + s[7] * r, this.z = s[2] * t13 + s[5] * i + s[8] * r, this; } applyNormalMatrix(e) { return this.applyMatrix3(e).normalize(); } applyMatrix4(e) { const t13 = this.x, i = this.y, r = this.z, s = e.elements, o = 1 / (s[3] * t13 + s[7] * i + s[11] * r + s[15]); return this.x = (s[0] * t13 + s[4] * i + s[8] * r + s[12]) * o, this.y = (s[1] * t13 + s[5] * i + s[9] * r + s[13]) * o, this.z = (s[2] * t13 + s[6] * i + s[10] * r + s[14]) * o, this; } applyQuaternion(e) { const t13 = this.x, i = this.y, r = this.z, s = e.x, o = e.y, a = e.z, c = e.w, l = c * t13 + o * r - a * i, d = c * i + a * t13 - s * r, h6 = c * r + s * i - o * t13, p = -s * t13 - o * i - a * r; return this.x = l * c + p * -s + d * -a - h6 * -o, this.y = d * c + p * -o + h6 * -s - l * -a, this.z = h6 * c + p * -a + l * -o - d * -s, this; } project(e) { return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix); } unproject(e) { return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld); } transformDirection(e) { const t13 = this.x, i = this.y, r = this.z, s = e.elements; return this.x = s[0] * t13 + s[4] * i + s[8] * r, this.y = s[1] * t13 + s[5] * i + s[9] * r, this.z = s[2] * t13 + s[6] * i + s[10] * r, 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, t13) { return this.x = Math.max(e.x, Math.min(t13.x, this.x)), this.y = Math.max(e.y, Math.min(t13.y, this.y)), this.z = Math.max(e.z, Math.min(t13.z, this.z)), this; } clampScalar(e, t13) { return this.x = Math.max(e, Math.min(t13, this.x)), this.y = Math.max(e, Math.min(t13, this.y)), this.z = Math.max(e, Math.min(t13, this.z)), this; } clampLength(e, t13) { const i = this.length(); return this.divideScalar(i || 1).multiplyScalar(Math.max(e, Math.min(t13, 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, t13) { return this.x += (e.x - this.x) * t13, this.y += (e.y - this.y) * t13, this.z += (e.z - this.z) * t13, this; } lerpVectors(e, t13, i) { return this.x = e.x + (t13.x - e.x) * i, this.y = e.y + (t13.y - e.y) * i, this.z = e.z + (t13.z - e.z) * i, this; } cross(e, t13) { return t13 !== void 0 ? (console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."), this.crossVectors(e, t13)) : this.crossVectors(this, e); } crossVectors(e, t13) { const i = e.x, r = e.y, s = e.z, o = t13.x, a = t13.y, c = t13.z; return this.x = r * c - s * a, this.y = s * o - i * c, this.z = i * a - r * o, this; } projectOnVector(e) { const t13 = e.lengthSq(); if (t13 === 0) return this.set(0, 0, 0); const i = e.dot(this) / t13; return this.copy(e).multiplyScalar(i); } projectOnPlane(e) { return oh2.copy(this).projectOnVector(e), this.sub(oh2); } reflect(e) { return this.sub(oh2.copy(e).multiplyScalar(2 * this.dot(e))); } angleTo(e) { const t13 = Math.sqrt(this.lengthSq() * e.lengthSq()); if (t13 === 0) return Math.PI / 2; const i = this.dot(e) / t13; return Math.acos(wn3(i, -1, 1)); } distanceTo(e) { return Math.sqrt(this.distanceToSquared(e)); } distanceToSquared(e) { const t13 = this.x - e.x, i = this.y - e.y, r = this.z - e.z; return t13 * t13 + i * i + r * r; } 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, t13, i) { const r = Math.sin(t13) * e; return this.x = r * Math.sin(i), this.y = Math.cos(t13) * e, this.z = r * Math.cos(i), this; } setFromCylindrical(e) { return this.setFromCylindricalCoords(e.radius, e.theta, e.y); } setFromCylindricalCoords(e, t13, i) { return this.x = e * Math.sin(t13), this.y = i, this.z = e * Math.cos(t13), this; } setFromMatrixPosition(e) { const t13 = e.elements; return this.x = t13[12], this.y = t13[13], this.z = t13[14], this; } setFromMatrixScale(e) { const t13 = this.setFromMatrixColumn(e, 0).length(), i = this.setFromMatrixColumn(e, 1).length(), r = this.setFromMatrixColumn(e, 2).length(); return this.x = t13, this.y = i, this.z = r, this; } setFromMatrixColumn(e, t13) { return this.fromArray(e.elements, t13 * 4); } setFromMatrix3Column(e, t13) { return this.fromArray(e.elements, t13 * 3); } equals(e) { return e.x === this.x && e.y === this.y && e.z === this.z; } fromArray(e, t13 = 0) { return this.x = e[t13], this.y = e[t13 + 1], this.z = e[t13 + 2], this; } toArray(e = [], t13 = 0) { return e[t13] = this.x, e[t13 + 1] = this.y, e[t13 + 2] = this.z, e; } fromBufferAttribute(e, t13, i) { return i !== void 0 && console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."), this.x = e.getX(t13), this.y = e.getY(t13), this.z = e.getZ(t13), this; } random() { return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this; } }; X.prototype.isVector3 = true; var oh2 = new X(); var pg2 = new Sn(); var Hn2 = class { constructor(e = new X(1 / 0, 1 / 0, 1 / 0), t13 = new X(-1 / 0, -1 / 0, -1 / 0)) { this.min = e, this.max = t13; } set(e, t13) { return this.min.copy(e), this.max.copy(t13), this; } setFromArray(e) { let t13 = 1 / 0, i = 1 / 0, r = 1 / 0, s = -1 / 0, o = -1 / 0, a = -1 / 0; for (let c = 0, l = e.length; c < l; c += 3) { const d = e[c], h6 = e[c + 1], p = e[c + 2]; d < t13 && (t13 = d), h6 < i && (i = h6), p < r && (r = p), d > s && (s = d), h6 > o && (o = h6), p > a && (a = p); } return this.min.set(t13, i, r), this.max.set(s, o, a), this; } setFromBufferAttribute(e) { let t13 = 1 / 0, i = 1 / 0, r = 1 / 0, s = -1 / 0, o = -1 / 0, a = -1 / 0; for (let c = 0, l = e.count; c < l; c++) { const d = e.getX(c), h6 = e.getY(c), p = e.getZ(c); d < t13 && (t13 = d), h6 < i && (i = h6), p < r && (r = p), d > s && (s = d), h6 > o && (o = h6), p > a && (a = p); } return this.min.set(t13, i, r), this.max.set(s, o, a), this; } setFromPoints(e) { this.makeEmpty(); for (let t13 = 0, i = e.length; t13 < i; t13++) this.expandByPoint(e[t13]); return this; } setFromCenterAndSize(e, t13) { const i = ba2.copy(t13).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(false, false); const t13 = e.geometry; t13 !== void 0 && (t13.boundingBox === null && t13.computeBoundingBox(), ah2.copy(t13.boundingBox), ah2.applyMatrix4(e.matrixWorld), this.union(ah2)); const i = e.children; for (let r = 0, s = i.length; r < s; r++) this.expandByObject(i[r]); 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, t13) { return t13.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, ba2), ba2.distanceToSquared(e.center) <= e.radius * e.radius; } intersectsPlane(e) { let t13, i; return e.normal.x > 0 ? (t13 = e.normal.x * this.min.x, i = e.normal.x * this.max.x) : (t13 = e.normal.x * this.max.x, i = e.normal.x * this.min.x), e.normal.y > 0 ? (t13 += e.normal.y * this.min.y, i += e.normal.y * this.max.y) : (t13 += e.normal.y * this.max.y, i += e.normal.y * this.min.y), e.normal.z > 0 ? (t13 += e.normal.z * this.min.z, i += e.normal.z * this.max.z) : (t13 += e.normal.z * this.max.z, i += e.normal.z * this.min.z), t13 <= -e.constant && i >= -e.constant; } intersectsTriangle(e) { if (this.isEmpty()) return false; this.getCenter(xa2), Wl2.subVectors(this.max, xa2), Ks2.subVectors(e.a, xa2), Qs2.subVectors(e.b, xa2), eo2.subVectors(e.c, xa2), Sr2.subVectors(Qs2, Ks2), _r2.subVectors(eo2, Qs2), cs2.subVectors(Ks2, eo2); let t13 = [ 0, -Sr2.z, Sr2.y, 0, -_r2.z, _r2.y, 0, -cs2.z, cs2.y, Sr2.z, 0, -Sr2.x, _r2.z, 0, -_r2.x, cs2.z, 0, -cs2.x, -Sr2.y, Sr2.x, 0, -_r2.y, _r2.x, 0, -cs2.y, cs2.x, 0 ]; return !lh2(t13, Ks2, Qs2, eo2, Wl2) || (t13 = [1, 0, 0, 0, 1, 0, 0, 0, 1], !lh2(t13, Ks2, Qs2, eo2, Wl2)) ? false : (jl2.crossVectors(Sr2, _r2), t13 = [jl2.x, jl2.y, jl2.z], lh2(t13, Ks2, Qs2, eo2, Wl2)); } clampPoint(e, t13) { return t13.copy(e).clamp(this.min, this.max); } distanceToPoint(e) { return ba2.copy(e).clamp(this.min, this.max).sub(e).length(); } getBoundingSphere(e) { return this.getCenter(e.center), e.radius = this.getSize(ba2).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 : ($i2[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e), $i2[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e), $i2[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e), $i2[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e), $i2[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e), $i2[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e), $i2[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e), $i2[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e), this.setFromPoints($i2), 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); } }; Hn2.prototype.isBox3 = true; var $i2 = [ new X(), new X(), new X(), new X(), new X(), new X(), new X(), new X() ]; var ba2 = new X(); var ah2 = new Hn2(); var Ks2 = new X(); var Qs2 = new X(); var eo2 = new X(); var Sr2 = new X(); var _r2 = new X(); var cs2 = new X(); var xa2 = new X(); var Wl2 = new X(); var jl2 = new X(); var us2 = new X(); function lh2(n, e, t13, i, r) { for (let s = 0, o = n.length - 3; s <= o; s += 3) { us2.fromArray(n, s); const a = r.x * Math.abs(us2.x) + r.y * Math.abs(us2.y) + r.z * Math.abs(us2.z), c = e.dot(us2), l = t13.dot(us2), d = i.dot(us2); if (Math.max(-Math.max(c, l, d), Math.min(c, l, d)) > a) return false; } return true; } var gI = new Hn2(); var mg2 = new X(); var ch2 = new X(); var uh2 = new X(); var xr = class { constructor(e = new X(), t13 = -1) { this.center = e, this.radius = t13; } set(e, t13) { return this.center.copy(e), this.radius = t13, this; } setFromPoints(e, t13) { const i = this.center; t13 !== void 0 ? i.copy(t13) : gI.setFromPoints(e).getCenter(i); let r = 0; for (let s = 0, o = e.length; s < o; s++) r = Math.max(r, i.distanceToSquared(e[s])); return this.radius = Math.sqrt(r), 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 t13 = this.radius + e.radius; return e.center.distanceToSquared(this.center) <= t13 * t13; } intersectsBox(e) { return e.intersectsSphere(this); } intersectsPlane(e) { return Math.abs(e.distanceToPoint(this.center)) <= this.radius; } clampPoint(e, t13) { const i = this.center.distanceToSquared(e); return t13.copy(e), i > this.radius * this.radius && (t13.sub(this.center).normalize(), t13.multiplyScalar(this.radius).add(this.center)), t13; } 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) { uh2.subVectors(e, this.center); const t13 = uh2.lengthSq(); if (t13 > this.radius * this.radius) { const i = Math.sqrt(t13), r = (i - this.radius) * 0.5; this.center.add(uh2.multiplyScalar(r / i)), this.radius += r; } return this; } union(e) { return ch2.subVectors(e.center, this.center).normalize().multiplyScalar(e.radius), this.expandByPoint(mg2.copy(e.center).add(ch2)), this.expandByPoint(mg2.copy(e.center).sub(ch2)), this; } equals(e) { return e.center.equals(this.center) && e.radius === this.radius; } clone() { return new this.constructor().copy(this); } }; var Zi2 = new X(); var hh2 = new X(); var $l2 = new X(); var Tr2 = new X(); var dh2 = new X(); var Zl2 = new X(); var fh2 = new X(); var is2 = class { constructor(e = new X(), t13 = new X(0, 0, -1)) { this.origin = e, this.direction = t13; } set(e, t13) { return this.origin.copy(e), this.direction.copy(t13), this; } copy(e) { return this.origin.copy(e.origin), this.direction.copy(e.direction), this; } at(e, t13) { return t13.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, Zi2)), this; } closestPointToPoint(e, t13) { t13.subVectors(e, this.origin); const i = t13.dot(this.direction); return i < 0 ? t13.copy(this.origin) : t13.copy(this.direction).multiplyScalar(i).add(this.origin); } distanceToPoint(e) { return Math.sqrt(this.distanceSqToPoint(e)); } distanceSqToPoint(e) { const t13 = Zi2.subVectors(e, this.origin).dot(this.direction); return t13 < 0 ? this.origin.distanceToSquared(e) : (Zi2.copy(this.direction).multiplyScalar(t13).add(this.origin), Zi2.distanceToSquared(e)); } distanceSqToSegment(e, t13, i, r) { hh2.copy(e).add(t13).multiplyScalar(0.5), $l2.copy(t13).sub(e).normalize(), Tr2.copy(this.origin).sub(hh2); const s = e.distanceTo(t13) * 0.5, o = -this.direction.dot($l2), a = Tr2.dot(this.direction), c = -Tr2.dot($l2), l = Tr2.lengthSq(), d = Math.abs(1 - o * o); let h6, p, g, f; if (d > 0) if (h6 = o * c - a, p = o * a - c, f = s * d, h6 >= 0) if (p >= -f) if (p <= f) { const u = 1 / d; h6 *= u, p *= u, g = h6 * (h6 + o * p + 2 * a) + p * (o * h6 + p + 2 * c) + l; } else p = s, h6 = Math.max(0, -(o * p + a)), g = -h6 * h6 + p * (p + 2 * c) + l; else p = -s, h6 = Math.max(0, -(o * p + a)), g = -h6 * h6 + p * (p + 2 * c) + l; else p <= -f ? (h6 = Math.max(0, -(-o * s + a)), p = h6 > 0 ? -s : Math.min(Math.max(-s, -c), s), g = -h6 * h6 + p * (p + 2 * c) + l) : p <= f ? (h6 = 0, p = Math.min(Math.max(-s, -c), s), g = p * (p + 2 * c) + l) : (h6 = Math.max(0, -(o * s + a)), p = h6 > 0 ? s : Math.min(Math.max(-s, -c), s), g = -h6 * h6 + p * (p + 2 * c) + l); else p = o > 0 ? -s : s, h6 = Math.max(0, -(o * p + a)), g = -h6 * h6 + p * (p + 2 * c) + l; return i && i.copy(this.direction).multiplyScalar(h6).add(this.origin), r && r.copy($l2).multiplyScalar(p).add(hh2), g; } intersectSphere(e, t13) { Zi2.subVectors(e.center, this.origin); const i = Zi2.dot(this.direction), r = Zi2.dot(Zi2) - i * i, s = e.radius * e.radius; if (r > s) return null; const o = Math.sqrt(s - r), a = i - o, c = i + o; return a < 0 && c < 0 ? null : a < 0 ? this.at(c, t13) : this.at(a, t13); } intersectsSphere(e) { return this.distanceSqToPoint(e.center) <= e.radius * e.radius; } distanceToPlane(e) { const t13 = e.normal.dot(this.direction); if (t13 === 0) return e.distanceToPoint(this.origin) === 0 ? 0 : null; const i = -(this.origin.dot(e.normal) + e.constant) / t13; return i >= 0 ? i : null; } intersectPlane(e, t13) { const i = this.distanceToPlane(e); return i === null ? null : this.at(i, t13); } intersectsPlane(e) { const t13 = e.distanceToPoint(this.origin); return t13 === 0 || e.normal.dot(this.direction) * t13 < 0; } intersectBox(e, t13) { let i, r, s, o, a, c; const l = 1 / this.direction.x, d = 1 / this.direction.y, h6 = 1 / this.direction.z, p = this.origin; return l >= 0 ? (i = (e.min.x - p.x) * l, r = (e.max.x - p.x) * l) : (i = (e.max.x - p.x) * l, r = (e.min.x - p.x) * l), d >= 0 ? (s = (e.min.y - p.y) * d, o = (e.max.y - p.y) * d) : (s = (e.max.y - p.y) * d, o = (e.min.y - p.y) * d), i > o || s > r || ((s > i || i !== i) && (i = s), (o < r || r !== r) && (r = o), h6 >= 0 ? (a = (e.min.z - p.z) * h6, c = (e.max.z - p.z) * h6) : (a = (e.max.z - p.z) * h6, c = (e.min.z - p.z) * h6), i > c || a > r) || ((a > i || i !== i) && (i = a), (c < r || r !== r) && (r = c), r < 0) ? null : this.at(i >= 0 ? i : r, t13); } intersectsBox(e) { return this.intersectBox(e, Zi2) !== null; } intersectTriangle(e, t13, i, r, s) { dh2.subVectors(t13, e), Zl2.subVectors(i, e), fh2.crossVectors(dh2, Zl2); let o = this.direction.dot(fh2), a; if (o > 0) { if (r) return null; a = 1; } else if (o < 0) a = -1, o = -o; else return null; Tr2.subVectors(this.origin, e); const c = a * this.direction.dot(Zl2.crossVectors(Tr2, Zl2)); if (c < 0) return null; const l = a * this.direction.dot(dh2.cross(Tr2)); if (l < 0 || c + l > o) return null; const d = -a * Tr2.dot(fh2); return d < 0 ? null : this.at(d / o, s); } 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); } }; var $e2 = class _$e { 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, t13, i, r, s, o, a, c, l, d, h6, p, g, f, u, y) { const v = this.elements; return v[0] = e, v[4] = t13, v[8] = i, v[12] = r, v[1] = s, v[5] = o, v[9] = a, v[13] = c, v[2] = l, v[6] = d, v[10] = h6, v[14] = p, v[3] = g, v[7] = f, v[11] = u, v[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 _$e().fromArray(this.elements); } copy(e) { const t13 = this.elements, i = e.elements; return t13[0] = i[0], t13[1] = i[1], t13[2] = i[2], t13[3] = i[3], t13[4] = i[4], t13[5] = i[5], t13[6] = i[6], t13[7] = i[7], t13[8] = i[8], t13[9] = i[9], t13[10] = i[10], t13[11] = i[11], t13[12] = i[12], t13[13] = i[13], t13[14] = i[14], t13[15] = i[15], this; } copyPosition(e) { const t13 = this.elements, i = e.elements; return t13[12] = i[12], t13[13] = i[13], t13[14] = i[14], this; } setFromMatrix3(e) { const t13 = e.elements; return this.set( t13[0], t13[3], t13[6], 0, t13[1], t13[4], t13[7], 0, t13[2], t13[5], t13[8], 0, 0, 0, 0, 1 ), this; } extractBasis(e, t13, i) { return e.setFromMatrixColumn(this, 0), t13.setFromMatrixColumn(this, 1), i.setFromMatrixColumn(this, 2), this; } makeBasis(e, t13, i) { return this.set( e.x, t13.x, i.x, 0, e.y, t13.y, i.y, 0, e.z, t13.z, i.z, 0, 0, 0, 0, 1 ), this; } extractRotation(e) { const t13 = this.elements, i = e.elements, r = 1 / to2.setFromMatrixColumn(e, 0).length(), s = 1 / to2.setFromMatrixColumn(e, 1).length(), o = 1 / to2.setFromMatrixColumn(e, 2).length(); return t13[0] = i[0] * r, t13[1] = i[1] * r, t13[2] = i[2] * r, t13[3] = 0, t13[4] = i[4] * s, t13[5] = i[5] * s, t13[6] = i[6] * s, t13[7] = 0, t13[8] = i[8] * o, t13[9] = i[9] * o, t13[10] = i[10] * o, t13[11] = 0, t13[12] = 0, t13[13] = 0, t13[14] = 0, t13[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 t13 = this.elements, i = e.x, r = e.y, s = e.z, o = Math.cos(i), a = Math.sin(i), c = Math.cos(r), l = Math.sin(r), d = Math.cos(s), h6 = Math.sin(s); if (e.order === "XYZ") { const p = o * d, g = o * h6, f = a * d, u = a * h6; t13[0] = c * d, t13[4] = -c * h6, t13[8] = l, t13[1] = g + f * l, t13[5] = p - u * l, t13[9] = -a * c, t13[2] = u - p * l, t13[6] = f + g * l, t13[10] = o * c; } else if (e.order === "YXZ") { const p = c * d, g = c * h6, f = l * d, u = l * h6; t13[0] = p + u * a, t13[4] = f * a - g, t13[8] = o * l, t13[1] = o * h6, t13[5] = o * d, t13[9] = -a, t13[2] = g * a - f, t13[6] = u + p * a, t13[10] = o * c; } else if (e.order === "ZXY") { const p = c * d, g = c * h6, f = l * d, u = l * h6; t13[0] = p - u * a, t13[4] = -o * h6, t13[8] = f + g * a, t13[1] = g + f * a, t13[5] = o * d, t13[9] = u - p * a, t13[2] = -o * l, t13[6] = a, t13[10] = o * c; } else if (e.order === "ZYX") { const p = o * d, g = o * h6, f = a * d, u = a * h6; t13[0] = c * d, t13[4] = f * l - g, t13[8] = p * l + u, t13[1] = c * h6, t13[5] = u * l + p, t13[9] = g * l - f, t13[2] = -l, t13[6] = a * c, t13[10] = o * c; } else if (e.order === "YZX") { const p = o * c, g = o * l, f = a * c, u = a * l; t13[0] = c * d, t13[4] = u - p * h6, t13[8] = f * h6 + g, t13[1] = h6, t13[5] = o * d, t13[9] = -a * d, t13[2] = -l * d, t13[6] = g * h6 + f, t13[10] = p - u * h6; } else if (e.order === "XZY") { const p = o * c, g = o * l, f = a * c, u = a * l; t13[0] = c * d, t13[4] = -h6, t13[8] = l * d, t13[1] = p * h6 + u, t13[5] = o * d, t13[9] = g * h6 - f, t13[2] = f * h6 - g, t13[6] = a * d, t13[10] = u * h6 + p; } return t13[3] = 0, t13[7] = 0, t13[11] = 0, t13[12] = 0, t13[13] = 0, t13[14] = 0, t13[15] = 1, this; } makeRotationFromQuaternion(e) { return this.compose(vI, e, yI); } lookAt(e, t13, i) { const r = this.elements; return Wn2.subVectors(e, t13), Wn2.lengthSq() === 0 && (Wn2.z = 1), Wn2.normalize(), Er2.crossVectors(i, Wn2), Er2.lengthSq() === 0 && (Math.abs(i.z) === 1 ? Wn2.x += 1e-4 : Wn2.z += 1e-4, Wn2.normalize(), Er2.crossVectors(i, Wn2)), Er2.normalize(), Xl2.crossVectors(Wn2, Er2), r[0] = Er2.x, r[4] = Xl2.x, r[8] = Wn2.x, r[1] = Er2.y, r[5] = Xl2.y, r[9] = Wn2.y, r[2] = Er2.z, r[6] = Xl2.z, r[10] = Wn2.z, this; } multiply(e, t13) { return t13 !== void 0 ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."), this.multiplyMatrices(e, t13)) : this.multiplyMatrices(this, e); } premultiply(e) { return this.multiplyMatrices(e, this); } multiplyMatrices(e, t13) { const i = e.elements, r = t13.elements, s = this.elements, o = i[0], a = i[4], c = i[8], l = i[12], d = i[1], h6 = i[5], p = i[9], g = i[13], f = i[2], u = i[6], y = i[10], v = i[14], m = i[3], w = i[7], S = i[11], T = i[15], M = r[0], x = r[4], _ = r[8], E = r[12], L = r[1], R = r[5], C = r[9], A = r[13], P = r[2], I = r[6], b = r[10], O = r[14], N = r[3], D = r[7], B = r[11], U = r[15]; return s[0] = o * M + a * L + c * P + l * N, s[4] = o * x + a * R + c * I + l * D, s[8] = o * _ + a * C + c * b + l * B, s[12] = o * E + a * A + c * O + l * U, s[1] = d * M + h6 * L + p * P + g * N, s[5] = d * x + h6 * R + p * I + g * D, s[9] = d * _ + h6 * C + p * b + g * B, s[13] = d * E + h6 * A + p * O + g * U, s[2] = f * M + u * L + y * P + v * N, s[6] = f * x + u * R + y * I + v * D, s[10] = f * _ + u * C + y * b + v * B, s[14] = f * E + u * A + y * O + v * U, s[3] = m * M + w * L + S * P + T * N, s[7] = m * x + w * R + S * I + T * D, s[11] = m * _ + w * C + S * b + T * B, s[15] = m * E + w * A + S * O + T * U, this; } multiplyScalar(e) { const t13 = this.elements; return t13[0] *= e, t13[4] *= e, t13[8] *= e, t13[12] *= e, t13[1] *= e, t13[5] *= e, t13[9] *= e, t13[13] *= e, t13[2] *= e, t13[6] *= e, t13[10] *= e, t13[14] *= e, t13[3] *= e, t13[7] *= e, t13[11] *= e, t13[15] *= e, this; } determinant() { const e = this.elements, t13 = e[0], i = e[4], r = e[8], s = e[12], o = e[1], a = e[5], c = e[9], l = e[13], d = e[2], h6 = e[6], p = e[10], g = e[14], f = e[3], u = e[7], y = e[11], v = e[15]; return f * (+s * c * h6 - r * l * h6 - s * a * p + i * l * p + r * a * g - i * c * g) + u * (+t13 * c * g - t13 * l * p + s * o * p - r * o * g + r * l * d - s * c * d) + y * (+t13 * l * h6 - t13 * a * g - s * o * h6 + i * o * g + s * a * d - i * l * d) + v * (-r * a * d - t13 * c * h6 + t13 * a * p + r * o * h6 - i * o * p + i * c * d); } transpose() { const e = this.elements; let t13; return t13 = e[1], e[1] = e[4], e[4] = t13, t13 = e[2], e[2] = e[8], e[8] = t13, t13 = e[6], e[6] = e[9], e[9] = t13, t13 = e[3], e[3] = e[12], e[12] = t13, t13 = e[7], e[7] = e[13], e[13] = t13, t13 = e[11], e[11] = e[14], e[14] = t13, this; } setPosition(e, t13, i) { const r = this.elements; return e.isVector3 ? (r[12] = e.x, r[13] = e.y, r[14] = e.z) : (r[12] = e, r[13] = t13, r[14] = i), this; } invert() { const e = this.elements, t13 = e[0], i = e[1], r = e[2], s = e[3], o = e[4], a = e[5], c = e[6], l = e[7], d = e[8], h6 = e[9], p = e[10], g = e[11], f = e[12], u = e[13], y = e[14], v = e[15], m = h6 * y * l - u * p * l + u * c * g - a * y * g - h6 * c * v + a * p * v, w = f * p * l - d * y * l - f * c * g + o * y * g + d * c * v - o * p * v, S = d * u * l - f * h6 * l + f * a * g - o * u * g - d * a * v + o * h6 * v, T = f * h6 * c - d * u * c - f * a * p + o * u * p + d * a * y - o * h6 * y, M = t13 * m + i * w + r * S + s * T; if (M === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); const x = 1 / M; return e[0] = m * x, e[1] = (u * p * s - h6 * y * s - u * r * g + i * y * g + h6 * r * v - i * p * v) * x, e[2] = (a * y * s - u * c * s + u * r * l - i * y * l - a * r * v + i * c * v) * x, e[3] = (h6 * c * s - a * p * s - h6 * r * l + i * p * l + a * r * g - i * c * g) * x, e[4] = w * x, e[5] = (d * y * s - f * p * s + f * r * g - t13 * y * g - d * r * v + t13 * p * v) * x, e[6] = (f * c * s - o * y * s - f * r * l + t13 * y * l + o * r * v - t13 * c * v) * x, e[7] = (o * p * s - d * c * s + d * r * l - t13 * p * l - o * r * g + t13 * c * g) * x, e[8] = S * x, e[9] = (f * h6 * s - d * u * s - f * i * g + t13 * u * g + d * i * v - t13 * h6 * v) * x, e[10] = (o * u * s - f * a * s + f * i * l - t13 * u * l - o * i * v + t13 * a * v) * x, e[11] = (d * a * s - o * h6 * s - d * i * l + t13 * h6 * l + o * i * g - t13 * a * g) * x, e[12] = T * x, e[13] = (d * u * r - f * h6 * r + f * i * p - t13 * u * p - d * i * y + t13 * h6 * y) * x, e[14] = (f * a * r - o * u * r - f * i * c + t13 * u * c + o * i * y - t13 * a * y) * x, e[15] = (o * h6 * r - d * a * r + d * i * c - t13 * h6 * c - o * i * p + t13 * a * p) * x, this; } scale(e) { const t13 = this.elements, i = e.x, r = e.y, s = e.z; return t13[0] *= i, t13[4] *= r, t13[8] *= s, t13[1] *= i, t13[5] *= r, t13[9] *= s, t13[2] *= i, t13[6] *= r, t13[10] *= s, t13[3] *= i, t13[7] *= r, t13[11] *= s, this; } getMaxScaleOnAxis() { const e = this.elements, t13 = 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], r = e[8] * e[8] + e[9] * e[9] + e[10] * e[10]; return Math.sqrt(Math.max(t13, i, r)); } makeTranslation(e, t13, i) { return this.set( 1, 0, 0, e, 0, 1, 0, t13, 0, 0, 1, i, 0, 0, 0, 1 ), this; } makeRotationX(e) { const t13 = Math.cos(e), i = Math.sin(e); return this.set( 1, 0, 0, 0, 0, t13, -i, 0, 0, i, t13, 0, 0, 0, 0, 1 ), this; } makeRotationY(e) { const t13 = Math.cos(e), i = Math.sin(e); return this.set( t13, 0, i, 0, 0, 1, 0, 0, -i, 0, t13, 0, 0, 0, 0, 1 ), this; } makeRotationZ(e) { const t13 = Math.cos(e), i = Math.sin(e); return this.set( t13, -i, 0, 0, i, t13, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ), this; } makeRotationAxis(e, t13) { const i = Math.cos(t13), r = Math.sin(t13), s = 1 - i, o = e.x, a = e.y, c = e.z, l = s * o, d = s * a; return this.set( l * o + i, l * a - r * c, l * c + r * a, 0, l * a + r * c, d * a + i, d * c - r * o, 0, l * c - r * a, d * c + r * o, s * c * c + i, 0, 0, 0, 0, 1 ), this; } makeScale(e, t13, i) { return this.set( e, 0, 0, 0, 0, t13, 0, 0, 0, 0, i, 0, 0, 0, 0, 1 ), this; } makeShear(e, t13, i, r, s, o) { return this.set( 1, i, s, 0, e, 1, o, 0, t13, r, 1, 0, 0, 0, 0, 1 ), this; } compose(e, t13, i) { const r = this.elements, s = t13._x, o = t13._y, a = t13._z, c = t13._w, l = s + s, d = o + o, h6 = a + a, p = s * l, g = s * d, f = s * h6, u = o * d, y = o * h6, v = a * h6, m = c * l, w = c * d, S = c * h6, T = i.x, M = i.y, x = i.z; return r[0] = (1 - (u + v)) * T, r[1] = (g + S) * T, r[2] = (f - w) * T, r[3] = 0, r[4] = (g - S) * M, r[5] = (1 - (p + v)) * M, r[6] = (y + m) * M, r[7] = 0, r[8] = (f + w) * x, r[9] = (y - m) * x, r[10] = (1 - (p + u)) * x, r[11] = 0, r[12] = e.x, r[13] = e.y, r[14] = e.z, r[15] = 1, this; } decompose(e, t13, i) { const r = this.elements; let s = to2.set(r[0], r[1], r[2]).length(); const o = to2.set(r[4], r[5], r[6]).length(), a = to2.set(r[8], r[9], r[10]).length(); this.determinant() < 0 && (s = -s), e.x = r[12], e.y = r[13], e.z = r[14], hi2.copy(this); const l = 1 / s, d = 1 / o, h6 = 1 / a; return hi2.elements[0] *= l, hi2.elements[1] *= l, hi2.elements[2] *= l, hi2.elements[4] *= d, hi2.elements[5] *= d, hi2.elements[6] *= d, hi2.elements[8] *= h6, hi2.elements[9] *= h6, hi2.elements[10] *= h6, t13.setFromRotationMatrix(hi2), i.x = s, i.y = o, i.z = a, this; } makePerspective(e, t13, i, r, s, o) { o === void 0 && console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs."); const a = this.elements, c = 2 * s / (t13 - e), l = 2 * s / (i - r), d = (t13 + e) / (t13 - e), h6 = (i + r) / (i - r), p = -(o + s) / (o - s), g = -2 * o * s / (o - s); return a[0] = c, a[4] = 0, a[8] = d, a[12] = 0, a[1] = 0, a[5] = l, a[9] = h6, a[13] = 0, a[2] = 0, a[6] = 0, a[10] = p, a[14] = g, a[3] = 0, a[7] = 0, a[11] = -1, a[15] = 0, this; } makeOrthographic(e, t13, i, r, s, o) { const a = this.elements, c = 1 / (t13 - e), l = 1 / (i - r), d = 1 / (o - s), h6 = (t13 + e) * c, p = (i + r) * l, g = (o + s) * d; return a[0] = 2 * c, a[4] = 0, a[8] = 0, a[12] = -h6, a[1] = 0, a[5] = 2 * l, a[9] = 0, a[13] = -p, a[2] = 0, a[6] = 0, a[10] = -2 * d, a[14] = -g, a[3] = 0, a[7] = 0, a[11] = 0, a[15] = 1, this; } equals(e) { const t13 = this.elements, i = e.elements; for (let r = 0; r < 16; r++) if (t13[r] !== i[r]) return false; return true; } fromArray(e, t13 = 0) { for (let i = 0; i < 16; i++) this.elements[i] = e[i + t13]; return this; } toArray(e = [], t13 = 0) { const i = this.elements; return e[t13] = i[0], e[t13 + 1] = i[1], e[t13 + 2] = i[2], e[t13 + 3] = i[3], e[t13 + 4] = i[4], e[t13 + 5] = i[5], e[t13 + 6] = i[6], e[t13 + 7] = i[7], e[t13 + 8] = i[8], e[t13 + 9] = i[9], e[t13 + 10] = i[10], e[t13 + 11] = i[11], e[t13 + 12] = i[12], e[t13 + 13] = i[13], e[t13 + 14] = i[14], e[t13 + 15] = i[15], e; } }; $e2.prototype.isMatrix4 = true; var to2 = new X(); var hi2 = new $e2(); var vI = new X(0, 0, 0); var yI = new X(1, 1, 1); var Er2 = new X(); var Xl2 = new X(); var Wn2 = new X(); var gg2 = new $e2(); var vg2 = new Sn(); var Ws2 = class _Ws { constructor(e = 0, t13 = 0, i = 0, r = _Ws.DefaultOrder) { this._x = e, this._y = t13, this._z = i, this._order = r; } 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, t13, i, r = this._order) { return this._x = e, this._y = t13, this._z = i, this._order = r, 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, t13 = this._order, i = true) { const r = e.elements, s = r[0], o = r[4], a = r[8], c = r[1], l = r[5], d = r[9], h6 = r[2], p = r[6], g = r[10]; switch (t13) { case "XYZ": this._y = Math.asin(wn3(a, -1, 1)), Math.abs(a) < 0.9999999 ? (this._x = Math.atan2(-d, g), this._z = Math.atan2(-o, s)) : (this._x = Math.atan2(p, l), this._z = 0); break; case "YXZ": this._x = Math.asin(-wn3(d, -1, 1)), Math.abs(d) < 0.9999999 ? (this._y = Math.atan2(a, g), this._z = Math.atan2(c, l)) : (this._y = Math.atan2(-h6, s), this._z = 0); break; case "ZXY": this._x = Math.asin(wn3(p, -1, 1)), Math.abs(p) < 0.9999999 ? (this._y = Math.atan2(-h6, g), this._z = Math.atan2(-o, l)) : (this._y = 0, this._z = Math.atan2(c, s)); break; case "ZYX": this._y = Math.asin(-wn3(h6, -1, 1)), Math.abs(h6) < 0.9999999 ? (this._x = Math.atan2(p, g), this._z = Math.atan2(c, s)) : (this._x = 0, this._z = Math.atan2(-o, l)); break; case "YZX": this._z = Math.asin(wn3(c, -1, 1)), Math.abs(c) < 0.9999999 ? (this._x = Math.atan2(-d, l), this._y = Math.atan2(-h6, s)) : (this._x = 0, this._y = Math.atan2(a, g)); break; case "XZY": this._z = Math.asin(-wn3(o, -1, 1)), Math.abs(o) < 0.9999999 ? (this._x = Math.atan2(p, l), this._y = Math.atan2(a, s)) : (this._x = Math.atan2(-d, g), this._y = 0); break; default: console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: " + t13); } return this._order = t13, i === true && this._onChangeCallback(), this; } setFromQuaternion(e, t13, i) { return gg2.makeRotationFromQuaternion(e), this.setFromRotationMatrix(gg2, t13, i); } setFromVector3(e, t13 = this._order) { return this.set(e.x, e.y, e.z, t13); } reorder(e) { return vg2.setFromEuler(this), this.setFromQuaternion(vg2, 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 = [], t13 = 0) { return e[t13] = this._x, e[t13 + 1] = this._y, e[t13 + 2] = this._z, e[t13 + 3] = this._order, e; } toVector3(e) { return e ? e.set(this._x, this._y, this._z) : new X(this._x, this._y, this._z); } _onChange(e) { return this._onChangeCallback = e, this; } _onChangeCallback() { } }; Ws2.prototype.isEuler = true; Ws2.DefaultOrder = "XYZ"; Ws2.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"]; var qf2 = class { 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; } }; var bI = 0; var yg2 = new X(); var no2 = new Sn(); var Xi2 = new $e2(); var Yl2 = new X(); var wa2 = new X(); var xI = new X(); var wI = new Sn(); var bg2 = new X(1, 0, 0); var xg2 = new X(0, 1, 0); var wg2 = new X(0, 0, 1); var MI = { type: "added" }; var Mg2 = { type: "removed" }; var ot = class _ot extends ns2 { constructor() { super(), Object.defineProperty(this, "id", { value: bI++ }), this.uuid = Jn2(), this.name = "", this.type = "Object3D", this.parent = null, this.children = [], this.up = _ot.DefaultUp.clone(); const e = new X(), t13 = new Ws2(), i = new Sn(), r = new X(1, 1, 1); function s() { i.setFromEuler(t13, false); } function o() { t13.setFromQuaternion(i, void 0, false); } t13._onChange(s), i._onChange(o), Object.defineProperties(this, { position: { configurable: true, enumerable: true, value: e }, rotation: { configurable: true, enumerable: true, value: t13 }, quaternion: { configurable: true, enumerable: true, value: i }, scale: { configurable: true, enumerable: true, value: r }, modelViewMatrix: { value: new $e2() }, normalMatrix: { value: new ln2() } }), this.matrix = new $e2(), this.matrixWorld = new $e2(), this.matrixAutoUpdate = _ot.DefaultMatrixAutoUpdate, this.matrixWorldNeedsUpdate = false, this.layers = new qf2(), this.visible = true, this.castShadow = false, this.receiveShadow = false, this.frustumCulled = true, 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, t13) { this.quaternion.setFromAxisAngle(e, t13); } setRotationFromEuler(e) { this.quaternion.setFromEuler(e, true); } setRotationFromMatrix(e) { this.quaternion.setFromRotationMatrix(e); } setRotationFromQuaternion(e) { this.quaternion.copy(e); } rotateOnAxis(e, t13) { return no2.setFromAxisAngle(e, t13), this.quaternion.multiply(no2), this; } rotateOnWorldAxis(e, t13) { return no2.setFromAxisAngle(e, t13), this.quaternion.premultiply(no2), this; } rotateX(e) { return this.rotateOnAxis(bg2, e); } rotateY(e) { return this.rotateOnAxis(xg2, e); } rotateZ(e) { return this.rotateOnAxis(wg2, e); } translateOnAxis(e, t13) { return yg2.copy(e).applyQuaternion(this.quaternion), this.position.add(yg2.multiplyScalar(t13)), this; } translateX(e) { return this.translateOnAxis(bg2, e); } translateY(e) { return this.translateOnAxis(xg2, e); } translateZ(e) { return this.translateOnAxis(wg2, e); } localToWorld(e) { return e.applyMatrix4(this.matrixWorld); } worldToLocal(e) { return e.applyMatrix4(Xi2.copy(this.matrixWorld).invert()); } lookAt(e, t13, i) { e.isVector3 ? Yl2.copy(e) : Yl2.set(e, t13, i); const r = this.parent; this.updateWorldMatrix(true, false), wa2.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? Xi2.lookAt(wa2, Yl2, this.up) : Xi2.lookAt(Yl2, wa2, this.up), this.quaternion.setFromRotationMatrix(Xi2), r && (Xi2.extractRotation(r.matrixWorld), no2.setFromRotationMatrix(Xi2), this.quaternion.premultiply(no2.invert())); } add(e) { if (arguments.length > 1) { for (let t13 = 0; t13 < arguments.length; t13++) this.add(arguments[t13]); 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(MI)) : 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 t13 = this.children.indexOf(e); return t13 !== -1 && (e.parent = null, this.children.splice(t13, 1), e.dispatchEvent(Mg2)), this; } removeFromParent() { const e = this.parent; return e !== null && e.remove(this), this; } clear() { for (let e = 0; e < this.children.length; e++) { const t13 = this.children[e]; t13.parent = null, t13.dispatchEvent(Mg2); } return this.children.length = 0, this; } attach(e) { return this.updateWorldMatrix(true, false), Xi2.copy(this.matrixWorld).invert(), e.parent !== null && (e.parent.updateWorldMatrix(true, false), Xi2.multiply(e.parent.matrixWorld)), e.applyMatrix4(Xi2), this.add(e), e.updateWorldMatrix(false, true), this; } getObjectById(e) { return this.getObjectByProperty("id", e); } getObjectByName(e) { return this.getObjectByProperty("name", e); } getObjectByProperty(e, t13) { if (this[e] === t13) return this; for (let i = 0, r = this.children.length; i < r; i++) { const o = this.children[i].getObjectByProperty(e, t13); if (o !== void 0) return o; } } getWorldPosition(e) { return this.updateWorldMatrix(true, false), e.setFromMatrixPosition(this.matrixWorld); } getWorldQuaternion(e) { return this.updateWorldMatrix(true, false), this.matrixWorld.decompose(wa2, e, xI), e; } getWorldScale(e) { return this.updateWorldMatrix(true, false), this.matrixWorld.decompose(wa2, wI, e), e; } getWorldDirection(e) { this.updateWorldMatrix(true, false); const t13 = this.matrixWorld.elements; return e.set(t13[8], t13[9], t13[10]).normalize(); } raycast() { } traverse(e) { e(this); const t13 = this.children; for (let i = 0, r = t13.length; i < r; i++) t13[i].traverse(e); } traverseVisible(e) { if (this.visible === false) return; e(this); const t13 = this.children; for (let i = 0, r = t13.length; i < r; i++) t13[i].traverseVisible(e); } traverseAncestors(e) { const t13 = this.parent; t13 !== null && (e(t13), t13.traverseAncestors(e)); } updateMatrix() { this.matrix.compose(this.position, this.quaternion, this.scale), this.matrixWorldNeedsUpdate = true; } 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 = false, e = true); const t13 = this.children; for (let i = 0, r = t13.length; i < r; i++) t13[i].updateMatrixWorld(e); } updateWorldMatrix(e, t13) { const i = this.parent; if (e === true && i !== null && i.updateWorldMatrix(true, false), this.matrixAutoUpdate && this.updateMatrix(), this.parent === null ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix), t13 === true) { const r = this.children; for (let s = 0, o = r.length; s < o; s++) r[s].updateWorldMatrix(false, true); } } toJSON(e) { const t13 = e === void 0 || typeof e == "string", i = {}; t13 && (e = { geometries: {}, materials: {}, textures: {}, images: {}, shapes: {}, skeletons: {}, animations: {} }, i.metadata = { version: 4.5, type: "Object", generator: "Object3D.toJSON" }); const r = {}; r.uuid = this.uuid, r.type = this.type, this.name !== "" && (r.name = this.name), this.castShadow === true && (r.castShadow = true), this.receiveShadow === true && (r.receiveShadow = true), this.visible === false && (r.visible = false), this.frustumCulled === false && (r.frustumCulled = false), this.renderOrder !== 0 && (r.renderOrder = this.renderOrder), JSON.stringify(this.userData) !== "{}" && (r.userData = this.userData), r.layers = this.layers.mask, r.matrix = this.matrix.toArray(), this.matrixAutoUpdate === false && (r.matrixAutoUpdate = false), this.isInstancedMesh && (r.type = "InstancedMesh", r.count = this.count, r.instanceMatrix = this.instanceMatrix.toJSON(), this.instanceColor !== null && (r.instanceColor = this.instanceColor.toJSON())); function s(a, c) { return a[c.uuid] === void 0 && (a[c.uuid] = c.toJSON(e)), c.uuid; } if (this.isScene) this.background && (this.background.isColor ? r.background = this.background.toJSON() : this.background.isTexture && (r.background = this.background.toJSON(e).uuid)), this.environment && this.environment.isTexture && (r.environment = this.environment.toJSON(e).uuid); else if (this.isMesh || this.isLine || this.isPoints) { r.geometry = s(e.geometries, this.geometry); const a = this.geometry.parameters; if (a !== void 0 && a.shapes !== void 0) { const c = a.shapes; if (Array.isArray(c)) for (let l = 0, d = c.length; l < d; l++) { const h6 = c[l]; s(e.shapes, h6); } else s(e.shapes, c); } } if (this.isSkinnedMesh && (r.bindMode = this.bindMode, r.bindMatrix = this.bindMatrix.toArray(), this.skeleton !== void 0 && (s(e.skeletons, this.skeleton), r.skeleton = this.skeleton.uuid)), this.material !== void 0) if (Array.isArray(this.material)) { const a = []; for (let c = 0, l = this.material.length; c < l; c++) a.push(s(e.materials, this.material[c])); r.material = a; } else r.material = s(e.materials, this.material); if (this.children.length > 0) { r.children = []; for (let a = 0; a < this.children.length; a++) r.children.push(this.children[a].toJSON(e).object); } if (this.animations.length > 0) { r.animations = []; for (let a = 0; a < this.animations.length; a++) { const c = this.animations[a]; r.animations.push(s(e.animations, c)); } } if (t13) { const a = o(e.geometries), c = o(e.materials), l = o(e.textures), d = o(e.images), h6 = o(e.shapes), p = o(e.skeletons), g = o(e.animations); a.length > 0 && (i.geometries = a), c.length > 0 && (i.materials = c), l.length > 0 && (i.textures = l), d.length > 0 && (i.images = d), h6.length > 0 && (i.shapes = h6), p.length > 0 && (i.skeletons = p), g.length > 0 && (i.animations = g); } return i.object = r, i; function o(a) { const c = []; for (const l in a) { const d = a[l]; delete d.metadata, c.push(d); } return c; } } clone(e) { return new this.constructor().copy(this, e); } copy(e, t13 = true) { 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)), t13 === true) for (let i = 0; i < e.children.length; i++) { const r = e.children[i]; this.add(r.clone()); } return this; } }; ot.DefaultUp = new X(0, 1, 0); ot.DefaultMatrixAutoUpdate = true; ot.prototype.isObject3D = true; var di2 = new X(); var Yi2 = new X(); var ph2 = new X(); var Ji2 = new X(); var io2 = new X(); var ro2 = new X(); var Sg2 = new X(); var mh2 = new X(); var gh2 = new X(); var vh2 = new X(); var Qt = class _Qt { constructor(e = new X(), t13 = new X(), i = new X()) { this.a = e, this.b = t13, this.c = i; } static getNormal(e, t13, i, r) { r.subVectors(i, t13), di2.subVectors(e, t13), r.cross(di2); const s = r.lengthSq(); return s > 0 ? r.multiplyScalar(1 / Math.sqrt(s)) : r.set(0, 0, 0); } // static/instance method to calculate barycentric coordinates // based on: http://www.blackpawn.com/texts/pointinpoly/default.html static getBarycoord(e, t13, i, r, s) { di2.subVectors(r, t13), Yi2.subVectors(i, t13), ph2.subVectors(e, t13); const o = di2.dot(di2), a = di2.dot(Yi2), c = di2.dot(ph2), l = Yi2.dot(Yi2), d = Yi2.dot(ph2), h6 = o * l - a * a; if (h6 === 0) return s.set(-2, -1, -1); const p = 1 / h6, g = (l * c - a * d) * p, f = (o * d - a * c) * p; return s.set(1 - g - f, f, g); } static containsPoint(e, t13, i, r) { return this.getBarycoord(e, t13, i, r, Ji2), Ji2.x >= 0 && Ji2.y >= 0 && Ji2.x + Ji2.y <= 1; } static getUV(e, t13, i, r, s, o, a, c) { return this.getBarycoord(e, t13, i, r, Ji2), c.set(0, 0), c.addScaledVector(s, Ji2.x), c.addScaledVector(o, Ji2.y), c.addScaledVector(a, Ji2.z), c; } static isFrontFacing(e, t13, i, r) { return di2.subVectors(i, t13), Yi2.subVectors(e, t13), di2.cross(Yi2).dot(r) < 0; } set(e, t13, i) { return this.a.copy(e), this.b.copy(t13), this.c.copy(i), this; } setFromPointsAndIndices(e, t13, i, r) { return this.a.copy(e[t13]), this.b.copy(e[i]), this.c.copy(e[r]), 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 di2.subVectors(this.c, this.b), Yi2.subVectors(this.a, this.b), di2.cross(Yi2).length() * 0.5; } getMidpoint(e) { return e.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3); } getNormal(e) { return _Qt.getNormal(this.a, this.b, this.c, e); } getPlane(e) { return e.setFromCoplanarPoints(this.a, this.b, this.c); } getBarycoord(e, t13) { return _Qt.getBarycoord(e, this.a, this.b, this.c, t13); } getUV(e, t13, i, r, s) { return _Qt.getUV(e, this.a, this.b, this.c, t13, i, r, s); } containsPoint(e) { return _Qt.containsPoint(e, this.a, this.b, this.c); } isFrontFacing(e) { return _Qt.isFrontFacing(this.a, this.b, this.c, e); } intersectsBox(e) { return e.intersectsTriangle(this); } closestPointToPoint(e, t13) { const i = this.a, r = this.b, s = this.c; let o, a; io2.subVectors(r, i), ro2.subVectors(s, i), mh2.subVectors(e, i); const c = io2.dot(mh2), l = ro2.dot(mh2); if (c <= 0 && l <= 0) return t13.copy(i); gh2.subVectors(e, r); const d = io2.dot(gh2), h6 = ro2.dot(gh2); if (d >= 0 && h6 <= d) return t13.copy(r); const p = c * h6 - d * l; if (p <= 0 && c >= 0 && d <= 0) return o = c / (c - d), t13.copy(i).addScaledVector(io2, o); vh2.subVectors(e, s); const g = io2.dot(vh2), f = ro2.dot(vh2); if (f >= 0 && g <= f) return t13.copy(s); const u = g * l - c * f; if (u <= 0 && l >= 0 && f <= 0) return a = l / (l - f), t13.copy(i).addScaledVector(ro2, a); const y = d * f - g * h6; if (y <= 0 && h6 - d >= 0 && g - f >= 0) return Sg2.subVectors(s, r), a = (h6 - d) / (h6 - d + (g - f)), t13.copy(r).addScaledVector(Sg2, a); const v = 1 / (y + u + p); return o = u * v, a = p * v, t13.copy(i).addScaledVector(io2, o).addScaledVector(ro2, a); } equals(e) { return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c); } }; var SI = 0; var sn = class extends ns2 { constructor() { super(), Object.defineProperty(this, "id", { value: SI++ }), this.uuid = Jn2(), this.name = "", this.type = "Material", this.fog = true, this.blending = _o2, this.side = Xr2, this.vertexColors = false, this.opacity = 1, this.transparent = false, this.blendSrc = Gf2, this.blendDst = Hf2, this.blendEquation = ys, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.depthFunc = Kc2, this.depthTest = true, this.depthWrite = true, this.stencilWriteMask = 255, this.stencilFunc = hx2, this.stencilRef = 0, this.stencilFuncMask = 255, this.stencilFail = kc2, this.stencilZFail = kc2, this.stencilZPass = kc2, this.stencilWrite = false, this.clippingPlanes = null, this.clipIntersection = false, this.clipShadows = false, this.shadowSide = null, this.colorWrite = true, this.precision = null, this.polygonOffset = false, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.dithering = false, this.alphaTest = 0, this.alphaToCoverage = false, this.premultipliedAlpha = false, this.visible = true, this.toneMapped = true, this.userData = {}, this.version = 0; } onBuild() { } onBeforeCompile() { } customProgramCacheKey() { return this.onBeforeCompile.toString(); } setValues(e) { if (e !== void 0) for (const t13 in e) { const i = e[t13]; if (i === void 0) { console.warn("THREE.Material: '" + t13 + "' parameter is undefined."); continue; } if (t13 === "shading") { console.warn("THREE." + this.type + ": .shading has been removed. Use the boolean .flatShading instead."), this.flatShading = i === kf2; continue; } const r = this[t13]; if (r === void 0) { console.warn("THREE." + this.type + ": '" + t13 + "' is not a property of this material."); continue; } r && r.isColor ? r.set(i) : r && r.isVector3 && i && i.isVector3 ? r.copy(i) : this[t13] = i; } } toJSON(e) { const t13 = e === void 0 || typeof e == "string"; t13 && (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 !== _o2 && (i.blending = this.blending), this.side !== Xr2 && (i.side = this.side), this.vertexColors && (i.vertexColors = true), this.opacity < 1 && (i.opacity = this.opacity), this.transparent === true && (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 === true && (i.polygonOffset = true), 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 === true && (i.dithering = true), this.alphaTest > 0 && (i.alphaTest = this.alphaTest), this.alphaToCoverage === true && (i.alphaToCoverage = this.alphaToCoverage), this.premultipliedAlpha === true && (i.premultipliedAlpha = this.premultipliedAlpha), this.wireframe === true && (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 === true && (i.morphTargets = true), this.morphNormals === true && (i.morphNormals = true), this.flatShading === true && (i.flatShading = this.flatShading), this.visible === false && (i.visible = false), this.toneMapped === false && (i.toneMapped = false), JSON.stringify(this.userData) !== "{}" && (i.userData = this.userData); function r(s) { const o = []; for (const a in s) { const c = s[a]; delete c.metadata, o.push(c); } return o; } if (t13) { const s = r(e.textures), o = r(e.images); s.length > 0 && (i.textures = s), 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 t13 = e.clippingPlanes; let i = null; if (t13 !== null) { const r = t13.length; i = new Array(r); for (let s = 0; s !== r; ++s) i[s] = t13[s].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 === true && this.version++; } }; sn.prototype.isMaterial = true; var mx2 = { 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 }; var fi2 = { h: 0, s: 0, l: 0 }; var Jl2 = { h: 0, s: 0, l: 0 }; function yh2(n, e, t13) { return t13 < 0 && (t13 += 1), t13 > 1 && (t13 -= 1), t13 < 1 / 6 ? n + (e - n) * 6 * t13 : t13 < 1 / 2 ? e : t13 < 2 / 3 ? n + (e - n) * 6 * (2 / 3 - t13) : n; } function bh2(n) { return n < 0.04045 ? n * 0.0773993808 : Math.pow(n * 0.9478672986 + 0.0521327014, 2.4); } function xh2(n) { return n < 31308e-7 ? n * 12.92 : 1.055 * Math.pow(n, 0.41666) - 0.055; } var Fe = class { constructor(e, t13, i) { return t13 === void 0 && i === void 0 ? this.set(e) : this.setRGB(e, t13, 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, t13, i) { return this.r = e, this.g = t13, this.b = i, this; } setHSL(e, t13, i) { if (e = Yf2(e, 1), t13 = wn3(t13, 0, 1), i = wn3(i, 0, 1), t13 === 0) this.r = this.g = this.b = i; else { const r = i <= 0.5 ? i * (1 + t13) : i + t13 - i * t13, s = 2 * i - r; this.r = yh2(s, r, e + 1 / 3), this.g = yh2(s, r, e), this.b = yh2(s, r, e - 1 / 3); } return this; } setStyle(e) { function t13(r) { r !== void 0 && parseFloat(r) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored."); } let i; if (i = /^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)) { let r; const s = i[1], o = i[2]; switch (s) { case "rgb": case "rgba": if (r = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)) return this.r = Math.min(255, parseInt(r[1], 10)) / 255, this.g = Math.min(255, parseInt(r[2], 10)) / 255, this.b = Math.min(255, parseInt(r[3], 10)) / 255, t13(r[4]), this; if (r = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)) return this.r = Math.min(100, parseInt(r[1], 10)) / 100, this.g = Math.min(100, parseInt(r[2], 10)) / 100, this.b = Math.min(100, parseInt(r[3], 10)) / 100, t13(r[4]), this; break; case "hsl": case "hsla": if (r = /^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)) { const a = parseFloat(r[1]) / 360, c = parseInt(r[2], 10) / 100, l = parseInt(r[3], 10) / 100; return t13(r[4]), this.setHSL(a, c, l); } break; } } else if (i = /^\#([A-Fa-f\d]+)$/.exec(e)) { const r = i[1], s = r.length; if (s === 3) return this.r = parseInt(r.charAt(0) + r.charAt(0), 16) / 255, this.g = parseInt(r.charAt(1) + r.charAt(1), 16) / 255, this.b = parseInt(r.charAt(2) + r.charAt(2), 16) / 255, this; if (s === 6) return this.r = parseInt(r.charAt(0) + r.charAt(1), 16) / 255, this.g = parseInt(r.charAt(2) + r.charAt(3), 16) / 255, this.b = parseInt(r.charAt(4) + r.charAt(5), 16) / 255, this; } return e && e.length > 0 ? this.setColorName(e) : this; } setColorName(e) { const t13 = mx2[e.toLowerCase()]; return t13 !== void 0 ? this.setHex(t13) : 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, t13 = 2) { return this.r = Math.pow(e.r, t13), this.g = Math.pow(e.g, t13), this.b = Math.pow(e.b, t13), this; } copyLinearToGamma(e, t13 = 2) { const i = t13 > 0 ? 1 / t13 : 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 = bh2(e.r), this.g = bh2(e.g), this.b = bh2(e.b), this; } copyLinearToSRGB(e) { return this.r = xh2(e.r), this.g = xh2(e.g), this.b = xh2(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 t13 = this.r, i = this.g, r = this.b, s = Math.max(t13, i, r), o = Math.min(t13, i, r); let a, c; const l = (o + s) / 2; if (o === s) a = 0, c = 0; else { const d = s - o; switch (c = l <= 0.5 ? d / (s + o) : d / (2 - s - o), s) { case t13: a = (i - r) / d + (i < r ? 6 : 0); break; case i: a = (r - t13) / d + 2; break; case r: a = (t13 - i) / d + 4; break; } a /= 6; } return e.h = a, e.s = c, e.l = l, e; } getStyle() { return "rgb(" + (this.r * 255 | 0) + "," + (this.g * 255 | 0) + "," + (this.b * 255 | 0) + ")"; } offsetHSL(e, t13, i) { return this.getHSL(fi2), fi2.h += e, fi2.s += t13, fi2.l += i, this.setHSL(fi2.h, fi2.s, fi2.l), this; } add(e) { return this.r += e.r, this.g += e.g, this.b += e.b, this; } addColors(e, t13) { return this.r = e.r + t13.r, this.g = e.g + t13.g, this.b = e.b + t13.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, t13) { return this.r += (e.r - this.r) * t13, this.g += (e.g - this.g) * t13, this.b += (e.b - this.b) * t13, this; } lerpColors(e, t13, i) { return this.r = e.r + (t13.r - e.r) * i, this.g = e.g + (t13.g - e.g) * i, this.b = e.b + (t13.b - e.b) * i, this; } lerpHSL(e, t13) { this.getHSL(fi2), e.getHSL(Jl2); const i = ka2(fi2.h, Jl2.h, t13), r = ka2(fi2.s, Jl2.s, t13), s = ka2(fi2.l, Jl2.l, t13); return this.setHSL(i, r, s), this; } equals(e) { return e.r === this.r && e.g === this.g && e.b === this.b; } fromArray(e, t13 = 0) { return this.r = e[t13], this.g = e[t13 + 1], this.b = e[t13 + 2], this; } toArray(e = [], t13 = 0) { return e[t13] = this.r, e[t13 + 1] = this.g, e[t13 + 2] = this.b, e; } fromBufferAttribute(e, t13) { return this.r = e.getX(t13), this.g = e.getY(t13), this.b = e.getZ(t13), e.normalized === true && (this.r /= 255, this.g /= 255, this.b /= 255), this; } toJSON() { return this.getHex(); } }; Fe.NAMES = mx2; Fe.prototype.isColor = true; Fe.prototype.r = 1; Fe.prototype.g = 1; Fe.prototype.b = 1; var Vn2 = class extends sn { constructor(e) { super(), this.type = "MeshBasicMaterial", this.color = new Fe(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 = vl2, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = false, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.morphTargets = false, 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; } }; Vn2.prototype.isMeshBasicMaterial = true; var At2 = new X(); var ql2 = new Pe(); var nt = class { constructor(e, t13, i) { if (Array.isArray(e)) throw new TypeError("THREE.BufferAttribute: array should be a Typed Array."); this.name = "", this.array = e, this.itemSize = t13, this.count = e !== void 0 ? e.length / t13 : 0, this.normalized = i === true, this.usage = zo2, this.updateRange = { offset: 0, count: -1 }, this.version = 0; } onUploadCallback() { } set needsUpdate(e) { e === true && 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, t13, i) { e *= this.itemSize, i *= t13.itemSize; for (let r = 0, s = this.itemSize; r < s; r++) this.array[e + r] = t13.array[i + r]; return this; } copyArray(e) { return this.array.set(e), this; } copyColorsArray(e) { const t13 = this.array; let i = 0; for (let r = 0, s = e.length; r < s; r++) { let o = e[r]; o === void 0 && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", r), o = new Fe()), t13[i++] = o.r, t13[i++] = o.g, t13[i++] = o.b; } return this; } copyVector2sArray(e) { const t13 = this.array; let i = 0; for (let r = 0, s = e.length; r < s; r++) { let o = e[r]; o === void 0 && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r), o = new Pe()), t13[i++] = o.x, t13[i++] = o.y; } return this; } copyVector3sArray(e) { const t13 = this.array; let i = 0; for (let r = 0, s = e.length; r < s; r++) { let o = e[r]; o === void 0 && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", r), o = new X()), t13[i++] = o.x, t13[i++] = o.y, t13[i++] = o.z; } return this; } copyVector4sArray(e) { const t13 = this.array; let i = 0; for (let r = 0, s = e.length; r < s; r++) { let o = e[r]; o === void 0 && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", r), o = new _t2()), t13[i++] = o.x, t13[i++] = o.y, t13[i++] = o.z, t13[i++] = o.w; } return this; } applyMatrix3(e) { if (this.itemSize === 2) for (let t13 = 0, i = this.count; t13 < i; t13++) ql2.fromBufferAttribute(this, t13), ql2.applyMatrix3(e), this.setXY(t13, ql2.x, ql2.y); else if (this.itemSize === 3) for (let t13 = 0, i = this.count; t13 < i; t13++) At2.fromBufferAttribute(this, t13), At2.applyMatrix3(e), this.setXYZ(t13, At2.x, At2.y, At2.z); return this; } applyMatrix4(e) { for (let t13 = 0, i = this.count; t13 < i; t13++) At2.x = this.getX(t13), At2.y = this.getY(t13), At2.z = this.getZ(t13), At2.applyMatrix4(e), this.setXYZ(t13, At2.x, At2.y, At2.z); return this; } applyNormalMatrix(e) { for (let t13 = 0, i = this.count; t13 < i; t13++) At2.x = this.getX(t13), At2.y = this.getY(t13), At2.z = this.getZ(t13), At2.applyNormalMatrix(e), this.setXYZ(t13, At2.x, At2.y, At2.z); return this; } transformDirection(e) { for (let t13 = 0, i = this.count; t13 < i; t13++) At2.x = this.getX(t13), At2.y = this.getY(t13), At2.z = this.getZ(t13), At2.transformDirection(e), this.setXYZ(t13, At2.x, At2.y, At2.z); return this; } set(e, t13 = 0) { return this.array.set(e, t13), this; } getX(e) { return this.array[e * this.itemSize]; } setX(e, t13) { return this.array[e * this.itemSize] = t13, this; } getY(e) { return this.array[e * this.itemSize + 1]; } setY(e, t13) { return this.array[e * this.itemSize + 1] = t13, this; } getZ(e) { return this.array[e * this.itemSize + 2]; } setZ(e, t13) { return this.array[e * this.itemSize + 2] = t13, this; } getW(e) { return this.array[e * this.itemSize + 3]; } setW(e, t13) { return this.array[e * this.itemSize + 3] = t13, this; } setXY(e, t13, i) { return e *= this.itemSize, this.array[e + 0] = t13, this.array[e + 1] = i, this; } setXYZ(e, t13, i, r) { return e *= this.itemSize, this.array[e + 0] = t13, this.array[e + 1] = i, this.array[e + 2] = r, this; } setXYZW(e, t13, i, r, s) { return e *= this.itemSize, this.array[e + 0] = t13, this.array[e + 1] = i, this.array[e + 2] = r, this.array[e + 3] = s, 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 !== zo2 && (e.usage = this.usage), (this.updateRange.offset !== 0 || this.updateRange.count !== -1) && (e.updateRange = this.updateRange), e; } }; nt.prototype.isBufferAttribute = true; var gx2 = class extends nt { constructor(e, t13, i) { super(new Int8Array(e), t13, i); } }; var vx2 = class extends nt { constructor(e, t13, i) { super(new Uint8Array(e), t13, i); } }; var yx2 = class extends nt { constructor(e, t13, i) { super(new Uint8ClampedArray(e), t13, i); } }; var bx2 = class extends nt { constructor(e, t13, i) { super(new Int16Array(e), t13, i); } }; var Lu2 = class extends nt { constructor(e, t13, i) { super(new Uint16Array(e), t13, i); } }; var xx2 = class extends nt { constructor(e, t13, i) { super(new Int32Array(e), t13, i); } }; var Ru2 = class extends nt { constructor(e, t13, i) { super(new Uint32Array(e), t13, i); } }; var wx2 = class extends nt { constructor(e, t13, i) { super(new Uint16Array(e), t13, i); } }; wx2.prototype.isFloat16BufferAttribute = true; var We = class extends nt { constructor(e, t13, i) { super(new Float32Array(e), t13, i); } }; var Mx2 = class extends nt { constructor(e, t13, i) { super(new Float64Array(e), t13, i); } }; function Sx2(n) { if (n.length === 0) return -1 / 0; let e = n[0]; for (let t13 = 1, i = n.length; t13 < i; ++t13) n[t13] > e && (e = n[t13]); return e; } var _I = { Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array }; function Mo2(n, e) { return new _I[n](e); } var TI = 0; var ti2 = new $e2(); var wh2 = new ot(); var so2 = new X(); var jn2 = new Hn2(); var Ma2 = new Hn2(); var dn2 = new X(); var Je2 = class _Je extends ns2 { constructor() { super(), Object.defineProperty(this, "id", { value: TI++ }), this.uuid = Jn2(), this.name = "", this.type = "BufferGeometry", this.index = null, this.attributes = {}, this.morphAttributes = {}, this.morphTargetsRelative = false, 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 (Sx2(e) > 65535 ? Ru2 : Lu2)(e, 1) : this.index = e, this; } getAttribute(e) { return this.attributes[e]; } setAttribute(e, t13) { return this.attributes[e] = t13, this; } deleteAttribute(e) { return delete this.attributes[e], this; } hasAttribute(e) { return this.attributes[e] !== void 0; } addGroup(e, t13, i = 0) { this.groups.push({ start: e, count: t13, materialIndex: i }); } clearGroups() { this.groups = []; } setDrawRange(e, t13) { this.drawRange.start = e, this.drawRange.count = t13; } applyMatrix4(e) { const t13 = this.attributes.position; t13 !== void 0 && (t13.applyMatrix4(e), t13.needsUpdate = true); const i = this.attributes.normal; if (i !== void 0) { const s = new ln2().getNormalMatrix(e); i.applyNormalMatrix(s), i.needsUpdate = true; } const r = this.attributes.tangent; return r !== void 0 && (r.transformDirection(e), r.needsUpdate = true), this.boundingBox !== null && this.computeBoundingBox(), this.boundingSphere !== null && this.computeBoundingSphere(), this; } applyQuaternion(e) { return ti2.makeRotationFromQuaternion(e), this.applyMatrix4(ti2), this; } rotateX(e) { return ti2.makeRotationX(e), this.applyMatrix4(ti2), this; } rotateY(e) { return ti2.makeRotationY(e), this.applyMatrix4(ti2), this; } rotateZ(e) { return ti2.makeRotationZ(e), this.applyMatrix4(ti2), this; } translate(e, t13, i) { return ti2.makeTranslation(e, t13, i), this.applyMatrix4(ti2), this; } scale(e, t13, i) { return ti2.makeScale(e, t13, i), this.applyMatrix4(ti2), this; } lookAt(e) { return wh2.lookAt(e), wh2.updateMatrix(), this.applyMatrix4(wh2.matrix), this; } center() { return this.computeBoundingBox(), this.boundingBox.getCenter(so2).negate(), this.translate(so2.x, so2.y, so2.z), this; } setFromPoints(e) { const t13 = []; for (let i = 0, r = e.length; i < r; i++) { const s = e[i]; t13.push(s.x, s.y, s.z || 0); } return this.setAttribute("position", new We(t13, 3)), this; } computeBoundingBox() { this.boundingBox === null && (this.boundingBox = new Hn2()); const e = this.attributes.position, t13 = 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 X(-1 / 0, -1 / 0, -1 / 0), new X(1 / 0, 1 / 0, 1 / 0) ); return; } if (e !== void 0) { if (this.boundingBox.setFromBufferAttribute(e), t13) for (let i = 0, r = t13.length; i < r; i++) { const s = t13[i]; jn2.setFromBufferAttribute(s), this.morphTargetsRelative ? (dn2.addVectors(this.boundingBox.min, jn2.min), this.boundingBox.expandByPoint(dn2), dn2.addVectors(this.boundingBox.max, jn2.max), this.boundingBox.expandByPoint(dn2)) : (this.boundingBox.expandByPoint(jn2.min), this.boundingBox.expandByPoint(jn2.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 xr()); const e = this.attributes.position, t13 = 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 X(), 1 / 0); return; } if (e) { const i = this.boundingSphere.center; if (jn2.setFromBufferAttribute(e), t13) for (let s = 0, o = t13.length; s < o; s++) { const a = t13[s]; Ma2.setFromBufferAttribute(a), this.morphTargetsRelative ? (dn2.addVectors(jn2.min, Ma2.min), jn2.expandByPoint(dn2), dn2.addVectors(jn2.max, Ma2.max), jn2.expandByPoint(dn2)) : (jn2.expandByPoint(Ma2.min), jn2.expandByPoint(Ma2.max)); } jn2.getCenter(i); let r = 0; for (let s = 0, o = e.count; s < o; s++) dn2.fromBufferAttribute(e, s), r = Math.max(r, i.distanceToSquared(dn2)); if (t13) for (let s = 0, o = t13.length; s < o; s++) { const a = t13[s], c = this.morphTargetsRelative; for (let l = 0, d = a.count; l < d; l++) dn2.fromBufferAttribute(a, l), c && (so2.fromBufferAttribute(e, l), dn2.add(so2)), r = Math.max(r, i.distanceToSquared(dn2)); } this.boundingSphere.radius = Math.sqrt(r), 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, t13 = this.attributes; if (e === null || t13.position === void 0 || t13.normal === void 0 || t13.uv === void 0) { console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)"); return; } const i = e.array, r = t13.position.array, s = t13.normal.array, o = t13.uv.array, a = r.length / 3; t13.tangent === void 0 && this.setAttribute("tangent", new nt(new Float32Array(4 * a), 4)); const c = t13.tangent.array, l = [], d = []; for (let L = 0; L < a; L++) l[L] = new X(), d[L] = new X(); const h6 = new X(), p = new X(), g = new X(), f = new Pe(), u = new Pe(), y = new Pe(), v = new X(), m = new X(); function w(L, R, C) { h6.fromArray(r, L * 3), p.fromArray(r, R * 3), g.fromArray(r, C * 3), f.fromArray(o, L * 2), u.fromArray(o, R * 2), y.fromArray(o, C * 2), p.sub(h6), g.sub(h6), u.sub(f), y.sub(f); const A = 1 / (u.x * y.y - y.x * u.y); isFinite(A) && (v.copy(p).multiplyScalar(y.y).addScaledVector(g, -u.y).multiplyScalar(A), m.copy(g).multiplyScalar(u.x).addScaledVector(p, -y.x).multiplyScalar(A), l[L].add(v), l[R].add(v), l[C].add(v), d[L].add(m), d[R].add(m), d[C].add(m)); } let S = this.groups; S.length === 0 && (S = [{ start: 0, count: i.length }]); for (let L = 0, R = S.length; L < R; ++L) { const C = S[L], A = C.start, P = C.count; for (let I = A, b = A + P; I < b; I += 3) w( i[I + 0], i[I + 1], i[I + 2] ); } const T = new X(), M = new X(), x = new X(), _ = new X(); function E(L) { x.fromArray(s, L * 3), _.copy(x); const R = l[L]; T.copy(R), T.sub(x.multiplyScalar(x.dot(R))).normalize(), M.crossVectors(_, R); const A = M.dot(d[L]) < 0 ? -1 : 1; c[L * 4] = T.x, c[L * 4 + 1] = T.y, c[L * 4 + 2] = T.z, c[L * 4 + 3] = A; } for (let L = 0, R = S.length; L < R; ++L) { const C = S[L], A = C.start, P = C.count; for (let I = A, b = A + P; I < b; I += 3) E(i[I + 0]), E(i[I + 1]), E(i[I + 2]); } } computeVertexNormals() { const e = this.index, t13 = this.getAttribute("position"); if (t13 !== void 0) { let i = this.getAttribute("normal"); if (i === void 0) i = new nt(new Float32Array(t13.count * 3), 3), this.setAttribute("normal", i); else for (let p = 0, g = i.count; p < g; p++) i.setXYZ(p, 0, 0, 0); const r = new X(), s = new X(), o = new X(), a = new X(), c = new X(), l = new X(), d = new X(), h6 = new X(); if (e) for (let p = 0, g = e.count; p < g; p += 3) { const f = e.getX(p + 0), u = e.getX(p + 1), y = e.getX(p + 2); r.fromBufferAttribute(t13, f), s.fromBufferAttribute(t13, u), o.fromBufferAttribute(t13, y), d.subVectors(o, s), h6.subVectors(r, s), d.cross(h6), a.fromBufferAttribute(i, f), c.fromBufferAttribute(i, u), l.fromBufferAttribute(i, y), a.add(d), c.add(d), l.add(d), i.setXYZ(f, a.x, a.y, a.z), i.setXYZ(u, c.x, c.y, c.z), i.setXYZ(y, l.x, l.y, l.z); } else for (let p = 0, g = t13.count; p < g; p += 3) r.fromBufferAttribute(t13, p + 0), s.fromBufferAttribute(t13, p + 1), o.fromBufferAttribute(t13, p + 2), d.subVectors(o, s), h6.subVectors(r, s), d.cross(h6), i.setXYZ(p + 0, d.x, d.y, d.z), i.setXYZ(p + 1, d.x, d.y, d.z), i.setXYZ(p + 2, d.x, d.y, d.z); this.normalizeNormals(), i.needsUpdate = true; } } merge(e, t13) { if (!(e && e.isBufferGeometry)) { console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e); return; } t13 === void 0 && (t13 = 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 r in i) { if (e.attributes[r] === void 0) continue; const o = i[r].array, a = e.attributes[r], c = a.array, l = a.itemSize * t13, d = Math.min(c.length, o.length - l); for (let h6 = 0, p = l; h6 < d; h6++, p++) o[p] = c[h6]; } return this; } normalizeNormals() { const e = this.attributes.normal; for (let t13 = 0, i = e.count; t13 < i; t13++) dn2.fromBufferAttribute(e, t13), dn2.normalize(), e.setXYZ(t13, dn2.x, dn2.y, dn2.z); } toNonIndexed() { function e(a, c) { const l = a.array, d = a.itemSize, h6 = a.normalized, p = new l.constructor(c.length * d); let g = 0, f = 0; for (let u = 0, y = c.length; u < y; u++) { a.isInterleavedBufferAttribute ? g = c[u] * a.data.stride + a.offset : g = c[u] * d; for (let v = 0; v < d; v++) p[f++] = l[g++]; } return new nt(p, d, h6); } if (this.index === null) return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."), this; const t13 = new _Je(), i = this.index.array, r = this.attributes; for (const a in r) { const c = r[a], l = e(c, i); t13.setAttribute(a, l); } const s = this.morphAttributes; for (const a in s) { const c = [], l = s[a]; for (let d = 0, h6 = l.length; d < h6; d++) { const p = l[d], g = e(p, i); c.push(g); } t13.morphAttributes[a] = c; } t13.morphTargetsRelative = this.morphTargetsRelative; const o = this.groups; for (let a = 0, c = o.length; a < c; a++) { const l = o[a]; t13.addGroup(l.start, l.count, l.materialIndex); } return t13; } 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 t13 = this.index; t13 !== null && (e.data.index = { type: t13.array.constructor.name, array: Array.prototype.slice.call(t13.array) }); const i = this.attributes; for (const c in i) { const l = i[c]; e.data.attributes[c] = l.toJSON(e.data); } const r = {}; let s = false; for (const c in this.morphAttributes) { const l = this.morphAttributes[c], d = []; for (let h6 = 0, p = l.length; h6 < p; h6++) { const g = l[h6]; d.push(g.toJSON(e.data)); } d.length > 0 && (r[c] = d, s = true); } s && (e.data.morphAttributes = r, e.data.morphTargetsRelative = this.morphTargetsRelative); const o = this.groups; o.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(o))); const a = this.boundingSphere; return a !== null && (e.data.boundingSphere = { center: a.center.toArray(), radius: a.radius }), e; } clone() { return new _Je().copy(this); } copy(e) { this.index = null, this.attributes = {}, this.morphAttributes = {}, this.groups = [], this.boundingBox = null, this.boundingSphere = null; const t13 = {}; this.name = e.name; const i = e.index; i !== null && this.setIndex(i.clone(t13)); const r = e.attributes; for (const l in r) { const d = r[l]; this.setAttribute(l, d.clone(t13)); } const s = e.morphAttributes; for (const l in s) { const d = [], h6 = s[l]; for (let p = 0, g = h6.length; p < g; p++) d.push(h6[p].clone(t13)); this.morphAttributes[l] = d; } this.morphTargetsRelative = e.morphTargetsRelative; const o = e.groups; for (let l = 0, d = o.length; l < d; l++) { const h6 = o[l]; this.addGroup(h6.start, h6.count, h6.materialIndex); } const a = e.boundingBox; a !== null && (this.boundingBox = a.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" }); } }; Je2.prototype.isBufferGeometry = true; var _g2 = new $e2(); var oo2 = new is2(); var Mh2 = new xr(); var Ar2 = new X(); var Cr2 = new X(); var Lr = new X(); var Sh2 = new X(); var _h2 = new X(); var Th2 = new X(); var Kl2 = new X(); var Ql2 = new X(); var ec2 = new X(); var tc2 = new Pe(); var nc2 = new Pe(); var ic2 = new Pe(); var Eh2 = new X(); var rc2 = new X(); var tn2 = class extends ot { constructor(e = new Je2(), t13 = new Vn2()) { super(), this.type = "Mesh", this.geometry = e, this.material = t13, 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 t13 = e.morphAttributes, i = Object.keys(t13); if (i.length > 0) { const r = t13[i[0]]; if (r !== void 0) { this.morphTargetInfluences = [], this.morphTargetDictionary = {}; for (let s = 0, o = r.length; s < o; s++) { const a = r[s].name || String(s); this.morphTargetInfluences.push(0), this.morphTargetDictionary[a] = s; } } } } else { const t13 = e.morphTargets; t13 !== void 0 && t13.length > 0 && console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); } } raycast(e, t13) { const i = this.geometry, r = this.material, s = this.matrixWorld; if (r === void 0 || (i.boundingSphere === null && i.computeBoundingSphere(), Mh2.copy(i.boundingSphere), Mh2.applyMatrix4(s), e.ray.intersectsSphere(Mh2) === false) || (_g2.copy(s).invert(), oo2.copy(e.ray).applyMatrix4(_g2), i.boundingBox !== null && oo2.intersectsBox(i.boundingBox) === false)) return; let o; if (i.isBufferGeometry) { const a = i.index, c = i.attributes.position, l = i.morphAttributes.position, d = i.morphTargetsRelative, h6 = i.attributes.uv, p = i.attributes.uv2, g = i.groups, f = i.drawRange; if (a !== null) if (Array.isArray(r)) for (let u = 0, y = g.length; u < y; u++) { const v = g[u], m = r[v.materialIndex], w = Math.max(v.start, f.start), S = Math.min(v.start + v.count, f.start + f.count); for (let T = w, M = S; T < M; T += 3) { const x = a.getX(T), _ = a.getX(T + 1), E = a.getX(T + 2); o = sc2(this, m, e, oo2, c, l, d, h6, p, x, _, E), o && (o.faceIndex = Math.floor(T / 3), o.face.materialIndex = v.materialIndex, t13.push(o)); } } else { const u = Math.max(0, f.start), y = Math.min(a.count, f.start + f.count); for (let v = u, m = y; v < m; v += 3) { const w = a.getX(v), S = a.getX(v + 1), T = a.getX(v + 2); o = sc2(this, r, e, oo2, c, l, d, h6, p, w, S, T), o && (o.faceIndex = Math.floor(v / 3), t13.push(o)); } } else if (c !== void 0) if (Array.isArray(r)) for (let u = 0, y = g.length; u < y; u++) { const v = g[u], m = r[v.materialIndex], w = Math.max(v.start, f.start), S = Math.min(v.start + v.count, f.start + f.count); for (let T = w, M = S; T < M; T += 3) { const x = T, _ = T + 1, E = T + 2; o = sc2(this, m, e, oo2, c, l, d, h6, p, x, _, E), o && (o.faceIndex = Math.floor(T / 3), o.face.materialIndex = v.materialIndex, t13.push(o)); } } else { const u = Math.max(0, f.start), y = Math.min(c.count, f.start + f.count); for (let v = u, m = y; v < m; v += 3) { const w = v, S = v + 1, T = v + 2; o = sc2(this, r, e, oo2, c, l, d, h6, p, w, S, T), o && (o.faceIndex = Math.floor(v / 3), t13.push(o)); } } } else i.isGeometry && console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); } }; tn2.prototype.isMesh = true; function EI(n, e, t13, i, r, s, o, a) { let c; if (e.side === qt2 ? c = i.intersectTriangle(o, s, r, true, a) : c = i.intersectTriangle(r, s, o, e.side !== Yr2, a), c === null) return null; rc2.copy(a), rc2.applyMatrix4(n.matrixWorld); const l = t13.ray.origin.distanceTo(rc2); return l < t13.near || l > t13.far ? null : { distance: l, point: rc2.clone(), object: n }; } function sc2(n, e, t13, i, r, s, o, a, c, l, d, h6) { Ar2.fromBufferAttribute(r, l), Cr2.fromBufferAttribute(r, d), Lr.fromBufferAttribute(r, h6); const p = n.morphTargetInfluences; if (e.morphTargets && s && p) { Kl2.set(0, 0, 0), Ql2.set(0, 0, 0), ec2.set(0, 0, 0); for (let f = 0, u = s.length; f < u; f++) { const y = p[f], v = s[f]; y !== 0 && (Sh2.fromBufferAttribute(v, l), _h2.fromBufferAttribute(v, d), Th2.fromBufferAttribute(v, h6), o ? (Kl2.addScaledVector(Sh2, y), Ql2.addScaledVector(_h2, y), ec2.addScaledVector(Th2, y)) : (Kl2.addScaledVector(Sh2.sub(Ar2), y), Ql2.addScaledVector(_h2.sub(Cr2), y), ec2.addScaledVector(Th2.sub(Lr), y))); } Ar2.add(Kl2), Cr2.add(Ql2), Lr.add(ec2); } n.isSkinnedMesh && (n.boneTransform(l, Ar2), n.boneTransform(d, Cr2), n.boneTransform(h6, Lr)); const g = EI(n, e, t13, i, Ar2, Cr2, Lr, Eh2); if (g) { a && (tc2.fromBufferAttribute(a, l), nc2.fromBufferAttribute(a, d), ic2.fromBufferAttribute(a, h6), g.uv = Qt.getUV(Eh2, Ar2, Cr2, Lr, tc2, nc2, ic2, new Pe())), c && (tc2.fromBufferAttribute(c, l), nc2.fromBufferAttribute(c, d), ic2.fromBufferAttribute(c, h6), g.uv2 = Qt.getUV(Eh2, Ar2, Cr2, Lr, tc2, nc2, ic2, new Pe())); const f = { a: l, b: d, c: h6, normal: new X(), materialIndex: 0 }; Qt.getNormal(Ar2, Cr2, Lr, f.normal), g.face = f; } return g; } var hr2 = class _hr extends Je2 { constructor(e = 1, t13 = 1, i = 1, r = 1, s = 1, o = 1) { super(), this.type = "BoxGeometry", this.parameters = { width: e, height: t13, depth: i, widthSegments: r, heightSegments: s, depthSegments: o }; const a = this; r = Math.floor(r), s = Math.floor(s), o = Math.floor(o); const c = [], l = [], d = [], h6 = []; let p = 0, g = 0; f("z", "y", "x", -1, -1, i, t13, e, o, s, 0), f("z", "y", "x", 1, -1, i, t13, -e, o, s, 1), f("x", "z", "y", 1, 1, e, i, t13, r, o, 2), f("x", "z", "y", 1, -1, e, i, -t13, r, o, 3), f("x", "y", "z", 1, -1, e, t13, i, r, s, 4), f("x", "y", "z", -1, -1, e, t13, -i, r, s, 5), this.setIndex(c), this.setAttribute("position", new We(l, 3)), this.setAttribute("normal", new We(d, 3)), this.setAttribute("uv", new We(h6, 2)); function f(u, y, v, m, w, S, T, M, x, _, E) { const L = S / x, R = T / _, C = S / 2, A = T / 2, P = M / 2, I = x + 1, b = _ + 1; let O = 0, N = 0; const D = new X(); for (let B = 0; B < b; B++) { const U = B * R - A; for (let k = 0; k < I; k++) { const K = k * L - C; D[u] = K * m, D[y] = U * w, D[v] = P, l.push(D.x, D.y, D.z), D[u] = 0, D[y] = 0, D[v] = M > 0 ? 1 : -1, d.push(D.x, D.y, D.z), h6.push(k / x), h6.push(1 - B / _), O += 1; } } for (let B = 0; B < _; B++) for (let U = 0; U < x; U++) { const k = p + U + I * B, K = p + U + I * (B + 1), ie = p + (U + 1) + I * (B + 1), j = p + (U + 1) + I * B; c.push(k, K, j), c.push(K, ie, j), N += 6; } a.addGroup(g, N, E), g += N, p += O; } } static fromJSON(e) { return new _hr(e.width, e.height, e.depth, e.widthSegments, e.heightSegments, e.depthSegments); } }; function Vo2(n) { const e = {}; for (const t13 in n) { e[t13] = {}; for (const i in n[t13]) { const r = n[t13][i]; r && (r.isColor || r.isMatrix3 || r.isMatrix4 || r.isVector2 || r.isVector3 || r.isVector4 || r.isTexture || r.isQuaternion) ? e[t13][i] = r.clone() : Array.isArray(r) ? e[t13][i] = r.slice() : e[t13][i] = r; } } return e; } function En2(n) { const e = {}; for (let t13 = 0; t13 < n.length; t13++) { const i = Vo2(n[t13]); for (const r in i) e[r] = i[r]; } return e; } var _x2 = { clone: Vo2, merge: En2 }; var AI = `void main() { gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); }`; var CI = `void main() { gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); }`; var dr2 = class extends sn { constructor(e) { super(), this.type = "ShaderMaterial", this.defines = {}, this.uniforms = {}, this.vertexShader = AI, this.fragmentShader = CI, this.linewidth = 1, this.wireframe = false, this.wireframeLinewidth = 1, this.fog = false, this.lights = false, this.clipping = false, this.morphTargets = false, this.morphNormals = false, this.extensions = { derivatives: false, // set to use derivatives fragDepth: false, // set to use fragment depth values drawBuffers: false, // set to use draw buffers shaderTextureLOD: false // set to use shader texture LOD }, this.defaultAttributeValues = { color: [1, 1, 1], uv: [0, 0], uv2: [0, 0] }, this.index0AttributeName = void 0, this.uniformsNeedUpdate = false, 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 = Vo2(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 t13 = super.toJSON(e); t13.glslVersion = this.glslVersion, t13.uniforms = {}; for (const r in this.uniforms) { const o = this.uniforms[r].value; o && o.isTexture ? t13.uniforms[r] = { type: "t", value: o.toJSON(e).uuid } : o && o.isColor ? t13.uniforms[r] = { type: "c", value: o.getHex() } : o && o.isVector2 ? t13.uniforms[r] = { type: "v2", value: o.toArray() } : o && o.isVector3 ? t13.uniforms[r] = { type: "v3", value: o.toArray() } : o && o.isVector4 ? t13.uniforms[r] = { type: "v4", value: o.toArray() } : o && o.isMatrix3 ? t13.uniforms[r] = { type: "m3", value: o.toArray() } : o && o.isMatrix4 ? t13.uniforms[r] = { type: "m4", value: o.toArray() } : t13.uniforms[r] = { value: o }; } Object.keys(this.defines).length > 0 && (t13.defines = this.defines), t13.vertexShader = this.vertexShader, t13.fragmentShader = this.fragmentShader; const i = {}; for (const r in this.extensions) this.extensions[r] === true && (i[r] = true); return Object.keys(i).length > 0 && (t13.extensions = i), t13; } }; dr2.prototype.isShaderMaterial = true; var wl2 = class extends ot { constructor() { super(), this.type = "Camera", this.matrixWorldInverse = new $e2(), this.projectionMatrix = new $e2(), this.projectionMatrixInverse = new $e2(); } copy(e, t13) { return super.copy(e, t13), this.matrixWorldInverse.copy(e.matrixWorldInverse), this.projectionMatrix.copy(e.projectionMatrix), this.projectionMatrixInverse.copy(e.projectionMatrixInverse), this; } getWorldDirection(e) { this.updateWorldMatrix(true, false); const t13 = this.matrixWorld.elements; return e.set(-t13[8], -t13[9], -t13[10]).normalize(); } updateMatrixWorld(e) { super.updateMatrixWorld(e), this.matrixWorldInverse.copy(this.matrixWorld).invert(); } updateWorldMatrix(e, t13) { super.updateWorldMatrix(e, t13), this.matrixWorldInverse.copy(this.matrixWorld).invert(); } clone() { return new this.constructor().copy(this); } }; wl2.prototype.isCamera = true; var an2 = class extends wl2 { constructor(e = 50, t13 = 1, i = 0.1, r = 2e3) { super(), this.type = "PerspectiveCamera", this.fov = e, this.zoom = 1, this.near = i, this.far = r, this.focus = 10, this.aspect = t13, this.view = null, this.filmGauge = 35, this.filmOffset = 0, this.updateProjectionMatrix(); } copy(e, t13) { return super.copy(e, t13), 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 t13 = 0.5 * this.getFilmHeight() / e; this.fov = nl2 * 2 * Math.atan(t13), this.updateProjectionMatrix(); } /** * Calculates the focal length from the current .fov and .filmGauge. */ getFocalLength() { const e = Math.tan(As2 * 0.5 * this.fov); return 0.5 * this.getFilmHeight() / e; } getEffectiveFOV() { return nl2 * 2 * Math.atan( Math.tan(As2 * 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, t13, i, r, s, o) { this.aspect = e / t13, this.view === null && (this.view = { enabled: true, fullWidth: 1, fullHeight: 1, offsetX: 0, offsetY: 0, width: 1, height: 1 }), this.view.enabled = true, this.view.fullWidth = e, this.view.fullHeight = t13, this.view.offsetX = i, this.view.offsetY = r, this.view.width = s, this.view.height = o, this.updateProjectionMatrix(); } clearViewOffset() { this.view !== null && (this.view.enabled = false), this.updateProjectionMatrix(); } updateProjectionMatrix() { const e = this.near; let t13 = e * Math.tan(As2 * 0.5 * this.fov) / this.zoom, i = 2 * t13, r = this.aspect * i, s = -0.5 * r; const o = this.view; if (this.view !== null && this.view.enabled) { const c = o.fullWidth, l = o.fullHeight; s += o.offsetX * r / c, t13 -= o.offsetY * i / l, r *= o.width / c, i *= o.height / l; } const a = this.filmOffset; a !== 0 && (s += e * a / this.getFilmWidth()), this.projectionMatrix.makePerspective(s, s + r, t13, t13 - i, e, this.far), this.projectionMatrixInverse.copy(this.projectionMatrix).invert(); } toJSON(e) { const t13 = super.toJSON(e); return t13.object.fov = this.fov, t13.object.zoom = this.zoom, t13.object.near = this.near, t13.object.far = this.far, t13.object.focus = this.focus, t13.object.aspect = this.aspect, this.view !== null && (t13.object.view = Object.assign({}, this.view)), t13.object.filmGauge = this.filmGauge, t13.object.filmOffset = this.filmOffset, t13; } }; an2.prototype.isPerspectiveCamera = true; var ao2 = 90; var lo2 = 1; var Pu2 = class extends ot { constructor(e, t13, i) { if (super(), this.type = "CubeCamera", i.isWebGLCubeRenderTarget !== true) { console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter."); return; } this.renderTarget = i; const r = new an2(ao2, lo2, e, t13); r.layers = this.layers, r.up.set(0, -1, 0), r.lookAt(new X(1, 0, 0)), this.add(r); const s = new an2(ao2, lo2, e, t13); s.layers = this.layers, s.up.set(0, -1, 0), s.lookAt(new X(-1, 0, 0)), this.add(s); const o = new an2(ao2, lo2, e, t13); o.layers = this.layers, o.up.set(0, 0, 1), o.lookAt(new X(0, 1, 0)), this.add(o); const a = new an2(ao2, lo2, e, t13); a.layers = this.layers, a.up.set(0, 0, -1), a.lookAt(new X(0, -1, 0)), this.add(a); const c = new an2(ao2, lo2, e, t13); c.layers = this.layers, c.up.set(0, -1, 0), c.lookAt(new X(0, 0, 1)), this.add(c); const l = new an2(ao2, lo2, e, t13); l.layers = this.layers, l.up.set(0, -1, 0), l.lookAt(new X(0, 0, -1)), this.add(l); } update(e, t13) { this.parent === null && this.updateMatrixWorld(); const i = this.renderTarget, [r, s, o, a, c, l] = this.children, d = e.xr.enabled, h6 = e.getRenderTarget(); e.xr.enabled = false; const p = i.texture.generateMipmaps; i.texture.generateMipmaps = false, e.setRenderTarget(i, 0), e.render(t13, r), e.setRenderTarget(i, 1), e.render(t13, s), e.setRenderTarget(i, 2), e.render(t13, o), e.setRenderTarget(i, 3), e.render(t13, a), e.setRenderTarget(i, 4), e.render(t13, c), i.texture.generateMipmaps = p, e.setRenderTarget(i, 5), e.render(t13, l), e.setRenderTarget(h6), e.xr.enabled = d; } }; var ca2 = class extends nn2 { constructor(e, t13, i, r, s, o, a, c, l, d) { e = e !== void 0 ? e : [], t13 = t13 !== void 0 ? t13 : yl, a = a !== void 0 ? a : ar2, super(e, t13, i, r, s, o, a, c, l, d), this._needsFlipEnvMap = true, this.flipY = false; } get images() { return this.image; } set images(e) { this.image = e; } }; ca2.prototype.isCubeTexture = true; var Iu2 = class extends bi2 { constructor(e, t13, i) { Number.isInteger(t13) && (console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"), t13 = i), super(e, e, t13), t13 = t13 || {}, this.texture = new ca2(void 0, t13.mapping, t13.wrapS, t13.wrapT, t13.magFilter, t13.minFilter, t13.format, t13.type, t13.anisotropy, t13.encoding), this.texture.generateMipmaps = t13.generateMipmaps !== void 0 ? t13.generateMipmaps : false, this.texture.minFilter = t13.minFilter !== void 0 ? t13.minFilter : jt, this.texture._needsFlipEnvMap = false; } fromEquirectangularTexture(e, t13) { this.texture.type = t13.type, this.texture.format = Yn2, this.texture.encoding = t13.encoding, this.texture.generateMipmaps = t13.generateMipmaps, this.texture.minFilter = t13.minFilter, this.texture.magFilter = t13.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 ); } ` ) }, r = new hr2(5, 5, 5), s = new dr2({ name: "CubemapFromEquirect", uniforms: Vo2(i.uniforms), vertexShader: i.vertexShader, fragmentShader: i.fragmentShader, side: qt2, blending: or2 }); s.uniforms.tEquirect.value = t13; const o = new tn2(r, s), a = t13.minFilter; return t13.minFilter === br2 && (t13.minFilter = jt), new Pu2(1, 10, this).update(e, o), t13.minFilter = a, o.geometry.dispose(), o.material.dispose(), this; } clear(e, t13, i, r) { const s = e.getRenderTarget(); for (let o = 0; o < 6; o++) e.setRenderTarget(this, o), e.clear(t13, i, r); e.setRenderTarget(s); } }; Iu2.prototype.isWebGLCubeRenderTarget = true; var Ah2 = new X(); var LI = new X(); var RI = new ln2(); var Li2 = class { constructor(e = new X(1, 0, 0), t13 = 0) { this.normal = e, this.constant = t13; } set(e, t13) { return this.normal.copy(e), this.constant = t13, this; } setComponents(e, t13, i, r) { return this.normal.set(e, t13, i), this.constant = r, this; } setFromNormalAndCoplanarPoint(e, t13) { return this.normal.copy(e), this.constant = -t13.dot(this.normal), this; } setFromCoplanarPoints(e, t13, i) { const r = Ah2.subVectors(i, t13).cross(LI.subVectors(e, t13)).normalize(); return this.setFromNormalAndCoplanarPoint(r, 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, t13) { return t13.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e); } intersectLine(e, t13) { const i = e.delta(Ah2), r = this.normal.dot(i); if (r === 0) return this.distanceToPoint(e.start) === 0 ? t13.copy(e.start) : null; const s = -(e.start.dot(this.normal) + this.constant) / r; return s < 0 || s > 1 ? null : t13.copy(i).multiplyScalar(s).add(e.start); } intersectsLine(e) { const t13 = this.distanceToPoint(e.start), i = this.distanceToPoint(e.end); return t13 < 0 && i > 0 || i < 0 && t13 > 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, t13) { const i = t13 || RI.getNormalMatrix(e), r = this.coplanarPoint(Ah2).applyMatrix4(e), s = this.normal.applyMatrix3(i).normalize(); return this.constant = -r.dot(s), 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); } }; Li2.prototype.isPlane = true; var co2 = new xr(); var oc2 = new X(); var Ml2 = class { constructor(e = new Li2(), t13 = new Li2(), i = new Li2(), r = new Li2(), s = new Li2(), o = new Li2()) { this.planes = [e, t13, i, r, s, o]; } set(e, t13, i, r, s, o) { const a = this.planes; return a[0].copy(e), a[1].copy(t13), a[2].copy(i), a[3].copy(r), a[4].copy(s), a[5].copy(o), this; } copy(e) { const t13 = this.planes; for (let i = 0; i < 6; i++) t13[i].copy(e.planes[i]); return this; } setFromProjectionMatrix(e) { const t13 = this.planes, i = e.elements, r = i[0], s = i[1], o = i[2], a = i[3], c = i[4], l = i[5], d = i[6], h6 = i[7], p = i[8], g = i[9], f = i[10], u = i[11], y = i[12], v = i[13], m = i[14], w = i[15]; return t13[0].setComponents(a - r, h6 - c, u - p, w - y).normalize(), t13[1].setComponents(a + r, h6 + c, u + p, w + y).normalize(), t13[2].setComponents(a + s, h6 + l, u + g, w + v).normalize(), t13[3].setComponents(a - s, h6 - l, u - g, w - v).normalize(), t13[4].setComponents(a - o, h6 - d, u - f, w - m).normalize(), t13[5].setComponents(a + o, h6 + d, u + f, w + m).normalize(), this; } intersectsObject(e) { const t13 = e.geometry; return t13.boundingSphere === null && t13.computeBoundingSphere(), co2.copy(t13.boundingSphere).applyMatrix4(e.matrixWorld), this.intersectsSphere(co2); } intersectsSprite(e) { return co2.center.set(0, 0, 0), co2.radius = 0.7071067811865476, co2.applyMatrix4(e.matrixWorld), this.intersectsSphere(co2); } intersectsSphere(e) { const t13 = this.planes, i = e.center, r = -e.radius; for (let s = 0; s < 6; s++) if (t13[s].distanceToPoint(i) < r) return false; return true; } intersectsBox(e) { const t13 = this.planes; for (let i = 0; i < 6; i++) { const r = t13[i]; if (oc2.x = r.normal.x > 0 ? e.max.x : e.min.x, oc2.y = r.normal.y > 0 ? e.max.y : e.min.y, oc2.z = r.normal.z > 0 ? e.max.z : e.min.z, r.distanceToPoint(oc2) < 0) return false; } return true; } containsPoint(e) { const t13 = this.planes; for (let i = 0; i < 6; i++) if (t13[i].distanceToPoint(e) < 0) return false; return true; } clone() { return new this.constructor().copy(this); } }; function Tx2() { let n = null, e = false, t13 = null, i = null; function r(s, o) { t13(s, o), i = n.requestAnimationFrame(r); } return { start: function() { e !== true && t13 !== null && (i = n.requestAnimationFrame(r), e = true); }, stop: function() { n.cancelAnimationFrame(i), e = false; }, setAnimationLoop: function(s) { t13 = s; }, setContext: function(s) { n = s; } }; } function PI(n, e) { const t13 = e.isWebGL2, i = /* @__PURE__ */ new WeakMap(); function r(l, d) { const h6 = l.array, p = l.usage, g = n.createBuffer(); n.bindBuffer(d, g), n.bufferData(d, h6, p), l.onUploadCallback(); let f = 5126; return h6 instanceof Float32Array ? f = 5126 : h6 instanceof Float64Array ? console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array.") : h6 instanceof Uint16Array ? l.isFloat16BufferAttribute ? t13 ? f = 5131 : console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.") : f = 5123 : h6 instanceof Int16Array ? f = 5122 : h6 instanceof Uint32Array ? f = 5125 : h6 instanceof Int32Array ? f = 5124 : h6 instanceof Int8Array ? f = 5120 : (h6 instanceof Uint8Array || h6 instanceof Uint8ClampedArray) && (f = 5121), { buffer: g, type: f, bytesPerElement: h6.BYTES_PER_ELEMENT, version: l.version }; } function s(l, d, h6) { const p = d.array, g = d.updateRange; n.bindBuffer(h6, l), g.count === -1 ? n.bufferSubData(h6, 0, p) : (t13 ? n.bufferSubData( h6, g.offset * p.BYTES_PER_ELEMENT, p, g.offset, g.count ) : n.bufferSubData( h6, g.offset * p.BYTES_PER_ELEMENT, p.subarray(g.offset, g.offset + g.count) ), g.count = -1); } function o(l) { return l.isInterleavedBufferAttribute && (l = l.data), i.get(l); } function a(l) { l.isInterleavedBufferAttribute && (l = l.data); const d = i.get(l); d && (n.deleteBuffer(d.buffer), i.delete(l)); } function c(l, d) { if (l.isGLBufferAttribute) { const p = i.get(l); (!p || p.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 h6 = i.get(l); h6 === void 0 ? i.set(l, r(l, d)) : h6.version < l.version && (s(h6.buffer, l, d), h6.version = l.version); } return { get: o, remove: a, update: c }; } var Ds2 = class _Ds extends Je2 { constructor(e = 1, t13 = 1, i = 1, r = 1) { super(), this.type = "PlaneGeometry", this.parameters = { width: e, height: t13, widthSegments: i, heightSegments: r }; const s = e / 2, o = t13 / 2, a = Math.floor(i), c = Math.floor(r), l = a + 1, d = c + 1, h6 = e / a, p = t13 / c, g = [], f = [], u = [], y = []; for (let v = 0; v < d; v++) { const m = v * p - o; for (let w = 0; w < l; w++) { const S = w * h6 - s; f.push(S, -m, 0), u.push(0, 0, 1), y.push(w / a), y.push(1 - v / c); } } for (let v = 0; v < c; v++) for (let m = 0; m < a; m++) { const w = m + l * v, S = m + l * (v + 1), T = m + 1 + l * (v + 1), M = m + 1 + l * v; g.push(w, S, M), g.push(S, T, M); } this.setIndex(g), this.setAttribute("position", new We(f, 3)), this.setAttribute("normal", new We(u, 3)), this.setAttribute("uv", new We(y, 2)); } static fromJSON(e) { return new _Ds(e.width, e.height, e.widthSegments, e.heightSegments); } }; var II = `#ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, vUv ).g; #endif`; var OI = `#ifdef USE_ALPHAMAP uniform sampler2D alphaMap; #endif`; var DI = `#ifdef ALPHATEST if ( diffuseColor.a < ALPHATEST ) discard; #endif`; var NI = `#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`; var FI = `#ifdef USE_AOMAP uniform sampler2D aoMap; uniform float aoMapIntensity; #endif`; var BI = "vec3 transformed = vec3( position );"; var zI = `vec3 objectNormal = vec3( normal ); #ifdef USE_TANGENT vec3 objectTangent = vec3( tangent.xyz ); #endif`; var UI = `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`; var VI = `#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`; var kI = `#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`; var GI = `#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; #endif`; var HI = `#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; #endif`; var WI = `#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; #endif`; var jI = `#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; #endif`; var $I = `#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; #endif`; var ZI = `#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) varying vec3 vColor; #endif`; var XI = `#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`; var YI = `#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 ); }`; var JI = `#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`; var qI = `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`; var KI = `#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; #endif`; var QI = `#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); #endif`; var eO2 = `#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vUv ); emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb; totalEmissiveRadiance *= emissiveColor.rgb; #endif`; var tO2 = `#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; #endif`; var nO2 = "gl_FragColor = linearToOutputTexel( gl_FragColor );"; var iO2 = ` 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 ); }`; var rO2 = `#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`; var sO2 = `#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`; var oO2 = `#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`; var aO2 = `#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`; var lO2 = `#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`; var cO2 = `#ifdef USE_FOG fogDepth = - mvPosition.z; #endif`; var uO2 = `#ifdef USE_FOG varying float fogDepth; #endif`; var hO2 = `#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`; var dO2 = `#ifdef USE_FOG uniform vec3 fogColor; varying float fogDepth; #ifdef FOG_EXP2 uniform float fogDensity; #else uniform float fogNear; uniform float fogFar; #endif #endif`; var fO2 = `#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 }`; var pO2 = `#ifdef USE_LIGHTMAP vec4 lightMapTexel= texture2D( lightMap, vUv2 ); reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; #endif`; var mO2 = `#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; #endif`; var gO2 = `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`; var vO2 = `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`; var yO2 = `#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`; var bO2 = `ToonMaterial material; material.diffuseColor = diffuseColor.rgb;`; var xO2 = `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)`; var wO2 = `BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; material.specularStrength = specularStrength;`; var MO2 = `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)`; var SO2 = `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`; var _O2 = `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 ); }`; var TO2 = ` 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`; var EO2 = `#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`; var AO2 = `#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); #endif`; var CO2 = `#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; #endif`; var LO2 = `#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; #endif`; var RO2 = `#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT varying float vFragDepth; varying float vIsPerspective; #else uniform float logDepthBufFC; #endif #endif`; var PO2 = `#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`; var IO2 = `#ifdef USE_MAP vec4 texelColor = texture2D( map, vUv ); texelColor = mapTexelToLinear( texelColor ); diffuseColor *= texelColor; #endif`; var OO2 = `#ifdef USE_MAP uniform sampler2D map; #endif`; var DO2 = `#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`; var NO2 = `#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`; var FO2 = `float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vUv ); metalnessFactor *= texelMetalness.b; #endif`; var BO2 = `#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; #endif`; var zO2 = `#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; #endif`; var UO2 = `#ifdef USE_MORPHTARGETS uniform float morphTargetBaseInfluence; #ifndef USE_MORPHNORMALS uniform float morphTargetInfluences[ 8 ]; #else uniform float morphTargetInfluences[ 4 ]; #endif #endif`; var VO2 = `#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`; var kO2 = `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;`; var GO2 = `#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`; var HO2 = `#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`; var WO2 = `#ifdef CLEARCOAT vec3 clearcoatNormal = geometryNormal; #endif`; var jO2 = `#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`; var $O2 = `#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`; var ZO2 = `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 ); }`; var XO2 = `#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; #endif`; var YO2 = `vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_INSTANCING mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; gl_Position = projectionMatrix * mvPosition;`; var JO2 = `#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); #endif`; var qO2 = `#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`; var KO2 = `float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vUv ); roughnessFactor *= texelRoughness.g; #endif`; var QO2 = `#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; #endif`; var e32 = `#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`; var t33 = `#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`; var n32 = `#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`; var i32 = `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; }`; var r32 = `#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); #endif`; var s32 = `#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`; var o32 = `#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`; var a32 = `#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`; var l32 = `float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; #endif`; var c32 = `#ifdef USE_SPECULARMAP uniform sampler2D specularMap; #endif`; var u32 = `#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); #endif`; var h32 = `#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; }`; var d32 = `#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`; var f32 = `#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`; var p32 = `#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) varying vec2 vUv; #endif`; var m32 = `#ifdef USE_UV #ifdef UVS_VERTEX_ONLY vec2 vUv; #else varying vec2 vUv; #endif uniform mat3 uvTransform; #endif`; var g32 = `#ifdef USE_UV vUv = ( uvTransform * vec3( uv, 1 ) ).xy; #endif`; var v32 = `#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) varying vec2 vUv2; #endif`; var y32 = `#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) attribute vec2 uv2; varying vec2 vUv2; uniform mat3 uv2Transform; #endif`; var b32 = `#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; #endif`; var x32 = `#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`; var w32 = `uniform sampler2D t2D; varying vec2 vUv; void main() { vec4 texColor = texture2D( t2D, vUv ); gl_FragColor = mapTexelToLinear( texColor ); #include #include }`; var M32 = `varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); }`; var S32 = `#include uniform float opacity; varying vec3 vWorldDirection; #include void main() { vec3 vReflect = vWorldDirection; #include gl_FragColor = envColor; gl_FragColor.a *= opacity; #include #include }`; var _32 = `varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; }`; var T32 = `#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 }`; var E32 = `#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; }`; var A32 = `#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 ); }`; var C32 = `#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; }`; var L32 = `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 }`; var R32 = `varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include }`; var P32 = `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 }`; var I32 = `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 }`; var O32 = `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 }`; var D32 = `#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 }`; var N32 = `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 }`; var F32 = `#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 }`; var B32 = `#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 }`; var z32 = `#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; }`; var U32 = `#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 }`; var V32 = `#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 }`; var k32 = `#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 }`; var G32 = `#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 }`; var H32 = `#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 }`; var W32 = `#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 }`; var j32 = `#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 ); }`; var $32 = `#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 }`; var Z32 = `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 }`; var X32 = `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 }`; var Y32 = `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 }`; var J32 = `#include #include #include void main() { #include #include #include #include #include #include #include #include #include #include }`; var q32 = `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 }`; var K32 = `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 }`; var ct2 = { alphamap_fragment: II, alphamap_pars_fragment: OI, alphatest_fragment: DI, aomap_fragment: NI, aomap_pars_fragment: FI, begin_vertex: BI, beginnormal_vertex: zI, bsdfs: UI, bumpmap_pars_fragment: VI, clipping_planes_fragment: kI, clipping_planes_pars_fragment: GI, clipping_planes_pars_vertex: HI, clipping_planes_vertex: WI, color_fragment: jI, color_pars_fragment: $I, color_pars_vertex: ZI, color_vertex: XI, common: YI, cube_uv_reflection_fragment: JI, defaultnormal_vertex: qI, displacementmap_pars_vertex: KI, displacementmap_vertex: QI, emissivemap_fragment: eO2, emissivemap_pars_fragment: tO2, encodings_fragment: nO2, encodings_pars_fragment: iO2, envmap_fragment: rO2, envmap_common_pars_fragment: sO2, envmap_pars_fragment: oO2, envmap_pars_vertex: aO2, envmap_physical_pars_fragment: yO2, envmap_vertex: lO2, fog_vertex: cO2, fog_pars_vertex: uO2, fog_fragment: hO2, fog_pars_fragment: dO2, gradientmap_pars_fragment: fO2, lightmap_fragment: pO2, lightmap_pars_fragment: mO2, lights_lambert_vertex: gO2, lights_pars_begin: vO2, lights_toon_fragment: bO2, lights_toon_pars_fragment: xO2, lights_phong_fragment: wO2, lights_phong_pars_fragment: MO2, lights_physical_fragment: SO2, lights_physical_pars_fragment: _O2, lights_fragment_begin: TO2, lights_fragment_maps: EO2, lights_fragment_end: AO2, logdepthbuf_fragment: CO2, logdepthbuf_pars_fragment: LO2, logdepthbuf_pars_vertex: RO2, logdepthbuf_vertex: PO2, map_fragment: IO2, map_pars_fragment: OO2, map_particle_fragment: DO2, map_particle_pars_fragment: NO2, metalnessmap_fragment: FO2, metalnessmap_pars_fragment: BO2, morphnormal_vertex: zO2, morphtarget_pars_vertex: UO2, morphtarget_vertex: VO2, normal_fragment_begin: kO2, normal_fragment_maps: GO2, normalmap_pars_fragment: HO2, clearcoat_normal_fragment_begin: WO2, clearcoat_normal_fragment_maps: jO2, clearcoat_pars_fragment: $O2, packing: ZO2, premultiplied_alpha_fragment: XO2, project_vertex: YO2, dithering_fragment: JO2, dithering_pars_fragment: qO2, roughnessmap_fragment: KO2, roughnessmap_pars_fragment: QO2, shadowmap_pars_fragment: e32, shadowmap_pars_vertex: t33, shadowmap_vertex: n32, shadowmask_pars_fragment: i32, skinbase_vertex: r32, skinning_pars_vertex: s32, skinning_vertex: o32, skinnormal_vertex: a32, specularmap_fragment: l32, specularmap_pars_fragment: c32, tonemapping_fragment: u32, tonemapping_pars_fragment: h32, transmission_fragment: d32, transmission_pars_fragment: f32, uv_pars_fragment: p32, uv_pars_vertex: m32, uv_vertex: g32, uv2_pars_fragment: v32, uv2_pars_vertex: y32, uv2_vertex: b32, worldpos_vertex: x32, background_frag: w32, background_vert: M32, cube_frag: S32, cube_vert: _32, depth_frag: T32, depth_vert: E32, distanceRGBA_frag: A32, distanceRGBA_vert: C32, equirect_frag: L32, equirect_vert: R32, linedashed_frag: P32, linedashed_vert: I32, meshbasic_frag: O32, meshbasic_vert: D32, meshlambert_frag: N32, meshlambert_vert: F32, meshmatcap_frag: B32, meshmatcap_vert: z32, meshtoon_frag: U32, meshtoon_vert: V32, meshphong_frag: k32, meshphong_vert: G32, meshphysical_frag: H32, meshphysical_vert: W32, normal_frag: j32, normal_vert: $32, points_frag: Z32, points_vert: X32, shadow_frag: Y32, shadow_vert: J32, sprite_frag: q32, sprite_vert: K32 }; var ze2 = { common: { diffuse: { value: new Fe(16777215) }, opacity: { value: 1 }, map: { value: null }, uvTransform: { value: new ln2() }, uv2Transform: { value: new ln2() }, 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 Pe(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 Fe(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 Fe(16777215) }, opacity: { value: 1 }, size: { value: 1 }, scale: { value: 1 }, map: { value: null }, alphaMap: { value: null }, uvTransform: { value: new ln2() } }, sprite: { diffuse: { value: new Fe(16777215) }, opacity: { value: 1 }, center: { value: new Pe(0.5, 0.5) }, rotation: { value: 0 }, map: { value: null }, alphaMap: { value: null }, uvTransform: { value: new ln2() } } }; var gi2 = { basic: { uniforms: En2([ ze2.common, ze2.specularmap, ze2.envmap, ze2.aomap, ze2.lightmap, ze2.fog ]), vertexShader: ct2.meshbasic_vert, fragmentShader: ct2.meshbasic_frag }, lambert: { uniforms: En2([ ze2.common, ze2.specularmap, ze2.envmap, ze2.aomap, ze2.lightmap, ze2.emissivemap, ze2.fog, ze2.lights, { emissive: { value: new Fe(0) } } ]), vertexShader: ct2.meshlambert_vert, fragmentShader: ct2.meshlambert_frag }, phong: { uniforms: En2([ ze2.common, ze2.specularmap, ze2.envmap, ze2.aomap, ze2.lightmap, ze2.emissivemap, ze2.bumpmap, ze2.normalmap, ze2.displacementmap, ze2.fog, ze2.lights, { emissive: { value: new Fe(0) }, specular: { value: new Fe(1118481) }, shininess: { value: 30 } } ]), vertexShader: ct2.meshphong_vert, fragmentShader: ct2.meshphong_frag }, standard: { uniforms: En2([ ze2.common, ze2.envmap, ze2.aomap, ze2.lightmap, ze2.emissivemap, ze2.bumpmap, ze2.normalmap, ze2.displacementmap, ze2.roughnessmap, ze2.metalnessmap, ze2.fog, ze2.lights, { emissive: { value: new Fe(0) }, roughness: { value: 1 }, metalness: { value: 0 }, envMapIntensity: { value: 1 } // temporary } ]), vertexShader: ct2.meshphysical_vert, fragmentShader: ct2.meshphysical_frag }, toon: { uniforms: En2([ ze2.common, ze2.aomap, ze2.lightmap, ze2.emissivemap, ze2.bumpmap, ze2.normalmap, ze2.displacementmap, ze2.gradientmap, ze2.fog, ze2.lights, { emissive: { value: new Fe(0) } } ]), vertexShader: ct2.meshtoon_vert, fragmentShader: ct2.meshtoon_frag }, matcap: { uniforms: En2([ ze2.common, ze2.bumpmap, ze2.normalmap, ze2.displacementmap, ze2.fog, { matcap: { value: null } } ]), vertexShader: ct2.meshmatcap_vert, fragmentShader: ct2.meshmatcap_frag }, points: { uniforms: En2([ ze2.points, ze2.fog ]), vertexShader: ct2.points_vert, fragmentShader: ct2.points_frag }, dashed: { uniforms: En2([ ze2.common, ze2.fog, { scale: { value: 1 }, dashSize: { value: 1 }, totalSize: { value: 2 } } ]), vertexShader: ct2.linedashed_vert, fragmentShader: ct2.linedashed_frag }, depth: { uniforms: En2([ ze2.common, ze2.displacementmap ]), vertexShader: ct2.depth_vert, fragmentShader: ct2.depth_frag }, normal: { uniforms: En2([ ze2.common, ze2.bumpmap, ze2.normalmap, ze2.displacementmap, { opacity: { value: 1 } } ]), vertexShader: ct2.normal_vert, fragmentShader: ct2.normal_frag }, sprite: { uniforms: En2([ ze2.sprite, ze2.fog ]), vertexShader: ct2.sprite_vert, fragmentShader: ct2.sprite_frag }, background: { uniforms: { uvTransform: { value: new ln2() }, t2D: { value: null } }, vertexShader: ct2.background_vert, fragmentShader: ct2.background_frag }, /* ------------------------------------------------------------------------- // Cube map shader ------------------------------------------------------------------------- */ cube: { uniforms: En2([ ze2.envmap, { opacity: { value: 1 } } ]), vertexShader: ct2.cube_vert, fragmentShader: ct2.cube_frag }, equirect: { uniforms: { tEquirect: { value: null } }, vertexShader: ct2.equirect_vert, fragmentShader: ct2.equirect_frag }, distanceRGBA: { uniforms: En2([ ze2.common, ze2.displacementmap, { referencePosition: { value: new X() }, nearDistance: { value: 1 }, farDistance: { value: 1e3 } } ]), vertexShader: ct2.distanceRGBA_vert, fragmentShader: ct2.distanceRGBA_frag }, shadow: { uniforms: En2([ ze2.lights, ze2.fog, { color: { value: new Fe(0) }, opacity: { value: 1 } } ]), vertexShader: ct2.shadow_vert, fragmentShader: ct2.shadow_frag } }; gi2.physical = { uniforms: En2([ gi2.standard.uniforms, { clearcoat: { value: 0 }, clearcoatMap: { value: null }, clearcoatRoughness: { value: 0 }, clearcoatRoughnessMap: { value: null }, clearcoatNormalScale: { value: new Pe(1, 1) }, clearcoatNormalMap: { value: null }, sheen: { value: new Fe(0) }, transmission: { value: 0 }, transmissionMap: { value: null }, transmissionSamplerSize: { value: new Pe() }, transmissionSamplerMap: { value: null }, thickness: { value: 0 }, thicknessMap: { value: null }, attenuationDistance: { value: 0 }, attenuationColor: { value: new Fe(0) } } ]), vertexShader: ct2.meshphysical_vert, fragmentShader: ct2.meshphysical_frag }; function Q32(n, e, t13, i, r) { const s = new Fe(0); let o = 0, a, c, l = null, d = 0, h6 = null; function p(f, u) { let y = false, v = u.isScene === true ? u.background : null; v && v.isTexture && (v = e.get(v)); const m = n.xr, w = m.getSession && m.getSession(); w && w.environmentBlendMode === "additive" && (v = null), v === null ? g(s, o) : v && v.isColor && (g(v, 1), y = true), (n.autoClear || y) && n.clear(n.autoClearColor, n.autoClearDepth, n.autoClearStencil), v && (v.isCubeTexture || v.mapping === la2) ? (c === void 0 && (c = new tn2( new hr2(1, 1, 1), new dr2({ name: "BackgroundCubeMaterial", uniforms: Vo2(gi2.cube.uniforms), vertexShader: gi2.cube.vertexShader, fragmentShader: gi2.cube.fragmentShader, side: qt2, depthTest: false, depthWrite: false, fog: false }) ), c.geometry.deleteAttribute("normal"), c.geometry.deleteAttribute("uv"), c.onBeforeRender = function(S, T, M) { this.matrixWorld.copyPosition(M.matrixWorld); }, Object.defineProperty(c.material, "envMap", { get: function() { return this.uniforms.envMap.value; } }), i.update(c)), c.material.uniforms.envMap.value = v, c.material.uniforms.flipEnvMap.value = v.isCubeTexture && v._needsFlipEnvMap ? -1 : 1, (l !== v || d !== v.version || h6 !== n.toneMapping) && (c.material.needsUpdate = true, l = v, d = v.version, h6 = n.toneMapping), f.unshift(c, c.geometry, c.material, 0, 0, null)) : v && v.isTexture && (a === void 0 && (a = new tn2( new Ds2(2, 2), new dr2({ name: "BackgroundMaterial", uniforms: Vo2(gi2.background.uniforms), vertexShader: gi2.background.vertexShader, fragmentShader: gi2.background.fragmentShader, side: Xr2, depthTest: false, depthWrite: false, fog: false }) ), a.geometry.deleteAttribute("normal"), Object.defineProperty(a.material, "map", { get: function() { return this.uniforms.t2D.value; } }), i.update(a)), a.material.uniforms.t2D.value = v, v.matrixAutoUpdate === true && v.updateMatrix(), a.material.uniforms.uvTransform.value.copy(v.matrix), (l !== v || d !== v.version || h6 !== n.toneMapping) && (a.material.needsUpdate = true, l = v, d = v.version, h6 = n.toneMapping), f.unshift(a, a.geometry, a.material, 0, 0, null)); } function g(f, u) { t13.buffers.color.setClear(f.r, f.g, f.b, u, r); } return { getClearColor: function() { return s; }, setClearColor: function(f, u = 1) { s.set(f), o = u, g(s, o); }, getClearAlpha: function() { return o; }, setClearAlpha: function(f) { o = f, g(s, o); }, render: p }; } function eD2(n, e, t13, i) { const r = n.getParameter(34921), s = i.isWebGL2 ? null : e.get("OES_vertex_array_object"), o = i.isWebGL2 || s !== null, a = {}, c = u(null); let l = c; function d(A, P, I, b, O) { let N = false; if (o) { const D = f(b, I, P); l !== D && (l = D, p(l.object)), N = y(b, O), N && v(b, O); } else { const D = P.wireframe === true; (l.geometry !== b.id || l.program !== I.id || l.wireframe !== D) && (l.geometry = b.id, l.program = I.id, l.wireframe = D, N = true); } A.isInstancedMesh === true && (N = true), O !== null && t13.update(O, 34963), N && (x(A, P, I, b), O !== null && n.bindBuffer(34963, t13.get(O).buffer)); } function h6() { return i.isWebGL2 ? n.createVertexArray() : s.createVertexArrayOES(); } function p(A) { return i.isWebGL2 ? n.bindVertexArray(A) : s.bindVertexArrayOES(A); } function g(A) { return i.isWebGL2 ? n.deleteVertexArray(A) : s.deleteVertexArrayOES(A); } function f(A, P, I) { const b = I.wireframe === true; let O = a[A.id]; O === void 0 && (O = {}, a[A.id] = O); let N = O[P.id]; N === void 0 && (N = {}, O[P.id] = N); let D = N[b]; return D === void 0 && (D = u(h6()), N[b] = D), D; } function u(A) { const P = [], I = [], b = []; for (let O = 0; O < r; O++) P[O] = 0, I[O] = 0, b[O] = 0; return { // for backward compatibility on non-VAO support browser geometry: null, program: null, wireframe: false, newAttributes: P, enabledAttributes: I, attributeDivisors: b, object: A, attributes: {}, index: null }; } function y(A, P) { const I = l.attributes, b = A.attributes; let O = 0; for (const N in b) { const D = I[N], B = b[N]; if (D === void 0 || D.attribute !== B || D.data !== B.data) return true; O++; } return l.attributesNum !== O || l.index !== P; } function v(A, P) { const I = {}, b = A.attributes; let O = 0; for (const N in b) { const D = b[N], B = {}; B.attribute = D, D.data && (B.data = D.data), I[N] = B, O++; } l.attributes = I, l.attributesNum = O, l.index = P; } function m() { const A = l.newAttributes; for (let P = 0, I = A.length; P < I; P++) A[P] = 0; } function w(A) { S(A, 0); } function S(A, P) { const I = l.newAttributes, b = l.enabledAttributes, O = l.attributeDivisors; I[A] = 1, b[A] === 0 && (n.enableVertexAttribArray(A), b[A] = 1), O[A] !== P && ((i.isWebGL2 ? n : e.get("ANGLE_instanced_arrays"))[i.isWebGL2 ? "vertexAttribDivisor" : "vertexAttribDivisorANGLE"](A, P), O[A] = P); } function T() { const A = l.newAttributes, P = l.enabledAttributes; for (let I = 0, b = P.length; I < b; I++) P[I] !== A[I] && (n.disableVertexAttribArray(I), P[I] = 0); } function M(A, P, I, b, O, N) { i.isWebGL2 === true && (I === 5124 || I === 5125) ? n.vertexAttribIPointer(A, P, I, O, N) : n.vertexAttribPointer(A, P, I, b, O, N); } function x(A, P, I, b) { if (i.isWebGL2 === false && (A.isInstancedMesh || b.isInstancedBufferGeometry) && e.get("ANGLE_instanced_arrays") === null) return; m(); const O = b.attributes, N = I.getAttributes(), D = P.defaultAttributeValues; for (const B in N) { const U = N[B]; if (U >= 0) { const k = O[B]; if (k !== void 0) { const K = k.normalized, ie = k.itemSize, j = t13.get(k); if (j === void 0) continue; const G = j.buffer, W = j.type, q = j.bytesPerElement; if (k.isInterleavedBufferAttribute) { const Q = k.data, ee = Q.stride, ne = k.offset; Q && Q.isInstancedInterleavedBuffer ? (S(U, Q.meshPerAttribute), b._maxInstanceCount === void 0 && (b._maxInstanceCount = Q.meshPerAttribute * Q.count)) : w(U), n.bindBuffer(34962, G), M(U, ie, W, K, ee * q, ne * q); } else k.isInstancedBufferAttribute ? (S(U, k.meshPerAttribute), b._maxInstanceCount === void 0 && (b._maxInstanceCount = k.meshPerAttribute * k.count)) : w(U), n.bindBuffer(34962, G), M(U, ie, W, K, 0, 0); } else if (B === "instanceMatrix") { const K = t13.get(A.instanceMatrix); if (K === void 0) continue; const ie = K.buffer, j = K.type; S(U + 0, 1), S(U + 1, 1), S(U + 2, 1), S(U + 3, 1), n.bindBuffer(34962, ie), n.vertexAttribPointer(U + 0, 4, j, false, 64, 0), n.vertexAttribPointer(U + 1, 4, j, false, 64, 16), n.vertexAttribPointer(U + 2, 4, j, false, 64, 32), n.vertexAttribPointer(U + 3, 4, j, false, 64, 48); } else if (B === "instanceColor") { const K = t13.get(A.instanceColor); if (K === void 0) continue; const ie = K.buffer, j = K.type; S(U, 1), n.bindBuffer(34962, ie), n.vertexAttribPointer(U, 3, j, false, 12, 0); } else if (D !== void 0) { const K = D[B]; if (K !== void 0) switch (K.length) { case 2: n.vertexAttrib2fv(U, K); break; case 3: n.vertexAttrib3fv(U, K); break; case 4: n.vertexAttrib4fv(U, K); break; default: n.vertexAttrib1fv(U, K); } } } } T(); } function _() { R(); for (const A in a) { const P = a[A]; for (const I in P) { const b = P[I]; for (const O in b) g(b[O].object), delete b[O]; delete P[I]; } delete a[A]; } } function E(A) { if (a[A.id] === void 0) return; const P = a[A.id]; for (const I in P) { const b = P[I]; for (const O in b) g(b[O].object), delete b[O]; delete P[I]; } delete a[A.id]; } function L(A) { for (const P in a) { const I = a[P]; if (I[A.id] === void 0) continue; const b = I[A.id]; for (const O in b) g(b[O].object), delete b[O]; delete I[A.id]; } } function R() { C(), l !== c && (l = c, p(l.object)); } function C() { c.geometry = null, c.program = null, c.wireframe = false; } return { setup: d, reset: R, resetDefaultState: C, dispose: _, releaseStatesOfGeometry: E, releaseStatesOfProgram: L, initAttributes: m, enableAttribute: w, disableUnusedAttributes: T }; } function tD2(n, e, t13, i) { const r = i.isWebGL2; let s; function o(l) { s = l; } function a(l, d) { n.drawArrays(s, l, d), t13.update(d, s, 1); } function c(l, d, h6) { if (h6 === 0) return; let p, g; if (r) p = n, g = "drawArraysInstanced"; else if (p = e.get("ANGLE_instanced_arrays"), g = "drawArraysInstancedANGLE", p === null) { console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."); return; } p[g](s, l, d, h6), t13.update(d, s, h6); } this.setMode = o, this.render = a, this.renderInstances = c; } function nD2(n, e, t13) { let i; function r() { if (i !== void 0) return i; if (e.has("EXT_texture_filter_anisotropic") === true) { const x = e.get("EXT_texture_filter_anisotropic"); i = n.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT); } else i = 0; return i; } function s(x) { if (x === "highp") { if (n.getShaderPrecisionFormat(35633, 36338).precision > 0 && n.getShaderPrecisionFormat(35632, 36338).precision > 0) return "highp"; x = "mediump"; } return x === "mediump" && n.getShaderPrecisionFormat(35633, 36337).precision > 0 && n.getShaderPrecisionFormat(35632, 36337).precision > 0 ? "mediump" : "lowp"; } const o = typeof WebGL2RenderingContext < "u" && n instanceof WebGL2RenderingContext || typeof WebGL2ComputeRenderingContext < "u" && n instanceof WebGL2ComputeRenderingContext; let a = t13.precision !== void 0 ? t13.precision : "highp"; const c = s(a); c !== a && (console.warn("THREE.WebGLRenderer:", a, "not supported, using", c, "instead."), a = c); const l = o || e.has("WEBGL_draw_buffers"), d = t13.logarithmicDepthBuffer === true, h6 = n.getParameter(34930), p = n.getParameter(35660), g = n.getParameter(3379), f = n.getParameter(34076), u = n.getParameter(34921), y = n.getParameter(36347), v = n.getParameter(36348), m = n.getParameter(36349), w = p > 0, S = o || e.has("OES_texture_float"), T = w && S, M = o ? n.getParameter(36183) : 0; return { isWebGL2: o, drawBuffers: l, getMaxAnisotropy: r, getMaxPrecision: s, precision: a, logarithmicDepthBuffer: d, maxTextures: h6, maxVertexTextures: p, maxTextureSize: g, maxCubemapSize: f, maxAttributes: u, maxVertexUniforms: y, maxVaryings: v, maxFragmentUniforms: m, vertexTextures: w, floatFragmentTextures: S, floatVertexTextures: T, maxSamples: M }; } function iD2(n) { const e = this; let t13 = null, i = 0, r = false, s = false; const o = new Li2(), a = new ln2(), c = { value: null, needsUpdate: false }; this.uniform = c, this.numPlanes = 0, this.numIntersection = 0, this.init = function(h6, p, g) { const f = h6.length !== 0 || p || // enable state of previous frame - the clipping code has to // run another frame in order to reset the state: i !== 0 || r; return r = p, t13 = d(h6, g, 0), i = h6.length, f; }, this.beginShadows = function() { s = true, d(null); }, this.endShadows = function() { s = false, l(); }, this.setState = function(h6, p, g) { const f = h6.clippingPlanes, u = h6.clipIntersection, y = h6.clipShadows, v = n.get(h6); if (!r || f === null || f.length === 0 || s && !y) s ? d(null) : l(); else { const m = s ? 0 : i, w = m * 4; let S = v.clippingState || null; c.value = S, S = d(f, p, w, g); for (let T = 0; T !== w; ++T) S[T] = t13[T]; v.clippingState = S, this.numIntersection = u ? this.numPlanes : 0, this.numPlanes += m; } }; function l() { c.value !== t13 && (c.value = t13, c.needsUpdate = i > 0), e.numPlanes = i, e.numIntersection = 0; } function d(h6, p, g, f) { const u = h6 !== null ? h6.length : 0; let y = null; if (u !== 0) { if (y = c.value, f !== true || y === null) { const v = g + u * 4, m = p.matrixWorldInverse; a.getNormalMatrix(m), (y === null || y.length < v) && (y = new Float32Array(v)); for (let w = 0, S = g; w !== u; ++w, S += 4) o.copy(h6[w]).applyMatrix4(m, a), o.normal.toArray(y, S), y[S + 3] = o.constant; } c.value = y, c.needsUpdate = true; } return e.numPlanes = u, e.numIntersection = 0, y; } } function rD2(n) { let e = /* @__PURE__ */ new WeakMap(); function t13(o, a) { return a === Qc2 ? o.mapping = yl : a === eu2 && (o.mapping = bl2), o; } function i(o) { if (o && o.isTexture) { const a = o.mapping; if (a === Qc2 || a === eu2) if (e.has(o)) { const c = e.get(o).texture; return t13(c, o.mapping); } else { const c = o.image; if (c && c.height > 0) { const l = n.getRenderTarget(), d = new Iu2(c.height / 2); return d.fromEquirectangularTexture(n, o), e.set(o, d), n.setRenderTarget(l), o.addEventListener("dispose", r), t13(d.texture, o.mapping); } else return null; } } return o; } function r(o) { const a = o.target; a.removeEventListener("dispose", r); const c = e.get(a); c !== void 0 && (e.delete(a), c.dispose()); } function s() { e = /* @__PURE__ */ new WeakMap(); } return { get: i, dispose: s }; } function sD2(n) { const e = {}; function t13(i) { if (e[i] !== void 0) return e[i]; let r; switch (i) { case "WEBGL_depth_texture": r = n.getExtension("WEBGL_depth_texture") || n.getExtension("MOZ_WEBGL_depth_texture") || n.getExtension("WEBKIT_WEBGL_depth_texture"); break; case "EXT_texture_filter_anisotropic": r = n.getExtension("EXT_texture_filter_anisotropic") || n.getExtension("MOZ_EXT_texture_filter_anisotropic") || n.getExtension("WEBKIT_EXT_texture_filter_anisotropic"); break; case "WEBGL_compressed_texture_s3tc": r = n.getExtension("WEBGL_compressed_texture_s3tc") || n.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"); break; case "WEBGL_compressed_texture_pvrtc": r = n.getExtension("WEBGL_compressed_texture_pvrtc") || n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"); break; default: r = n.getExtension(i); } return e[i] = r, r; } return { has: function(i) { return t13(i) !== null; }, init: function(i) { i.isWebGL2 ? t13("EXT_color_buffer_float") : (t13("WEBGL_depth_texture"), t13("OES_texture_float"), t13("OES_texture_half_float"), t13("OES_texture_half_float_linear"), t13("OES_standard_derivatives"), t13("OES_element_index_uint"), t13("OES_vertex_array_object"), t13("ANGLE_instanced_arrays")), t13("OES_texture_float_linear"), t13("EXT_color_buffer_half_float"); }, get: function(i) { const r = t13(i); return r === null && console.warn("THREE.WebGLRenderer: " + i + " extension not supported."), r; } }; } function oD2(n, e, t13, i) { const r = {}, s = /* @__PURE__ */ new WeakMap(); function o(h6) { const p = h6.target; p.index !== null && e.remove(p.index); for (const f in p.attributes) e.remove(p.attributes[f]); p.removeEventListener("dispose", o), delete r[p.id]; const g = s.get(p); g && (e.remove(g), s.delete(p)), i.releaseStatesOfGeometry(p), p.isInstancedBufferGeometry === true && delete p._maxInstanceCount, t13.memory.geometries--; } function a(h6, p) { return r[p.id] === true || (p.addEventListener("dispose", o), r[p.id] = true, t13.memory.geometries++), p; } function c(h6) { const p = h6.attributes; for (const f in p) e.update(p[f], 34962); const g = h6.morphAttributes; for (const f in g) { const u = g[f]; for (let y = 0, v = u.length; y < v; y++) e.update(u[y], 34962); } } function l(h6) { const p = [], g = h6.index, f = h6.attributes.position; let u = 0; if (g !== null) { const m = g.array; u = g.version; for (let w = 0, S = m.length; w < S; w += 3) { const T = m[w + 0], M = m[w + 1], x = m[w + 2]; p.push(T, M, M, x, x, T); } } else { const m = f.array; u = f.version; for (let w = 0, S = m.length / 3 - 1; w < S; w += 3) { const T = w + 0, M = w + 1, x = w + 2; p.push(T, M, M, x, x, T); } } const y = new (Sx2(p) > 65535 ? Ru2 : Lu2)(p, 1); y.version = u; const v = s.get(h6); v && e.remove(v), s.set(h6, y); } function d(h6) { const p = s.get(h6); if (p) { const g = h6.index; g !== null && p.version < g.version && l(h6); } else l(h6); return s.get(h6); } return { get: a, update: c, getWireframeAttribute: d }; } function aD2(n, e, t13, i) { const r = i.isWebGL2; let s; function o(p) { s = p; } let a, c; function l(p) { a = p.type, c = p.bytesPerElement; } function d(p, g) { n.drawElements(s, g, a, p * c), t13.update(g, s, 1); } function h6(p, g, f) { if (f === 0) return; let u, y; if (r) u = n, y = "drawElementsInstanced"; else if (u = e.get("ANGLE_instanced_arrays"), y = "drawElementsInstancedANGLE", u === null) { console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."); return; } u[y](s, g, a, p * c, f), t13.update(g, s, f); } this.setMode = o, this.setIndex = l, this.render = d, this.renderInstances = h6; } function lD2(n) { const e = { geometries: 0, textures: 0 }, t13 = { frame: 0, calls: 0, triangles: 0, points: 0, lines: 0 }; function i(s, o, a) { switch (t13.calls++, o) { case 4: t13.triangles += a * (s / 3); break; case 1: t13.lines += a * (s / 2); break; case 3: t13.lines += a * (s - 1); break; case 2: t13.lines += a * s; break; case 0: t13.points += a * s; break; default: console.error("THREE.WebGLInfo: Unknown draw mode:", o); break; } } function r() { t13.frame++, t13.calls = 0, t13.triangles = 0, t13.points = 0, t13.lines = 0; } return { memory: e, render: t13, programs: null, autoReset: true, reset: r, update: i }; } function cD2(n, e) { return n[0] - e[0]; } function uD2(n, e) { return Math.abs(e[1]) - Math.abs(n[1]); } function hD2(n) { const e = {}, t13 = new Float32Array(8), i = []; for (let s = 0; s < 8; s++) i[s] = [s, 0]; function r(s, o, a, c) { const l = s.morphTargetInfluences, d = l === void 0 ? 0 : l.length; let h6 = e[o.id]; if (h6 === void 0 || h6.length !== d) { h6 = []; for (let y = 0; y < d; y++) h6[y] = [y, 0]; e[o.id] = h6; } for (let y = 0; y < d; y++) { const v = h6[y]; v[0] = y, v[1] = l[y]; } h6.sort(uD2); for (let y = 0; y < 8; y++) y < d && h6[y][1] ? (i[y][0] = h6[y][0], i[y][1] = h6[y][1]) : (i[y][0] = Number.MAX_SAFE_INTEGER, i[y][1] = 0); i.sort(cD2); const p = a.morphTargets && o.morphAttributes.position, g = a.morphNormals && o.morphAttributes.normal; let f = 0; for (let y = 0; y < 8; y++) { const v = i[y], m = v[0], w = v[1]; m !== Number.MAX_SAFE_INTEGER && w ? (p && o.getAttribute("morphTarget" + y) !== p[m] && o.setAttribute("morphTarget" + y, p[m]), g && o.getAttribute("morphNormal" + y) !== g[m] && o.setAttribute("morphNormal" + y, g[m]), t13[y] = w, f += w) : (p && o.hasAttribute("morphTarget" + y) === true && o.deleteAttribute("morphTarget" + y), g && o.hasAttribute("morphNormal" + y) === true && o.deleteAttribute("morphNormal" + y), t13[y] = 0); } const u = o.morphTargetsRelative ? 1 : 1 - f; c.getUniforms().setValue(n, "morphTargetBaseInfluence", u), c.getUniforms().setValue(n, "morphTargetInfluences", t13); } return { update: r }; } function dD2(n, e, t13, i) { let r = /* @__PURE__ */ new WeakMap(); function s(c) { const l = i.render.frame, d = c.geometry, h6 = e.get(c, d); return r.get(h6) !== l && (e.update(h6), r.set(h6, l)), c.isInstancedMesh && (c.hasEventListener("dispose", a) === false && c.addEventListener("dispose", a), t13.update(c.instanceMatrix, 34962), c.instanceColor !== null && t13.update(c.instanceColor, 34962)), h6; } function o() { r = /* @__PURE__ */ new WeakMap(); } function a(c) { const l = c.target; l.removeEventListener("dispose", a), t13.remove(l.instanceMatrix), l.instanceColor !== null && t13.remove(l.instanceColor); } return { update: s, dispose: o }; } var Kf2 = class extends nn2 { constructor(e = null, t13 = 1, i = 1, r = 1) { super(null), this.image = { data: e, width: t13, height: i, depth: r }, this.magFilter = Kt2, this.minFilter = Kt2, this.wrapR = mn2, this.generateMipmaps = false, this.flipY = false, this.unpackAlignment = 1, this.needsUpdate = true; } }; Kf2.prototype.isDataTexture2DArray = true; var Qf2 = class extends nn2 { constructor(e = null, t13 = 1, i = 1, r = 1) { super(null), this.image = { data: e, width: t13, height: i, depth: r }, this.magFilter = Kt2, this.minFilter = Kt2, this.wrapR = mn2, this.generateMipmaps = false, this.flipY = false, this.unpackAlignment = 1, this.needsUpdate = true; } }; Qf2.prototype.isDataTexture3D = true; var Ex2 = new nn2(); var fD2 = new Kf2(); var pD2 = new Qf2(); var Ax2 = new ca2(); var Tg2 = []; var Eg2 = []; var Ag2 = new Float32Array(16); var Cg2 = new Float32Array(9); var Lg2 = new Float32Array(4); function ua2(n, e, t13) { const i = n[0]; if (i <= 0 || i > 0) return n; const r = e * t13; let s = Tg2[r]; if (s === void 0 && (s = new Float32Array(r), Tg2[r] = s), e !== 0) { i.toArray(s, 0); for (let o = 1, a = 0; o !== e; ++o) a += t13, n[o].toArray(s, a); } return s; } function Nn2(n, e) { if (n.length !== e.length) return false; for (let t13 = 0, i = n.length; t13 < i; t13++) if (n[t13] !== e[t13]) return false; return true; } function Rn2(n, e) { for (let t13 = 0, i = e.length; t13 < i; t13++) n[t13] = e[t13]; } function Cx2(n, e) { let t13 = Eg2[e]; t13 === void 0 && (t13 = new Int32Array(e), Eg2[e] = t13); for (let i = 0; i !== e; ++i) t13[i] = n.allocateTextureUnit(); return t13; } function mD2(n, e) { const t13 = this.cache; t13[0] !== e && (n.uniform1f(this.addr, e), t13[0] = e); } function gD2(n, e) { const t13 = this.cache; if (e.x !== void 0) (t13[0] !== e.x || t13[1] !== e.y) && (n.uniform2f(this.addr, e.x, e.y), t13[0] = e.x, t13[1] = e.y); else { if (Nn2(t13, e)) return; n.uniform2fv(this.addr, e), Rn2(t13, e); } } function vD2(n, e) { const t13 = this.cache; if (e.x !== void 0) (t13[0] !== e.x || t13[1] !== e.y || t13[2] !== e.z) && (n.uniform3f(this.addr, e.x, e.y, e.z), t13[0] = e.x, t13[1] = e.y, t13[2] = e.z); else if (e.r !== void 0) (t13[0] !== e.r || t13[1] !== e.g || t13[2] !== e.b) && (n.uniform3f(this.addr, e.r, e.g, e.b), t13[0] = e.r, t13[1] = e.g, t13[2] = e.b); else { if (Nn2(t13, e)) return; n.uniform3fv(this.addr, e), Rn2(t13, e); } } function yD2(n, e) { const t13 = this.cache; if (e.x !== void 0) (t13[0] !== e.x || t13[1] !== e.y || t13[2] !== e.z || t13[3] !== e.w) && (n.uniform4f(this.addr, e.x, e.y, e.z, e.w), t13[0] = e.x, t13[1] = e.y, t13[2] = e.z, t13[3] = e.w); else { if (Nn2(t13, e)) return; n.uniform4fv(this.addr, e), Rn2(t13, e); } } function bD2(n, e) { const t13 = this.cache, i = e.elements; if (i === void 0) { if (Nn2(t13, e)) return; n.uniformMatrix2fv(this.addr, false, e), Rn2(t13, e); } else { if (Nn2(t13, i)) return; Lg2.set(i), n.uniformMatrix2fv(this.addr, false, Lg2), Rn2(t13, i); } } function xD2(n, e) { const t13 = this.cache, i = e.elements; if (i === void 0) { if (Nn2(t13, e)) return; n.uniformMatrix3fv(this.addr, false, e), Rn2(t13, e); } else { if (Nn2(t13, i)) return; Cg2.set(i), n.uniformMatrix3fv(this.addr, false, Cg2), Rn2(t13, i); } } function wD2(n, e) { const t13 = this.cache, i = e.elements; if (i === void 0) { if (Nn2(t13, e)) return; n.uniformMatrix4fv(this.addr, false, e), Rn2(t13, e); } else { if (Nn2(t13, i)) return; Ag2.set(i), n.uniformMatrix4fv(this.addr, false, Ag2), Rn2(t13, i); } } function MD2(n, e) { const t13 = this.cache; t13[0] !== e && (n.uniform1i(this.addr, e), t13[0] = e); } function SD2(n, e) { const t13 = this.cache; Nn2(t13, e) || (n.uniform2iv(this.addr, e), Rn2(t13, e)); } function _D2(n, e) { const t13 = this.cache; Nn2(t13, e) || (n.uniform3iv(this.addr, e), Rn2(t13, e)); } function TD2(n, e) { const t13 = this.cache; Nn2(t13, e) || (n.uniform4iv(this.addr, e), Rn2(t13, e)); } function ED2(n, e) { const t13 = this.cache; t13[0] !== e && (n.uniform1ui(this.addr, e), t13[0] = e); } function AD2(n, e) { const t13 = this.cache; Nn2(t13, e) || (n.uniform2uiv(this.addr, e), Rn2(t13, e)); } function CD2(n, e) { const t13 = this.cache; Nn2(t13, e) || (n.uniform3uiv(this.addr, e), Rn2(t13, e)); } function LD2(n, e) { const t13 = this.cache; Nn2(t13, e) || (n.uniform4uiv(this.addr, e), Rn2(t13, e)); } function RD2(n, e, t13) { const i = this.cache, r = t13.allocateTextureUnit(); i[0] !== r && (n.uniform1i(this.addr, r), i[0] = r), t13.safeSetTexture2D(e || Ex2, r); } function PD2(n, e, t13) { const i = this.cache, r = t13.allocateTextureUnit(); i[0] !== r && (n.uniform1i(this.addr, r), i[0] = r), t13.setTexture3D(e || pD2, r); } function ID2(n, e, t13) { const i = this.cache, r = t13.allocateTextureUnit(); i[0] !== r && (n.uniform1i(this.addr, r), i[0] = r), t13.safeSetTextureCube(e || Ax2, r); } function OD2(n, e, t13) { const i = this.cache, r = t13.allocateTextureUnit(); i[0] !== r && (n.uniform1i(this.addr, r), i[0] = r), t13.setTexture2DArray(e || fD2, r); } function DD2(n) { switch (n) { case 5126: return mD2; case 35664: return gD2; case 35665: return vD2; case 35666: return yD2; case 35674: return bD2; case 35675: return xD2; case 35676: return wD2; case 5124: case 35670: return MD2; case 35667: case 35671: return SD2; case 35668: case 35672: return _D2; case 35669: case 35673: return TD2; case 5125: return ED2; case 36294: return AD2; case 36295: return CD2; case 36296: return LD2; case 35678: case 36198: case 36298: case 36306: case 35682: return RD2; case 35679: case 36299: case 36307: return PD2; case 35680: case 36300: case 36308: case 36293: return ID2; case 36289: case 36303: case 36311: case 36292: return OD2; } } function ND2(n, e) { n.uniform1fv(this.addr, e); } function FD2(n, e) { const t13 = ua2(e, this.size, 2); n.uniform2fv(this.addr, t13); } function BD2(n, e) { const t13 = ua2(e, this.size, 3); n.uniform3fv(this.addr, t13); } function zD2(n, e) { const t13 = ua2(e, this.size, 4); n.uniform4fv(this.addr, t13); } function UD2(n, e) { const t13 = ua2(e, this.size, 4); n.uniformMatrix2fv(this.addr, false, t13); } function VD2(n, e) { const t13 = ua2(e, this.size, 9); n.uniformMatrix3fv(this.addr, false, t13); } function kD2(n, e) { const t13 = ua2(e, this.size, 16); n.uniformMatrix4fv(this.addr, false, t13); } function GD2(n, e) { n.uniform1iv(this.addr, e); } function HD2(n, e) { n.uniform2iv(this.addr, e); } function WD2(n, e) { n.uniform3iv(this.addr, e); } function jD2(n, e) { n.uniform4iv(this.addr, e); } function $D2(n, e) { n.uniform1uiv(this.addr, e); } function ZD2(n, e) { n.uniform2uiv(this.addr, e); } function XD2(n, e) { n.uniform3uiv(this.addr, e); } function YD2(n, e) { n.uniform4uiv(this.addr, e); } function JD2(n, e, t13) { const i = e.length, r = Cx2(t13, i); n.uniform1iv(this.addr, r); for (let s = 0; s !== i; ++s) t13.safeSetTexture2D(e[s] || Ex2, r[s]); } function qD2(n, e, t13) { const i = e.length, r = Cx2(t13, i); n.uniform1iv(this.addr, r); for (let s = 0; s !== i; ++s) t13.safeSetTextureCube(e[s] || Ax2, r[s]); } function KD2(n) { switch (n) { case 5126: return ND2; case 35664: return FD2; case 35665: return BD2; case 35666: return zD2; case 35674: return UD2; case 35675: return VD2; case 35676: return kD2; case 5124: case 35670: return GD2; case 35667: case 35671: return HD2; case 35668: case 35672: return WD2; case 35669: case 35673: return jD2; case 5125: return $D2; case 36294: return ZD2; case 36295: return XD2; case 36296: return YD2; case 35678: case 36198: case 36298: case 36306: case 35682: return JD2; case 35680: case 36300: case 36308: case 36293: return qD2; } } function QD2(n, e, t13) { this.id = n, this.addr = t13, this.cache = [], this.setValue = DD2(e.type); } function Lx2(n, e, t13) { this.id = n, this.addr = t13, this.cache = [], this.size = e.size, this.setValue = KD2(e.type); } Lx2.prototype.updateCache = function(n) { const e = this.cache; n instanceof Float32Array && e.length !== n.length && (this.cache = new Float32Array(n.length)), Rn2(e, n); }; function Rx2(n) { this.id = n, this.seq = [], this.map = {}; } Rx2.prototype.setValue = function(n, e, t13) { const i = this.seq; for (let r = 0, s = i.length; r !== s; ++r) { const o = i[r]; o.setValue(n, e[o.id], t13); } }; var Ch2 = /(\w+)(\])?(\[|\.)?/g; function Rg2(n, e) { n.seq.push(e), n.map[e.id] = e; } function eN(n, e, t13) { const i = n.name, r = i.length; for (Ch2.lastIndex = 0; ; ) { const s = Ch2.exec(i), o = Ch2.lastIndex; let a = s[1]; const c = s[2] === "]", l = s[3]; if (c && (a = a | 0), l === void 0 || l === "[" && o + 2 === r) { Rg2(t13, l === void 0 ? new QD2(a, n, e) : new Lx2(a, n, e)); break; } else { let h6 = t13.map[a]; h6 === void 0 && (h6 = new Rx2(a), Rg2(t13, h6)), t13 = h6; } } } function kr2(n, e) { this.seq = [], this.map = {}; const t13 = n.getProgramParameter(e, 35718); for (let i = 0; i < t13; ++i) { const r = n.getActiveUniform(e, i), s = n.getUniformLocation(e, r.name); eN(r, s, this); } } kr2.prototype.setValue = function(n, e, t13, i) { const r = this.map[e]; r !== void 0 && r.setValue(n, t13, i); }; kr2.prototype.setOptional = function(n, e, t13) { const i = e[t13]; i !== void 0 && this.setValue(n, t13, i); }; kr2.upload = function(n, e, t13, i) { for (let r = 0, s = e.length; r !== s; ++r) { const o = e[r], a = t13[o.id]; a.needsUpdate !== false && o.setValue(n, a.value, i); } }; kr2.seqWithValue = function(n, e) { const t13 = []; for (let i = 0, r = n.length; i !== r; ++i) { const s = n[i]; s.id in e && t13.push(s); } return t13; }; function Pg2(n, e, t13) { const i = n.createShader(e); return n.shaderSource(i, t13), n.compileShader(i), i; } var tN = 0; function nN(n) { const e = n.split(` `); for (let t13 = 0; t13 < e.length; t13++) e[t13] = t13 + 1 + ": " + e[t13]; return e.join(` `); } function Px2(n) { switch (n) { case Dn2: return ["Linear", "( value )"]; case Os2: return ["sRGB", "( value )"]; case Cu2: return ["RGBE", "( value )"]; case $f2: return ["RGBM", "( value, 7.0 )"]; case Zf2: return ["RGBM", "( value, 16.0 )"]; case Xf2: return ["RGBD", "( value, 256.0 )"]; case Au2: return ["Gamma", "( value, float( GAMMA_FACTOR ) )"]; case ax2: return ["LogLuv", "( value )"]; default: return console.warn("THREE.WebGLProgram: Unsupported encoding:", n), ["Linear", "( value )"]; } } function Ig2(n, e, t13) { const i = n.getShaderParameter(e, 35713), r = n.getShaderInfoLog(e).trim(); if (i && r === "") return ""; const s = n.getShaderSource(e); return "THREE.WebGLShader: gl.getShaderInfoLog() " + t13 + ` ` + r + nN(s); } function Sa2(n, e) { const t13 = Px2(e); return "vec4 " + n + "( vec4 value ) { return " + t13[0] + "ToLinear" + t13[1] + "; }"; } function iN(n, e) { const t13 = Px2(e); return "vec4 " + n + "( vec4 value ) { return LinearTo" + t13[0] + t13[1] + "; }"; } function rN(n, e) { let t13; switch (e) { case sb2: t13 = "Linear"; break; case ob2: t13 = "Reinhard"; break; case ab2: t13 = "OptimizedCineon"; break; case lb2: t13 = "ACESFilmic"; break; case cb2: t13 = "Custom"; break; default: console.warn("THREE.WebGLProgram: Unsupported toneMapping:", e), t13 = "Linear"; } return "vec3 " + n + "( vec3 color ) { return " + t13 + "ToneMapping( color ); }"; } function sN(n) { return [ n.extensionDerivatives || n.envMapCubeUV || n.bumpMap || n.tangentSpaceNormalMap || n.clearcoatNormalMap || n.flatShading || n.shaderID === "physical" ? "#extension GL_OES_standard_derivatives : enable" : "", (n.extensionFragDepth || n.logarithmicDepthBuffer) && n.rendererExtensionFragDepth ? "#extension GL_EXT_frag_depth : enable" : "", n.extensionDrawBuffers && n.rendererExtensionDrawBuffers ? "#extension GL_EXT_draw_buffers : require" : "", (n.extensionShaderTextureLOD || n.envMap || n.transmission > 0) && n.rendererExtensionShaderTextureLod ? "#extension GL_EXT_shader_texture_lod : enable" : "" ].filter(Da2).join(` `); } function oN(n) { const e = []; for (const t13 in n) { const i = n[t13]; i !== false && e.push("#define " + t13 + " " + i); } return e.join(` `); } function aN(n, e) { const t13 = {}, i = n.getProgramParameter(e, 35721); for (let r = 0; r < i; r++) { const o = n.getActiveAttrib(e, r).name; t13[o] = n.getAttribLocation(e, o); } return t13; } function Da2(n) { return n !== ""; } function Og2(n, e) { return n.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 Dg2(n, e) { return n.replace(/NUM_CLIPPING_PLANES/g, e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g, e.numClippingPlanes - e.numClipIntersection); } var lN = /^[ \t]*#include +<([\w\d./]+)>/gm; function Bd2(n) { return n.replace(lN, cN); } function cN(n, e) { const t13 = ct2[e]; if (t13 === void 0) throw new Error("Can not resolve #include <" + e + ">"); return Bd2(t13); } var uN = /#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g; var hN = /#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 Ng2(n) { return n.replace(hN, Ix2).replace(uN, dN); } function dN(n, e, t13, i) { return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."), Ix2(n, e, t13, i); } function Ix2(n, e, t13, i) { let r = ""; for (let s = parseInt(e); s < parseInt(t13); s++) r += i.replace(/\[\s*i\s*\]/g, "[ " + s + " ]").replace(/UNROLLED_LOOP_INDEX/g, s); return r; } function Fg2(n) { let e = "precision " + n.precision + ` float; precision ` + n.precision + " int;"; return n.precision === "highp" ? e += ` #define HIGH_PRECISION` : n.precision === "mediump" ? e += ` #define MEDIUM_PRECISION` : n.precision === "lowp" && (e += ` #define LOW_PRECISION`), e; } function fN(n) { let e = "SHADOWMAP_TYPE_BASIC"; return n.shadowMapType === Vf2 ? e = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === By2 ? e = "SHADOWMAP_TYPE_PCF_SOFT" : n.shadowMapType === wo2 && (e = "SHADOWMAP_TYPE_VSM"), e; } function pN(n) { let e = "ENVMAP_TYPE_CUBE"; if (n.envMap) switch (n.envMapMode) { case yl: case bl2: e = "ENVMAP_TYPE_CUBE"; break; case la2: case xl2: e = "ENVMAP_TYPE_CUBE_UV"; break; } return e; } function mN(n) { let e = "ENVMAP_MODE_REFLECTION"; if (n.envMap) switch (n.envMapMode) { case bl2: case xl2: e = "ENVMAP_MODE_REFRACTION"; break; } return e; } function gN(n) { let e = "ENVMAP_BLENDING_NONE"; if (n.envMap) switch (n.combine) { case vl2: e = "ENVMAP_BLENDING_MULTIPLY"; break; case ib2: e = "ENVMAP_BLENDING_MIX"; break; case rb2: e = "ENVMAP_BLENDING_ADD"; break; } return e; } function vN(n, e, t13, i) { const r = n.getContext(), s = t13.defines; let o = t13.vertexShader, a = t13.fragmentShader; const c = fN(t13), l = pN(t13), d = mN(t13), h6 = gN(t13), p = n.gammaFactor > 0 ? n.gammaFactor : 1, g = t13.isWebGL2 ? "" : sN(t13), f = oN(s), u = r.createProgram(); let y, v, m = t13.glslVersion ? "#version " + t13.glslVersion + ` ` : ""; t13.isRawShaderMaterial ? (y = [ f ].filter(Da2).join(` `), y.length > 0 && (y += ` `), v = [ g, f ].filter(Da2).join(` `), v.length > 0 && (v += ` `)) : (y = [ Fg2(t13), "#define SHADER_NAME " + t13.shaderName, f, t13.instancing ? "#define USE_INSTANCING" : "", t13.instancingColor ? "#define USE_INSTANCING_COLOR" : "", t13.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "", "#define GAMMA_FACTOR " + p, "#define MAX_BONES " + t13.maxBones, t13.useFog && t13.fog ? "#define USE_FOG" : "", t13.useFog && t13.fogExp2 ? "#define FOG_EXP2" : "", t13.map ? "#define USE_MAP" : "", t13.envMap ? "#define USE_ENVMAP" : "", t13.envMap ? "#define " + d : "", t13.lightMap ? "#define USE_LIGHTMAP" : "", t13.aoMap ? "#define USE_AOMAP" : "", t13.emissiveMap ? "#define USE_EMISSIVEMAP" : "", t13.bumpMap ? "#define USE_BUMPMAP" : "", t13.normalMap ? "#define USE_NORMALMAP" : "", t13.normalMap && t13.objectSpaceNormalMap ? "#define OBJECTSPACE_NORMALMAP" : "", t13.normalMap && t13.tangentSpaceNormalMap ? "#define TANGENTSPACE_NORMALMAP" : "", t13.clearcoatMap ? "#define USE_CLEARCOATMAP" : "", t13.clearcoatRoughnessMap ? "#define USE_CLEARCOAT_ROUGHNESSMAP" : "", t13.clearcoatNormalMap ? "#define USE_CLEARCOAT_NORMALMAP" : "", t13.displacementMap && t13.supportsVertexTextures ? "#define USE_DISPLACEMENTMAP" : "", t13.specularMap ? "#define USE_SPECULARMAP" : "", t13.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", t13.metalnessMap ? "#define USE_METALNESSMAP" : "", t13.alphaMap ? "#define USE_ALPHAMAP" : "", t13.transmission ? "#define USE_TRANSMISSION" : "", t13.transmissionMap ? "#define USE_TRANSMISSIONMAP" : "", t13.thicknessMap ? "#define USE_THICKNESSMAP" : "", t13.vertexTangents ? "#define USE_TANGENT" : "", t13.vertexColors ? "#define USE_COLOR" : "", t13.vertexAlphas ? "#define USE_COLOR_ALPHA" : "", t13.vertexUvs ? "#define USE_UV" : "", t13.uvsVertexOnly ? "#define UVS_VERTEX_ONLY" : "", t13.flatShading ? "#define FLAT_SHADED" : "", t13.skinning ? "#define USE_SKINNING" : "", t13.useVertexTexture ? "#define BONE_TEXTURE" : "", t13.morphTargets ? "#define USE_MORPHTARGETS" : "", t13.morphNormals && t13.flatShading === false ? "#define USE_MORPHNORMALS" : "", t13.doubleSided ? "#define DOUBLE_SIDED" : "", t13.flipSided ? "#define FLIP_SIDED" : "", t13.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", t13.shadowMapEnabled ? "#define " + c : "", t13.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", t13.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", t13.logarithmicDepthBuffer && t13.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(Da2).join(` `), v = [ g, Fg2(t13), "#define SHADER_NAME " + t13.shaderName, f, t13.alphaTest ? "#define ALPHATEST " + t13.alphaTest + (t13.alphaTest % 1 ? "" : ".0") : "", // add '.0' if integer "#define GAMMA_FACTOR " + p, t13.useFog && t13.fog ? "#define USE_FOG" : "", t13.useFog && t13.fogExp2 ? "#define FOG_EXP2" : "", t13.map ? "#define USE_MAP" : "", t13.matcap ? "#define USE_MATCAP" : "", t13.envMap ? "#define USE_ENVMAP" : "", t13.envMap ? "#define " + l : "", t13.envMap ? "#define " + d : "", t13.envMap ? "#define " + h6 : "", t13.lightMap ? "#define USE_LIGHTMAP" : "", t13.aoMap ? "#define USE_AOMAP" : "", t13.emissiveMap ? "#define USE_EMISSIVEMAP" : "", t13.bumpMap ? "#define USE_BUMPMAP" : "", t13.normalMap ? "#define USE_NORMALMAP" : "", t13.normalMap && t13.objectSpaceNormalMap ? "#define OBJECTSPACE_NORMALMAP" : "", t13.normalMap && t13.tangentSpaceNormalMap ? "#define TANGENTSPACE_NORMALMAP" : "", t13.clearcoatMap ? "#define USE_CLEARCOATMAP" : "", t13.clearcoatRoughnessMap ? "#define USE_CLEARCOAT_ROUGHNESSMAP" : "", t13.clearcoatNormalMap ? "#define USE_CLEARCOAT_NORMALMAP" : "", t13.specularMap ? "#define USE_SPECULARMAP" : "", t13.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", t13.metalnessMap ? "#define USE_METALNESSMAP" : "", t13.alphaMap ? "#define USE_ALPHAMAP" : "", t13.sheen ? "#define USE_SHEEN" : "", t13.transmission ? "#define USE_TRANSMISSION" : "", t13.transmissionMap ? "#define USE_TRANSMISSIONMAP" : "", t13.thicknessMap ? "#define USE_THICKNESSMAP" : "", t13.vertexTangents ? "#define USE_TANGENT" : "", t13.vertexColors || t13.instancingColor ? "#define USE_COLOR" : "", t13.vertexAlphas ? "#define USE_COLOR_ALPHA" : "", t13.vertexUvs ? "#define USE_UV" : "", t13.uvsVertexOnly ? "#define UVS_VERTEX_ONLY" : "", t13.gradientMap ? "#define USE_GRADIENTMAP" : "", t13.flatShading ? "#define FLAT_SHADED" : "", t13.doubleSided ? "#define DOUBLE_SIDED" : "", t13.flipSided ? "#define FLIP_SIDED" : "", t13.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", t13.shadowMapEnabled ? "#define " + c : "", t13.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", t13.physicallyCorrectLights ? "#define PHYSICALLY_CORRECT_LIGHTS" : "", t13.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", t13.logarithmicDepthBuffer && t13.rendererExtensionFragDepth ? "#define USE_LOGDEPTHBUF_EXT" : "", (t13.extensionShaderTextureLOD || t13.envMap) && t13.rendererExtensionShaderTextureLod ? "#define TEXTURE_LOD_EXT" : "", "uniform mat4 viewMatrix;", "uniform vec3 cameraPosition;", "uniform bool isOrthographic;", t13.toneMapping !== Vr2 ? "#define TONE_MAPPING" : "", t13.toneMapping !== Vr2 ? ct2.tonemapping_pars_fragment : "", // this code is required here because it is used by the toneMapping() function defined below t13.toneMapping !== Vr2 ? rN("toneMapping", t13.toneMapping) : "", t13.dithering ? "#define DITHERING" : "", ct2.encodings_pars_fragment, // this code is required here because it is used by the various encoding/decoding function defined below t13.map ? Sa2("mapTexelToLinear", t13.mapEncoding) : "", t13.matcap ? Sa2("matcapTexelToLinear", t13.matcapEncoding) : "", t13.envMap ? Sa2("envMapTexelToLinear", t13.envMapEncoding) : "", t13.emissiveMap ? Sa2("emissiveMapTexelToLinear", t13.emissiveMapEncoding) : "", t13.lightMap ? Sa2("lightMapTexelToLinear", t13.lightMapEncoding) : "", iN("linearToOutputTexel", t13.outputEncoding), t13.depthPacking ? "#define DEPTH_PACKING " + t13.depthPacking : "", ` ` ].filter(Da2).join(` `)), o = Bd2(o), o = Og2(o, t13), o = Dg2(o, t13), a = Bd2(a), a = Og2(a, t13), a = Dg2(a, t13), o = Ng2(o), a = Ng2(a), t13.isWebGL2 && t13.isRawShaderMaterial !== true && (m = `#version 300 es `, y = [ "#define attribute in", "#define varying out", "#define texture2D texture" ].join(` `) + ` ` + y, v = [ "#define varying in", t13.glslVersion === Dd2 ? "" : "out highp vec4 pc_fragColor;", t13.glslVersion === Dd2 ? "" : "#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(` `) + ` ` + v); const w = m + y + o, S = m + v + a, T = Pg2(r, 35633, w), M = Pg2(r, 35632, S); if (r.attachShader(u, T), r.attachShader(u, M), t13.index0AttributeName !== void 0 ? r.bindAttribLocation(u, 0, t13.index0AttributeName) : t13.morphTargets === true && r.bindAttribLocation(u, 0, "position"), r.linkProgram(u), n.debug.checkShaderErrors) { const E = r.getProgramInfoLog(u).trim(), L = r.getShaderInfoLog(T).trim(), R = r.getShaderInfoLog(M).trim(); let C = true, A = true; if (r.getProgramParameter(u, 35714) === false) { C = false; const P = Ig2(r, T, "vertex"), I = Ig2(r, M, "fragment"); console.error("THREE.WebGLProgram: shader error: ", r.getError(), "35715", r.getProgramParameter(u, 35715), "gl.getProgramInfoLog", E, P, I); } else E !== "" ? console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()", E) : (L === "" || R === "") && (A = false); A && (this.diagnostics = { runnable: C, programLog: E, vertexShader: { log: L, prefix: y }, fragmentShader: { log: R, prefix: v } }); } r.deleteShader(T), r.deleteShader(M); let x; this.getUniforms = function() { return x === void 0 && (x = new kr2(r, u)), x; }; let _; return this.getAttributes = function() { return _ === void 0 && (_ = aN(r, u)), _; }, this.destroy = function() { i.releaseStatesOfProgram(this), r.deleteProgram(u), this.program = void 0; }, this.name = t13.shaderName, this.id = tN++, this.cacheKey = e, this.usedTimes = 1, this.program = u, this.vertexShader = T, this.fragmentShader = M, this; } function yN(n, e, t13, i, r, s) { const o = [], a = i.isWebGL2, c = i.logarithmicDepthBuffer, l = i.floatVertexTextures, d = i.maxVertexUniforms, h6 = i.vertexTextures; let p = i.precision; const g = { 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" }, f = [ "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 u(M) { const _ = M.skeleton.bones; if (l) return 1024; { const L = Math.floor((d - 20) / 4), R = Math.min(L, _.length); return R < _.length ? (console.warn("THREE.WebGLRenderer: Skeleton has " + _.length + " bones. This GPU supports " + R + "."), 0) : R; } } function y(M) { let x; return M && M.isTexture ? x = M.encoding : M && M.isWebGLRenderTarget ? (console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."), x = M.texture.encoding) : x = Dn2, x; } function v(M, x, _, E, L) { const R = E.fog, C = M.isMeshStandardMaterial ? E.environment : null, A = e.get(M.envMap || C), P = g[M.type], I = L.isSkinnedMesh ? u(L) : 0; M.precision !== null && (p = i.getMaxPrecision(M.precision), p !== M.precision && console.warn("THREE.WebGLProgram.getParameters:", M.precision, "not supported, using", p, "instead.")); let b, O; if (P) { const B = gi2[P]; b = B.vertexShader, O = B.fragmentShader; } else b = M.vertexShader, O = M.fragmentShader; const N = n.getRenderTarget(); return { isWebGL2: a, shaderID: P, shaderName: M.type, vertexShader: b, fragmentShader: O, defines: M.defines, isRawShaderMaterial: M.isRawShaderMaterial === true, glslVersion: M.glslVersion, precision: p, instancing: L.isInstancedMesh === true, instancingColor: L.isInstancedMesh === true && L.instanceColor !== null, supportsVertexTextures: h6, outputEncoding: N !== null ? y(N.texture) : n.outputEncoding, map: !!M.map, mapEncoding: y(M.map), matcap: !!M.matcap, matcapEncoding: y(M.matcap), envMap: !!A, envMapMode: A && A.mapping, envMapEncoding: y(A), envMapCubeUV: !!A && (A.mapping === la2 || A.mapping === xl2), lightMap: !!M.lightMap, lightMapEncoding: y(M.lightMap), aoMap: !!M.aoMap, emissiveMap: !!M.emissiveMap, emissiveMapEncoding: y(M.emissiveMap), bumpMap: !!M.bumpMap, normalMap: !!M.normalMap, objectSpaceNormalMap: M.normalMapType === ux2, tangentSpaceNormalMap: M.normalMapType === ts2, clearcoatMap: !!M.clearcoatMap, clearcoatRoughnessMap: !!M.clearcoatRoughnessMap, clearcoatNormalMap: !!M.clearcoatNormalMap, displacementMap: !!M.displacementMap, roughnessMap: !!M.roughnessMap, metalnessMap: !!M.metalnessMap, specularMap: !!M.specularMap, alphaMap: !!M.alphaMap, gradientMap: !!M.gradientMap, sheen: !!M.sheen, transmission: !!M.transmission, transmissionMap: !!M.transmissionMap, thicknessMap: !!M.thicknessMap, combine: M.combine, vertexTangents: M.normalMap && M.vertexTangents, vertexColors: M.vertexColors, vertexAlphas: M.vertexColors === true && L.geometry && L.geometry.attributes.color && L.geometry.attributes.color.itemSize === 4, vertexUvs: !!M.map || !!M.bumpMap || !!M.normalMap || !!M.specularMap || !!M.alphaMap || !!M.emissiveMap || !!M.roughnessMap || !!M.metalnessMap || !!M.clearcoatMap || !!M.clearcoatRoughnessMap || !!M.clearcoatNormalMap || !!M.displacementMap || !!M.transmissionMap || !!M.thicknessMap, uvsVertexOnly: !(M.map || M.bumpMap || M.normalMap || M.specularMap || M.alphaMap || M.emissiveMap || M.roughnessMap || M.metalnessMap || M.clearcoatNormalMap || M.transmission || M.transmissionMap || M.thicknessMap) && !!M.displacementMap, fog: !!R, useFog: M.fog, fogExp2: R && R.isFogExp2, flatShading: !!M.flatShading, sizeAttenuation: M.sizeAttenuation, logarithmicDepthBuffer: c, skinning: L.isSkinnedMesh === true && I > 0, maxBones: I, useVertexTexture: l, morphTargets: M.morphTargets, morphNormals: M.morphNormals, numDirLights: x.directional.length, numPointLights: x.point.length, numSpotLights: x.spot.length, numRectAreaLights: x.rectArea.length, numHemiLights: x.hemi.length, numDirLightShadows: x.directionalShadowMap.length, numPointLightShadows: x.pointShadowMap.length, numSpotLightShadows: x.spotShadowMap.length, numClippingPlanes: s.numPlanes, numClipIntersection: s.numIntersection, dithering: M.dithering, shadowMapEnabled: n.shadowMap.enabled && _.length > 0, shadowMapType: n.shadowMap.type, toneMapping: M.toneMapped ? n.toneMapping : Vr2, physicallyCorrectLights: n.physicallyCorrectLights, premultipliedAlpha: M.premultipliedAlpha, alphaTest: M.alphaTest, doubleSided: M.side === Yr2, flipSided: M.side === qt2, depthPacking: M.depthPacking !== void 0 ? M.depthPacking : false, index0AttributeName: M.index0AttributeName, extensionDerivatives: M.extensions && M.extensions.derivatives, extensionFragDepth: M.extensions && M.extensions.fragDepth, extensionDrawBuffers: M.extensions && M.extensions.drawBuffers, extensionShaderTextureLOD: M.extensions && M.extensions.shaderTextureLOD, rendererExtensionFragDepth: a || t13.has("EXT_frag_depth"), rendererExtensionDrawBuffers: a || t13.has("WEBGL_draw_buffers"), rendererExtensionShaderTextureLod: a || t13.has("EXT_shader_texture_lod"), customProgramCacheKey: M.customProgramCacheKey() }; } function m(M) { const x = []; if (M.shaderID ? x.push(M.shaderID) : (x.push(M.fragmentShader), x.push(M.vertexShader)), M.defines !== void 0) for (const _ in M.defines) x.push(_), x.push(M.defines[_]); if (M.isRawShaderMaterial === false) { for (let _ = 0; _ < f.length; _++) x.push(M[f[_]]); x.push(n.outputEncoding), x.push(n.gammaFactor); } return x.push(M.customProgramCacheKey), x.join(); } function w(M) { const x = g[M.type]; let _; if (x) { const E = gi2[x]; _ = _x2.clone(E.uniforms); } else _ = M.uniforms; return _; } function S(M, x) { let _; for (let E = 0, L = o.length; E < L; E++) { const R = o[E]; if (R.cacheKey === x) { _ = R, ++_.usedTimes; break; } } return _ === void 0 && (_ = new vN(n, x, M, r), o.push(_)), _; } function T(M) { if (--M.usedTimes === 0) { const x = o.indexOf(M); o[x] = o[o.length - 1], o.pop(), M.destroy(); } } return { getParameters: v, getProgramCacheKey: m, getUniforms: w, acquireProgram: S, releaseProgram: T, // Exposed for resource monitoring & error feedback via renderer.info: programs: o }; } function bN() { let n = /* @__PURE__ */ new WeakMap(); function e(s) { let o = n.get(s); return o === void 0 && (o = {}, n.set(s, o)), o; } function t13(s) { n.delete(s); } function i(s, o, a) { n.get(s)[o] = a; } function r() { n = /* @__PURE__ */ new WeakMap(); } return { get: e, remove: t13, update: i, dispose: r }; } function xN(n, e) { return n.groupOrder !== e.groupOrder ? n.groupOrder - e.groupOrder : n.renderOrder !== e.renderOrder ? n.renderOrder - e.renderOrder : n.program !== e.program ? n.program.id - e.program.id : n.material.id !== e.material.id ? n.material.id - e.material.id : n.z !== e.z ? n.z - e.z : n.id - e.id; } function Bg2(n, e) { return n.groupOrder !== e.groupOrder ? n.groupOrder - e.groupOrder : n.renderOrder !== e.renderOrder ? n.renderOrder - e.renderOrder : n.z !== e.z ? e.z - n.z : n.id - e.id; } function zg2(n) { const e = []; let t13 = 0; const i = [], r = [], s = [], o = { id: -1 }; function a() { t13 = 0, i.length = 0, r.length = 0, s.length = 0; } function c(g, f, u, y, v, m) { let w = e[t13]; const S = n.get(u); return w === void 0 ? (w = { id: g.id, object: g, geometry: f, material: u, program: S.program || o, groupOrder: y, renderOrder: g.renderOrder, z: v, group: m }, e[t13] = w) : (w.id = g.id, w.object = g, w.geometry = f, w.material = u, w.program = S.program || o, w.groupOrder = y, w.renderOrder = g.renderOrder, w.z = v, w.group = m), t13++, w; } function l(g, f, u, y, v, m) { const w = c(g, f, u, y, v, m); u.transmission > 0 ? r.push(w) : u.transparent === true ? s.push(w) : i.push(w); } function d(g, f, u, y, v, m) { const w = c(g, f, u, y, v, m); u.transmission > 0 ? r.unshift(w) : u.transparent === true ? s.unshift(w) : i.unshift(w); } function h6(g, f) { i.length > 1 && i.sort(g || xN), r.length > 1 && r.sort(f || Bg2), s.length > 1 && s.sort(f || Bg2); } function p() { for (let g = t13, f = e.length; g < f; g++) { const u = e[g]; if (u.id === null) break; u.id = null, u.object = null, u.geometry = null, u.material = null, u.program = null, u.group = null; } } return { opaque: i, transmissive: r, transparent: s, init: a, push: l, unshift: d, finish: p, sort: h6 }; } function wN(n) { let e = /* @__PURE__ */ new WeakMap(); function t13(r, s) { let o; return e.has(r) === false ? (o = new zg2(n), e.set(r, [o])) : s >= e.get(r).length ? (o = new zg2(n), e.get(r).push(o)) : o = e.get(r)[s], o; } function i() { e = /* @__PURE__ */ new WeakMap(); } return { get: t13, dispose: i }; } function MN() { const n = {}; return { get: function(e) { if (n[e.id] !== void 0) return n[e.id]; let t13; switch (e.type) { case "DirectionalLight": t13 = { direction: new X(), color: new Fe() }; break; case "SpotLight": t13 = { position: new X(), direction: new X(), color: new Fe(), distance: 0, coneCos: 0, penumbraCos: 0, decay: 0 }; break; case "PointLight": t13 = { position: new X(), color: new Fe(), distance: 0, decay: 0 }; break; case "HemisphereLight": t13 = { direction: new X(), skyColor: new Fe(), groundColor: new Fe() }; break; case "RectAreaLight": t13 = { color: new Fe(), position: new X(), halfWidth: new X(), halfHeight: new X() }; break; } return n[e.id] = t13, t13; } }; } function SN() { const n = {}; return { get: function(e) { if (n[e.id] !== void 0) return n[e.id]; let t13; switch (e.type) { case "DirectionalLight": t13 = { shadowBias: 0, shadowNormalBias: 0, shadowRadius: 1, shadowMapSize: new Pe() }; break; case "SpotLight": t13 = { shadowBias: 0, shadowNormalBias: 0, shadowRadius: 1, shadowMapSize: new Pe() }; break; case "PointLight": t13 = { shadowBias: 0, shadowNormalBias: 0, shadowRadius: 1, shadowMapSize: new Pe(), shadowCameraNear: 1, shadowCameraFar: 1e3 }; break; } return n[e.id] = t13, t13; } }; } var _N = 0; function TN(n, e) { return (e.castShadow ? 1 : 0) - (n.castShadow ? 1 : 0); } function EN(n, e) { const t13 = new MN(), i = SN(), r = { 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 d = 0; d < 9; d++) r.probe.push(new X()); const s = new X(), o = new $e2(), a = new $e2(); function c(d) { let h6 = 0, p = 0, g = 0; for (let x = 0; x < 9; x++) r.probe[x].set(0, 0, 0); let f = 0, u = 0, y = 0, v = 0, m = 0, w = 0, S = 0, T = 0; d.sort(TN); for (let x = 0, _ = d.length; x < _; x++) { const E = d[x], L = E.color, R = E.intensity, C = E.distance, A = E.shadow && E.shadow.map ? E.shadow.map.texture : null; if (E.isAmbientLight) h6 += L.r * R, p += L.g * R, g += L.b * R; else if (E.isLightProbe) for (let P = 0; P < 9; P++) r.probe[P].addScaledVector(E.sh.coefficients[P], R); else if (E.isDirectionalLight) { const P = t13.get(E); if (P.color.copy(E.color).multiplyScalar(E.intensity), E.castShadow) { const I = E.shadow, b = i.get(E); b.shadowBias = I.bias, b.shadowNormalBias = I.normalBias, b.shadowRadius = I.radius, b.shadowMapSize = I.mapSize, r.directionalShadow[f] = b, r.directionalShadowMap[f] = A, r.directionalShadowMatrix[f] = E.shadow.matrix, w++; } r.directional[f] = P, f++; } else if (E.isSpotLight) { const P = t13.get(E); if (P.position.setFromMatrixPosition(E.matrixWorld), P.color.copy(L).multiplyScalar(R), P.distance = C, P.coneCos = Math.cos(E.angle), P.penumbraCos = Math.cos(E.angle * (1 - E.penumbra)), P.decay = E.decay, E.castShadow) { const I = E.shadow, b = i.get(E); b.shadowBias = I.bias, b.shadowNormalBias = I.normalBias, b.shadowRadius = I.radius, b.shadowMapSize = I.mapSize, r.spotShadow[y] = b, r.spotShadowMap[y] = A, r.spotShadowMatrix[y] = E.shadow.matrix, T++; } r.spot[y] = P, y++; } else if (E.isRectAreaLight) { const P = t13.get(E); P.color.copy(L).multiplyScalar(R), P.halfWidth.set(E.width * 0.5, 0, 0), P.halfHeight.set(0, E.height * 0.5, 0), r.rectArea[v] = P, v++; } else if (E.isPointLight) { const P = t13.get(E); if (P.color.copy(E.color).multiplyScalar(E.intensity), P.distance = E.distance, P.decay = E.decay, E.castShadow) { const I = E.shadow, b = i.get(E); b.shadowBias = I.bias, b.shadowNormalBias = I.normalBias, b.shadowRadius = I.radius, b.shadowMapSize = I.mapSize, b.shadowCameraNear = I.camera.near, b.shadowCameraFar = I.camera.far, r.pointShadow[u] = b, r.pointShadowMap[u] = A, r.pointShadowMatrix[u] = E.shadow.matrix, S++; } r.point[u] = P, u++; } else if (E.isHemisphereLight) { const P = t13.get(E); P.skyColor.copy(E.color).multiplyScalar(R), P.groundColor.copy(E.groundColor).multiplyScalar(R), r.hemi[m] = P, m++; } } v > 0 && (e.isWebGL2 || n.has("OES_texture_float_linear") === true ? (r.rectAreaLTC1 = ze2.LTC_FLOAT_1, r.rectAreaLTC2 = ze2.LTC_FLOAT_2) : n.has("OES_texture_half_float_linear") === true ? (r.rectAreaLTC1 = ze2.LTC_HALF_1, r.rectAreaLTC2 = ze2.LTC_HALF_2) : console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")), r.ambient[0] = h6, r.ambient[1] = p, r.ambient[2] = g; const M = r.hash; (M.directionalLength !== f || M.pointLength !== u || M.spotLength !== y || M.rectAreaLength !== v || M.hemiLength !== m || M.numDirectionalShadows !== w || M.numPointShadows !== S || M.numSpotShadows !== T) && (r.directional.length = f, r.spot.length = y, r.rectArea.length = v, r.point.length = u, r.hemi.length = m, r.directionalShadow.length = w, r.directionalShadowMap.length = w, r.pointShadow.length = S, r.pointShadowMap.length = S, r.spotShadow.length = T, r.spotShadowMap.length = T, r.directionalShadowMatrix.length = w, r.pointShadowMatrix.length = S, r.spotShadowMatrix.length = T, M.directionalLength = f, M.pointLength = u, M.spotLength = y, M.rectAreaLength = v, M.hemiLength = m, M.numDirectionalShadows = w, M.numPointShadows = S, M.numSpotShadows = T, r.version = _N++); } function l(d, h6) { let p = 0, g = 0, f = 0, u = 0, y = 0; const v = h6.matrixWorldInverse; for (let m = 0, w = d.length; m < w; m++) { const S = d[m]; if (S.isDirectionalLight) { const T = r.directional[p]; T.direction.setFromMatrixPosition(S.matrixWorld), s.setFromMatrixPosition(S.target.matrixWorld), T.direction.sub(s), T.direction.transformDirection(v), p++; } else if (S.isSpotLight) { const T = r.spot[f]; T.position.setFromMatrixPosition(S.matrixWorld), T.position.applyMatrix4(v), T.direction.setFromMatrixPosition(S.matrixWorld), s.setFromMatrixPosition(S.target.matrixWorld), T.direction.sub(s), T.direction.transformDirection(v), f++; } else if (S.isRectAreaLight) { const T = r.rectArea[u]; T.position.setFromMatrixPosition(S.matrixWorld), T.position.applyMatrix4(v), a.identity(), o.copy(S.matrixWorld), o.premultiply(v), a.extractRotation(o), T.halfWidth.set(S.width * 0.5, 0, 0), T.halfHeight.set(0, S.height * 0.5, 0), T.halfWidth.applyMatrix4(a), T.halfHeight.applyMatrix4(a), u++; } else if (S.isPointLight) { const T = r.point[g]; T.position.setFromMatrixPosition(S.matrixWorld), T.position.applyMatrix4(v), g++; } else if (S.isHemisphereLight) { const T = r.hemi[y]; T.direction.setFromMatrixPosition(S.matrixWorld), T.direction.transformDirection(v), T.direction.normalize(), y++; } } } return { setup: c, setupView: l, state: r }; } function Ug2(n, e) { const t13 = new EN(n, e), i = [], r = []; function s() { i.length = 0, r.length = 0; } function o(h6) { i.push(h6); } function a(h6) { r.push(h6); } function c() { t13.setup(i); } function l(h6) { t13.setupView(i, h6); } return { init: s, state: { lightsArray: i, shadowsArray: r, lights: t13 }, setupLights: c, setupLightsView: l, pushLight: o, pushShadow: a }; } function AN(n, e) { let t13 = /* @__PURE__ */ new WeakMap(); function i(s, o = 0) { let a; return t13.has(s) === false ? (a = new Ug2(n, e), t13.set(s, [a])) : o >= t13.get(s).length ? (a = new Ug2(n, e), t13.get(s).push(a)) : a = t13.get(s)[o], a; } function r() { t13 = /* @__PURE__ */ new WeakMap(); } return { get: i, dispose: r }; } var Ou2 = class extends sn { constructor(e) { super(), this.type = "MeshDepthMaterial", this.depthPacking = lx2, this.morphTargets = false, this.map = null, this.alphaMap = null, this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.wireframe = false, this.wireframeLinewidth = 1, this.fog = false, 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; } }; Ou2.prototype.isMeshDepthMaterial = true; var Du2 = class extends sn { constructor(e) { super(), this.type = "MeshDistanceMaterial", this.referencePosition = new X(), this.nearDistance = 1, this.farDistance = 1e3, this.morphTargets = false, this.map = null, this.alphaMap = null, this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.fog = false, 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; } }; Du2.prototype.isMeshDistanceMaterial = true; var CN = `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 ) ); }`; var LN = `void main() { gl_Position = vec4( position, 1.0 ); }`; function Ox2(n, e, t13) { let i = new Ml2(); const r = new Pe(), s = new Pe(), o = new _t2(), a = [], c = [], l = {}, d = t13.maxTextureSize, h6 = { 0: qt2, 1: Xr2, 2: Yr2 }, p = new dr2({ defines: { SAMPLE_RATE: 2 / 8, HALF_SAMPLE_RATE: 1 / 8 }, uniforms: { shadow_pass: { value: null }, resolution: { value: new Pe() }, radius: { value: 4 } }, vertexShader: LN, fragmentShader: CN }), g = p.clone(); g.defines.HORIZONTAL_PASS = 1; const f = new Je2(); f.setAttribute( "position", new nt( new Float32Array([-1, -1, 0.5, 3, -1, 0.5, -1, 3, 0.5]), 3 ) ); const u = new tn2(f, p), y = this; this.enabled = false, this.autoUpdate = true, this.needsUpdate = false, this.type = Vf2, this.render = function(M, x, _) { if (y.enabled === false || y.autoUpdate === false && y.needsUpdate === false || M.length === 0) return; const E = n.getRenderTarget(), L = n.getActiveCubeFace(), R = n.getActiveMipmapLevel(), C = n.state; C.setBlending(or2), C.buffers.color.setClear(1, 1, 1, 1), C.buffers.depth.setTest(true), C.setScissorTest(false); for (let A = 0, P = M.length; A < P; A++) { const I = M[A], b = I.shadow; if (b === void 0) { console.warn("THREE.WebGLShadowMap:", I, "has no shadow."); continue; } if (b.autoUpdate === false && b.needsUpdate === false) continue; r.copy(b.mapSize); const O = b.getFrameExtents(); if (r.multiply(O), s.copy(b.mapSize), (r.x > d || r.y > d) && (r.x > d && (s.x = Math.floor(d / O.x), r.x = s.x * O.x, b.mapSize.x = s.x), r.y > d && (s.y = Math.floor(d / O.y), r.y = s.y * O.y, b.mapSize.y = s.y)), b.map === null && !b.isPointLightShadow && this.type === wo2) { const D = { minFilter: jt, magFilter: jt, format: Yn2 }; b.map = new bi2(r.x, r.y, D), b.map.texture.name = I.name + ".shadowMap", b.mapPass = new bi2(r.x, r.y, D), b.camera.updateProjectionMatrix(); } if (b.map === null) { const D = { minFilter: Kt2, magFilter: Kt2, format: Yn2 }; b.map = new bi2(r.x, r.y, D), b.map.texture.name = I.name + ".shadowMap", b.camera.updateProjectionMatrix(); } n.setRenderTarget(b.map), n.clear(); const N = b.getViewportCount(); for (let D = 0; D < N; D++) { const B = b.getViewport(D); o.set( s.x * B.x, s.y * B.y, s.x * B.z, s.y * B.w ), C.viewport(o), b.updateMatrices(I, D), i = b.getFrustum(), T(x, _, b.camera, I, this.type); } !b.isPointLightShadow && this.type === wo2 && v(b, _), b.needsUpdate = false; } y.needsUpdate = false, n.setRenderTarget(E, L, R); }; function v(M, x) { const _ = e.update(u); p.uniforms.shadow_pass.value = M.map.texture, p.uniforms.resolution.value = M.mapSize, p.uniforms.radius.value = M.radius, n.setRenderTarget(M.mapPass), n.clear(), n.renderBufferDirect(x, null, _, p, u, null), g.uniforms.shadow_pass.value = M.mapPass.texture, g.uniforms.resolution.value = M.mapSize, g.uniforms.radius.value = M.radius, n.setRenderTarget(M.map), n.clear(), n.renderBufferDirect(x, null, _, g, u, null); } function m(M) { const x = M << 0; let _ = a[x]; return _ === void 0 && (_ = new Ou2({ depthPacking: cx2, morphTargets: M }), a[x] = _), _; } function w(M) { const x = M << 0; let _ = c[x]; return _ === void 0 && (_ = new Du2({ morphTargets: M }), c[x] = _), _; } function S(M, x, _, E, L, R, C) { let A = null, P = m, I = M.customDepthMaterial; if (E.isPointLight === true && (P = w, I = M.customDistanceMaterial), I === void 0) { let b = false; _.morphTargets === true && (b = x.morphAttributes && x.morphAttributes.position && x.morphAttributes.position.length > 0), A = P(b); } else A = I; if (n.localClippingEnabled && _.clipShadows === true && _.clippingPlanes.length !== 0) { const b = A.uuid, O = _.uuid; let N = l[b]; N === void 0 && (N = {}, l[b] = N); let D = N[O]; D === void 0 && (D = A.clone(), N[O] = D), A = D; } return A.visible = _.visible, A.wireframe = _.wireframe, C === wo2 ? A.side = _.shadowSide !== null ? _.shadowSide : _.side : A.side = _.shadowSide !== null ? _.shadowSide : h6[_.side], A.clipShadows = _.clipShadows, A.clippingPlanes = _.clippingPlanes, A.clipIntersection = _.clipIntersection, A.wireframeLinewidth = _.wireframeLinewidth, A.linewidth = _.linewidth, E.isPointLight === true && A.isMeshDistanceMaterial === true && (A.referencePosition.setFromMatrixPosition(E.matrixWorld), A.nearDistance = L, A.farDistance = R), A; } function T(M, x, _, E, L) { if (M.visible === false) return; if (M.layers.test(x.layers) && (M.isMesh || M.isLine || M.isPoints) && (M.castShadow || M.receiveShadow && L === wo2) && (!M.frustumCulled || i.intersectsObject(M))) { M.modelViewMatrix.multiplyMatrices(_.matrixWorldInverse, M.matrixWorld); const A = e.update(M), P = M.material; if (Array.isArray(P)) { const I = A.groups; for (let b = 0, O = I.length; b < O; b++) { const N = I[b], D = P[N.materialIndex]; if (D && D.visible) { const B = S(M, A, D, E, _.near, _.far, L); n.renderBufferDirect(_, null, A, B, M, N); } } } else if (P.visible) { const I = S(M, A, P, E, _.near, _.far, L); n.renderBufferDirect(_, null, A, I, M, null); } } const C = M.children; for (let A = 0, P = C.length; A < P; A++) T(C[A], x, _, E, L); } } function RN(n, e, t13) { const i = t13.isWebGL2; function r() { let se = false; const Se2 = new _t2(); let ge = null; const be2 = new _t2(0, 0, 0, 0); return { setMask: function(Ie2) { ge !== Ie2 && !se && (n.colorMask(Ie2, Ie2, Ie2, Ie2), ge = Ie2); }, setLocked: function(Ie2) { se = Ie2; }, setClear: function(Ie2, et2, mt, Ue, bt2) { bt2 === true && (Ie2 *= Ue, et2 *= Ue, mt *= Ue), Se2.set(Ie2, et2, mt, Ue), be2.equals(Se2) === false && (n.clearColor(Ie2, et2, mt, Ue), be2.copy(Se2)); }, reset: function() { se = false, ge = null, be2.set(-1, 0, 0, 0); } }; } function s() { let se = false, Se2 = null, ge = null, be2 = null; return { setTest: function(Ie2) { Ie2 ? ie(2929) : j(2929); }, setMask: function(Ie2) { Se2 !== Ie2 && !se && (n.depthMask(Ie2), Se2 = Ie2); }, setFunc: function(Ie2) { if (ge !== Ie2) { if (Ie2) switch (Ie2) { case Jy2: n.depthFunc(512); break; case qy2: n.depthFunc(519); break; case Ky2: n.depthFunc(513); break; case Kc2: n.depthFunc(515); break; case Qy2: n.depthFunc(514); break; case eb2: n.depthFunc(518); break; case tb2: n.depthFunc(516); break; case nb2: n.depthFunc(517); break; default: n.depthFunc(515); } else n.depthFunc(515); ge = Ie2; } }, setLocked: function(Ie2) { se = Ie2; }, setClear: function(Ie2) { be2 !== Ie2 && (n.clearDepth(Ie2), be2 = Ie2); }, reset: function() { se = false, Se2 = null, ge = null, be2 = null; } }; } function o() { let se = false, Se2 = null, ge = null, be2 = null, Ie2 = null, et2 = null, mt = null, Ue = null, bt2 = null; return { setTest: function(Ve) { se || (Ve ? ie(2960) : j(2960)); }, setMask: function(Ve) { Se2 !== Ve && !se && (n.stencilMask(Ve), Se2 = Ve); }, setFunc: function(Ve, lt, tt2) { (ge !== Ve || be2 !== lt || Ie2 !== tt2) && (n.stencilFunc(Ve, lt, tt2), ge = Ve, be2 = lt, Ie2 = tt2); }, setOp: function(Ve, lt, tt2) { (et2 !== Ve || mt !== lt || Ue !== tt2) && (n.stencilOp(Ve, lt, tt2), et2 = Ve, mt = lt, Ue = tt2); }, setLocked: function(Ve) { se = Ve; }, setClear: function(Ve) { bt2 !== Ve && (n.clearStencil(Ve), bt2 = Ve); }, reset: function() { se = false, Se2 = null, ge = null, be2 = null, Ie2 = null, et2 = null, mt = null, Ue = null, bt2 = null; } }; } const a = new r(), c = new s(), l = new o(); let d = {}, h6 = null, p = {}, g = null, f = false, u = null, y = null, v = null, m = null, w = null, S = null, T = null, M = false, x = null, _ = null, E = null, L = null, R = null; const C = n.getParameter(35661); let A = false, P = 0; const I = n.getParameter(7938); I.indexOf("WebGL") !== -1 ? (P = parseFloat(/^WebGL (\d)/.exec(I)[1]), A = P >= 1) : I.indexOf("OpenGL ES") !== -1 && (P = parseFloat(/^OpenGL ES (\d)/.exec(I)[1]), A = P >= 2); let b = null, O = {}; const N = n.getParameter(3088), D = n.getParameter(2978), B = new _t2().fromArray(N), U = new _t2().fromArray(D); function k(se, Se2, ge) { const be2 = new Uint8Array(4), Ie2 = n.createTexture(); n.bindTexture(se, Ie2), n.texParameteri(se, 10241, 9728), n.texParameteri(se, 10240, 9728); for (let et2 = 0; et2 < ge; et2++) n.texImage2D(Se2 + et2, 0, 6408, 1, 1, 0, 6408, 5121, be2); return Ie2; } const K = {}; K[3553] = k(3553, 3553, 1), K[34067] = k(34067, 34069, 6), a.setClear(0, 0, 0, 1), c.setClear(1), l.setClear(0), ie(2929), c.setFunc(Kc2), te(false), F(yd2), ie(2884), ne(or2); function ie(se) { d[se] !== true && (n.enable(se), d[se] = true); } function j(se) { d[se] !== false && (n.disable(se), d[se] = false); } function G(se) { se !== h6 && (n.bindFramebuffer(36160, se), h6 = se); } function W(se, Se2) { return Se2 === null && h6 !== null && (Se2 = h6), p[se] !== Se2 ? (n.bindFramebuffer(se, Se2), p[se] = Se2, i && (se === 36009 && (p[36160] = Se2), se === 36160 && (p[36009] = Se2)), true) : false; } function q(se) { return g !== se ? (n.useProgram(se), g = se, true) : false; } const Q = { [ys]: 32774, [Uy2]: 32778, [Vy2]: 32779 }; if (i) Q[Md2] = 32775, Q[Sd2] = 32776; else { const se = e.get("EXT_blend_minmax"); se !== null && (Q[Md2] = se.MIN_EXT, Q[Sd2] = se.MAX_EXT); } const ee = { [ky2]: 0, [Gy2]: 1, [Hy2]: 768, [Gf2]: 770, [Yy2]: 776, [Zy2]: 774, [jy2]: 772, [Wy2]: 769, [Hf2]: 771, [Xy2]: 775, [$y2]: 773 }; function ne(se, Se2, ge, be2, Ie2, et2, mt, Ue) { if (se === or2) { f === true && (j(3042), f = false); return; } if (f === false && (ie(3042), f = true), se !== zy2) { if (se !== u || Ue !== M) { if ((y !== ys || w !== ys) && (n.blendEquation(32774), y = ys, w = ys), Ue) switch (se) { case _o2: n.blendFuncSeparate(1, 771, 1, 771); break; case bd2: n.blendFunc(1, 1); break; case xd2: n.blendFuncSeparate(0, 0, 769, 771); break; case wd2: n.blendFuncSeparate(0, 768, 0, 770); break; default: console.error("THREE.WebGLState: Invalid blending: ", se); break; } else switch (se) { case _o2: n.blendFuncSeparate(770, 771, 1, 771); break; case bd2: n.blendFunc(770, 1); break; case xd2: n.blendFunc(0, 769); break; case wd2: n.blendFunc(0, 768); break; default: console.error("THREE.WebGLState: Invalid blending: ", se); break; } v = null, m = null, S = null, T = null, u = se, M = Ue; } return; } Ie2 = Ie2 || Se2, et2 = et2 || ge, mt = mt || be2, (Se2 !== y || Ie2 !== w) && (n.blendEquationSeparate(Q[Se2], Q[Ie2]), y = Se2, w = Ie2), (ge !== v || be2 !== m || et2 !== S || mt !== T) && (n.blendFuncSeparate(ee[ge], ee[be2], ee[et2], ee[mt]), v = ge, m = be2, S = et2, T = mt), u = se, M = null; } function Y(se, Se2) { se.side === Yr2 ? j(2884) : ie(2884); let ge = se.side === qt2; Se2 && (ge = !ge), te(ge), se.blending === _o2 && se.transparent === false ? ne(or2) : ne(se.blending, se.blendEquation, se.blendSrc, se.blendDst, se.blendEquationAlpha, se.blendSrcAlpha, se.blendDstAlpha, se.premultipliedAlpha), c.setFunc(se.depthFunc), c.setTest(se.depthTest), c.setMask(se.depthWrite), a.setMask(se.colorWrite); const be2 = se.stencilWrite; l.setTest(be2), be2 && (l.setMask(se.stencilWriteMask), l.setFunc(se.stencilFunc, se.stencilRef, se.stencilFuncMask), l.setOp(se.stencilFail, se.stencilZFail, se.stencilZPass)), J(se.polygonOffset, se.polygonOffsetFactor, se.polygonOffsetUnits), se.alphaToCoverage === true ? ie(32926) : j(32926); } function te(se) { x !== se && (se ? n.frontFace(2304) : n.frontFace(2305), x = se); } function F(se) { se !== Ny2 ? (ie(2884), se !== _ && (se === yd2 ? n.cullFace(1029) : se === Fy2 ? n.cullFace(1028) : n.cullFace(1032))) : j(2884), _ = se; } function $(se) { se !== E && (A && n.lineWidth(se), E = se); } function J(se, Se2, ge) { se ? (ie(32823), (L !== Se2 || R !== ge) && (n.polygonOffset(Se2, ge), L = Se2, R = ge)) : j(32823); } function z(se) { se ? ie(3089) : j(3089); } function V(se) { se === void 0 && (se = 33984 + C - 1), b !== se && (n.activeTexture(se), b = se); } function oe(se, Se2) { b === null && V(); let ge = O[b]; ge === void 0 && (ge = { type: void 0, texture: void 0 }, O[b] = ge), (ge.type !== se || ge.texture !== Se2) && (n.bindTexture(se, Se2 || K[se]), ge.type = se, ge.texture = Se2); } function ue() { const se = O[b]; se !== void 0 && se.type !== void 0 && (n.bindTexture(se.type, null), se.type = void 0, se.texture = void 0); } function le() { try { n.compressedTexImage2D.apply(n, arguments); } catch (se) { console.error("THREE.WebGLState:", se); } } function ve() { try { n.texImage2D.apply(n, arguments); } catch (se) { console.error("THREE.WebGLState:", se); } } function xe() { try { n.texImage3D.apply(n, arguments); } catch (se) { console.error("THREE.WebGLState:", se); } } function Te(se) { B.equals(se) === false && (n.scissor(se.x, se.y, se.z, se.w), B.copy(se)); } function de(se) { U.equals(se) === false && (n.viewport(se.x, se.y, se.z, se.w), U.copy(se)); } function we() { n.disable(3042), n.disable(2884), n.disable(2929), n.disable(32823), n.disable(3089), n.disable(2960), n.disable(32926), n.blendEquation(32774), n.blendFunc(1, 0), n.blendFuncSeparate(1, 0, 1, 0), n.colorMask(true, true, true, true), n.clearColor(0, 0, 0, 0), n.depthMask(true), n.depthFunc(513), n.clearDepth(1), n.stencilMask(4294967295), n.stencilFunc(519, 0, 4294967295), n.stencilOp(7680, 7680, 7680), n.clearStencil(0), n.cullFace(1029), n.frontFace(2305), n.polygonOffset(0, 0), n.activeTexture(33984), n.bindFramebuffer(36160, null), i === true && (n.bindFramebuffer(36009, null), n.bindFramebuffer(36008, null)), n.useProgram(null), n.lineWidth(1), n.scissor(0, 0, n.canvas.width, n.canvas.height), n.viewport(0, 0, n.canvas.width, n.canvas.height), d = {}, b = null, O = {}, h6 = null, p = {}, g = null, f = false, u = null, y = null, v = null, m = null, w = null, S = null, T = null, M = false, x = null, _ = null, E = null, L = null, R = null, B.set(0, 0, n.canvas.width, n.canvas.height), U.set(0, 0, n.canvas.width, n.canvas.height), a.reset(), c.reset(), l.reset(); } return { buffers: { color: a, depth: c, stencil: l }, enable: ie, disable: j, bindFramebuffer: W, bindXRFramebuffer: G, useProgram: q, setBlending: ne, setMaterial: Y, setFlipSided: te, setCullFace: F, setLineWidth: $, setPolygonOffset: J, setScissorTest: z, activeTexture: V, bindTexture: oe, unbindTexture: ue, compressedTexImage2D: le, texImage2D: ve, texImage3D: xe, scissor: Te, viewport: de, reset: we }; } function PN(n, e, t13, i, r, s, o) { const a = r.isWebGL2, c = r.maxTextures, l = r.maxCubemapSize, d = r.maxTextureSize, h6 = r.maxSamples, p = /* @__PURE__ */ new WeakMap(); let g, f = false; try { f = typeof OffscreenCanvas < "u" && new OffscreenCanvas(1, 1).getContext("2d") !== null; } catch { } function u(z, V) { return f ? new OffscreenCanvas(z, V) : document.createElementNS("http://www.w3.org/1999/xhtml", "canvas"); } function y(z, V, oe, ue) { let le = 1; if ((z.width > ue || z.height > ue) && (le = ue / Math.max(z.width, z.height)), le < 1 || V === true) if (typeof HTMLImageElement < "u" && z instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && z instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && z instanceof ImageBitmap) { const ve = V ? fx2 : Math.floor, xe = ve(le * z.width), Te = ve(le * z.height); g === void 0 && (g = u(xe, Te)); const de = oe ? u(xe, Te) : g; return de.width = xe, de.height = Te, de.getContext("2d").drawImage(z, 0, 0, xe, Te), console.warn("THREE.WebGLRenderer: Texture has been resized from (" + z.width + "x" + z.height + ") to (" + xe + "x" + Te + ")."), de; } else return "data" in z && console.warn("THREE.WebGLRenderer: Image in DataTexture is too big (" + z.width + "x" + z.height + ")."), z; return z; } function v(z) { return Nd2(z.width) && Nd2(z.height); } function m(z) { return a ? false : z.wrapS !== mn2 || z.wrapT !== mn2 || z.minFilter !== Kt2 && z.minFilter !== jt; } function w(z, V) { return z.generateMipmaps && V && z.minFilter !== Kt2 && z.minFilter !== jt; } function S(z, V, oe, ue, le = 1) { n.generateMipmap(z); const ve = i.get(V); ve.__maxMipLevel = Math.log2(Math.max(oe, ue, le)); } function T(z, V, oe) { if (a === false) return V; if (z !== null) { if (n[z] !== void 0) return n[z]; console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '" + z + "'"); } let ue = V; return V === 6403 && (oe === 5126 && (ue = 33326), oe === 5131 && (ue = 33325), oe === 5121 && (ue = 33321)), V === 6407 && (oe === 5126 && (ue = 34837), oe === 5131 && (ue = 34843), oe === 5121 && (ue = 32849)), V === 6408 && (oe === 5126 && (ue = 34836), oe === 5131 && (ue = 34842), oe === 5121 && (ue = 32856)), (ue === 33325 || ue === 33326 || ue === 34842 || ue === 34836) && e.get("EXT_color_buffer_float"), ue; } function M(z) { return z === Kt2 || z === Ka2 || z === Qa2 ? 9728 : 9729; } function x(z) { const V = z.target; V.removeEventListener("dispose", x), E(V), V.isVideoTexture && p.delete(V), o.memory.textures--; } function _(z) { const V = z.target; V.removeEventListener("dispose", _), L(V); } function E(z) { const V = i.get(z); V.__webglInit !== void 0 && (n.deleteTexture(V.__webglTexture), i.remove(z)); } function L(z) { const V = z.texture, oe = i.get(z), ue = i.get(V); if (z) { if (ue.__webglTexture !== void 0 && (n.deleteTexture(ue.__webglTexture), o.memory.textures--), z.depthTexture && z.depthTexture.dispose(), z.isWebGLCubeRenderTarget) for (let le = 0; le < 6; le++) n.deleteFramebuffer(oe.__webglFramebuffer[le]), oe.__webglDepthbuffer && n.deleteRenderbuffer(oe.__webglDepthbuffer[le]); else n.deleteFramebuffer(oe.__webglFramebuffer), oe.__webglDepthbuffer && n.deleteRenderbuffer(oe.__webglDepthbuffer), oe.__webglMultisampledFramebuffer && n.deleteFramebuffer(oe.__webglMultisampledFramebuffer), oe.__webglColorRenderbuffer && n.deleteRenderbuffer(oe.__webglColorRenderbuffer), oe.__webglDepthRenderbuffer && n.deleteRenderbuffer(oe.__webglDepthRenderbuffer); if (z.isWebGLMultipleRenderTargets) for (let le = 0, ve = V.length; le < ve; le++) { const xe = i.get(V[le]); xe.__webglTexture && (n.deleteTexture(xe.__webglTexture), o.memory.textures--), i.remove(V[le]); } i.remove(V), i.remove(z); } } let R = 0; function C() { R = 0; } function A() { const z = R; return z >= c && console.warn("THREE.WebGLTextures: Trying to use " + z + " texture units while this GPU supports only " + c), R += 1, z; } function P(z, V) { const oe = i.get(z); if (z.isVideoTexture && Y(z), z.version > 0 && oe.__version !== z.version) { const ue = z.image; if (ue === void 0) console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined"); else if (ue.complete === false) console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete"); else { k(oe, z, V); return; } } t13.activeTexture(33984 + V), t13.bindTexture(3553, oe.__webglTexture); } function I(z, V) { const oe = i.get(z); if (z.version > 0 && oe.__version !== z.version) { k(oe, z, V); return; } t13.activeTexture(33984 + V), t13.bindTexture(35866, oe.__webglTexture); } function b(z, V) { const oe = i.get(z); if (z.version > 0 && oe.__version !== z.version) { k(oe, z, V); return; } t13.activeTexture(33984 + V), t13.bindTexture(32879, oe.__webglTexture); } function O(z, V) { const oe = i.get(z); if (z.version > 0 && oe.__version !== z.version) { K(oe, z, V); return; } t13.activeTexture(33984 + V), t13.bindTexture(34067, oe.__webglTexture); } const N = { [Jr]: 10497, [mn2]: 33071, [No2]: 33648 }, D = { [Kt2]: 9728, [Ka2]: 9984, [Qa2]: 9986, [jt]: 9729, [Tu2]: 9985, [br2]: 9987 }; function B(z, V, oe) { if (oe ? (n.texParameteri(z, 10242, N[V.wrapS]), n.texParameteri(z, 10243, N[V.wrapT]), (z === 32879 || z === 35866) && n.texParameteri(z, 32882, N[V.wrapR]), n.texParameteri(z, 10240, D[V.magFilter]), n.texParameteri(z, 10241, D[V.minFilter])) : (n.texParameteri(z, 10242, 33071), n.texParameteri(z, 10243, 33071), (z === 32879 || z === 35866) && n.texParameteri(z, 32882, 33071), (V.wrapS !== mn2 || V.wrapT !== mn2) && console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."), n.texParameteri(z, 10240, M(V.magFilter)), n.texParameteri(z, 10241, M(V.minFilter)), V.minFilter !== Kt2 && V.minFilter !== jt && 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") === true) { const ue = e.get("EXT_texture_filter_anisotropic"); if (V.type === nr2 && e.has("OES_texture_float_linear") === false || a === false && V.type === Ts2 && e.has("OES_texture_half_float_linear") === false) return; (V.anisotropy > 1 || i.get(V).__currentAnisotropy) && (n.texParameterf(z, ue.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(V.anisotropy, r.getMaxAnisotropy())), i.get(V).__currentAnisotropy = V.anisotropy); } } function U(z, V) { z.__webglInit === void 0 && (z.__webglInit = true, V.addEventListener("dispose", x), z.__webglTexture = n.createTexture(), o.memory.textures++); } function k(z, V, oe) { let ue = 3553; V.isDataTexture2DArray && (ue = 35866), V.isDataTexture3D && (ue = 32879), U(z, V), t13.activeTexture(33984 + oe), t13.bindTexture(ue, z.__webglTexture), n.pixelStorei(37440, V.flipY), n.pixelStorei(37441, V.premultiplyAlpha), n.pixelStorei(3317, V.unpackAlignment), n.pixelStorei(37443, 0); const le = m(V) && v(V.image) === false, ve = y(V.image, le, false, d), xe = v(ve) || a, Te = s.convert(V.format); let de = s.convert(V.type), we = T(V.internalFormat, Te, de); B(ue, V, xe); let se; const Se2 = V.mipmaps; if (V.isDepthTexture) we = 6402, a ? V.type === nr2 ? we = 36012 : V.type === Va2 ? we = 33190 : V.type === To2 ? we = 35056 : we = 33189 : V.type === nr2 && console.error("WebGLRenderer: Floating point depth texture requires WebGL2."), V.format === Es2 && we === 6402 && V.type !== el2 && V.type !== Va2 && (console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."), V.type = el2, de = s.convert(V.type)), V.format === Fo2 && we === 6402 && (we = 34041, V.type !== To2 && (console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."), V.type = To2, de = s.convert(V.type))), t13.texImage2D(3553, 0, we, ve.width, ve.height, 0, Te, de, null); else if (V.isDataTexture) if (Se2.length > 0 && xe) { for (let ge = 0, be2 = Se2.length; ge < be2; ge++) se = Se2[ge], t13.texImage2D(3553, ge, we, se.width, se.height, 0, Te, de, se.data); V.generateMipmaps = false, z.__maxMipLevel = Se2.length - 1; } else t13.texImage2D(3553, 0, we, ve.width, ve.height, 0, Te, de, ve.data), z.__maxMipLevel = 0; else if (V.isCompressedTexture) { for (let ge = 0, be2 = Se2.length; ge < be2; ge++) se = Se2[ge], V.format !== Yn2 && V.format !== ar2 ? Te !== null ? t13.compressedTexImage2D(3553, ge, we, se.width, se.height, 0, se.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : t13.texImage2D(3553, ge, we, se.width, se.height, 0, Te, de, se.data); z.__maxMipLevel = Se2.length - 1; } else if (V.isDataTexture2DArray) t13.texImage3D(35866, 0, we, ve.width, ve.height, ve.depth, 0, Te, de, ve.data), z.__maxMipLevel = 0; else if (V.isDataTexture3D) t13.texImage3D(32879, 0, we, ve.width, ve.height, ve.depth, 0, Te, de, ve.data), z.__maxMipLevel = 0; else if (Se2.length > 0 && xe) { for (let ge = 0, be2 = Se2.length; ge < be2; ge++) se = Se2[ge], t13.texImage2D(3553, ge, we, Te, de, se); V.generateMipmaps = false, z.__maxMipLevel = Se2.length - 1; } else t13.texImage2D(3553, 0, we, Te, de, ve), z.__maxMipLevel = 0; w(V, xe) && S(ue, V, ve.width, ve.height), z.__version = V.version, V.onUpdate && V.onUpdate(V); } function K(z, V, oe) { if (V.image.length !== 6) return; U(z, V), t13.activeTexture(33984 + oe), t13.bindTexture(34067, z.__webglTexture), n.pixelStorei(37440, V.flipY), n.pixelStorei(37441, V.premultiplyAlpha), n.pixelStorei(3317, V.unpackAlignment), n.pixelStorei(37443, 0); const ue = V && (V.isCompressedTexture || V.image[0].isCompressedTexture), le = V.image[0] && V.image[0].isDataTexture, ve = []; for (let ge = 0; ge < 6; ge++) !ue && !le ? ve[ge] = y(V.image[ge], false, true, l) : ve[ge] = le ? V.image[ge].image : V.image[ge]; const xe = ve[0], Te = v(xe) || a, de = s.convert(V.format), we = s.convert(V.type), se = T(V.internalFormat, de, we); B(34067, V, Te); let Se2; if (ue) { for (let ge = 0; ge < 6; ge++) { Se2 = ve[ge].mipmaps; for (let be2 = 0; be2 < Se2.length; be2++) { const Ie2 = Se2[be2]; V.format !== Yn2 && V.format !== ar2 ? de !== null ? t13.compressedTexImage2D(34069 + ge, be2, se, Ie2.width, Ie2.height, 0, Ie2.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()") : t13.texImage2D(34069 + ge, be2, se, Ie2.width, Ie2.height, 0, de, we, Ie2.data); } } z.__maxMipLevel = Se2.length - 1; } else { Se2 = V.mipmaps; for (let ge = 0; ge < 6; ge++) if (le) { t13.texImage2D(34069 + ge, 0, se, ve[ge].width, ve[ge].height, 0, de, we, ve[ge].data); for (let be2 = 0; be2 < Se2.length; be2++) { const et2 = Se2[be2].image[ge].image; t13.texImage2D(34069 + ge, be2 + 1, se, et2.width, et2.height, 0, de, we, et2.data); } } else { t13.texImage2D(34069 + ge, 0, se, de, we, ve[ge]); for (let be2 = 0; be2 < Se2.length; be2++) { const Ie2 = Se2[be2]; t13.texImage2D(34069 + ge, be2 + 1, se, de, we, Ie2.image[ge]); } } z.__maxMipLevel = Se2.length; } w(V, Te) && S(34067, V, xe.width, xe.height), z.__version = V.version, V.onUpdate && V.onUpdate(V); } function ie(z, V, oe, ue, le) { const ve = s.convert(oe.format), xe = s.convert(oe.type), Te = T(oe.internalFormat, ve, xe); le === 32879 || le === 35866 ? t13.texImage3D(le, 0, Te, V.width, V.height, V.depth, 0, ve, xe, null) : t13.texImage2D(le, 0, Te, V.width, V.height, 0, ve, xe, null), t13.bindFramebuffer(36160, z), n.framebufferTexture2D(36160, ue, le, i.get(oe).__webglTexture, 0), t13.bindFramebuffer(36160, null); } function j(z, V, oe) { if (n.bindRenderbuffer(36161, z), V.depthBuffer && !V.stencilBuffer) { let ue = 33189; if (oe) { const le = V.depthTexture; le && le.isDepthTexture && (le.type === nr2 ? ue = 36012 : le.type === Va2 && (ue = 33190)); const ve = ne(V); n.renderbufferStorageMultisample(36161, ve, ue, V.width, V.height); } else n.renderbufferStorage(36161, ue, V.width, V.height); n.framebufferRenderbuffer(36160, 36096, 36161, z); } else if (V.depthBuffer && V.stencilBuffer) { if (oe) { const ue = ne(V); n.renderbufferStorageMultisample(36161, ue, 35056, V.width, V.height); } else n.renderbufferStorage(36161, 34041, V.width, V.height); n.framebufferRenderbuffer(36160, 33306, 36161, z); } else { const ue = V.isWebGLMultipleRenderTargets === true ? V.texture[0] : V.texture, le = s.convert(ue.format), ve = s.convert(ue.type), xe = T(ue.internalFormat, le, ve); if (oe) { const Te = ne(V); n.renderbufferStorageMultisample(36161, Te, xe, V.width, V.height); } else n.renderbufferStorage(36161, xe, V.width, V.height); } n.bindRenderbuffer(36161, null); } function G(z, V) { if (V && V.isWebGLCubeRenderTarget) throw new Error("Depth Texture with cube render targets is not supported"); if (t13.bindFramebuffer(36160, z), !(V.depthTexture && V.depthTexture.isDepthTexture)) throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture"); (!i.get(V.depthTexture).__webglTexture || V.depthTexture.image.width !== V.width || V.depthTexture.image.height !== V.height) && (V.depthTexture.image.width = V.width, V.depthTexture.image.height = V.height, V.depthTexture.needsUpdate = true), P(V.depthTexture, 0); const ue = i.get(V.depthTexture).__webglTexture; if (V.depthTexture.format === Es2) n.framebufferTexture2D(36160, 36096, 3553, ue, 0); else if (V.depthTexture.format === Fo2) n.framebufferTexture2D(36160, 33306, 3553, ue, 0); else throw new Error("Unknown depthTexture format"); } function W(z) { const V = i.get(z), oe = z.isWebGLCubeRenderTarget === true; if (z.depthTexture) { if (oe) throw new Error("target.depthTexture not supported in Cube render targets"); G(V.__webglFramebuffer, z); } else if (oe) { V.__webglDepthbuffer = []; for (let ue = 0; ue < 6; ue++) t13.bindFramebuffer(36160, V.__webglFramebuffer[ue]), V.__webglDepthbuffer[ue] = n.createRenderbuffer(), j(V.__webglDepthbuffer[ue], z, false); } else t13.bindFramebuffer(36160, V.__webglFramebuffer), V.__webglDepthbuffer = n.createRenderbuffer(), j(V.__webglDepthbuffer, z, false); t13.bindFramebuffer(36160, null); } function q(z) { const V = z.texture, oe = i.get(z), ue = i.get(V); z.addEventListener("dispose", _), z.isWebGLMultipleRenderTargets !== true && (ue.__webglTexture = n.createTexture(), ue.__version = V.version, o.memory.textures++); const le = z.isWebGLCubeRenderTarget === true, ve = z.isWebGLMultipleRenderTargets === true, xe = z.isWebGLMultisampleRenderTarget === true, Te = V.isDataTexture3D || V.isDataTexture2DArray, de = v(z) || a; if (a && V.format === ar2 && (V.type === nr2 || V.type === Ts2) && (V.format = Yn2, console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")), le) { oe.__webglFramebuffer = []; for (let we = 0; we < 6; we++) oe.__webglFramebuffer[we] = n.createFramebuffer(); } else if (oe.__webglFramebuffer = n.createFramebuffer(), ve) if (r.drawBuffers) { const we = z.texture; for (let se = 0, Se2 = we.length; se < Se2; se++) { const ge = i.get(we[se]); ge.__webglTexture === void 0 && (ge.__webglTexture = n.createTexture(), o.memory.textures++); } } else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension."); else if (xe) if (a) { oe.__webglMultisampledFramebuffer = n.createFramebuffer(), oe.__webglColorRenderbuffer = n.createRenderbuffer(), n.bindRenderbuffer(36161, oe.__webglColorRenderbuffer); const we = s.convert(V.format), se = s.convert(V.type), Se2 = T(V.internalFormat, we, se), ge = ne(z); n.renderbufferStorageMultisample(36161, ge, Se2, z.width, z.height), t13.bindFramebuffer(36160, oe.__webglMultisampledFramebuffer), n.framebufferRenderbuffer(36160, 36064, 36161, oe.__webglColorRenderbuffer), n.bindRenderbuffer(36161, null), z.depthBuffer && (oe.__webglDepthRenderbuffer = n.createRenderbuffer(), j(oe.__webglDepthRenderbuffer, z, true)), t13.bindFramebuffer(36160, null); } else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2."); if (le) { t13.bindTexture(34067, ue.__webglTexture), B(34067, V, de); for (let we = 0; we < 6; we++) ie(oe.__webglFramebuffer[we], z, V, 36064, 34069 + we); w(V, de) && S(34067, V, z.width, z.height), t13.bindTexture(34067, null); } else if (ve) { const we = z.texture; for (let se = 0, Se2 = we.length; se < Se2; se++) { const ge = we[se], be2 = i.get(ge); t13.bindTexture(3553, be2.__webglTexture), B(3553, ge, de), ie(oe.__webglFramebuffer, z, ge, 36064 + se, 3553), w(ge, de) && S(3553, ge, z.width, z.height); } t13.bindTexture(3553, null); } else { let we = 3553; Te && (a ? we = V.isDataTexture3D ? 32879 : 35866 : console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")), t13.bindTexture(we, ue.__webglTexture), B(we, V, de), ie(oe.__webglFramebuffer, z, V, 36064, we), w(V, de) && S(we, V, z.width, z.height, z.depth), t13.bindTexture(we, null); } z.depthBuffer && W(z); } function Q(z) { const V = v(z) || a, oe = z.isWebGLMultipleRenderTargets === true ? z.texture : [z.texture]; for (let ue = 0, le = oe.length; ue < le; ue++) { const ve = oe[ue]; if (w(ve, V)) { const xe = z.isWebGLCubeRenderTarget ? 34067 : 3553, Te = i.get(ve).__webglTexture; t13.bindTexture(xe, Te), S(xe, ve, z.width, z.height), t13.bindTexture(xe, null); } } } function ee(z) { if (z.isWebGLMultisampleRenderTarget) if (a) { const V = z.width, oe = z.height; let ue = 16384; z.depthBuffer && (ue |= 256), z.stencilBuffer && (ue |= 1024); const le = i.get(z); t13.bindFramebuffer(36008, le.__webglMultisampledFramebuffer), t13.bindFramebuffer(36009, le.__webglFramebuffer), n.blitFramebuffer(0, 0, V, oe, 0, 0, V, oe, ue, 9728), t13.bindFramebuffer(36008, null), t13.bindFramebuffer(36009, le.__webglMultisampledFramebuffer); } else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2."); } function ne(z) { return a && z.isWebGLMultisampleRenderTarget ? Math.min(h6, z.samples) : 0; } function Y(z) { const V = o.render.frame; p.get(z) !== V && (p.set(z, V), z.update()); } let te = false, F = false; function $(z, V) { z && z.isWebGLRenderTarget && (te === false && (console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."), te = true), z = z.texture), P(z, V); } function J(z, V) { z && z.isWebGLCubeRenderTarget && (F === false && (console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."), F = true), z = z.texture), O(z, V); } this.allocateTextureUnit = A, this.resetTextureUnits = C, this.setTexture2D = P, this.setTexture2DArray = I, this.setTexture3D = b, this.setTextureCube = O, this.setupRenderTarget = q, this.updateRenderTargetMipmap = Q, this.updateMultisampleRenderTarget = ee, this.safeSetTexture2D = $, this.safeSetTextureCube = J; } function Dx2(n, e, t13) { const i = t13.isWebGL2; function r(s) { let o; if (s === Ps2) return 5121; if (s === fb2) return 32819; if (s === pb2) return 32820; if (s === mb2) return 33635; if (s === ub2) return 5120; if (s === hb2) return 5122; if (s === el2) return 5123; if (s === db2) return 5124; if (s === Va2) return 5125; if (s === nr2) return 5126; if (s === Ts2) return i ? 5131 : (o = e.get("OES_texture_half_float"), o !== null ? o.HALF_FLOAT_OES : null); if (s === gb2) return 6406; if (s === ar2) return 6407; if (s === Yn2) return 6408; if (s === vb2) return 6409; if (s === yb2) return 6410; if (s === Es2) return 6402; if (s === Fo2) return 34041; if (s === xb2) return 6403; if (s === wb2) return 36244; if (s === Mb2) return 33319; if (s === Sb2) return 33320; if (s === _b2) return 36248; if (s === Tb2) return 36249; if (s === _d2 || s === Td2 || s === Ed2 || s === Ad2) if (o = e.get("WEBGL_compressed_texture_s3tc"), o !== null) { if (s === _d2) return o.COMPRESSED_RGB_S3TC_DXT1_EXT; if (s === Td2) return o.COMPRESSED_RGBA_S3TC_DXT1_EXT; if (s === Ed2) return o.COMPRESSED_RGBA_S3TC_DXT3_EXT; if (s === Ad2) return o.COMPRESSED_RGBA_S3TC_DXT5_EXT; } else return null; if (s === Cd2 || s === Ld2 || s === Rd2 || s === Pd2) if (o = e.get("WEBGL_compressed_texture_pvrtc"), o !== null) { if (s === Cd2) return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG; if (s === Ld2) return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG; if (s === Rd2) return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; if (s === Pd2) return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; } else return null; if (s === Eb2) return o = e.get("WEBGL_compressed_texture_etc1"), o !== null ? o.COMPRESSED_RGB_ETC1_WEBGL : null; if ((s === Id2 || s === Od2) && (o = e.get("WEBGL_compressed_texture_etc"), o !== null)) { if (s === Id2) return o.COMPRESSED_RGB8_ETC2; if (s === Od2) return o.COMPRESSED_RGBA8_ETC2_EAC; } if (s === Ab2 || s === Cb2 || s === Lb2 || s === Rb2 || s === Pb2 || s === Ib2 || s === Ob2 || s === Db2 || s === Nb2 || s === Fb2 || s === Bb2 || s === zb2 || s === Ub2 || s === Vb2 || s === Gb2 || s === Hb2 || s === Wb2 || s === jb2 || s === $b2 || s === Zb2 || s === Xb2 || s === Yb2 || s === Jb2 || s === qb2 || s === Kb2 || s === Qb2 || s === ex2 || s === tx2) return o = e.get("WEBGL_compressed_texture_astc"), o !== null ? s : null; if (s === kb2) return o = e.get("EXT_texture_compression_bptc"), o !== null ? s : null; if (s === To2) return i ? 34042 : (o = e.get("WEBGL_depth_texture"), o !== null ? o.UNSIGNED_INT_24_8_WEBGL : null); } return { convert: r }; } var ep2 = class extends an2 { constructor(e = []) { super(), this.cameras = e; } }; ep2.prototype.isArrayCamera = true; var Pi2 = class extends ot { constructor() { super(), this.type = "Group"; } }; Pi2.prototype.isGroup = true; var IN = { type: "move" }; var Lh2 = class { constructor() { this._targetRay = null, this._grip = null, this._hand = null; } getHandSpace() { return this._hand === null && (this._hand = new Pi2(), this._hand.matrixAutoUpdate = false, this._hand.visible = false, this._hand.joints = {}, this._hand.inputState = { pinching: false }), this._hand; } getTargetRaySpace() { return this._targetRay === null && (this._targetRay = new Pi2(), this._targetRay.matrixAutoUpdate = false, this._targetRay.visible = false, this._targetRay.hasLinearVelocity = false, this._targetRay.linearVelocity = new X(), this._targetRay.hasAngularVelocity = false, this._targetRay.angularVelocity = new X()), this._targetRay; } getGripSpace() { return this._grip === null && (this._grip = new Pi2(), this._grip.matrixAutoUpdate = false, this._grip.visible = false, this._grip.hasLinearVelocity = false, this._grip.linearVelocity = new X(), this._grip.hasAngularVelocity = false, this._grip.angularVelocity = new X()), 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 = false), this._grip !== null && (this._grip.visible = false), this._hand !== null && (this._hand.visible = false), this; } update(e, t13, i) { let r = null, s = null, o = null; const a = this._targetRay, c = this._grip, l = this._hand; if (e && t13.session.visibilityState !== "visible-blurred") if (a !== null && (r = t13.getPose(e.targetRaySpace, i), r !== null && (a.matrix.fromArray(r.transform.matrix), a.matrix.decompose(a.position, a.rotation, a.scale), r.linearVelocity ? (a.hasLinearVelocity = true, a.linearVelocity.copy(r.linearVelocity)) : a.hasLinearVelocity = false, r.angularVelocity ? (a.hasAngularVelocity = true, a.angularVelocity.copy(r.angularVelocity)) : a.hasAngularVelocity = false, this.dispatchEvent(IN))), l && e.hand) { o = true; for (const u of e.hand.values()) { const y = t13.getJointPose(u, i); if (l.joints[u.jointName] === void 0) { const m = new Pi2(); m.matrixAutoUpdate = false, m.visible = false, l.joints[u.jointName] = m, l.add(m); } const v = l.joints[u.jointName]; y !== null && (v.matrix.fromArray(y.transform.matrix), v.matrix.decompose(v.position, v.rotation, v.scale), v.jointRadius = y.radius), v.visible = y !== null; } const d = l.joints["index-finger-tip"], h6 = l.joints["thumb-tip"], p = d.position.distanceTo(h6.position), g = 0.02, f = 5e-3; l.inputState.pinching && p > g + f ? (l.inputState.pinching = false, this.dispatchEvent({ type: "pinchend", handedness: e.handedness, target: this })) : !l.inputState.pinching && p <= g - f && (l.inputState.pinching = true, this.dispatchEvent({ type: "pinchstart", handedness: e.handedness, target: this })); } else c !== null && e.gripSpace && (s = t13.getPose(e.gripSpace, i), s !== null && (c.matrix.fromArray(s.transform.matrix), c.matrix.decompose(c.position, c.rotation, c.scale), s.linearVelocity ? (c.hasLinearVelocity = true, c.linearVelocity.copy(s.linearVelocity)) : c.hasLinearVelocity = false, s.angularVelocity ? (c.hasAngularVelocity = true, c.angularVelocity.copy(s.angularVelocity)) : c.hasAngularVelocity = false)); return a !== null && (a.visible = r !== null), c !== null && (c.visible = s !== null), l !== null && (l.visible = o !== null), this; } }; var ON = class extends ns2 { constructor(e, t13) { super(); const i = this, r = e.state; let s = null, o = 1, a = null, c = "local-floor", l = null, d = null, h6 = null, p = null; const g = [], f = /* @__PURE__ */ new Map(), u = new an2(); u.layers.enable(1), u.viewport = new _t2(); const y = new an2(); y.layers.enable(2), y.viewport = new _t2(); const v = [u, y], m = new ep2(); m.layers.enable(1), m.layers.enable(2); let w = null, S = null; this.cameraAutoUpdate = true, this.enabled = false, this.isPresenting = false, this.getController = function(I) { let b = g[I]; return b === void 0 && (b = new Lh2(), g[I] = b), b.getTargetRaySpace(); }, this.getControllerGrip = function(I) { let b = g[I]; return b === void 0 && (b = new Lh2(), g[I] = b), b.getGripSpace(); }, this.getHand = function(I) { let b = g[I]; return b === void 0 && (b = new Lh2(), g[I] = b), b.getHandSpace(); }; function T(I) { const b = f.get(I.inputSource); b && b.dispatchEvent({ type: I.type, data: I.inputSource }); } function M() { f.forEach(function(I, b) { I.disconnect(b); }), f.clear(), w = null, S = null, r.bindXRFramebuffer(null), e.setRenderTarget(e.getRenderTarget()), P.stop(), i.isPresenting = false, i.dispatchEvent({ type: "sessionend" }); } this.setFramebufferScaleFactor = function(I) { o = I, i.isPresenting === true && console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting."); }, this.setReferenceSpaceType = function(I) { c = I, i.isPresenting === true && console.warn("THREE.WebXRManager: Cannot change reference space type while presenting."); }, this.getReferenceSpace = function() { return a; }, this.getSession = function() { return s; }, this.setSession = async function(I) { if (s = I, s !== null) { s.addEventListener("select", T), s.addEventListener("selectstart", T), s.addEventListener("selectend", T), s.addEventListener("squeeze", T), s.addEventListener("squeezestart", T), s.addEventListener("squeezeend", T), s.addEventListener("end", M), s.addEventListener("inputsourceschange", x); const b = t13.getContextAttributes(); if (b.xrCompatible !== true && await t13.makeXRCompatible(), s.renderState.layers === void 0) { const O = { antialias: b.antialias, alpha: b.alpha, depth: b.depth, stencil: b.stencil, framebufferScaleFactor: o }, N = new XRWebGLLayer(s, t13, O); s.updateRenderState({ baseLayer: N }); } else { let O = 0; b.depth && (O = b.stencil ? 34041 : 6402); const N = { colorFormat: b.alpha ? 6408 : 6407, depthFormat: O, scaleFactor: o }; d = new XRWebGLBinding(s, t13), p = d.createProjectionLayer(N), h6 = t13.createFramebuffer(), s.updateRenderState({ layers: [p] }); } a = await s.requestReferenceSpace(c), P.setContext(s), P.start(), i.isPresenting = true, i.dispatchEvent({ type: "sessionstart" }); } }; function x(I) { const b = s.inputSources; for (let O = 0; O < g.length; O++) f.set(b[O], g[O]); for (let O = 0; O < I.removed.length; O++) { const N = I.removed[O], D = f.get(N); D && (D.dispatchEvent({ type: "disconnected", data: N }), f.delete(N)); } for (let O = 0; O < I.added.length; O++) { const N = I.added[O], D = f.get(N); D && D.dispatchEvent({ type: "connected", data: N }); } } const _ = new X(), E = new X(); function L(I, b, O) { _.setFromMatrixPosition(b.matrixWorld), E.setFromMatrixPosition(O.matrixWorld); const N = _.distanceTo(E), D = b.projectionMatrix.elements, B = O.projectionMatrix.elements, U = D[14] / (D[10] - 1), k = D[14] / (D[10] + 1), K = (D[9] + 1) / D[5], ie = (D[9] - 1) / D[5], j = (D[8] - 1) / D[0], G = (B[8] + 1) / B[0], W = U * j, q = U * G, Q = N / (-j + G), ee = Q * -j; b.matrixWorld.decompose(I.position, I.quaternion, I.scale), I.translateX(ee), I.translateZ(Q), I.matrixWorld.compose(I.position, I.quaternion, I.scale), I.matrixWorldInverse.copy(I.matrixWorld).invert(); const ne = U + Q, Y = k + Q, te = W - ee, F = q + (N - ee), $ = K * k / Y * ne, J = ie * k / Y * ne; I.projectionMatrix.makePerspective(te, F, $, J, ne, Y); } function R(I, b) { b === null ? I.matrixWorld.copy(I.matrix) : I.matrixWorld.multiplyMatrices(b.matrixWorld, I.matrix), I.matrixWorldInverse.copy(I.matrixWorld).invert(); } this.updateCamera = function(I) { if (s === null) return; m.near = y.near = u.near = I.near, m.far = y.far = u.far = I.far, (w !== m.near || S !== m.far) && (s.updateRenderState({ depthNear: m.near, depthFar: m.far }), w = m.near, S = m.far); const b = I.parent, O = m.cameras; R(m, b); for (let D = 0; D < O.length; D++) R(O[D], b); m.matrixWorld.decompose(m.position, m.quaternion, m.scale), I.position.copy(m.position), I.quaternion.copy(m.quaternion), I.scale.copy(m.scale), I.matrix.copy(m.matrix), I.matrixWorld.copy(m.matrixWorld); const N = I.children; for (let D = 0, B = N.length; D < B; D++) N[D].updateMatrixWorld(true); O.length === 2 ? L(m, u, y) : m.projectionMatrix.copy(u.projectionMatrix); }, this.getCamera = function() { return m; }; let C = null; function A(I, b) { if (l = b.getViewerPose(a), l !== null) { const N = l.views, D = s.renderState.baseLayer; s.renderState.layers === void 0 && r.bindXRFramebuffer(D.framebuffer); let B = false; N.length !== m.cameras.length && (m.cameras.length = 0, B = true); for (let U = 0; U < N.length; U++) { const k = N[U]; let K = null; if (s.renderState.layers === void 0) K = D.getViewport(k); else { const j = d.getViewSubImage(p, k); r.bindXRFramebuffer(h6), t13.framebufferTexture2D(36160, 36064, 3553, j.colorTexture, 0), j.depthStencilTexture !== void 0 && t13.framebufferTexture2D(36160, 36096, 3553, j.depthStencilTexture, 0), K = j.viewport; } const ie = v[U]; ie.matrix.fromArray(k.transform.matrix), ie.projectionMatrix.fromArray(k.projectionMatrix), ie.viewport.set(K.x, K.y, K.width, K.height), U === 0 && m.matrix.copy(ie.matrix), B === true && m.cameras.push(ie); } } const O = s.inputSources; for (let N = 0; N < g.length; N++) { const D = g[N], B = O[N]; D.update(B, b, a); } C && C(I, b); } const P = new Tx2(); P.setAnimationLoop(A), this.setAnimationLoop = function(I) { C = I; }, this.dispose = function() { }; } }; function DN(n) { function e(v, m) { v.fogColor.value.copy(m.color), m.isFog ? (v.fogNear.value = m.near, v.fogFar.value = m.far) : m.isFogExp2 && (v.fogDensity.value = m.density); } function t13(v, m, w, S, T) { m.isMeshBasicMaterial ? i(v, m) : m.isMeshLambertMaterial ? (i(v, m), c(v, m)) : m.isMeshToonMaterial ? (i(v, m), d(v, m)) : m.isMeshPhongMaterial ? (i(v, m), l(v, m)) : m.isMeshStandardMaterial ? (i(v, m), m.isMeshPhysicalMaterial ? p(v, m, T) : h6(v, m)) : m.isMeshMatcapMaterial ? (i(v, m), g(v, m)) : m.isMeshDepthMaterial ? (i(v, m), f(v, m)) : m.isMeshDistanceMaterial ? (i(v, m), u(v, m)) : m.isMeshNormalMaterial ? (i(v, m), y(v, m)) : m.isLineBasicMaterial ? (r(v, m), m.isLineDashedMaterial && s(v, m)) : m.isPointsMaterial ? o(v, m, w, S) : m.isSpriteMaterial ? a(v, m) : m.isShadowMaterial ? (v.color.value.copy(m.color), v.opacity.value = m.opacity) : m.isShaderMaterial && (m.uniformsNeedUpdate = false); } function i(v, m) { v.opacity.value = m.opacity, m.color && v.diffuse.value.copy(m.color), m.emissive && v.emissive.value.copy(m.emissive).multiplyScalar(m.emissiveIntensity), m.map && (v.map.value = m.map), m.alphaMap && (v.alphaMap.value = m.alphaMap), m.specularMap && (v.specularMap.value = m.specularMap); const w = n.get(m).envMap; if (w) { v.envMap.value = w, v.flipEnvMap.value = w.isCubeTexture && w._needsFlipEnvMap ? -1 : 1, v.reflectivity.value = m.reflectivity, v.refractionRatio.value = m.refractionRatio; const M = n.get(w).__maxMipLevel; M !== void 0 && (v.maxMipLevel.value = M); } m.lightMap && (v.lightMap.value = m.lightMap, v.lightMapIntensity.value = m.lightMapIntensity), m.aoMap && (v.aoMap.value = m.aoMap, v.aoMapIntensity.value = m.aoMapIntensity); let S; m.map ? S = m.map : m.specularMap ? S = m.specularMap : m.displacementMap ? S = m.displacementMap : m.normalMap ? S = m.normalMap : m.bumpMap ? S = m.bumpMap : m.roughnessMap ? S = m.roughnessMap : m.metalnessMap ? S = m.metalnessMap : m.alphaMap ? S = m.alphaMap : m.emissiveMap ? S = m.emissiveMap : m.clearcoatMap ? S = m.clearcoatMap : m.clearcoatNormalMap ? S = m.clearcoatNormalMap : m.clearcoatRoughnessMap && (S = m.clearcoatRoughnessMap), S !== void 0 && (S.isWebGLRenderTarget && (S = S.texture), S.matrixAutoUpdate === true && S.updateMatrix(), v.uvTransform.value.copy(S.matrix)); let T; m.aoMap ? T = m.aoMap : m.lightMap && (T = m.lightMap), T !== void 0 && (T.isWebGLRenderTarget && (T = T.texture), T.matrixAutoUpdate === true && T.updateMatrix(), v.uv2Transform.value.copy(T.matrix)); } function r(v, m) { v.diffuse.value.copy(m.color), v.opacity.value = m.opacity; } function s(v, m) { v.dashSize.value = m.dashSize, v.totalSize.value = m.dashSize + m.gapSize, v.scale.value = m.scale; } function o(v, m, w, S) { v.diffuse.value.copy(m.color), v.opacity.value = m.opacity, v.size.value = m.size * w, v.scale.value = S * 0.5, m.map && (v.map.value = m.map), m.alphaMap && (v.alphaMap.value = m.alphaMap); let T; m.map ? T = m.map : m.alphaMap && (T = m.alphaMap), T !== void 0 && (T.matrixAutoUpdate === true && T.updateMatrix(), v.uvTransform.value.copy(T.matrix)); } function a(v, m) { v.diffuse.value.copy(m.color), v.opacity.value = m.opacity, v.rotation.value = m.rotation, m.map && (v.map.value = m.map), m.alphaMap && (v.alphaMap.value = m.alphaMap); let w; m.map ? w = m.map : m.alphaMap && (w = m.alphaMap), w !== void 0 && (w.matrixAutoUpdate === true && w.updateMatrix(), v.uvTransform.value.copy(w.matrix)); } function c(v, m) { m.emissiveMap && (v.emissiveMap.value = m.emissiveMap); } function l(v, m) { v.specular.value.copy(m.specular), v.shininess.value = Math.max(m.shininess, 1e-4), m.emissiveMap && (v.emissiveMap.value = m.emissiveMap), m.bumpMap && (v.bumpMap.value = m.bumpMap, v.bumpScale.value = m.bumpScale, m.side === qt2 && (v.bumpScale.value *= -1)), m.normalMap && (v.normalMap.value = m.normalMap, v.normalScale.value.copy(m.normalScale), m.side === qt2 && v.normalScale.value.negate()), m.displacementMap && (v.displacementMap.value = m.displacementMap, v.displacementScale.value = m.displacementScale, v.displacementBias.value = m.displacementBias); } function d(v, m) { m.gradientMap && (v.gradientMap.value = m.gradientMap), m.emissiveMap && (v.emissiveMap.value = m.emissiveMap), m.bumpMap && (v.bumpMap.value = m.bumpMap, v.bumpScale.value = m.bumpScale, m.side === qt2 && (v.bumpScale.value *= -1)), m.normalMap && (v.normalMap.value = m.normalMap, v.normalScale.value.copy(m.normalScale), m.side === qt2 && v.normalScale.value.negate()), m.displacementMap && (v.displacementMap.value = m.displacementMap, v.displacementScale.value = m.displacementScale, v.displacementBias.value = m.displacementBias); } function h6(v, m) { v.roughness.value = m.roughness, v.metalness.value = m.metalness, m.roughnessMap && (v.roughnessMap.value = m.roughnessMap), m.metalnessMap && (v.metalnessMap.value = m.metalnessMap), m.emissiveMap && (v.emissiveMap.value = m.emissiveMap), m.bumpMap && (v.bumpMap.value = m.bumpMap, v.bumpScale.value = m.bumpScale, m.side === qt2 && (v.bumpScale.value *= -1)), m.normalMap && (v.normalMap.value = m.normalMap, v.normalScale.value.copy(m.normalScale), m.side === qt2 && v.normalScale.value.negate()), m.displacementMap && (v.displacementMap.value = m.displacementMap, v.displacementScale.value = m.displacementScale, v.displacementBias.value = m.displacementBias), n.get(m).envMap && (v.envMapIntensity.value = m.envMapIntensity); } function p(v, m, w) { h6(v, m), v.reflectivity.value = m.reflectivity, v.clearcoat.value = m.clearcoat, v.clearcoatRoughness.value = m.clearcoatRoughness, m.sheen && v.sheen.value.copy(m.sheen), m.clearcoatMap && (v.clearcoatMap.value = m.clearcoatMap), m.clearcoatRoughnessMap && (v.clearcoatRoughnessMap.value = m.clearcoatRoughnessMap), m.clearcoatNormalMap && (v.clearcoatNormalScale.value.copy(m.clearcoatNormalScale), v.clearcoatNormalMap.value = m.clearcoatNormalMap, m.side === qt2 && v.clearcoatNormalScale.value.negate()), v.transmission.value = m.transmission, m.transmissionMap && (v.transmissionMap.value = m.transmissionMap), m.transmission > 0 && (v.transmissionSamplerMap.value = w.texture, v.transmissionSamplerSize.value.set(w.width, w.height)), v.thickness.value = m.thickness, m.thicknessMap && (v.thicknessMap.value = m.thicknessMap), v.attenuationDistance.value = m.attenuationDistance, v.attenuationColor.value.copy(m.attenuationColor); } function g(v, m) { m.matcap && (v.matcap.value = m.matcap), m.bumpMap && (v.bumpMap.value = m.bumpMap, v.bumpScale.value = m.bumpScale, m.side === qt2 && (v.bumpScale.value *= -1)), m.normalMap && (v.normalMap.value = m.normalMap, v.normalScale.value.copy(m.normalScale), m.side === qt2 && v.normalScale.value.negate()), m.displacementMap && (v.displacementMap.value = m.displacementMap, v.displacementScale.value = m.displacementScale, v.displacementBias.value = m.displacementBias); } function f(v, m) { m.displacementMap && (v.displacementMap.value = m.displacementMap, v.displacementScale.value = m.displacementScale, v.displacementBias.value = m.displacementBias); } function u(v, m) { m.displacementMap && (v.displacementMap.value = m.displacementMap, v.displacementScale.value = m.displacementScale, v.displacementBias.value = m.displacementBias), v.referencePosition.value.copy(m.referencePosition), v.nearDistance.value = m.nearDistance, v.farDistance.value = m.farDistance; } function y(v, m) { m.bumpMap && (v.bumpMap.value = m.bumpMap, v.bumpScale.value = m.bumpScale, m.side === qt2 && (v.bumpScale.value *= -1)), m.normalMap && (v.normalMap.value = m.normalMap, v.normalScale.value.copy(m.normalScale), m.side === qt2 && v.normalScale.value.negate()), m.displacementMap && (v.displacementMap.value = m.displacementMap, v.displacementScale.value = m.displacementScale, v.displacementBias.value = m.displacementBias); } return { refreshFogUniforms: e, refreshMaterialUniforms: t13 }; } function NN() { const n = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas"); return n.style.display = "block", n; } function Et(n = {}) { const e = n.canvas !== void 0 ? n.canvas : NN(), t13 = n.context !== void 0 ? n.context : null, i = n.alpha !== void 0 ? n.alpha : false, r = n.depth !== void 0 ? n.depth : true, s = n.stencil !== void 0 ? n.stencil : true, o = n.antialias !== void 0 ? n.antialias : false, a = n.premultipliedAlpha !== void 0 ? n.premultipliedAlpha : true, c = n.preserveDrawingBuffer !== void 0 ? n.preserveDrawingBuffer : false, l = n.powerPreference !== void 0 ? n.powerPreference : "default", d = n.failIfMajorPerformanceCaveat !== void 0 ? n.failIfMajorPerformanceCaveat : false; let h6 = null, p = null; const g = [], f = []; this.domElement = e, this.debug = { /** * Enables error checking and reporting when shader programs are being compiled * @type {boolean} */ checkShaderErrors: true }, this.autoClear = true, this.autoClearColor = true, this.autoClearDepth = true, this.autoClearStencil = true, this.sortObjects = true, this.clippingPlanes = [], this.localClippingEnabled = false, this.gammaFactor = 2, this.outputEncoding = Dn2, this.physicallyCorrectLights = false, this.toneMapping = Vr2, this.toneMappingExposure = 1; const u = this; let y = false, v = 0, m = 0, w = null, S = -1, T = null; const M = new _t2(), x = new _t2(); let _ = null, E = e.width, L = e.height, R = 1, C = null, A = null; const P = new _t2(0, 0, E, L), I = new _t2(0, 0, E, L); let b = false; const O = [], N = new Ml2(); let D = false, B = false, U = null; const k = new $e2(), K = new X(), ie = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: true }; function j() { return w === null ? R : 1; } let G = t13; function W(Z, ye) { for (let me = 0; me < Z.length; me++) { const Me = Z[me], Oe = e.getContext(Me, ye); if (Oe !== null) return Oe; } return null; } try { const Z = { alpha: i, depth: r, stencil: s, antialias: o, premultipliedAlpha: a, preserveDrawingBuffer: c, powerPreference: l, failIfMajorPerformanceCaveat: d }; if (e.addEventListener("webglcontextlost", et2, false), e.addEventListener("webglcontextrestored", mt, false), G === null) { const ye = ["webgl2", "webgl", "experimental-webgl"]; if (u.isWebGL1Renderer === true && ye.shift(), G = W(ye, Z), G === null) throw W(ye) ? new Error("Error creating WebGL context with your selected attributes.") : new Error("Error creating WebGL context."); } G.getShaderPrecisionFormat === void 0 && (G.getShaderPrecisionFormat = function() { return { rangeMin: 1, rangeMax: 1, precision: 1 }; }); } catch (Z) { throw console.error("THREE.WebGLRenderer: " + Z.message), Z; } let q, Q, ee, ne, Y, te, F, $, J, z, V, oe, ue, le, ve, xe, Te, de, we, se, Se2, ge; function be2() { q = new sD2(G), Q = new nD2(G, q, n), q.init(Q), Se2 = new Dx2(G, q, Q), ee = new RN(G, q, Q), O[0] = 1029, ne = new lD2(), Y = new bN(), te = new PN(G, q, ee, Y, Q, Se2, ne), F = new rD2(u), $ = new PI(G, Q), ge = new eD2(G, q, $, Q), J = new oD2(G, $, ne, ge), z = new dD2(G, J, $, ne), de = new hD2(G), ve = new iD2(Y), V = new yN(u, F, q, Q, ge, ve), oe = new DN(Y), ue = new wN(Y), le = new AN(q, Q), Te = new Q32(u, F, ee, z, a), xe = new Ox2(u, z, Q), we = new tD2(G, q, ne, Q), se = new aD2(G, q, ne, Q), ne.programs = V.programs, u.capabilities = Q, u.extensions = q, u.properties = Y, u.renderLists = ue, u.shadowMap = xe, u.state = ee, u.info = ne; } be2(); const Ie2 = new ON(u, G); this.xr = Ie2, this.getContext = function() { return G; }, this.getContextAttributes = function() { return G.getContextAttributes(); }, this.forceContextLoss = function() { const Z = q.get("WEBGL_lose_context"); Z && Z.loseContext(); }, this.forceContextRestore = function() { const Z = q.get("WEBGL_lose_context"); Z && Z.restoreContext(); }, this.getPixelRatio = function() { return R; }, this.setPixelRatio = function(Z) { Z !== void 0 && (R = Z, this.setSize(E, L, false)); }, this.getSize = function(Z) { return Z.set(E, L); }, this.setSize = function(Z, ye, me) { if (Ie2.isPresenting) { console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."); return; } E = Z, L = ye, e.width = Math.floor(Z * R), e.height = Math.floor(ye * R), me !== false && (e.style.width = Z + "px", e.style.height = ye + "px"), this.setViewport(0, 0, Z, ye); }, this.getDrawingBufferSize = function(Z) { return Z.set(E * R, L * R).floor(); }, this.setDrawingBufferSize = function(Z, ye, me) { E = Z, L = ye, R = me, e.width = Math.floor(Z * me), e.height = Math.floor(ye * me), this.setViewport(0, 0, Z, ye); }, this.getCurrentViewport = function(Z) { return Z.copy(M); }, this.getViewport = function(Z) { return Z.copy(P); }, this.setViewport = function(Z, ye, me, Me) { Z.isVector4 ? P.set(Z.x, Z.y, Z.z, Z.w) : P.set(Z, ye, me, Me), ee.viewport(M.copy(P).multiplyScalar(R).floor()); }, this.getScissor = function(Z) { return Z.copy(I); }, this.setScissor = function(Z, ye, me, Me) { Z.isVector4 ? I.set(Z.x, Z.y, Z.z, Z.w) : I.set(Z, ye, me, Me), ee.scissor(x.copy(I).multiplyScalar(R).floor()); }, this.getScissorTest = function() { return b; }, this.setScissorTest = function(Z) { ee.setScissorTest(b = Z); }, this.setOpaqueSort = function(Z) { C = Z; }, this.setTransparentSort = function(Z) { A = Z; }, this.getClearColor = function(Z) { return Z.copy(Te.getClearColor()); }, this.setClearColor = function() { Te.setClearColor.apply(Te, arguments); }, this.getClearAlpha = function() { return Te.getClearAlpha(); }, this.setClearAlpha = function() { Te.setClearAlpha.apply(Te, arguments); }, this.clear = function(Z, ye, me) { let Me = 0; (Z === void 0 || Z) && (Me |= 16384), (ye === void 0 || ye) && (Me |= 256), (me === void 0 || me) && (Me |= 1024), G.clear(Me); }, this.clearColor = function() { this.clear(true, false, false); }, this.clearDepth = function() { this.clear(false, true, false); }, this.clearStencil = function() { this.clear(false, false, true); }, this.dispose = function() { e.removeEventListener("webglcontextlost", et2, false), e.removeEventListener("webglcontextrestored", mt, false), ue.dispose(), le.dispose(), Y.dispose(), F.dispose(), z.dispose(), ge.dispose(), Ie2.dispose(), Ie2.removeEventListener("sessionstart", pt2), Ie2.removeEventListener("sessionend", Vt2), U && (U.dispose(), U = null), Nt2.stop(); }; function et2(Z) { Z.preventDefault(), console.log("THREE.WebGLRenderer: Context Lost."), y = true; } function mt() { console.log("THREE.WebGLRenderer: Context Restored."), y = false; const Z = ne.autoReset, ye = xe.enabled, me = xe.autoUpdate, Me = xe.needsUpdate, Oe = xe.type; be2(), ne.autoReset = Z, xe.enabled = ye, xe.autoUpdate = me, xe.needsUpdate = Me, xe.type = Oe; } function Ue(Z) { const ye = Z.target; ye.removeEventListener("dispose", Ue), bt2(ye); } function bt2(Z) { Ve(Z), Y.remove(Z); } function Ve(Z) { const ye = Y.get(Z).programs; ye !== void 0 && ye.forEach(function(me) { V.releaseProgram(me); }); } function lt(Z, ye) { Z.render(function(me) { u.renderBufferImmediate(me, ye); }); } this.renderBufferImmediate = function(Z, ye) { ge.initAttributes(); const me = Y.get(Z); Z.hasPositions && !me.position && (me.position = G.createBuffer()), Z.hasNormals && !me.normal && (me.normal = G.createBuffer()), Z.hasUvs && !me.uv && (me.uv = G.createBuffer()), Z.hasColors && !me.color && (me.color = G.createBuffer()); const Me = ye.getAttributes(); Z.hasPositions && (G.bindBuffer(34962, me.position), G.bufferData(34962, Z.positionArray, 35048), ge.enableAttribute(Me.position), G.vertexAttribPointer(Me.position, 3, 5126, false, 0, 0)), Z.hasNormals && (G.bindBuffer(34962, me.normal), G.bufferData(34962, Z.normalArray, 35048), ge.enableAttribute(Me.normal), G.vertexAttribPointer(Me.normal, 3, 5126, false, 0, 0)), Z.hasUvs && (G.bindBuffer(34962, me.uv), G.bufferData(34962, Z.uvArray, 35048), ge.enableAttribute(Me.uv), G.vertexAttribPointer(Me.uv, 2, 5126, false, 0, 0)), Z.hasColors && (G.bindBuffer(34962, me.color), G.bufferData(34962, Z.colorArray, 35048), ge.enableAttribute(Me.color), G.vertexAttribPointer(Me.color, 3, 5126, false, 0, 0)), ge.disableUnusedAttributes(), G.drawArrays(4, 0, Z.count), Z.count = 0; }, this.renderBufferDirect = function(Z, ye, me, Me, Oe, he) { ye === null && (ye = ie); const _e = Oe.isMesh && Oe.matrixWorld.determinant() < 0, Ce = Tt(Z, ye, Me, Oe); ee.setMaterial(Me, _e); let ke = me.index; const Ze = me.attributes.position; if (ke === null) { if (Ze === void 0 || Ze.count === 0) return; } else if (ke.count === 0) return; let Qe = 1; Me.wireframe === true && (ke = J.getWireframeAttribute(me), Qe = 2), (Me.morphTargets || Me.morphNormals) && de.update(Oe, me, Me, Ce), ge.setup(Oe, Me, Ce, me, ke); let qe, ut = we; ke !== null && (qe = $.get(ke), ut = se, ut.setIndex(qe)); const Zt = ke !== null ? ke.count : Ze.count, hn3 = me.drawRange.start * Qe, os2 = me.drawRange.count * Qe, Rt2 = he !== null ? he.start * Qe : 0, as2 = he !== null ? he.count * Qe : 1 / 0, Tn = Math.max(hn3, Rt2), qw2 = Math.min(Zt, hn3 + os2, Rt2 + as2) - 1, Dl2 = Math.max(0, qw2 - Tn + 1); if (Dl2 !== 0) { if (Oe.isMesh) Me.wireframe === true ? (ee.setLineWidth(Me.wireframeLinewidth * j()), ut.setMode(1)) : ut.setMode(4); else if (Oe.isLine) { let ma2 = Me.linewidth; ma2 === void 0 && (ma2 = 1), ee.setLineWidth(ma2 * j()), Oe.isLineSegments ? ut.setMode(1) : Oe.isLineLoop ? ut.setMode(2) : ut.setMode(3); } else Oe.isPoints ? ut.setMode(0) : Oe.isSprite && ut.setMode(4); if (Oe.isInstancedMesh) ut.renderInstances(Tn, Dl2, Oe.count); else if (me.isInstancedBufferGeometry) { const ma2 = Math.min(me.instanceCount, me._maxInstanceCount); ut.renderInstances(Tn, Dl2, ma2); } else ut.render(Tn, Dl2); } }, this.compile = function(Z, ye) { p = le.get(Z), p.init(), Z.traverseVisible(function(me) { me.isLight && me.layers.test(ye.layers) && (p.pushLight(me), me.castShadow && p.pushShadow(me)); }), p.setupLights(), Z.traverse(function(me) { const Me = me.material; if (Me) if (Array.isArray(Me)) for (let Oe = 0; Oe < Me.length; Oe++) { const he = Me[Oe]; rt2(he, Z, me); } else rt2(Me, Z, me); }); }; let tt2 = null; function xt(Z) { tt2 && tt2(Z); } function pt2() { Nt2.stop(); } function Vt2() { Nt2.start(); } const Nt2 = new Tx2(); Nt2.setAnimationLoop(xt), typeof window < "u" && Nt2.setContext(window), this.setAnimationLoop = function(Z) { tt2 = Z, Ie2.setAnimationLoop(Z), Z === null ? Nt2.stop() : Nt2.start(); }, Ie2.addEventListener("sessionstart", pt2), Ie2.addEventListener("sessionend", Vt2), this.render = function(Z, ye) { if (ye !== void 0 && ye.isCamera !== true) { console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera."); return; } if (y === true) return; Z.autoUpdate === true && Z.updateMatrixWorld(), ye.parent === null && ye.updateMatrixWorld(), Ie2.enabled === true && Ie2.isPresenting === true && (Ie2.cameraAutoUpdate === true && Ie2.updateCamera(ye), ye = Ie2.getCamera()), Z.isScene === true && Z.onBeforeRender(u, Z, ye, w), p = le.get(Z, f.length), p.init(), f.push(p), k.multiplyMatrices(ye.projectionMatrix, ye.matrixWorldInverse), N.setFromProjectionMatrix(k), B = this.localClippingEnabled, D = ve.init(this.clippingPlanes, B, ye), h6 = ue.get(Z, g.length), h6.init(), g.push(h6), re(Z, ye, 0, u.sortObjects), h6.finish(), u.sortObjects === true && h6.sort(C, A), D === true && ve.beginShadows(); const me = p.state.shadowsArray; xe.render(me, Z, ye), p.setupLights(), p.setupLightsView(ye), D === true && ve.endShadows(), this.info.autoReset === true && this.info.reset(), Te.render(h6, Z); const Me = h6.opaque, Oe = h6.transmissive, he = h6.transparent; Me.length > 0 && Ne(Me, Z, ye), Oe.length > 0 && Ee(Me, Oe, Z, ye), he.length > 0 && Ne(he, Z, ye), w !== null && (te.updateMultisampleRenderTarget(w), te.updateRenderTargetMipmap(w)), Z.isScene === true && Z.onAfterRender(u, Z, ye), ee.buffers.depth.setTest(true), ee.buffers.depth.setMask(true), ee.buffers.color.setMask(true), ee.setPolygonOffset(false), ge.resetDefaultState(), S = -1, T = null, f.pop(), f.length > 0 ? p = f[f.length - 1] : p = null, g.pop(), g.length > 0 ? h6 = g[g.length - 1] : h6 = null; }; function re(Z, ye, me, Me) { if (Z.visible === false) return; if (Z.layers.test(ye.layers)) { if (Z.isGroup) me = Z.renderOrder; else if (Z.isLOD) Z.autoUpdate === true && Z.update(ye); else if (Z.isLight) p.pushLight(Z), Z.castShadow && p.pushShadow(Z); else if (Z.isSprite) { if (!Z.frustumCulled || N.intersectsSprite(Z)) { Me && K.setFromMatrixPosition(Z.matrixWorld).applyMatrix4(k); const _e = z.update(Z), Ce = Z.material; Ce.visible && h6.push(Z, _e, Ce, me, K.z, null); } } else if (Z.isImmediateRenderObject) Me && K.setFromMatrixPosition(Z.matrixWorld).applyMatrix4(k), h6.push(Z, null, Z.material, me, K.z, null); else if ((Z.isMesh || Z.isLine || Z.isPoints) && (Z.isSkinnedMesh && Z.skeleton.frame !== ne.render.frame && (Z.skeleton.update(), Z.skeleton.frame = ne.render.frame), !Z.frustumCulled || N.intersectsObject(Z))) { Me && K.setFromMatrixPosition(Z.matrixWorld).applyMatrix4(k); const _e = z.update(Z), Ce = Z.material; if (Array.isArray(Ce)) { const ke = _e.groups; for (let Ze = 0, Qe = ke.length; Ze < Qe; Ze++) { const qe = ke[Ze], ut = Ce[qe.materialIndex]; ut && ut.visible && h6.push(Z, _e, ut, me, K.z, qe); } } else Ce.visible && h6.push(Z, _e, Ce, me, K.z, null); } } const he = Z.children; for (let _e = 0, Ce = he.length; _e < Ce; _e++) re(he[_e], ye, me, Me); } function Ee(Z, ye, me, Me) { if (U === null) { const Ce = o === true && Q.isWebGL2 === true ? Jf2 : bi2; U = new Ce(1024, 1024, { generateMipmaps: true, type: Se2.convert(Ts2) !== null ? Ts2 : Ps2, minFilter: br2, magFilter: Kt2, wrapS: mn2, wrapT: mn2 }); } const Oe = u.getRenderTarget(); u.setRenderTarget(U), u.clear(); const he = u.toneMapping; u.toneMapping = Vr2, Ne(Z, me, Me), u.toneMapping = he, te.updateMultisampleRenderTarget(U), te.updateRenderTargetMipmap(U), u.setRenderTarget(Oe), Ne(ye, me, Me); } function Ne(Z, ye, me) { const Me = ye.isScene === true ? ye.overrideMaterial : null; for (let Oe = 0, he = Z.length; Oe < he; Oe++) { const _e = Z[Oe], Ce = _e.object, ke = _e.geometry, Ze = Me === null ? _e.material : Me, Qe = _e.group; if (me.isArrayCamera) { const qe = me.cameras; for (let ut = 0, Zt = qe.length; ut < Zt; ut++) { const hn3 = qe[ut]; Ce.layers.test(hn3.layers) && (ee.viewport(M.copy(hn3.viewport)), p.setupLightsView(hn3), je2(Ce, ye, hn3, ke, Ze, Qe)); } } else je2(Ce, ye, me, ke, Ze, Qe); } } function je2(Z, ye, me, Me, Oe, he) { if (Z.onBeforeRender(u, ye, me, Me, Oe, he), Z.modelViewMatrix.multiplyMatrices(me.matrixWorldInverse, Z.matrixWorld), Z.normalMatrix.getNormalMatrix(Z.modelViewMatrix), Z.isImmediateRenderObject) { const _e = Tt(me, ye, Oe, Z); ee.setMaterial(Oe), ge.reset(), lt(Z, _e); } else Oe.transparent === true && Oe.side === Yr2 ? (Oe.side = qt2, Oe.needsUpdate = true, u.renderBufferDirect(me, ye, Me, Oe, Z, he), Oe.side = Xr2, Oe.needsUpdate = true, u.renderBufferDirect(me, ye, Me, Oe, Z, he), Oe.side = Yr2) : u.renderBufferDirect(me, ye, Me, Oe, Z, he); Z.onAfterRender(u, ye, me, Me, Oe, he); } function rt2(Z, ye, me) { ye.isScene !== true && (ye = ie); const Me = Y.get(Z), Oe = p.state.lights, he = p.state.shadowsArray, _e = Oe.state.version, Ce = V.getParameters(Z, Oe.state, he, ye, me), ke = V.getProgramCacheKey(Ce); let Ze = Me.programs; Me.environment = Z.isMeshStandardMaterial ? ye.environment : null, Me.fog = ye.fog, Me.envMap = F.get(Z.envMap || Me.environment), Ze === void 0 && (Z.addEventListener("dispose", Ue), Ze = /* @__PURE__ */ new Map(), Me.programs = Ze); let Qe = Ze.get(ke); if (Qe !== void 0) { if (Me.currentProgram === Qe && Me.lightsStateVersion === _e) return gt(Z, Ce), Qe; } else Ce.uniforms = V.getUniforms(Z), Z.onBuild(Ce, u), Z.onBeforeCompile(Ce, u), Qe = V.acquireProgram(Ce, ke), Ze.set(ke, Qe), Me.uniforms = Ce.uniforms; const qe = Me.uniforms; (!Z.isShaderMaterial && !Z.isRawShaderMaterial || Z.clipping === true) && (qe.clippingPlanes = ve.uniform), gt(Z, Ce), Me.needsLights = kt(Z), Me.lightsStateVersion = _e, Me.needsLights && (qe.ambientLightColor.value = Oe.state.ambient, qe.lightProbe.value = Oe.state.probe, qe.directionalLights.value = Oe.state.directional, qe.directionalLightShadows.value = Oe.state.directionalShadow, qe.spotLights.value = Oe.state.spot, qe.spotLightShadows.value = Oe.state.spotShadow, qe.rectAreaLights.value = Oe.state.rectArea, qe.ltc_1.value = Oe.state.rectAreaLTC1, qe.ltc_2.value = Oe.state.rectAreaLTC2, qe.pointLights.value = Oe.state.point, qe.pointLightShadows.value = Oe.state.pointShadow, qe.hemisphereLights.value = Oe.state.hemi, qe.directionalShadowMap.value = Oe.state.directionalShadowMap, qe.directionalShadowMatrix.value = Oe.state.directionalShadowMatrix, qe.spotShadowMap.value = Oe.state.spotShadowMap, qe.spotShadowMatrix.value = Oe.state.spotShadowMatrix, qe.pointShadowMap.value = Oe.state.pointShadowMap, qe.pointShadowMatrix.value = Oe.state.pointShadowMatrix); const ut = Qe.getUniforms(), Zt = kr2.seqWithValue(ut.seq, qe); return Me.currentProgram = Qe, Me.uniformsList = Zt, Qe; } function gt(Z, ye) { const me = Y.get(Z); me.outputEncoding = ye.outputEncoding, me.instancing = ye.instancing, me.skinning = ye.skinning, me.numClippingPlanes = ye.numClippingPlanes, me.numIntersection = ye.numClipIntersection, me.vertexAlphas = ye.vertexAlphas; } function Tt(Z, ye, me, Me) { ye.isScene !== true && (ye = ie), te.resetTextureUnits(); const Oe = ye.fog, he = me.isMeshStandardMaterial ? ye.environment : null, _e = w === null ? u.outputEncoding : w.texture.encoding, Ce = F.get(me.envMap || he), ke = me.vertexColors === true && Me.geometry && Me.geometry.attributes.color && Me.geometry.attributes.color.itemSize === 4, Ze = Y.get(me), Qe = p.state.lights; if (D === true && (B === true || Z !== T)) { const Tn = Z === T && me.id === S; ve.setState(me, Z, Tn); } let qe = false; me.version === Ze.__version ? (Ze.needsLights && Ze.lightsStateVersion !== Qe.state.version || Ze.outputEncoding !== _e || Me.isInstancedMesh && Ze.instancing === false || !Me.isInstancedMesh && Ze.instancing === true || Me.isSkinnedMesh && Ze.skinning === false || !Me.isSkinnedMesh && Ze.skinning === true || Ze.envMap !== Ce || me.fog && Ze.fog !== Oe || Ze.numClippingPlanes !== void 0 && (Ze.numClippingPlanes !== ve.numPlanes || Ze.numIntersection !== ve.numIntersection) || Ze.vertexAlphas !== ke) && (qe = true) : (qe = true, Ze.__version = me.version); let ut = Ze.currentProgram; qe === true && (ut = rt2(me, ye, Me)); let Zt = false, hn3 = false, os2 = false; const Rt2 = ut.getUniforms(), as2 = Ze.uniforms; if (ee.useProgram(ut.program) && (Zt = true, hn3 = true, os2 = true), me.id !== S && (S = me.id, hn3 = true), Zt || T !== Z) { if (Rt2.setValue(G, "projectionMatrix", Z.projectionMatrix), Q.logarithmicDepthBuffer && Rt2.setValue( G, "logDepthBufFC", 2 / (Math.log(Z.far + 1) / Math.LN2) ), T !== Z && (T = Z, hn3 = true, os2 = true), me.isShaderMaterial || me.isMeshPhongMaterial || me.isMeshToonMaterial || me.isMeshStandardMaterial || me.envMap) { const Tn = Rt2.map.cameraPosition; Tn !== void 0 && Tn.setValue( G, K.setFromMatrixPosition(Z.matrixWorld) ); } (me.isMeshPhongMaterial || me.isMeshToonMaterial || me.isMeshLambertMaterial || me.isMeshBasicMaterial || me.isMeshStandardMaterial || me.isShaderMaterial) && Rt2.setValue(G, "isOrthographic", Z.isOrthographicCamera === true), (me.isMeshPhongMaterial || me.isMeshToonMaterial || me.isMeshLambertMaterial || me.isMeshBasicMaterial || me.isMeshStandardMaterial || me.isShaderMaterial || me.isShadowMaterial || Me.isSkinnedMesh) && Rt2.setValue(G, "viewMatrix", Z.matrixWorldInverse); } if (Me.isSkinnedMesh) { Rt2.setOptional(G, Me, "bindMatrix"), Rt2.setOptional(G, Me, "bindMatrixInverse"); const Tn = Me.skeleton; Tn && (Q.floatVertexTextures ? (Tn.boneTexture === null && Tn.computeBoneTexture(), Rt2.setValue(G, "boneTexture", Tn.boneTexture, te), Rt2.setValue(G, "boneTextureSize", Tn.boneTextureSize)) : Rt2.setOptional(G, Tn, "boneMatrices")); } return (hn3 || Ze.receiveShadow !== Me.receiveShadow) && (Ze.receiveShadow = Me.receiveShadow, Rt2.setValue(G, "receiveShadow", Me.receiveShadow)), hn3 && (Rt2.setValue(G, "toneMappingExposure", u.toneMappingExposure), Ze.needsLights && Lt2(as2, os2), Oe && me.fog && oe.refreshFogUniforms(as2, Oe), oe.refreshMaterialUniforms(as2, me, R, L, U), kr2.upload(G, Ze.uniformsList, as2, te)), me.isShaderMaterial && me.uniformsNeedUpdate === true && (kr2.upload(G, Ze.uniformsList, as2, te), me.uniformsNeedUpdate = false), me.isSpriteMaterial && Rt2.setValue(G, "center", Me.center), Rt2.setValue(G, "modelViewMatrix", Me.modelViewMatrix), Rt2.setValue(G, "normalMatrix", Me.normalMatrix), Rt2.setValue(G, "modelMatrix", Me.matrixWorld), ut; } function Lt2(Z, ye) { Z.ambientLightColor.needsUpdate = ye, Z.lightProbe.needsUpdate = ye, Z.directionalLights.needsUpdate = ye, Z.directionalLightShadows.needsUpdate = ye, Z.pointLights.needsUpdate = ye, Z.pointLightShadows.needsUpdate = ye, Z.spotLights.needsUpdate = ye, Z.spotLightShadows.needsUpdate = ye, Z.rectAreaLights.needsUpdate = ye, Z.hemisphereLights.needsUpdate = ye; } function kt(Z) { return Z.isMeshLambertMaterial || Z.isMeshToonMaterial || Z.isMeshPhongMaterial || Z.isMeshStandardMaterial || Z.isShadowMaterial || Z.isShaderMaterial && Z.lights === true; } this.getActiveCubeFace = function() { return v; }, this.getActiveMipmapLevel = function() { return m; }, this.getRenderTarget = function() { return w; }, this.setRenderTarget = function(Z, ye = 0, me = 0) { w = Z, v = ye, m = me, Z && Y.get(Z).__webglFramebuffer === void 0 && te.setupRenderTarget(Z); let Me = null, Oe = false, he = false; if (Z) { const Ce = Z.texture; (Ce.isDataTexture3D || Ce.isDataTexture2DArray) && (he = true); const ke = Y.get(Z).__webglFramebuffer; Z.isWebGLCubeRenderTarget ? (Me = ke[ye], Oe = true) : Z.isWebGLMultisampleRenderTarget ? Me = Y.get(Z).__webglMultisampledFramebuffer : Me = ke, M.copy(Z.viewport), x.copy(Z.scissor), _ = Z.scissorTest; } else M.copy(P).multiplyScalar(R).floor(), x.copy(I).multiplyScalar(R).floor(), _ = b; if (ee.bindFramebuffer(36160, Me) && Q.drawBuffers) { let Ce = false; if (Z) if (Z.isWebGLMultipleRenderTargets) { const ke = Z.texture; if (O.length !== ke.length || O[0] !== 36064) { for (let Ze = 0, Qe = ke.length; Ze < Qe; Ze++) O[Ze] = 36064 + Ze; O.length = ke.length, Ce = true; } } else (O.length !== 1 || O[0] !== 36064) && (O[0] = 36064, O.length = 1, Ce = true); else (O.length !== 1 || O[0] !== 1029) && (O[0] = 1029, O.length = 1, Ce = true); Ce && (Q.isWebGL2 ? G.drawBuffers(O) : q.get("WEBGL_draw_buffers").drawBuffersWEBGL(O)); } if (ee.viewport(M), ee.scissor(x), ee.setScissorTest(_), Oe) { const Ce = Y.get(Z.texture); G.framebufferTexture2D(36160, 36064, 34069 + ye, Ce.__webglTexture, me); } else if (he) { const Ce = Y.get(Z.texture), ke = ye || 0; G.framebufferTextureLayer(36160, 36064, Ce.__webglTexture, me || 0, ke); } }, this.readRenderTargetPixels = function(Z, ye, me, Me, Oe, he, _e) { if (!(Z && Z.isWebGLRenderTarget)) { console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget."); return; } let Ce = Y.get(Z).__webglFramebuffer; if (Z.isWebGLCubeRenderTarget && _e !== void 0 && (Ce = Ce[_e]), Ce) { ee.bindFramebuffer(36160, Ce); try { const ke = Z.texture, Ze = ke.format, Qe = ke.type; if (Ze !== Yn2 && Se2.convert(Ze) !== G.getParameter(35739)) { console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."); return; } const qe = Qe === Ts2 && (q.has("EXT_color_buffer_half_float") || Q.isWebGL2 && q.has("EXT_color_buffer_float")); if (Qe !== Ps2 && Se2.convert(Qe) !== G.getParameter(35738) && // Edge and Chrome Mac < 52 (#9513) !(Qe === nr2 && (Q.isWebGL2 || q.has("OES_texture_float") || q.has("WEBGL_color_buffer_float"))) && // Chrome Mac >= 52 and Firefox !qe) { console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type."); return; } G.checkFramebufferStatus(36160) === 36053 ? ye >= 0 && ye <= Z.width - Me && me >= 0 && me <= Z.height - Oe && G.readPixels(ye, me, Me, Oe, Se2.convert(Ze), Se2.convert(Qe), he) : console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."); } finally { const ke = w !== null ? Y.get(w).__webglFramebuffer : null; ee.bindFramebuffer(36160, ke); } } }, this.copyFramebufferToTexture = function(Z, ye, me = 0) { const Me = Math.pow(2, -me), Oe = Math.floor(ye.image.width * Me), he = Math.floor(ye.image.height * Me); let _e = Se2.convert(ye.format); Q.isWebGL2 && (_e === 6407 && (_e = 32849), _e === 6408 && (_e = 32856)), te.setTexture2D(ye, 0), G.copyTexImage2D(3553, me, _e, Z.x, Z.y, Oe, he, 0), ee.unbindTexture(); }, this.copyTextureToTexture = function(Z, ye, me, Me = 0) { const Oe = ye.image.width, he = ye.image.height, _e = Se2.convert(me.format), Ce = Se2.convert(me.type); te.setTexture2D(me, 0), G.pixelStorei(37440, me.flipY), G.pixelStorei(37441, me.premultiplyAlpha), G.pixelStorei(3317, me.unpackAlignment), ye.isDataTexture ? G.texSubImage2D(3553, Me, Z.x, Z.y, Oe, he, _e, Ce, ye.image.data) : ye.isCompressedTexture ? G.compressedTexSubImage2D(3553, Me, Z.x, Z.y, ye.mipmaps[0].width, ye.mipmaps[0].height, _e, ye.mipmaps[0].data) : G.texSubImage2D(3553, Me, Z.x, Z.y, _e, Ce, ye.image), Me === 0 && me.generateMipmaps && G.generateMipmap(3553), ee.unbindTexture(); }, this.copyTextureToTexture3D = function(Z, ye, me, Me, Oe = 0) { if (u.isWebGL1Renderer) { console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2."); return; } const he = Z.max.x - Z.min.x + 1, _e = Z.max.y - Z.min.y + 1, Ce = Z.max.z - Z.min.z + 1, ke = Se2.convert(Me.format), Ze = Se2.convert(Me.type); let Qe; if (Me.isDataTexture3D) te.setTexture3D(Me, 0), Qe = 32879; else if (Me.isDataTexture2DArray) te.setTexture2DArray(Me, 0), Qe = 35866; else { console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray."); return; } G.pixelStorei(37440, Me.flipY), G.pixelStorei(37441, Me.premultiplyAlpha), G.pixelStorei(3317, Me.unpackAlignment); const qe = G.getParameter(3314), ut = G.getParameter(32878), Zt = G.getParameter(3316), hn3 = G.getParameter(3315), os2 = G.getParameter(32877), Rt2 = me.isCompressedTexture ? me.mipmaps[0] : me.image; G.pixelStorei(3314, Rt2.width), G.pixelStorei(32878, Rt2.height), G.pixelStorei(3316, Z.min.x), G.pixelStorei(3315, Z.min.y), G.pixelStorei(32877, Z.min.z), me.isDataTexture || me.isDataTexture3D ? G.texSubImage3D(Qe, Oe, ye.x, ye.y, ye.z, he, _e, Ce, ke, Ze, Rt2.data) : me.isCompressedTexture ? (console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."), G.compressedTexSubImage3D(Qe, Oe, ye.x, ye.y, ye.z, he, _e, Ce, ke, Rt2.data)) : G.texSubImage3D(Qe, Oe, ye.x, ye.y, ye.z, he, _e, Ce, ke, Ze, Rt2), G.pixelStorei(3314, qe), G.pixelStorei(32878, ut), G.pixelStorei(3316, Zt), G.pixelStorei(3315, hn3), G.pixelStorei(32877, os2), Oe === 0 && Me.generateMipmaps && G.generateMipmap(Qe), ee.unbindTexture(); }, this.initTexture = function(Z) { te.setTexture2D(Z, 0), ee.unbindTexture(); }, this.resetState = function() { v = 0, m = 0, w = null, ee.reset(), ge.reset(); }, typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this })); } var Nx2 = class extends Et { }; Nx2.prototype.isWebGL1Renderer = true; var Sl2 = class _Sl { constructor(e, t13 = 25e-5) { this.name = "", this.color = new Fe(e), this.density = t13; } clone() { return new _Sl(this.color, this.density); } toJSON() { return { type: "FogExp2", color: this.color.getHex(), density: this.density }; } }; Sl2.prototype.isFogExp2 = true; var _l2 = class __l { constructor(e, t13 = 1, i = 1e3) { this.name = "", this.color = new Fe(e), this.near = t13, this.far = i; } clone() { return new __l(this.color, this.near, this.far); } toJSON() { return { type: "Fog", color: this.color.getHex(), near: this.near, far: this.far }; } }; _l2.prototype.isFog = true; var Nu2 = class extends ot { constructor() { super(), this.type = "Scene", this.background = null, this.environment = null, this.fog = null, this.overrideMaterial = null, this.autoUpdate = true, typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this })); } copy(e, t13) { return super.copy(e, t13), 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 t13 = super.toJSON(e); return this.fog !== null && (t13.object.fog = this.fog.toJSON()), t13; } }; Nu2.prototype.isScene = true; var rs2 = class { constructor(e, t13) { this.array = e, this.stride = t13, this.count = e !== void 0 ? e.length / t13 : 0, this.usage = zo2, this.updateRange = { offset: 0, count: -1 }, this.version = 0, this.uuid = Jn2(); } onUploadCallback() { } set needsUpdate(e) { e === true && 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, t13, i) { e *= this.stride, i *= t13.stride; for (let r = 0, s = this.stride; r < s; r++) this.array[e + r] = t13.array[i + r]; return this; } set(e, t13 = 0) { return this.array.set(e, t13), this; } clone(e) { e.arrayBuffers === void 0 && (e.arrayBuffers = {}), this.array.buffer._uuid === void 0 && (this.array.buffer._uuid = Jn2()), e.arrayBuffers[this.array.buffer._uuid] === void 0 && (e.arrayBuffers[this.array.buffer._uuid] = this.array.slice(0).buffer); const t13 = new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]), i = new this.constructor(t13, 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 = Jn2()), 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 }; } }; rs2.prototype.isInterleavedBuffer = true; var Xt = new X(); var fr2 = class _fr { constructor(e, t13, i, r = false) { this.name = "", this.data = e, this.itemSize = t13, this.offset = i, this.normalized = r === true; } get count() { return this.data.count; } get array() { return this.data.array; } set needsUpdate(e) { this.data.needsUpdate = e; } applyMatrix4(e) { for (let t13 = 0, i = this.data.count; t13 < i; t13++) Xt.x = this.getX(t13), Xt.y = this.getY(t13), Xt.z = this.getZ(t13), Xt.applyMatrix4(e), this.setXYZ(t13, Xt.x, Xt.y, Xt.z); return this; } applyNormalMatrix(e) { for (let t13 = 0, i = this.count; t13 < i; t13++) Xt.x = this.getX(t13), Xt.y = this.getY(t13), Xt.z = this.getZ(t13), Xt.applyNormalMatrix(e), this.setXYZ(t13, Xt.x, Xt.y, Xt.z); return this; } transformDirection(e) { for (let t13 = 0, i = this.count; t13 < i; t13++) Xt.x = this.getX(t13), Xt.y = this.getY(t13), Xt.z = this.getZ(t13), Xt.transformDirection(e), this.setXYZ(t13, Xt.x, Xt.y, Xt.z); return this; } setX(e, t13) { return this.data.array[e * this.data.stride + this.offset] = t13, this; } setY(e, t13) { return this.data.array[e * this.data.stride + this.offset + 1] = t13, this; } setZ(e, t13) { return this.data.array[e * this.data.stride + this.offset + 2] = t13, this; } setW(e, t13) { return this.data.array[e * this.data.stride + this.offset + 3] = t13, 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, t13, i) { return e = e * this.data.stride + this.offset, this.data.array[e + 0] = t13, this.data.array[e + 1] = i, this; } setXYZ(e, t13, i, r) { return e = e * this.data.stride + this.offset, this.data.array[e + 0] = t13, this.data.array[e + 1] = i, this.data.array[e + 2] = r, this; } setXYZW(e, t13, i, r, s) { return e = e * this.data.stride + this.offset, this.data.array[e + 0] = t13, this.data.array[e + 1] = i, this.data.array[e + 2] = r, this.data.array[e + 3] = s, this; } clone(e) { if (e === void 0) { console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data."); const t13 = []; for (let i = 0; i < this.count; i++) { const r = i * this.data.stride + this.offset; for (let s = 0; s < this.itemSize; s++) t13.push(this.data.array[r + s]); } return new nt(new this.array.constructor(t13), 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 _fr(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 t13 = []; for (let i = 0; i < this.count; i++) { const r = i * this.data.stride + this.offset; for (let s = 0; s < this.itemSize; s++) t13.push(this.data.array[r + s]); } return { itemSize: this.itemSize, type: this.array.constructor.name, array: t13, 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: true, itemSize: this.itemSize, data: this.data.uuid, offset: this.offset, normalized: this.normalized }; } }; fr2.prototype.isInterleavedBufferAttribute = true; var Tl2 = class extends sn { constructor(e) { super(), this.type = "SpriteMaterial", this.color = new Fe(16777215), this.map = null, this.alphaMap = null, this.rotation = 0, this.sizeAttenuation = true, this.transparent = true, 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; } }; Tl2.prototype.isSpriteMaterial = true; var uo2; var _a2 = new X(); var ho = new X(); var fo2 = new X(); var po = new Pe(); var Ta2 = new Pe(); var Fx2 = new $e2(); var ac2 = new X(); var Ea2 = new X(); var lc2 = new X(); var Vg2 = new Pe(); var Rh2 = new Pe(); var kg2 = new Pe(); var El2 = class extends ot { constructor(e) { if (super(), this.type = "Sprite", uo2 === void 0) { uo2 = new Je2(); const t13 = 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 rs2(t13, 5); uo2.setIndex([0, 1, 2, 0, 2, 3]), uo2.setAttribute("position", new fr2(i, 3, 0, false)), uo2.setAttribute("uv", new fr2(i, 2, 3, false)); } this.geometry = uo2, this.material = e !== void 0 ? e : new Tl2(), this.center = new Pe(0.5, 0.5); } raycast(e, t13) { e.camera === null && console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'), ho.setFromMatrixScale(this.matrixWorld), Fx2.copy(e.camera.matrixWorld), this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse, this.matrixWorld), fo2.setFromMatrixPosition(this.modelViewMatrix), e.camera.isPerspectiveCamera && this.material.sizeAttenuation === false && ho.multiplyScalar(-fo2.z); const i = this.material.rotation; let r, s; i !== 0 && (s = Math.cos(i), r = Math.sin(i)); const o = this.center; cc2(ac2.set(-0.5, -0.5, 0), fo2, o, ho, r, s), cc2(Ea2.set(0.5, -0.5, 0), fo2, o, ho, r, s), cc2(lc2.set(0.5, 0.5, 0), fo2, o, ho, r, s), Vg2.set(0, 0), Rh2.set(1, 0), kg2.set(1, 1); let a = e.ray.intersectTriangle(ac2, Ea2, lc2, false, _a2); if (a === null && (cc2(Ea2.set(-0.5, 0.5, 0), fo2, o, ho, r, s), Rh2.set(0, 1), a = e.ray.intersectTriangle(ac2, lc2, Ea2, false, _a2), a === null)) return; const c = e.ray.origin.distanceTo(_a2); c < e.near || c > e.far || t13.push({ distance: c, point: _a2.clone(), uv: Qt.getUV(_a2, ac2, Ea2, lc2, Vg2, Rh2, kg2, new Pe()), face: null, object: this }); } copy(e) { return super.copy(e), e.center !== void 0 && this.center.copy(e.center), this.material = e.material, this; } }; El2.prototype.isSprite = true; function cc2(n, e, t13, i, r, s) { po.subVectors(n, t13).addScalar(0.5).multiply(i), r !== void 0 ? (Ta2.x = s * po.x - r * po.y, Ta2.y = r * po.x + s * po.y) : Ta2.copy(po), n.copy(e), n.x += Ta2.x, n.y += Ta2.y, n.applyMatrix4(Fx2); } var uc2 = new X(); var Gg2 = new X(); var Bx2 = class extends ot { constructor() { super(), this._currentLevel = 0, this.type = "LOD", Object.defineProperties(this, { levels: { enumerable: true, value: [] }, isLOD: { value: true } }), this.autoUpdate = true; } copy(e) { super.copy(e, false); const t13 = e.levels; for (let i = 0, r = t13.length; i < r; i++) { const s = t13[i]; this.addLevel(s.object.clone(), s.distance); } return this.autoUpdate = e.autoUpdate, this; } addLevel(e, t13 = 0) { t13 = Math.abs(t13); const i = this.levels; let r; for (r = 0; r < i.length && !(t13 < i[r].distance); r++) ; return i.splice(r, 0, { distance: t13, object: e }), this.add(e), this; } getCurrentLevel() { return this._currentLevel; } getObjectForDistance(e) { const t13 = this.levels; if (t13.length > 0) { let i, r; for (i = 1, r = t13.length; i < r && !(e < t13[i].distance); i++) ; return t13[i - 1].object; } return null; } raycast(e, t13) { if (this.levels.length > 0) { uc2.setFromMatrixPosition(this.matrixWorld); const r = e.ray.origin.distanceTo(uc2); this.getObjectForDistance(r).raycast(e, t13); } } update(e) { const t13 = this.levels; if (t13.length > 1) { uc2.setFromMatrixPosition(e.matrixWorld), Gg2.setFromMatrixPosition(this.matrixWorld); const i = uc2.distanceTo(Gg2) / e.zoom; t13[0].object.visible = true; let r, s; for (r = 1, s = t13.length; r < s && i >= t13[r].distance; r++) t13[r - 1].object.visible = false, t13[r].object.visible = true; for (this._currentLevel = r - 1; r < s; r++) t13[r].object.visible = false; } } toJSON(e) { const t13 = super.toJSON(e); this.autoUpdate === false && (t13.object.autoUpdate = false), t13.object.levels = []; const i = this.levels; for (let r = 0, s = i.length; r < s; r++) { const o = i[r]; t13.object.levels.push({ object: o.object.uuid, distance: o.distance }); } return t13; } }; var Hg2 = new X(); var Wg2 = new _t2(); var jg2 = new _t2(); var FN = new X(); var $g2 = new $e2(); var Al2 = class extends tn2 { constructor(e, t13) { super(e, t13), this.type = "SkinnedMesh", this.bindMode = "attached", this.bindMatrix = new $e2(), this.bindMatrixInverse = new $e2(); } 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, t13) { this.skeleton = e, t13 === void 0 && (this.updateMatrixWorld(true), this.skeleton.calculateInverses(), t13 = this.matrixWorld), this.bindMatrix.copy(t13), this.bindMatrixInverse.copy(t13).invert(); } pose() { this.skeleton.pose(); } normalizeSkinWeights() { const e = new _t2(), t13 = this.geometry.attributes.skinWeight; for (let i = 0, r = t13.count; i < r; i++) { e.x = t13.getX(i), e.y = t13.getY(i), e.z = t13.getZ(i), e.w = t13.getW(i); const s = 1 / e.manhattanLength(); s !== 1 / 0 ? e.multiplyScalar(s) : e.set(1, 0, 0, 0), t13.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, t13) { const i = this.skeleton, r = this.geometry; Wg2.fromBufferAttribute(r.attributes.skinIndex, e), jg2.fromBufferAttribute(r.attributes.skinWeight, e), Hg2.fromBufferAttribute(r.attributes.position, e).applyMatrix4(this.bindMatrix), t13.set(0, 0, 0); for (let s = 0; s < 4; s++) { const o = jg2.getComponent(s); if (o !== 0) { const a = Wg2.getComponent(s); $g2.multiplyMatrices(i.bones[a].matrixWorld, i.boneInverses[a]), t13.addScaledVector(FN.copy(Hg2).applyMatrix4($g2), o); } } return t13.applyMatrix4(this.bindMatrixInverse); } }; Al2.prototype.isSkinnedMesh = true; var Cl2 = class extends ot { constructor() { super(), this.type = "Bone"; } }; Cl2.prototype.isBone = true; var Cs2 = class extends nn2 { constructor(e = null, t13 = 1, i = 1, r, s, o, a, c, l = Kt2, d = Kt2, h6, p) { super(null, o, a, c, l, d, r, s, h6, p), this.image = { data: e, width: t13, height: i }, this.magFilter = l, this.minFilter = d, this.generateMipmaps = false, this.flipY = false, this.unpackAlignment = 1, this.needsUpdate = true; } }; Cs2.prototype.isDataTexture = true; var Zg2 = new $e2(); var BN = new $e2(); var Ll2 = class _Ll { constructor(e = [], t13 = []) { this.uuid = Jn2(), this.bones = e.slice(0), this.boneInverses = t13, this.boneMatrices = null, this.boneTexture = null, this.boneTextureSize = 0, this.frame = -1, this.init(); } init() { const e = this.bones, t13 = this.boneInverses; if (this.boneMatrices = new Float32Array(e.length * 16), t13.length === 0) this.calculateInverses(); else if (e.length !== t13.length) { console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."), this.boneInverses = []; for (let i = 0, r = this.bones.length; i < r; i++) this.boneInverses.push(new $e2()); } } calculateInverses() { this.boneInverses.length = 0; for (let e = 0, t13 = this.bones.length; e < t13; e++) { const i = new $e2(); this.bones[e] && i.copy(this.bones[e].matrixWorld).invert(), this.boneInverses.push(i); } } pose() { for (let e = 0, t13 = this.bones.length; e < t13; e++) { const i = this.bones[e]; i && i.matrixWorld.copy(this.boneInverses[e]).invert(); } for (let e = 0, t13 = this.bones.length; e < t13; 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, t13 = this.boneInverses, i = this.boneMatrices, r = this.boneTexture; for (let s = 0, o = e.length; s < o; s++) { const a = e[s] ? e[s].matrixWorld : BN; Zg2.multiplyMatrices(a, t13[s]), Zg2.toArray(i, s * 16); } r !== null && (r.needsUpdate = true); } clone() { return new _Ll(this.bones, this.boneInverses); } computeBoneTexture() { let e = Math.sqrt(this.bones.length * 4); e = dx2(e), e = Math.max(e, 4); const t13 = new Float32Array(e * e * 4); t13.set(this.boneMatrices); const i = new Cs2(t13, e, e, Yn2, nr2); return this.boneMatrices = t13, this.boneTexture = i, this.boneTextureSize = e, this; } getBoneByName(e) { for (let t13 = 0, i = this.bones.length; t13 < i; t13++) { const r = this.bones[t13]; if (r.name === e) return r; } } dispose() { this.boneTexture !== null && (this.boneTexture.dispose(), this.boneTexture = null); } fromJSON(e, t13) { this.uuid = e.uuid; for (let i = 0, r = e.bones.length; i < r; i++) { const s = e.bones[i]; let o = t13[s]; o === void 0 && (console.warn("THREE.Skeleton: No bone found with UUID:", s), o = new Cl2()), this.bones.push(o), this.boneInverses.push(new $e2().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 t13 = this.bones, i = this.boneInverses; for (let r = 0, s = t13.length; r < s; r++) { const o = t13[r]; e.bones.push(o.uuid); const a = i[r]; e.boneInverses.push(a.toArray()); } return e; } }; var Xg2 = new $e2(); var Yg2 = new $e2(); var hc2 = []; var Aa2 = new tn2(); var tp2 = class extends tn2 { constructor(e, t13, i) { super(e, t13), this.instanceMatrix = new nt(new Float32Array(i * 16), 16), this.instanceColor = null, this.count = i, this.frustumCulled = false; } 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, t13) { t13.fromArray(this.instanceColor.array, e * 3); } getMatrixAt(e, t13) { t13.fromArray(this.instanceMatrix.array, e * 16); } raycast(e, t13) { const i = this.matrixWorld, r = this.count; if (Aa2.geometry = this.geometry, Aa2.material = this.material, Aa2.material !== void 0) for (let s = 0; s < r; s++) { this.getMatrixAt(s, Xg2), Yg2.multiplyMatrices(i, Xg2), Aa2.matrixWorld = Yg2, Aa2.raycast(e, hc2); for (let o = 0, a = hc2.length; o < a; o++) { const c = hc2[o]; c.instanceId = s, c.object = this, t13.push(c); } hc2.length = 0; } } setColorAt(e, t13) { this.instanceColor === null && (this.instanceColor = new nt(new Float32Array(this.count * 3), 3)), t13.toArray(this.instanceColor.array, e * 3); } setMatrixAt(e, t13) { t13.toArray(this.instanceMatrix.array, e * 16); } updateMorphTargets() { } dispose() { this.dispatchEvent({ type: "dispose" }); } }; tp2.prototype.isInstancedMesh = true; var un2 = class extends sn { constructor(e) { super(), this.type = "LineBasicMaterial", this.color = new Fe(16777215), this.linewidth = 1, this.linecap = "round", this.linejoin = "round", this.morphTargets = false, 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; } }; un2.prototype.isLineBasicMaterial = true; var Jg2 = new X(); var qg2 = new X(); var Kg2 = new $e2(); var Ph2 = new is2(); var dc2 = new xr(); var Ui2 = class extends ot { constructor(e = new Je2(), t13 = new un2()) { super(), this.type = "Line", this.geometry = e, this.material = t13, 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 t13 = e.attributes.position, i = [0]; for (let r = 1, s = t13.count; r < s; r++) Jg2.fromBufferAttribute(t13, r - 1), qg2.fromBufferAttribute(t13, r), i[r] = i[r - 1], i[r] += Jg2.distanceTo(qg2); e.setAttribute("lineDistance", new We(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, t13) { const i = this.geometry, r = this.matrixWorld, s = e.params.Line.threshold, o = i.drawRange; if (i.boundingSphere === null && i.computeBoundingSphere(), dc2.copy(i.boundingSphere), dc2.applyMatrix4(r), dc2.radius += s, e.ray.intersectsSphere(dc2) === false) return; Kg2.copy(r).invert(), Ph2.copy(e.ray).applyMatrix4(Kg2); const a = s / ((this.scale.x + this.scale.y + this.scale.z) / 3), c = a * a, l = new X(), d = new X(), h6 = new X(), p = new X(), g = this.isLineSegments ? 2 : 1; if (i.isBufferGeometry) { const f = i.index, y = i.attributes.position; if (f !== null) { const v = Math.max(0, o.start), m = Math.min(f.count, o.start + o.count); for (let w = v, S = m - 1; w < S; w += g) { const T = f.getX(w), M = f.getX(w + 1); if (l.fromBufferAttribute(y, T), d.fromBufferAttribute(y, M), Ph2.distanceSqToSegment(l, d, p, h6) > c) continue; p.applyMatrix4(this.matrixWorld); const _ = e.ray.origin.distanceTo(p); _ < e.near || _ > e.far || t13.push({ distance: _, // What do we want? intersection point on the ray or on the segment?? // point: raycaster.ray.at( distance ), point: h6.clone().applyMatrix4(this.matrixWorld), index: w, face: null, faceIndex: null, object: this }); } } else { const v = Math.max(0, o.start), m = Math.min(y.count, o.start + o.count); for (let w = v, S = m - 1; w < S; w += g) { if (l.fromBufferAttribute(y, w), d.fromBufferAttribute(y, w + 1), Ph2.distanceSqToSegment(l, d, p, h6) > c) continue; p.applyMatrix4(this.matrixWorld); const M = e.ray.origin.distanceTo(p); M < e.near || M > e.far || t13.push({ distance: M, // What do we want? intersection point on the ray or on the segment?? // point: raycaster.ray.at( distance ), point: h6.clone().applyMatrix4(this.matrixWorld), index: w, 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 t13 = e.morphAttributes, i = Object.keys(t13); if (i.length > 0) { const r = t13[i[0]]; if (r !== void 0) { this.morphTargetInfluences = [], this.morphTargetDictionary = {}; for (let s = 0, o = r.length; s < o; s++) { const a = r[s].name || String(s); this.morphTargetInfluences.push(0), this.morphTargetDictionary[a] = s; } } } } else { const t13 = e.morphTargets; t13 !== void 0 && t13.length > 0 && console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead."); } } }; Ui2.prototype.isLine = true; var Qg2 = new X(); var ev2 = new X(); var Fn2 = class extends Ui2 { constructor(e, t13) { super(e, t13), this.type = "LineSegments"; } computeLineDistances() { const e = this.geometry; if (e.isBufferGeometry) if (e.index === null) { const t13 = e.attributes.position, i = []; for (let r = 0, s = t13.count; r < s; r += 2) Qg2.fromBufferAttribute(t13, r), ev2.fromBufferAttribute(t13, r + 1), i[r] = r === 0 ? 0 : i[r - 1], i[r + 1] = i[r] + Qg2.distanceTo(ev2); e.setAttribute("lineDistance", new We(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; } }; Fn2.prototype.isLineSegments = true; var Fu2 = class extends Ui2 { constructor(e, t13) { super(e, t13), this.type = "LineLoop"; } }; Fu2.prototype.isLineLoop = true; var ss2 = class extends sn { constructor(e) { super(), this.type = "PointsMaterial", this.color = new Fe(16777215), this.map = null, this.alphaMap = null, this.size = 1, this.sizeAttenuation = true, this.morphTargets = false, 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; } }; ss2.prototype.isPointsMaterial = true; var tv2 = new $e2(); var zd2 = new is2(); var fc2 = new xr(); var pc2 = new X(); var ha2 = class extends ot { constructor(e = new Je2(), t13 = new ss2()) { super(), this.type = "Points", this.geometry = e, this.material = t13, this.updateMorphTargets(); } copy(e) { return super.copy(e), this.material = e.material, this.geometry = e.geometry, this; } raycast(e, t13) { const i = this.geometry, r = this.matrixWorld, s = e.params.Points.threshold, o = i.drawRange; if (i.boundingSphere === null && i.computeBoundingSphere(), fc2.copy(i.boundingSphere), fc2.applyMatrix4(r), fc2.radius += s, e.ray.intersectsSphere(fc2) === false) return; tv2.copy(r).invert(), zd2.copy(e.ray).applyMatrix4(tv2); const a = s / ((this.scale.x + this.scale.y + this.scale.z) / 3), c = a * a; if (i.isBufferGeometry) { const l = i.index, h6 = i.attributes.position; if (l !== null) { const p = Math.max(0, o.start), g = Math.min(l.count, o.start + o.count); for (let f = p, u = g; f < u; f++) { const y = l.getX(f); pc2.fromBufferAttribute(h6, y), nv2(pc2, y, c, r, e, t13, this); } } else { const p = Math.max(0, o.start), g = Math.min(h6.count, o.start + o.count); for (let f = p, u = g; f < u; f++) pc2.fromBufferAttribute(h6, f), nv2(pc2, f, c, r, e, t13, 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 t13 = e.morphAttributes, i = Object.keys(t13); if (i.length > 0) { const r = t13[i[0]]; if (r !== void 0) { this.morphTargetInfluences = [], this.morphTargetDictionary = {}; for (let s = 0, o = r.length; s < o; s++) { const a = r[s].name || String(s); this.morphTargetInfluences.push(0), this.morphTargetDictionary[a] = s; } } } } else { const t13 = e.morphTargets; t13 !== void 0 && t13.length > 0 && console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead."); } } }; ha2.prototype.isPoints = true; function nv2(n, e, t13, i, r, s, o) { const a = zd2.distanceSqToPoint(n); if (a < t13) { const c = new X(); zd2.closestPointToPoint(n, c), c.applyMatrix4(i); const l = r.ray.origin.distanceTo(c); if (l < r.near || l > r.far) return; s.push({ distance: l, distanceToRay: Math.sqrt(a), point: c, index: e, face: null, object: o }); } } var zx2 = class extends nn2 { constructor(e, t13, i, r, s, o, a, c, l) { super(e, t13, i, r, s, o, a, c, l), this.format = a !== void 0 ? a : ar2, this.minFilter = o !== void 0 ? o : jt, this.magFilter = s !== void 0 ? s : jt, this.generateMipmaps = false; const d = this; function h6() { d.needsUpdate = true, e.requestVideoFrameCallback(h6); } "requestVideoFrameCallback" in e && e.requestVideoFrameCallback(h6); } clone() { return new this.constructor(this.image).copy(this); } update() { const e = this.image; "requestVideoFrameCallback" in e === false && e.readyState >= e.HAVE_CURRENT_DATA && (this.needsUpdate = true); } }; zx2.prototype.isVideoTexture = true; var np2 = class extends nn2 { constructor(e, t13, i, r, s, o, a, c, l, d, h6, p) { super(null, o, a, c, l, d, r, s, h6, p), this.image = { width: t13, height: i }, this.mipmaps = e, this.flipY = false, this.generateMipmaps = false; } }; np2.prototype.isCompressedTexture = true; var Ux2 = class extends nn2 { constructor(e, t13, i, r, s, o, a, c, l) { super(e, t13, i, r, s, o, a, c, l), this.needsUpdate = true; } }; Ux2.prototype.isCanvasTexture = true; var Vx2 = class extends nn2 { constructor(e, t13, i, r, s, o, a, c, l, d) { if (d = d !== void 0 ? d : Es2, d !== Es2 && d !== Fo2) throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat"); i === void 0 && d === Es2 && (i = el2), i === void 0 && d === Fo2 && (i = To2), super(null, r, s, o, a, c, d, i, l), this.image = { width: e, height: t13 }, this.magFilter = a !== void 0 ? a : Kt2, this.minFilter = c !== void 0 ? c : Kt2, this.flipY = false, this.generateMipmaps = false; } }; Vx2.prototype.isDepthTexture = true; var ko2 = class _ko extends Je2 { constructor(e = 1, t13 = 8, i = 0, r = Math.PI * 2) { super(), this.type = "CircleGeometry", this.parameters = { radius: e, segments: t13, thetaStart: i, thetaLength: r }, t13 = Math.max(3, t13); const s = [], o = [], a = [], c = [], l = new X(), d = new Pe(); o.push(0, 0, 0), a.push(0, 0, 1), c.push(0.5, 0.5); for (let h6 = 0, p = 3; h6 <= t13; h6++, p += 3) { const g = i + h6 / t13 * r; l.x = e * Math.cos(g), l.y = e * Math.sin(g), o.push(l.x, l.y, l.z), a.push(0, 0, 1), d.x = (o[p] / e + 1) / 2, d.y = (o[p + 1] / e + 1) / 2, c.push(d.x, d.y); } for (let h6 = 1; h6 <= t13; h6++) s.push(h6, h6 + 1, 0); this.setIndex(s), this.setAttribute("position", new We(o, 3)), this.setAttribute("normal", new We(a, 3)), this.setAttribute("uv", new We(c, 2)); } static fromJSON(e) { return new _ko(e.radius, e.segments, e.thetaStart, e.thetaLength); } }; var qr = class _qr extends Je2 { constructor(e = 1, t13 = 1, i = 1, r = 8, s = 1, o = false, a = 0, c = Math.PI * 2) { super(), this.type = "CylinderGeometry", this.parameters = { radiusTop: e, radiusBottom: t13, height: i, radialSegments: r, heightSegments: s, openEnded: o, thetaStart: a, thetaLength: c }; const l = this; r = Math.floor(r), s = Math.floor(s); const d = [], h6 = [], p = [], g = []; let f = 0; const u = [], y = i / 2; let v = 0; m(), o === false && (e > 0 && w(true), t13 > 0 && w(false)), this.setIndex(d), this.setAttribute("position", new We(h6, 3)), this.setAttribute("normal", new We(p, 3)), this.setAttribute("uv", new We(g, 2)); function m() { const S = new X(), T = new X(); let M = 0; const x = (t13 - e) / i; for (let _ = 0; _ <= s; _++) { const E = [], L = _ / s, R = L * (t13 - e) + e; for (let C = 0; C <= r; C++) { const A = C / r, P = A * c + a, I = Math.sin(P), b = Math.cos(P); T.x = R * I, T.y = -L * i + y, T.z = R * b, h6.push(T.x, T.y, T.z), S.set(I, x, b).normalize(), p.push(S.x, S.y, S.z), g.push(A, 1 - L), E.push(f++); } u.push(E); } for (let _ = 0; _ < r; _++) for (let E = 0; E < s; E++) { const L = u[E][_], R = u[E + 1][_], C = u[E + 1][_ + 1], A = u[E][_ + 1]; d.push(L, R, A), d.push(R, C, A), M += 6; } l.addGroup(v, M, 0), v += M; } function w(S) { const T = f, M = new Pe(), x = new X(); let _ = 0; const E = S === true ? e : t13, L = S === true ? 1 : -1; for (let C = 1; C <= r; C++) h6.push(0, y * L, 0), p.push(0, L, 0), g.push(0.5, 0.5), f++; const R = f; for (let C = 0; C <= r; C++) { const P = C / r * c + a, I = Math.cos(P), b = Math.sin(P); x.x = E * b, x.y = y * L, x.z = E * I, h6.push(x.x, x.y, x.z), p.push(0, L, 0), M.x = I * 0.5 + 0.5, M.y = b * 0.5 * L + 0.5, g.push(M.x, M.y), f++; } for (let C = 0; C < r; C++) { const A = T + C, P = R + C; S === true ? d.push(P, P + 1, A) : d.push(P + 1, P, A), _ += 3; } l.addGroup(v, _, S === true ? 1 : 2), v += _; } } static fromJSON(e) { return new _qr(e.radiusTop, e.radiusBottom, e.height, e.radialSegments, e.heightSegments, e.openEnded, e.thetaStart, e.thetaLength); } }; var Go2 = class _Go extends qr { constructor(e = 1, t13 = 1, i = 8, r = 1, s = false, o = 0, a = Math.PI * 2) { super(0, e, t13, i, r, s, o, a), this.type = "ConeGeometry", this.parameters = { radius: e, height: t13, radialSegments: i, heightSegments: r, openEnded: s, thetaStart: o, thetaLength: a }; } static fromJSON(e) { return new _Go(e.radius, e.height, e.radialSegments, e.heightSegments, e.openEnded, e.thetaStart, e.thetaLength); } }; var Vi2 = class _Vi extends Je2 { constructor(e, t13, i = 1, r = 0) { super(), this.type = "PolyhedronGeometry", this.parameters = { vertices: e, indices: t13, radius: i, detail: r }; const s = [], o = []; a(r), l(i), d(), this.setAttribute("position", new We(s, 3)), this.setAttribute("normal", new We(s.slice(), 3)), this.setAttribute("uv", new We(o, 2)), r === 0 ? this.computeVertexNormals() : this.normalizeNormals(); function a(m) { const w = new X(), S = new X(), T = new X(); for (let M = 0; M < t13.length; M += 3) g(t13[M + 0], w), g(t13[M + 1], S), g(t13[M + 2], T), c(w, S, T, m); } function c(m, w, S, T) { const M = T + 1, x = []; for (let _ = 0; _ <= M; _++) { x[_] = []; const E = m.clone().lerp(S, _ / M), L = w.clone().lerp(S, _ / M), R = M - _; for (let C = 0; C <= R; C++) C === 0 && _ === M ? x[_][C] = E : x[_][C] = E.clone().lerp(L, C / R); } for (let _ = 0; _ < M; _++) for (let E = 0; E < 2 * (M - _) - 1; E++) { const L = Math.floor(E / 2); E % 2 === 0 ? (p(x[_][L + 1]), p(x[_ + 1][L]), p(x[_][L])) : (p(x[_][L + 1]), p(x[_ + 1][L + 1]), p(x[_ + 1][L])); } } function l(m) { const w = new X(); for (let S = 0; S < s.length; S += 3) w.x = s[S + 0], w.y = s[S + 1], w.z = s[S + 2], w.normalize().multiplyScalar(m), s[S + 0] = w.x, s[S + 1] = w.y, s[S + 2] = w.z; } function d() { const m = new X(); for (let w = 0; w < s.length; w += 3) { m.x = s[w + 0], m.y = s[w + 1], m.z = s[w + 2]; const S = y(m) / 2 / Math.PI + 0.5, T = v(m) / Math.PI + 0.5; o.push(S, 1 - T); } f(), h6(); } function h6() { for (let m = 0; m < o.length; m += 6) { const w = o[m + 0], S = o[m + 2], T = o[m + 4], M = Math.max(w, S, T), x = Math.min(w, S, T); M > 0.9 && x < 0.1 && (w < 0.2 && (o[m + 0] += 1), S < 0.2 && (o[m + 2] += 1), T < 0.2 && (o[m + 4] += 1)); } } function p(m) { s.push(m.x, m.y, m.z); } function g(m, w) { const S = m * 3; w.x = e[S + 0], w.y = e[S + 1], w.z = e[S + 2]; } function f() { const m = new X(), w = new X(), S = new X(), T = new X(), M = new Pe(), x = new Pe(), _ = new Pe(); for (let E = 0, L = 0; E < s.length; E += 9, L += 6) { m.set(s[E + 0], s[E + 1], s[E + 2]), w.set(s[E + 3], s[E + 4], s[E + 5]), S.set(s[E + 6], s[E + 7], s[E + 8]), M.set(o[L + 0], o[L + 1]), x.set(o[L + 2], o[L + 3]), _.set(o[L + 4], o[L + 5]), T.copy(m).add(w).add(S).divideScalar(3); const R = y(T); u(M, L + 0, m, R), u(x, L + 2, w, R), u(_, L + 4, S, R); } } function u(m, w, S, T) { T < 0 && m.x === 1 && (o[w] = m.x - 1), S.x === 0 && S.z === 0 && (o[w] = T / 2 / Math.PI + 0.5); } function y(m) { return Math.atan2(m.z, -m.x); } function v(m) { return Math.atan2(-m.y, Math.sqrt(m.x * m.x + m.z * m.z)); } } static fromJSON(e) { return new _Vi(e.vertices, e.indices, e.radius, e.details); } }; var Ho2 = class _Ho extends Vi2 { constructor(e = 1, t13 = 0) { const i = (1 + Math.sqrt(5)) / 2, r = 1 / i, s = [ // (±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, -r, -i, 0, -r, i, 0, r, -i, 0, r, i, // (±1/φ, ±φ, 0) -r, -i, 0, -r, i, 0, r, -i, 0, r, i, 0, // (±φ, 0, ±1/φ) -i, 0, -r, i, 0, -r, -i, 0, r, i, 0, r ], 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(s, o, e, t13), this.type = "DodecahedronGeometry", this.parameters = { radius: e, detail: t13 }; } static fromJSON(e) { return new _Ho(e.radius, e.detail); } }; var mc2 = new X(); var gc2 = new X(); var Ih2 = new X(); var vc2 = new Qt(); var ip2 = class extends Je2 { constructor(e, t13) { if (super(), this.type = "EdgesGeometry", this.parameters = { thresholdAngle: t13 }, t13 = t13 !== void 0 ? t13 : 1, e.isGeometry === true) { console.error("THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); return; } const r = Math.pow(10, 4), s = Math.cos(As2 * t13), o = e.getIndex(), a = e.getAttribute("position"), c = o ? o.count : a.count, l = [0, 0, 0], d = ["a", "b", "c"], h6 = new Array(3), p = {}, g = []; for (let f = 0; f < c; f += 3) { o ? (l[0] = o.getX(f), l[1] = o.getX(f + 1), l[2] = o.getX(f + 2)) : (l[0] = f, l[1] = f + 1, l[2] = f + 2); const { a: u, b: y, c: v } = vc2; if (u.fromBufferAttribute(a, l[0]), y.fromBufferAttribute(a, l[1]), v.fromBufferAttribute(a, l[2]), vc2.getNormal(Ih2), h6[0] = `${Math.round(u.x * r)},${Math.round(u.y * r)},${Math.round(u.z * r)}`, h6[1] = `${Math.round(y.x * r)},${Math.round(y.y * r)},${Math.round(y.z * r)}`, h6[2] = `${Math.round(v.x * r)},${Math.round(v.y * r)},${Math.round(v.z * r)}`, !(h6[0] === h6[1] || h6[1] === h6[2] || h6[2] === h6[0])) for (let m = 0; m < 3; m++) { const w = (m + 1) % 3, S = h6[m], T = h6[w], M = vc2[d[m]], x = vc2[d[w]], _ = `${S}_${T}`, E = `${T}_${S}`; E in p && p[E] ? (Ih2.dot(p[E].normal) <= s && (g.push(M.x, M.y, M.z), g.push(x.x, x.y, x.z)), p[E] = null) : _ in p || (p[_] = { index0: l[m], index1: l[w], normal: Ih2.clone() }); } } for (const f in p) if (p[f]) { const { index0: u, index1: y } = p[f]; mc2.fromBufferAttribute(a, u), gc2.fromBufferAttribute(a, y), g.push(mc2.x, mc2.y, mc2.z), g.push(gc2.x, gc2.y, gc2.z); } this.setAttribute("position", new We(g, 3)); } }; var Kn2 = class { 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, t13) { const i = this.getUtoTmapping(e); return this.getPoint(i, t13); } // Get sequence of points using getPoint( t ) getPoints(e = 5) { const t13 = []; for (let i = 0; i <= e; i++) t13.push(this.getPoint(i / e)); return t13; } // Get sequence of points using getPointAt( u ) getSpacedPoints(e = 5) { const t13 = []; for (let i = 0; i <= e; i++) t13.push(this.getPointAt(i / e)); return t13; } // 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 = false; const t13 = []; let i, r = this.getPoint(0), s = 0; t13.push(0); for (let o = 1; o <= e; o++) i = this.getPoint(o / e), s += i.distanceTo(r), t13.push(s), r = i; return this.cacheArcLengths = t13, t13; } updateArcLengths() { this.needsUpdate = true, this.getLengths(); } // Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant getUtoTmapping(e, t13) { const i = this.getLengths(); let r = 0; const s = i.length; let o; t13 ? o = t13 : o = e * i[s - 1]; let a = 0, c = s - 1, l; for (; a <= c; ) if (r = Math.floor(a + (c - a) / 2), l = i[r] - o, l < 0) a = r + 1; else if (l > 0) c = r - 1; else { c = r; break; } if (r = c, i[r] === o) return r / (s - 1); const d = i[r], p = i[r + 1] - d, g = (o - d) / p; return (r + g) / (s - 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, t13) { let r = e - 1e-4, s = e + 1e-4; r < 0 && (r = 0), s > 1 && (s = 1); const o = this.getPoint(r), a = this.getPoint(s), c = t13 || (o.isVector2 ? new Pe() : new X()); return c.copy(a).sub(o).normalize(), c; } getTangentAt(e, t13) { const i = this.getUtoTmapping(e); return this.getTangent(i, t13); } computeFrenetFrames(e, t13) { const i = new X(), r = [], s = [], o = [], a = new X(), c = new $e2(); for (let g = 0; g <= e; g++) { const f = g / e; r[g] = this.getTangentAt(f, new X()), r[g].normalize(); } s[0] = new X(), o[0] = new X(); let l = Number.MAX_VALUE; const d = Math.abs(r[0].x), h6 = Math.abs(r[0].y), p = Math.abs(r[0].z); d <= l && (l = d, i.set(1, 0, 0)), h6 <= l && (l = h6, i.set(0, 1, 0)), p <= l && i.set(0, 0, 1), a.crossVectors(r[0], i).normalize(), s[0].crossVectors(r[0], a), o[0].crossVectors(r[0], s[0]); for (let g = 1; g <= e; g++) { if (s[g] = s[g - 1].clone(), o[g] = o[g - 1].clone(), a.crossVectors(r[g - 1], r[g]), a.length() > Number.EPSILON) { a.normalize(); const f = Math.acos(wn3(r[g - 1].dot(r[g]), -1, 1)); s[g].applyMatrix4(c.makeRotationAxis(a, f)); } o[g].crossVectors(r[g], s[g]); } if (t13 === true) { let g = Math.acos(wn3(s[0].dot(s[e]), -1, 1)); g /= e, r[0].dot(a.crossVectors(s[0], s[e])) > 0 && (g = -g); for (let f = 1; f <= e; f++) s[f].applyMatrix4(c.makeRotationAxis(r[f], g * f)), o[f].crossVectors(r[f], s[f]); } return { tangents: r, normals: s, 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; } }; var Rl2 = class extends Kn2 { constructor(e = 0, t13 = 0, i = 1, r = 1, s = 0, o = Math.PI * 2, a = false, c = 0) { super(), this.type = "EllipseCurve", this.aX = e, this.aY = t13, this.xRadius = i, this.yRadius = r, this.aStartAngle = s, this.aEndAngle = o, this.aClockwise = a, this.aRotation = c; } getPoint(e, t13) { const i = t13 || new Pe(), r = Math.PI * 2; let s = this.aEndAngle - this.aStartAngle; const o = Math.abs(s) < Number.EPSILON; for (; s < 0; ) s += r; for (; s > r; ) s -= r; s < Number.EPSILON && (o ? s = 0 : s = r), this.aClockwise === true && !o && (s === r ? s = -r : s = s - r); const a = this.aStartAngle + e * s; let c = this.aX + this.xRadius * Math.cos(a), l = this.aY + this.yRadius * Math.sin(a); if (this.aRotation !== 0) { const d = Math.cos(this.aRotation), h6 = Math.sin(this.aRotation), p = c - this.aX, g = l - this.aY; c = p * d - g * h6 + this.aX, l = p * h6 + g * d + 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; } }; Rl2.prototype.isEllipseCurve = true; var rp2 = class extends Rl2 { constructor(e, t13, i, r, s, o) { super(e, t13, i, i, r, s, o), this.type = "ArcCurve"; } }; rp2.prototype.isArcCurve = true; function sp2() { let n = 0, e = 0, t13 = 0, i = 0; function r(s, o, a, c) { n = s, e = a, t13 = -3 * s + 3 * o - 2 * a - c, i = 2 * s - 2 * o + a + c; } return { initCatmullRom: function(s, o, a, c, l) { r(o, a, l * (a - s), l * (c - o)); }, initNonuniformCatmullRom: function(s, o, a, c, l, d, h6) { let p = (o - s) / l - (a - s) / (l + d) + (a - o) / d, g = (a - o) / d - (c - o) / (d + h6) + (c - a) / h6; p *= d, g *= d, r(o, a, p, g); }, calc: function(s) { const o = s * s, a = o * s; return n + e * s + t13 * o + i * a; } }; } var yc2 = new X(); var Oh2 = new sp2(); var Dh2 = new sp2(); var Nh2 = new sp2(); var op2 = class extends Kn2 { constructor(e = [], t13 = false, i = "centripetal", r = 0.5) { super(), this.type = "CatmullRomCurve3", this.points = e, this.closed = t13, this.curveType = i, this.tension = r; } getPoint(e, t13 = new X()) { const i = t13, r = this.points, s = r.length, o = (s - (this.closed ? 0 : 1)) * e; let a = Math.floor(o), c = o - a; this.closed ? a += a > 0 ? 0 : (Math.floor(Math.abs(a) / s) + 1) * s : c === 0 && a === s - 1 && (a = s - 2, c = 1); let l, d; this.closed || a > 0 ? l = r[(a - 1) % s] : (yc2.subVectors(r[0], r[1]).add(r[0]), l = yc2); const h6 = r[a % s], p = r[(a + 1) % s]; if (this.closed || a + 2 < s ? d = r[(a + 2) % s] : (yc2.subVectors(r[s - 1], r[s - 2]).add(r[s - 1]), d = yc2), this.curveType === "centripetal" || this.curveType === "chordal") { const g = this.curveType === "chordal" ? 0.5 : 0.25; let f = Math.pow(l.distanceToSquared(h6), g), u = Math.pow(h6.distanceToSquared(p), g), y = Math.pow(p.distanceToSquared(d), g); u < 1e-4 && (u = 1), f < 1e-4 && (f = u), y < 1e-4 && (y = u), Oh2.initNonuniformCatmullRom(l.x, h6.x, p.x, d.x, f, u, y), Dh2.initNonuniformCatmullRom(l.y, h6.y, p.y, d.y, f, u, y), Nh2.initNonuniformCatmullRom(l.z, h6.z, p.z, d.z, f, u, y); } else this.curveType === "catmullrom" && (Oh2.initCatmullRom(l.x, h6.x, p.x, d.x, this.tension), Dh2.initCatmullRom(l.y, h6.y, p.y, d.y, this.tension), Nh2.initCatmullRom(l.z, h6.z, p.z, d.z, this.tension)); return i.set( Oh2.calc(c), Dh2.calc(c), Nh2.calc(c) ), i; } copy(e) { super.copy(e), this.points = []; for (let t13 = 0, i = e.points.length; t13 < i; t13++) { const r = e.points[t13]; this.points.push(r.clone()); } return this.closed = e.closed, this.curveType = e.curveType, this.tension = e.tension, this; } toJSON() { const e = super.toJSON(); e.points = []; for (let t13 = 0, i = this.points.length; t13 < i; t13++) { const r = this.points[t13]; e.points.push(r.toArray()); } return e.closed = this.closed, e.curveType = this.curveType, e.tension = this.tension, e; } fromJSON(e) { super.fromJSON(e), this.points = []; for (let t13 = 0, i = e.points.length; t13 < i; t13++) { const r = e.points[t13]; this.points.push(new X().fromArray(r)); } return this.closed = e.closed, this.curveType = e.curveType, this.tension = e.tension, this; } }; op2.prototype.isCatmullRomCurve3 = true; function iv2(n, e, t13, i, r) { const s = (i - e) * 0.5, o = (r - t13) * 0.5, a = n * n, c = n * a; return (2 * t13 - 2 * i + s + o) * c + (-3 * t13 + 3 * i - 2 * s - o) * a + s * n + t13; } function zN(n, e) { const t13 = 1 - n; return t13 * t13 * e; } function UN(n, e) { return 2 * (1 - n) * n * e; } function VN(n, e) { return n * n * e; } function Ga2(n, e, t13, i) { return zN(n, e) + UN(n, t13) + VN(n, i); } function kN(n, e) { const t13 = 1 - n; return t13 * t13 * t13 * e; } function GN(n, e) { const t13 = 1 - n; return 3 * t13 * t13 * n * e; } function HN(n, e) { return 3 * (1 - n) * n * n * e; } function WN(n, e) { return n * n * n * e; } function Ha2(n, e, t13, i, r) { return kN(n, e) + GN(n, t13) + HN(n, i) + WN(n, r); } var Bu2 = class extends Kn2 { constructor(e = new Pe(), t13 = new Pe(), i = new Pe(), r = new Pe()) { super(), this.type = "CubicBezierCurve", this.v0 = e, this.v1 = t13, this.v2 = i, this.v3 = r; } getPoint(e, t13 = new Pe()) { const i = t13, r = this.v0, s = this.v1, o = this.v2, a = this.v3; return i.set( Ha2(e, r.x, s.x, o.x, a.x), Ha2(e, r.y, s.y, o.y, a.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; } }; Bu2.prototype.isCubicBezierCurve = true; var ap2 = class extends Kn2 { constructor(e = new X(), t13 = new X(), i = new X(), r = new X()) { super(), this.type = "CubicBezierCurve3", this.v0 = e, this.v1 = t13, this.v2 = i, this.v3 = r; } getPoint(e, t13 = new X()) { const i = t13, r = this.v0, s = this.v1, o = this.v2, a = this.v3; return i.set( Ha2(e, r.x, s.x, o.x, a.x), Ha2(e, r.y, s.y, o.y, a.y), Ha2(e, r.z, s.z, o.z, a.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; } }; ap2.prototype.isCubicBezierCurve3 = true; var Pl2 = class extends Kn2 { constructor(e = new Pe(), t13 = new Pe()) { super(), this.type = "LineCurve", this.v1 = e, this.v2 = t13; } getPoint(e, t13 = new Pe()) { const i = t13; 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, t13) { return this.getPoint(e, t13); } getTangent(e, t13) { const i = t13 || new Pe(); 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; } }; Pl2.prototype.isLineCurve = true; var kx2 = class extends Kn2 { constructor(e = new X(), t13 = new X()) { super(), this.type = "LineCurve3", this.isLineCurve3 = true, this.v1 = e, this.v2 = t13; } getPoint(e, t13 = new X()) { const i = t13; 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, t13) { return this.getPoint(e, t13); } 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; } }; var zu2 = class extends Kn2 { constructor(e = new Pe(), t13 = new Pe(), i = new Pe()) { super(), this.type = "QuadraticBezierCurve", this.v0 = e, this.v1 = t13, this.v2 = i; } getPoint(e, t13 = new Pe()) { const i = t13, r = this.v0, s = this.v1, o = this.v2; return i.set( Ga2(e, r.x, s.x, o.x), Ga2(e, r.y, s.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; } }; zu2.prototype.isQuadraticBezierCurve = true; var lp2 = class extends Kn2 { constructor(e = new X(), t13 = new X(), i = new X()) { super(), this.type = "QuadraticBezierCurve3", this.v0 = e, this.v1 = t13, this.v2 = i; } getPoint(e, t13 = new X()) { const i = t13, r = this.v0, s = this.v1, o = this.v2; return i.set( Ga2(e, r.x, s.x, o.x), Ga2(e, r.y, s.y, o.y), Ga2(e, r.z, s.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; } }; lp2.prototype.isQuadraticBezierCurve3 = true; var Uu2 = class extends Kn2 { constructor(e = []) { super(), this.type = "SplineCurve", this.points = e; } getPoint(e, t13 = new Pe()) { const i = t13, r = this.points, s = (r.length - 1) * e, o = Math.floor(s), a = s - o, c = r[o === 0 ? o : o - 1], l = r[o], d = r[o > r.length - 2 ? r.length - 1 : o + 1], h6 = r[o > r.length - 3 ? r.length - 1 : o + 2]; return i.set( iv2(a, c.x, l.x, d.x, h6.x), iv2(a, c.y, l.y, d.y, h6.y) ), i; } copy(e) { super.copy(e), this.points = []; for (let t13 = 0, i = e.points.length; t13 < i; t13++) { const r = e.points[t13]; this.points.push(r.clone()); } return this; } toJSON() { const e = super.toJSON(); e.points = []; for (let t13 = 0, i = this.points.length; t13 < i; t13++) { const r = this.points[t13]; e.points.push(r.toArray()); } return e; } fromJSON(e) { super.fromJSON(e), this.points = []; for (let t13 = 0, i = e.points.length; t13 < i; t13++) { const r = e.points[t13]; this.points.push(new Pe().fromArray(r)); } return this; } }; Uu2.prototype.isSplineCurve = true; var cp2 = Object.freeze({ __proto__: null, ArcCurve: rp2, CatmullRomCurve3: op2, CubicBezierCurve: Bu2, CubicBezierCurve3: ap2, EllipseCurve: Rl2, LineCurve: Pl2, LineCurve3: kx2, QuadraticBezierCurve: zu2, QuadraticBezierCurve3: lp2, SplineCurve: Uu2 }); var jN = { triangulate: function(n, e, t13 = 2) { const i = e && e.length, r = i ? e[0] * t13 : n.length; let s = Gx2(n, 0, r, t13, true); const o = []; if (!s || s.next === s.prev) return o; let a, c, l, d, h6, p, g; if (i && (s = JN(n, e, s, t13)), n.length > 80 * t13) { a = l = n[0], c = d = n[1]; for (let f = t13; f < r; f += t13) h6 = n[f], p = n[f + 1], h6 < a && (a = h6), p < c && (c = p), h6 > l && (l = h6), p > d && (d = p); g = Math.max(l - a, d - c), g = g !== 0 ? 1 / g : 0; } return il2(s, o, t13, a, c, g), o; } }; function Gx2(n, e, t13, i, r) { let s, o; if (r === aF2(n, e, t13, i) > 0) for (s = e; s < t13; s += i) o = rv2(s, n[s], n[s + 1], o); else for (s = t13 - i; s >= e; s -= i) o = rv2(s, n[s], n[s + 1], o); return o && Vu2(o, o.next) && (sl2(o), o = o.next), o; } function Kr2(n, e) { if (!n) return n; e || (e = n); let t13 = n, i; do if (i = false, !t13.steiner && (Vu2(t13, t13.next) || zt2(t13.prev, t13, t13.next) === 0)) { if (sl2(t13), t13 = e = t13.prev, t13 === t13.next) break; i = true; } else t13 = t13.next; while (i || t13 !== e); return e; } function il2(n, e, t13, i, r, s, o) { if (!n) return; !o && s && tF2(n, i, r, s); let a = n, c, l; for (; n.prev !== n.next; ) { if (c = n.prev, l = n.next, s ? ZN(n, i, r, s) : $N(n)) { e.push(c.i / t13), e.push(n.i / t13), e.push(l.i / t13), sl2(n), n = l.next, a = l.next; continue; } if (n = l, n === a) { o ? o === 1 ? (n = XN(Kr2(n), e, t13), il2(n, e, t13, i, r, s, 2)) : o === 2 && YN(n, e, t13, i, r, s) : il2(Kr2(n), e, t13, i, r, s, 1); break; } } } function $N(n) { const e = n.prev, t13 = n, i = n.next; if (zt2(e, t13, i) >= 0) return false; let r = n.next.next; for (; r !== n.prev; ) { if (So2(e.x, e.y, t13.x, t13.y, i.x, i.y, r.x, r.y) && zt2(r.prev, r, r.next) >= 0) return false; r = r.next; } return true; } function ZN(n, e, t13, i) { const r = n.prev, s = n, o = n.next; if (zt2(r, s, o) >= 0) return false; const a = r.x < s.x ? r.x < o.x ? r.x : o.x : s.x < o.x ? s.x : o.x, c = r.y < s.y ? r.y < o.y ? r.y : o.y : s.y < o.y ? s.y : o.y, l = r.x > s.x ? r.x > o.x ? r.x : o.x : s.x > o.x ? s.x : o.x, d = r.y > s.y ? r.y > o.y ? r.y : o.y : s.y > o.y ? s.y : o.y, h6 = Ud2(a, c, e, t13, i), p = Ud2(l, d, e, t13, i); let g = n.prevZ, f = n.nextZ; for (; g && g.z >= h6 && f && f.z <= p; ) { if (g !== n.prev && g !== n.next && So2(r.x, r.y, s.x, s.y, o.x, o.y, g.x, g.y) && zt2(g.prev, g, g.next) >= 0 || (g = g.prevZ, f !== n.prev && f !== n.next && So2(r.x, r.y, s.x, s.y, o.x, o.y, f.x, f.y) && zt2(f.prev, f, f.next) >= 0)) return false; f = f.nextZ; } for (; g && g.z >= h6; ) { if (g !== n.prev && g !== n.next && So2(r.x, r.y, s.x, s.y, o.x, o.y, g.x, g.y) && zt2(g.prev, g, g.next) >= 0) return false; g = g.prevZ; } for (; f && f.z <= p; ) { if (f !== n.prev && f !== n.next && So2(r.x, r.y, s.x, s.y, o.x, o.y, f.x, f.y) && zt2(f.prev, f, f.next) >= 0) return false; f = f.nextZ; } return true; } function XN(n, e, t13) { let i = n; do { const r = i.prev, s = i.next.next; !Vu2(r, s) && Hx2(r, i, i.next, s) && rl2(r, s) && rl2(s, r) && (e.push(r.i / t13), e.push(i.i / t13), e.push(s.i / t13), sl2(i), sl2(i.next), i = n = s), i = i.next; } while (i !== n); return Kr2(i); } function YN(n, e, t13, i, r, s) { let o = n; do { let a = o.next.next; for (; a !== o.prev; ) { if (o.i !== a.i && rF2(o, a)) { let c = Wx2(o, a); o = Kr2(o, o.next), c = Kr2(c, c.next), il2(o, e, t13, i, r, s), il2(c, e, t13, i, r, s); return; } a = a.next; } o = o.next; } while (o !== n); } function JN(n, e, t13, i) { const r = []; let s, o, a, c, l; for (s = 0, o = e.length; s < o; s++) a = e[s] * i, c = s < o - 1 ? e[s + 1] * i : n.length, l = Gx2(n, a, c, i, false), l === l.next && (l.steiner = true), r.push(iF2(l)); for (r.sort(qN), s = 0; s < r.length; s++) KN(r[s], t13), t13 = Kr2(t13, t13.next); return t13; } function qN(n, e) { return n.x - e.x; } function KN(n, e) { if (e = QN(n, e), e) { const t13 = Wx2(e, n); Kr2(e, e.next), Kr2(t13, t13.next); } } function QN(n, e) { let t13 = e; const i = n.x, r = n.y; let s = -1 / 0, o; do { if (r <= t13.y && r >= t13.next.y && t13.next.y !== t13.y) { const p = t13.x + (r - t13.y) * (t13.next.x - t13.x) / (t13.next.y - t13.y); if (p <= i && p > s) { if (s = p, p === i) { if (r === t13.y) return t13; if (r === t13.next.y) return t13.next; } o = t13.x < t13.next.x ? t13 : t13.next; } } t13 = t13.next; } while (t13 !== e); if (!o) return null; if (i === s) return o; const a = o, c = o.x, l = o.y; let d = 1 / 0, h6; t13 = o; do i >= t13.x && t13.x >= c && i !== t13.x && So2(r < l ? i : s, r, c, l, r < l ? s : i, r, t13.x, t13.y) && (h6 = Math.abs(r - t13.y) / (i - t13.x), rl2(t13, n) && (h6 < d || h6 === d && (t13.x > o.x || t13.x === o.x && eF2(o, t13))) && (o = t13, d = h6)), t13 = t13.next; while (t13 !== a); return o; } function eF2(n, e) { return zt2(n.prev, n, e.prev) < 0 && zt2(e.next, n, n.next) < 0; } function tF2(n, e, t13, i) { let r = n; do r.z === null && (r.z = Ud2(r.x, r.y, e, t13, i)), r.prevZ = r.prev, r.nextZ = r.next, r = r.next; while (r !== n); r.prevZ.nextZ = null, r.prevZ = null, nF2(r); } function nF2(n) { let e, t13, i, r, s, o, a, c, l = 1; do { for (t13 = n, n = null, s = null, o = 0; t13; ) { for (o++, i = t13, a = 0, e = 0; e < l && (a++, i = i.nextZ, !!i); e++) ; for (c = l; a > 0 || c > 0 && i; ) a !== 0 && (c === 0 || !i || t13.z <= i.z) ? (r = t13, t13 = t13.nextZ, a--) : (r = i, i = i.nextZ, c--), s ? s.nextZ = r : n = r, r.prevZ = s, s = r; t13 = i; } s.nextZ = null, l *= 2; } while (o > 1); return n; } function Ud2(n, e, t13, i, r) { return n = 32767 * (n - t13) * r, e = 32767 * (e - i) * r, n = (n | n << 8) & 16711935, n = (n | n << 4) & 252645135, n = (n | n << 2) & 858993459, n = (n | n << 1) & 1431655765, e = (e | e << 8) & 16711935, e = (e | e << 4) & 252645135, e = (e | e << 2) & 858993459, e = (e | e << 1) & 1431655765, n | e << 1; } function iF2(n) { let e = n, t13 = n; do (e.x < t13.x || e.x === t13.x && e.y < t13.y) && (t13 = e), e = e.next; while (e !== n); return t13; } function So2(n, e, t13, i, r, s, o, a) { return (r - o) * (e - a) - (n - o) * (s - a) >= 0 && (n - o) * (i - a) - (t13 - o) * (e - a) >= 0 && (t13 - o) * (s - a) - (r - o) * (i - a) >= 0; } function rF2(n, e) { return n.next.i !== e.i && n.prev.i !== e.i && !sF2(n, e) && // dones't intersect other edges (rl2(n, e) && rl2(e, n) && oF2(n, e) && // locally visible (zt2(n.prev, n, e.prev) || zt2(n, e.prev, e)) || // does not create opposite-facing sectors Vu2(n, e) && zt2(n.prev, n, n.next) > 0 && zt2(e.prev, e, e.next) > 0); } function zt2(n, e, t13) { return (e.y - n.y) * (t13.x - e.x) - (e.x - n.x) * (t13.y - e.y); } function Vu2(n, e) { return n.x === e.x && n.y === e.y; } function Hx2(n, e, t13, i) { const r = xc2(zt2(n, e, t13)), s = xc2(zt2(n, e, i)), o = xc2(zt2(t13, i, n)), a = xc2(zt2(t13, i, e)); return !!(r !== s && o !== a || r === 0 && bc2(n, t13, e) || s === 0 && bc2(n, i, e) || o === 0 && bc2(t13, n, i) || a === 0 && bc2(t13, e, i)); } function bc2(n, e, t13) { return e.x <= Math.max(n.x, t13.x) && e.x >= Math.min(n.x, t13.x) && e.y <= Math.max(n.y, t13.y) && e.y >= Math.min(n.y, t13.y); } function xc2(n) { return n > 0 ? 1 : n < 0 ? -1 : 0; } function sF2(n, e) { let t13 = n; do { if (t13.i !== n.i && t13.next.i !== n.i && t13.i !== e.i && t13.next.i !== e.i && Hx2(t13, t13.next, n, e)) return true; t13 = t13.next; } while (t13 !== n); return false; } function rl2(n, e) { return zt2(n.prev, n, n.next) < 0 ? zt2(n, e, n.next) >= 0 && zt2(n, n.prev, e) >= 0 : zt2(n, e, n.prev) < 0 || zt2(n, n.next, e) < 0; } function oF2(n, e) { let t13 = n, i = false; const r = (n.x + e.x) / 2, s = (n.y + e.y) / 2; do t13.y > s != t13.next.y > s && t13.next.y !== t13.y && r < (t13.next.x - t13.x) * (s - t13.y) / (t13.next.y - t13.y) + t13.x && (i = !i), t13 = t13.next; while (t13 !== n); return i; } function Wx2(n, e) { const t13 = new Vd2(n.i, n.x, n.y), i = new Vd2(e.i, e.x, e.y), r = n.next, s = e.prev; return n.next = e, e.prev = n, t13.next = r, r.prev = t13, i.next = t13, t13.prev = i, s.next = i, i.prev = s, i; } function rv2(n, e, t13, i) { const r = new Vd2(n, e, t13); return i ? (r.next = i.next, r.prev = i, i.next.prev = r, i.next = r) : (r.prev = r, r.next = r), r; } function sl2(n) { n.next.prev = n.prev, n.prev.next = n.next, n.prevZ && (n.prevZ.nextZ = n.nextZ), n.nextZ && (n.nextZ.prevZ = n.prevZ); } function Vd2(n, e, t13) { this.i = n, this.x = e, this.y = t13, this.prev = null, this.next = null, this.z = null, this.prevZ = null, this.nextZ = null, this.steiner = false; } function aF2(n, e, t13, i) { let r = 0; for (let s = e, o = t13 - i; s < t13; s += i) r += (n[o] - n[s]) * (n[s + 1] + n[o + 1]), o = s; return r; } var Fi2 = class _Fi { // calculate area of the contour polygon static area(e) { const t13 = e.length; let i = 0; for (let r = t13 - 1, s = 0; s < t13; r = s++) i += e[r].x * e[s].y - e[s].x * e[r].y; return i * 0.5; } static isClockWise(e) { return _Fi.area(e) < 0; } static triangulateShape(e, t13) { const i = [], r = [], s = []; sv2(e), ov2(i, e); let o = e.length; t13.forEach(sv2); for (let c = 0; c < t13.length; c++) r.push(o), o += t13[c].length, ov2(i, t13[c]); const a = jN.triangulate(i, r); for (let c = 0; c < a.length; c += 3) s.push(a.slice(c, c + 3)); return s; } }; function sv2(n) { const e = n.length; e > 2 && n[e - 1].equals(n[0]) && n.pop(); } function ov2(n, e) { for (let t13 = 0; t13 < e.length; t13++) n.push(e[t13].x), n.push(e[t13].y); } var wi2 = class _wi extends Je2 { constructor(e, t13) { super(), this.type = "ExtrudeGeometry", this.parameters = { shapes: e, options: t13 }, e = Array.isArray(e) ? e : [e]; const i = this, r = [], s = []; for (let a = 0, c = e.length; a < c; a++) { const l = e[a]; o(l); } this.setAttribute("position", new We(r, 3)), this.setAttribute("uv", new We(s, 2)), this.computeVertexNormals(); function o(a) { const c = [], l = t13.curveSegments !== void 0 ? t13.curveSegments : 12, d = t13.steps !== void 0 ? t13.steps : 1; let h6 = t13.depth !== void 0 ? t13.depth : 100, p = t13.bevelEnabled !== void 0 ? t13.bevelEnabled : true, g = t13.bevelThickness !== void 0 ? t13.bevelThickness : 6, f = t13.bevelSize !== void 0 ? t13.bevelSize : g - 2, u = t13.bevelOffset !== void 0 ? t13.bevelOffset : 0, y = t13.bevelSegments !== void 0 ? t13.bevelSegments : 3; const v = t13.extrudePath, m = t13.UVGenerator !== void 0 ? t13.UVGenerator : lF2; t13.amount !== void 0 && (console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."), h6 = t13.amount); let w, S = false, T, M, x, _; v && (w = v.getSpacedPoints(d), S = true, p = false, T = v.computeFrenetFrames(d, false), M = new X(), x = new X(), _ = new X()), p || (y = 0, g = 0, f = 0, u = 0); const E = a.extractPoints(l); let L = E.shape; const R = E.holes; if (!Fi2.isClockWise(L)) { L = L.reverse(); for (let Y = 0, te = R.length; Y < te; Y++) { const F = R[Y]; Fi2.isClockWise(F) && (R[Y] = F.reverse()); } } const A = Fi2.triangulateShape(L, R), P = L; for (let Y = 0, te = R.length; Y < te; Y++) { const F = R[Y]; L = L.concat(F); } function I(Y, te, F) { return te || console.error("THREE.ExtrudeGeometry: vec does not exist"), te.clone().multiplyScalar(F).add(Y); } const b = L.length, O = A.length; function N(Y, te, F) { let $, J, z; const V = Y.x - te.x, oe = Y.y - te.y, ue = F.x - Y.x, le = F.y - Y.y, ve = V * V + oe * oe, xe = V * le - oe * ue; if (Math.abs(xe) > Number.EPSILON) { const Te = Math.sqrt(ve), de = Math.sqrt(ue * ue + le * le), we = te.x - oe / Te, se = te.y + V / Te, Se2 = F.x - le / de, ge = F.y + ue / de, be2 = ((Se2 - we) * le - (ge - se) * ue) / (V * le - oe * ue); $ = we + V * be2 - Y.x, J = se + oe * be2 - Y.y; const Ie2 = $ * $ + J * J; if (Ie2 <= 2) return new Pe($, J); z = Math.sqrt(Ie2 / 2); } else { let Te = false; V > Number.EPSILON ? ue > Number.EPSILON && (Te = true) : V < -Number.EPSILON ? ue < -Number.EPSILON && (Te = true) : Math.sign(oe) === Math.sign(le) && (Te = true), Te ? ($ = -oe, J = V, z = Math.sqrt(ve)) : ($ = V, J = oe, z = Math.sqrt(ve / 2)); } return new Pe($ / z, J / z); } const D = []; for (let Y = 0, te = P.length, F = te - 1, $ = Y + 1; Y < te; Y++, F++, $++) F === te && (F = 0), $ === te && ($ = 0), D[Y] = N(P[Y], P[F], P[$]); const B = []; let U, k = D.concat(); for (let Y = 0, te = R.length; Y < te; Y++) { const F = R[Y]; U = []; for (let $ = 0, J = F.length, z = J - 1, V = $ + 1; $ < J; $++, z++, V++) z === J && (z = 0), V === J && (V = 0), U[$] = N(F[$], F[z], F[V]); B.push(U), k = k.concat(U); } for (let Y = 0; Y < y; Y++) { const te = Y / y, F = g * Math.cos(te * Math.PI / 2), $ = f * Math.sin(te * Math.PI / 2) + u; for (let J = 0, z = P.length; J < z; J++) { const V = I(P[J], D[J], $); W(V.x, V.y, -F); } for (let J = 0, z = R.length; J < z; J++) { const V = R[J]; U = B[J]; for (let oe = 0, ue = V.length; oe < ue; oe++) { const le = I(V[oe], U[oe], $); W(le.x, le.y, -F); } } } const K = f + u; for (let Y = 0; Y < b; Y++) { const te = p ? I(L[Y], k[Y], K) : L[Y]; S ? (x.copy(T.normals[0]).multiplyScalar(te.x), M.copy(T.binormals[0]).multiplyScalar(te.y), _.copy(w[0]).add(x).add(M), W(_.x, _.y, _.z)) : W(te.x, te.y, 0); } for (let Y = 1; Y <= d; Y++) for (let te = 0; te < b; te++) { const F = p ? I(L[te], k[te], K) : L[te]; S ? (x.copy(T.normals[Y]).multiplyScalar(F.x), M.copy(T.binormals[Y]).multiplyScalar(F.y), _.copy(w[Y]).add(x).add(M), W(_.x, _.y, _.z)) : W(F.x, F.y, h6 / d * Y); } for (let Y = y - 1; Y >= 0; Y--) { const te = Y / y, F = g * Math.cos(te * Math.PI / 2), $ = f * Math.sin(te * Math.PI / 2) + u; for (let J = 0, z = P.length; J < z; J++) { const V = I(P[J], D[J], $); W(V.x, V.y, h6 + F); } for (let J = 0, z = R.length; J < z; J++) { const V = R[J]; U = B[J]; for (let oe = 0, ue = V.length; oe < ue; oe++) { const le = I(V[oe], U[oe], $); S ? W(le.x, le.y + w[d - 1].y, w[d - 1].x + F) : W(le.x, le.y, h6 + F); } } } ie(), j(); function ie() { const Y = r.length / 3; if (p) { let te = 0, F = b * te; for (let $ = 0; $ < O; $++) { const J = A[$]; q(J[2] + F, J[1] + F, J[0] + F); } te = d + y * 2, F = b * te; for (let $ = 0; $ < O; $++) { const J = A[$]; q(J[0] + F, J[1] + F, J[2] + F); } } else { for (let te = 0; te < O; te++) { const F = A[te]; q(F[2], F[1], F[0]); } for (let te = 0; te < O; te++) { const F = A[te]; q(F[0] + b * d, F[1] + b * d, F[2] + b * d); } } i.addGroup(Y, r.length / 3 - Y, 0); } function j() { const Y = r.length / 3; let te = 0; G(P, te), te += P.length; for (let F = 0, $ = R.length; F < $; F++) { const J = R[F]; G(J, te), te += J.length; } i.addGroup(Y, r.length / 3 - Y, 1); } function G(Y, te) { let F = Y.length; for (; --F >= 0; ) { const $ = F; let J = F - 1; J < 0 && (J = Y.length - 1); for (let z = 0, V = d + y * 2; z < V; z++) { const oe = b * z, ue = b * (z + 1), le = te + $ + oe, ve = te + J + oe, xe = te + J + ue, Te = te + $ + ue; Q(le, ve, xe, Te); } } } function W(Y, te, F) { c.push(Y), c.push(te), c.push(F); } function q(Y, te, F) { ee(Y), ee(te), ee(F); const $ = r.length / 3, J = m.generateTopUV(i, r, $ - 3, $ - 2, $ - 1); ne(J[0]), ne(J[1]), ne(J[2]); } function Q(Y, te, F, $) { ee(Y), ee(te), ee($), ee(te), ee(F), ee($); const J = r.length / 3, z = m.generateSideWallUV(i, r, J - 6, J - 3, J - 2, J - 1); ne(z[0]), ne(z[1]), ne(z[3]), ne(z[1]), ne(z[2]), ne(z[3]); } function ee(Y) { r.push(c[Y * 3 + 0]), r.push(c[Y * 3 + 1]), r.push(c[Y * 3 + 2]); } function ne(Y) { s.push(Y.x), s.push(Y.y); } } } toJSON() { const e = super.toJSON(), t13 = this.parameters.shapes, i = this.parameters.options; return cF2(t13, i, e); } static fromJSON(e, t13) { const i = []; for (let s = 0, o = e.shapes.length; s < o; s++) { const a = t13[e.shapes[s]]; i.push(a); } const r = e.options.extrudePath; return r !== void 0 && (e.options.extrudePath = new cp2[r.type]().fromJSON(r)), new _wi(i, e.options); } }; var lF2 = { generateTopUV: function(n, e, t13, i, r) { const s = e[t13 * 3], o = e[t13 * 3 + 1], a = e[i * 3], c = e[i * 3 + 1], l = e[r * 3], d = e[r * 3 + 1]; return [ new Pe(s, o), new Pe(a, c), new Pe(l, d) ]; }, generateSideWallUV: function(n, e, t13, i, r, s) { const o = e[t13 * 3], a = e[t13 * 3 + 1], c = e[t13 * 3 + 2], l = e[i * 3], d = e[i * 3 + 1], h6 = e[i * 3 + 2], p = e[r * 3], g = e[r * 3 + 1], f = e[r * 3 + 2], u = e[s * 3], y = e[s * 3 + 1], v = e[s * 3 + 2]; return Math.abs(a - d) < Math.abs(o - l) ? [ new Pe(o, 1 - c), new Pe(l, 1 - h6), new Pe(p, 1 - f), new Pe(u, 1 - v) ] : [ new Pe(a, 1 - c), new Pe(d, 1 - h6), new Pe(g, 1 - f), new Pe(y, 1 - v) ]; } }; function cF2(n, e, t13) { if (t13.shapes = [], Array.isArray(n)) for (let i = 0, r = n.length; i < r; i++) { const s = n[i]; t13.shapes.push(s.uuid); } else t13.shapes.push(n.uuid); return e.extrudePath !== void 0 && (t13.options.extrudePath = e.extrudePath.toJSON()), t13; } var Wo2 = class _Wo extends Vi2 { constructor(e = 1, t13 = 0) { const i = (1 + Math.sqrt(5)) / 2, r = [ -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 ], s = [ 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(r, s, e, t13), this.type = "IcosahedronGeometry", this.parameters = { radius: e, detail: t13 }; } static fromJSON(e) { return new _Wo(e.radius, e.detail); } }; var jo2 = class _jo extends Je2 { constructor(e, t13 = 12, i = 0, r = Math.PI * 2) { super(), this.type = "LatheGeometry", this.parameters = { points: e, segments: t13, phiStart: i, phiLength: r }, t13 = Math.floor(t13), r = wn3(r, 0, Math.PI * 2); const s = [], o = [], a = [], c = 1 / t13, l = new X(), d = new Pe(); for (let h6 = 0; h6 <= t13; h6++) { const p = i + h6 * c * r, g = Math.sin(p), f = Math.cos(p); for (let u = 0; u <= e.length - 1; u++) l.x = e[u].x * g, l.y = e[u].y, l.z = e[u].x * f, o.push(l.x, l.y, l.z), d.x = h6 / t13, d.y = u / (e.length - 1), a.push(d.x, d.y); } for (let h6 = 0; h6 < t13; h6++) for (let p = 0; p < e.length - 1; p++) { const g = p + h6 * e.length, f = g, u = g + e.length, y = g + e.length + 1, v = g + 1; s.push(f, u, v), s.push(u, y, v); } if (this.setIndex(s), this.setAttribute("position", new We(o, 3)), this.setAttribute("uv", new We(a, 2)), this.computeVertexNormals(), r === Math.PI * 2) { const h6 = this.attributes.normal.array, p = new X(), g = new X(), f = new X(), u = t13 * e.length * 3; for (let y = 0, v = 0; y < e.length; y++, v += 3) p.x = h6[v + 0], p.y = h6[v + 1], p.z = h6[v + 2], g.x = h6[u + v + 0], g.y = h6[u + v + 1], g.z = h6[u + v + 2], f.addVectors(p, g).normalize(), h6[v + 0] = h6[u + v + 0] = f.x, h6[v + 1] = h6[u + v + 1] = f.y, h6[v + 2] = h6[u + v + 2] = f.z; } } static fromJSON(e) { return new _jo(e.points, e.segments, e.phiStart, e.phiLength); } }; var Ns2 = class _Ns extends Vi2 { constructor(e = 1, t13 = 0) { const i = [ 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1 ], r = [ 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, r, e, t13), this.type = "OctahedronGeometry", this.parameters = { radius: e, detail: t13 }; } static fromJSON(e) { return new _Ns(e.radius, e.detail); } }; var tu2 = class extends Je2 { constructor(e, t13, i) { super(), this.type = "ParametricGeometry", this.parameters = { func: e, slices: t13, stacks: i }; const r = [], s = [], o = [], a = [], c = 1e-5, l = new X(), d = new X(), h6 = new X(), p = new X(), g = new X(); e.length < 3 && console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter."); const f = t13 + 1; for (let u = 0; u <= i; u++) { const y = u / i; for (let v = 0; v <= t13; v++) { const m = v / t13; e(m, y, d), s.push(d.x, d.y, d.z), m - c >= 0 ? (e(m - c, y, h6), p.subVectors(d, h6)) : (e(m + c, y, h6), p.subVectors(h6, d)), y - c >= 0 ? (e(m, y - c, h6), g.subVectors(d, h6)) : (e(m, y + c, h6), g.subVectors(h6, d)), l.crossVectors(p, g).normalize(), o.push(l.x, l.y, l.z), a.push(m, y); } } for (let u = 0; u < i; u++) for (let y = 0; y < t13; y++) { const v = u * f + y, m = u * f + y + 1, w = (u + 1) * f + y + 1, S = (u + 1) * f + y; r.push(v, m, S), r.push(m, w, S); } this.setIndex(r), this.setAttribute("position", new We(s, 3)), this.setAttribute("normal", new We(o, 3)), this.setAttribute("uv", new We(a, 2)); } }; var $o2 = class _$o extends Je2 { constructor(e = 0.5, t13 = 1, i = 8, r = 1, s = 0, o = Math.PI * 2) { super(), this.type = "RingGeometry", this.parameters = { innerRadius: e, outerRadius: t13, thetaSegments: i, phiSegments: r, thetaStart: s, thetaLength: o }, i = Math.max(3, i), r = Math.max(1, r); const a = [], c = [], l = [], d = []; let h6 = e; const p = (t13 - e) / r, g = new X(), f = new Pe(); for (let u = 0; u <= r; u++) { for (let y = 0; y <= i; y++) { const v = s + y / i * o; g.x = h6 * Math.cos(v), g.y = h6 * Math.sin(v), c.push(g.x, g.y, g.z), l.push(0, 0, 1), f.x = (g.x / t13 + 1) / 2, f.y = (g.y / t13 + 1) / 2, d.push(f.x, f.y); } h6 += p; } for (let u = 0; u < r; u++) { const y = u * (i + 1); for (let v = 0; v < i; v++) { const m = v + y, w = m, S = m + i + 1, T = m + i + 2, M = m + 1; a.push(w, S, M), a.push(S, T, M); } } this.setIndex(a), this.setAttribute("position", new We(c, 3)), this.setAttribute("normal", new We(l, 3)), this.setAttribute("uv", new We(d, 2)); } static fromJSON(e) { return new _$o(e.innerRadius, e.outerRadius, e.thetaSegments, e.phiSegments, e.thetaStart, e.thetaLength); } }; var Fs2 = class _Fs extends Je2 { constructor(e, t13 = 12) { super(), this.type = "ShapeGeometry", this.parameters = { shapes: e, curveSegments: t13 }; const i = [], r = [], s = [], o = []; let a = 0, c = 0; if (Array.isArray(e) === false) l(e); else for (let d = 0; d < e.length; d++) l(e[d]), this.addGroup(a, c, d), a += c, c = 0; this.setIndex(i), this.setAttribute("position", new We(r, 3)), this.setAttribute("normal", new We(s, 3)), this.setAttribute("uv", new We(o, 2)); function l(d) { const h6 = r.length / 3, p = d.extractPoints(t13); let g = p.shape; const f = p.holes; Fi2.isClockWise(g) === false && (g = g.reverse()); for (let y = 0, v = f.length; y < v; y++) { const m = f[y]; Fi2.isClockWise(m) === true && (f[y] = m.reverse()); } const u = Fi2.triangulateShape(g, f); for (let y = 0, v = f.length; y < v; y++) { const m = f[y]; g = g.concat(m); } for (let y = 0, v = g.length; y < v; y++) { const m = g[y]; r.push(m.x, m.y, 0), s.push(0, 0, 1), o.push(m.x, m.y); } for (let y = 0, v = u.length; y < v; y++) { const m = u[y], w = m[0] + h6, S = m[1] + h6, T = m[2] + h6; i.push(w, S, T), c += 3; } } } toJSON() { const e = super.toJSON(), t13 = this.parameters.shapes; return uF2(t13, e); } static fromJSON(e, t13) { const i = []; for (let r = 0, s = e.shapes.length; r < s; r++) { const o = t13[e.shapes[r]]; i.push(o); } return new _Fs(i, e.curveSegments); } }; function uF2(n, e) { if (e.shapes = [], Array.isArray(n)) for (let t13 = 0, i = n.length; t13 < i; t13++) { const r = n[t13]; e.shapes.push(r.uuid); } else e.shapes.push(n.uuid); return e; } var Bs2 = class _Bs extends Je2 { constructor(e = 1, t13 = 8, i = 6, r = 0, s = Math.PI * 2, o = 0, a = Math.PI) { super(), this.type = "SphereGeometry", this.parameters = { radius: e, widthSegments: t13, heightSegments: i, phiStart: r, phiLength: s, thetaStart: o, thetaLength: a }, t13 = Math.max(3, Math.floor(t13)), i = Math.max(2, Math.floor(i)); const c = Math.min(o + a, Math.PI); let l = 0; const d = [], h6 = new X(), p = new X(), g = [], f = [], u = [], y = []; for (let v = 0; v <= i; v++) { const m = [], w = v / i; let S = 0; v == 0 && o == 0 ? S = 0.5 / t13 : v == i && c == Math.PI && (S = -0.5 / t13); for (let T = 0; T <= t13; T++) { const M = T / t13; h6.x = -e * Math.cos(r + M * s) * Math.sin(o + w * a), h6.y = e * Math.cos(o + w * a), h6.z = e * Math.sin(r + M * s) * Math.sin(o + w * a), f.push(h6.x, h6.y, h6.z), p.copy(h6).normalize(), u.push(p.x, p.y, p.z), y.push(M + S, 1 - w), m.push(l++); } d.push(m); } for (let v = 0; v < i; v++) for (let m = 0; m < t13; m++) { const w = d[v][m + 1], S = d[v][m], T = d[v + 1][m], M = d[v + 1][m + 1]; (v !== 0 || o > 0) && g.push(w, S, M), (v !== i - 1 || c < Math.PI) && g.push(S, T, M); } this.setIndex(g), this.setAttribute("position", new We(f, 3)), this.setAttribute("normal", new We(u, 3)), this.setAttribute("uv", new We(y, 2)); } static fromJSON(e) { return new _Bs(e.radius, e.widthSegments, e.heightSegments, e.phiStart, e.phiLength, e.thetaStart, e.thetaLength); } }; var Zo2 = class _Zo extends Vi2 { constructor(e = 1, t13 = 0) { const i = [ 1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1 ], r = [ 2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1 ]; super(i, r, e, t13), this.type = "TetrahedronGeometry", this.parameters = { radius: e, detail: t13 }; } static fromJSON(e) { return new _Zo(e.radius, e.detail); } }; var nu2 = class extends wi2 { constructor(e, t13 = {}) { const i = t13.font; if (!(i && i.isFont)) return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."), new Je2(); const r = i.generateShapes(e, t13.size); t13.depth = t13.height !== void 0 ? t13.height : 50, t13.bevelThickness === void 0 && (t13.bevelThickness = 10), t13.bevelSize === void 0 && (t13.bevelSize = 8), t13.bevelEnabled === void 0 && (t13.bevelEnabled = false), super(r, t13), this.type = "TextGeometry"; } }; var Xo2 = class _Xo extends Je2 { constructor(e = 1, t13 = 0.4, i = 8, r = 6, s = Math.PI * 2) { super(), this.type = "TorusGeometry", this.parameters = { radius: e, tube: t13, radialSegments: i, tubularSegments: r, arc: s }, i = Math.floor(i), r = Math.floor(r); const o = [], a = [], c = [], l = [], d = new X(), h6 = new X(), p = new X(); for (let g = 0; g <= i; g++) for (let f = 0; f <= r; f++) { const u = f / r * s, y = g / i * Math.PI * 2; h6.x = (e + t13 * Math.cos(y)) * Math.cos(u), h6.y = (e + t13 * Math.cos(y)) * Math.sin(u), h6.z = t13 * Math.sin(y), a.push(h6.x, h6.y, h6.z), d.x = e * Math.cos(u), d.y = e * Math.sin(u), p.subVectors(h6, d).normalize(), c.push(p.x, p.y, p.z), l.push(f / r), l.push(g / i); } for (let g = 1; g <= i; g++) for (let f = 1; f <= r; f++) { const u = (r + 1) * g + f - 1, y = (r + 1) * (g - 1) + f - 1, v = (r + 1) * (g - 1) + f, m = (r + 1) * g + f; o.push(u, y, m), o.push(y, v, m); } this.setIndex(o), this.setAttribute("position", new We(a, 3)), this.setAttribute("normal", new We(c, 3)), this.setAttribute("uv", new We(l, 2)); } static fromJSON(e) { return new _Xo(e.radius, e.tube, e.radialSegments, e.tubularSegments, e.arc); } }; var Yo2 = class _Yo extends Je2 { constructor(e = 1, t13 = 0.4, i = 64, r = 8, s = 2, o = 3) { super(), this.type = "TorusKnotGeometry", this.parameters = { radius: e, tube: t13, tubularSegments: i, radialSegments: r, p: s, q: o }, i = Math.floor(i), r = Math.floor(r); const a = [], c = [], l = [], d = [], h6 = new X(), p = new X(), g = new X(), f = new X(), u = new X(), y = new X(), v = new X(); for (let w = 0; w <= i; ++w) { const S = w / i * s * Math.PI * 2; m(S, s, o, e, g), m(S + 0.01, s, o, e, f), y.subVectors(f, g), v.addVectors(f, g), u.crossVectors(y, v), v.crossVectors(u, y), u.normalize(), v.normalize(); for (let T = 0; T <= r; ++T) { const M = T / r * Math.PI * 2, x = -t13 * Math.cos(M), _ = t13 * Math.sin(M); h6.x = g.x + (x * v.x + _ * u.x), h6.y = g.y + (x * v.y + _ * u.y), h6.z = g.z + (x * v.z + _ * u.z), c.push(h6.x, h6.y, h6.z), p.subVectors(h6, g).normalize(), l.push(p.x, p.y, p.z), d.push(w / i), d.push(T / r); } } for (let w = 1; w <= i; w++) for (let S = 1; S <= r; S++) { const T = (r + 1) * (w - 1) + (S - 1), M = (r + 1) * w + (S - 1), x = (r + 1) * w + S, _ = (r + 1) * (w - 1) + S; a.push(T, M, _), a.push(M, x, _); } this.setIndex(a), this.setAttribute("position", new We(c, 3)), this.setAttribute("normal", new We(l, 3)), this.setAttribute("uv", new We(d, 2)); function m(w, S, T, M, x) { const _ = Math.cos(w), E = Math.sin(w), L = T / S * w, R = Math.cos(L); x.x = M * (2 + R) * 0.5 * _, x.y = M * (2 + R) * E * 0.5, x.z = M * Math.sin(L) * 0.5; } } static fromJSON(e) { return new _Yo(e.radius, e.tube, e.tubularSegments, e.radialSegments, e.p, e.q); } }; var Jo2 = class _Jo extends Je2 { constructor(e, t13 = 64, i = 1, r = 8, s = false) { super(), this.type = "TubeGeometry", this.parameters = { path: e, tubularSegments: t13, radius: i, radialSegments: r, closed: s }; const o = e.computeFrenetFrames(t13, s); this.tangents = o.tangents, this.normals = o.normals, this.binormals = o.binormals; const a = new X(), c = new X(), l = new Pe(); let d = new X(); const h6 = [], p = [], g = [], f = []; u(), this.setIndex(f), this.setAttribute("position", new We(h6, 3)), this.setAttribute("normal", new We(p, 3)), this.setAttribute("uv", new We(g, 2)); function u() { for (let w = 0; w < t13; w++) y(w); y(s === false ? t13 : 0), m(), v(); } function y(w) { d = e.getPointAt(w / t13, d); const S = o.normals[w], T = o.binormals[w]; for (let M = 0; M <= r; M++) { const x = M / r * Math.PI * 2, _ = Math.sin(x), E = -Math.cos(x); c.x = E * S.x + _ * T.x, c.y = E * S.y + _ * T.y, c.z = E * S.z + _ * T.z, c.normalize(), p.push(c.x, c.y, c.z), a.x = d.x + i * c.x, a.y = d.y + i * c.y, a.z = d.z + i * c.z, h6.push(a.x, a.y, a.z); } } function v() { for (let w = 1; w <= t13; w++) for (let S = 1; S <= r; S++) { const T = (r + 1) * (w - 1) + (S - 1), M = (r + 1) * w + (S - 1), x = (r + 1) * w + S, _ = (r + 1) * (w - 1) + S; f.push(T, M, _), f.push(M, x, _); } } function m() { for (let w = 0; w <= t13; w++) for (let S = 0; S <= r; S++) l.x = w / t13, l.y = S / r, g.push(l.x, l.y); } } toJSON() { const e = super.toJSON(); return e.path = this.parameters.path.toJSON(), e; } static fromJSON(e) { return new _Jo( new cp2[e.path.type]().fromJSON(e.path), e.tubularSegments, e.radius, e.radialSegments, e.closed ); } }; var up2 = class extends Je2 { constructor(e) { if (super(), this.type = "WireframeGeometry", e.isGeometry === true) { console.error("THREE.WireframeGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); return; } const t13 = [], i = [0, 0], r = {}, s = new X(); if (e.index !== null) { const o = e.attributes.position, a = e.index; let c = e.groups; c.length === 0 && (c = [{ start: 0, count: a.count, materialIndex: 0 }]); for (let l = 0, d = c.length; l < d; ++l) { const h6 = c[l], p = h6.start, g = h6.count; for (let f = p, u = p + g; f < u; f += 3) for (let y = 0; y < 3; y++) { const v = a.getX(f + y), m = a.getX(f + (y + 1) % 3); i[0] = Math.min(v, m), i[1] = Math.max(v, m); const w = i[0] + "," + i[1]; r[w] === void 0 && (r[w] = { index1: i[0], index2: i[1] }); } } for (const l in r) { const d = r[l]; s.fromBufferAttribute(o, d.index1), t13.push(s.x, s.y, s.z), s.fromBufferAttribute(o, d.index2), t13.push(s.x, s.y, s.z); } } else { const o = e.attributes.position; for (let a = 0, c = o.count / 3; a < c; a++) for (let l = 0; l < 3; l++) { const d = 3 * a + l; s.fromBufferAttribute(o, d), t13.push(s.x, s.y, s.z); const h6 = 3 * a + (l + 1) % 3; s.fromBufferAttribute(o, h6), t13.push(s.x, s.y, s.z); } } this.setAttribute("position", new We(t13, 3)); } }; var av2 = Object.freeze({ __proto__: null, BoxGeometry: hr2, BoxBufferGeometry: hr2, CircleGeometry: ko2, CircleBufferGeometry: ko2, ConeGeometry: Go2, ConeBufferGeometry: Go2, CylinderGeometry: qr, CylinderBufferGeometry: qr, DodecahedronGeometry: Ho2, DodecahedronBufferGeometry: Ho2, EdgesGeometry: ip2, ExtrudeGeometry: wi2, ExtrudeBufferGeometry: wi2, IcosahedronGeometry: Wo2, IcosahedronBufferGeometry: Wo2, LatheGeometry: jo2, LatheBufferGeometry: jo2, OctahedronGeometry: Ns2, OctahedronBufferGeometry: Ns2, ParametricGeometry: tu2, ParametricBufferGeometry: tu2, PlaneGeometry: Ds2, PlaneBufferGeometry: Ds2, PolyhedronGeometry: Vi2, PolyhedronBufferGeometry: Vi2, RingGeometry: $o2, RingBufferGeometry: $o2, ShapeGeometry: Fs2, ShapeBufferGeometry: Fs2, SphereGeometry: Bs2, SphereBufferGeometry: Bs2, TetrahedronGeometry: Zo2, TetrahedronBufferGeometry: Zo2, TextGeometry: nu2, TextBufferGeometry: nu2, TorusGeometry: Xo2, TorusBufferGeometry: Xo2, TorusKnotGeometry: Yo2, TorusKnotBufferGeometry: Yo2, TubeGeometry: Jo2, TubeBufferGeometry: Jo2, WireframeGeometry: up2 }); var hp2 = class extends sn { constructor(e) { super(), this.type = "ShadowMaterial", this.color = new Fe(0), this.transparent = true, this.setValues(e); } copy(e) { return super.copy(e), this.color.copy(e.color), this; } }; hp2.prototype.isShadowMaterial = true; var da2 = class extends dr2 { constructor(e) { super(e), this.type = "RawShaderMaterial"; } }; da2.prototype.isRawShaderMaterial = true; var js2 = class extends sn { constructor(e) { super(), this.defines = { STANDARD: "" }, this.type = "MeshStandardMaterial", this.color = new Fe(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 Fe(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = ts2, this.normalScale = new Pe(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 = false, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.morphTargets = false, this.morphNormals = false, this.flatShading = false, this.vertexTangents = false, 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; } }; js2.prototype.isMeshStandardMaterial = true; var Il2 = class extends js2 { 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 Pe(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(t13) { this.reflectivity = wn3(2.5 * (t13 - 1) / (t13 + 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 Fe(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 Fe()).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; } }; Il2.prototype.isMeshPhysicalMaterial = true; var dp2 = class extends sn { constructor(e) { super(), this.type = "MeshPhongMaterial", this.color = new Fe(16777215), this.specular = new Fe(1118481), this.shininess = 30, this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new Fe(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = ts2, this.normalScale = new Pe(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.combine = vl2, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = false, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.morphTargets = false, this.morphNormals = false, this.flatShading = false, 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; } }; dp2.prototype.isMeshPhongMaterial = true; var fp2 = class extends sn { constructor(e) { super(), this.defines = { TOON: "" }, this.type = "MeshToonMaterial", this.color = new Fe(16777215), this.map = null, this.gradientMap = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new Fe(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = ts2, this.normalScale = new Pe(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.alphaMap = null, this.wireframe = false, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.morphTargets = false, this.morphNormals = false, 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; } }; fp2.prototype.isMeshToonMaterial = true; var pp2 = class extends sn { constructor(e) { super(), this.type = "MeshNormalMaterial", this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = ts2, this.normalScale = new Pe(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.wireframe = false, this.wireframeLinewidth = 1, this.fog = false, this.morphTargets = false, this.morphNormals = false, this.flatShading = false, 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; } }; pp2.prototype.isMeshNormalMaterial = true; var mp2 = class extends sn { constructor(e) { super(), this.type = "MeshLambertMaterial", this.color = new Fe(16777215), this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.emissive = new Fe(0), this.emissiveIntensity = 1, this.emissiveMap = null, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.combine = vl2, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = false, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.morphTargets = false, this.morphNormals = false, 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; } }; mp2.prototype.isMeshLambertMaterial = true; var gp2 = class extends sn { constructor(e) { super(), this.defines = { MATCAP: "" }, this.type = "MeshMatcapMaterial", this.color = new Fe(16777215), this.matcap = null, this.map = null, this.bumpMap = null, this.bumpScale = 1, this.normalMap = null, this.normalMapType = ts2, this.normalScale = new Pe(1, 1), this.displacementMap = null, this.displacementScale = 1, this.displacementBias = 0, this.alphaMap = null, this.morphTargets = false, this.morphNormals = false, this.flatShading = false, 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; } }; gp2.prototype.isMeshMatcapMaterial = true; var vp2 = class extends un2 { 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; } }; vp2.prototype.isLineDashedMaterial = true; var hF2 = Object.freeze({ __proto__: null, ShadowMaterial: hp2, SpriteMaterial: Tl2, RawShaderMaterial: da2, ShaderMaterial: dr2, PointsMaterial: ss2, MeshPhysicalMaterial: Il2, MeshStandardMaterial: js2, MeshPhongMaterial: dp2, MeshToonMaterial: fp2, MeshNormalMaterial: pp2, MeshLambertMaterial: mp2, MeshDepthMaterial: Ou2, MeshDistanceMaterial: Du2, MeshBasicMaterial: Vn2, MeshMatcapMaterial: gp2, LineDashedMaterial: vp2, LineBasicMaterial: un2, Material: sn }); var It2 = { // same as Array.prototype.slice, but also works on typed arrays arraySlice: function(n, e, t13) { return It2.isTypedArray(n) ? new n.constructor(n.subarray(e, t13 !== void 0 ? t13 : n.length)) : n.slice(e, t13); }, // converts an array to a specific type convertArray: function(n, e, t13) { return !n || // let 'undefined' and 'null' pass !t13 && n.constructor === e ? n : typeof e.BYTES_PER_ELEMENT == "number" ? new e(n) : Array.prototype.slice.call(n); }, isTypedArray: function(n) { return ArrayBuffer.isView(n) && !(n instanceof DataView); }, // returns an array by which times and values can be sorted getKeyframeOrder: function(n) { function e(r, s) { return n[r] - n[s]; } const t13 = n.length, i = new Array(t13); for (let r = 0; r !== t13; ++r) i[r] = r; return i.sort(e), i; }, // uses the array previously returned by 'getKeyframeOrder' to sort data sortedArray: function(n, e, t13) { const i = n.length, r = new n.constructor(i); for (let s = 0, o = 0; o !== i; ++s) { const a = t13[s] * e; for (let c = 0; c !== e; ++c) r[o++] = n[a + c]; } return r; }, // function for parsing AOS keyframe formats flattenJSON: function(n, e, t13, i) { let r = 1, s = n[0]; for (; s !== void 0 && s[i] === void 0; ) s = n[r++]; if (s === void 0) return; let o = s[i]; if (o !== void 0) if (Array.isArray(o)) do o = s[i], o !== void 0 && (e.push(s.time), t13.push.apply(t13, o)), s = n[r++]; while (s !== void 0); else if (o.toArray !== void 0) do o = s[i], o !== void 0 && (e.push(s.time), o.toArray(t13, t13.length)), s = n[r++]; while (s !== void 0); else do o = s[i], o !== void 0 && (e.push(s.time), t13.push(o)), s = n[r++]; while (s !== void 0); }, subclip: function(n, e, t13, i, r = 30) { const s = n.clone(); s.name = e; const o = []; for (let c = 0; c < s.tracks.length; ++c) { const l = s.tracks[c], d = l.getValueSize(), h6 = [], p = []; for (let g = 0; g < l.times.length; ++g) { const f = l.times[g] * r; if (!(f < t13 || f >= i)) { h6.push(l.times[g]); for (let u = 0; u < d; ++u) p.push(l.values[g * d + u]); } } h6.length !== 0 && (l.times = It2.convertArray(h6, l.times.constructor), l.values = It2.convertArray(p, l.values.constructor), o.push(l)); } s.tracks = o; let a = 1 / 0; for (let c = 0; c < s.tracks.length; ++c) a > s.tracks[c].times[0] && (a = s.tracks[c].times[0]); for (let c = 0; c < s.tracks.length; ++c) s.tracks[c].shift(-1 * a); return s.resetDuration(), s; }, makeClipAdditive: function(n, e = 0, t13 = n, i = 30) { i <= 0 && (i = 30); const r = t13.tracks.length, s = e / i; for (let o = 0; o < r; ++o) { const a = t13.tracks[o], c = a.ValueTypeName; if (c === "bool" || c === "string") continue; const l = n.tracks.find(function(v) { return v.name === a.name && v.ValueTypeName === c; }); if (l === void 0) continue; let d = 0; const h6 = a.getValueSize(); a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline && (d = h6 / 3); let p = 0; const g = l.getValueSize(); l.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline && (p = g / 3); const f = a.times.length - 1; let u; if (s <= a.times[0]) { const v = d, m = h6 - d; u = It2.arraySlice(a.values, v, m); } else if (s >= a.times[f]) { const v = f * h6 + d, m = v + h6 - d; u = It2.arraySlice(a.values, v, m); } else { const v = a.createInterpolant(), m = d, w = h6 - d; v.evaluate(s), u = It2.arraySlice(v.resultBuffer, m, w); } c === "quaternion" && new Sn().fromArray(u).normalize().conjugate().toArray(u); const y = l.times.length; for (let v = 0; v < y; ++v) { const m = v * g + p; if (c === "quaternion") Sn.multiplyQuaternionsFlat( l.values, m, u, 0, l.values, m ); else { const w = g - p * 2; for (let S = 0; S < w; ++S) l.values[m + S] -= u[S]; } } } return n.blendMode = Wf2, n; } }; var ki = class { constructor(e, t13, i, r) { this.parameterPositions = e, this._cachedIndex = 0, this.resultBuffer = r !== void 0 ? r : new t13.constructor(i), this.sampleValues = t13, this.valueSize = i, this.settings = null, this.DefaultSettings_ = {}; } evaluate(e) { const t13 = this.parameterPositions; let i = this._cachedIndex, r = t13[i], s = t13[i - 1]; e: { t: { let o; n: { i: if (!(e < r)) { for (let a = i + 2; ; ) { if (r === void 0) { if (e < s) break i; return i = t13.length, this._cachedIndex = i, this.afterEnd_(i - 1, e, s); } if (i === a) break; if (s = r, r = t13[++i], e < r) break t; } o = t13.length; break n; } if (!(e >= s)) { const a = t13[1]; e < a && (i = 2, s = a); for (let c = i - 2; ; ) { if (s === void 0) return this._cachedIndex = 0, this.beforeStart_(0, e, r); if (i === c) break; if (r = s, s = t13[--i - 1], e >= s) break t; } o = i, i = 0; break n; } break e; } for (; i < o; ) { const a = i + o >>> 1; e < t13[a] ? o = a : i = a + 1; } if (r = t13[i], s = t13[i - 1], s === void 0) return this._cachedIndex = 0, this.beforeStart_(0, e, r); if (r === void 0) return i = t13.length, this._cachedIndex = i, this.afterEnd_(i - 1, s, e); } this._cachedIndex = i, this.intervalChanged_(i, s, r); } return this.interpolate_(i, s, e, r); } getSettings_() { return this.settings || this.DefaultSettings_; } copySampleValue_(e) { const t13 = this.resultBuffer, i = this.sampleValues, r = this.valueSize, s = e * r; for (let o = 0; o !== r; ++o) t13[o] = i[s + o]; return t13; } // Template methods for derived classes: interpolate_() { throw new Error("call to abstract method"); } intervalChanged_() { } }; ki.prototype.beforeStart_ = ki.prototype.copySampleValue_; ki.prototype.afterEnd_ = ki.prototype.copySampleValue_; var jx2 = class extends ki { constructor(e, t13, i, r) { super(e, t13, i, r), this._weightPrev = -0, this._offsetPrev = -0, this._weightNext = -0, this._offsetNext = -0, this.DefaultSettings_ = { endingStart: xs2, endingEnd: xs2 }; } intervalChanged_(e, t13, i) { const r = this.parameterPositions; let s = e - 2, o = e + 1, a = r[s], c = r[o]; if (a === void 0) switch (this.getSettings_().endingStart) { case ws2: s = e, a = 2 * t13 - i; break; case tl2: s = r.length - 2, a = t13 + r[s] - r[s + 1]; break; default: s = e, a = i; } if (c === void 0) switch (this.getSettings_().endingEnd) { case ws2: o = e, c = 2 * i - t13; break; case tl2: o = 1, c = i + r[1] - r[0]; break; default: o = e - 1, c = t13; } const l = (i - t13) * 0.5, d = this.valueSize; this._weightPrev = l / (t13 - a), this._weightNext = l / (c - i), this._offsetPrev = s * d, this._offsetNext = o * d; } interpolate_(e, t13, i, r) { const s = this.resultBuffer, o = this.sampleValues, a = this.valueSize, c = e * a, l = c - a, d = this._offsetPrev, h6 = this._offsetNext, p = this._weightPrev, g = this._weightNext, f = (i - t13) / (r - t13), u = f * f, y = u * f, v = -p * y + 2 * p * u - p * f, m = (1 + p) * y + (-1.5 - 2 * p) * u + (-0.5 + p) * f + 1, w = (-1 - g) * y + (1.5 + g) * u + 0.5 * f, S = g * y - g * u; for (let T = 0; T !== a; ++T) s[T] = v * o[d + T] + m * o[l + T] + w * o[c + T] + S * o[h6 + T]; return s; } }; var yp2 = class extends ki { constructor(e, t13, i, r) { super(e, t13, i, r); } interpolate_(e, t13, i, r) { const s = this.resultBuffer, o = this.sampleValues, a = this.valueSize, c = e * a, l = c - a, d = (i - t13) / (r - t13), h6 = 1 - d; for (let p = 0; p !== a; ++p) s[p] = o[l + p] * h6 + o[c + p] * d; return s; } }; var $x2 = class extends ki { constructor(e, t13, i, r) { super(e, t13, i, r); } interpolate_(e) { return this.copySampleValue_(e - 1); } }; var Ti2 = class { constructor(e, t13, i, r) { if (e === void 0) throw new Error("THREE.KeyframeTrack: track name is undefined"); if (t13 === void 0 || t13.length === 0) throw new Error("THREE.KeyframeTrack: no keyframes in track named " + e); this.name = e, this.times = It2.convertArray(t13, this.TimeBufferType), this.values = It2.convertArray(i, this.ValueBufferType), this.setInterpolation(r || this.DefaultInterpolation); } // Serialization (in static context, because of constructor invocation // and automatic invocation of .toJSON): static toJSON(e) { const t13 = e.constructor; let i; if (t13.toJSON !== this.toJSON) i = t13.toJSON(e); else { i = { name: e.name, times: It2.convertArray(e.times, Array), values: It2.convertArray(e.values, Array) }; const r = e.getInterpolation(); r !== e.DefaultInterpolation && (i.interpolation = r); } return i.type = e.ValueTypeName, i; } InterpolantFactoryMethodDiscrete(e) { return new $x2(this.times, this.values, this.getValueSize(), e); } InterpolantFactoryMethodLinear(e) { return new yp2(this.times, this.values, this.getValueSize(), e); } InterpolantFactoryMethodSmooth(e) { return new jx2(this.times, this.values, this.getValueSize(), e); } setInterpolation(e) { let t13; switch (e) { case Bo: t13 = this.InterpolantFactoryMethodDiscrete; break; case Is2: t13 = this.InterpolantFactoryMethodLinear; break; case Vc2: t13 = this.InterpolantFactoryMethodSmooth; break; } if (t13 === 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 = t13, this; } getInterpolation() { switch (this.createInterpolant) { case this.InterpolantFactoryMethodDiscrete: return Bo; case this.InterpolantFactoryMethodLinear: return Is2; case this.InterpolantFactoryMethodSmooth: return Vc2; } } getValueSize() { return this.values.length / this.times.length; } // move all keyframes either forwards or backwards in time shift(e) { if (e !== 0) { const t13 = this.times; for (let i = 0, r = t13.length; i !== r; ++i) t13[i] += e; } return this; } // scale all keyframe times by a factor (useful for frame <-> seconds conversions) scale(e) { if (e !== 1) { const t13 = this.times; for (let i = 0, r = t13.length; i !== r; ++i) t13[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, t13) { const i = this.times, r = i.length; let s = 0, o = r - 1; for (; s !== r && i[s] < e; ) ++s; for (; o !== -1 && i[o] > t13; ) --o; if (++o, s !== 0 || o !== r) { s >= o && (o = Math.max(o, 1), s = o - 1); const a = this.getValueSize(); this.times = It2.arraySlice(i, s, o), this.values = It2.arraySlice(this.values, s * a, o * a); } return this; } // ensure we do not get a GarbageInGarbageOut situation, make sure tracks are at least minimally viable validate() { let e = true; const t13 = this.getValueSize(); t13 - Math.floor(t13) !== 0 && (console.error("THREE.KeyframeTrack: Invalid value size in track.", this), e = false); const i = this.times, r = this.values, s = i.length; s === 0 && (console.error("THREE.KeyframeTrack: Track is empty.", this), e = false); let o = null; for (let a = 0; a !== s; a++) { const c = i[a]; if (typeof c == "number" && isNaN(c)) { console.error("THREE.KeyframeTrack: Time is not a valid number.", this, a, c), e = false; break; } if (o !== null && o > c) { console.error("THREE.KeyframeTrack: Out of order keys.", this, a, c, o), e = false; break; } o = c; } if (r !== void 0 && It2.isTypedArray(r)) for (let a = 0, c = r.length; a !== c; ++a) { const l = r[a]; if (isNaN(l)) { console.error("THREE.KeyframeTrack: Value is not a valid number.", this, a, l), e = false; 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 = It2.arraySlice(this.times), t13 = It2.arraySlice(this.values), i = this.getValueSize(), r = this.getInterpolation() === Vc2, s = e.length - 1; let o = 1; for (let a = 1; a < s; ++a) { let c = false; const l = e[a], d = e[a + 1]; if (l !== d && (a !== 1 || l !== e[0])) if (r) c = true; else { const h6 = a * i, p = h6 - i, g = h6 + i; for (let f = 0; f !== i; ++f) { const u = t13[h6 + f]; if (u !== t13[p + f] || u !== t13[g + f]) { c = true; break; } } } if (c) { if (a !== o) { e[o] = e[a]; const h6 = a * i, p = o * i; for (let g = 0; g !== i; ++g) t13[p + g] = t13[h6 + g]; } ++o; } } if (s > 0) { e[o] = e[s]; for (let a = s * i, c = o * i, l = 0; l !== i; ++l) t13[c + l] = t13[a + l]; ++o; } return o !== e.length ? (this.times = It2.arraySlice(e, 0, o), this.values = It2.arraySlice(t13, 0, o * i)) : (this.times = e, this.values = t13), this; } clone() { const e = It2.arraySlice(this.times, 0), t13 = It2.arraySlice(this.values, 0), i = this.constructor, r = new i(this.name, e, t13); return r.createInterpolant = this.createInterpolant, r; } }; Ti2.prototype.TimeBufferType = Float32Array; Ti2.prototype.ValueBufferType = Float32Array; Ti2.prototype.DefaultInterpolation = Is2; var $s2 = class extends Ti2 { }; $s2.prototype.ValueTypeName = "bool"; $s2.prototype.ValueBufferType = Array; $s2.prototype.DefaultInterpolation = Bo; $s2.prototype.InterpolantFactoryMethodLinear = void 0; $s2.prototype.InterpolantFactoryMethodSmooth = void 0; var bp2 = class extends Ti2 { }; bp2.prototype.ValueTypeName = "color"; var qo2 = class extends Ti2 { }; qo2.prototype.ValueTypeName = "number"; var Zx2 = class extends ki { constructor(e, t13, i, r) { super(e, t13, i, r); } interpolate_(e, t13, i, r) { const s = this.resultBuffer, o = this.sampleValues, a = this.valueSize, c = (i - t13) / (r - t13); let l = e * a; for (let d = l + a; l !== d; l += 4) Sn.slerpFlat(s, 0, o, l - a, o, l, c); return s; } }; var Zs2 = class extends Ti2 { InterpolantFactoryMethodLinear(e) { return new Zx2(this.times, this.values, this.getValueSize(), e); } }; Zs2.prototype.ValueTypeName = "quaternion"; Zs2.prototype.DefaultInterpolation = Is2; Zs2.prototype.InterpolantFactoryMethodSmooth = void 0; var Xs2 = class extends Ti2 { }; Xs2.prototype.ValueTypeName = "string"; Xs2.prototype.ValueBufferType = Array; Xs2.prototype.DefaultInterpolation = Bo; Xs2.prototype.InterpolantFactoryMethodLinear = void 0; Xs2.prototype.InterpolantFactoryMethodSmooth = void 0; var Ko2 = class extends Ti2 { }; Ko2.prototype.ValueTypeName = "vector"; var Qo2 = class { constructor(e, t13 = -1, i, r = Eu2) { this.name = e, this.tracks = i, this.duration = t13, this.blendMode = r, this.uuid = Jn2(), this.duration < 0 && this.resetDuration(); } static parse(e) { const t13 = [], i = e.tracks, r = 1 / (e.fps || 1); for (let o = 0, a = i.length; o !== a; ++o) t13.push(fF2(i[o]).scale(r)); const s = new this(e.name, e.duration, t13, e.blendMode); return s.uuid = e.uuid, s; } static toJSON(e) { const t13 = [], i = e.tracks, r = { name: e.name, duration: e.duration, tracks: t13, uuid: e.uuid, blendMode: e.blendMode }; for (let s = 0, o = i.length; s !== o; ++s) t13.push(Ti2.toJSON(i[s])); return r; } static CreateFromMorphTargetSequence(e, t13, i, r) { const s = t13.length, o = []; for (let a = 0; a < s; a++) { let c = [], l = []; c.push( (a + s - 1) % s, a, (a + 1) % s ), l.push(0, 1, 0); const d = It2.getKeyframeOrder(c); c = It2.sortedArray(c, 1, d), l = It2.sortedArray(l, 1, d), !r && c[0] === 0 && (c.push(s), l.push(l[0])), o.push( new qo2( ".morphTargetInfluences[" + t13[a].name + "]", c, l ).scale(1 / i) ); } return new this(e, -1, o); } static findByName(e, t13) { let i = e; if (!Array.isArray(e)) { const r = e; i = r.geometry && r.geometry.animations || r.animations; } for (let r = 0; r < i.length; r++) if (i[r].name === t13) return i[r]; return null; } static CreateClipsFromMorphTargetSequences(e, t13, i) { const r = {}, s = /^([\w-]*?)([\d]+)$/; for (let a = 0, c = e.length; a < c; a++) { const l = e[a], d = l.name.match(s); if (d && d.length > 1) { const h6 = d[1]; let p = r[h6]; p || (r[h6] = p = []), p.push(l); } } const o = []; for (const a in r) o.push(this.CreateFromMorphTargetSequence(a, r[a], t13, i)); return o; } // parse the animation.hierarchy format static parseAnimation(e, t13) { if (!e) return console.error("THREE.AnimationClip: No animation in JSONLoader data."), null; const i = function(h6, p, g, f, u) { if (g.length !== 0) { const y = [], v = []; It2.flattenJSON(g, y, v, f), y.length !== 0 && u.push(new h6(p, y, v)); } }, r = [], s = e.name || "default", o = e.fps || 30, a = e.blendMode; let c = e.length || -1; const l = e.hierarchy || []; for (let h6 = 0; h6 < l.length; h6++) { const p = l[h6].keys; if (!(!p || p.length === 0)) if (p[0].morphTargets) { const g = {}; let f; for (f = 0; f < p.length; f++) if (p[f].morphTargets) for (let u = 0; u < p[f].morphTargets.length; u++) g[p[f].morphTargets[u]] = -1; for (const u in g) { const y = [], v = []; for (let m = 0; m !== p[f].morphTargets.length; ++m) { const w = p[f]; y.push(w.time), v.push(w.morphTarget === u ? 1 : 0); } r.push(new qo2(".morphTargetInfluence[" + u + "]", y, v)); } c = g.length * (o || 1); } else { const g = ".bones[" + t13[h6].name + "]"; i( Ko2, g + ".position", p, "pos", r ), i( Zs2, g + ".quaternion", p, "rot", r ), i( Ko2, g + ".scale", p, "scl", r ); } } return r.length === 0 ? null : new this(s, c, r, a); } resetDuration() { const e = this.tracks; let t13 = 0; for (let i = 0, r = e.length; i !== r; ++i) { const s = this.tracks[i]; t13 = Math.max(t13, s.times[s.times.length - 1]); } return this.duration = t13, this; } trim() { for (let e = 0; e < this.tracks.length; e++) this.tracks[e].trim(0, this.duration); return this; } validate() { let e = true; for (let t13 = 0; t13 < this.tracks.length; t13++) e = e && this.tracks[t13].validate(); return e; } optimize() { for (let e = 0; e < this.tracks.length; e++) this.tracks[e].optimize(); return this; } clone() { const e = []; for (let t13 = 0; t13 < this.tracks.length; t13++) e.push(this.tracks[t13].clone()); return new this.constructor(this.name, this.duration, e, this.blendMode); } toJSON() { return this.constructor.toJSON(this); } }; function dF2(n) { switch (n.toLowerCase()) { case "scalar": case "double": case "float": case "number": case "integer": return qo2; case "vector": case "vector2": case "vector3": case "vector4": return Ko2; case "color": return bp2; case "quaternion": return Zs2; case "bool": case "boolean": return $s2; case "string": return Xs2; } throw new Error("THREE.KeyframeTrack: Unsupported typeName: " + n); } function fF2(n) { if (n.type === void 0) throw new Error("THREE.KeyframeTrack: track type undefined, can not parse"); const e = dF2(n.type); if (n.times === void 0) { const t13 = [], i = []; It2.flattenJSON(n.keys, t13, i, "value"), n.times = t13, n.values = i; } return e.parse !== void 0 ? e.parse(n) : new e(n.name, n.times, n.values, n.interpolation); } var zs2 = { enabled: false, files: {}, add: function(n, e) { this.enabled !== false && (this.files[n] = e); }, get: function(n) { if (this.enabled !== false) return this.files[n]; }, remove: function(n) { delete this.files[n]; }, clear: function() { this.files = {}; } }; var xp2 = class { constructor(e, t13, i) { const r = this; let s = false, o = 0, a = 0, c; const l = []; this.onStart = void 0, this.onLoad = e, this.onProgress = t13, this.onError = i, this.itemStart = function(d) { a++, s === false && r.onStart !== void 0 && r.onStart(d, o, a), s = true; }, this.itemEnd = function(d) { o++, r.onProgress !== void 0 && r.onProgress(d, o, a), o === a && (s = false, r.onLoad !== void 0 && r.onLoad()); }, this.itemError = function(d) { r.onError !== void 0 && r.onError(d); }, this.resolveURL = function(d) { return c ? c(d) : d; }, this.setURLModifier = function(d) { return c = d, this; }, this.addHandler = function(d, h6) { return l.push(d, h6), this; }, this.removeHandler = function(d) { const h6 = l.indexOf(d); return h6 !== -1 && l.splice(h6, 2), this; }, this.getHandler = function(d) { for (let h6 = 0, p = l.length; h6 < p; h6 += 2) { const g = l[h6], f = l[h6 + 1]; if (g.global && (g.lastIndex = 0), g.test(d)) return f; } return null; }; } }; var Xx2 = new xp2(); var _n2 = class { constructor(e) { this.manager = e !== void 0 ? e : Xx2, this.crossOrigin = "anonymous", this.withCredentials = false, this.path = "", this.resourcePath = "", this.requestHeader = {}; } load() { } loadAsync(e, t13) { const i = this; return new Promise(function(r, s) { i.load(e, r, t13, s); }); } 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; } }; var pi2 = {}; var Qn2 = class extends _n2 { constructor(e) { super(e); } load(e, t13, i, r) { e === void 0 && (e = ""), this.path !== void 0 && (e = this.path + e), e = this.manager.resolveURL(e); const s = this, o = zs2.get(e); if (o !== void 0) return s.manager.itemStart(e), setTimeout(function() { t13 && t13(o), s.manager.itemEnd(e); }, 0), o; if (pi2[e] !== void 0) { pi2[e].push({ onLoad: t13, onProgress: i, onError: r }); return; } const a = /^data:(.*?)(;base64)?,(.*)$/, c = e.match(a); let l; if (c) { const d = c[1], h6 = !!c[2]; let p = c[3]; p = decodeURIComponent(p), h6 && (p = atob(p)); try { let g; const f = (this.responseType || "").toLowerCase(); switch (f) { case "arraybuffer": case "blob": const u = new Uint8Array(p.length); for (let v = 0; v < p.length; v++) u[v] = p.charCodeAt(v); f === "blob" ? g = new Blob([u.buffer], { type: d }) : g = u.buffer; break; case "document": g = new DOMParser().parseFromString(p, d); break; case "json": g = JSON.parse(p); break; default: g = p; break; } setTimeout(function() { t13 && t13(g), s.manager.itemEnd(e); }, 0); } catch (g) { setTimeout(function() { r && r(g), s.manager.itemError(e), s.manager.itemEnd(e); }, 0); } } else { pi2[e] = [], pi2[e].push({ onLoad: t13, onProgress: i, onError: r }), l = new XMLHttpRequest(), l.open("GET", e, true), l.addEventListener("load", function(d) { const h6 = this.response, p = pi2[e]; if (delete pi2[e], this.status === 200 || this.status === 0) { this.status === 0 && console.warn("THREE.FileLoader: HTTP Status 0 received."), zs2.add(e, h6); for (let g = 0, f = p.length; g < f; g++) { const u = p[g]; u.onLoad && u.onLoad(h6); } s.manager.itemEnd(e); } else { for (let g = 0, f = p.length; g < f; g++) { const u = p[g]; u.onError && u.onError(d); } s.manager.itemError(e), s.manager.itemEnd(e); } }, false), l.addEventListener("progress", function(d) { const h6 = pi2[e]; for (let p = 0, g = h6.length; p < g; p++) { const f = h6[p]; f.onProgress && f.onProgress(d); } }, false), l.addEventListener("error", function(d) { const h6 = pi2[e]; delete pi2[e]; for (let p = 0, g = h6.length; p < g; p++) { const f = h6[p]; f.onError && f.onError(d); } s.manager.itemError(e), s.manager.itemEnd(e); }, false), l.addEventListener("abort", function(d) { const h6 = pi2[e]; delete pi2[e]; for (let p = 0, g = h6.length; p < g; p++) { const f = h6[p]; f.onError && f.onError(d); } s.manager.itemError(e), s.manager.itemEnd(e); }, false), 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 d in this.requestHeader) l.setRequestHeader(d, this.requestHeader[d]); l.send(null); } return s.manager.itemStart(e), l; } setResponseType(e) { return this.responseType = e, this; } setMimeType(e) { return this.mimeType = e, this; } }; var pF2 = class extends _n2 { constructor(e) { super(e); } load(e, t13, i, r) { const s = this, o = new Qn2(this.manager); o.setPath(this.path), o.setRequestHeader(this.requestHeader), o.setWithCredentials(this.withCredentials), o.load(e, function(a) { try { t13(s.parse(JSON.parse(a))); } catch (c) { r ? r(c) : console.error(c), s.manager.itemError(e); } }, i, r); } parse(e) { const t13 = []; for (let i = 0; i < e.length; i++) { const r = Qo2.parse(e[i]); t13.push(r); } return t13; } }; var mF2 = class extends _n2 { constructor(e) { super(e); } load(e, t13, i, r) { const s = this, o = [], a = new np2(), c = new Qn2(this.manager); c.setPath(this.path), c.setResponseType("arraybuffer"), c.setRequestHeader(this.requestHeader), c.setWithCredentials(s.withCredentials); let l = 0; function d(h6) { c.load(e[h6], function(p) { const g = s.parse(p, true); o[h6] = { width: g.width, height: g.height, format: g.format, mipmaps: g.mipmaps }, l += 1, l === 6 && (g.mipmapCount === 1 && (a.minFilter = jt), a.image = o, a.format = g.format, a.needsUpdate = true, t13 && t13(a)); }, i, r); } if (Array.isArray(e)) for (let h6 = 0, p = e.length; h6 < p; ++h6) d(h6); else c.load(e, function(h6) { const p = s.parse(h6, true); if (p.isCubemap) { const g = p.mipmaps.length / p.mipmapCount; for (let f = 0; f < g; f++) { o[f] = { mipmaps: [] }; for (let u = 0; u < p.mipmapCount; u++) o[f].mipmaps.push(p.mipmaps[f * p.mipmapCount + u]), o[f].format = p.format, o[f].width = p.width, o[f].height = p.height; } a.image = o; } else a.image.width = p.width, a.image.height = p.height, a.mipmaps = p.mipmaps; p.mipmapCount === 1 && (a.minFilter = jt), a.format = p.format, a.needsUpdate = true, t13 && t13(a); }, i, r); return a; } }; var ol2 = class extends _n2 { constructor(e) { super(e); } load(e, t13, i, r) { this.path !== void 0 && (e = this.path + e), e = this.manager.resolveURL(e); const s = this, o = zs2.get(e); if (o !== void 0) return s.manager.itemStart(e), setTimeout(function() { t13 && t13(o), s.manager.itemEnd(e); }, 0), o; const a = document.createElementNS("http://www.w3.org/1999/xhtml", "img"); function c() { a.removeEventListener("load", c, false), a.removeEventListener("error", l, false), zs2.add(e, this), t13 && t13(this), s.manager.itemEnd(e); } function l(d) { a.removeEventListener("load", c, false), a.removeEventListener("error", l, false), r && r(d), s.manager.itemError(e), s.manager.itemEnd(e); } return a.addEventListener("load", c, false), a.addEventListener("error", l, false), e.substr(0, 5) !== "data:" && this.crossOrigin !== void 0 && (a.crossOrigin = this.crossOrigin), s.manager.itemStart(e), a.src = e, a; } }; var Yx2 = class extends _n2 { constructor(e) { super(e); } load(e, t13, i, r) { const s = new ca2(), o = new ol2(this.manager); o.setCrossOrigin(this.crossOrigin), o.setPath(this.path); let a = 0; function c(l) { o.load(e[l], function(d) { s.images[l] = d, a++, a === 6 && (s.needsUpdate = true, t13 && t13(s)); }, void 0, r); } for (let l = 0; l < e.length; ++l) c(l); return s; } }; var Jx2 = class extends _n2 { constructor(e) { super(e); } load(e, t13, i, r) { const s = this, o = new Cs2(), a = new Qn2(this.manager); return a.setResponseType("arraybuffer"), a.setRequestHeader(this.requestHeader), a.setPath(this.path), a.setWithCredentials(s.withCredentials), a.load(e, function(c) { const l = s.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 : mn2, o.wrapT = l.wrapT !== void 0 ? l.wrapT : mn2, o.magFilter = l.magFilter !== void 0 ? l.magFilter : jt, o.minFilter = l.minFilter !== void 0 ? l.minFilter : jt, 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 = br2), l.mipmapCount === 1 && (o.minFilter = jt), l.generateMipmaps !== void 0 && (o.generateMipmaps = l.generateMipmaps), o.needsUpdate = true, t13 && t13(o, l)); }, i, r), o; } }; var wp2 = class extends _n2 { constructor(e) { super(e); } load(e, t13, i, r) { const s = new nn2(), o = new ol2(this.manager); return o.setCrossOrigin(this.crossOrigin), o.setPath(this.path), o.load(e, function(a) { s.image = a; const c = e.search(/\.jpe?g($|\?)/i) > 0 || e.search(/^data\:image\/jpeg/) === 0; s.format = c ? ar2 : Yn2, s.needsUpdate = true, t13 !== void 0 && t13(s); }, i, r), s; } }; var qx2 = class extends Kn2 { constructor() { super(), this.type = "CurvePath", this.curves = [], this.autoClose = false; } add(e) { this.curves.push(e); } closePath() { const e = this.curves[0].getPoint(0), t13 = this.curves[this.curves.length - 1].getPoint(1); e.equals(t13) || this.curves.push(new Pl2(t13, 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 t13 = e * this.getLength(), i = this.getCurveLengths(); let r = 0; for (; r < i.length; ) { if (i[r] >= t13) { const s = i[r] - t13, o = this.curves[r], a = o.getLength(), c = a === 0 ? 0 : 1 - s / a; return o.getPointAt(c); } r++; } 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 = true, 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 t13 = 0; for (let i = 0, r = this.curves.length; i < r; i++) t13 += this.curves[i].getLength(), e.push(t13); return this.cacheLengths = e, e; } getSpacedPoints(e = 40) { const t13 = []; for (let i = 0; i <= e; i++) t13.push(this.getPoint(i / e)); return this.autoClose && t13.push(t13[0]), t13; } getPoints(e = 12) { const t13 = []; let i; for (let r = 0, s = this.curves; r < s.length; r++) { const o = s[r], a = o && o.isEllipseCurve ? e * 2 : o && (o.isLineCurve || o.isLineCurve3) ? 1 : o && o.isSplineCurve ? e * o.points.length : e, c = o.getPoints(a); for (let l = 0; l < c.length; l++) { const d = c[l]; i && i.equals(d) || (t13.push(d), i = d); } } return this.autoClose && t13.length > 1 && !t13[t13.length - 1].equals(t13[0]) && t13.push(t13[0]), t13; } copy(e) { super.copy(e), this.curves = []; for (let t13 = 0, i = e.curves.length; t13 < i; t13++) { const r = e.curves[t13]; this.curves.push(r.clone()); } return this.autoClose = e.autoClose, this; } toJSON() { const e = super.toJSON(); e.autoClose = this.autoClose, e.curves = []; for (let t13 = 0, i = this.curves.length; t13 < i; t13++) { const r = this.curves[t13]; e.curves.push(r.toJSON()); } return e; } fromJSON(e) { super.fromJSON(e), this.autoClose = e.autoClose, this.curves = []; for (let t13 = 0, i = e.curves.length; t13 < i; t13++) { const r = e.curves[t13]; this.curves.push(new cp2[r.type]().fromJSON(r)); } return this; } }; var al2 = class extends qx2 { constructor(e) { super(), this.type = "Path", this.currentPoint = new Pe(), e && this.setFromPoints(e); } setFromPoints(e) { this.moveTo(e[0].x, e[0].y); for (let t13 = 1, i = e.length; t13 < i; t13++) this.lineTo(e[t13].x, e[t13].y); return this; } moveTo(e, t13) { return this.currentPoint.set(e, t13), this; } lineTo(e, t13) { const i = new Pl2(this.currentPoint.clone(), new Pe(e, t13)); return this.curves.push(i), this.currentPoint.set(e, t13), this; } quadraticCurveTo(e, t13, i, r) { const s = new zu2( this.currentPoint.clone(), new Pe(e, t13), new Pe(i, r) ); return this.curves.push(s), this.currentPoint.set(i, r), this; } bezierCurveTo(e, t13, i, r, s, o) { const a = new Bu2( this.currentPoint.clone(), new Pe(e, t13), new Pe(i, r), new Pe(s, o) ); return this.curves.push(a), this.currentPoint.set(s, o), this; } splineThru(e) { const t13 = [this.currentPoint.clone()].concat(e), i = new Uu2(t13); return this.curves.push(i), this.currentPoint.copy(e[e.length - 1]), this; } arc(e, t13, i, r, s, o) { const a = this.currentPoint.x, c = this.currentPoint.y; return this.absarc( e + a, t13 + c, i, r, s, o ), this; } absarc(e, t13, i, r, s, o) { return this.absellipse(e, t13, i, i, r, s, o), this; } ellipse(e, t13, i, r, s, o, a, c) { const l = this.currentPoint.x, d = this.currentPoint.y; return this.absellipse(e + l, t13 + d, i, r, s, o, a, c), this; } absellipse(e, t13, i, r, s, o, a, c) { const l = new Rl2(e, t13, i, r, s, o, a, c); if (this.curves.length > 0) { const h6 = l.getPoint(0); h6.equals(this.currentPoint) || this.lineTo(h6.x, h6.y); } this.curves.push(l); const d = l.getPoint(1); return this.currentPoint.copy(d), 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; } }; var Gr = class extends al2 { constructor(e) { super(e), this.uuid = Jn2(), this.type = "Shape", this.holes = []; } getPointsHoles(e) { const t13 = []; for (let i = 0, r = this.holes.length; i < r; i++) t13[i] = this.holes[i].getPoints(e); return t13; } // 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 t13 = 0, i = e.holes.length; t13 < i; t13++) { const r = e.holes[t13]; this.holes.push(r.clone()); } return this; } toJSON() { const e = super.toJSON(); e.uuid = this.uuid, e.holes = []; for (let t13 = 0, i = this.holes.length; t13 < i; t13++) { const r = this.holes[t13]; e.holes.push(r.toJSON()); } return e; } fromJSON(e) { super.fromJSON(e), this.uuid = e.uuid, this.holes = []; for (let t13 = 0, i = e.holes.length; t13 < i; t13++) { const r = e.holes[t13]; this.holes.push(new al2().fromJSON(r)); } return this; } }; var Mi2 = class extends ot { constructor(e, t13 = 1) { super(), this.type = "Light", this.color = new Fe(e), this.intensity = t13; } dispose() { } copy(e) { return super.copy(e), this.color.copy(e.color), this.intensity = e.intensity, this; } toJSON(e) { const t13 = super.toJSON(e); return t13.object.color = this.color.getHex(), t13.object.intensity = this.intensity, this.groundColor !== void 0 && (t13.object.groundColor = this.groundColor.getHex()), this.distance !== void 0 && (t13.object.distance = this.distance), this.angle !== void 0 && (t13.object.angle = this.angle), this.decay !== void 0 && (t13.object.decay = this.decay), this.penumbra !== void 0 && (t13.object.penumbra = this.penumbra), this.shadow !== void 0 && (t13.object.shadow = this.shadow.toJSON()), t13; } }; Mi2.prototype.isLight = true; var Mp2 = class extends Mi2 { constructor(e, t13, i) { super(e, i), this.type = "HemisphereLight", this.position.copy(ot.DefaultUp), this.updateMatrix(), this.groundColor = new Fe(t13); } copy(e) { return Mi2.prototype.copy.call(this, e), this.groundColor.copy(e.groundColor), this; } }; Mp2.prototype.isHemisphereLight = true; var lv2 = new $e2(); var cv2 = new X(); var uv2 = new X(); var Sp2 = class { constructor(e) { this.camera = e, this.bias = 0, this.normalBias = 0, this.radius = 1, this.mapSize = new Pe(512, 512), this.map = null, this.mapPass = null, this.matrix = new $e2(), this.autoUpdate = true, this.needsUpdate = false, this._frustum = new Ml2(), this._frameExtents = new Pe(1, 1), this._viewportCount = 1, this._viewports = [ new _t2(0, 0, 1, 1) ]; } getViewportCount() { return this._viewportCount; } getFrustum() { return this._frustum; } updateMatrices(e) { const t13 = this.camera, i = this.matrix; cv2.setFromMatrixPosition(e.matrixWorld), t13.position.copy(cv2), uv2.setFromMatrixPosition(e.target.matrixWorld), t13.lookAt(uv2), t13.updateMatrixWorld(), lv2.multiplyMatrices(t13.projectionMatrix, t13.matrixWorldInverse), this._frustum.setFromProjectionMatrix(lv2), 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(t13.projectionMatrix), i.multiply(t13.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(false).object, delete e.camera.matrix, e; } }; var Kx2 = class extends Sp2 { constructor() { super(new an2(50, 1, 0.5, 500)), this.focus = 1; } updateMatrices(e) { const t13 = this.camera, i = nl2 * 2 * e.angle * this.focus, r = this.mapSize.width / this.mapSize.height, s = e.distance || t13.far; (i !== t13.fov || r !== t13.aspect || s !== t13.far) && (t13.fov = i, t13.aspect = r, t13.far = s, t13.updateProjectionMatrix()), super.updateMatrices(e); } copy(e) { return super.copy(e), this.focus = e.focus, this; } }; Kx2.prototype.isSpotLightShadow = true; var ku2 = class extends Mi2 { constructor(e, t13, i = 0, r = Math.PI / 3, s = 0, o = 1) { super(e, t13), this.type = "SpotLight", this.position.copy(ot.DefaultUp), this.updateMatrix(), this.target = new ot(), this.distance = i, this.angle = r, this.penumbra = s, this.decay = o, this.shadow = new Kx2(); } 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; } }; ku2.prototype.isSpotLight = true; var hv2 = new $e2(); var Ca2 = new X(); var Fh2 = new X(); var Qx2 = class extends Sp2 { constructor() { super(new an2(90, 1, 0.5, 500)), this._frameExtents = new Pe(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 _t2(2, 1, 1, 1), // negative X new _t2(0, 1, 1, 1), // positive Z new _t2(3, 1, 1, 1), // negative Z new _t2(1, 1, 1, 1), // positive Y new _t2(3, 0, 1, 1), // negative Y new _t2(1, 0, 1, 1) ], this._cubeDirections = [ new X(1, 0, 0), new X(-1, 0, 0), new X(0, 0, 1), new X(0, 0, -1), new X(0, 1, 0), new X(0, -1, 0) ], this._cubeUps = [ new X(0, 1, 0), new X(0, 1, 0), new X(0, 1, 0), new X(0, 1, 0), new X(0, 0, 1), new X(0, 0, -1) ]; } updateMatrices(e, t13 = 0) { const i = this.camera, r = this.matrix, s = e.distance || i.far; s !== i.far && (i.far = s, i.updateProjectionMatrix()), Ca2.setFromMatrixPosition(e.matrixWorld), i.position.copy(Ca2), Fh2.copy(i.position), Fh2.add(this._cubeDirections[t13]), i.up.copy(this._cubeUps[t13]), i.lookAt(Fh2), i.updateMatrixWorld(), r.makeTranslation(-Ca2.x, -Ca2.y, -Ca2.z), hv2.multiplyMatrices(i.projectionMatrix, i.matrixWorldInverse), this._frustum.setFromProjectionMatrix(hv2); } }; Qx2.prototype.isPointLightShadow = true; var Gu2 = class extends Mi2 { constructor(e, t13, i = 0, r = 1) { super(e, t13), this.type = "PointLight", this.distance = i, this.decay = r, this.shadow = new Qx2(); } 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; } }; Gu2.prototype.isPointLight = true; var fa2 = class extends wl2 { constructor(e = -1, t13 = 1, i = 1, r = -1, s = 0.1, o = 2e3) { super(), this.type = "OrthographicCamera", this.zoom = 1, this.view = null, this.left = e, this.right = t13, this.top = i, this.bottom = r, this.near = s, this.far = o, this.updateProjectionMatrix(); } copy(e, t13) { return super.copy(e, t13), 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, t13, i, r, s, o) { this.view === null && (this.view = { enabled: true, fullWidth: 1, fullHeight: 1, offsetX: 0, offsetY: 0, width: 1, height: 1 }), this.view.enabled = true, this.view.fullWidth = e, this.view.fullHeight = t13, this.view.offsetX = i, this.view.offsetY = r, this.view.width = s, this.view.height = o, this.updateProjectionMatrix(); } clearViewOffset() { this.view !== null && (this.view.enabled = false), this.updateProjectionMatrix(); } updateProjectionMatrix() { const e = (this.right - this.left) / (2 * this.zoom), t13 = (this.top - this.bottom) / (2 * this.zoom), i = (this.right + this.left) / 2, r = (this.top + this.bottom) / 2; let s = i - e, o = i + e, a = r + t13, c = r - t13; if (this.view !== null && this.view.enabled) { const l = (this.right - this.left) / this.view.fullWidth / this.zoom, d = (this.top - this.bottom) / this.view.fullHeight / this.zoom; s += l * this.view.offsetX, o = s + l * this.view.width, a -= d * this.view.offsetY, c = a - d * this.view.height; } this.projectionMatrix.makeOrthographic(s, o, a, c, this.near, this.far), this.projectionMatrixInverse.copy(this.projectionMatrix).invert(); } toJSON(e) { const t13 = super.toJSON(e); return t13.object.zoom = this.zoom, t13.object.left = this.left, t13.object.right = this.right, t13.object.top = this.top, t13.object.bottom = this.bottom, t13.object.near = this.near, t13.object.far = this.far, this.view !== null && (t13.object.view = Object.assign({}, this.view)), t13; } }; fa2.prototype.isOrthographicCamera = true; var ew2 = class extends Sp2 { constructor() { super(new fa2(-5, 5, 5, -5, 0.5, 500)); } }; ew2.prototype.isDirectionalLightShadow = true; var Hu2 = class extends Mi2 { constructor(e, t13) { super(e, t13), this.type = "DirectionalLight", this.position.copy(ot.DefaultUp), this.updateMatrix(), this.target = new ot(), this.shadow = new ew2(); } dispose() { this.shadow.dispose(); } copy(e) { return super.copy(e), this.target = e.target.clone(), this.shadow = e.shadow.clone(), this; } }; Hu2.prototype.isDirectionalLight = true; var _p2 = class extends Mi2 { constructor(e, t13) { super(e, t13), this.type = "AmbientLight"; } }; _p2.prototype.isAmbientLight = true; var Tp2 = class extends Mi2 { constructor(e, t13, i = 10, r = 10) { super(e, t13), this.type = "RectAreaLight", this.width = i, this.height = r; } copy(e) { return super.copy(e), this.width = e.width, this.height = e.height, this; } toJSON(e) { const t13 = super.toJSON(e); return t13.object.width = this.width, t13.object.height = this.height, t13; } }; Tp2.prototype.isRectAreaLight = true; var Ep2 = class { constructor() { this.coefficients = []; for (let e = 0; e < 9; e++) this.coefficients.push(new X()); } set(e) { for (let t13 = 0; t13 < 9; t13++) this.coefficients[t13].copy(e[t13]); 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, t13) { const i = e.x, r = e.y, s = e.z, o = this.coefficients; return t13.copy(o[0]).multiplyScalar(0.282095), t13.addScaledVector(o[1], 0.488603 * r), t13.addScaledVector(o[2], 0.488603 * s), t13.addScaledVector(o[3], 0.488603 * i), t13.addScaledVector(o[4], 1.092548 * (i * r)), t13.addScaledVector(o[5], 1.092548 * (r * s)), t13.addScaledVector(o[6], 0.315392 * (3 * s * s - 1)), t13.addScaledVector(o[7], 1.092548 * (i * s)), t13.addScaledVector(o[8], 0.546274 * (i * i - r * r)), t13; } // 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, t13) { const i = e.x, r = e.y, s = e.z, o = this.coefficients; return t13.copy(o[0]).multiplyScalar(0.886227), t13.addScaledVector(o[1], 2 * 0.511664 * r), t13.addScaledVector(o[2], 2 * 0.511664 * s), t13.addScaledVector(o[3], 2 * 0.511664 * i), t13.addScaledVector(o[4], 2 * 0.429043 * i * r), t13.addScaledVector(o[5], 2 * 0.429043 * r * s), t13.addScaledVector(o[6], 0.743125 * s * s - 0.247708), t13.addScaledVector(o[7], 2 * 0.429043 * i * s), t13.addScaledVector(o[8], 0.429043 * (i * i - r * r)), t13; } add(e) { for (let t13 = 0; t13 < 9; t13++) this.coefficients[t13].add(e.coefficients[t13]); return this; } addScaledSH(e, t13) { for (let i = 0; i < 9; i++) this.coefficients[i].addScaledVector(e.coefficients[i], t13); return this; } scale(e) { for (let t13 = 0; t13 < 9; t13++) this.coefficients[t13].multiplyScalar(e); return this; } lerp(e, t13) { for (let i = 0; i < 9; i++) this.coefficients[i].lerp(e.coefficients[i], t13); return this; } equals(e) { for (let t13 = 0; t13 < 9; t13++) if (!this.coefficients[t13].equals(e.coefficients[t13])) return false; return true; } copy(e) { return this.set(e.coefficients); } clone() { return new this.constructor().copy(this); } fromArray(e, t13 = 0) { const i = this.coefficients; for (let r = 0; r < 9; r++) i[r].fromArray(e, t13 + r * 3); return this; } toArray(e = [], t13 = 0) { const i = this.coefficients; for (let r = 0; r < 9; r++) i[r].toArray(e, t13 + r * 3); return e; } // evaluate the basis functions // shBasis is an Array[ 9 ] static getBasisAt(e, t13) { const i = e.x, r = e.y, s = e.z; t13[0] = 0.282095, t13[1] = 0.488603 * r, t13[2] = 0.488603 * s, t13[3] = 0.488603 * i, t13[4] = 1.092548 * i * r, t13[5] = 1.092548 * r * s, t13[6] = 0.315392 * (3 * s * s - 1), t13[7] = 1.092548 * i * s, t13[8] = 0.546274 * (i * i - r * r); } }; Ep2.prototype.isSphericalHarmonics3 = true; var Ol2 = class extends Mi2 { constructor(e = new Ep2(), t13 = 1) { super(void 0, t13), 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 t13 = super.toJSON(e); return t13.object.sh = this.sh.toArray(), t13; } }; Ol2.prototype.isLightProbe = true; var tw2 = class extends _n2 { constructor(e) { super(e), this.textures = {}; } load(e, t13, i, r) { const s = this, o = new Qn2(s.manager); o.setPath(s.path), o.setRequestHeader(s.requestHeader), o.setWithCredentials(s.withCredentials), o.load(e, function(a) { try { t13(s.parse(JSON.parse(a))); } catch (c) { r ? r(c) : console.error(c), s.manager.itemError(e); } }, i, r); } parse(e) { const t13 = this.textures; function i(s) { return t13[s] === void 0 && console.warn("THREE.MaterialLoader: Undefined texture", s), t13[s]; } const r = new hF2[e.type](); if (e.uuid !== void 0 && (r.uuid = e.uuid), e.name !== void 0 && (r.name = e.name), e.color !== void 0 && r.color !== void 0 && r.color.setHex(e.color), e.roughness !== void 0 && (r.roughness = e.roughness), e.metalness !== void 0 && (r.metalness = e.metalness), e.sheen !== void 0 && (r.sheen = new Fe().setHex(e.sheen)), e.emissive !== void 0 && r.emissive !== void 0 && r.emissive.setHex(e.emissive), e.specular !== void 0 && r.specular !== void 0 && r.specular.setHex(e.specular), e.shininess !== void 0 && (r.shininess = e.shininess), e.clearcoat !== void 0 && (r.clearcoat = e.clearcoat), e.clearcoatRoughness !== void 0 && (r.clearcoatRoughness = e.clearcoatRoughness), e.transmission !== void 0 && (r.transmission = e.transmission), e.thickness !== void 0 && (r.thickness = e.thickness), e.attenuationDistance !== void 0 && (r.attenuationDistance = e.attenuationDistance), e.attenuationColor !== void 0 && r.attenuationColor !== void 0 && r.attenuationColor.setHex(e.attenuationColor), e.fog !== void 0 && (r.fog = e.fog), e.flatShading !== void 0 && (r.flatShading = e.flatShading), e.blending !== void 0 && (r.blending = e.blending), e.combine !== void 0 && (r.combine = e.combine), e.side !== void 0 && (r.side = e.side), e.shadowSide !== void 0 && (r.shadowSide = e.shadowSide), e.opacity !== void 0 && (r.opacity = e.opacity), e.transparent !== void 0 && (r.transparent = e.transparent), e.alphaTest !== void 0 && (r.alphaTest = e.alphaTest), e.depthTest !== void 0 && (r.depthTest = e.depthTest), e.depthWrite !== void 0 && (r.depthWrite = e.depthWrite), e.colorWrite !== void 0 && (r.colorWrite = e.colorWrite), e.stencilWrite !== void 0 && (r.stencilWrite = e.stencilWrite), e.stencilWriteMask !== void 0 && (r.stencilWriteMask = e.stencilWriteMask), e.stencilFunc !== void 0 && (r.stencilFunc = e.stencilFunc), e.stencilRef !== void 0 && (r.stencilRef = e.stencilRef), e.stencilFuncMask !== void 0 && (r.stencilFuncMask = e.stencilFuncMask), e.stencilFail !== void 0 && (r.stencilFail = e.stencilFail), e.stencilZFail !== void 0 && (r.stencilZFail = e.stencilZFail), e.stencilZPass !== void 0 && (r.stencilZPass = e.stencilZPass), e.wireframe !== void 0 && (r.wireframe = e.wireframe), e.wireframeLinewidth !== void 0 && (r.wireframeLinewidth = e.wireframeLinewidth), e.wireframeLinecap !== void 0 && (r.wireframeLinecap = e.wireframeLinecap), e.wireframeLinejoin !== void 0 && (r.wireframeLinejoin = e.wireframeLinejoin), e.rotation !== void 0 && (r.rotation = e.rotation), e.linewidth !== 1 && (r.linewidth = e.linewidth), e.dashSize !== void 0 && (r.dashSize = e.dashSize), e.gapSize !== void 0 && (r.gapSize = e.gapSize), e.scale !== void 0 && (r.scale = e.scale), e.polygonOffset !== void 0 && (r.polygonOffset = e.polygonOffset), e.polygonOffsetFactor !== void 0 && (r.polygonOffsetFactor = e.polygonOffsetFactor), e.polygonOffsetUnits !== void 0 && (r.polygonOffsetUnits = e.polygonOffsetUnits), e.morphTargets !== void 0 && (r.morphTargets = e.morphTargets), e.morphNormals !== void 0 && (r.morphNormals = e.morphNormals), e.dithering !== void 0 && (r.dithering = e.dithering), e.alphaToCoverage !== void 0 && (r.alphaToCoverage = e.alphaToCoverage), e.premultipliedAlpha !== void 0 && (r.premultipliedAlpha = e.premultipliedAlpha), e.vertexTangents !== void 0 && (r.vertexTangents = e.vertexTangents), e.visible !== void 0 && (r.visible = e.visible), e.toneMapped !== void 0 && (r.toneMapped = e.toneMapped), e.userData !== void 0 && (r.userData = e.userData), e.vertexColors !== void 0 && (typeof e.vertexColors == "number" ? r.vertexColors = e.vertexColors > 0 : r.vertexColors = e.vertexColors), e.uniforms !== void 0) for (const s in e.uniforms) { const o = e.uniforms[s]; switch (r.uniforms[s] = {}, o.type) { case "t": r.uniforms[s].value = i(o.value); break; case "c": r.uniforms[s].value = new Fe().setHex(o.value); break; case "v2": r.uniforms[s].value = new Pe().fromArray(o.value); break; case "v3": r.uniforms[s].value = new X().fromArray(o.value); break; case "v4": r.uniforms[s].value = new _t2().fromArray(o.value); break; case "m3": r.uniforms[s].value = new ln2().fromArray(o.value); break; case "m4": r.uniforms[s].value = new $e2().fromArray(o.value); break; default: r.uniforms[s].value = o.value; } } if (e.defines !== void 0 && (r.defines = e.defines), e.vertexShader !== void 0 && (r.vertexShader = e.vertexShader), e.fragmentShader !== void 0 && (r.fragmentShader = e.fragmentShader), e.extensions !== void 0) for (const s in e.extensions) r.extensions[s] = e.extensions[s]; if (e.shading !== void 0 && (r.flatShading = e.shading === 1), e.size !== void 0 && (r.size = e.size), e.sizeAttenuation !== void 0 && (r.sizeAttenuation = e.sizeAttenuation), e.map !== void 0 && (r.map = i(e.map)), e.matcap !== void 0 && (r.matcap = i(e.matcap)), e.alphaMap !== void 0 && (r.alphaMap = i(e.alphaMap)), e.bumpMap !== void 0 && (r.bumpMap = i(e.bumpMap)), e.bumpScale !== void 0 && (r.bumpScale = e.bumpScale), e.normalMap !== void 0 && (r.normalMap = i(e.normalMap)), e.normalMapType !== void 0 && (r.normalMapType = e.normalMapType), e.normalScale !== void 0) { let s = e.normalScale; Array.isArray(s) === false && (s = [s, s]), r.normalScale = new Pe().fromArray(s); } return e.displacementMap !== void 0 && (r.displacementMap = i(e.displacementMap)), e.displacementScale !== void 0 && (r.displacementScale = e.displacementScale), e.displacementBias !== void 0 && (r.displacementBias = e.displacementBias), e.roughnessMap !== void 0 && (r.roughnessMap = i(e.roughnessMap)), e.metalnessMap !== void 0 && (r.metalnessMap = i(e.metalnessMap)), e.emissiveMap !== void 0 && (r.emissiveMap = i(e.emissiveMap)), e.emissiveIntensity !== void 0 && (r.emissiveIntensity = e.emissiveIntensity), e.specularMap !== void 0 && (r.specularMap = i(e.specularMap)), e.envMap !== void 0 && (r.envMap = i(e.envMap)), e.envMapIntensity !== void 0 && (r.envMapIntensity = e.envMapIntensity), e.reflectivity !== void 0 && (r.reflectivity = e.reflectivity), e.refractionRatio !== void 0 && (r.refractionRatio = e.refractionRatio), e.lightMap !== void 0 && (r.lightMap = i(e.lightMap)), e.lightMapIntensity !== void 0 && (r.lightMapIntensity = e.lightMapIntensity), e.aoMap !== void 0 && (r.aoMap = i(e.aoMap)), e.aoMapIntensity !== void 0 && (r.aoMapIntensity = e.aoMapIntensity), e.gradientMap !== void 0 && (r.gradientMap = i(e.gradientMap)), e.clearcoatMap !== void 0 && (r.clearcoatMap = i(e.clearcoatMap)), e.clearcoatRoughnessMap !== void 0 && (r.clearcoatRoughnessMap = i(e.clearcoatRoughnessMap)), e.clearcoatNormalMap !== void 0 && (r.clearcoatNormalMap = i(e.clearcoatNormalMap)), e.clearcoatNormalScale !== void 0 && (r.clearcoatNormalScale = new Pe().fromArray(e.clearcoatNormalScale)), e.transmissionMap !== void 0 && (r.transmissionMap = i(e.transmissionMap)), e.thicknessMap !== void 0 && (r.thicknessMap = i(e.thicknessMap)), r; } setTextures(e) { return this.textures = e, this; } }; var lr2 = class { static decodeText(e) { if (typeof TextDecoder < "u") return new TextDecoder().decode(e); let t13 = ""; for (let i = 0, r = e.length; i < r; i++) t13 += String.fromCharCode(e[i]); try { return decodeURIComponent(escape(t13)); } catch { return t13; } } static extractUrlBase(e) { const t13 = e.lastIndexOf("/"); return t13 === -1 ? "./" : e.substr(0, t13 + 1); } }; var Ap2 = class extends Je2 { 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 = true, e; } }; Ap2.prototype.isInstancedBufferGeometry = true; var Cp2 = class extends nt { constructor(e, t13, i, r = 1) { typeof i == "number" && (r = i, i = false, console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")), super(e, t13, i), this.meshPerAttribute = r; } copy(e) { return super.copy(e), this.meshPerAttribute = e.meshPerAttribute, this; } toJSON() { const e = super.toJSON(); return e.meshPerAttribute = this.meshPerAttribute, e.isInstancedBufferAttribute = true, e; } }; Cp2.prototype.isInstancedBufferAttribute = true; var nw2 = class extends _n2 { constructor(e) { super(e); } load(e, t13, i, r) { const s = this, o = new Qn2(s.manager); o.setPath(s.path), o.setRequestHeader(s.requestHeader), o.setWithCredentials(s.withCredentials), o.load(e, function(a) { try { t13(s.parse(JSON.parse(a))); } catch (c) { r ? r(c) : console.error(c), s.manager.itemError(e); } }, i, r); } parse(e) { const t13 = {}, i = {}; function r(g, f) { if (t13[f] !== void 0) return t13[f]; const y = g.interleavedBuffers[f], v = s(g, y.buffer), m = Mo2(y.type, v), w = new rs2(m, y.stride); return w.uuid = y.uuid, t13[f] = w, w; } function s(g, f) { if (i[f] !== void 0) return i[f]; const y = g.arrayBuffers[f], v = new Uint32Array(y).buffer; return i[f] = v, v; } const o = e.isInstancedBufferGeometry ? new Ap2() : new Je2(), a = e.data.index; if (a !== void 0) { const g = Mo2(a.type, a.array); o.setIndex(new nt(g, 1)); } const c = e.data.attributes; for (const g in c) { const f = c[g]; let u; if (f.isInterleavedBufferAttribute) { const y = r(e.data, f.data); u = new fr2(y, f.itemSize, f.offset, f.normalized); } else { const y = Mo2(f.type, f.array), v = f.isInstancedBufferAttribute ? Cp2 : nt; u = new v(y, f.itemSize, f.normalized); } f.name !== void 0 && (u.name = f.name), f.usage !== void 0 && u.setUsage(f.usage), f.updateRange !== void 0 && (u.updateRange.offset = f.updateRange.offset, u.updateRange.count = f.updateRange.count), o.setAttribute(g, u); } const l = e.data.morphAttributes; if (l) for (const g in l) { const f = l[g], u = []; for (let y = 0, v = f.length; y < v; y++) { const m = f[y]; let w; if (m.isInterleavedBufferAttribute) { const S = r(e.data, m.data); w = new fr2(S, m.itemSize, m.offset, m.normalized); } else { const S = Mo2(m.type, m.array); w = new nt(S, m.itemSize, m.normalized); } m.name !== void 0 && (w.name = m.name), u.push(w); } o.morphAttributes[g] = u; } e.data.morphTargetsRelative && (o.morphTargetsRelative = true); const h6 = e.data.groups || e.data.drawcalls || e.data.offsets; if (h6 !== void 0) for (let g = 0, f = h6.length; g !== f; ++g) { const u = h6[g]; o.addGroup(u.start, u.count, u.materialIndex); } const p = e.data.boundingSphere; if (p !== void 0) { const g = new X(); p.center !== void 0 && g.fromArray(p.center), o.boundingSphere = new xr(g, p.radius); } return e.name && (o.name = e.name), e.userData && (o.userData = e.userData), o; } }; var gF2 = class extends _n2 { constructor(e) { super(e); } load(e, t13, i, r) { const s = this, o = this.path === "" ? lr2.extractUrlBase(e) : this.path; this.resourcePath = this.resourcePath || o; const a = new Qn2(this.manager); a.setPath(this.path), a.setRequestHeader(this.requestHeader), a.setWithCredentials(this.withCredentials), a.load(e, function(c) { let l = null; try { l = JSON.parse(c); } catch (h6) { r !== void 0 && r(h6), console.error("THREE:ObjectLoader: Can't parse " + e + ".", h6.message); return; } const d = l.metadata; if (d === void 0 || d.type === void 0 || d.type.toLowerCase() === "geometry") { console.error("THREE.ObjectLoader: Can't load " + e); return; } s.parse(l, t13); }, i, r); } async loadAsync(e, t13) { const i = this, r = this.path === "" ? lr2.extractUrlBase(e) : this.path; this.resourcePath = this.resourcePath || r; const s = new Qn2(this.manager); s.setPath(this.path), s.setRequestHeader(this.requestHeader), s.setWithCredentials(this.withCredentials); const o = await s.loadAsync(e, t13), a = JSON.parse(o), c = a.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(a); } parse(e, t13) { const i = this.parseAnimations(e.animations), r = this.parseShapes(e.shapes), s = this.parseGeometries(e.geometries, r), o = this.parseImages(e.images, function() { t13 !== void 0 && t13(l); }), a = this.parseTextures(e.textures, o), c = this.parseMaterials(e.materials, a), l = this.parseObject(e.object, s, c, a, i), d = this.parseSkeletons(e.skeletons, l); if (this.bindSkeletons(l, d), t13 !== void 0) { let h6 = false; for (const p in o) if (o[p] instanceof HTMLImageElement) { h6 = true; break; } h6 === false && t13(l); } return l; } async parseAsync(e) { const t13 = this.parseAnimations(e.animations), i = this.parseShapes(e.shapes), r = this.parseGeometries(e.geometries, i), s = await this.parseImagesAsync(e.images), o = this.parseTextures(e.textures, s), a = this.parseMaterials(e.materials, o), c = this.parseObject(e.object, r, a, o, t13), l = this.parseSkeletons(e.skeletons, c); return this.bindSkeletons(c, l), c; } parseShapes(e) { const t13 = {}; if (e !== void 0) for (let i = 0, r = e.length; i < r; i++) { const s = new Gr().fromJSON(e[i]); t13[s.uuid] = s; } return t13; } parseSkeletons(e, t13) { const i = {}, r = {}; if (t13.traverse(function(s) { s.isBone && (r[s.uuid] = s); }), e !== void 0) for (let s = 0, o = e.length; s < o; s++) { const a = new Ll2().fromJSON(e[s], r); i[a.uuid] = a; } return i; } parseGeometries(e, t13) { const i = {}; if (e !== void 0) { const r = new nw2(); for (let s = 0, o = e.length; s < o; s++) { let a; const c = e[s]; switch (c.type) { case "BufferGeometry": case "InstancedBufferGeometry": a = r.parse(c); break; case "Geometry": console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported."); break; default: c.type in av2 ? a = av2[c.type].fromJSON(c, t13) : console.warn(`THREE.ObjectLoader: Unsupported geometry type "${c.type}"`); } a.uuid = c.uuid, c.name !== void 0 && (a.name = c.name), a.isBufferGeometry === true && c.userData !== void 0 && (a.userData = c.userData), i[c.uuid] = a; } } return i; } parseMaterials(e, t13) { const i = {}, r = {}; if (e !== void 0) { const s = new tw2(); s.setTextures(t13); for (let o = 0, a = e.length; o < a; o++) { const c = e[o]; if (c.type === "MultiMaterial") { const l = []; for (let d = 0; d < c.materials.length; d++) { const h6 = c.materials[d]; i[h6.uuid] === void 0 && (i[h6.uuid] = s.parse(h6)), l.push(i[h6.uuid]); } r[c.uuid] = l; } else i[c.uuid] === void 0 && (i[c.uuid] = s.parse(c)), r[c.uuid] = i[c.uuid]; } } return r; } parseAnimations(e) { const t13 = {}; if (e !== void 0) for (let i = 0; i < e.length; i++) { const r = e[i], s = Qo2.parse(r); t13[s.uuid] = s; } return t13; } parseImages(e, t13) { const i = this, r = {}; let s; function o(c) { return i.manager.itemStart(c), s.load(c, function() { i.manager.itemEnd(c); }, void 0, function() { i.manager.itemError(c), i.manager.itemEnd(c); }); } function a(c) { if (typeof c == "string") { const l = c, d = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(l) ? l : i.resourcePath + l; return o(d); } else return c.data ? { data: Mo2(c.type, c.data), width: c.width, height: c.height } : null; } if (e !== void 0 && e.length > 0) { const c = new xp2(t13); s = new ol2(c), s.setCrossOrigin(this.crossOrigin); for (let l = 0, d = e.length; l < d; l++) { const h6 = e[l], p = h6.url; if (Array.isArray(p)) { r[h6.uuid] = []; for (let g = 0, f = p.length; g < f; g++) { const u = p[g], y = a(u); y !== null && (y instanceof HTMLImageElement ? r[h6.uuid].push(y) : r[h6.uuid].push(new Cs2(y.data, y.width, y.height))); } } else { const g = a(h6.url); g !== null && (r[h6.uuid] = g); } } } return r; } async parseImagesAsync(e) { const t13 = this, i = {}; let r; async function s(o) { if (typeof o == "string") { const a = o, c = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(a) ? a : t13.resourcePath + a; return await r.loadAsync(c); } else return o.data ? { data: Mo2(o.type, o.data), width: o.width, height: o.height } : null; } if (e !== void 0 && e.length > 0) { r = new ol2(this.manager), r.setCrossOrigin(this.crossOrigin); for (let o = 0, a = e.length; o < a; o++) { const c = e[o], l = c.url; if (Array.isArray(l)) { i[c.uuid] = []; for (let d = 0, h6 = l.length; d < h6; d++) { const p = l[d], g = await s(p); g !== null && (g instanceof HTMLImageElement ? i[c.uuid].push(g) : i[c.uuid].push(new Cs2(g.data, g.width, g.height))); } } else { const d = await s(c.url); d !== null && (i[c.uuid] = d); } } } return i; } parseTextures(e, t13) { function i(s, o) { return typeof s == "number" ? s : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", s), o[s]); } const r = {}; if (e !== void 0) for (let s = 0, o = e.length; s < o; s++) { const a = e[s]; a.image === void 0 && console.warn('THREE.ObjectLoader: No "image" specified for', a.uuid), t13[a.image] === void 0 && console.warn("THREE.ObjectLoader: Undefined image", a.image); let c; const l = t13[a.image]; Array.isArray(l) ? (c = new ca2(l), l.length === 6 && (c.needsUpdate = true)) : (l && l.data ? c = new Cs2(l.data, l.width, l.height) : c = new nn2(l), l && (c.needsUpdate = true)), c.uuid = a.uuid, a.name !== void 0 && (c.name = a.name), a.mapping !== void 0 && (c.mapping = i(a.mapping, vF2)), a.offset !== void 0 && c.offset.fromArray(a.offset), a.repeat !== void 0 && c.repeat.fromArray(a.repeat), a.center !== void 0 && c.center.fromArray(a.center), a.rotation !== void 0 && (c.rotation = a.rotation), a.wrap !== void 0 && (c.wrapS = i(a.wrap[0], dv2), c.wrapT = i(a.wrap[1], dv2)), a.format !== void 0 && (c.format = a.format), a.type !== void 0 && (c.type = a.type), a.encoding !== void 0 && (c.encoding = a.encoding), a.minFilter !== void 0 && (c.minFilter = i(a.minFilter, fv2)), a.magFilter !== void 0 && (c.magFilter = i(a.magFilter, fv2)), a.anisotropy !== void 0 && (c.anisotropy = a.anisotropy), a.flipY !== void 0 && (c.flipY = a.flipY), a.premultiplyAlpha !== void 0 && (c.premultiplyAlpha = a.premultiplyAlpha), a.unpackAlignment !== void 0 && (c.unpackAlignment = a.unpackAlignment), r[a.uuid] = c; } return r; } parseObject(e, t13, i, r, s) { let o; function a(p) { return t13[p] === void 0 && console.warn("THREE.ObjectLoader: Undefined geometry", p), t13[p]; } function c(p) { if (p !== void 0) { if (Array.isArray(p)) { const g = []; for (let f = 0, u = p.length; f < u; f++) { const y = p[f]; i[y] === void 0 && console.warn("THREE.ObjectLoader: Undefined material", y), g.push(i[y]); } return g; } return i[p] === void 0 && console.warn("THREE.ObjectLoader: Undefined material", p), i[p]; } } function l(p) { return r[p] === void 0 && console.warn("THREE.ObjectLoader: Undefined texture", p), r[p]; } let d, h6; switch (e.type) { case "Scene": o = new Nu2(), e.background !== void 0 && (Number.isInteger(e.background) ? o.background = new Fe(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 _l2(e.fog.color, e.fog.near, e.fog.far) : e.fog.type === "FogExp2" && (o.fog = new Sl2(e.fog.color, e.fog.density))); break; case "PerspectiveCamera": o = new an2(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 fa2(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 _p2(e.color, e.intensity); break; case "DirectionalLight": o = new Hu2(e.color, e.intensity); break; case "PointLight": o = new Gu2(e.color, e.intensity, e.distance, e.decay); break; case "RectAreaLight": o = new Tp2(e.color, e.intensity, e.width, e.height); break; case "SpotLight": o = new ku2(e.color, e.intensity, e.distance, e.angle, e.penumbra, e.decay); break; case "HemisphereLight": o = new Mp2(e.color, e.groundColor, e.intensity); break; case "LightProbe": o = new Ol2().fromJSON(e); break; case "SkinnedMesh": d = a(e.geometry), h6 = c(e.material), o = new Al2(d, h6), 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": d = a(e.geometry), h6 = c(e.material), o = new tn2(d, h6); break; case "InstancedMesh": d = a(e.geometry), h6 = c(e.material); const p = e.count, g = e.instanceMatrix, f = e.instanceColor; o = new tp2(d, h6, p), o.instanceMatrix = new nt(new Float32Array(g.array), 16), f !== void 0 && (o.instanceColor = new nt(new Float32Array(f.array), f.itemSize)); break; case "LOD": o = new Bx2(); break; case "Line": o = new Ui2(a(e.geometry), c(e.material)); break; case "LineLoop": o = new Fu2(a(e.geometry), c(e.material)); break; case "LineSegments": o = new Fn2(a(e.geometry), c(e.material)); break; case "PointCloud": case "Points": o = new ha2(a(e.geometry), c(e.material)); break; case "Sprite": o = new El2(c(e.material)); break; case "Group": o = new Pi2(); break; case "Bone": o = new Cl2(); break; default: o = new ot(); } 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 p = e.children; for (let g = 0; g < p.length; g++) o.add(this.parseObject(p[g], t13, i, r, s)); } if (e.animations !== void 0) { const p = e.animations; for (let g = 0; g < p.length; g++) { const f = p[g]; o.animations.push(s[f]); } } if (e.type === "LOD") { e.autoUpdate !== void 0 && (o.autoUpdate = e.autoUpdate); const p = e.levels; for (let g = 0; g < p.length; g++) { const f = p[g], u = o.getObjectByProperty("uuid", f.object); u !== void 0 && o.addLevel(u, f.distance); } } return o; } bindSkeletons(e, t13) { Object.keys(t13).length !== 0 && e.traverse(function(i) { if (i.isSkinnedMesh === true && i.skeleton !== void 0) { const r = t13[i.skeleton]; r === void 0 ? console.warn("THREE.ObjectLoader: No skeleton found with UUID:", i.skeleton) : i.bind(r, i.bindMatrix); } }); } /* DEPRECATED */ setTexturePath(e) { return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."), this.setResourcePath(e); } }; var vF2 = { UVMapping: _u2, CubeReflectionMapping: yl, CubeRefractionMapping: bl2, EquirectangularReflectionMapping: Qc2, EquirectangularRefractionMapping: eu2, CubeUVReflectionMapping: la2, CubeUVRefractionMapping: xl2 }; var dv2 = { RepeatWrapping: Jr, ClampToEdgeWrapping: mn2, MirroredRepeatWrapping: No2 }; var fv2 = { NearestFilter: Kt2, NearestMipmapNearestFilter: Ka2, NearestMipmapLinearFilter: Qa2, LinearFilter: jt, LinearMipmapNearestFilter: Tu2, LinearMipmapLinearFilter: br2 }; var Lp2 = class extends _n2 { 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, t13, i, r) { e === void 0 && (e = ""), this.path !== void 0 && (e = this.path + e), e = this.manager.resolveURL(e); const s = this, o = zs2.get(e); if (o !== void 0) return s.manager.itemStart(e), setTimeout(function() { t13 && t13(o), s.manager.itemEnd(e); }, 0), o; const a = {}; a.credentials = this.crossOrigin === "anonymous" ? "same-origin" : "include", a.headers = this.requestHeader, fetch(e, a).then(function(c) { return c.blob(); }).then(function(c) { return createImageBitmap(c, Object.assign(s.options, { colorSpaceConversion: "none" })); }).then(function(c) { zs2.add(e, c), t13 && t13(c), s.manager.itemEnd(e); }).catch(function(c) { r && r(c), s.manager.itemError(e), s.manager.itemEnd(e); }), s.manager.itemStart(e); } }; Lp2.prototype.isImageBitmapLoader = true; var iw2 = class { constructor() { this.type = "ShapePath", this.color = new Fe(), this.subPaths = [], this.currentPath = null; } moveTo(e, t13) { return this.currentPath = new al2(), this.subPaths.push(this.currentPath), this.currentPath.moveTo(e, t13), this; } lineTo(e, t13) { return this.currentPath.lineTo(e, t13), this; } quadraticCurveTo(e, t13, i, r) { return this.currentPath.quadraticCurveTo(e, t13, i, r), this; } bezierCurveTo(e, t13, i, r, s, o) { return this.currentPath.bezierCurveTo(e, t13, i, r, s, o), this; } splineThru(e) { return this.currentPath.splineThru(e), this; } toShapes(e, t13) { function i(m) { const w = []; for (let S = 0, T = m.length; S < T; S++) { const M = m[S], x = new Gr(); x.curves = M.curves, w.push(x); } return w; } function r(m, w) { const S = w.length; let T = false; for (let M = S - 1, x = 0; x < S; M = x++) { let _ = w[M], E = w[x], L = E.x - _.x, R = E.y - _.y; if (Math.abs(R) > Number.EPSILON) { if (R < 0 && (_ = w[x], L = -L, E = w[M], R = -R), m.y < _.y || m.y > E.y) continue; if (m.y === _.y) { if (m.x === _.x) return true; } else { const C = R * (m.x - _.x) - L * (m.y - _.y); if (C === 0) return true; if (C < 0) continue; T = !T; } } else { if (m.y !== _.y) continue; if (E.x <= m.x && m.x <= _.x || _.x <= m.x && m.x <= E.x) return true; } } return T; } const s = Fi2.isClockWise, o = this.subPaths; if (o.length === 0) return []; if (t13 === true) return i(o); let a, c, l; const d = []; if (o.length === 1) return c = o[0], l = new Gr(), l.curves = c.curves, d.push(l), d; let h6 = !s(o[0].getPoints()); h6 = e ? !h6 : h6; const p = [], g = []; let f = [], u = 0, y; g[u] = void 0, f[u] = []; for (let m = 0, w = o.length; m < w; m++) c = o[m], y = c.getPoints(), a = s(y), a = e ? !a : a, a ? (!h6 && g[u] && u++, g[u] = { s: new Gr(), p: y }, g[u].s.curves = c.curves, h6 && u++, f[u] = []) : f[u].push({ h: c, p: y[0] }); if (!g[0]) return i(o); if (g.length > 1) { let m = false; const w = []; for (let S = 0, T = g.length; S < T; S++) p[S] = []; for (let S = 0, T = g.length; S < T; S++) { const M = f[S]; for (let x = 0; x < M.length; x++) { const _ = M[x]; let E = true; for (let L = 0; L < g.length; L++) r(_.p, g[L].p) && (S !== L && w.push({ froms: S, tos: L, hole: x }), E ? (E = false, p[L].push(_)) : m = true); E && p[S].push(_); } } w.length > 0 && (m || (f = p)); } let v; for (let m = 0, w = g.length; m < w; m++) { l = g[m].s, d.push(l), v = f[m]; for (let S = 0, T = v.length; S < T; S++) l.holes.push(v[S].h); } return d; } }; var Rp2 = class { constructor(e) { this.type = "Font", this.data = e; } generateShapes(e, t13 = 100) { const i = [], r = yF2(e, t13, this.data); for (let s = 0, o = r.length; s < o; s++) Array.prototype.push.apply(i, r[s].toShapes()); return i; } }; function yF2(n, e, t13) { const i = Array.from(n), r = e / t13.resolution, s = (t13.boundingBox.yMax - t13.boundingBox.yMin + t13.underlineThickness) * r, o = []; let a = 0, c = 0; for (let l = 0; l < i.length; l++) { const d = i[l]; if (d === ` `) a = 0, c -= s; else { const h6 = bF2(d, r, a, c, t13); a += h6.offsetX, o.push(h6.path); } } return o; } function bF2(n, e, t13, i, r) { const s = r.glyphs[n] || r.glyphs["?"]; if (!s) { console.error('THREE.Font: character "' + n + '" does not exists in font family ' + r.familyName + "."); return; } const o = new iw2(); let a, c, l, d, h6, p, g, f; if (s.o) { const u = s._cachedOutline || (s._cachedOutline = s.o.split(" ")); for (let y = 0, v = u.length; y < v; ) switch (u[y++]) { case "m": a = u[y++] * e + t13, c = u[y++] * e + i, o.moveTo(a, c); break; case "l": a = u[y++] * e + t13, c = u[y++] * e + i, o.lineTo(a, c); break; case "q": l = u[y++] * e + t13, d = u[y++] * e + i, h6 = u[y++] * e + t13, p = u[y++] * e + i, o.quadraticCurveTo(h6, p, l, d); break; case "b": l = u[y++] * e + t13, d = u[y++] * e + i, h6 = u[y++] * e + t13, p = u[y++] * e + i, g = u[y++] * e + t13, f = u[y++] * e + i, o.bezierCurveTo(h6, p, g, f, l, d); break; } } return { offsetX: s.ha * e, path: o }; } Rp2.prototype.isFont = true; var xF2 = class extends _n2 { constructor(e) { super(e); } load(e, t13, i, r) { const s = this, o = new Qn2(this.manager); o.setPath(this.path), o.setRequestHeader(this.requestHeader), o.setWithCredentials(s.withCredentials), o.load(e, function(a) { let c; try { c = JSON.parse(a); } catch { console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."), c = JSON.parse(a.substring(65, a.length - 2)); } const l = s.parse(c); t13 && t13(l); }, i, r); } parse(e) { return new Rp2(e); } }; var wc2; var Pp2 = { getContext: function() { return wc2 === void 0 && (wc2 = new (window.AudioContext || window.webkitAudioContext)()), wc2; }, setContext: function(n) { wc2 = n; } }; var rw2 = class extends _n2 { constructor(e) { super(e); } load(e, t13, i, r) { const s = this, o = new Qn2(this.manager); o.setResponseType("arraybuffer"), o.setPath(this.path), o.setRequestHeader(this.requestHeader), o.setWithCredentials(this.withCredentials), o.load(e, function(a) { try { const c = a.slice(0); Pp2.getContext().decodeAudioData(c, function(d) { t13(d); }); } catch (c) { r ? r(c) : console.error(c), s.manager.itemError(e); } }, i, r); } }; var sw2 = class extends Ol2 { constructor(e, t13, i = 1) { super(void 0, i); const r = new Fe().set(e), s = new Fe().set(t13), o = new X(r.r, r.g, r.b), a = new X(s.r, s.g, s.b), c = Math.sqrt(Math.PI), l = c * Math.sqrt(0.75); this.sh.coefficients[0].copy(o).add(a).multiplyScalar(c), this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(l); } }; sw2.prototype.isHemisphereLightProbe = true; var ow2 = class extends Ol2 { constructor(e, t13 = 1) { super(void 0, t13); const i = new Fe().set(e); this.sh.coefficients[0].set(i.r, i.g, i.b).multiplyScalar(2 * Math.sqrt(Math.PI)); } }; ow2.prototype.isAmbientLightProbe = true; var pv2 = new $e2(); var mv = new $e2(); var wF2 = class { constructor() { this.type = "StereoCamera", this.aspect = 1, this.eyeSep = 0.064, this.cameraL = new an2(), this.cameraL.layers.enable(1), this.cameraL.matrixAutoUpdate = false, this.cameraR = new an2(), this.cameraR.layers.enable(2), this.cameraR.matrixAutoUpdate = false, this._cache = { focus: null, fov: null, aspect: null, near: null, far: null, zoom: null, eyeSep: null }; } update(e) { const t13 = this._cache; if (t13.focus !== e.focus || t13.fov !== e.fov || t13.aspect !== e.aspect * this.aspect || t13.near !== e.near || t13.far !== e.far || t13.zoom !== e.zoom || t13.eyeSep !== this.eyeSep) { t13.focus = e.focus, t13.fov = e.fov, t13.aspect = e.aspect * this.aspect, t13.near = e.near, t13.far = e.far, t13.zoom = e.zoom, t13.eyeSep = this.eyeSep; const r = e.projectionMatrix.clone(), s = t13.eyeSep / 2, o = s * t13.near / t13.focus, a = t13.near * Math.tan(As2 * t13.fov * 0.5) / t13.zoom; let c, l; mv.elements[12] = -s, pv2.elements[12] = s, c = -a * t13.aspect + o, l = a * t13.aspect + o, r.elements[0] = 2 * t13.near / (l - c), r.elements[8] = (l + c) / (l - c), this.cameraL.projectionMatrix.copy(r), c = -a * t13.aspect - o, l = a * t13.aspect - o, r.elements[0] = 2 * t13.near / (l - c), r.elements[8] = (l + c) / (l - c), this.cameraR.projectionMatrix.copy(r); } this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(mv), this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(pv2); } }; var aw2 = class { constructor(e = true) { this.autoStart = e, this.startTime = 0, this.oldTime = 0, this.elapsedTime = 0, this.running = false; } start() { this.startTime = gv(), this.oldTime = this.startTime, this.elapsedTime = 0, this.running = true; } stop() { this.getElapsedTime(), this.running = false, this.autoStart = false; } getElapsedTime() { return this.getDelta(), this.elapsedTime; } getDelta() { let e = 0; if (this.autoStart && !this.running) return this.start(), 0; if (this.running) { const t13 = gv(); e = (t13 - this.oldTime) / 1e3, this.oldTime = t13, this.elapsedTime += e; } return e; } }; function gv() { return (typeof performance > "u" ? Date : performance).now(); } var hs2 = new X(); var vv2 = new Sn(); var MF2 = new X(); var ds2 = new X(); var SF2 = class extends ot { constructor() { super(), this.type = "AudioListener", this.context = Pp2.getContext(), this.gain = this.context.createGain(), this.gain.connect(this.context.destination), this.filter = null, this.timeDelta = 0, this._clock = new aw2(); } 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 t13 = this.context.listener, i = this.up; if (this.timeDelta = this._clock.getDelta(), this.matrixWorld.decompose(hs2, vv2, MF2), ds2.set(0, 0, -1).applyQuaternion(vv2), t13.positionX) { const r = this.context.currentTime + this.timeDelta; t13.positionX.linearRampToValueAtTime(hs2.x, r), t13.positionY.linearRampToValueAtTime(hs2.y, r), t13.positionZ.linearRampToValueAtTime(hs2.z, r), t13.forwardX.linearRampToValueAtTime(ds2.x, r), t13.forwardY.linearRampToValueAtTime(ds2.y, r), t13.forwardZ.linearRampToValueAtTime(ds2.z, r), t13.upX.linearRampToValueAtTime(i.x, r), t13.upY.linearRampToValueAtTime(i.y, r), t13.upZ.linearRampToValueAtTime(i.z, r); } else t13.setPosition(hs2.x, hs2.y, hs2.z), t13.setOrientation(ds2.x, ds2.y, ds2.z, i.x, i.y, i.z); } }; var Ip2 = class extends ot { 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 = false, this.buffer = null, this.detune = 0, this.loop = false, this.loopStart = 0, this.loopEnd = 0, this.offset = 0, this.duration = void 0, this.playbackRate = 1, this.isPlaying = false, this.hasPlaybackControl = true, this.source = null, this.sourceType = "empty", this._startedAt = 0, this._progress = 0, this._connected = false, this.filters = []; } getOutput() { return this.gain; } setNodeSource(e) { return this.hasPlaybackControl = false, this.sourceType = "audioNode", this.source = e, this.connect(), this; } setMediaElementSource(e) { return this.hasPlaybackControl = false, this.sourceType = "mediaNode", this.source = this.context.createMediaElementSource(e), this.connect(), this; } setMediaStreamSource(e) { return this.hasPlaybackControl = false, 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 === true) { console.warn("THREE.Audio: Audio is already playing."); return; } if (this.hasPlaybackControl === false) { console.warn("THREE.Audio: this Audio has no playback control."); return; } this._startedAt = this.context.currentTime + e; const t13 = this.context.createBufferSource(); return t13.buffer = this.buffer, t13.loop = this.loop, t13.loopStart = this.loopStart, t13.loopEnd = this.loopEnd, t13.onended = this.onEnded.bind(this), t13.start(this._startedAt, this._progress + this.offset, this.duration), this.isPlaying = true, this.source = t13, this.setDetune(this.detune), this.setPlaybackRate(this.playbackRate), this.connect(); } pause() { if (this.hasPlaybackControl === false) { console.warn("THREE.Audio: this Audio has no playback control."); return; } return this.isPlaying === true && (this._progress += Math.max(this.context.currentTime - this._startedAt, 0) * this.playbackRate, this.loop === true && (this._progress = this._progress % (this.duration || this.buffer.duration)), this.source.stop(), this.source.onended = null, this.isPlaying = false), this; } stop() { if (this.hasPlaybackControl === false) { console.warn("THREE.Audio: this Audio has no playback control."); return; } return this._progress = 0, this.source.stop(), this.source.onended = null, this.isPlaying = false, this; } connect() { if (this.filters.length > 0) { this.source.connect(this.filters[0]); for (let e = 1, t13 = this.filters.length; e < t13; 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 = true, this; } disconnect() { if (this.filters.length > 0) { this.source.disconnect(this.filters[0]); for (let e = 1, t13 = this.filters.length; e < t13; 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 = false, this; } getFilters() { return this.filters; } setFilters(e) { return e || (e = []), this._connected === true ? (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 === true && 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 === false) { console.warn("THREE.Audio: this Audio has no playback control."); return; } return this.playbackRate = e, this.isPlaying === true && this.source.playbackRate.setTargetAtTime(this.playbackRate, this.context.currentTime, 0.01), this; } getPlaybackRate() { return this.playbackRate; } onEnded() { this.isPlaying = false; } getLoop() { return this.hasPlaybackControl === false ? (console.warn("THREE.Audio: this Audio has no playback control."), false) : this.loop; } setLoop(e) { if (this.hasPlaybackControl === false) { console.warn("THREE.Audio: this Audio has no playback control."); return; } return this.loop = e, this.isPlaying === true && (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; } }; var fs2 = new X(); var yv = new Sn(); var _F2 = new X(); var ps2 = new X(); var TF2 = class extends Ip2 { 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, t13, i) { return this.panner.coneInnerAngle = e, this.panner.coneOuterAngle = t13, this.panner.coneOuterGain = i, this; } updateMatrixWorld(e) { if (super.updateMatrixWorld(e), this.hasPlaybackControl === true && this.isPlaying === false) return; this.matrixWorld.decompose(fs2, yv, _F2), ps2.set(0, 0, 1).applyQuaternion(yv); const t13 = this.panner; if (t13.positionX) { const i = this.context.currentTime + this.listener.timeDelta; t13.positionX.linearRampToValueAtTime(fs2.x, i), t13.positionY.linearRampToValueAtTime(fs2.y, i), t13.positionZ.linearRampToValueAtTime(fs2.z, i), t13.orientationX.linearRampToValueAtTime(ps2.x, i), t13.orientationY.linearRampToValueAtTime(ps2.y, i), t13.orientationZ.linearRampToValueAtTime(ps2.z, i); } else t13.setPosition(fs2.x, fs2.y, fs2.z), t13.setOrientation(ps2.x, ps2.y, ps2.z); } }; var lw2 = class { constructor(e, t13 = 2048) { this.analyser = e.context.createAnalyser(), this.analyser.fftSize = t13, 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 t13 = this.getFrequencyData(); for (let i = 0; i < t13.length; i++) e += t13[i]; return e / t13.length; } }; var cw2 = class { constructor(e, t13, i) { this.binding = e, this.valueSize = i; let r, s, o; switch (t13) { case "quaternion": r = this._slerp, s = this._slerpAdditive, o = this._setAdditiveIdentityQuaternion, this.buffer = new Float64Array(i * 6), this._workIndex = 5; break; case "string": case "bool": r = this._select, s = this._select, o = this._setAdditiveIdentityOther, this.buffer = new Array(i * 5); break; default: r = this._lerp, s = this._lerpAdditive, o = this._setAdditiveIdentityNumeric, this.buffer = new Float64Array(i * 5); } this._mixBufferRegion = r, this._mixBufferRegionAdditive = s, 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, t13) { const i = this.buffer, r = this.valueSize, s = e * r + r; let o = this.cumulativeWeight; if (o === 0) { for (let a = 0; a !== r; ++a) i[s + a] = i[a]; o = t13; } else { o += t13; const a = t13 / o; this._mixBufferRegion(i, s, 0, a, r); } this.cumulativeWeight = o; } // accumulate data in the 'incoming' region into 'add' accumulateAdditive(e) { const t13 = this.buffer, i = this.valueSize, r = i * this._addIndex; this.cumulativeWeightAdditive === 0 && this._setIdentity(), this._mixBufferRegionAdditive(t13, r, 0, e, i), this.cumulativeWeightAdditive += e; } // apply the state of 'accu' to the binding when accus differ apply(e) { const t13 = this.valueSize, i = this.buffer, r = e * t13 + t13, s = this.cumulativeWeight, o = this.cumulativeWeightAdditive, a = this.binding; if (this.cumulativeWeight = 0, this.cumulativeWeightAdditive = 0, s < 1) { const c = t13 * this._origIndex; this._mixBufferRegion( i, r, c, 1 - s, t13 ); } o > 0 && this._mixBufferRegionAdditive(i, r, this._addIndex * t13, 1, t13); for (let c = t13, l = t13 + t13; c !== l; ++c) if (i[c] !== i[c + t13]) { a.setValue(i, r); break; } } // remember the state of the bound property and copy it to both accus saveOriginalState() { const e = this.binding, t13 = this.buffer, i = this.valueSize, r = i * this._origIndex; e.getValue(t13, r); for (let s = i, o = r; s !== o; ++s) t13[s] = t13[r + s % 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, t13 = e + this.valueSize; for (let i = e; i < t13; i++) this.buffer[i] = 0; } _setAdditiveIdentityQuaternion() { this._setAdditiveIdentityNumeric(), this.buffer[this._addIndex * this.valueSize + 3] = 1; } _setAdditiveIdentityOther() { const e = this._origIndex * this.valueSize, t13 = this._addIndex * this.valueSize; for (let i = 0; i < this.valueSize; i++) this.buffer[t13 + i] = this.buffer[e + i]; } // mix functions _select(e, t13, i, r, s) { if (r >= 0.5) for (let o = 0; o !== s; ++o) e[t13 + o] = e[i + o]; } _slerp(e, t13, i, r) { Sn.slerpFlat(e, t13, e, t13, e, i, r); } _slerpAdditive(e, t13, i, r, s) { const o = this._workIndex * s; Sn.multiplyQuaternionsFlat(e, o, e, t13, e, i), Sn.slerpFlat(e, t13, e, t13, e, o, r); } _lerp(e, t13, i, r, s) { const o = 1 - r; for (let a = 0; a !== s; ++a) { const c = t13 + a; e[c] = e[c] * o + e[i + a] * r; } } _lerpAdditive(e, t13, i, r, s) { for (let o = 0; o !== s; ++o) { const a = t13 + o; e[a] = e[a] + e[i + o] * r; } } }; var Op2 = "\\[\\]\\.:\\/"; var EF2 = new RegExp("[" + Op2 + "]", "g"); var Dp2 = "[^" + Op2 + "]"; var AF = "[^" + Op2.replace("\\.", "") + "]"; var CF2 = /((?:WC+[\/:])*)/.source.replace("WC", Dp2); var LF = /(WCOD+)?/.source.replace("WCOD", AF); var RF2 = /(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC", Dp2); var PF2 = /\.(WC+)(?:\[(.+)\])?/.source.replace("WC", Dp2); var IF2 = new RegExp( "^" + CF2 + LF + RF2 + PF2 + "$" ); var OF2 = ["material", "materials", "bones"]; var DF2 = class { constructor(e, t13, i) { const r = i || ft2.parseTrackName(t13); this._targetGroup = e, this._bindings = e.subscribe_(t13, r); } getValue(e, t13) { this.bind(); const i = this._targetGroup.nCachedObjects_, r = this._bindings[i]; r !== void 0 && r.getValue(e, t13); } setValue(e, t13) { const i = this._bindings; for (let r = this._targetGroup.nCachedObjects_, s = i.length; r !== s; ++r) i[r].setValue(e, t13); } bind() { const e = this._bindings; for (let t13 = this._targetGroup.nCachedObjects_, i = e.length; t13 !== i; ++t13) e[t13].bind(); } unbind() { const e = this._bindings; for (let t13 = this._targetGroup.nCachedObjects_, i = e.length; t13 !== i; ++t13) e[t13].unbind(); } }; var ft2 = class _ft { constructor(e, t13, i) { this.path = t13, this.parsedPath = i || _ft.parseTrackName(t13), this.node = _ft.findNode(e, this.parsedPath.nodeName) || e, this.rootNode = e, this.getValue = this._getValue_unbound, this.setValue = this._setValue_unbound; } static create(e, t13, i) { return e && e.isAnimationObjectGroup ? new _ft.Composite(e, t13, i) : new _ft(e, t13, 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(EF2, ""); } static parseTrackName(e) { const t13 = IF2.exec(e); if (!t13) throw new Error("PropertyBinding: Cannot parse trackName: " + e); const i = { // directoryName: matches[ 1 ], // (tschw) currently unused nodeName: t13[2], objectName: t13[3], objectIndex: t13[4], propertyName: t13[5], // required propertyIndex: t13[6] }, r = i.nodeName && i.nodeName.lastIndexOf("."); if (r !== void 0 && r !== -1) { const s = i.nodeName.substring(r + 1); OF2.indexOf(s) !== -1 && (i.nodeName = i.nodeName.substring(0, r), i.objectName = s); } if (i.propertyName === null || i.propertyName.length === 0) throw new Error("PropertyBinding: can not parse propertyName from trackName: " + e); return i; } static findNode(e, t13) { if (!t13 || t13 === "" || t13 === "." || t13 === -1 || t13 === e.name || t13 === e.uuid) return e; if (e.skeleton) { const i = e.skeleton.getBoneByName(t13); if (i !== void 0) return i; } if (e.children) { const i = function(s) { for (let o = 0; o < s.length; o++) { const a = s[o]; if (a.name === t13 || a.uuid === t13) return a; const c = i(a.children); if (c) return c; } return null; }, r = i(e.children); if (r) return r; } return null; } // these are used to "bind" a nonexistent property _getValue_unavailable() { } _setValue_unavailable() { } // Getters _getValue_direct(e, t13) { e[t13] = this.node[this.propertyName]; } _getValue_array(e, t13) { const i = this.resolvedProperty; for (let r = 0, s = i.length; r !== s; ++r) e[t13++] = i[r]; } _getValue_arrayElement(e, t13) { e[t13] = this.resolvedProperty[this.propertyIndex]; } _getValue_toArray(e, t13) { this.resolvedProperty.toArray(e, t13); } // Direct _setValue_direct(e, t13) { this.targetObject[this.propertyName] = e[t13]; } _setValue_direct_setNeedsUpdate(e, t13) { this.targetObject[this.propertyName] = e[t13], this.targetObject.needsUpdate = true; } _setValue_direct_setMatrixWorldNeedsUpdate(e, t13) { this.targetObject[this.propertyName] = e[t13], this.targetObject.matrixWorldNeedsUpdate = true; } // EntireArray _setValue_array(e, t13) { const i = this.resolvedProperty; for (let r = 0, s = i.length; r !== s; ++r) i[r] = e[t13++]; } _setValue_array_setNeedsUpdate(e, t13) { const i = this.resolvedProperty; for (let r = 0, s = i.length; r !== s; ++r) i[r] = e[t13++]; this.targetObject.needsUpdate = true; } _setValue_array_setMatrixWorldNeedsUpdate(e, t13) { const i = this.resolvedProperty; for (let r = 0, s = i.length; r !== s; ++r) i[r] = e[t13++]; this.targetObject.matrixWorldNeedsUpdate = true; } // ArrayElement _setValue_arrayElement(e, t13) { this.resolvedProperty[this.propertyIndex] = e[t13]; } _setValue_arrayElement_setNeedsUpdate(e, t13) { this.resolvedProperty[this.propertyIndex] = e[t13], this.targetObject.needsUpdate = true; } _setValue_arrayElement_setMatrixWorldNeedsUpdate(e, t13) { this.resolvedProperty[this.propertyIndex] = e[t13], this.targetObject.matrixWorldNeedsUpdate = true; } // HasToFromArray _setValue_fromArray(e, t13) { this.resolvedProperty.fromArray(e, t13); } _setValue_fromArray_setNeedsUpdate(e, t13) { this.resolvedProperty.fromArray(e, t13), this.targetObject.needsUpdate = true; } _setValue_fromArray_setMatrixWorldNeedsUpdate(e, t13) { this.resolvedProperty.fromArray(e, t13), this.targetObject.matrixWorldNeedsUpdate = true; } _getValue_unbound(e, t13) { this.bind(), this.getValue(e, t13); } _setValue_unbound(e, t13) { this.bind(), this.setValue(e, t13); } // create getter / setter pair for a property in the scene graph bind() { let e = this.node; const t13 = this.parsedPath, i = t13.objectName, r = t13.propertyName; let s = t13.propertyIndex; if (e || (e = _ft.findNode(this.rootNode, t13.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 = t13.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 d = 0; d < e.length; d++) if (e[d].name === l) { l = d; 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[r]; if (o === void 0) { const l = t13.nodeName; console.error("THREE.PropertyBinding: Trying to update property for track: " + l + "." + r + " but it wasn't found.", e); return; } let a = this.Versioning.None; this.targetObject = e, e.needsUpdate !== void 0 ? a = this.Versioning.NeedsUpdate : e.matrixWorldNeedsUpdate !== void 0 && (a = this.Versioning.MatrixWorldNeedsUpdate); let c = this.BindingType.Direct; if (s !== void 0) { if (r === "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[s] !== void 0 && (s = e.morphTargetDictionary[s]); } 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 = s; } 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 = r; this.getValue = this.GetterByBindingType[c], this.setValue = this.SetterByBindingTypeAndVersioning[c][a]; } unbind() { this.node = null, this.getValue = this._getValue_unbound, this.setValue = this._setValue_unbound; } }; ft2.Composite = DF2; ft2.prototype.BindingType = { Direct: 0, EntireArray: 1, ArrayElement: 2, HasFromToArray: 3 }; ft2.prototype.Versioning = { None: 0, NeedsUpdate: 1, MatrixWorldNeedsUpdate: 2 }; ft2.prototype.GetterByBindingType = [ ft2.prototype._getValue_direct, ft2.prototype._getValue_array, ft2.prototype._getValue_arrayElement, ft2.prototype._getValue_toArray ]; ft2.prototype.SetterByBindingTypeAndVersioning = [ [ // Direct ft2.prototype._setValue_direct, ft2.prototype._setValue_direct_setNeedsUpdate, ft2.prototype._setValue_direct_setMatrixWorldNeedsUpdate ], [ // EntireArray ft2.prototype._setValue_array, ft2.prototype._setValue_array_setNeedsUpdate, ft2.prototype._setValue_array_setMatrixWorldNeedsUpdate ], [ // ArrayElement ft2.prototype._setValue_arrayElement, ft2.prototype._setValue_arrayElement_setNeedsUpdate, ft2.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate ], [ // HasToFromArray ft2.prototype._setValue_fromArray, ft2.prototype._setValue_fromArray_setNeedsUpdate, ft2.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate ] ]; var uw2 = class { constructor() { this.uuid = Jn2(), this._objects = Array.prototype.slice.call(arguments), this.nCachedObjects_ = 0; const e = {}; this._indicesByUUID = e; for (let i = 0, r = arguments.length; i !== r; ++i) e[arguments[i].uuid] = i; this._paths = [], this._parsedPaths = [], this._bindings = [], this._bindingsIndicesByPath = {}; const t13 = this; this.stats = { objects: { get total() { return t13._objects.length; }, get inUse() { return this.total - t13.nCachedObjects_; } }, get bindingsPerObject() { return t13._bindings.length; } }; } add() { const e = this._objects, t13 = this._indicesByUUID, i = this._paths, r = this._parsedPaths, s = this._bindings, o = s.length; let a, c = e.length, l = this.nCachedObjects_; for (let d = 0, h6 = arguments.length; d !== h6; ++d) { const p = arguments[d], g = p.uuid; let f = t13[g]; if (f === void 0) { f = c++, t13[g] = f, e.push(p); for (let u = 0, y = o; u !== y; ++u) s[u].push(new ft2(p, i[u], r[u])); } else if (f < l) { a = e[f]; const u = --l, y = e[u]; t13[y.uuid] = f, e[f] = y, t13[g] = u, e[u] = p; for (let v = 0, m = o; v !== m; ++v) { const w = s[v], S = w[u]; let T = w[f]; w[f] = S, T === void 0 && (T = new ft2(p, i[v], r[v])), w[u] = T; } } else e[f] !== a && 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, t13 = this._indicesByUUID, i = this._bindings, r = i.length; let s = this.nCachedObjects_; for (let o = 0, a = arguments.length; o !== a; ++o) { const c = arguments[o], l = c.uuid, d = t13[l]; if (d !== void 0 && d >= s) { const h6 = s++, p = e[h6]; t13[p.uuid] = d, e[d] = p, t13[l] = h6, e[h6] = c; for (let g = 0, f = r; g !== f; ++g) { const u = i[g], y = u[h6], v = u[d]; u[d] = y, u[h6] = v; } } } this.nCachedObjects_ = s; } // remove & forget uncache() { const e = this._objects, t13 = this._indicesByUUID, i = this._bindings, r = i.length; let s = this.nCachedObjects_, o = e.length; for (let a = 0, c = arguments.length; a !== c; ++a) { const l = arguments[a], d = l.uuid, h6 = t13[d]; if (h6 !== void 0) if (delete t13[d], h6 < s) { const p = --s, g = e[p], f = --o, u = e[f]; t13[g.uuid] = h6, e[h6] = g, t13[u.uuid] = p, e[p] = u, e.pop(); for (let y = 0, v = r; y !== v; ++y) { const m = i[y], w = m[p], S = m[f]; m[h6] = w, m[p] = S, m.pop(); } } else { const p = --o, g = e[p]; p > 0 && (t13[g.uuid] = h6), e[h6] = g, e.pop(); for (let f = 0, u = r; f !== u; ++f) { const y = i[f]; y[h6] = y[p], y.pop(); } } } this.nCachedObjects_ = s; } // Internal interface used by befriended PropertyBinding.Composite: subscribe_(e, t13) { const i = this._bindingsIndicesByPath; let r = i[e]; const s = this._bindings; if (r !== void 0) return s[r]; const o = this._paths, a = this._parsedPaths, c = this._objects, l = c.length, d = this.nCachedObjects_, h6 = new Array(l); r = s.length, i[e] = r, o.push(e), a.push(t13), s.push(h6); for (let p = d, g = c.length; p !== g; ++p) { const f = c[p]; h6[p] = new ft2(f, e, t13); } return h6; } unsubscribe_(e) { const t13 = this._bindingsIndicesByPath, i = t13[e]; if (i !== void 0) { const r = this._paths, s = this._parsedPaths, o = this._bindings, a = o.length - 1, c = o[a], l = e[a]; t13[l] = i, o[i] = c, o.pop(), s[i] = s[a], s.pop(), r[i] = r[a], r.pop(); } } }; uw2.prototype.isAnimationObjectGroup = true; var NF2 = class { constructor(e, t13, i = null, r = t13.blendMode) { this._mixer = e, this._clip = t13, this._localRoot = i, this.blendMode = r; const s = t13.tracks, o = s.length, a = new Array(o), c = { endingStart: xs2, endingEnd: xs2 }; for (let l = 0; l !== o; ++l) { const d = s[l].createInterpolant(null); a[l] = d, d.settings = c; } this._interpolantSettings = c, this._interpolants = a, this._propertyBindings = new Array(o), this._cacheIndex = null, this._byClipCacheIndex = null, this._timeScaleInterpolant = null, this._weightInterpolant = null, this.loop = ix2, 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 = false, this.enabled = true, this.clampWhenFinished = false, this.zeroSlopeAtStart = true, this.zeroSlopeAtEnd = true; } // State & Scheduling play() { return this._mixer._activateAction(this), this; } stop() { return this._mixer._deactivateAction(this), this.reset(); } reset() { return this.paused = false, this.enabled = true, 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, t13) { return this.loop = e, this.repetitions = t13, 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, t13, i) { if (e.fadeOut(t13), this.fadeIn(t13), i) { const r = this._clip.duration, s = e._clip.duration, o = s / r, a = r / s; e.warp(1, o, t13), this.warp(a, 1, t13); } return this; } crossFadeTo(e, t13, i) { return e.crossFadeFrom(this, t13, 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, t13, i) { const r = this._mixer, s = r.time, o = this.timeScale; let a = this._timeScaleInterpolant; a === null && (a = r._lendControlInterpolant(), this._timeScaleInterpolant = a); const c = a.parameterPositions, l = a.sampleValues; return c[0] = s, c[1] = s + i, l[0] = e / o, l[1] = t13 / 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, t13, i, r) { if (!this.enabled) { this._updateWeight(e); return; } const s = this._startTime; if (s !== null) { const c = (e - s) * i; if (c < 0 || i === 0) return; this._startTime = null, t13 = i * c; } t13 *= this._updateTimeScale(e); const o = this._updateTime(t13), a = this._updateWeight(e); if (a > 0) { const c = this._interpolants, l = this._propertyBindings; switch (this.blendMode) { case Wf2: for (let d = 0, h6 = c.length; d !== h6; ++d) c[d].evaluate(o), l[d].accumulateAdditive(a); break; case Eu2: default: for (let d = 0, h6 = c.length; d !== h6; ++d) c[d].evaluate(o), l[d].accumulate(r, a); } } } _updateWeight(e) { let t13 = 0; if (this.enabled) { t13 = this.weight; const i = this._weightInterpolant; if (i !== null) { const r = i.evaluate(e)[0]; t13 *= r, e > i.parameterPositions[1] && (this.stopFading(), r === 0 && (this.enabled = false)); } } return this._effectiveWeight = t13, t13; } _updateTimeScale(e) { let t13 = 0; if (!this.paused) { t13 = this.timeScale; const i = this._timeScaleInterpolant; if (i !== null) { const r = i.evaluate(e)[0]; t13 *= r, e > i.parameterPositions[1] && (this.stopWarping(), t13 === 0 ? this.paused = true : this.timeScale = t13); } } return this._effectiveTimeScale = t13, t13; } _updateTime(e) { const t13 = this._clip.duration, i = this.loop; let r = this.time + e, s = this._loopCount; const o = i === rx2; if (e === 0) return s === -1 ? r : o && (s & 1) === 1 ? t13 - r : r; if (i === nx2) { s === -1 && (this._loopCount = 0, this._setEndings(true, true, false)); e: { if (r >= t13) r = t13; else if (r < 0) r = 0; else { this.time = r; break e; } this.clampWhenFinished ? this.paused = true : this.enabled = false, this.time = r, this._mixer.dispatchEvent({ type: "finished", action: this, direction: e < 0 ? -1 : 1 }); } } else { if (s === -1 && (e >= 0 ? (s = 0, this._setEndings(true, this.repetitions === 0, o)) : this._setEndings(this.repetitions === 0, true, o)), r >= t13 || r < 0) { const a = Math.floor(r / t13); r -= t13 * a, s += Math.abs(a); const c = this.repetitions - s; if (c <= 0) this.clampWhenFinished ? this.paused = true : this.enabled = false, r = e > 0 ? t13 : 0, this.time = r, 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(false, false, o); this._loopCount = s, this.time = r, this._mixer.dispatchEvent({ type: "loop", action: this, loopDelta: a }); } } else this.time = r; if (o && (s & 1) === 1) return t13 - r; } return r; } _setEndings(e, t13, i) { const r = this._interpolantSettings; i ? (r.endingStart = ws2, r.endingEnd = ws2) : (e ? r.endingStart = this.zeroSlopeAtStart ? ws2 : xs2 : r.endingStart = tl2, t13 ? r.endingEnd = this.zeroSlopeAtEnd ? ws2 : xs2 : r.endingEnd = tl2); } _scheduleFading(e, t13, i) { const r = this._mixer, s = r.time; let o = this._weightInterpolant; o === null && (o = r._lendControlInterpolant(), this._weightInterpolant = o); const a = o.parameterPositions, c = o.sampleValues; return a[0] = s, c[0] = t13, a[1] = s + e, c[1] = i, this; } }; var hw2 = class extends ns2 { constructor(e) { super(), this._root = e, this._initMemoryManager(), this._accuIndex = 0, this.time = 0, this.timeScale = 1; } _bindAction(e, t13) { const i = e._localRoot || this._root, r = e._clip.tracks, s = r.length, o = e._propertyBindings, a = e._interpolants, c = i.uuid, l = this._bindingsByRootAndName; let d = l[c]; d === void 0 && (d = {}, l[c] = d); for (let h6 = 0; h6 !== s; ++h6) { const p = r[h6], g = p.name; let f = d[g]; if (f !== void 0) o[h6] = f; else { if (f = o[h6], f !== void 0) { f._cacheIndex === null && (++f.referenceCount, this._addInactiveBinding(f, c, g)); continue; } const u = t13 && t13._propertyBindings[h6].binding.parsedPath; f = new cw2( ft2.create(i, g, u), p.ValueTypeName, p.getValueSize() ), ++f.referenceCount, this._addInactiveBinding(f, c, g), o[h6] = f; } a[h6].resultBuffer = f.buffer; } } _activateAction(e) { if (!this._isActiveAction(e)) { if (e._cacheIndex === null) { const i = (e._localRoot || this._root).uuid, r = e._clip.uuid, s = this._actionsByClip[r]; this._bindAction( e, s && s.knownActions[0] ), this._addInactiveAction(e, r, i); } const t13 = e._propertyBindings; for (let i = 0, r = t13.length; i !== r; ++i) { const s = t13[i]; s.useCount++ === 0 && (this._lendBinding(s), s.saveOriginalState()); } this._lendAction(e); } } _deactivateAction(e) { if (this._isActiveAction(e)) { const t13 = e._propertyBindings; for (let i = 0, r = t13.length; i !== r; ++i) { const s = t13[i]; --s.useCount === 0 && (s.restoreOriginalState(), this._takeBackBinding(s)); } 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 t13 = e._cacheIndex; return t13 !== null && t13 < this._nActiveActions; } _addInactiveAction(e, t13, i) { const r = this._actions, s = this._actionsByClip; let o = s[t13]; if (o === void 0) o = { knownActions: [e], actionByRoot: {} }, e._byClipCacheIndex = 0, s[t13] = o; else { const a = o.knownActions; e._byClipCacheIndex = a.length, a.push(e); } e._cacheIndex = r.length, r.push(e), o.actionByRoot[i] = e; } _removeInactiveAction(e) { const t13 = this._actions, i = t13[t13.length - 1], r = e._cacheIndex; i._cacheIndex = r, t13[r] = i, t13.pop(), e._cacheIndex = null; const s = e._clip.uuid, o = this._actionsByClip, a = o[s], c = a.knownActions, l = c[c.length - 1], d = e._byClipCacheIndex; l._byClipCacheIndex = d, c[d] = l, c.pop(), e._byClipCacheIndex = null; const h6 = a.actionByRoot, p = (e._localRoot || this._root).uuid; delete h6[p], c.length === 0 && delete o[s], this._removeInactiveBindingsForAction(e); } _removeInactiveBindingsForAction(e) { const t13 = e._propertyBindings; for (let i = 0, r = t13.length; i !== r; ++i) { const s = t13[i]; --s.referenceCount === 0 && this._removeInactiveBinding(s); } } _lendAction(e) { const t13 = this._actions, i = e._cacheIndex, r = this._nActiveActions++, s = t13[r]; e._cacheIndex = r, t13[r] = e, s._cacheIndex = i, t13[i] = s; } _takeBackAction(e) { const t13 = this._actions, i = e._cacheIndex, r = --this._nActiveActions, s = t13[r]; e._cacheIndex = r, t13[r] = e, s._cacheIndex = i, t13[i] = s; } // Memory management for PropertyMixer objects _addInactiveBinding(e, t13, i) { const r = this._bindingsByRootAndName, s = this._bindings; let o = r[t13]; o === void 0 && (o = {}, r[t13] = o), o[i] = e, e._cacheIndex = s.length, s.push(e); } _removeInactiveBinding(e) { const t13 = this._bindings, i = e.binding, r = i.rootNode.uuid, s = i.path, o = this._bindingsByRootAndName, a = o[r], c = t13[t13.length - 1], l = e._cacheIndex; c._cacheIndex = l, t13[l] = c, t13.pop(), delete a[s], Object.keys(a).length === 0 && delete o[r]; } _lendBinding(e) { const t13 = this._bindings, i = e._cacheIndex, r = this._nActiveBindings++, s = t13[r]; e._cacheIndex = r, t13[r] = e, s._cacheIndex = i, t13[i] = s; } _takeBackBinding(e) { const t13 = this._bindings, i = e._cacheIndex, r = --this._nActiveBindings, s = t13[r]; e._cacheIndex = r, t13[r] = e, s._cacheIndex = i, t13[i] = s; } // Memory management of Interpolants for weight and time scale _lendControlInterpolant() { const e = this._controlInterpolants, t13 = this._nActiveControlInterpolants++; let i = e[t13]; return i === void 0 && (i = new yp2( new Float32Array(2), new Float32Array(2), 1, this._controlInterpolantsResultBuffer ), i.__cacheIndex = t13, e[t13] = i), i; } _takeBackControlInterpolant(e) { const t13 = this._controlInterpolants, i = e.__cacheIndex, r = --this._nActiveControlInterpolants, s = t13[r]; e.__cacheIndex = r, t13[r] = e, s.__cacheIndex = i, t13[i] = s; } // 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, t13, i) { const r = t13 || this._root, s = r.uuid; let o = typeof e == "string" ? Qo2.findByName(r, e) : e; const a = o !== null ? o.uuid : e, c = this._actionsByClip[a]; let l = null; if (i === void 0 && (o !== null ? i = o.blendMode : i = Eu2), c !== void 0) { const h6 = c.actionByRoot[s]; if (h6 !== void 0 && h6.blendMode === i) return h6; l = c.knownActions[0], o === null && (o = l._clip); } if (o === null) return null; const d = new NF2(this, o, t13, i); return this._bindAction(d, l), this._addInactiveAction(d, a, s), d; } // get an existing action existingAction(e, t13) { const i = t13 || this._root, r = i.uuid, s = typeof e == "string" ? Qo2.findByName(i, e) : e, o = s ? s.uuid : e, a = this._actionsByClip[o]; return a !== void 0 && a.actionByRoot[r] || null; } // deactivates all previously scheduled actions stopAllAction() { const e = this._actions, t13 = this._nActiveActions; for (let i = t13 - 1; i >= 0; --i) e[i].stop(); return this; } // advance the time and update apply the animation update(e) { e *= this.timeScale; const t13 = this._actions, i = this._nActiveActions, r = this.time += e, s = Math.sign(e), o = this._accuIndex ^= 1; for (let l = 0; l !== i; ++l) t13[l]._update(r, e, s, o); const a = this._bindings, c = this._nActiveBindings; for (let l = 0; l !== c; ++l) a[l].apply(o); return this; } // Allows you to seek to a specific time in an animation. setTime(e) { this.time = 0; for (let t13 = 0; t13 < this._actions.length; t13++) this._actions[t13].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 t13 = this._actions, i = e.uuid, r = this._actionsByClip, s = r[i]; if (s !== void 0) { const o = s.knownActions; for (let a = 0, c = o.length; a !== c; ++a) { const l = o[a]; this._deactivateAction(l); const d = l._cacheIndex, h6 = t13[t13.length - 1]; l._cacheIndex = null, l._byClipCacheIndex = null, h6._cacheIndex = d, t13[d] = h6, t13.pop(), this._removeInactiveBindingsForAction(l); } delete r[i]; } } // free all resources specific to a particular root target object uncacheRoot(e) { const t13 = e.uuid, i = this._actionsByClip; for (const o in i) { const a = i[o].actionByRoot, c = a[t13]; c !== void 0 && (this._deactivateAction(c), this._removeInactiveAction(c)); } const r = this._bindingsByRootAndName, s = r[t13]; if (s !== void 0) for (const o in s) { const a = s[o]; a.restoreOriginalState(), this._removeInactiveBinding(a); } } // remove a targeted clip from the cache uncacheAction(e, t13) { const i = this.existingAction(e, t13); i !== null && (this._deactivateAction(i), this._removeInactiveAction(i)); } }; hw2.prototype._controlInterpolantsResultBuffer = new Float32Array(1); var Wu2 = class _Wu { constructor(e) { typeof e == "string" && (console.warn("THREE.Uniform: Type parameter is no longer needed."), e = arguments[1]), this.value = e; } clone() { return new _Wu(this.value.clone === void 0 ? this.value : this.value.clone()); } }; var dw2 = class extends rs2 { constructor(e, t13, i = 1) { super(e, t13), this.meshPerAttribute = i; } copy(e) { return super.copy(e), this.meshPerAttribute = e.meshPerAttribute, this; } clone(e) { const t13 = super.clone(e); return t13.meshPerAttribute = this.meshPerAttribute, t13; } toJSON(e) { const t13 = super.toJSON(e); return t13.isInstancedInterleavedBuffer = true, t13.meshPerAttribute = this.meshPerAttribute, t13; } }; dw2.prototype.isInstancedInterleavedBuffer = true; var fw2 = class { constructor(e, t13, i, r, s) { this.buffer = e, this.type = t13, this.itemSize = i, this.elementSize = r, this.count = s, this.version = 0; } set needsUpdate(e) { e === true && this.version++; } setBuffer(e) { return this.buffer = e, this; } setType(e, t13) { return this.type = e, this.elementSize = t13, this; } setItemSize(e) { return this.itemSize = e, this; } setCount(e) { return this.count = e, this; } }; fw2.prototype.isGLBufferAttribute = true; var FF = class { constructor(e, t13, i = 0, r = 1 / 0) { this.ray = new is2(e, t13), this.near = i, this.far = r, this.camera = null, this.layers = new qf2(), this.params = { Mesh: {}, Line: { threshold: 1 }, LOD: {}, Points: { threshold: 1 }, Sprite: {} }; } set(e, t13) { this.ray.set(e, t13); } setFromCamera(e, t13) { t13 && t13.isPerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t13.matrixWorld), this.ray.direction.set(e.x, e.y, 0.5).unproject(t13).sub(this.ray.origin).normalize(), this.camera = t13) : t13 && t13.isOrthographicCamera ? (this.ray.origin.set(e.x, e.y, (t13.near + t13.far) / (t13.near - t13.far)).unproject(t13), this.ray.direction.set(0, 0, -1).transformDirection(t13.matrixWorld), this.camera = t13) : console.error("THREE.Raycaster: Unsupported camera type: " + t13.type); } intersectObject(e, t13 = false, i = []) { return kd2(e, this, i, t13), i.sort(bv2), i; } intersectObjects(e, t13 = false, i = []) { for (let r = 0, s = e.length; r < s; r++) kd2(e[r], this, i, t13); return i.sort(bv2), i; } }; function bv2(n, e) { return n.distance - e.distance; } function kd2(n, e, t13, i) { if (n.layers.test(e.layers) && n.raycast(e, t13), i === true) { const r = n.children; for (let s = 0, o = r.length; s < o; s++) kd2(r[s], e, t13, true); } } var BF2 = class { constructor(e = 1, t13 = 0, i = 0) { return this.radius = e, this.phi = t13, this.theta = i, this; } set(e, t13, i) { return this.radius = e, this.phi = t13, 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, t13, i) { return this.radius = Math.sqrt(e * e + t13 * t13 + i * i), this.radius === 0 ? (this.theta = 0, this.phi = 0) : (this.theta = Math.atan2(e, i), this.phi = Math.acos(wn3(t13 / this.radius, -1, 1))), this; } clone() { return new this.constructor().copy(this); } }; var zF2 = class { constructor(e = 1, t13 = 0, i = 0) { return this.radius = e, this.theta = t13, this.y = i, this; } set(e, t13, i) { return this.radius = e, this.theta = t13, 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, t13, i) { return this.radius = Math.sqrt(e * e + i * i), this.theta = Math.atan2(e, i), this.y = t13, this; } clone() { return new this.constructor().copy(this); } }; var xv2 = new Pe(); var pa2 = class { constructor(e = new Pe(1 / 0, 1 / 0), t13 = new Pe(-1 / 0, -1 / 0)) { this.min = e, this.max = t13; } set(e, t13) { return this.min.copy(e), this.max.copy(t13), this; } setFromPoints(e) { this.makeEmpty(); for (let t13 = 0, i = e.length; t13 < i; t13++) this.expandByPoint(e[t13]); return this; } setFromCenterAndSize(e, t13) { const i = xv2.copy(t13).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, t13) { return t13.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, t13) { return t13.copy(e).clamp(this.min, this.max); } distanceToPoint(e) { return xv2.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); } }; pa2.prototype.isBox2 = true; var wv2 = new X(); var Mc2 = new X(); var pw2 = class { constructor(e = new X(), t13 = new X()) { this.start = e, this.end = t13; } set(e, t13) { return this.start.copy(e), this.end.copy(t13), 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, t13) { return this.delta(t13).multiplyScalar(e).add(this.start); } closestPointToPointParameter(e, t13) { wv2.subVectors(e, this.start), Mc2.subVectors(this.end, this.start); const i = Mc2.dot(Mc2); let s = Mc2.dot(wv2) / i; return t13 && (s = wn3(s, 0, 1)), s; } closestPointToPoint(e, t13, i) { const r = this.closestPointToPointParameter(e, t13); return this.delta(i).multiplyScalar(r).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); } }; var mw2 = class extends ot { constructor(e) { super(), this.material = e, this.render = function() { }, this.hasPositions = false, this.hasNormals = false, this.hasColors = false, this.hasUvs = false, this.positionArray = null, this.normalArray = null, this.colorArray = null, this.uvArray = null, this.count = 0; } }; mw2.prototype.isImmediateRenderObject = true; var Mv2 = new X(); var UF = class extends ot { constructor(e, t13) { super(), this.light = e, this.light.updateMatrixWorld(), this.matrix = e.matrixWorld, this.matrixAutoUpdate = false, this.color = t13; const i = new Je2(), r = [ 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, a = 1, c = 32; o < c; o++, a++) { const l = o / c * Math.PI * 2, d = a / c * Math.PI * 2; r.push( Math.cos(l), Math.sin(l), 1, Math.cos(d), Math.sin(d), 1 ); } i.setAttribute("position", new We(r, 3)); const s = new un2({ fog: false, toneMapped: false }); this.cone = new Fn2(i, s), 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, t13 = e * Math.tan(this.light.angle); this.cone.scale.set(t13, t13, e), Mv2.setFromMatrixPosition(this.light.target.matrixWorld), this.cone.lookAt(Mv2), this.color !== void 0 ? this.cone.material.color.set(this.color) : this.cone.material.color.copy(this.light.color); } }; var Rr = new X(); var Sc2 = new $e2(); var Bh2 = new $e2(); var gw2 = class extends Fn2 { constructor(e) { const t13 = vw2(e), i = new Je2(), r = [], s = [], o = new Fe(0, 0, 1), a = new Fe(0, 1, 0); for (let l = 0; l < t13.length; l++) { const d = t13[l]; d.parent && d.parent.isBone && (r.push(0, 0, 0), r.push(0, 0, 0), s.push(o.r, o.g, o.b), s.push(a.r, a.g, a.b)); } i.setAttribute("position", new We(r, 3)), i.setAttribute("color", new We(s, 3)); const c = new un2({ vertexColors: true, depthTest: false, depthWrite: false, toneMapped: false, transparent: true }); super(i, c), this.type = "SkeletonHelper", this.isSkeletonHelper = true, this.root = e, this.bones = t13, this.matrix = e.matrixWorld, this.matrixAutoUpdate = false; } updateMatrixWorld(e) { const t13 = this.bones, i = this.geometry, r = i.getAttribute("position"); Bh2.copy(this.root.matrixWorld).invert(); for (let s = 0, o = 0; s < t13.length; s++) { const a = t13[s]; a.parent && a.parent.isBone && (Sc2.multiplyMatrices(Bh2, a.matrixWorld), Rr.setFromMatrixPosition(Sc2), r.setXYZ(o, Rr.x, Rr.y, Rr.z), Sc2.multiplyMatrices(Bh2, a.parent.matrixWorld), Rr.setFromMatrixPosition(Sc2), r.setXYZ(o + 1, Rr.x, Rr.y, Rr.z), o += 2); } i.getAttribute("position").needsUpdate = true, super.updateMatrixWorld(e); } }; function vw2(n) { const e = []; n && n.isBone && e.push(n); for (let t13 = 0; t13 < n.children.length; t13++) e.push.apply(e, vw2(n.children[t13])); return e; } var VF = class extends tn2 { constructor(e, t13, i) { const r = new Bs2(t13, 4, 2), s = new Vn2({ wireframe: true, fog: false, toneMapped: false }); super(r, s), this.light = e, this.light.updateMatrixWorld(), this.color = i, this.type = "PointLightHelper", this.matrix = this.light.matrixWorld, this.matrixAutoUpdate = false, 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); } }; var kF2 = new X(); var Sv2 = new Fe(); var _v2 = new Fe(); var GF = class extends ot { constructor(e, t13, i) { super(), this.light = e, this.light.updateMatrixWorld(), this.matrix = e.matrixWorld, this.matrixAutoUpdate = false, this.color = i; const r = new Ns2(t13); r.rotateY(Math.PI * 0.5), this.material = new Vn2({ wireframe: true, fog: false, toneMapped: false }), this.color === void 0 && (this.material.vertexColors = true); const s = r.getAttribute("position"), o = new Float32Array(s.count * 3); r.setAttribute("color", new nt(o, 3)), this.add(new tn2(r, 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 t13 = e.geometry.getAttribute("color"); Sv2.copy(this.light.color), _v2.copy(this.light.groundColor); for (let i = 0, r = t13.count; i < r; i++) { const s = i < r / 2 ? Sv2 : _v2; t13.setXYZ(i, s.r, s.g, s.b); } t13.needsUpdate = true; } e.lookAt(kF2.setFromMatrixPosition(this.light.matrixWorld).negate()); } }; var yw2 = class extends Fn2 { constructor(e = 10, t13 = 10, i = 4473924, r = 8947848) { i = new Fe(i), r = new Fe(r); const s = t13 / 2, o = e / t13, a = e / 2, c = [], l = []; for (let p = 0, g = 0, f = -a; p <= t13; p++, f += o) { c.push(-a, 0, f, a, 0, f), c.push(f, 0, -a, f, 0, a); const u = p === s ? i : r; u.toArray(l, g), g += 3, u.toArray(l, g), g += 3, u.toArray(l, g), g += 3, u.toArray(l, g), g += 3; } const d = new Je2(); d.setAttribute("position", new We(c, 3)), d.setAttribute("color", new We(l, 3)); const h6 = new un2({ vertexColors: true, toneMapped: false }); super(d, h6), this.type = "GridHelper"; } }; var HF = class extends Fn2 { constructor(e = 10, t13 = 16, i = 8, r = 64, s = 4473924, o = 8947848) { s = new Fe(s), o = new Fe(o); const a = [], c = []; for (let h6 = 0; h6 <= t13; h6++) { const p = h6 / t13 * (Math.PI * 2), g = Math.sin(p) * e, f = Math.cos(p) * e; a.push(0, 0, 0), a.push(g, 0, f); const u = h6 & 1 ? s : o; c.push(u.r, u.g, u.b), c.push(u.r, u.g, u.b); } for (let h6 = 0; h6 <= i; h6++) { const p = h6 & 1 ? s : o, g = e - e / i * h6; for (let f = 0; f < r; f++) { let u = f / r * (Math.PI * 2), y = Math.sin(u) * g, v = Math.cos(u) * g; a.push(y, 0, v), c.push(p.r, p.g, p.b), u = (f + 1) / r * (Math.PI * 2), y = Math.sin(u) * g, v = Math.cos(u) * g, a.push(y, 0, v), c.push(p.r, p.g, p.b); } } const l = new Je2(); l.setAttribute("position", new We(a, 3)), l.setAttribute("color", new We(c, 3)); const d = new un2({ vertexColors: true, toneMapped: false }); super(l, d), this.type = "PolarGridHelper"; } }; var Tv2 = new X(); var _c2 = new X(); var Ev2 = new X(); var WF = class extends ot { constructor(e, t13, i) { super(), this.light = e, this.light.updateMatrixWorld(), this.matrix = e.matrixWorld, this.matrixAutoUpdate = false, this.color = i, t13 === void 0 && (t13 = 1); let r = new Je2(); r.setAttribute("position", new We([ -t13, t13, 0, t13, t13, 0, t13, -t13, 0, -t13, -t13, 0, -t13, t13, 0 ], 3)); const s = new un2({ fog: false, toneMapped: false }); this.lightPlane = new Ui2(r, s), this.add(this.lightPlane), r = new Je2(), r.setAttribute("position", new We([0, 0, 0, 0, 0, 1], 3)), this.targetLine = new Ui2(r, s), this.add(this.targetLine), this.update(); } dispose() { this.lightPlane.geometry.dispose(), this.lightPlane.material.dispose(), this.targetLine.geometry.dispose(), this.targetLine.material.dispose(); } update() { Tv2.setFromMatrixPosition(this.light.matrixWorld), _c2.setFromMatrixPosition(this.light.target.matrixWorld), Ev2.subVectors(_c2, Tv2), this.lightPlane.lookAt(_c2), 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(_c2), this.targetLine.scale.z = Ev2.length(); } }; var Tc2 = new X(); var Gt2 = new wl2(); var jF = class extends Fn2 { constructor(e) { const t13 = new Je2(), i = new un2({ color: 16777215, vertexColors: true, toneMapped: false }), r = [], s = [], o = {}, a = new Fe(16755200), c = new Fe(16711680), l = new Fe(43775), d = new Fe(16777215), h6 = new Fe(3355443); p("n1", "n2", a), p("n2", "n4", a), p("n4", "n3", a), p("n3", "n1", a), p("f1", "f2", a), p("f2", "f4", a), p("f4", "f3", a), p("f3", "f1", a), p("n1", "f1", a), p("n2", "f2", a), p("n3", "f3", a), p("n4", "f4", a), p("p", "n1", c), p("p", "n2", c), p("p", "n3", c), p("p", "n4", c), p("u1", "u2", l), p("u2", "u3", l), p("u3", "u1", l), p("c", "t", d), p("p", "c", h6), p("cn1", "cn2", h6), p("cn3", "cn4", h6), p("cf1", "cf2", h6), p("cf3", "cf4", h6); function p(f, u, y) { g(f, y), g(u, y); } function g(f, u) { r.push(0, 0, 0), s.push(u.r, u.g, u.b), o[f] === void 0 && (o[f] = []), o[f].push(r.length / 3 - 1); } t13.setAttribute("position", new We(r, 3)), t13.setAttribute("color", new We(s, 3)), super(t13, i), this.type = "CameraHelper", this.camera = e, this.camera.updateProjectionMatrix && this.camera.updateProjectionMatrix(), this.matrix = e.matrixWorld, this.matrixAutoUpdate = false, this.pointMap = o, this.update(); } update() { const e = this.geometry, t13 = this.pointMap, i = 1, r = 1; Gt2.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse), Yt2("c", t13, e, Gt2, 0, 0, -1), Yt2("t", t13, e, Gt2, 0, 0, 1), Yt2("n1", t13, e, Gt2, -i, -r, -1), Yt2("n2", t13, e, Gt2, i, -r, -1), Yt2("n3", t13, e, Gt2, -i, r, -1), Yt2("n4", t13, e, Gt2, i, r, -1), Yt2("f1", t13, e, Gt2, -i, -r, 1), Yt2("f2", t13, e, Gt2, i, -r, 1), Yt2("f3", t13, e, Gt2, -i, r, 1), Yt2("f4", t13, e, Gt2, i, r, 1), Yt2("u1", t13, e, Gt2, i * 0.7, r * 1.1, -1), Yt2("u2", t13, e, Gt2, -i * 0.7, r * 1.1, -1), Yt2("u3", t13, e, Gt2, 0, r * 2, -1), Yt2("cf1", t13, e, Gt2, -i, 0, 1), Yt2("cf2", t13, e, Gt2, i, 0, 1), Yt2("cf3", t13, e, Gt2, 0, -r, 1), Yt2("cf4", t13, e, Gt2, 0, r, 1), Yt2("cn1", t13, e, Gt2, -i, 0, -1), Yt2("cn2", t13, e, Gt2, i, 0, -1), Yt2("cn3", t13, e, Gt2, 0, -r, -1), Yt2("cn4", t13, e, Gt2, 0, r, -1), e.getAttribute("position").needsUpdate = true; } dispose() { this.geometry.dispose(), this.material.dispose(); } }; function Yt2(n, e, t13, i, r, s, o) { Tc2.set(r, s, o).unproject(i); const a = e[n]; if (a !== void 0) { const c = t13.getAttribute("position"); for (let l = 0, d = a.length; l < d; l++) c.setXYZ(a[l], Tc2.x, Tc2.y, Tc2.z); } } var Ec2 = new Hn2(); var bw2 = class extends Fn2 { constructor(e, t13 = 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]), r = new Float32Array(8 * 3), s = new Je2(); s.setIndex(new nt(i, 1)), s.setAttribute("position", new nt(r, 3)), super(s, new un2({ color: t13, toneMapped: false })), this.object = e, this.type = "BoxHelper", this.matrixAutoUpdate = false, this.update(); } update(e) { if (e !== void 0 && console.warn("THREE.BoxHelper: .update() has no longer arguments."), this.object !== void 0 && Ec2.setFromObject(this.object), Ec2.isEmpty()) return; const t13 = Ec2.min, i = Ec2.max, r = this.geometry.attributes.position, s = r.array; s[0] = i.x, s[1] = i.y, s[2] = i.z, s[3] = t13.x, s[4] = i.y, s[5] = i.z, s[6] = t13.x, s[7] = t13.y, s[8] = i.z, s[9] = i.x, s[10] = t13.y, s[11] = i.z, s[12] = i.x, s[13] = i.y, s[14] = t13.z, s[15] = t13.x, s[16] = i.y, s[17] = t13.z, s[18] = t13.x, s[19] = t13.y, s[20] = t13.z, s[21] = i.x, s[22] = t13.y, s[23] = t13.z, r.needsUpdate = true, this.geometry.computeBoundingSphere(); } setFromObject(e) { return this.object = e, this.update(), this; } copy(e) { return Fn2.prototype.copy.call(this, e), this.object = e.object, this; } }; var $F2 = class extends Fn2 { constructor(e, t13 = 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]), r = [1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1], s = new Je2(); s.setIndex(new nt(i, 1)), s.setAttribute("position", new We(r, 3)), super(s, new un2({ color: t13, toneMapped: false })), this.box = e, this.type = "Box3Helper", this.geometry.computeBoundingSphere(); } updateMatrixWorld(e) { const t13 = this.box; t13.isEmpty() || (t13.getCenter(this.position), t13.getSize(this.scale), this.scale.multiplyScalar(0.5), super.updateMatrixWorld(e)); } }; var ZF = class extends Ui2 { constructor(e, t13 = 1, i = 16776960) { const r = i, s = [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 Je2(); o.setAttribute("position", new We(s, 3)), o.computeBoundingSphere(), super(o, new un2({ color: r, toneMapped: false })), this.type = "PlaneHelper", this.plane = e, this.size = t13; const a = [1, 1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1], c = new Je2(); c.setAttribute("position", new We(a, 3)), c.computeBoundingSphere(), this.add(new tn2(c, new Vn2({ color: r, opacity: 0.2, transparent: true, depthWrite: false, toneMapped: false }))); } updateMatrixWorld(e) { let t13 = -this.plane.constant; Math.abs(t13) < 1e-8 && (t13 = 1e-8), this.scale.set(0.5 * this.size, 0.5 * this.size, t13), this.children[0].material.side = t13 < 0 ? qt2 : Xr2, this.lookAt(this.plane.normal), super.updateMatrixWorld(e); } }; var Av2 = new X(); var Ac2; var zh2; var XF = class extends ot { // dir is assumed to be normalized constructor(e = new X(0, 0, 1), t13 = new X(0, 0, 0), i = 1, r = 16776960, s = i * 0.2, o = s * 0.2) { super(), this.type = "ArrowHelper", Ac2 === void 0 && (Ac2 = new Je2(), Ac2.setAttribute("position", new We([0, 0, 0, 0, 1, 0], 3)), zh2 = new qr(0, 0.5, 1, 5, 1), zh2.translate(0, -0.5, 0)), this.position.copy(t13), this.line = new Ui2(Ac2, new un2({ color: r, toneMapped: false })), this.line.matrixAutoUpdate = false, this.add(this.line), this.cone = new tn2(zh2, new Vn2({ color: r, toneMapped: false })), this.cone.matrixAutoUpdate = false, this.add(this.cone), this.setDirection(e), this.setLength(i, s, 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 { Av2.set(e.z, 0, -e.x).normalize(); const t13 = Math.acos(e.y); this.quaternion.setFromAxisAngle(Av2, t13); } } setLength(e, t13 = e * 0.2, i = t13 * 0.2) { this.line.scale.set(1, Math.max(1e-4, e - t13), 1), this.line.updateMatrix(), this.cone.scale.set(i, t13, 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, false), this.line.copy(e.line), this.cone.copy(e.cone), this; } }; var xw2 = class extends Fn2 { constructor(e = 1) { const t13 = [ 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 ], r = new Je2(); r.setAttribute("position", new We(t13, 3)), r.setAttribute("color", new We(i, 3)); const s = new un2({ vertexColors: true, toneMapped: false }); super(r, s), this.type = "AxesHelper"; } setColors(e, t13, i) { const r = new Fe(), s = this.geometry.attributes.color.array; return r.set(e), r.toArray(s, 0), r.toArray(s, 3), r.set(t13), r.toArray(s, 6), r.toArray(s, 9), r.set(i), r.toArray(s, 12), r.toArray(s, 15), this.geometry.attributes.color.needsUpdate = true, this; } dispose() { this.geometry.dispose(), this.material.dispose(); } }; var ww2 = new Float32Array(1); var YF = new Int32Array(ww2.buffer); var JF = class { // Converts float32 to float16 (stored as uint16 value). static toHalfFloat(e) { ww2[0] = e; const t13 = YF[0]; let i = t13 >> 16 & 32768, r = t13 >> 12 & 2047; const s = t13 >> 23 & 255; return s < 103 ? i : s > 142 ? (i |= 31744, i |= (s == 255 ? 0 : 1) && t13 & 8388607, i) : s < 113 ? (r |= 2048, i |= (r >> 114 - s) + (r >> 113 - s & 1), i) : (i |= s - 112 << 10 | r >> 1, i += r & 1, i); } }; var Eo2 = 4; var Hr2 = 8; var Ci2 = Math.pow(2, Hr2); var Mw2 = [0.125, 0.215, 0.35, 0.446, 0.526, 0.582]; var Sw2 = Hr2 - Eo2 + 1 + Mw2.length; var mo2 = 20; var Ii2 = { [Dn2]: 0, [Os2]: 1, [Cu2]: 2, [$f2]: 3, [Zf2]: 4, [Xf2]: 5, [Au2]: 6 }; var ms2 = new Vn2({ side: qt2, depthWrite: false, depthTest: false }); var qF = new tn2(new hr2(), ms2); var Uh2 = new fa2(); var { _lodPlanes: La2, _sizeLods: Cv2, _sigmas: Cc2 } = eB(); var Lv2 = new Fe(); var Vh2 = null; var gs2 = (1 + Math.sqrt(5)) / 2; var go = 1 / gs2; var Rv2 = [ new X(1, 1, 1), new X(-1, 1, 1), new X(1, 1, -1), new X(-1, 1, -1), new X(0, gs2, go), new X(0, gs2, -go), new X(go, 0, gs2), new X(-go, 0, gs2), new X(gs2, go, 0), new X(-gs2, go, 0) ]; function Pv2(n) { const e = Math.max(n.r, n.g, n.b), t13 = Math.min(Math.max(Math.ceil(Math.log2(e)), -128), 127); return n.multiplyScalar(Math.pow(2, -t13)), (t13 + 128) / 255; } var KF = class { constructor(e) { this._renderer = e, this._pingPongRenderTarget = null, this._blurMaterial = tB(mo2), 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, t13 = 0, i = 0.1, r = 100) { Vh2 = this._renderer.getRenderTarget(); const s = this._allocateTargets(); return this._sceneToCubeUV(e, i, r, s), t13 > 0 && this._blur(s, 0, 0, t13), this._applyPMREM(s), this._cleanup(s), s; } /** * 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 = Dv2(), 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 = Ov2(), 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 < La2.length; e++) La2[e].dispose(); } // private interface _cleanup(e) { this._pingPongRenderTarget.dispose(), this._renderer.setRenderTarget(Vh2), e.scissorTest = false, Lc(e, 0, 0, e.width, e.height); } _fromTexture(e) { Vh2 = this._renderer.getRenderTarget(); const t13 = this._allocateTargets(e); return this._textureToCubeUV(e, t13), this._applyPMREM(t13), this._cleanup(t13), t13; } _allocateTargets(e) { const t13 = { magFilter: Kt2, minFilter: Kt2, generateMipmaps: false, type: Ps2, format: bb2, encoding: QF(e) ? e.encoding : Cu2, depthBuffer: false }, i = Iv2(t13); return i.depthBuffer = !e, this._pingPongRenderTarget = Iv2(t13), i; } _compileMaterial(e) { const t13 = new tn2(La2[0], e); this._renderer.compile(t13, Uh2); } _sceneToCubeUV(e, t13, i, r) { const a = new an2(90, 1, t13, i), c = [1, -1, 1, 1, 1, 1], l = [1, 1, 1, -1, -1, -1], d = this._renderer, h6 = d.autoClear, p = d.outputEncoding, g = d.toneMapping; d.getClearColor(Lv2), d.toneMapping = Vr2, d.outputEncoding = Dn2, d.autoClear = false; let f = false; const u = e.background; if (u) { if (u.isColor) { ms2.color.copy(u).convertSRGBToLinear(), e.background = null; const y = Pv2(ms2.color); ms2.opacity = y, f = true; } } else { ms2.color.copy(Lv2).convertSRGBToLinear(); const y = Pv2(ms2.color); ms2.opacity = y, f = true; } for (let y = 0; y < 6; y++) { const v = y % 3; v == 0 ? (a.up.set(0, c[y], 0), a.lookAt(l[y], 0, 0)) : v == 1 ? (a.up.set(0, 0, c[y]), a.lookAt(0, l[y], 0)) : (a.up.set(0, c[y], 0), a.lookAt(0, 0, l[y])), Lc( r, v * Ci2, y > 2 ? Ci2 : 0, Ci2, Ci2 ), d.setRenderTarget(r), f && d.render(qF, a), d.render(e, a); } d.toneMapping = g, d.outputEncoding = p, d.autoClear = h6; } _textureToCubeUV(e, t13) { const i = this._renderer; e.isCubeTexture ? this._cubemapShader == null && (this._cubemapShader = Dv2()) : this._equirectShader == null && (this._equirectShader = Ov2()); const r = e.isCubeTexture ? this._cubemapShader : this._equirectShader, s = new tn2(La2[0], r), o = r.uniforms; o.envMap.value = e, e.isCubeTexture || o.texelSize.value.set(1 / e.image.width, 1 / e.image.height), o.inputEncoding.value = Ii2[e.encoding], o.outputEncoding.value = Ii2[t13.texture.encoding], Lc(t13, 0, 0, 3 * Ci2, 2 * Ci2), i.setRenderTarget(t13), i.render(s, Uh2); } _applyPMREM(e) { const t13 = this._renderer, i = t13.autoClear; t13.autoClear = false; for (let r = 1; r < Sw2; r++) { const s = Math.sqrt(Cc2[r] * Cc2[r] - Cc2[r - 1] * Cc2[r - 1]), o = Rv2[(r - 1) % Rv2.length]; this._blur(e, r - 1, r, s, o); } t13.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, t13, i, r, s) { const o = this._pingPongRenderTarget; this._halfBlur( e, o, t13, i, r, "latitudinal", s ), this._halfBlur( o, e, i, i, r, "longitudinal", s ); } _halfBlur(e, t13, i, r, s, o, a) { const c = this._renderer, l = this._blurMaterial; o !== "latitudinal" && o !== "longitudinal" && console.error( "blur direction must be either latitudinal or longitudinal!" ); const d = 3, h6 = new tn2(La2[r], l), p = l.uniforms, g = Cv2[i] - 1, f = isFinite(s) ? Math.PI / (2 * g) : 2 * Math.PI / (2 * mo2 - 1), u = s / f, y = isFinite(s) ? 1 + Math.floor(d * u) : mo2; y > mo2 && console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${mo2}`); const v = []; let m = 0; for (let M = 0; M < mo2; ++M) { const x = M / u, _ = Math.exp(-x * x / 2); v.push(_), M == 0 ? m += _ : M < y && (m += 2 * _); } for (let M = 0; M < v.length; M++) v[M] = v[M] / m; p.envMap.value = e.texture, p.samples.value = y, p.weights.value = v, p.latitudinal.value = o === "latitudinal", a && (p.poleAxis.value = a), p.dTheta.value = f, p.mipInt.value = Hr2 - i, p.inputEncoding.value = Ii2[e.texture.encoding], p.outputEncoding.value = Ii2[e.texture.encoding]; const w = Cv2[r], S = 3 * Math.max(0, Ci2 - 2 * w), T = (r === 0 ? 0 : 2 * Ci2) + 2 * w * (r > Hr2 - Eo2 ? r - Hr2 + Eo2 : 0); Lc(t13, S, T, 3 * w, 2 * w), c.setRenderTarget(t13), c.render(h6, Uh2); } }; function QF(n) { return n === void 0 || n.type !== Ps2 ? false : n.encoding === Dn2 || n.encoding === Os2 || n.encoding === Au2; } function eB() { const n = [], e = [], t13 = []; let i = Hr2; for (let r = 0; r < Sw2; r++) { const s = Math.pow(2, i); e.push(s); let o = 1 / s; r > Hr2 - Eo2 ? o = Mw2[r - Hr2 + Eo2 - 1] : r == 0 && (o = 0), t13.push(o); const a = 1 / (s - 1), c = -a / 2, l = 1 + a / 2, d = [c, c, l, c, l, l, c, c, l, l, c, l], h6 = 6, p = 6, g = 3, f = 2, u = 1, y = new Float32Array(g * p * h6), v = new Float32Array(f * p * h6), m = new Float32Array(u * p * h6); for (let S = 0; S < h6; S++) { const T = S % 3 * 2 / 3 - 1, M = S > 2 ? 0 : -1, x = [ T, M, 0, T + 2 / 3, M, 0, T + 2 / 3, M + 1, 0, T, M, 0, T + 2 / 3, M + 1, 0, T, M + 1, 0 ]; y.set(x, g * p * S), v.set(d, f * p * S); const _ = [S, S, S, S, S, S]; m.set(_, u * p * S); } const w = new Je2(); w.setAttribute("position", new nt(y, g)), w.setAttribute("uv", new nt(v, f)), w.setAttribute("faceIndex", new nt(m, u)), n.push(w), i > Eo2 && i--; } return { _lodPlanes: n, _sizeLods: e, _sigmas: t13 }; } function Iv2(n) { const e = new bi2(3 * Ci2, 3 * Ci2, n); return e.texture.mapping = la2, e.texture.name = "PMREM.cubeUv", e.scissorTest = true, e; } function Lc(n, e, t13, i, r) { n.viewport.set(e, t13, i, r), n.scissor.set(e, t13, i, r); } function tB(n) { const e = new Float32Array(n), t13 = new X(0, 1, 0); return new da2({ name: "SphericalGaussianBlur", defines: { n }, uniforms: { envMap: { value: null }, samples: { value: 1 }, weights: { value: e }, latitudinal: { value: false }, dTheta: { value: 0 }, mipInt: { value: 0 }, poleAxis: { value: t13 }, inputEncoding: { value: Ii2[Dn2] }, outputEncoding: { value: Ii2[Dn2] } }, vertexShader: Np2(), 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; ${Fp2()} #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: or2, depthTest: false, depthWrite: false }); } function Ov2() { const n = new Pe(1, 1); return new da2({ name: "EquirectangularToCubeUV", uniforms: { envMap: { value: null }, texelSize: { value: n }, inputEncoding: { value: Ii2[Dn2] }, outputEncoding: { value: Ii2[Dn2] } }, vertexShader: Np2(), fragmentShader: ( /* glsl */ ` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform sampler2D envMap; uniform vec2 texelSize; ${Fp2()} #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: or2, depthTest: false, depthWrite: false }); } function Dv2() { return new da2({ name: "CubemapToCubeUV", uniforms: { envMap: { value: null }, inputEncoding: { value: Ii2[Dn2] }, outputEncoding: { value: Ii2[Dn2] } }, vertexShader: Np2(), fragmentShader: ( /* glsl */ ` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform samplerCube envMap; ${Fp2()} 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: or2, depthTest: false, depthWrite: false }); } function Np2() { 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 Fp2() { 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 ); } ` ); } var nB = 0; var iB = 1; var rB = 0; var sB = 1; var oB = 2; function aB(n) { return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."), n; } function lB(n = []) { return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."), n.isMultiMaterial = true, n.materials = n, n.clone = function() { return n.slice(); }, n; } function cB(n, e) { return console.warn("THREE.PointCloud has been renamed to THREE.Points."), new ha2(n, e); } function uB(n) { return console.warn("THREE.Particle has been renamed to THREE.Sprite."), new El2(n); } function hB(n, e) { return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."), new ha2(n, e); } function dB(n) { return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."), new ss2(n); } function fB(n) { return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."), new ss2(n); } function pB(n) { return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."), new ss2(n); } function mB(n, e, t13) { return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."), new X(n, e, t13); } function gB(n, e) { return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."), new nt(n, e).setUsage(Uo2); } function vB(n, e) { return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."), new gx2(n, e); } function yB(n, e) { return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."), new vx2(n, e); } function bB(n, e) { return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."), new yx2(n, e); } function xB(n, e) { return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."), new bx2(n, e); } function wB(n, e) { return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."), new Lu2(n, e); } function MB(n, e) { return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."), new xx2(n, e); } function SB(n, e) { return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."), new Ru2(n, e); } function _B(n, e) { return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."), new We(n, e); } function TB(n, e) { return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."), new Mx2(n, e); } Kn2.create = function(n, e) { return console.log("THREE.Curve.create() has been deprecated"), n.prototype = Object.create(Kn2.prototype), n.prototype.constructor = n, n.prototype.getPoint = e, n; }; al2.prototype.fromPoints = function(n) { return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."), this.setFromPoints(n); }; function EB(n) { return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."), new xw2(n); } function AB(n, e) { return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."), new bw2(n, e); } function CB(n, e) { return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."), new Fn2(new ip2(n.geometry), new un2({ color: e !== void 0 ? e : 16777215 })); } yw2.prototype.setColors = function() { console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead."); }; gw2.prototype.update = function() { console.error("THREE.SkeletonHelper: update() no longer needs to be called."); }; function LB(n, e) { return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."), new Fn2(new up2(n.geometry), new un2({ color: e !== void 0 ? e : 16777215 })); } _n2.prototype.extractUrlBase = function(n) { return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."), lr2.extractUrlBase(n); }; _n2.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 RB(n) { return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."), new Qn2(n); } function PB(n) { return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."), new Jx2(n); } pa2.prototype.center = function(n) { return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."), this.getCenter(n); }; pa2.prototype.empty = function() { return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."), this.isEmpty(); }; pa2.prototype.isIntersectionBox = function(n) { return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."), this.intersectsBox(n); }; pa2.prototype.size = function(n) { return console.warn("THREE.Box2: .size() has been renamed to .getSize()."), this.getSize(n); }; Hn2.prototype.center = function(n) { return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."), this.getCenter(n); }; Hn2.prototype.empty = function() { return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."), this.isEmpty(); }; Hn2.prototype.isIntersectionBox = function(n) { return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."), this.intersectsBox(n); }; Hn2.prototype.isIntersectionSphere = function(n) { return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."), this.intersectsSphere(n); }; Hn2.prototype.size = function(n) { return console.warn("THREE.Box3: .size() has been renamed to .getSize()."), this.getSize(n); }; xr.prototype.empty = function() { return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."), this.isEmpty(); }; Ml2.prototype.setFromMatrix = function(n) { return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."), this.setFromProjectionMatrix(n); }; pw2.prototype.center = function(n) { return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."), this.getCenter(n); }; ln2.prototype.flattenToArrayOffset = function(n, e) { return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."), this.toArray(n, e); }; ln2.prototype.multiplyVector3 = function(n) { return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."), n.applyMatrix3(this); }; ln2.prototype.multiplyVector3Array = function() { console.error("THREE.Matrix3: .multiplyVector3Array() has been removed."); }; ln2.prototype.applyToBufferAttribute = function(n) { return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."), n.applyMatrix3(this); }; ln2.prototype.applyToVector3Array = function() { console.error("THREE.Matrix3: .applyToVector3Array() has been removed."); }; ln2.prototype.getInverse = function(n) { return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."), this.copy(n).invert(); }; $e2.prototype.extractPosition = function(n) { return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."), this.copyPosition(n); }; $e2.prototype.flattenToArrayOffset = function(n, e) { return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."), this.toArray(n, e); }; $e2.prototype.getPosition = function() { return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."), new X().setFromMatrixColumn(this, 3); }; $e2.prototype.setRotationFromQuaternion = function(n) { return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."), this.makeRotationFromQuaternion(n); }; $e2.prototype.multiplyToArray = function() { console.warn("THREE.Matrix4: .multiplyToArray() has been removed."); }; $e2.prototype.multiplyVector3 = function(n) { return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."), n.applyMatrix4(this); }; $e2.prototype.multiplyVector4 = function(n) { return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."), n.applyMatrix4(this); }; $e2.prototype.multiplyVector3Array = function() { console.error("THREE.Matrix4: .multiplyVector3Array() has been removed."); }; $e2.prototype.rotateAxis = function(n) { console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."), n.transformDirection(this); }; $e2.prototype.crossVector = function(n) { return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."), n.applyMatrix4(this); }; $e2.prototype.translate = function() { console.error("THREE.Matrix4: .translate() has been removed."); }; $e2.prototype.rotateX = function() { console.error("THREE.Matrix4: .rotateX() has been removed."); }; $e2.prototype.rotateY = function() { console.error("THREE.Matrix4: .rotateY() has been removed."); }; $e2.prototype.rotateZ = function() { console.error("THREE.Matrix4: .rotateZ() has been removed."); }; $e2.prototype.rotateByAxis = function() { console.error("THREE.Matrix4: .rotateByAxis() has been removed."); }; $e2.prototype.applyToBufferAttribute = function(n) { return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."), n.applyMatrix4(this); }; $e2.prototype.applyToVector3Array = function() { console.error("THREE.Matrix4: .applyToVector3Array() has been removed."); }; $e2.prototype.makeFrustum = function(n, e, t13, i, r, s) { return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."), this.makePerspective(n, e, i, t13, r, s); }; $e2.prototype.getInverse = function(n) { return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."), this.copy(n).invert(); }; Li2.prototype.isIntersectionLine = function(n) { return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."), this.intersectsLine(n); }; Sn.prototype.multiplyVector3 = function(n) { return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."), n.applyQuaternion(this); }; Sn.prototype.inverse = function() { return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."), this.invert(); }; is2.prototype.isIntersectionBox = function(n) { return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."), this.intersectsBox(n); }; is2.prototype.isIntersectionPlane = function(n) { return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."), this.intersectsPlane(n); }; is2.prototype.isIntersectionSphere = function(n) { return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."), this.intersectsSphere(n); }; Qt.prototype.area = function() { return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."), this.getArea(); }; Qt.prototype.barycoordFromPoint = function(n, e) { return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."), this.getBarycoord(n, e); }; Qt.prototype.midpoint = function(n) { return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."), this.getMidpoint(n); }; Qt.prototypenormal = function(n) { return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."), this.getNormal(n); }; Qt.prototype.plane = function(n) { return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."), this.getPlane(n); }; Qt.barycoordFromPoint = function(n, e, t13, i, r) { return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."), Qt.getBarycoord(n, e, t13, i, r); }; Qt.normal = function(n, e, t13, i) { return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."), Qt.getNormal(n, e, t13, i); }; Gr.prototype.extractAllPoints = function(n) { return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."), this.extractPoints(n); }; Gr.prototype.extrude = function(n) { return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."), new wi2(this, n); }; Gr.prototype.makeGeometry = function(n) { return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."), new Fs2(this, n); }; Pe.prototype.fromAttribute = function(n, e, t13) { return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."), this.fromBufferAttribute(n, e, t13); }; Pe.prototype.distanceToManhattan = function(n) { return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."), this.manhattanDistanceTo(n); }; Pe.prototype.lengthManhattan = function() { return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."), this.manhattanLength(); }; X.prototype.setEulerFromRotationMatrix = function() { console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead."); }; X.prototype.setEulerFromQuaternion = function() { console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead."); }; X.prototype.getPositionFromMatrix = function(n) { return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."), this.setFromMatrixPosition(n); }; X.prototype.getScaleFromMatrix = function(n) { return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."), this.setFromMatrixScale(n); }; X.prototype.getColumnFromMatrix = function(n, e) { return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."), this.setFromMatrixColumn(e, n); }; X.prototype.applyProjection = function(n) { return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."), this.applyMatrix4(n); }; X.prototype.fromAttribute = function(n, e, t13) { return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."), this.fromBufferAttribute(n, e, t13); }; X.prototype.distanceToManhattan = function(n) { return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."), this.manhattanDistanceTo(n); }; X.prototype.lengthManhattan = function() { return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."), this.manhattanLength(); }; _t2.prototype.fromAttribute = function(n, e, t13) { return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."), this.fromBufferAttribute(n, e, t13); }; _t2.prototype.lengthManhattan = function() { return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."), this.manhattanLength(); }; ot.prototype.getChildByName = function(n) { return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."), this.getObjectByName(n); }; ot.prototype.renderDepth = function() { console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead."); }; ot.prototype.translate = function(n, e) { return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."), this.translateOnAxis(e, n); }; ot.prototype.getWorldRotation = function() { console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead."); }; ot.prototype.applyMatrix = function(n) { return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."), this.applyMatrix4(n); }; Object.defineProperties(ot.prototype, { eulerOrder: { get: function() { return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."), this.rotation.order; }, set: function(n) { console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."), this.rotation.order = n; } }, 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."); } } }); tn2.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(tn2.prototype, { drawMode: { get: function() { return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."), sx2; }, 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."); } } }); Al2.prototype.initBones = function() { console.error("THREE.SkinnedMesh: initBones() has been removed."); }; an2.prototype.setLens = function(n, e) { console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."), e !== void 0 && (this.filmGauge = e), this.setFocalLength(n); }; Object.defineProperties(Mi2.prototype, { onlyShadow: { set: function() { console.warn("THREE.Light: .onlyShadow has been removed."); } }, shadowCameraFov: { set: function(n) { console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."), this.shadow.camera.fov = n; } }, shadowCameraLeft: { set: function(n) { console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."), this.shadow.camera.left = n; } }, shadowCameraRight: { set: function(n) { console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."), this.shadow.camera.right = n; } }, shadowCameraTop: { set: function(n) { console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."), this.shadow.camera.top = n; } }, shadowCameraBottom: { set: function(n) { console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."), this.shadow.camera.bottom = n; } }, shadowCameraNear: { set: function(n) { console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."), this.shadow.camera.near = n; } }, shadowCameraFar: { set: function(n) { console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."), this.shadow.camera.far = n; } }, shadowCameraVisible: { set: function() { console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead."); } }, shadowBias: { set: function(n) { console.warn("THREE.Light: .shadowBias is now .shadow.bias."), this.shadow.bias = n; } }, shadowDarkness: { set: function() { console.warn("THREE.Light: .shadowDarkness has been removed."); } }, shadowMapWidth: { set: function(n) { console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."), this.shadow.mapSize.width = n; } }, shadowMapHeight: { set: function(n) { console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."), this.shadow.mapSize.height = n; } } }); Object.defineProperties(nt.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 === Uo2; }, set: function() { console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."), this.setUsage(Uo2); } } }); nt.prototype.setDynamic = function(n) { return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."), this.setUsage(n === true ? Uo2 : zo2), this; }; nt.prototype.copyIndicesArray = function() { console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed."); }, nt.prototype.setArray = function() { console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers"); }; Je2.prototype.addIndex = function(n) { console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."), this.setIndex(n); }; Je2.prototype.addAttribute = function(n, 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(n, new nt(arguments[1], arguments[2]))) : n === "index" ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."), this.setIndex(e), this) : this.setAttribute(n, e); }; Je2.prototype.addDrawCall = function(n, e, t13) { t13 !== void 0 && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."), console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."), this.addGroup(n, e); }; Je2.prototype.clearDrawCalls = function() { console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."), this.clearGroups(); }; Je2.prototype.computeOffsets = function() { console.warn("THREE.BufferGeometry: .computeOffsets() has been removed."); }; Je2.prototype.removeAttribute = function(n) { return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."), this.deleteAttribute(n); }; Je2.prototype.applyMatrix = function(n) { return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."), this.applyMatrix4(n); }; Object.defineProperties(Je2.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; } } }); rs2.prototype.setDynamic = function(n) { return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."), this.setUsage(n === true ? Uo2 : zo2), this; }; rs2.prototype.setArray = function() { console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers"); }; wi2.prototype.getArrays = function() { console.error("THREE.ExtrudeGeometry: .getArrays() has been removed."); }; wi2.prototype.addShapeList = function() { console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed."); }; wi2.prototype.addShape = function() { console.error("THREE.ExtrudeGeometry: .addShape() has been removed."); }; Nu2.prototype.dispose = function() { console.error("THREE.Scene: .dispose() has been removed."); }; Wu2.prototype.onUpdate = function() { return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."), this; }; Object.defineProperties(sn.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 Fe(); } }, shading: { get: function() { console.error("THREE." + this.type + ": .shading has been removed. Use the boolean .flatShading instead."); }, set: function(n) { console.warn("THREE." + this.type + ": .shading has been removed. Use the boolean .flatShading instead."), this.flatShading = n === kf2; } }, stencilMask: { get: function() { return console.warn("THREE." + this.type + ": .stencilMask has been removed. Use .stencilFuncMask instead."), this.stencilFuncMask; }, set: function(n) { console.warn("THREE." + this.type + ": .stencilMask has been removed. Use .stencilFuncMask instead."), this.stencilFuncMask = n; } } }); Object.defineProperties(dr2.prototype, { derivatives: { get: function() { return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."), this.extensions.derivatives; }, set: function(n) { console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."), this.extensions.derivatives = n; } } }); Et.prototype.clearTarget = function(n, e, t13, i) { console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."), this.setRenderTarget(n), this.clear(e, t13, i); }; Et.prototype.animate = function(n) { console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."), this.setAnimationLoop(n); }; Et.prototype.getCurrentRenderTarget = function() { return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."), this.getRenderTarget(); }; Et.prototype.getMaxAnisotropy = function() { return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."), this.capabilities.getMaxAnisotropy(); }; Et.prototype.getPrecision = function() { return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."), this.capabilities.precision; }; Et.prototype.resetGLState = function() { return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."), this.state.reset(); }; Et.prototype.supportsFloatTextures = function() { return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."), this.extensions.get("OES_texture_float"); }; Et.prototype.supportsHalfFloatTextures = function() { return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."), this.extensions.get("OES_texture_half_float"); }; Et.prototype.supportsStandardDerivatives = function() { return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."), this.extensions.get("OES_standard_derivatives"); }; Et.prototype.supportsCompressedTextureS3TC = function() { return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."), this.extensions.get("WEBGL_compressed_texture_s3tc"); }; Et.prototype.supportsCompressedTexturePVRTC = function() { return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."), this.extensions.get("WEBGL_compressed_texture_pvrtc"); }; Et.prototype.supportsBlendMinMax = function() { return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."), this.extensions.get("EXT_blend_minmax"); }; Et.prototype.supportsVertexTextures = function() { return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."), this.capabilities.vertexTextures; }; Et.prototype.supportsInstancedArrays = function() { return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."), this.extensions.get("ANGLE_instanced_arrays"); }; Et.prototype.enableScissorTest = function(n) { console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."), this.setScissorTest(n); }; Et.prototype.initMaterial = function() { console.warn("THREE.WebGLRenderer: .initMaterial() has been removed."); }; Et.prototype.addPrePlugin = function() { console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed."); }; Et.prototype.addPostPlugin = function() { console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed."); }; Et.prototype.updateShadowMap = function() { console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed."); }; Et.prototype.setFaceCulling = function() { console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed."); }; Et.prototype.allocTextureUnit = function() { console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed."); }; Et.prototype.setTexture = function() { console.warn("THREE.WebGLRenderer: .setTexture() has been removed."); }; Et.prototype.setTexture2D = function() { console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed."); }; Et.prototype.setTextureCube = function() { console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed."); }; Et.prototype.getActiveMipMapLevel = function() { return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."), this.getActiveMipmapLevel(); }; Object.defineProperties(Et.prototype, { shadowMapEnabled: { get: function() { return this.shadowMap.enabled; }, set: function(n) { console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."), this.shadowMap.enabled = n; } }, shadowMapType: { get: function() { return this.shadowMap.type; }, set: function(n) { console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."), this.shadowMap.type = n; } }, 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."), false; }, 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."), false; }, set: function(n) { console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."), this.outputEncoding = n === true ? Os2 : Dn2; } }, 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(Ox2.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 IB(n, e, t13) { return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."), new Iu2(n, t13); } Object.defineProperties(bi2.prototype, { wrapS: { get: function() { return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."), this.texture.wrapS; }, set: function(n) { console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."), this.texture.wrapS = n; } }, wrapT: { get: function() { return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."), this.texture.wrapT; }, set: function(n) { console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."), this.texture.wrapT = n; } }, magFilter: { get: function() { return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."), this.texture.magFilter; }, set: function(n) { console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."), this.texture.magFilter = n; } }, minFilter: { get: function() { return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."), this.texture.minFilter; }, set: function(n) { console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."), this.texture.minFilter = n; } }, anisotropy: { get: function() { return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."), this.texture.anisotropy; }, set: function(n) { console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."), this.texture.anisotropy = n; } }, offset: { get: function() { return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."), this.texture.offset; }, set: function(n) { console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."), this.texture.offset = n; } }, repeat: { get: function() { return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."), this.texture.repeat; }, set: function(n) { console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."), this.texture.repeat = n; } }, format: { get: function() { return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."), this.texture.format; }, set: function(n) { console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."), this.texture.format = n; } }, type: { get: function() { return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."), this.texture.type; }, set: function(n) { console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."), this.texture.type = n; } }, generateMipmaps: { get: function() { return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."), this.texture.generateMipmaps; }, set: function(n) { console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."), this.texture.generateMipmaps = n; } } }); Ip2.prototype.load = function(n) { console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead."); const e = this; return new rw2().load(n, function(i) { e.setBuffer(i); }), this; }; lw2.prototype.getData = function() { return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."), this.getFrequencyData(); }; Pu2.prototype.updateCubeMap = function(n, e) { return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."), this.update(n, e); }; Pu2.prototype.clear = function(n, e, t13, i) { return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."), this.renderTarget.clear(n, e, t13, i); }; Hs2.crossOrigin = void 0; Hs2.loadTexture = function(n, e, t13, i) { console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead."); const r = new wp2(); r.setCrossOrigin(this.crossOrigin); const s = r.load(n, t13, void 0, i); return e && (s.mapping = e), s; }; Hs2.loadTextureCube = function(n, e, t13, i) { console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead."); const r = new Yx2(); r.setCrossOrigin(this.crossOrigin); const s = r.load(n, t13, void 0, i); return e && (s.mapping = e), s; }; Hs2.loadCompressedTexture = function() { console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead."); }; Hs2.loadCompressedTextureCube = function() { console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead."); }; function OB() { console.error("THREE.CanvasRenderer has been removed"); } function DB() { console.error("THREE.JSONLoader has been removed."); } var NB = { 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 FB() { 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: Uf2 } })); typeof window < "u" && (window.__THREE__ ? console.warn("WARNING: Multiple instances of Three.js being imported.") : window.__THREE__ = Uf2); var BB = Object.freeze(Object.defineProperty({ __proto__: null, ACESFilmicToneMapping: lb2, AddEquation: ys, AddOperation: rb2, AdditiveAnimationBlendMode: Wf2, AdditiveBlending: bd2, AlphaFormat: gb2, AlwaysDepth: qy2, AlwaysStencilFunc: hx2, AmbientLight: _p2, AmbientLightProbe: ow2, AnimationClip: Qo2, AnimationLoader: pF2, AnimationMixer: hw2, AnimationObjectGroup: uw2, AnimationUtils: It2, ArcCurve: rp2, ArrayCamera: ep2, ArrowHelper: XF, Audio: Ip2, AudioAnalyser: lw2, AudioContext: Pp2, AudioListener: SF2, AudioLoader: rw2, AxesHelper: xw2, AxisHelper: EB, BackSide: qt2, BasicDepthPacking: lx2, BasicShadowMap: CP2, BinaryTextureLoader: PB, Bone: Cl2, BooleanKeyframeTrack: $s2, BoundingBoxHelper: AB, Box2: pa2, Box3: Hn2, Box3Helper: $F2, BoxBufferGeometry: hr2, BoxGeometry: hr2, BoxHelper: bw2, BufferAttribute: nt, BufferGeometry: Je2, BufferGeometryLoader: nw2, ByteType: ub2, Cache: zs2, Camera: wl2, CameraHelper: jF, CanvasRenderer: OB, CanvasTexture: Ux2, CatmullRomCurve3: op2, CineonToneMapping: ab2, CircleBufferGeometry: ko2, CircleGeometry: ko2, ClampToEdgeWrapping: mn2, Clock: aw2, Color: Fe, ColorKeyframeTrack: bp2, CompressedTexture: np2, CompressedTextureLoader: mF2, ConeBufferGeometry: Go2, ConeGeometry: Go2, CubeCamera: Pu2, CubeReflectionMapping: yl, CubeRefractionMapping: bl2, CubeTexture: ca2, CubeTextureLoader: Yx2, CubeUVReflectionMapping: la2, CubeUVRefractionMapping: xl2, CubicBezierCurve: Bu2, CubicBezierCurve3: ap2, CubicInterpolant: jx2, CullFaceBack: yd2, CullFaceFront: Fy2, CullFaceFrontBack: AP2, CullFaceNone: Ny2, Curve: Kn2, CurvePath: qx2, CustomBlending: zy2, CustomToneMapping: cb2, CylinderBufferGeometry: qr, CylinderGeometry: qr, Cylindrical: zF2, DataTexture: Cs2, DataTexture2DArray: Kf2, DataTexture3D: Qf2, DataTextureLoader: Jx2, DataUtils: JF, DecrementStencilOp: BP2, DecrementWrapStencilOp: UP2, DefaultLoadingManager: Xx2, DepthFormat: Es2, DepthStencilFormat: Fo2, DepthTexture: Vx2, DirectionalLight: Hu2, DirectionalLightHelper: WF, DiscreteInterpolant: $x2, DodecahedronBufferGeometry: Ho2, DodecahedronGeometry: Ho2, DoubleSide: Yr2, DstAlphaFactor: jy2, DstColorFactor: Zy2, DynamicBufferAttribute: gB, DynamicCopyUsage: QP2, DynamicDrawUsage: Uo2, DynamicReadUsage: JP2, EdgesGeometry: ip2, EdgesHelper: CB, EllipseCurve: Rl2, EqualDepth: Qy2, EqualStencilFunc: HP2, EquirectangularReflectionMapping: Qc2, EquirectangularRefractionMapping: eu2, Euler: Ws2, EventDispatcher: ns2, ExtrudeBufferGeometry: wi2, ExtrudeGeometry: wi2, FaceColors: sB, FileLoader: Qn2, FlatShading: kf2, Float16BufferAttribute: wx2, Float32Attribute: _B, Float32BufferAttribute: We, Float64Attribute: TB, Float64BufferAttribute: Mx2, FloatType: nr2, Fog: _l2, FogExp2: Sl2, Font: Rp2, FontLoader: xF2, FrontSide: Xr2, Frustum: Ml2, GLBufferAttribute: fw2, GLSL1: tI, GLSL3: Dd2, GammaEncoding: Au2, GreaterDepth: tb2, GreaterEqualDepth: eb2, GreaterEqualStencilFunc: ZP2, GreaterStencilFunc: jP2, GridHelper: yw2, Group: Pi2, HalfFloatType: Ts2, HemisphereLight: Mp2, HemisphereLightHelper: GF, HemisphereLightProbe: sw2, IcosahedronBufferGeometry: Wo2, IcosahedronGeometry: Wo2, ImageBitmapLoader: Lp2, ImageLoader: ol2, ImageUtils: Hs2, ImmediateRenderObject: mw2, IncrementStencilOp: FP2, IncrementWrapStencilOp: zP2, InstancedBufferAttribute: Cp2, InstancedBufferGeometry: Ap2, InstancedInterleavedBuffer: dw2, InstancedMesh: tp2, Int16Attribute: xB, Int16BufferAttribute: bx2, Int32Attribute: MB, Int32BufferAttribute: xx2, Int8Attribute: vB, Int8BufferAttribute: gx2, IntType: db2, InterleavedBuffer: rs2, InterleavedBufferAttribute: fr2, Interpolant: ki, InterpolateDiscrete: Bo, InterpolateLinear: Is2, InterpolateSmooth: Vc2, InvertStencilOp: VP2, JSONLoader: DB, KeepStencilOp: kc2, KeyframeTrack: Ti2, LOD: Bx2, LatheBufferGeometry: jo2, LatheGeometry: jo2, Layers: qf2, LensFlare: FB, LessDepth: Ky2, LessEqualDepth: Kc2, LessEqualStencilFunc: WP2, LessStencilFunc: GP2, Light: Mi2, LightProbe: Ol2, Line: Ui2, Line3: pw2, LineBasicMaterial: un2, LineCurve: Pl2, LineCurve3: kx2, LineDashedMaterial: vp2, LineLoop: Fu2, LinePieces: iB, LineSegments: Fn2, LineStrip: nB, LinearEncoding: Dn2, LinearFilter: jt, LinearInterpolant: yp2, LinearMipMapLinearFilter: OP2, LinearMipMapNearestFilter: IP2, LinearMipmapLinearFilter: br2, LinearMipmapNearestFilter: Tu2, LinearToneMapping: sb2, Loader: _n2, LoaderUtils: lr2, LoadingManager: xp2, LogLuvEncoding: ax2, LoopOnce: nx2, LoopPingPong: rx2, LoopRepeat: ix2, LuminanceAlphaFormat: yb2, LuminanceFormat: vb2, MOUSE: TP2, Material: sn, MaterialLoader: tw2, Math: Fd2, MathUtils: Fd2, Matrix3: ln2, Matrix4: $e2, MaxEquation: Sd2, Mesh: tn2, MeshBasicMaterial: Vn2, MeshDepthMaterial: Ou2, MeshDistanceMaterial: Du2, MeshFaceMaterial: aB, MeshLambertMaterial: mp2, MeshMatcapMaterial: gp2, MeshNormalMaterial: pp2, MeshPhongMaterial: dp2, MeshPhysicalMaterial: Il2, MeshStandardMaterial: js2, MeshToonMaterial: fp2, MinEquation: Md2, MirroredRepeatWrapping: No2, MixOperation: ib2, MultiMaterial: lB, MultiplyBlending: wd2, MultiplyOperation: vl2, NearestFilter: Kt2, NearestMipMapLinearFilter: PP2, NearestMipMapNearestFilter: RP2, NearestMipmapLinearFilter: Qa2, NearestMipmapNearestFilter: Ka2, NeverDepth: Jy2, NeverStencilFunc: kP2, NoBlending: or2, NoColors: rB, NoToneMapping: Vr2, NormalAnimationBlendMode: Eu2, NormalBlending: _o2, NotEqualDepth: nb2, NotEqualStencilFunc: $P2, NumberKeyframeTrack: qo2, Object3D: ot, ObjectLoader: gF2, ObjectSpaceNormalMap: ux2, OctahedronBufferGeometry: Ns2, OctahedronGeometry: Ns2, OneFactor: Gy2, OneMinusDstAlphaFactor: $y2, OneMinusDstColorFactor: Xy2, OneMinusSrcAlphaFactor: Hf2, OneMinusSrcColorFactor: Wy2, OrthographicCamera: fa2, PCFShadowMap: Vf2, PCFSoftShadowMap: By2, PMREMGenerator: KF, ParametricBufferGeometry: tu2, ParametricGeometry: tu2, Particle: uB, ParticleBasicMaterial: fB, ParticleSystem: hB, ParticleSystemMaterial: pB, Path: al2, PerspectiveCamera: an2, Plane: Li2, PlaneBufferGeometry: Ds2, PlaneGeometry: Ds2, PlaneHelper: ZF, PointCloud: cB, PointCloudMaterial: dB, PointLight: Gu2, PointLightHelper: VF, Points: ha2, PointsMaterial: ss2, PolarGridHelper: HF, PolyhedronBufferGeometry: Vi2, PolyhedronGeometry: Vi2, PositionalAudio: TF2, PropertyBinding: ft2, PropertyMixer: cw2, QuadraticBezierCurve: zu2, QuadraticBezierCurve3: lp2, Quaternion: Sn, QuaternionKeyframeTrack: Zs2, QuaternionLinearInterpolant: Zx2, REVISION: Uf2, RGBADepthPacking: cx2, RGBAFormat: Yn2, RGBAIntegerFormat: Tb2, RGBA_ASTC_10x10_Format: zb2, RGBA_ASTC_10x5_Format: Nb2, RGBA_ASTC_10x6_Format: Fb2, RGBA_ASTC_10x8_Format: Bb2, RGBA_ASTC_12x10_Format: Ub2, RGBA_ASTC_12x12_Format: Vb2, RGBA_ASTC_4x4_Format: Ab2, RGBA_ASTC_5x4_Format: Cb2, RGBA_ASTC_5x5_Format: Lb2, RGBA_ASTC_6x5_Format: Rb2, RGBA_ASTC_6x6_Format: Pb2, RGBA_ASTC_8x5_Format: Ib2, RGBA_ASTC_8x6_Format: Ob2, RGBA_ASTC_8x8_Format: Db2, RGBA_BPTC_Format: kb2, RGBA_ETC2_EAC_Format: Od2, RGBA_PVRTC_2BPPV1_Format: Pd2, RGBA_PVRTC_4BPPV1_Format: Rd2, RGBA_S3TC_DXT1_Format: Td2, RGBA_S3TC_DXT3_Format: Ed2, RGBA_S3TC_DXT5_Format: Ad2, RGBDEncoding: Xf2, RGBEEncoding: Cu2, RGBEFormat: bb2, RGBFormat: ar2, RGBIntegerFormat: _b2, RGBM16Encoding: Zf2, RGBM7Encoding: $f2, RGB_ETC1_Format: Eb2, RGB_ETC2_Format: Id2, RGB_PVRTC_2BPPV1_Format: Ld2, RGB_PVRTC_4BPPV1_Format: Cd2, RGB_S3TC_DXT1_Format: _d2, RGFormat: Mb2, RGIntegerFormat: Sb2, RawShaderMaterial: da2, Ray: is2, Raycaster: FF, RectAreaLight: Tp2, RedFormat: xb2, RedIntegerFormat: wb2, ReinhardToneMapping: ob2, RepeatWrapping: Jr, ReplaceStencilOp: NP2, ReverseSubtractEquation: Vy2, RingBufferGeometry: $o2, RingGeometry: $o2, SRGB8_ALPHA8_ASTC_10x10_Format: Qb2, SRGB8_ALPHA8_ASTC_10x5_Format: Jb2, SRGB8_ALPHA8_ASTC_10x6_Format: qb2, SRGB8_ALPHA8_ASTC_10x8_Format: Kb2, SRGB8_ALPHA8_ASTC_12x10_Format: ex2, SRGB8_ALPHA8_ASTC_12x12_Format: tx2, SRGB8_ALPHA8_ASTC_4x4_Format: Gb2, SRGB8_ALPHA8_ASTC_5x4_Format: Hb2, SRGB8_ALPHA8_ASTC_5x5_Format: Wb2, SRGB8_ALPHA8_ASTC_6x5_Format: jb2, SRGB8_ALPHA8_ASTC_6x6_Format: $b2, SRGB8_ALPHA8_ASTC_8x5_Format: Zb2, SRGB8_ALPHA8_ASTC_8x6_Format: Xb2, SRGB8_ALPHA8_ASTC_8x8_Format: Yb2, Scene: Nu2, SceneUtils: NB, ShaderChunk: ct2, ShaderLib: gi2, ShaderMaterial: dr2, ShadowMaterial: hp2, Shape: Gr, ShapeBufferGeometry: Fs2, ShapeGeometry: Fs2, ShapePath: iw2, ShapeUtils: Fi2, ShortType: hb2, Skeleton: Ll2, SkeletonHelper: gw2, SkinnedMesh: Al2, SmoothShading: LP2, Sphere: xr, SphereBufferGeometry: Bs2, SphereGeometry: Bs2, Spherical: BF2, SphericalHarmonics3: Ep2, SplineCurve: Uu2, SpotLight: ku2, SpotLightHelper: UF, Sprite: El2, SpriteMaterial: Tl2, SrcAlphaFactor: Gf2, SrcAlphaSaturateFactor: Yy2, SrcColorFactor: Hy2, StaticCopyUsage: KP2, StaticDrawUsage: zo2, StaticReadUsage: YP2, StereoCamera: wF2, StreamCopyUsage: eI, StreamDrawUsage: XP2, StreamReadUsage: qP2, StringKeyframeTrack: Xs2, SubtractEquation: Uy2, SubtractiveBlending: xd2, TOUCH: EP2, TangentSpaceNormalMap: ts2, TetrahedronBufferGeometry: Zo2, TetrahedronGeometry: Zo2, TextBufferGeometry: nu2, TextGeometry: nu2, Texture: nn2, TextureLoader: wp2, TorusBufferGeometry: Xo2, TorusGeometry: Xo2, TorusKnotBufferGeometry: Yo2, TorusKnotGeometry: Yo2, Triangle: Qt, TriangleFanDrawMode: jf2, TriangleStripDrawMode: ox2, TrianglesDrawMode: sx2, TubeBufferGeometry: Jo2, TubeGeometry: Jo2, UVMapping: _u2, Uint16Attribute: wB, Uint16BufferAttribute: Lu2, Uint32Attribute: SB, Uint32BufferAttribute: Ru2, Uint8Attribute: yB, Uint8BufferAttribute: vx2, Uint8ClampedAttribute: bB, Uint8ClampedBufferAttribute: yx2, Uniform: Wu2, UniformsLib: ze2, UniformsUtils: _x2, UnsignedByteType: Ps2, UnsignedInt248Type: To2, UnsignedIntType: Va2, UnsignedShort4444Type: fb2, UnsignedShort5551Type: pb2, UnsignedShort565Type: mb2, UnsignedShortType: el2, VSMShadowMap: wo2, Vector2: Pe, Vector3: X, Vector4: _t2, VectorKeyframeTrack: Ko2, Vertex: mB, VertexColors: oB, VideoTexture: zx2, WebGL1Renderer: Nx2, WebGLCubeRenderTarget: Iu2, WebGLMultipleRenderTargets: px2, WebGLMultisampleRenderTarget: Jf2, WebGLRenderTarget: bi2, WebGLRenderTargetCube: IB, WebGLRenderer: Et, WebGLUtils: Dx2, WireframeGeometry: up2, WireframeHelper: LB, WrapAroundEnding: tl2, XHRLoader: RB, ZeroCurvatureEnding: xs2, ZeroFactor: ky2, ZeroSlopeEnding: ws2, ZeroStencilOp: DP2, sRGBEncoding: Os2 }, Symbol.toStringTag, { value: "Module" })); var zB = xu2(BB); function UB(n, e) { if (!(n instanceof e)) throw new TypeError("Cannot call a class as a function"); } function VB(n, e) { for (var t13 = 0; t13 < e.length; t13++) { var i = e[t13]; i.enumerable = i.enumerable || false, i.configurable = true, "value" in i && (i.writable = true), Object.defineProperty(n, i.key, i); } } function kB(n, e, t13) { return e && VB(n.prototype, e), n; } function GB(n, e) { if (typeof e != "function" && e !== null) throw new TypeError("Super expression must either be null or a function"); n.prototype = Object.create(e && e.prototype, { constructor: { value: n, writable: true, configurable: true } }), e && Gd2(n, e); } function iu2(n) { return iu2 = Object.setPrototypeOf ? Object.getPrototypeOf : function(t13) { return t13.__proto__ || Object.getPrototypeOf(t13); }, iu2(n); } function Gd2(n, e) { return Gd2 = Object.setPrototypeOf || function(i, r) { return i.__proto__ = r, i; }, Gd2(n, e); } function HB() { if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return false; if (typeof Proxy == "function") return true; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })), true; } catch { return false; } } function WB(n) { if (n === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return n; } function jB(n, e) { return e && (typeof e == "object" || typeof e == "function") ? e : WB(n); } function $B(n) { var e = HB(); return function() { var i = iu2(n), r; if (e) { var s = iu2(this).constructor; r = Reflect.construct(i, arguments, s); } else r = i.apply(this, arguments); return jB(this, r); }; } function Nv2(n, e) { return XB(n) || JB(n, e) || _w2(n, e) || KB(); } function Rc2(n) { return ZB(n) || YB(n) || _w2(n) || qB(); } function ZB(n) { if (Array.isArray(n)) return Hd2(n); } function XB(n) { if (Array.isArray(n)) return n; } function YB(n) { if (typeof Symbol < "u" && n[Symbol.iterator] != null || n["@@iterator"] != null) return Array.from(n); } function JB(n, e) { var t13 = n && (typeof Symbol < "u" && n[Symbol.iterator] || n["@@iterator"]); if (t13 != null) { var i = [], r = true, s = false, o, a; try { for (t13 = t13.call(n); !(r = (o = t13.next()).done) && (i.push(o.value), !(e && i.length === e)); r = true) ; } catch (c) { s = true, a = c; } finally { try { !r && t13.return != null && t13.return(); } finally { if (s) throw a; } } return i; } } function _w2(n, e) { if (n) { if (typeof n == "string") return Hd2(n, e); var t13 = Object.prototype.toString.call(n).slice(8, -1); if (t13 === "Object" && n.constructor && (t13 = n.constructor.name), t13 === "Map" || t13 === "Set") return Array.from(n); if (t13 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t13)) return Hd2(n, e); } } function Hd2(n, e) { (e == null || e > n.length) && (e = n.length); for (var t13 = 0, i = new Array(e); t13 < e; t13++) i[t13] = n[t13]; return i; } function qB() { 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 KB() { 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 Ra2 = typeof window < "u" && window.THREE ? window.THREE : { LinearFilter: jt, Sprite: El2, SpriteMaterial: Tl2, Texture: nn2 }; var QB = function(n) { GB(t13, n); var e = $B(t13); function t13() { var i, r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", s = 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 UB(this, t13), i = e.call(this, new Ra2.SpriteMaterial({ map: new Ra2.Texture() })), i._text = "".concat(r), i._textHeight = s, i._color = o, i._backgroundColor = false, 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 = Ra2.LinearFilter, i._genCanvas(), i; } return kB(t13, [{ key: "text", get: function() { return this._text; }, set: function(r) { this._text = r, this._genCanvas(); } }, { key: "textHeight", get: function() { return this._textHeight; }, set: function(r) { this._textHeight = r, this._genCanvas(); } }, { key: "color", get: function() { return this._color; }, set: function(r) { this._color = r, this._genCanvas(); } }, { key: "backgroundColor", get: function() { return this._backgroundColor; }, set: function(r) { this._backgroundColor = r, this._genCanvas(); } }, { key: "padding", get: function() { return this._padding; }, set: function(r) { this._padding = r, this._genCanvas(); } }, { key: "borderWidth", get: function() { return this._borderWidth; }, set: function(r) { this._borderWidth = r, this._genCanvas(); } }, { key: "borderRadius", get: function() { return this._borderRadius; }, set: function(r) { this._borderRadius = r, this._genCanvas(); } }, { key: "borderColor", get: function() { return this._borderColor; }, set: function(r) { this._borderColor = r, this._genCanvas(); } }, { key: "fontFace", get: function() { return this._fontFace; }, set: function(r) { this._fontFace = r, this._genCanvas(); } }, { key: "fontSize", get: function() { return this._fontSize; }, set: function(r) { this._fontSize = r, this._genCanvas(); } }, { key: "fontWeight", get: function() { return this._fontWeight; }, set: function(r) { this._fontWeight = r, this._genCanvas(); } }, { key: "strokeWidth", get: function() { return this._strokeWidth; }, set: function(r) { this._strokeWidth = r, this._genCanvas(); } }, { key: "strokeColor", get: function() { return this._strokeColor; }, set: function(r) { this._strokeColor = r, this._genCanvas(); } }, { key: "_genCanvas", value: function() { var r = this, s = this._canvas, o = s.getContext("2d"), a = Array.isArray(this.borderWidth) ? this.borderWidth : [this.borderWidth, this.borderWidth], c = a.map(function(x) { return x * r.fontSize * 0.1; }), l = Array.isArray(this.borderRadius) ? this.borderRadius : [this.borderRadius, this.borderRadius, this.borderRadius, this.borderRadius], d = l.map(function(x) { return x * r.fontSize * 0.1; }), h6 = Array.isArray(this.padding) ? this.padding : [this.padding, this.padding], p = h6.map(function(x) { return x * r.fontSize * 0.1; }), g = this.text.split(` `), f = "".concat(this.fontWeight, " ").concat(this.fontSize, "px ").concat(this.fontFace); o.font = f; var u = Math.max.apply(Math, Rc2(g.map(function(x) { return o.measureText(x).width; }))), y = this.fontSize * g.length; if (s.width = u + c[0] * 2 + p[0] * 2, s.height = y + c[1] * 2 + p[1] * 2, this.borderWidth) { if (o.strokeStyle = this.borderColor, c[0]) { var v = c[0] / 2; o.lineWidth = c[0], o.beginPath(), o.moveTo(v, d[0]), o.lineTo(v, s.height - d[3]), o.moveTo(s.width - v, d[1]), o.lineTo(s.width - v, s.height - d[2]), o.stroke(); } if (c[1]) { var m = c[1] / 2; o.lineWidth = c[1], o.beginPath(), o.moveTo(Math.max(c[0], d[0]), m), o.lineTo(s.width - Math.max(c[0], d[1]), m), o.moveTo(Math.max(c[0], d[3]), s.height - m), o.lineTo(s.width - Math.max(c[0], d[2]), s.height - m), o.stroke(); } if (this.borderRadius) { var w = Math.max.apply(Math, Rc2(c)), S = w / 2; o.lineWidth = w, o.beginPath(), [!!d[0] && [d[0], S, S, d[0]], !!d[1] && [s.width - d[1], s.width - S, S, d[1]], !!d[2] && [s.width - d[2], s.width - S, s.height - S, s.height - d[2]], !!d[3] && [d[3], S, s.height - S, s.height - d[3]]].filter(function(x) { return x; }).forEach(function(x) { var _ = Nv2(x, 4), E = _[0], L = _[1], R = _[2], C = _[3]; o.moveTo(E, R), o.quadraticCurveTo(L, R, L, C); }), o.stroke(); } } this.backgroundColor && (o.fillStyle = this.backgroundColor, this.borderRadius ? (o.beginPath(), o.moveTo(c[0], d[0]), [ [c[0], d[0], s.width - d[1], c[1], c[1], c[1]], // t [s.width - c[0], s.width - c[0], s.width - c[0], c[1], d[1], s.height - d[2]], // r [s.width - c[0], s.width - d[2], d[3], s.height - c[1], s.height - c[1], s.height - c[1]], // b [c[0], c[0], c[0], s.height - c[1], s.height - d[3], d[0]] // t ].forEach(function(x) { var _ = Nv2(x, 6), E = _[0], L = _[1], R = _[2], C = _[3], A = _[4], P = _[5]; o.quadraticCurveTo(E, C, L, A), o.lineTo(R, P); }), o.closePath(), o.fill()) : o.fillRect(c[0], c[1], s.width - c[0] * 2, s.height - c[1] * 2)), o.translate.apply(o, Rc2(c)), o.translate.apply(o, Rc2(p)), o.font = f, o.fillStyle = this.color, o.textBaseline = "bottom"; var T = this.strokeWidth > 0; T && (o.lineWidth = this.strokeWidth * this.fontSize / 10, o.strokeStyle = this.strokeColor), g.forEach(function(x, _) { var E = (u - o.measureText(x).width) / 2, L = (_ + 1) * r.fontSize; T && o.strokeText(x, E, L), o.fillText(x, E, L); }), this._texture.image = s, this._texture.needsUpdate = true; var M = this.textHeight * g.length + a[1] * 2 + h6[1] * 2; this.scale.set(M * s.width / s.height, M, 0); } }, { key: "clone", value: function() { return new this.constructor(this.text, this.textHeight, this.color).copy(this); } }, { key: "copy", value: function(r) { return Ra2.Sprite.prototype.copy.call(this, r), this.color = r.color, this.backgroundColor = r.backgroundColor, this.padding = r.padding, this.borderWidth = r.borderWidth, this.borderColor = r.borderColor, this.fontFace = r.fontFace, this.fontSize = r.fontSize, this.fontWeight = r.fontWeight, this.strokeWidth = r.strokeWidth, this.strokeColor = r.strokeColor, this; } }]), t13; }(Ra2.Sprite); var ez = Object.freeze(Object.defineProperty({ __proto__: null, default: QB }, Symbol.toStringTag, { value: "Module" })); var tz = xu2(ez); var kh2 = { exports: {} }; var Fv2; function nz() { return Fv2 || (Fv2 = 1, function(n, e) { (function(t13, i) { n.exports = i(); })(typeof window < "u" ? window : Fr2, function() { if (typeof window > "u") return null; var t13 = typeof window < "u" && window.Math == Math ? window : typeof self < "u" && self.Math == Math ? self : Function("return this")(), i = t13.requestAnimationFrame || t13.mozRequestAnimationFrame || t13.webkitRequestAnimationFrame || function(d) { return t13.setTimeout(d, 20); }, r = t13.cancelAnimationFrame || t13.mozCancelAnimationFrame || t13.webkitCancelAnimationFrame || function(d) { t13.clearTimeout(d); }; function s(d, h6) { var p = Object.prototype.toString.call(d), g = p === "[object Array]" || p === "[object NodeList]" || p === "[object HTMLCollection]" || p === "[object Object]" || typeof jQuery < "u" && d instanceof jQuery || typeof Elements < "u" && d instanceof Elements, f = 0, u = d.length; if (g) for (; f < u; f++) h6(d[f]); else h6(d); } function o(d) { if (!d.getBoundingClientRect) return { width: d.offsetWidth, height: d.offsetHeight }; var h6 = d.getBoundingClientRect(); return { width: Math.round(h6.width), height: Math.round(h6.height) }; } function a(d, h6) { Object.keys(h6).forEach(function(p) { d.style[p] = h6[p]; }); } var c = function(d, h6) { var p = 0; function g() { var u = []; this.add = function(m) { u.push(m); }; var y, v; this.call = function(m) { for (y = 0, v = u.length; y < v; y++) u[y].call(this, m); }, this.remove = function(m) { var w = []; for (y = 0, v = u.length; y < v; y++) u[y] !== m && w.push(u[y]); u = w; }, this.length = function() { return u.length; }; } function f(u, y) { if (u) { if (u.resizedAttached) { u.resizedAttached.add(y); return; } u.resizedAttached = new g(), u.resizedAttached.add(y), u.resizeSensor = document.createElement("div"), u.resizeSensor.dir = "ltr", u.resizeSensor.className = "resize-sensor"; var v = { pointerEvents: "none", position: "absolute", left: "0px", top: "0px", right: "0px", bottom: "0px", overflow: "hidden", zIndex: "-1", visibility: "hidden", maxWidth: "100%" }, m = { position: "absolute", left: "0px", top: "0px", transition: "0s" }; a(u.resizeSensor, v); var w = document.createElement("div"); w.className = "resize-sensor-expand", a(w, v); var S = document.createElement("div"); a(S, m), w.appendChild(S); var T = document.createElement("div"); T.className = "resize-sensor-shrink", a(T, v); var M = document.createElement("div"); a(M, m), a(M, { width: "200%", height: "200%" }), T.appendChild(M), u.resizeSensor.appendChild(w), u.resizeSensor.appendChild(T), u.appendChild(u.resizeSensor); var x = window.getComputedStyle(u), _ = x ? x.getPropertyValue("position") : null; _ !== "absolute" && _ !== "relative" && _ !== "fixed" && _ !== "sticky" && (u.style.position = "relative"); var E = false, L = 0, R = o(u), C = 0, A = 0, P = true; p = 0; var I = function() { var B = u.offsetWidth, U = u.offsetHeight; S.style.width = B + 10 + "px", S.style.height = U + 10 + "px", w.scrollLeft = B + 10, w.scrollTop = U + 10, T.scrollLeft = B + 10, T.scrollTop = U + 10; }, b = function() { if (P) { var B = u.offsetWidth === 0 && u.offsetHeight === 0; if (B) { p || (p = i(function() { p = 0, b(); })); return; } else P = false; } I(); }; u.resizeSensor.resetSensor = b; var O = function() { L = 0, E && (C = R.width, A = R.height, u.resizedAttached && u.resizedAttached.call(R)); }, N = function() { R = o(u), E = R.width !== C || R.height !== A, E && !L && (L = i(O)), b(); }, D = function(B, U, k) { B.attachEvent ? B.attachEvent("on" + U, k) : B.addEventListener(U, k); }; D(w, "scroll", N), D(T, "scroll", N), p = i(function() { p = 0, b(); }); } } s(d, function(u) { f(u, h6); }), this.detach = function(u) { p || (r(p), p = 0), c.detach(d, u); }, this.reset = function() { d.resizeSensor.resetSensor(); }; }; if (c.reset = function(d) { s(d, function(h6) { h6.resizeSensor.resetSensor(); }); }, c.detach = function(d, h6) { s(d, function(p) { p && (p.resizedAttached && typeof h6 == "function" && (p.resizedAttached.remove(h6), p.resizedAttached.length()) || p.resizeSensor && (p.contains(p.resizeSensor) && p.removeChild(p.resizeSensor), delete p.resizeSensor, delete p.resizedAttached)); }); }, typeof MutationObserver < "u") { var l = new MutationObserver(function(d) { for (var h6 in d) if (d.hasOwnProperty(h6)) for (var p = d[h6].addedNodes, g = 0; g < p.length; g++) p[g].resizeSensor && c.reset(p[g]); }); document.addEventListener("DOMContentLoaded", function(d) { l.observe(document.body, { childList: true, subtree: true }); }); } return c; }); }(kh2)), kh2.exports; } var iz = class extends _n2 { constructor(e) { super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(t13) { return new az(t13); }), this.register(function(t13) { return new cz(t13); }), this.register(function(t13) { return new uz(t13); }), this.register(function(t13) { return new lz(t13); }), this.register(function(t13) { return new sz(t13); }), this.register(function(t13) { return new hz(t13); }); } load(e, t13, i, r) { const s = this; let o; this.resourcePath !== "" ? o = this.resourcePath : this.path !== "" ? o = this.path : o = lr2.extractUrlBase(e), this.manager.itemStart(e); const a = function(l) { r ? r(l) : console.error(l), s.manager.itemError(e), s.manager.itemEnd(e); }, c = new Qn2(this.manager); c.setPath(this.path), c.setResponseType("arraybuffer"), c.setRequestHeader(this.requestHeader), c.setWithCredentials(this.withCredentials), c.load(e, function(l) { try { s.parse(l, o, function(d) { t13(d), s.manager.itemEnd(e); }, a); } catch (d) { a(d); } }, i, a); } 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, t13, i, r) { let s; const o = {}, a = {}; if (typeof e == "string") s = e; else if (lr2.decodeText(new Uint8Array(e, 0, 4)) === Tw2) { try { o[vt2.KHR_BINARY_GLTF] = new dz(e); } catch (h6) { r && r(h6); return; } s = o[vt2.KHR_BINARY_GLTF].content; } else s = lr2.decodeText(new Uint8Array(e)); const c = JSON.parse(s); if (c.asset === void 0 || c.asset.version[0] < 2) { r && r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")); return; } const l = new Mz(c, { path: t13 || this.resourcePath || "", crossOrigin: this.crossOrigin, requestHeader: this.requestHeader, manager: this.manager, ktx2Loader: this.ktx2Loader, meshoptDecoder: this.meshoptDecoder }); l.fileLoader.setRequestHeader(this.requestHeader); for (let d = 0; d < this.pluginCallbacks.length; d++) { const h6 = this.pluginCallbacks[d](l); a[h6.name] = h6, o[h6.name] = true; } if (c.extensionsUsed) for (let d = 0; d < c.extensionsUsed.length; ++d) { const h6 = c.extensionsUsed[d], p = c.extensionsRequired || []; switch (h6) { case vt2.KHR_MATERIALS_UNLIT: o[h6] = new oz(); break; case vt2.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS: o[h6] = new mz(); break; case vt2.KHR_DRACO_MESH_COMPRESSION: o[h6] = new fz(c, this.dracoLoader); break; case vt2.KHR_TEXTURE_TRANSFORM: o[h6] = new pz(); break; case vt2.KHR_MESH_QUANTIZATION: o[h6] = new gz(); break; default: p.indexOf(h6) >= 0 && a[h6] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + h6 + '".'); } } l.setExtensions(o), l.setPlugins(a), l.parse(i, r); } }; function rz() { let n = {}; return { get: function(e) { return n[e]; }, add: function(e, t13) { n[e] = t13; }, remove: function(e) { delete n[e]; }, removeAll: function() { n = {}; } }; } var vt2 = { 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" }; var sz = class { constructor(e) { this.parser = e, this.name = vt2.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} }; } _markDefs() { const e = this.parser, t13 = this.parser.json.nodes || []; for (let i = 0, r = t13.length; i < r; i++) { const s = t13[i]; s.extensions && s.extensions[this.name] && s.extensions[this.name].light !== void 0 && e._addNodeRef(this.cache, s.extensions[this.name].light); } } _loadLight(e) { const t13 = this.parser, i = "light:" + e; let r = t13.cache.get(i); if (r) return r; const s = t13.json, c = ((s.extensions && s.extensions[this.name] || {}).lights || [])[e]; let l; const d = new Fe(16777215); c.color !== void 0 && d.fromArray(c.color); const h6 = c.range !== void 0 ? c.range : 0; switch (c.type) { case "directional": l = new Hu2(d), l.target.position.set(0, 0, -1), l.add(l.target); break; case "point": l = new Gu2(d), l.distance = h6; break; case "spot": l = new ku2(d), l.distance = h6, c.spot = c.spot || {}, c.spot.innerConeAngle = c.spot.innerConeAngle !== void 0 ? c.spot.innerConeAngle : 0, c.spot.outerConeAngle = c.spot.outerConeAngle !== void 0 ? c.spot.outerConeAngle : Math.PI / 4, l.angle = c.spot.outerConeAngle, l.penumbra = 1 - c.spot.innerConeAngle / c.spot.outerConeAngle, l.target.position.set(0, 0, -1), l.add(l.target); break; default: throw new Error("THREE.GLTFLoader: Unexpected light type: " + c.type); } return l.position.set(0, 0, 0), l.decay = 2, c.intensity !== void 0 && (l.intensity = c.intensity), l.name = t13.createUniqueName(c.name || "light_" + e), r = Promise.resolve(l), t13.cache.add(i, r), r; } createNodeAttachment(e) { const t13 = this, i = this.parser, s = i.json.nodes[e], a = (s.extensions && s.extensions[this.name] || {}).light; return a === void 0 ? null : this._loadLight(a).then(function(c) { return i._getNodeRef(t13.cache, a, c); }); } }; var oz = class { constructor() { this.name = vt2.KHR_MATERIALS_UNLIT; } getMaterialType() { return Vn2; } extendParams(e, t13, i) { const r = []; e.color = new Fe(1, 1, 1), e.opacity = 1; const s = t13.pbrMetallicRoughness; if (s) { if (Array.isArray(s.baseColorFactor)) { const o = s.baseColorFactor; e.color.fromArray(o), e.opacity = o[3]; } s.baseColorTexture !== void 0 && r.push(i.assignTexture(e, "map", s.baseColorTexture)); } return Promise.all(r); } }; var az = class { constructor(e) { this.parser = e, this.name = vt2.KHR_MATERIALS_CLEARCOAT; } getMaterialType(e) { const i = this.parser.json.materials[e]; return !i.extensions || !i.extensions[this.name] ? null : Il2; } extendMaterialParams(e, t13) { const i = this.parser, r = i.json.materials[e]; if (!r.extensions || !r.extensions[this.name]) return Promise.resolve(); const s = [], o = r.extensions[this.name]; if (o.clearcoatFactor !== void 0 && (t13.clearcoat = o.clearcoatFactor), o.clearcoatTexture !== void 0 && s.push(i.assignTexture(t13, "clearcoatMap", o.clearcoatTexture)), o.clearcoatRoughnessFactor !== void 0 && (t13.clearcoatRoughness = o.clearcoatRoughnessFactor), o.clearcoatRoughnessTexture !== void 0 && s.push(i.assignTexture(t13, "clearcoatRoughnessMap", o.clearcoatRoughnessTexture)), o.clearcoatNormalTexture !== void 0 && (s.push(i.assignTexture(t13, "clearcoatNormalMap", o.clearcoatNormalTexture)), o.clearcoatNormalTexture.scale !== void 0)) { const a = o.clearcoatNormalTexture.scale; t13.clearcoatNormalScale = new Pe(a, -a); } return Promise.all(s); } }; var lz = class { constructor(e) { this.parser = e, this.name = vt2.KHR_MATERIALS_TRANSMISSION; } getMaterialType(e) { const i = this.parser.json.materials[e]; return !i.extensions || !i.extensions[this.name] ? null : Il2; } extendMaterialParams(e, t13) { const i = this.parser, r = i.json.materials[e]; if (!r.extensions || !r.extensions[this.name]) return Promise.resolve(); const s = [], o = r.extensions[this.name]; return o.transmissionFactor !== void 0 && (t13.transmission = o.transmissionFactor), o.transmissionTexture !== void 0 && s.push(i.assignTexture(t13, "transmissionMap", o.transmissionTexture)), Promise.all(s); } }; var cz = class { constructor(e) { this.parser = e, this.name = vt2.KHR_TEXTURE_BASISU; } loadTexture(e) { const t13 = this.parser, i = t13.json, r = i.textures[e]; if (!r.extensions || !r.extensions[this.name]) return null; const s = r.extensions[this.name], o = i.images[s.source], a = t13.options.ktx2Loader; if (!a) { 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 t13.loadTextureImage(e, o, a); } }; var uz = class { constructor(e) { this.parser = e, this.name = vt2.EXT_TEXTURE_WEBP, this.isSupported = null; } loadTexture(e) { const t13 = this.name, i = this.parser, r = i.json, s = r.textures[e]; if (!s.extensions || !s.extensions[t13]) return null; const o = s.extensions[t13], a = r.images[o.source]; let c = i.textureLoader; if (a.uri) { const l = i.options.manager.getHandler(a.uri); l !== null && (c = l); } return this.detectSupport().then(function(l) { if (l) return i.loadTextureImage(e, a, c); if (r.extensionsRequired && r.extensionsRequired.indexOf(t13) >= 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 t13 = new Image(); t13.src = "data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA", t13.onload = t13.onerror = function() { e(t13.height === 1); }; })), this.isSupported; } }; var hz = class { constructor(e) { this.name = vt2.EXT_MESHOPT_COMPRESSION, this.parser = e; } loadBufferView(e) { const t13 = this.parser.json, i = t13.bufferViews[e]; if (i.extensions && i.extensions[this.name]) { const r = i.extensions[this.name], s = this.parser.getDependency("buffer", r.buffer), o = this.parser.options.meshoptDecoder; if (!o || !o.supported) { if (t13.extensionsRequired && t13.extensionsRequired.indexOf(this.name) >= 0) throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files"); return null; } return Promise.all([s, o.ready]).then(function(a) { const c = r.byteOffset || 0, l = r.byteLength || 0, d = r.count, h6 = r.byteStride, p = new ArrayBuffer(d * h6), g = new Uint8Array(a[0], c, l); return o.decodeGltfBuffer(new Uint8Array(p), d, h6, g, r.mode, r.filter), p; }); } else return null; } }; var Tw2 = "glTF"; var Pa2 = 12; var Bv2 = { JSON: 1313821514, BIN: 5130562 }; var dz = class { constructor(e) { this.name = vt2.KHR_BINARY_GLTF, this.content = null, this.body = null; const t13 = new DataView(e, 0, Pa2); if (this.header = { magic: lr2.decodeText(new Uint8Array(e.slice(0, 4))), version: t13.getUint32(4, true), length: t13.getUint32(8, true) }, this.header.magic !== Tw2) 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 - Pa2, r = new DataView(e, Pa2); let s = 0; for (; s < i; ) { const o = r.getUint32(s, true); s += 4; const a = r.getUint32(s, true); if (s += 4, a === Bv2.JSON) { const c = new Uint8Array(e, Pa2 + s, o); this.content = lr2.decodeText(c); } else if (a === Bv2.BIN) { const c = Pa2 + s; this.body = e.slice(c, c + o); } s += o; } if (this.content === null) throw new Error("THREE.GLTFLoader: JSON content not found."); } }; var fz = class { constructor(e, t13) { if (!t13) throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided."); this.name = vt2.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = t13, this.dracoLoader.preload(); } decodePrimitive(e, t13) { const i = this.json, r = this.dracoLoader, s = e.extensions[this.name].bufferView, o = e.extensions[this.name].attributes, a = {}, c = {}, l = {}; for (const d in o) { const h6 = jd2[d] || d.toLowerCase(); a[h6] = o[d]; } for (const d in e.attributes) { const h6 = jd2[d] || d.toLowerCase(); if (o[d] !== void 0) { const p = i.accessors[e.attributes[d]], g = ll2[p.componentType]; l[h6] = g, c[h6] = p.normalized === true; } } return t13.getDependency("bufferView", s).then(function(d) { return new Promise(function(h6) { r.decodeDracoFile(d, function(p) { for (const g in p.attributes) { const f = p.attributes[g], u = c[g]; u !== void 0 && (f.normalized = u); } h6(p); }, a, l); }); }); } }; var pz = class { constructor() { this.name = vt2.KHR_TEXTURE_TRANSFORM; } extendTexture(e, t13) { return t13.texCoord !== void 0 && console.warn('THREE.GLTFLoader: Custom UV sets in "' + this.name + '" extension not yet supported.'), t13.offset === void 0 && t13.rotation === void 0 && t13.scale === void 0 || (e = e.clone(), t13.offset !== void 0 && e.offset.fromArray(t13.offset), t13.rotation !== void 0 && (e.rotation = t13.rotation), t13.scale !== void 0 && e.repeat.fromArray(t13.scale), e.needsUpdate = true), e; } }; var Wd2 = class extends js2 { constructor(e) { super(), this.isGLTFSpecularGlossinessMaterial = true; const t13 = [ "#ifdef USE_SPECULARMAP", " uniform sampler2D specularMap;", "#endif" ].join(` `), i = [ "#ifdef USE_GLOSSINESSMAP", " uniform sampler2D glossinessMap;", "#endif" ].join(` `), r = [ "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(` `), s = [ "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(` `), a = { specular: { value: new Fe().setHex(16777215) }, glossiness: { value: 1 }, specularMap: { value: null }, glossinessMap: { value: null } }; this._extraUniforms = a, this.onBeforeCompile = function(c) { for (const l in a) c.uniforms[l] = a[l]; c.fragmentShader = c.fragmentShader.replace("uniform float roughness;", "uniform vec3 specular;").replace("uniform float metalness;", "uniform float glossiness;").replace("#include ", t13).replace("#include ", i).replace("#include ", r).replace("#include ", s).replace("#include ", o); }, Object.defineProperties(this, { specular: { get: function() { return a.specular.value; }, set: function(c) { a.specular.value = c; } }, specularMap: { get: function() { return a.specularMap.value; }, set: function(c) { a.specularMap.value = c, c ? this.defines.USE_SPECULARMAP = "" : delete this.defines.USE_SPECULARMAP; } }, glossiness: { get: function() { return a.glossiness.value; }, set: function(c) { a.glossiness.value = c; } }, glossinessMap: { get: function() { return a.glossinessMap.value; }, set: function(c) { a.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; } }; var mz = class { constructor() { this.name = vt2.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 Wd2; } extendParams(e, t13, i) { const r = t13.extensions[this.name]; e.color = new Fe(1, 1, 1), e.opacity = 1; const s = []; if (Array.isArray(r.diffuseFactor)) { const o = r.diffuseFactor; e.color.fromArray(o), e.opacity = o[3]; } if (r.diffuseTexture !== void 0 && s.push(i.assignTexture(e, "map", r.diffuseTexture)), e.emissive = new Fe(0, 0, 0), e.glossiness = r.glossinessFactor !== void 0 ? r.glossinessFactor : 1, e.specular = new Fe(1, 1, 1), Array.isArray(r.specularFactor) && e.specular.fromArray(r.specularFactor), r.specularGlossinessTexture !== void 0) { const o = r.specularGlossinessTexture; s.push(i.assignTexture(e, "glossinessMap", o)), s.push(i.assignTexture(e, "specularMap", o)); } return Promise.all(s); } createMaterial(e) { const t13 = new Wd2(e); return t13.fog = true, t13.color = e.color, t13.map = e.map === void 0 ? null : e.map, t13.lightMap = null, t13.lightMapIntensity = 1, t13.aoMap = e.aoMap === void 0 ? null : e.aoMap, t13.aoMapIntensity = 1, t13.emissive = e.emissive, t13.emissiveIntensity = 1, t13.emissiveMap = e.emissiveMap === void 0 ? null : e.emissiveMap, t13.bumpMap = e.bumpMap === void 0 ? null : e.bumpMap, t13.bumpScale = 1, t13.normalMap = e.normalMap === void 0 ? null : e.normalMap, t13.normalMapType = ts2, e.normalScale && (t13.normalScale = e.normalScale), t13.displacementMap = null, t13.displacementScale = 1, t13.displacementBias = 0, t13.specularMap = e.specularMap === void 0 ? null : e.specularMap, t13.specular = e.specular, t13.glossinessMap = e.glossinessMap === void 0 ? null : e.glossinessMap, t13.glossiness = e.glossiness, t13.alphaMap = null, t13.envMap = e.envMap === void 0 ? null : e.envMap, t13.envMapIntensity = 1, t13.refractionRatio = 0.98, t13; } }; var gz = class { constructor() { this.name = vt2.KHR_MESH_QUANTIZATION; } }; var ea2 = class extends ki { constructor(e, t13, i, r) { super(e, t13, i, r); } copySampleValue_(e) { const t13 = this.resultBuffer, i = this.sampleValues, r = this.valueSize, s = e * r * 3 + r; for (let o = 0; o !== r; o++) t13[o] = i[s + o]; return t13; } }; ea2.prototype.beforeStart_ = ea2.prototype.copySampleValue_; ea2.prototype.afterEnd_ = ea2.prototype.copySampleValue_; ea2.prototype.interpolate_ = function(n, e, t13, i) { const r = this.resultBuffer, s = this.sampleValues, o = this.valueSize, a = o * 2, c = o * 3, l = i - e, d = (t13 - e) / l, h6 = d * d, p = h6 * d, g = n * c, f = g - c, u = -2 * p + 3 * h6, y = p - h6, v = 1 - u, m = y - h6 + d; for (let w = 0; w !== o; w++) { const S = s[f + w + o], T = s[f + w + a] * l, M = s[g + w + o], x = s[g + w] * l; r[w] = v * S + m * T + u * M + y * x; } return r; }; var qi2 = { 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 }; var ll2 = { 5120: Int8Array, 5121: Uint8Array, 5122: Int16Array, 5123: Uint16Array, 5125: Uint32Array, 5126: Float32Array }; var zv2 = { 9728: Kt2, 9729: jt, 9984: Ka2, 9985: Tu2, 9986: Qa2, 9987: br2 }; var Uv2 = { 33071: mn2, 33648: No2, 10497: Jr }; var Vv2 = { SCALAR: 1, VEC2: 2, VEC3: 3, VEC4: 4, MAT2: 4, MAT3: 9, MAT4: 16 }; var jd2 = { POSITION: "position", NORMAL: "normal", TANGENT: "tangent", TEXCOORD_0: "uv", TEXCOORD_1: "uv2", COLOR_0: "color", WEIGHTS_0: "skinWeight", JOINTS_0: "skinIndex" }; var Pr = { scale: "scale", translation: "position", rotation: "quaternion", weights: "morphTargetInfluences" }; var vz = { 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: Is2, STEP: Bo }; var Gh2 = { OPAQUE: "OPAQUE", MASK: "MASK", BLEND: "BLEND" }; function kv2(n, e) { return typeof n != "string" || n === "" ? "" : (/^https?:\/\//i.test(e) && /^\//.test(n) && (e = e.replace(/(^https?:\/\/[^\/]+).*/i, "$1")), /^(https?:)?\/\//i.test(n) || /^data:.*,.*$/i.test(n) || /^blob:.*$/i.test(n) ? n : e + n); } function yz(n) { return n.DefaultMaterial === void 0 && (n.DefaultMaterial = new js2({ color: 16777215, emissive: 0, metalness: 1, roughness: 1, transparent: false, depthTest: true, side: Xr2 })), n.DefaultMaterial; } function Ia2(n, e, t13) { for (const i in t13.extensions) n[i] === void 0 && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[i] = t13.extensions[i]); } function vs2(n, e) { e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(n.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras)); } function bz(n, e, t13) { let i = false, r = false; for (let a = 0, c = e.length; a < c; a++) { const l = e[a]; if (l.POSITION !== void 0 && (i = true), l.NORMAL !== void 0 && (r = true), i && r) break; } if (!i && !r) return Promise.resolve(n); const s = [], o = []; for (let a = 0, c = e.length; a < c; a++) { const l = e[a]; if (i) { const d = l.POSITION !== void 0 ? t13.getDependency("accessor", l.POSITION) : n.attributes.position; s.push(d); } if (r) { const d = l.NORMAL !== void 0 ? t13.getDependency("accessor", l.NORMAL) : n.attributes.normal; o.push(d); } } return Promise.all([ Promise.all(s), Promise.all(o) ]).then(function(a) { const c = a[0], l = a[1]; return i && (n.morphAttributes.position = c), r && (n.morphAttributes.normal = l), n.morphTargetsRelative = true, n; }); } function xz(n, e) { if (n.updateMorphTargets(), e.weights !== void 0) for (let t13 = 0, i = e.weights.length; t13 < i; t13++) n.morphTargetInfluences[t13] = e.weights[t13]; if (e.extras && Array.isArray(e.extras.targetNames)) { const t13 = e.extras.targetNames; if (n.morphTargetInfluences.length === t13.length) { n.morphTargetDictionary = {}; for (let i = 0, r = t13.length; i < r; i++) n.morphTargetDictionary[t13[i]] = i; } else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names."); } } function wz(n) { const e = n.extensions && n.extensions[vt2.KHR_DRACO_MESH_COMPRESSION]; let t13; return e ? t13 = "draco:" + e.bufferView + ":" + e.indices + ":" + Gv2(e.attributes) : t13 = n.indices + ":" + Gv2(n.attributes) + ":" + n.mode, t13; } function Gv2(n) { let e = ""; const t13 = Object.keys(n).sort(); for (let i = 0, r = t13.length; i < r; i++) e += t13[i] + ":" + n[t13[i]] + ";"; return e; } function $d2(n) { switch (n) { 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."); } } var Mz = class { constructor(e = {}, t13 = {}) { this.json = e, this.extensions = {}, this.plugins = {}, this.options = t13, this.cache = new rz(), 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) === false ? this.textureLoader = new Lp2(this.options.manager) : this.textureLoader = new wp2(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new Qn2(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(true); } setExtensions(e) { this.extensions = e; } setPlugins(e) { this.plugins = e; } parse(e, t13) { const i = this, r = this.json, s = 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 a = { scene: o[0][r.scene || 0], scenes: o[0], animations: o[1], cameras: o[2], asset: r.asset, parser: i, userData: {} }; Ia2(s, a, r), vs2(a, r), Promise.all(i._invokeAll(function(c) { return c.afterRoot && c.afterRoot(a); })).then(function() { e(a); }); }).catch(t13); } /** * Marks the special nodes/meshes in json for efficient parse. */ _markDefs() { const e = this.json.nodes || [], t13 = this.json.skins || [], i = this.json.meshes || []; for (let r = 0, s = t13.length; r < s; r++) { const o = t13[r].joints; for (let a = 0, c = o.length; a < c; a++) e[o[a]].isBone = true; } for (let r = 0, s = e.length; r < s; r++) { const o = e[r]; o.mesh !== void 0 && (this._addNodeRef(this.meshCache, o.mesh), o.skin !== void 0 && (i[o.mesh].isSkinnedMesh = true)), 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, t13) { t13 !== void 0 && (e.refs[t13] === void 0 && (e.refs[t13] = e.uses[t13] = 0), e.refs[t13]++); } /** Returns a reference to a shared resource, cloning it if necessary. */ _getNodeRef(e, t13, i) { if (e.refs[t13] <= 1) return i; const r = i.clone(); return r.name += "_instance_" + e.uses[t13]++, r; } _invokeOne(e) { const t13 = Object.values(this.plugins); t13.push(this); for (let i = 0; i < t13.length; i++) { const r = e(t13[i]); if (r) return r; } return null; } _invokeAll(e) { const t13 = Object.values(this.plugins); t13.unshift(this); const i = []; for (let r = 0; r < t13.length; r++) { const s = e(t13[r]); s && i.push(s); } return i; } /** * Requests the specified dependency asynchronously, with caching. * @param {string} type * @param {number} index * @return {Promise} */ getDependency(e, t13) { const i = e + ":" + t13; let r = this.cache.get(i); if (!r) { switch (e) { case "scene": r = this.loadScene(t13); break; case "node": r = this.loadNode(t13); break; case "mesh": r = this._invokeOne(function(s) { return s.loadMesh && s.loadMesh(t13); }); break; case "accessor": r = this.loadAccessor(t13); break; case "bufferView": r = this._invokeOne(function(s) { return s.loadBufferView && s.loadBufferView(t13); }); break; case "buffer": r = this.loadBuffer(t13); break; case "material": r = this._invokeOne(function(s) { return s.loadMaterial && s.loadMaterial(t13); }); break; case "texture": r = this._invokeOne(function(s) { return s.loadTexture && s.loadTexture(t13); }); break; case "skin": r = this.loadSkin(t13); break; case "animation": r = this.loadAnimation(t13); break; case "camera": r = this.loadCamera(t13); break; default: throw new Error("Unknown type: " + e); } this.cache.add(i, r); } return r; } /** * Requests all dependencies of the specified type asynchronously, with caching. * @param {string} type * @return {Promise>} */ getDependencies(e) { let t13 = this.cache.get(e); if (!t13) { const i = this, r = this.json[e + (e === "mesh" ? "es" : "s")] || []; t13 = Promise.all(r.map(function(s, o) { return i.getDependency(e, o); })), this.cache.add(e, t13); } return t13; } /** * 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 t13 = this.json.buffers[e], i = this.fileLoader; if (t13.type && t13.type !== "arraybuffer") throw new Error("THREE.GLTFLoader: " + t13.type + " buffer type is not supported."); if (t13.uri === void 0 && e === 0) return Promise.resolve(this.extensions[vt2.KHR_BINARY_GLTF].body); const r = this.options; return new Promise(function(s, o) { i.load(kv2(t13.uri, r.path), s, void 0, function() { o(new Error('THREE.GLTFLoader: Failed to load buffer "' + t13.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 t13 = this.json.bufferViews[e]; return this.getDependency("buffer", t13.buffer).then(function(i) { const r = t13.byteLength || 0, s = t13.byteOffset || 0; return i.slice(s, s + r); }); } /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#accessors * @param {number} accessorIndex * @return {Promise} */ loadAccessor(e) { const t13 = this, i = this.json, r = this.json.accessors[e]; if (r.bufferView === void 0 && r.sparse === void 0) return Promise.resolve(null); const s = []; return r.bufferView !== void 0 ? s.push(this.getDependency("bufferView", r.bufferView)) : s.push(null), r.sparse !== void 0 && (s.push(this.getDependency("bufferView", r.sparse.indices.bufferView)), s.push(this.getDependency("bufferView", r.sparse.values.bufferView))), Promise.all(s).then(function(o) { const a = o[0], c = Vv2[r.type], l = ll2[r.componentType], d = l.BYTES_PER_ELEMENT, h6 = d * c, p = r.byteOffset || 0, g = r.bufferView !== void 0 ? i.bufferViews[r.bufferView].byteStride : void 0, f = r.normalized === true; let u, y; if (g && g !== h6) { const v = Math.floor(p / g), m = "InterleavedBuffer:" + r.bufferView + ":" + r.componentType + ":" + v + ":" + r.count; let w = t13.cache.get(m); w || (u = new l(a, v * g, r.count * g / d), w = new rs2(u, g / d), t13.cache.add(m, w)), y = new fr2(w, c, p % g / d, f); } else a === null ? u = new l(r.count * c) : u = new l(a, p, r.count * c), y = new nt(u, c, f); if (r.sparse !== void 0) { const v = Vv2.SCALAR, m = ll2[r.sparse.indices.componentType], w = r.sparse.indices.byteOffset || 0, S = r.sparse.values.byteOffset || 0, T = new m(o[1], w, r.sparse.count * v), M = new l(o[2], S, r.sparse.count * c); a !== null && (y = new nt(y.array.slice(), y.itemSize, y.normalized)); for (let x = 0, _ = T.length; x < _; x++) { const E = T[x]; if (y.setX(E, M[x * c]), c >= 2 && y.setY(E, M[x * c + 1]), c >= 3 && y.setZ(E, M[x * c + 2]), c >= 4 && y.setW(E, M[x * 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 t13 = this.json, i = this.options, r = t13.textures[e], s = t13.images[r.source]; let o = this.textureLoader; if (s.uri) { const a = i.manager.getHandler(s.uri); a !== null && (o = a); } return this.loadTextureImage(e, s, o); } loadTextureImage(e, t13, i) { const r = this, s = this.json, o = this.options, a = s.textures[e], c = (t13.uri || t13.bufferView) + ":" + a.sampler; if (this.textureCache[c]) return this.textureCache[c]; const l = self.URL || self.webkitURL; let d = t13.uri || "", h6 = false, p = true; const g = d.search(/\.jpe?g($|\?)/i) > 0 || d.search(/^data\:image\/jpeg/) === 0; if ((t13.mimeType === "image/jpeg" || g) && (p = false), t13.bufferView !== void 0) d = r.getDependency("bufferView", t13.bufferView).then(function(u) { if (t13.mimeType === "image/png") { const v = new DataView(u, 25, 1).getUint8(0, false); p = v === 6 || v === 4 || v === 3; } h6 = true; const y = new Blob([u], { type: t13.mimeType }); return d = l.createObjectURL(y), d; }); else if (t13.uri === void 0) throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView"); const f = Promise.resolve(d).then(function(u) { return new Promise(function(y, v) { let m = y; i.isImageBitmapLoader === true && (m = function(w) { const S = new nn2(w); S.needsUpdate = true, y(S); }), i.load(kv2(u, o.path), m, void 0, v); }); }).then(function(u) { h6 === true && l.revokeObjectURL(d), u.flipY = false, a.name && (u.name = a.name), p || (u.format = ar2); const v = (s.samplers || {})[a.sampler] || {}; return u.magFilter = zv2[v.magFilter] || jt, u.minFilter = zv2[v.minFilter] || br2, u.wrapS = Uv2[v.wrapS] || Jr, u.wrapT = Uv2[v.wrapT] || Jr, r.associations.set(u, { type: "textures", index: e }), u; }).catch(function() { return console.error("THREE.GLTFLoader: Couldn't load texture", d), null; }); return this.textureCache[c] = f, f; } /** * Asynchronously assigns a texture to the given material parameters. * @param {Object} materialParams * @param {string} mapName * @param {Object} mapDef * @return {Promise} */ assignTexture(e, t13, i) { const r = this; return this.getDependency("texture", i.index).then(function(s) { if (i.texCoord !== void 0 && i.texCoord != 0 && !(t13 === "aoMap" && i.texCoord == 1) && console.warn("THREE.GLTFLoader: Custom UV set " + i.texCoord + " for texture " + t13 + " not yet supported."), r.extensions[vt2.KHR_TEXTURE_TRANSFORM]) { const o = i.extensions !== void 0 ? i.extensions[vt2.KHR_TEXTURE_TRANSFORM] : void 0; if (o) { const a = r.associations.get(s); s = r.extensions[vt2.KHR_TEXTURE_TRANSFORM].extendTexture(s, o), r.associations.set(s, a); } } e[t13] = s; }); } /** * 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 t13 = e.geometry; let i = e.material; const r = t13.attributes.tangent !== void 0, s = t13.attributes.color !== void 0, o = t13.attributes.normal === void 0, a = Object.keys(t13.morphAttributes).length > 0, c = a && t13.morphAttributes.normal !== void 0; if (e.isPoints) { const l = "PointsMaterial:" + i.uuid; let d = this.cache.get(l); d || (d = new ss2(), sn.prototype.copy.call(d, i), d.color.copy(i.color), d.map = i.map, d.sizeAttenuation = false, this.cache.add(l, d)), i = d; } else if (e.isLine) { const l = "LineBasicMaterial:" + i.uuid; let d = this.cache.get(l); d || (d = new un2(), sn.prototype.copy.call(d, i), d.color.copy(i.color), this.cache.add(l, d)), i = d; } if (r || s || o || a) { let l = "ClonedMaterial:" + i.uuid + ":"; i.isGLTFSpecularGlossinessMaterial && (l += "specular-glossiness:"), r && (l += "vertex-tangents:"), s && (l += "vertex-colors:"), o && (l += "flat-shading:"), a && (l += "morph-targets:"), c && (l += "morph-normals:"); let d = this.cache.get(l); d || (d = i.clone(), s && (d.vertexColors = true), o && (d.flatShading = true), a && (d.morphTargets = true), c && (d.morphNormals = true), r && (d.vertexTangents = true, d.normalScale && (d.normalScale.y *= -1), d.clearcoatNormalScale && (d.clearcoatNormalScale.y *= -1)), this.cache.add(l, d), this.associations.set(d, this.associations.get(i))), i = d; } i.aoMap && t13.attributes.uv2 === void 0 && t13.attributes.uv !== void 0 && t13.setAttribute("uv2", t13.attributes.uv), e.material = i; } getMaterialType() { return js2; } /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials * @param {number} materialIndex * @return {Promise} */ loadMaterial(e) { const t13 = this, i = this.json, r = this.extensions, s = i.materials[e]; let o; const a = {}, c = s.extensions || {}, l = []; if (c[vt2.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]) { const h6 = r[vt2.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]; o = h6.getMaterialType(), l.push(h6.extendParams(a, s, t13)); } else if (c[vt2.KHR_MATERIALS_UNLIT]) { const h6 = r[vt2.KHR_MATERIALS_UNLIT]; o = h6.getMaterialType(), l.push(h6.extendParams(a, s, t13)); } else { const h6 = s.pbrMetallicRoughness || {}; if (a.color = new Fe(1, 1, 1), a.opacity = 1, Array.isArray(h6.baseColorFactor)) { const p = h6.baseColorFactor; a.color.fromArray(p), a.opacity = p[3]; } h6.baseColorTexture !== void 0 && l.push(t13.assignTexture(a, "map", h6.baseColorTexture)), a.metalness = h6.metallicFactor !== void 0 ? h6.metallicFactor : 1, a.roughness = h6.roughnessFactor !== void 0 ? h6.roughnessFactor : 1, h6.metallicRoughnessTexture !== void 0 && (l.push(t13.assignTexture(a, "metalnessMap", h6.metallicRoughnessTexture)), l.push(t13.assignTexture(a, "roughnessMap", h6.metallicRoughnessTexture))), o = this._invokeOne(function(p) { return p.getMaterialType && p.getMaterialType(e); }), l.push(Promise.all(this._invokeAll(function(p) { return p.extendMaterialParams && p.extendMaterialParams(e, a); }))); } s.doubleSided === true && (a.side = Yr2); const d = s.alphaMode || Gh2.OPAQUE; return d === Gh2.BLEND ? (a.transparent = true, a.depthWrite = false) : (a.transparent = false, d === Gh2.MASK && (a.alphaTest = s.alphaCutoff !== void 0 ? s.alphaCutoff : 0.5)), s.normalTexture !== void 0 && o !== Vn2 && (l.push(t13.assignTexture(a, "normalMap", s.normalTexture)), a.normalScale = new Pe(1, -1), s.normalTexture.scale !== void 0 && a.normalScale.set(s.normalTexture.scale, -s.normalTexture.scale)), s.occlusionTexture !== void 0 && o !== Vn2 && (l.push(t13.assignTexture(a, "aoMap", s.occlusionTexture)), s.occlusionTexture.strength !== void 0 && (a.aoMapIntensity = s.occlusionTexture.strength)), s.emissiveFactor !== void 0 && o !== Vn2 && (a.emissive = new Fe().fromArray(s.emissiveFactor)), s.emissiveTexture !== void 0 && o !== Vn2 && l.push(t13.assignTexture(a, "emissiveMap", s.emissiveTexture)), Promise.all(l).then(function() { let h6; return o === Wd2 ? h6 = r[vt2.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(a) : h6 = new o(a), s.name && (h6.name = s.name), h6.map && (h6.map.encoding = Os2), h6.emissiveMap && (h6.emissiveMap.encoding = Os2), vs2(h6, s), t13.associations.set(h6, { type: "materials", index: e }), s.extensions && Ia2(r, h6, s), h6; }); } /** When Object3D instances are targeted by animation, they need unique names. */ createUniqueName(e) { const t13 = ft2.sanitizeNodeName(e || ""); let i = t13; for (let r = 1; this.nodeNamesUsed[i]; ++r) i = t13 + "_" + r; return this.nodeNamesUsed[i] = true, 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 t13 = this, i = this.extensions, r = this.primitiveCache; function s(a) { return i[vt2.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a, t13).then(function(c) { return Hv2(c, a, t13); }); } const o = []; for (let a = 0, c = e.length; a < c; a++) { const l = e[a], d = wz(l), h6 = r[d]; if (h6) o.push(h6.promise); else { let p; l.extensions && l.extensions[vt2.KHR_DRACO_MESH_COMPRESSION] ? p = s(l) : p = Hv2(new Je2(), l, t13), r[d] = { primitive: l, promise: p }, o.push(p); } } 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 t13 = this, i = this.json, r = this.extensions, s = i.meshes[e], o = s.primitives, a = []; for (let c = 0, l = o.length; c < l; c++) { const d = o[c].material === void 0 ? yz(this.cache) : this.getDependency("material", o[c].material); a.push(d); } return a.push(t13.loadGeometries(o)), Promise.all(a).then(function(c) { const l = c.slice(0, c.length - 1), d = c[c.length - 1], h6 = []; for (let g = 0, f = d.length; g < f; g++) { const u = d[g], y = o[g]; let v; const m = l[g]; if (y.mode === qi2.TRIANGLES || y.mode === qi2.TRIANGLE_STRIP || y.mode === qi2.TRIANGLE_FAN || y.mode === void 0) v = s.isSkinnedMesh === true ? new Al2(u, m) : new tn2(u, m), v.isSkinnedMesh === true && !v.geometry.attributes.skinWeight.normalized && v.normalizeSkinWeights(), y.mode === qi2.TRIANGLE_STRIP ? v.geometry = Wv2(v.geometry, ox2) : y.mode === qi2.TRIANGLE_FAN && (v.geometry = Wv2(v.geometry, jf2)); else if (y.mode === qi2.LINES) v = new Fn2(u, m); else if (y.mode === qi2.LINE_STRIP) v = new Ui2(u, m); else if (y.mode === qi2.LINE_LOOP) v = new Fu2(u, m); else if (y.mode === qi2.POINTS) v = new ha2(u, m); else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + y.mode); Object.keys(v.geometry.morphAttributes).length > 0 && xz(v, s), v.name = t13.createUniqueName(s.name || "mesh_" + e), vs2(v, s), y.extensions && Ia2(r, v, y), t13.assignFinalMaterial(v), h6.push(v); } if (h6.length === 1) return h6[0]; const p = new Pi2(); for (let g = 0, f = h6.length; g < f; g++) p.add(h6[g]); return p; }); } /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#cameras * @param {number} cameraIndex * @return {Promise} */ loadCamera(e) { let t13; const i = this.json.cameras[e], r = i[i.type]; if (!r) { console.warn("THREE.GLTFLoader: Missing camera parameters."); return; } return i.type === "perspective" ? t13 = new an2(Fd2.radToDeg(r.yfov), r.aspectRatio || 1, r.znear || 1, r.zfar || 2e6) : i.type === "orthographic" && (t13 = new fa2(-r.xmag, r.xmag, r.ymag, -r.ymag, r.znear, r.zfar)), i.name && (t13.name = this.createUniqueName(i.name)), vs2(t13, i), Promise.resolve(t13); } /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins * @param {number} skinIndex * @return {Promise} */ loadSkin(e) { const t13 = this.json.skins[e], i = { joints: t13.joints }; return t13.inverseBindMatrices === void 0 ? Promise.resolve(i) : this.getDependency("accessor", t13.inverseBindMatrices).then(function(r) { return i.inverseBindMatrices = r, i; }); } /** * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#animations * @param {number} animationIndex * @return {Promise} */ loadAnimation(e) { const i = this.json.animations[e], r = [], s = [], o = [], a = [], c = []; for (let l = 0, d = i.channels.length; l < d; l++) { const h6 = i.channels[l], p = i.samplers[h6.sampler], g = h6.target, f = g.node !== void 0 ? g.node : g.id, u = i.parameters !== void 0 ? i.parameters[p.input] : p.input, y = i.parameters !== void 0 ? i.parameters[p.output] : p.output; r.push(this.getDependency("node", f)), s.push(this.getDependency("accessor", u)), o.push(this.getDependency("accessor", y)), a.push(p), c.push(g); } return Promise.all([ Promise.all(r), Promise.all(s), Promise.all(o), Promise.all(a), Promise.all(c) ]).then(function(l) { const d = l[0], h6 = l[1], p = l[2], g = l[3], f = l[4], u = []; for (let v = 0, m = d.length; v < m; v++) { const w = d[v], S = h6[v], T = p[v], M = g[v], x = f[v]; if (w === void 0) continue; w.updateMatrix(), w.matrixAutoUpdate = true; let _; switch (Pr[x.path]) { case Pr.weights: _ = qo2; break; case Pr.rotation: _ = Zs2; break; case Pr.position: case Pr.scale: default: _ = Ko2; break; } const E = w.name ? w.name : w.uuid, L = M.interpolation !== void 0 ? vz[M.interpolation] : Is2, R = []; Pr[x.path] === Pr.weights ? w.traverse(function(A) { A.isMesh === true && A.morphTargetInfluences && R.push(A.name ? A.name : A.uuid); }) : R.push(E); let C = T.array; if (T.normalized) { const A = $d2(C.constructor), P = new Float32Array(C.length); for (let I = 0, b = C.length; I < b; I++) P[I] = C[I] * A; C = P; } for (let A = 0, P = R.length; A < P; A++) { const I = new _( R[A] + "." + Pr[x.path], S.array, C, L ); M.interpolation === "CUBICSPLINE" && (I.createInterpolant = function(O) { return new ea2(this.times, this.values, this.getValueSize() / 3, O); }, I.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = true), u.push(I); } } const y = i.name ? i.name : "animation_" + e; return new Qo2(y, void 0, u); }); } createNodeMesh(e) { const t13 = this.json, i = this, r = t13.nodes[e]; return r.mesh === void 0 ? null : i.getDependency("mesh", r.mesh).then(function(s) { const o = i._getNodeRef(i.meshCache, r.mesh, s); return r.weights !== void 0 && o.traverse(function(a) { if (a.isMesh) for (let c = 0, l = r.weights.length; c < l; c++) a.morphTargetInfluences[c] = r.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 t13 = this.json, i = this.extensions, r = this, s = t13.nodes[e], o = s.name ? r.createUniqueName(s.name) : ""; return function() { const a = [], c = r._invokeOne(function(l) { return l.createNodeMesh && l.createNodeMesh(e); }); return c && a.push(c), s.camera !== void 0 && a.push(r.getDependency("camera", s.camera).then(function(l) { return r._getNodeRef(r.cameraCache, s.camera, l); })), r._invokeAll(function(l) { return l.createNodeAttachment && l.createNodeAttachment(e); }).forEach(function(l) { a.push(l); }), Promise.all(a); }().then(function(a) { let c; if (s.isBone === true ? c = new Cl2() : a.length > 1 ? c = new Pi2() : a.length === 1 ? c = a[0] : c = new ot(), c !== a[0]) for (let l = 0, d = a.length; l < d; l++) c.add(a[l]); if (s.name && (c.userData.name = s.name, c.name = o), vs2(c, s), s.extensions && Ia2(i, c, s), s.matrix !== void 0) { const l = new $e2(); l.fromArray(s.matrix), c.applyMatrix4(l); } else s.translation !== void 0 && c.position.fromArray(s.translation), s.rotation !== void 0 && c.quaternion.fromArray(s.rotation), s.scale !== void 0 && c.scale.fromArray(s.scale); return r.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 t13 = this.json, i = this.extensions, r = this.json.scenes[e], s = this, o = new Pi2(); r.name && (o.name = s.createUniqueName(r.name)), vs2(o, r), r.extensions && Ia2(i, o, r); const a = r.nodes || [], c = []; for (let l = 0, d = a.length; l < d; l++) c.push(Ew2(a[l], o, t13, s)); return Promise.all(c).then(function() { return o; }); } }; function Ew2(n, e, t13, i) { const r = t13.nodes[n]; return i.getDependency("node", n).then(function(s) { if (r.skin === void 0) return s; let o; return i.getDependency("skin", r.skin).then(function(a) { o = a; const c = []; for (let l = 0, d = o.joints.length; l < d; l++) c.push(i.getDependency("node", o.joints[l])); return Promise.all(c); }).then(function(a) { return s.traverse(function(c) { if (!c.isMesh) return; const l = [], d = []; for (let h6 = 0, p = a.length; h6 < p; h6++) { const g = a[h6]; if (g) { l.push(g); const f = new $e2(); o.inverseBindMatrices !== void 0 && f.fromArray(o.inverseBindMatrices.array, h6 * 16), d.push(f); } else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', o.joints[h6]); } c.bind(new Ll2(l, d), c.matrixWorld); }), s; }); }).then(function(s) { e.add(s); const o = []; if (r.children) { const a = r.children; for (let c = 0, l = a.length; c < l; c++) { const d = a[c]; o.push(Ew2(d, s, t13, i)); } } return Promise.all(o); }); } function Sz(n, e, t13) { const i = e.attributes, r = new Hn2(); if (i.POSITION !== void 0) { const a = t13.json.accessors[i.POSITION], c = a.min, l = a.max; if (c !== void 0 && l !== void 0) { if (r.set( new X(c[0], c[1], c[2]), new X(l[0], l[1], l[2]) ), a.normalized) { const d = $d2(ll2[a.componentType]); r.min.multiplyScalar(d), r.max.multiplyScalar(d); } } else { console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION."); return; } } else return; const s = e.targets; if (s !== void 0) { const a = new X(), c = new X(); for (let l = 0, d = s.length; l < d; l++) { const h6 = s[l]; if (h6.POSITION !== void 0) { const p = t13.json.accessors[h6.POSITION], g = p.min, f = p.max; if (g !== void 0 && f !== void 0) { if (c.setX(Math.max(Math.abs(g[0]), Math.abs(f[0]))), c.setY(Math.max(Math.abs(g[1]), Math.abs(f[1]))), c.setZ(Math.max(Math.abs(g[2]), Math.abs(f[2]))), p.normalized) { const u = $d2(ll2[p.componentType]); c.multiplyScalar(u); } a.max(c); } else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION."); } } r.expandByVector(a); } n.boundingBox = r; const o = new xr(); r.getCenter(o.center), o.radius = r.min.distanceTo(r.max) / 2, n.boundingSphere = o; } function Hv2(n, e, t13) { const i = e.attributes, r = []; function s(o, a) { return t13.getDependency("accessor", o).then(function(c) { n.setAttribute(a, c); }); } for (const o in i) { const a = jd2[o] || o.toLowerCase(); a in n.attributes || r.push(s(i[o], a)); } if (e.indices !== void 0 && !n.index) { const o = t13.getDependency("accessor", e.indices).then(function(a) { n.setIndex(a); }); r.push(o); } return vs2(n, e), Sz(n, e, t13), Promise.all(r).then(function() { return e.targets !== void 0 ? bz(n, e.targets, t13) : n; }); } function Wv2(n, e) { let t13 = n.getIndex(); if (t13 === null) { const o = [], a = n.getAttribute("position"); if (a !== void 0) { for (let c = 0; c < a.count; c++) o.push(c); n.setIndex(o), t13 = n.getIndex(); } else return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), n; } const i = t13.count - 2, r = []; if (e === jf2) for (let o = 1; o <= i; o++) r.push(t13.getX(0)), r.push(t13.getX(o)), r.push(t13.getX(o + 1)); else for (let o = 0; o < i; o++) o % 2 === 0 ? (r.push(t13.getX(o)), r.push(t13.getX(o + 1)), r.push(t13.getX(o + 2))) : (r.push(t13.getX(o + 2)), r.push(t13.getX(o + 1)), r.push(t13.getX(o))); r.length / 3 !== i && console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles."); const s = n.clone(); return s.setIndex(r), s; } var _z = Object.freeze(Object.defineProperty({ __proto__: null, GLTFLoader: iz }, Symbol.toStringTag, { value: "Module" })); var Tz = xu2(_z); var Hh2 = { exports: {} }; var jv2; function Ez() { return jv2 || (jv2 = 1, function(n) { function e(l) { var d = {}; function h6(g) { if (d[g]) return d[g].exports; var f = d[g] = { /******/ i: g, /******/ l: false, /******/ exports: {} /******/ }; return l[g].call(f.exports, f, f.exports, h6), f.l = true, f.exports; } h6.m = l, h6.c = d, h6.i = function(g) { return g; }, h6.d = function(g, f, u) { h6.o(g, f) || Object.defineProperty(g, f, { /******/ configurable: false, /******/ enumerable: true, /******/ get: u /******/ }); }, h6.r = function(g) { Object.defineProperty(g, "__esModule", { value: true }); }, h6.n = function(g) { var f = g && g.__esModule ? ( /******/ function() { return g.default; } ) : ( /******/ function() { return g; } ); return h6.d(f, "a", f), f; }, h6.o = function(g, f) { return Object.prototype.hasOwnProperty.call(g, f); }, h6.p = "/", h6.oe = function(g) { throw console.error(g), g; }; var p = h6(h6.s = ENTRY_MODULE); return p.default || p; } var t13 = "[\\.|\\-|\\+|\\w|/|@]+", i = "\\(\\s*(/\\*.*?\\*/)?\\s*.*?(" + t13 + ").*?\\)"; function r(l) { return (l + "").replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&"); } function s(l) { return !isNaN(1 * l); } function o(l, d, h6) { var p = {}; p[h6] = []; var g = d.toString(), f = g.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/); if (!f) return p; for (var u = f[1], y = new RegExp("(\\\\n|\\W)" + r(u) + i, "g"), v; v = y.exec(g); ) v[3] !== "dll-reference" && p[h6].push(v[3]); for (y = new RegExp("\\(" + r(u) + '\\("(dll-reference\\s(' + t13 + '))"\\)\\)' + i, "g"); v = y.exec(g); ) l[v[2]] || (p[h6].push(v[1]), l[v[2]] = __webpack_require__(v[1]).m), p[v[2]] = p[v[2]] || [], p[v[2]].push(v[4]); for (var m = Object.keys(p), w = 0; w < m.length; w++) for (var S = 0; S < p[m[w]].length; S++) s(p[m[w]][S]) && (p[m[w]][S] = 1 * p[m[w]][S]); return p; } function a(l) { var d = Object.keys(l); return d.reduce(function(h6, p) { return h6 || l[p].length > 0; }, false); } function c(l, d) { for (var h6 = { main: [d] }, p = { main: [] }, g = { main: {} }; a(h6); ) for (var f = Object.keys(h6), u = 0; u < f.length; u++) { var y = f[u], v = h6[y], m = v.pop(); if (g[y] = g[y] || {}, !(g[y][m] || !l[y][m])) { g[y][m] = true, p[y] = p[y] || [], p[y].push(m); for (var w = o(l, l[y][m], y), S = Object.keys(w), T = 0; T < S.length; T++) h6[S[T]] = h6[S[T]] || [], h6[S[T]] = h6[S[T]].concat(w[S[T]]); } } return p; } n.exports = function(l, d) { d = d || {}; var h6 = { main: __webpack_modules__ }, p = d.all ? { main: Object.keys(h6.main) } : c(h6, l), g = ""; Object.keys(p).filter(function(m) { return m !== "main"; }).forEach(function(m) { for (var w = 0; p[m][w]; ) w++; p[m].push(w), h6[m][w] = "(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })", g = g + "var " + m + " = (" + e.toString().replace("ENTRY_MODULE", JSON.stringify(w)) + ")({" + p[m].map(function(S) { return "" + JSON.stringify(S) + ": " + h6[m][S].toString(); }).join(",") + `}); `; }), g = g + "new ((" + e.toString().replace("ENTRY_MODULE", JSON.stringify(l)) + ")({" + p.main.map(function(m) { return "" + JSON.stringify(m) + ": " + h6.main[m].toString(); }).join(",") + "}))(self);"; var f = new window.Blob([g], { type: "text/javascript" }); if (d.bare) return f; var u = window.URL || window.webkitURL || window.mozURL || window.msURL, y = u.createObjectURL(f), v = new window.Worker(y); return v.objectURL = y, v; }; }(Hh2)), Hh2.exports; } function Az(n) { var e = this.constructor; return this.then( function(t13) { return e.resolve(n()).then(function() { return t13; }); }, function(t13) { return e.resolve(n()).then(function() { return e.reject(t13); }); } ); } function Cz(n) { var e = this; return new e(function(t13, i) { if (!(n && typeof n.length < "u")) return i( new TypeError( typeof n + " " + n + " is not iterable(cannot read property Symbol(Symbol.iterator))" ) ); var r = Array.prototype.slice.call(n); if (r.length === 0) return t13([]); var s = r.length; function o(c, l) { if (l && (typeof l == "object" || typeof l == "function")) { var d = l.then; if (typeof d == "function") { d.call( l, function(h6) { o(c, h6); }, function(h6) { r[c] = { status: "rejected", reason: h6 }, --s === 0 && t13(r); } ); return; } } r[c] = { status: "fulfilled", value: l }, --s === 0 && t13(r); } for (var a = 0; a < r.length; a++) o(a, r[a]); }); } function Aw2(n, e) { this.name = "AggregateError", this.errors = n, this.message = e || ""; } Aw2.prototype = Error.prototype; function Lz(n) { var e = this; return new e(function(t13, i) { if (!(n && typeof n.length < "u")) return i(new TypeError("Promise.any accepts an array")); var r = Array.prototype.slice.call(n); if (r.length === 0) return i(); for (var s = [], o = 0; o < r.length; o++) try { e.resolve(r[o]).then(t13).catch(function(a) { s.push(a), s.length === r.length && i( new Aw2( s, "All promises were rejected" ) ); }); } catch (a) { i(a); } }); } var Rz = setTimeout; function Cw2(n) { return !!(n && typeof n.length < "u"); } function Pz() { } function Iz(n, e) { return function() { n.apply(e, arguments); }; } function Ut2(n) { if (!(this instanceof Ut2)) throw new TypeError("Promises must be constructed via new"); if (typeof n != "function") throw new TypeError("not a function"); this._state = 0, this._handled = false, this._value = void 0, this._deferreds = [], Rw2(n, this); } function Lw2(n, e) { for (; n._state === 3; ) n = n._value; if (n._state === 0) { n._deferreds.push(e); return; } n._handled = true, Ut2._immediateFn(function() { var t13 = n._state === 1 ? e.onFulfilled : e.onRejected; if (t13 === null) { (n._state === 1 ? Zd2 : cl2)(e.promise, n._value); return; } var i; try { i = t13(n._value); } catch (r) { cl2(e.promise, r); return; } Zd2(e.promise, i); }); } function Zd2(n, e) { try { if (e === n) throw new TypeError("A promise cannot be resolved with itself."); if (e && (typeof e == "object" || typeof e == "function")) { var t13 = e.then; if (e instanceof Ut2) { n._state = 3, n._value = e, Xd2(n); return; } else if (typeof t13 == "function") { Rw2(Iz(t13, e), n); return; } } n._state = 1, n._value = e, Xd2(n); } catch (i) { cl2(n, i); } } function cl2(n, e) { n._state = 2, n._value = e, Xd2(n); } function Xd2(n) { n._state === 2 && n._deferreds.length === 0 && Ut2._immediateFn(function() { n._handled || Ut2._unhandledRejectionFn(n._value); }); for (var e = 0, t13 = n._deferreds.length; e < t13; e++) Lw2(n, n._deferreds[e]); n._deferreds = null; } function Oz(n, e, t13) { this.onFulfilled = typeof n == "function" ? n : null, this.onRejected = typeof e == "function" ? e : null, this.promise = t13; } function Rw2(n, e) { var t13 = false; try { n( function(i) { t13 || (t13 = true, Zd2(e, i)); }, function(i) { t13 || (t13 = true, cl2(e, i)); } ); } catch (i) { if (t13) return; t13 = true, cl2(e, i); } } Ut2.prototype.catch = function(n) { return this.then(null, n); }; Ut2.prototype.then = function(n, e) { var t13 = new this.constructor(Pz); return Lw2(this, new Oz(n, e, t13)), t13; }; Ut2.prototype.finally = Az; Ut2.all = function(n) { return new Ut2(function(e, t13) { if (!Cw2(n)) return t13(new TypeError("Promise.all accepts an array")); var i = Array.prototype.slice.call(n); if (i.length === 0) return e([]); var r = i.length; function s(a, c) { try { if (c && (typeof c == "object" || typeof c == "function")) { var l = c.then; if (typeof l == "function") { l.call( c, function(d) { s(a, d); }, t13 ); return; } } i[a] = c, --r === 0 && e(i); } catch (d) { t13(d); } } for (var o = 0; o < i.length; o++) s(o, i[o]); }); }; Ut2.any = Lz; Ut2.allSettled = Cz; Ut2.resolve = function(n) { return n && typeof n == "object" && n.constructor === Ut2 ? n : new Ut2(function(e) { e(n); }); }; Ut2.reject = function(n) { return new Ut2(function(e, t13) { t13(n); }); }; Ut2.race = function(n) { return new Ut2(function(e, t13) { if (!Cw2(n)) return t13(new TypeError("Promise.race accepts an array")); for (var i = 0, r = n.length; i < r; i++) Ut2.resolve(n[i]).then(e, t13); }); }; Ut2._immediateFn = // @ts-ignore typeof setImmediate == "function" && function(n) { setImmediate(n); } || function(n) { Rz(n, 0); }; Ut2._unhandledRejectionFn = function(e) { typeof console < "u" && console && console.warn("Possible Unhandled Promise Rejection:", e); }; var Dz = Object.freeze(Object.defineProperty({ __proto__: null, default: Ut2 }, Symbol.toStringTag, { value: "Module" })); var Nz = xu2(Dz); (function(n, e) { (function(i, r) { n.exports = r(); })(Fr2, () => ( /******/ (() => { var t13 = [ /* 0 */ /***/ (o, a, c) => { c(1); var l = c(2), d = l.version, h6 = function() { this.Revision = d, 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 h6(); }, /* 1 */ /***/ (o) => { o.exports = _P2(); }, /* 2 */ /***/ (o) => { o.exports = 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, a, c) { var l = c(4), d = c(5).toBufferGeometry, h6 = (g, f, u) => { var y = d(g, u), v = false; 1 > u.opacity && (v = true); var m; if (y._video === void 0) { var w = u.localTimeEnabled || u.localMorphColour; f ? (m = f, m.morphTargets = w, m.morphNormals = u.localTimeEnabled) : y instanceof l.BufferGeometry && y.attributes.color === void 0 ? m = new l.MeshPhongMaterial({ color: u.colour, morphTargets: w, morphNormals: u.localTimeEnabled, transparent: v, opacity: u.opacity, side: l.DoubleSide }) : m = new l.MeshPhongMaterial({ color: u.colour, morphTargets: w, morphNormals: u.localTimeEnabled, vertexColors: l.VertexColors, transparent: v, opacity: u.opacity, side: l.DoubleSide }), u.localMorphColour && y.morphAttributes.color && (m.onBeforeCompile = c(9).augmentMorphColor()); } else { var S = y._video.createCanvasVideoTexture(); m = new l.MeshBasicMaterial({ morphTargets: u.localTimeEnabled, color: new l.Color(1, 1, 1), transparent: v, opacity: u.opacity, map: S, side: l.DoubleSide }), this.videoHandler = y._video; } return new l.Mesh(y, m); }, p = function() { c(10).ZincObject.call(this), this.videoHandler = void 0, this.isGeometry = true, this.createMesh = (g, f, u) => { if (!(this.morph && this.morph.geometry && g != null)) { var y = h6(g, f, u); this.setMesh(y, u.localTimeEnabled, u.localMorphColour); } }, this.calculateUVs = () => { this.geometry.computeBoundingBox(); var g = this.geometry.boundingBox.max, f = this.geometry.boundingBox.min, u = new l.Vector2(0 - f.x, 0 - f.y), y = new l.Vector2(g.x - f.x, g.y - f.y); this.geometry.faceVertexUvs[0] = []; for (var v = 0; v < this.geometry.faces.length; v++) { var m = this.geometry.vertices[this.geometry.faces[v].a], w = this.geometry.vertices[this.geometry.faces[v].b], S = this.geometry.vertices[this.geometry.faces[v].c]; geometry.faceVertexUvs[0].push([new l.Vector2((m.x + u.x) / y.x, (m.y + u.y) / y.y), new l.Vector2((w.x + u.x) / y.x, (w.y + u.y) / y.y), new l.Vector2((S.x + u.x) / y.x, (S.y + u.y) / y.y)]); } geometry.uvsNeedUpdate = true; }, this.checkTransparentMesh = function() { this._lod.checkTransparentMesh(); }, this.setWireframe = (g) => { this.morph.material.wireframe = g; }, this.editVertices = function(g, f) { if (g && g.length) { var u = this.getMorph(), y = u.geometry.getAttribute("position"); if (!u || 0 > f) return; var v = 3 * f; g.forEach((m) => { y.array[v++] = m[0], y.array[v++] = m[1], y.array[v++] = m[2]; }), y.needsUpdate = true, u.geometry.computeBoundingBox(), u.geometry.computeBoundingSphere(), this.boundingBoxUpdateRequired = true; } }; }; p.prototype = Object.create(c(10).ZincObject.prototype), a.Geometry = p; }, /* 4 */ /***/ (o) => { o.exports = zB; }, /* 5 */ /***/ (o, a, c) => { function l(x) { throw new TypeError('"' + x + '" is read-only'); } var d = c(4), h6 = c(6).Geometry, p = c(7).default; function g(x) { var _ = x, E = c(0).modelPrefix; return E && (E[E.length - 1] != "/" && l("prefix"), /^(?:[a-z]+:)?\/\//i.test(x) || (_ = E + x)), _; } function f(x, _) { var E = (R, C) => { try { var A = new URL(R, C).href; if (R && 2 > R.split("?").length) { var P = C.split("?"); P.length === 2 && (A = A + "?" + P[1]); } return A; } catch { console.error("There is an issue creting the url link with: ".concat(R, ".")); } }; if (!Array.isArray(x)) return E(x, _); var L = []; return x.forEach((R) => { L.push(E(R, _)); }), L; } function u(x, _, E, L, R) { var C = x.morphTargetInfluences, A = void 0; x.geometry && (A = x.geometry.morphAttributes); var P = false; if (C && A && A.position) { L.set(0, 0, 0), R.set(0, 0, 0); for (var I = 0; I < C.length; I++) 0 < C[I] && (P = true, E.setFromArray(A.position[I].array), L.add(E.min.multiplyScalar(C[I])), R.add(E.max.multiplyScalar(C[I]))); P && _.set(L, R); } P || _.setFromBufferAttribute(x.geometry.attributes.position), x.updateWorldMatrix(true, true), _.applyMatrix4(x.matrixWorld); } function y(x, _, E, L) { var R = new XMLHttpRequest(); R.open("GET", g(x), true), R.onreadystatechange = () => { R.readyState == 4 && (R.status == 200 ? E(R.responseText, _) : L(x)); }, R.send(null); } function v(x, _, E) { function L(I, b) { A[b] = I, C++, C == R && _(A); } for (var R = x.length, C = 0, A = [], P = 0; P < R; P++) y(x[P], P, L, E); } a.getColorsRGB = (x, _) => { var E = Math.floor(_ / 3), L = _ % 3, R = 0; L == 0 ? R = x[E].r : L == 1 ? R = x[E].g : L == 2 && (R = x[E].b); var C = new d.Color(R); return [C.r, C.g, C.b]; }, a.updateMorphColorAttribute = function(x, _) { if (_ && x && x.morphAttributes && x.morphAttributes.color) { var E = x.morphAttributes.color, L = _.morphTargetInfluences, R = L.length; x.deleteAttribute("morphColor0"), x.deleteAttribute("morphColor1"); for (var C = 0, A = [], P = 0; 1 > C || P < R; P++) 0 < L[P] && (C++, A.push([P, L[P]])); A.length == 2 ? (x.setAttribute("morphColor0", E[A[0][0]]), x.setAttribute("morphColor1", E[A[1][0]])) : A.length == 1 && (x.setAttribute("morphColor0", E[A[0][0]]), x.setAttribute("morphColor1", E[A[0][0]])); } }, a.toBufferGeometry = (x, _) => { var E; return x instanceof h6 ? (_.localTimeEnabled && !x.morphNormalsReady && (x.morphNormals == null || x.morphNormals.length == 0) && x.computeMorphNormals(), E = x.toIndexedBufferGeometry(), _.localMorphColour && m(x, E)) : x instanceof d.BufferGeometry && (E = x.clone()), E.colorsNeedUpdate = true, E.computeBoundingBox(), E.computeBoundingSphere(), x._video && (E._video = x._video), E; }, a.copyMorphColorsToBufferGeometry = (x, _) => { if (x && x.morphColors && 0 < x.morphColors.length) { for (var E = [], L = x.morphColors, R = c(5).getColorsRGB, C = 0, A = L.length; C < A; C++) { for (var P = L[C], I = [], b = 0; b < x.faces.length; b++) { var O = x.faces[b], N = R(P.colors, O.a); I.push(N[0], N[1], N[2]), N = R(P.colors, O.b), I.push(N[0], N[1], N[2]), N = R(P.colors, O.c), I.push(N[0], N[1], N[2]); } var D = new d.Float32BufferAttribute(3 * (3 * x.faces.length), 3); D.name = P.name, E.push(D.copyArray(I)); } _.morphAttributes.color = E; } }; var m = (x, _) => { if (x && x.morphColors && 0 < x.morphColors.length) { for (var E = [], L = x.morphColors, R = c(5).getColorsRGB, C = 0, A = L.length; C < A; C++) { for (var P, I = L[C], b = [], O = 0; O < 3 * I.colors.length; O++) P = R(I.colors, O), b.push(P[0], P[1], P[2]); var N = new d.Float32BufferAttribute(b, 3); N.name = I.name, E.push(N); } _.morphAttributes.color = E; } }; a.mergeVertices = function(x) { var _ = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : 1e-4; _ = Math.max(_, Number.EPSILON); for (var E, L = {}, R = x.getIndex(), C = x.getAttribute("position"), A = R ? R.count : C.count, P = 0, I = Object.keys(x.attributes), b = {}, O = {}, le = [], N = ["getX", "getY", "getZ", "getW"], D = 0, B = I.length; D < B; D++) { E = I[D], b[E] = []; var U = x.morphAttributes[E]; U && (O[E] = Array(U.length).fill().map(() => [])); } for (var k = Math.log10(1 / _), K = Math.pow(10, k), D = 0; D < A; D++) { for (var ie = R ? R.getX(D) : D, j = "", G = 0, B = I.length; G < B; G++) for (var E = I[G], W = x.getAttribute(E), q = W.itemSize, Q = 0; Q < q; Q++) j += "".concat(~~(W[N[Q]](ie) * K), ","); if (j in L) le.push(L[j]); else { for (var G = 0, B = I.length; G < B; G++) for (var ee, E = I[G], W = x.getAttribute(E), U = x.morphAttributes[E], q = W.itemSize, ne = b[E], Y = O[E], Q = 0; Q < q; Q++) if (ee = N[Q], ne.push(W[ee](ie)), U) for (var te = 0, F = U.length; te < F; te++) Y[te].push(U[te][ee](ie)); L[j] = P, le.push(P), P++; } } for (var $ = x.clone(), D = 0, B = I.length; D < B; D++) { var W, E = I[D], J = x.getAttribute(E), z = new J.array.constructor(b[E]); if (J.isInterleavedBufferAttribute ? W = new d.BufferAttribute(z, J.itemSize, J.itemSize) : (W = x.getAttribute(E).clone(), W.setArray(z)), $.setAttribute(E, W), E in O) for (var V, G = 0; G < O[E].length; G++) V = x.morphAttributes[E][G].clone(), V.setArray(new V.array.constructor(O[E][G])), $.morphAttributes[E][G] = V; } var oe = Uint8Array; le.length >= Math.pow(2, 8) && (oe = Uint16Array), le.length >= Math.pow(2, 16) && (oe = Uint32Array); var ue = new oe(le), le = null; return R === null ? le = new d.BufferAttribute(ue, 1) : (le = x.getIndex().clone(), le.setArray(ue)), $.setIndex(le), $; }; function w(x) { if (x.isMeshPhongMaterial) { var _ = new d.MeshToonMaterial({ color: x.color.clone(), morphTargets: x.morphTargets, morphNormals: x.morphNormals, vertexColors: x.vertexColors, transparent: x.transparent, opacity: x.opacity, side: x.side }); return x.map && (_.map = x.map), _; } return x; } function S(x, _) { if (_ && x >= _.length) { var E = new d.BufferGeometry(), L = new Float32Array(3 * x), R = 0; return _.forEach((C) => { L[R++] = C[0], L[R++] = C[1], L[R++] = C[2]; }), E.setAttribute("position", new d.BufferAttribute(L, 3)), E.setDrawRange(0, _.length), E; } } function T() { var x = new Image(); x.src = c(8); var _ = new d.Texture(); return _.image = x, _.needsUpdate = true, _; } function M(x, _, E, L, R, C) { var A = new p(x, _, E, L, R, C); return A.fontFace = L, A.fontSize = R, A.fontWeight = C, A.material.map.generateMipmaps = false, A.material.map.anisotropy = 4, A.material.sizeAttenuation = false, A.material.alphaTest = 0.5, A.material.transparent = true, A.material.depthWrite = false, A.material.depthTest = false, A.center.set(0.5, -1.2), A.renderOrder = 1e4, A; } a.getBoundingBox = u, a.createNewURL = f, a.createBufferGeometry = S, a.getCircularTexture = T, a.resolveURL = g, a.loadExternalFile = y, a.loadExternalFiles = v, a.PhongToToon = w, a.createNewSpriteText = M; }, /* 6 */ /***/ (o, a, c) => { c.r(a), c.d(a, { /* harmony export */ Face3: () => ( /* binding */ y ), /* harmony export */ Geometry: () => ( /* binding */ f ) /* harmony export */ }); var l = c(4), d = new l.Matrix4(), h6 = new l.Object3D(), p = new l.Vector3(), g = new l.Vector3(); function f() { 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 = false, this.verticesNeedUpdate = false, this.uvsNeedUpdate = false, this.normalsNeedUpdate = false, this.colorsNeedUpdate = false, this.lineDistancesNeedUpdate = false, this.groupsNeedUpdate = false, this.morphNormalsReady = false; } f.prototype = Object.assign(Object.create(l.EventDispatcher.prototype), { constructor: f, isGeometry: true, applyMatrix4: function(m) { for (var w, S = new l.Matrix3().getNormalMatrix(m), T = 0, M = this.vertices.length; T < M; T++) w = this.vertices[T], w.applyMatrix4(m); for (var x, _ = 0, E = this.faces.length; _ < E; _++) { x = this.faces[_], x.normal.applyMatrix3(S).normalize(); for (var L = 0, R = x.vertexNormals.length; L < R; L++) x.vertexNormals[L].applyMatrix3(S).normalize(); } return this.boundingBox !== null && this.computeBoundingBox(), this.boundingSphere !== null && this.computeBoundingSphere(), this.verticesNeedUpdate = true, this.normalsNeedUpdate = true, this; }, rotateX: function(m) { return d.makeRotationX(m), this.applyMatrix4(d), this; }, rotateY: function(m) { return d.makeRotationY(m), this.applyMatrix4(d), this; }, rotateZ: function(m) { return d.makeRotationZ(m), this.applyMatrix4(d), this; }, translate: function(m, w, S) { return d.makeTranslation(m, w, S), this.applyMatrix4(d), this; }, scale: function(m, w, S) { return d.makeScale(m, w, S), this.applyMatrix4(d), this; }, lookAt: function(m) { return h6.lookAt(m), h6.updateMatrix(), this.applyMatrix4(h6.matrix), this; }, fromBufferGeometry: function(m) { function w(k, K, ie, j) { var G = E === void 0 ? [] : [S.colors[k].clone(), S.colors[K].clone(), S.colors[ie].clone()], W = _ === void 0 ? [] : [new l.Vector3().fromBufferAttribute(_, k), new l.Vector3().fromBufferAttribute(_, K), new l.Vector3().fromBufferAttribute(_, ie)], q = new y(k, K, ie, W, G, j); S.faces.push(q), L !== void 0 && S.faceVertexUvs[0].push([new l.Vector2().fromBufferAttribute(L, k), new l.Vector2().fromBufferAttribute(L, K), new l.Vector2().fromBufferAttribute(L, ie)]), R !== void 0 && S.faceVertexUvs[1].push([new l.Vector2().fromBufferAttribute(R, k), new l.Vector2().fromBufferAttribute(R, K), new l.Vector2().fromBufferAttribute(R, ie)]); } var S = this, T = m.index === null ? void 0 : m.index, M = m.attributes; if (M.position === void 0) return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."), this; var x = M.position, _ = M.normal, E = M.color, L = M.uv, R = M.uv2; R !== void 0 && (this.faceVertexUvs[1] = []); for (var C = 0; C < x.count; C++) S.vertices.push(new l.Vector3().fromBufferAttribute(x, C)), E !== void 0 && S.colors.push(new l.Color().fromBufferAttribute(E, C)); var A = m.groups; if (0 < A.length) for (var P = 0; P < A.length; P++) for (var I = A[P], b = I.start, O = I.count, N = b, D = b + O; N < D; N += 3) T === void 0 ? w(N, N + 1, N + 2, I.materialIndex) : w(T.getX(N), T.getX(N + 1), T.getX(N + 2), I.materialIndex); else if (T !== void 0) for (var B = 0; B < T.count; B += 3) w(T.getX(B), T.getX(B + 1), T.getX(B + 2)); else for (var U = 0; U < x.count; U += 3) w(U, U + 1, U + 2); return this.computeFaceNormals(), m.boundingBox !== null && (this.boundingBox = m.boundingBox.clone()), m.boundingSphere !== null && (this.boundingSphere = m.boundingSphere.clone()), this; }, center: function() { return this.computeBoundingBox(), this.boundingBox.getCenter(p).negate(), this.translate(p.x, p.y, p.z), this; }, normalize: function() { this.computeBoundingSphere(); var m = this.boundingSphere.center, w = this.boundingSphere.radius, S = w === 0 ? 1 : 1 / w, T = new l.Matrix4(); return T.set(S, 0, 0, -S * m.x, 0, S, 0, -S * m.y, 0, 0, S, -S * m.z, 0, 0, 0, 1), this.applyMatrix4(T), this; }, computeFaceNormals: function() { for (var m = new l.Vector3(), w = new l.Vector3(), S = 0, T = this.faces.length; S < T; S++) { var M = this.faces[S], x = this.vertices[M.a], _ = this.vertices[M.b], E = this.vertices[M.c]; m.subVectors(E, _), w.subVectors(x, _), m.cross(w), m.normalize(), M.normal.copy(m); } }, computeVertexNormals: function() { for (var m = !(0 < arguments.length && arguments[0] !== void 0) || arguments[0], w = Array(this.vertices.length), S = 0, T = this.vertices.length; S < T; S++) w[S] = new l.Vector3(); if (m) for (var M = new l.Vector3(), x = new l.Vector3(), _ = 0, E = this.faces.length; _ < E; _++) { var L = this.faces[_], R = this.vertices[L.a], C = this.vertices[L.b], A = this.vertices[L.c]; M.subVectors(A, C), x.subVectors(R, C), M.cross(x), w[L.a].add(M), w[L.b].add(M), w[L.c].add(M); } else { this.computeFaceNormals(); for (var P, I = 0, b = this.faces.length; I < b; I++) P = this.faces[I], w[P.a].add(P.normal), w[P.b].add(P.normal), w[P.c].add(P.normal); } for (var O = 0, N = this.vertices.length; O < N; O++) w[O].normalize(); for (var D = 0, B = this.faces.length; D < B; D++) { var U = this.faces[D], k = U.vertexNormals; k.length === 3 ? (k[0].copy(w[U.a]), k[1].copy(w[U.b]), k[2].copy(w[U.c])) : (k[0] = w[U.a].clone(), k[1] = w[U.b].clone(), k[2] = w[U.c].clone()); } return 0 < this.faces.length && (this.normalsNeedUpdate = true), w; }, computeFlatVertexNormals: function() { this.computeFaceNormals(); for (var m = 0, w = this.faces.length; m < w; m++) { var S = this.faces[m], T = S.vertexNormals; T.length === 3 ? (T[0].copy(S.normal), T[1].copy(S.normal), T[2].copy(S.normal)) : (T[0] = S.normal.clone(), T[1] = S.normal.clone(), T[2] = S.normal.clone()); } 0 < this.faces.length && (this.normalsNeedUpdate = true); }, computeMorphNormals: function() { for (var m, w = 0, S = this.faces.length; w < S; w++) { m = this.faces[w], m.__originalFaceNormal ? m.__originalFaceNormal.copy(m.normal) : m.__originalFaceNormal = m.normal.clone(), m.__originalVertexNormals || (m.__originalVertexNormals = []); for (var T = 0, M = m.vertexNormals.length; T < M; T++) m.__originalVertexNormals[T] ? m.__originalVertexNormals[T].copy(m.vertexNormals[T]) : m.__originalVertexNormals[T] = m.vertexNormals[T].clone(); } var x = new f(); x.faces = this.faces; for (var _ = 0, E = this.morphTargets.length; _ < E; _++) { if (!this.morphNormals[_]) { this.morphNormals[_] = {}, this.morphNormals[_].faceNormals = [], this.morphNormals[_].vertexNormals = []; for (var L = this.morphNormals[_].faceNormals, R = this.morphNormals[_].vertexNormals, C = 0, A = this.faces.length; C < A; C++) { var P = new l.Vector3(), I = { a: new l.Vector3(), b: new l.Vector3(), c: new l.Vector3() }; L.push(P), R.push(I); } } var b = this.morphNormals[_]; x.vertices = this.morphTargets[_].vertices, x.computeFaceNormals(); var O = x.computeVertexNormals(); if (O && 0 < O.length) { this.morphTargets[_].normals = Array(this.vertices.length); for (var N = 0; N < O.length; N++) this.morphTargets[_].normals[N] = O[N].clone(); } for (var D = 0, B = this.faces.length; D < B; D++) { var U = this.faces[D], k = b.faceNormals[D], K = b.vertexNormals[D]; k.copy(U.normal), K.a.copy(U.vertexNormals[0]), K.b.copy(U.vertexNormals[1]), K.c.copy(U.vertexNormals[2]); } } for (var ie, j = 0, G = this.faces.length; j < G; j++) ie = this.faces[j], ie.normal = ie.__originalFaceNormal, ie.vertexNormals = ie.__originalVertexNormals; this.morphNormalsReady = true; }, 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(m, w) { var S = this.morphTargets.length, T = this.morphTargets, M = m.morphTargets, x = this.morphColors.length, _ = this.morphColors, E = m.morphColors; if (0 < S && S == M.length) for (var L = 0, R = T.length; L < R; L++) { for (var C = T[L], A = M[L], P = 0, I = A.vertices.length; P < I; P++) { var b = A.vertices[P], O = b.clone(); w !== void 0 && O.applyMatrix4(w), C.vertices.push(O); } if (C.normals && A.normals) for (var N = 0; N < A.normals.length; N += 3) g.set(A.normals2[N], A.normals2[N + 1], A.normals2[N + 2]), w !== void 0 && g.applyMatrix4(w), C.normals.push(g.x, g.y, g.z); } if (0 < x && x == E.length) for (var D = 0, B = _.length; D < B; D++) for (var U = _[D], k = E[D], K = 0, ie = k.colors; K < ie; K++) U.colors.push(k.colors[K].clone()); }, merge: function(m, w) { var S = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : 0; if (!(m && m.isGeometry)) return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", m); var T, M = this.vertices.length, x = this.vertices, _ = m.vertices, E = m.normals, L = this.faces, R = m.faces, C = this.colors, A = m.colors; w !== void 0 && (T = new l.Matrix3().getNormalMatrix(w)); for (var P = 0, I = _.length; P < I; P++) { var b = _[P], O = b.clone(); w !== void 0 && O.applyMatrix4(w), x.push(O); } for (var N = 0; N < E.length; N += 3) g.set(E[N], E[N + 1], E[N + 2]), w !== void 0 && g.applyMatrix4(w), this.normals.push(g.x, g.y, g.z); for (var D = 0, B = A.length; D < B; D++) typeof A[D] == "number" ? C.push(A[D]) : C.push(A[D].clone()); for (var U = 0, k = R.length; U < k; U++) { var K = R[U], ie = void 0, j = void 0, G = K.vertexNormals, W = K.vertexColors, q = new y(K.a + M, K.b + M, K.c + M); q.normal.copy(K.normal), T !== void 0 && q.normal.applyMatrix3(T).normalize(); for (var Q = 0, ee = G.length; Q < ee; Q++) ie = G[Q].clone(), T !== void 0 && ie.applyMatrix3(T).normalize(), q.vertexNormals.push(ie); q.color.copy(K.color); for (var ne = 0, Y = W.length; ne < Y; ne++) j = W[ne], q.vertexColors.push(j.clone()); q.materialIndex = K.materialIndex + S, L.push(q); } for (var te, F = 0, $ = m.faceVertexUvs.length; F < $; F++) { te = m.faceVertexUvs[F], this.faceVertexUvs[F] === void 0 && (this.faceVertexUvs[F] = []); for (var J = 0, z = te.length; J < z; J++) { for (var V = te[J], oe = [], ue = 0, le = V.length; ue < le; ue++) oe.push(V[ue].clone()); this.faceVertexUvs[F].push(oe); } } this.mergeMorph(m, w); }, mergeMesh: function(m) { return m && m.isMesh ? (m.matrixAutoUpdate && m.updateMatrix(), void this.merge(m.geometry, m.matrix)) : void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", m); }, /* * Checks for duplicate vertices with hashmap. * Duplicated vertices are removed * and faces' vertices are updated. */ mergeVertices: function() { for (var m = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : 4, w = {}, S = [], T = [], M = Math.pow(10, m), x = 0, _ = this.vertices.length; x < _; x++) { var E = this.vertices[x], L = Math.round(E.x * M) + "_" + Math.round(E.y * M) + "_" + Math.round(E.z * M); w[L] === void 0 ? (w[L] = x, S.push(this.vertices[x]), T[x] = S.length - 1) : T[x] = T[w[L]]; } for (var R, C = [], A = 0, P = this.faces.length; A < P; A++) { R = this.faces[A], R.a = T[R.a], R.b = T[R.b], R.c = T[R.c]; for (var I = [R.a, R.b, R.c], b = 0; 3 > b; b++) if (I[b] === I[(b + 1) % 3]) { C.push(A); break; } } for (var O, N = C.length - 1; 0 <= N; N--) { O = C[N], this.faces.splice(O, 1); for (var D = 0, B = this.faceVertexUvs.length; D < B; D++) this.faceVertexUvs[D].splice(O, 1); } var U = this.vertices.length - S.length; return this.vertices = S, U; }, setFromPoints: function(m) { this.vertices = []; for (var w, S = 0, T = m.length; S < T; S++) w = m[S], this.vertices.push(new l.Vector3(w.x, w.y, w.z || 0)); return this; }, sortFacesByMaterialIndex: function() { for (var m = this.faces, w = m.length, S = 0; S < w; S++) m[S]._id = S; m.sort(function(R, C) { return R.materialIndex - C.materialIndex; }); var T, M, x = this.faceVertexUvs[0], _ = this.faceVertexUvs[1]; x && x.length === w && (T = []), _ && _.length === w && (M = []); for (var E, L = 0; L < w; L++) E = m[L]._id, T && T.push(x[E]), M && M.push(_[E]); T && (this.faceVertexUvs[0] = T), M && (this.faceVertexUvs[1] = M); }, toJSON: function() { function m(Y, te, F) { return F ? Y | 1 << te : Y & ~(1 << te); } function w(Y) { var te = Y.x.toString() + Y.y.toString() + Y.z.toString(); return P[te] === void 0 && (P[te] = A.length / 3, A.push(Y.x, Y.y, Y.z)), P[te]; } function S(Y) { var te = Y.r.toString() + Y.g.toString() + Y.b.toString(); return b[te] === void 0 && (b[te] = I.length, I.push(Y.getHex())), b[te]; } function T(Y) { var te = Y.x.toString() + Y.y.toString(); return N[te] === void 0 && (N[te] = O.length / 2, O.push(Y.x, Y.y)), N[te]; } var M = { metadata: { version: 4.5, type: "Geometry", generator: "Geometry.toJSON" } }; if (M.uuid = this.uuid, M.type = this.type, this.name !== "" && (M.name = this.name), this.parameters !== void 0) { var x = this.parameters; for (var _ in x) x[_] !== void 0 && (M[_] = x[_]); return M; } for (var E, L = [], R = 0; R < this.vertices.length; R++) E = this.vertices[R], L.push(E.x, E.y, E.z); for (var C = [], A = [], P = {}, I = [], b = {}, O = [], N = {}, D = 0; D < this.faces.length; D++) { var B = this.faces[D], U = true, k = false, K = this.faceVertexUvs[0][D] !== void 0, ie = 0 < B.normal.length(), j = 0 < B.vertexNormals.length, G = B.color.r !== 1 || B.color.g !== 1 || B.color.b !== 1, W = 0 < B.vertexColors.length, q = 0; if (q = m(q, 0, 0), q = m(q, 1, U), q = m(q, 2, k), q = m(q, 3, K), q = m(q, 4, ie), q = m(q, 5, j), q = m(q, 6, G), q = m(q, 7, W), C.push(q), C.push(B.a, B.b, B.c), C.push(B.materialIndex), K) { var Q = this.faceVertexUvs[0][D]; C.push(T(Q[0]), T(Q[1]), T(Q[2])); } if (ie && C.push(w(B.normal)), j) { var ee = B.vertexNormals; C.push(w(ee[0]), w(ee[1]), w(ee[2])); } if (G && C.push(S(B.color)), W) { var ne = B.vertexColors; C.push(S(ne[0]), S(ne[1]), S(ne[2])); } } return M.data = {}, M.data.vertices = L, M.data.normals = A, 0 < I.length && (M.data.colors = I), 0 < O.length && (M.data.uvs = [O]), M.data.faces = C, M; }, clone: function() { return new f().copy(this); }, copy: function(m) { 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 = m.name; for (var w = m.vertices, S = 0, T = w.length; S < T; S++) this.vertices.push(w[S].clone()); for (var M = m.colors, x = 0, _ = M.length; x < _; x++) this.colors.push(M[x].clone()); for (var E = m.faces, L = 0, R = E.length; L < R; L++) this.faces.push(E[L].clone()); for (var C, A = 0, P = m.faceVertexUvs.length; A < P; A++) { C = m.faceVertexUvs[A], this.faceVertexUvs[A] === void 0 && (this.faceVertexUvs[A] = []); for (var I = 0, b = C.length; I < b; I++) { for (var O, N = C[I], D = [], B = 0, U = N.length; B < U; B++) O = N[B], D.push(O.clone()); this.faceVertexUvs[A].push(D); } } for (var k, K = m.morphTargets, ie = 0, j = K.length; ie < j; ie++) { if (k = {}, k.name = K[ie].name, K[ie].vertices !== void 0) { k.vertices = []; for (var G = 0, W = K[ie].vertices.length; G < W; G++) k.vertices.push(K[ie].vertices[G].clone()); } if (K[ie].normals !== void 0) { k.normals = []; for (var q = 0, Q = K[ie].normals.length; q < Q; q++) k.normals.push(K[ie].normals[q].clone()); } this.morphTargets.push(k); } for (var ee, ne = m.morphNormals, Y = 0, te = ne.length; Y < te; Y++) { if (ee = {}, ne[Y].vertexNormals !== void 0) { ee.vertexNormals = []; for (var F = 0, $ = ne[Y].vertexNormals.length; F < $; F++) { var J = ne[Y].vertexNormals[F], z = {}; z.a = J.a.clone(), z.b = J.b.clone(), z.c = J.c.clone(), ee.vertexNormals.push(z); } } if (ne[Y].faceNormals !== void 0) { ee.faceNormals = []; for (var V = 0, oe = ne[Y].faceNormals.length; V < oe; V++) ee.faceNormals.push(ne[Y].faceNormals[V].clone()); } this.morphNormals.push(ee); } for (var ue = m.skinWeights, le = 0, ve = ue.length; le < ve; le++) this.skinWeights.push(ue[le].clone()); for (var xe = m.skinIndices, Te = 0, de = xe.length; Te < de; Te++) this.skinIndices.push(xe[Te].clone()); for (var we = m.lineDistances, se = 0, Se2 = we.length; se < Se2; se++) this.lineDistances.push(we[se]); var ge = m.boundingBox; ge !== null && (this.boundingBox = ge.clone()); var be2 = m.boundingSphere; return be2 !== null && (this.boundingSphere = be2.clone()), this.elementsNeedUpdate = m.elementsNeedUpdate, this.verticesNeedUpdate = m.verticesNeedUpdate, this.uvsNeedUpdate = m.uvsNeedUpdate, this.normalsNeedUpdate = m.normalsNeedUpdate, this.colorsNeedUpdate = m.colorsNeedUpdate, this.lineDistancesNeedUpdate = m.lineDistancesNeedUpdate, this.groupsNeedUpdate = m.groupsNeedUpdate, this; }, computeGroups() { var v, m, w = [], S = void 0, T = this.faces; for (m = 0; m < T.length; m++) { var M = T[m]; M.materialIndex !== S && (S = M.materialIndex, v !== void 0 && (v.count = 3 * m - v.start, w.push(v)), v = { start: 3 * m, materialIndex: S }); } return v !== void 0 && (v.count = 3 * m - v.start, w.push(v)), w; }, toBufferGeometry: function() { var m = new u().fromGeometry(this), w = new l.BufferGeometry(), S = new Float32Array(3 * m.vertices.length); if (w.setAttribute("position", new l.BufferAttribute(S, 3).copyVector3sArray(m.vertices)), 0 < m.normals.length) { var T = new Float32Array(3 * m.normals.length); w.setAttribute("normal", new l.BufferAttribute(T, 3).copyVector3sArray(m.normals)); } if (0 < m.colors.length) { var M = new Float32Array(3 * m.colors.length); w.setAttribute("color", new l.BufferAttribute(M, 3).copyColorsArray(m.colors)); } if (0 < m.uvs.length) { var x = new Float32Array(2 * m.uvs.length); w.setAttribute("uv", new l.BufferAttribute(x, 2).copyVector2sArray(m.uvs)); } if (0 < m.uvs2.length) { var _ = new Float32Array(2 * m.uvs2.length); w.setAttribute("uv2", new l.BufferAttribute(_, 2).copyVector2sArray(m.uvs2)); } for (var E in w.groups = m.groups, m.morphTargets) { for (var L = [], R = m.morphTargets[E], C = 0, A = R.length; C < A; C++) { var P = R[C], I = new l.Float32BufferAttribute(3 * P.data.length, 3); I.name = P.name, L.push(I.copyVector3sArray(P.data)); } w.morphAttributes[E] = L; } if (0 < m.skinIndices.length) { var b = new l.Float32BufferAttribute(4 * m.skinIndices.length, 4); w.setAttribute("skinIndex", b.copyVector4sArray(m.skinIndices)); } if (0 < m.skinWeights.length) { var O = new l.Float32BufferAttribute(4 * m.skinWeights.length, 4); w.setAttribute("skinWeight", O.copyVector4sArray(m.skinWeights)); } return m.boundingSphere !== null && (w.boundingSphere = m.boundingSphere.clone()), m.boundingBox !== null && (w.boundingBox = m.boundingBox.clone()), w; }, toIndexedBufferGeometry: function() { var m = new l.BufferGeometry(), w = new Float32Array(3 * this.vertices.length); if (m.setAttribute("position", new l.BufferAttribute(w, 3).copyVector3sArray(this.vertices)), 0 < this.normals.length) { var S = new Float32Array(this.normals.length), T = new l.BufferAttribute(S, 3).copyArray(this.normals); m.setAttribute("normal", T); } if (0 < this.uvs.length && 0 < this.uvs[0].length) { var M = new Float32Array(2 * this.uvs[0].length); m.setAttribute("uv", new l.BufferAttribute(M, 2).copyArray(this.uvs[0])); } if (1 < this.uvs.length && 0 < this.uvs[1].length) { var x = new Float32Array(2 * this.uvs[1].length); m.setAttribute("uv2", new l.BufferAttribute(x, 2).copyArray(this.uvs[1])); } if (0 < this.colors.length) { for (var _ = [], E = 0; E < this.colors.length; E++) _.push(new l.Color(this.colors[E])); var L = new Float32Array(3 * _.length); m.setAttribute("color", new l.BufferAttribute(L, 3).copyColorsArray(_)); } else { for (var R = new Float32Array(3 * this.vertices.length), C = 0; C < 3 * this.vertices.length; C++) R[C] = 1; m.setAttribute("color", new l.BufferAttribute(R, 3)); } if (0 < this.faces.length) { for (var A = [], P = [], I = 0; I < this.faces.length; I++) { P.push(this.faces[I].a, this.faces[I].b, this.faces[I].c); var b = this.faces[I].vertexColors; if (b.length === 3) A.push(b[0], b[1], b[2]); else { var O = this.faces[I].color; A.push(O, O, O); } } m.setIndex(P), m.groups = this.computeGroups(); } if (0 < this.morphTargets.length) { for (var N = [], D = [], B = 0, U = this.morphTargets.length; B < U; B++) { var k = this.morphTargets[B], K = new l.Float32BufferAttribute(3 * k.vertices.length, 3); if (K.name = k.name, N.push(K.copyVector3sArray(k.vertices)), k.normals) { var ie = new l.Float32BufferAttribute(3 * k.normals.length, 3); ie.name = k.name, D.push(ie.copyVector3sArray(k.normals)); } } m.morphAttributes.position = N, m.morphAttributes.normal = D; } if (0 < this.skinIndices.length) { var j = new l.Float32BufferAttribute(4 * this.skinIndices.length, 4); m.setAttribute("skinIndex", j.copyVector4sArray(this.skinIndices)); } if (0 < this.skinWeights.length) { var G = new l.Float32BufferAttribute(4 * this.skinWeights.length, 4); m.setAttribute("skinWeight", G.copyVector4sArray(this.skinWeights)); } return this.boundingSphere !== null && (m.boundingSphere = this.boundingSphere.clone()), this.boundingBox !== null && (m.boundingBox = this.boundingBox.clone()), m; }, 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(m) { return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."), this.applyMatrix4(m); }, dispose: function() { this.dispatchEvent({ type: "dispose" }); } }), f.createBufferGeometryFromObject = function(v) { var m = new l.BufferGeometry(), w = v.geometry; if (v.isPoints || v.isLine) { var S = new l.Float32BufferAttribute(3 * w.vertices.length, 3), T = new l.Float32BufferAttribute(3 * w.colors.length, 3); if (m.setAttribute("position", S.copyVector3sArray(w.vertices)), m.setAttribute("color", T.copyColorsArray(w.colors)), w.lineDistances && w.lineDistances.length === w.vertices.length) { var M = new l.Float32BufferAttribute(w.lineDistances.length, 1); m.setAttribute("lineDistance", M.copyArray(w.lineDistances)); } w.boundingSphere !== null && (m.boundingSphere = w.boundingSphere.clone()), w.boundingBox !== null && (m.boundingBox = w.boundingBox.clone()); } else v.isMesh && (m = w.toBufferGeometry()); return m; }; class u { 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 = false, this.normalsNeedUpdate = false, this.colorsNeedUpdate = false, this.uvsNeedUpdate = false, this.groupsNeedUpdate = false; } computeGroups(m) { var w, S, T = [], M = void 0, x = m.faces; for (S = 0; S < x.length; S++) { var _ = x[S]; _.materialIndex !== M && (M = _.materialIndex, w !== void 0 && (w.count = 3 * S - w.start, T.push(w)), w = { start: 3 * S, materialIndex: M }); } w !== void 0 && (w.count = 3 * S - w.start, T.push(w)), this.groups = T; } fromGeometry(m) { var w, S = m.faces, T = m.vertices, M = m.faceVertexUvs, x = M[0] && 0 < M[0].length, _ = M[1] && 0 < M[1].length, E = m.morphTargets, L = E.length; if (0 < L) { w = []; for (var R = 0; R < L; R++) w[R] = { name: E[R].name, data: [] }; this.morphTargets.position = w; } var C, A = m.morphNormals, P = A.length; if (0 < P) { C = []; for (var I = 0; I < P; I++) C[I] = { name: A[I].name, data: [] }; this.morphTargets.normal = C; } var b = m.skinIndices, O = m.skinWeights, N = b.length === T.length, D = O.length === T.length; 0 < T.length && S.length === 0 && console.error("THREE.DirectGeometry: Faceless geometries are not supported."); for (var B, U = 0; U < S.length; U++) { B = S[U], this.vertices.push(T[B.a], T[B.b], T[B.c]); var k = B.vertexNormals; if (k.length === 3) this.normals.push(k[0], k[1], k[2]); else { var K = B.normal; this.normals.push(K, K, K); } var ie = B.vertexColors; if (ie.length === 3) this.colors.push(ie[0], ie[1], ie[2]); else { var j = B.color; this.colors.push(j, j, j); } if (x === true) { var G = M[0][U]; G === void 0 ? (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", U), this.uvs.push(new l.Vector2(), new l.Vector2(), new l.Vector2())) : this.uvs.push(G[0], G[1], G[2]); } if (_ === true) { var W = M[1][U]; W === void 0 ? (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", U), this.uvs2.push(new l.Vector2(), new l.Vector2(), new l.Vector2())) : this.uvs2.push(W[0], W[1], W[2]); } for (var q, Q = 0; Q < L; Q++) q = E[Q].vertices, w[Q].data.push(q[B.a], q[B.b], q[B.c]); for (var ee, ne = 0; ne < P; ne++) ee = A[ne].vertexNormals[U], C[ne].data.push(ee.a, ee.b, ee.c); N && this.skinIndices.push(b[B.a], b[B.b], b[B.c]), D && this.skinWeights.push(O[B.a], O[B.b], O[B.c]); } return this.computeGroups(m), this.verticesNeedUpdate = m.verticesNeedUpdate, this.normalsNeedUpdate = m.normalsNeedUpdate, this.colorsNeedUpdate = m.colorsNeedUpdate, this.uvsNeedUpdate = m.uvsNeedUpdate, this.groupsNeedUpdate = m.groupsNeedUpdate, m.boundingSphere !== null && (this.boundingSphere = m.boundingSphere.clone()), m.boundingBox !== null && (this.boundingBox = m.boundingBox.clone()), this; } } class y { constructor(m, w, S, T, M) { var x = 5 < arguments.length && arguments[5] !== void 0 ? arguments[5] : 0; this.a = m, this.b = w, this.c = S, this.normal = T && T.isVector3 ? T : new l.Vector3(), this.vertexNormals = Array.isArray(T) ? T : [], this.color = M && M.isColor ? M : new l.Color(), this.vertexColors = Array.isArray(M) ? M : [], this.materialIndex = x; } clone() { return new this.constructor().copy(this); } copy(m) { this.a = m.a, this.b = m.b, this.c = m.c, this.normal.copy(m.normal), this.color.copy(m.color), this.materialIndex = m.materialIndex; for (var w = 0, S = m.vertexNormals.length; w < S; w++) this.vertexNormals[w] = m.vertexNormals[w].clone(); for (var T = 0, M = m.vertexColors.length; T < M; T++) this.vertexColors[T] = m.vertexColors[T].clone(); return this; } } }, /* 7 */ /***/ (o) => { o.exports = tz; }, /* 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, a) => { a.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, a, c) => { var l = c(4), d = c(5).createBufferGeometry, h6 = c(5).resolveURL, p = 0, g = function() { return "pr" + p++; }, f = function() { this.isZincObject = true, 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 = false, this.morphColour = false, 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 = true, this.closestVertexIndex = -1, this.boundingBoxUpdateRequired = true, this.cachedBoundingBox = new l.Box3(), this.anatomicalId = void 0, this.region = void 0, this.animationClip = void 0, this.markerMode = "inherited", this.uuid = g(), 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 = true, this.drawRange = -1; }; f.prototype.setDuration = function(u) { this.duration = u, this.clipAction && this.clipAction.setDuration(this.duration); }, f.prototype.getDuration = function() { return this.duration; }, f.prototype.setRegion = function(u) { this.region = u; }, f.prototype.getRegion = function() { return this.region; }, f.prototype.getMorph = function() { var u = this._lod.getCurrentMorph(); return u || this.morph; }, f.prototype.getGroup = function() { return this.group; }, f.prototype.setMorph = function(u) { this.morph = u, this.group.add(this.morph); var y = this._lod.calculateDistance("far"); this._lod.addLevel(u, y), this._lod.setMaterial(u.material); }, f.prototype.checkTransparentMesh = function() { }, f.prototype.setMesh = function(u, y, v) { this.animationGroup = new l.AnimationObjectGroup(u), this.mixer = new l.AnimationMixer(this.animationGroup); var m = u.geometry; if (this.geometry = u.geometry, this.clipAction = void 0, m && m.morphAttributes) { var w = m.morphAttributes.position; w || (w = m.morphAttributes.color ? m.morphAttributes.color : m.morphAttributes.normal), w && (this.animationClip = l.AnimationClip.CreateClipsFromMorphTargetSequences(w, 10, true), 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 = true, this.clipAction.play())); } this.timeEnabled = y, this.morphColour = v, u.userData = this, u.matrixAutoUpdate = false, this.setMorph(u), this.checkTransparentMesh(), this.timeEnabled ? this.setFrustumCulled(false) : this.morphColour && (m.setAttribute("morphTarget0", m.getAttribute("position")), m.setAttribute("morphTarget1", m.getAttribute("position"))), this.boundingBoxUpdateRequired = true; }, f.prototype.setName = function(u) { this.groupName = u, this._lod.setName(u); }, f.prototype.getCurrentTime = function() { if (this.clipAction) { var u = this.clipAction.time / this.clipAction._clip.duration; return this.duration * u; } return this.inbuildTime; }, f.prototype.setMorphTime = function(u) { var y = false; if (this.clipAction) { var v = u / this.duration, m = this.clipAction._clip.duration, w = v * m; w != this.clipAction.time && (this.clipAction.time = w, y = true), y && this.isTimeVarying() && this.mixer.update(0); } else { var S = u; S = u > this.duration ? this.duration : 0 > u ? 0 : u, S != this.inbuildTime && (this.inbuildTime = S, y = true); } y && (this.boundingBoxUpdateRequired = true, this._lod.updateMorphColorAttribute(true), this.timeEnabled && (this.markerUpdateRequired = true)); }, f.prototype.isTimeVarying = function() { return !!(this.timeEnabled || this.morphColour); }, f.prototype.getVisibility = function() { return this.visible; }, f.prototype.setVisibility = function(u) { u !== this.visible && (this.visible = u, this.group.visible = u, this.region && (this.region.pickableUpdateRequired = true)); }, f.prototype.setAlpha = function(u) { var y = this._lod._material, v = false; 1 > u && (v = true), y.opacity = u, y.transparent = v, this.checkTransparentMesh(); }, f.prototype.setFrustumCulled = function(u) { this._lod.setFrustumCulled(u); }, f.prototype.setVertexColors = function(u) { this._lod.setVertexColors(u); }, f.prototype.getColour = function() { return this._lod._material ? this._lod._material.color : void 0; }, f.prototype.setColour = function(u) { this._lod.setColour(u); }, f.prototype.getColourHex = function() { return !this.morphColour && this._lod._material && this._lod._material.color ? this._lod._material.color.getHexString() : void 0; }, f.prototype.setColourHex = function(u) { this._lod._material.color.setHex(u), this._lod._secondaryMaterial && this._lod._secondaryMaterial.color.setHex(u); }, f.prototype.setEmissiveRGB = function(u) { this._lod._material && this._lod._material.emissive && this._lod._material.emissive.setRGB(...u), this._lod._secondaryMaterial && this._lod._secondaryMaterial.emissive.setRGB(...u); }, f.prototype.setMaterial = function(u) { this._lod.setMaterial(u); }, f.prototype.getClosestVertexIndex = function() { var u = -1, y = this.getMorph(); if (y && y.geoemtry) { var v = y.geometry.attributes.position; if (this._b1.setFromBufferAttribute(v), this._b1.getCenter(this._v1), v) for (var m = -1, w = 0, S = 0; S < v.count; S++) this._v2.fromArray(v.array, 3 * S), w = this._v2.distanceTo(this._v1), m == -1 ? m = w : m > w && (m = w, u = S); } return u; }, f.prototype.getClosestVertex = function(u) { var y = new l.Vector3(); this.closestVertexIndex == -1 && (this.closestVertexIndex = this.getClosestVertexIndex()); var v = this.getMorph(); if (v && v.geometry && 0 <= this.closestVertexIndex) { var m = v.morphTargetInfluences, w = v.geometry.morphAttributes; if (m && w && w.position) { for (var S = false, T = 0; T < m.length; T++) 0 < m[T] && (S = true, this._v1.fromArray(w.position[T].array, 3 * this.closestVertexIndex), y.add(this._v1.multiplyScalar(m[T]))); if (S) return u ? y.applyMatrix4(v.matrixWorld) : y; } else return y.fromArray(v.geometry.attributes.position.array, 3 * this.closestVertexIndex), u ? y.applyMatrix4(v.matrixWorld) : y; } return this.getBoundingBox(), y.copy(this.center), u ? y.applyMatrix4(this.morph.matrixWorld) : y; }, f.prototype.getBoundingBox = function() { if (this.visible) { var u = this._lod.getCurrentMorph(); if (u && u.visible) return this.boundingBoxUpdateRequired && (c(5).getBoundingBox(u, this.cachedBoundingBox, this._b1, this._v1, this._v2), this.cachedBoundingBox.getCenter(this.center), this.radius = this.center.distanceTo(this.cachedBoundingBox.max), this.boundingBoxUpdateRequired = false), this.cachedBoundingBox; } }, f.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; }, f.prototype.markerIsRequired = function(u) { return !!(this.visible && (this.markerMode === "on" || u && u.displayMarkers && this.markerMode === "inherited")); }, f.prototype.updateMarker = function(u, y) { if (u == false && this.markerIsRequired(y)) { var v = y.ndcToBeUpdated; if (this.groupName) { if (this.marker || (this.marker = new (c(14)).Marker(this), this.markerUpdateRequired = true), this.markerUpdateRequired) { var m = this.getClosestVertex(false); m && (this.marker.setPosition(m.x, m.y, m.z), this.markerUpdateRequired = false); } this.marker.isEnabled() || (y.markersList && !(this.marker.uuid in y.markersList) && (v = true, 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 && (v || y.markerCluster.markerUpdateRequired) && (this.marker.updateNDC(y.camera.cameraObject), y.markerCluster.markerUpdateRequired = true); } } 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 = true, delete y.markersList[this.marker.uuid])), this.markerUpdateRequired = true; }, f.prototype.processMarkerVisual = function(u, y) { this.marker && this.marker.isEnabled() && this.marker.updateVisual(u, y); }, f.prototype.initiateMorphColor = function() { this.morphColour == 1 && this._lod.updateMorphColorAttribute(false); }, f.prototype.setRenderOrder = function(u) { this._lod.setRenderOrder(u); }, f.prototype.getClosestVertexDOMElementCoords = function(u) { if (u && u.camera) { var y = true, v = this.getClosestVertex(true); return v.project(u.camera), v.z = Math.min(Math.max(v.z, 0), 1), (1 < v.x || -1 > v.x || 1 < v.y || -1 > v.y) && (y = false), u.getZincCameraControls().getRelativeCoordsFromNDC(v.x, v.y, v), { position: v, inView: y }; } }, f.prototype.setMarkerMode = function(u, y) { u !== this.markerMode && (this.markerMode = u === "on" || u === "off" ? u : "inherited", this.region && (this.region.pickableUpdateRequired = true)), y && (this.markerNumber = y.number, this.markerImgURL = y.imgURL); }, f.prototype.render = function(u, y, v, m) { if (this.visible && !(this.timeEnabled && y) && this._lod.update(v, this.center), y == true) { if (this.clipAction && this.isTimeVarying()) this.mixer.update(u); else { var w = this.inbuildTime + u; w > this.duration && (w -= this.duration), this.inbuildTime = w; } this.visible && u != 0 && (this.boundingBoxUpdateRequired = true, this.morphColour == 1 && this._lod.updateMorphColorAttribute(true)); } this.updateMarker(y, m); }, f.prototype.addLOD = function(u, y, v, m, w) { this._lod.addLevelFromURL(u, y, v, m, w); }, f.prototype.addVertices = function(u) { var y = this.getMorph(), v = void 0; if (!y) v = d(500, u), this.drawRange = u.length; else if (-1 < this.drawRange) { var m = y.geometry.getAttribute("position"); u.forEach((w) => { m.setXYZ(this.drawRange, w[0], w[1], w[2]), ++this.drawRange; }), m.needsUpdate = true, y.geometry.setDrawRange(0, this.drawRange), y.geometry.computeBoundingBox(), y.geometry.computeBoundingSphere(), v = y.geoemtry, this.boundingBoxUpdateRequired = true; } return v; }, f.prototype.setPosition = function(u, y, v) { var m = this.getGroup(); m && (m.position.set(u, y, v), m.updateMatrix(), this.boundingBoxUpdateRequired = true); }, f.prototype.loadAdditionalSources = function(u) { u.load(h6(filename), meshloader(region, colour, opacity, localTimeEnabled, localMorphColour, void 0, void 0, void 0, void 0, finishCallback), this.onProgress(filename), this.onError(finishCallback)); }, f.prototype.setScaleAll = function(u) { var y = this.getGroup(); y && (y.scale.set(u, u, u), y.updateMatrix(), this.boundingBoxUpdateRequired = true); }, a.ZincObject = f; }, /* 11 */ /***/ (o, a, c) => { var l = c(4), d = c(5).updateMorphColorAttribute, h6 = c(5).toBufferGeometry, p = function(g) { this.levels = [], this._currentLevel = 0, this._renderOrder = 1, this._material = void 0, this._secondaryMaterial = void 0, this._loader = void 0, this._parent = g, this.addLevel = (u, y) => { if (u) { var v, m = Math.abs(y); for (v = 0; v < this.levels.length && !(m < this.levels[v].distance); v++) ; this.levels.splice(v, 0, { distance: m, morph: u, loaded: true, loading: false, url: "" }), u.renderOrder = this._renderOrder; } }, this.levelLoaded = (u, y) => { if (u) { for (var v = Math.abs(y), m = 0; m < this.levels.length; m++) if (v === this.levels[m].distance) { this._parent.group.add(u), this.levels[m].morph = u, this.levels[m].loaded = true, this.levels[m].loading = false; break; } this.checkTransparentMesh(); } }, this.addLevelFromURL = (u, y, v, m, w) => { this._loader = u; var S, T = this.calculateDistance(y); for (S = 0; S < this.levels.length && !(T < this.levels[S].distance); S++) ; this.levels.splice(S, 0, { distance: T, morph: void 0, loaded: false, loading: false, url: v, index: m }), w && this.loadLevel(S); }, this.loadLevel = (u) => { var y = this.levels[u]; return y.morph || y.loaded || y.loading || (y.loading = true, this._loader.load(y.url, this.lodLoader(y.distance), void 0, void 0, { index: y.index })), y.morph === void 0; }, this.calculateDistance = function(u) { this._parent.getBoundingBox(); var y = this._parent.radius, v = 0; return u === "far" ? v = 4.5 * y : u === "medium" ? v = 2.5 * y : u == "close" && (v = 0), v; }, this.containsLevels = () => !!(this.levels && 1 < this.levels.length), this.checkTransparentMesh = () => { var u = 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 = true, !u.secondaryMesh && (u.secondaryMesh = new l.Mesh(u.morph.geometry, this._secondaryMaterial), u.secondaryMesh.renderOrder = u.morph.renderOrder + 1, u.secondaryMesh.userData = u.morph.userData, u.secondaryMesh.name = u.morph.name), this._material.side = l.BackSide, this._material.needsUpdate = true, !u.secondaryMesh.parent && (u.morph.add(u.secondaryMesh), this._parent.animationGroup && this._parent.animationGroup.add(u.secondaryMesh))) : (u.secondaryMesh && (u.morph.remove(u.secondaryMesh), this._parent.animationGroup && (this._parent.animationGroup.uncache(u.secondaryMesh), this._parent.animationGroup.remove(u.secondaryMesh))), this._material.side = l.DoubleSide, this._material.needsUpdate = true)); }, this.dispose = () => { this.levels.forEach((u) => { u.morph && u.morph.geometry && u.morph.geometry.dispose(); }), this._material && this._material.dispose(), this._secondaryMaterial && this._secondaryMaterial.dispose(); }, this.getCurrentLevel = () => this._currentLevel, this.getCurrentMorph = () => { var u = this.levels[this._currentLevel]; return u && u.morph ? u.morph : this._parent.morph; }, this.lodLoader = function(u) { return (y) => { var v = this._material, m = { localTimeEnabled: this._parent.timeEnabled, localMorphColour: this._parent.morphColour }, w = h6(y, m), S = void 0; this._parent.isGeometry ? S = new l.Mesh(w, v) : this._parent.isLines && (S = new (c(12)).LineSegments(w, v)), S.userData = this._parent, S.renderOrder = this._renderOrder, y.dispose(), this.levelLoaded(S, u); }; }, this.updateMorphColorAttribute = (u) => { if (this._material && (this._material.vertexColors == l.VertexColors || this._material.vertexColors == true)) if (u) { var y = this.getCurrentMorph(); d(y.geometry, y); } else this.levels.forEach((v) => { v.morph && v.morph.geometry && d(v.morph.geometry, v.morph); }); }, this.setColour = (u) => { this._material.color = u, this._secondaryMaterial && (this._secondaryMaterial.color = u), f(); }, this.setFrustumCulled = (u) => { this.levels.forEach((y) => { y.morph && (y.morph.frustumCulled = u), y.secondaryMesh && (y.secondaryMesh.frustumCulled = u); }); }, this.setMaterial = (u) => { u && (!this._material || this._material.id !== u.id) && (this._material = u, this._secondaryMaterial && this._secondaryMaterial.dispose(), this._secondaryMaterial = u.clone(), this._secondaryMaterial.side = l.FrontSide, this._secondaryMaterial.transparent = true, this.levels.forEach((y) => { y.morph && (y.morph.material = this._material, y.morph.geometry && (y.morph.geometry.colorsNeedUpdate = true)), y.secondaryMesh && (y.secondaryMesh.material = this._secondaryMaterial); })); }, this.setName = (u) => { this.levels.forEach((y) => { y.morph && (y.morph.name = u), y.secondaryMesh && (y.secondaryMesh.name = u); }); }, this.setRenderOrder = (u) => { this._renderOrder = u, this.levels.forEach((y) => { y.morph && (y.morph.renderOrder = u), y.secondaryMesh && (y.secondaryMesh.renderOrder = u); }); }, this.setVertexColors = (u) => { this._material.vertexColors = u, f(), this._secondaryMaterial && (this._secondaryMaterial.vertexColors = u); }, this.update = (u, y) => { var v = this.levels; if (1 < v.length) { var m, w, S = u.cameraObject.position.distanceTo(y), T = -1, M = -1; for (m = 0, w = v.length; m < w && S >= v[m].distance; m++) v[m].morph ? (-1 < T && v[T].morph && (v[T].morph.visible = false), T = m, v[m].morph.visible = true, M = -1) : M = m; for (-1 < M && this.loadLevel(M); m < w; m++) v[m].morph && (-1 < T ? v[m].morph.visible = false : (v[m].morph.visible = true, T = m)); this._currentLevel != T && (this._currentLevel = T, this.checkTransparentMesh()); } }, this.toggleMarker = (u, y) => { this.levels.forEach((v) => { v.morph && (y ? v.morph.add(u) : v.morph.remove(u)); }); }; var f = () => { this.levels.forEach((u) => { u.morph && u.morph.geometry && (u.morph.geometry.colorsNeedUpdate = true); }); }; }; a.LOD = p; }, /* 12 */ /***/ (o, a, c) => { c.r(a), c.d(a, { /* harmony export */ LineSegments: () => ( /* binding */ g ) /* harmony export */ }); var l = c(13), d = c(4), h6 = new d.Vector3(), p = new d.Vector3(); class g extends l.Line { constructor(u, y) { super(u, y), this.type = "LineSegments"; } computeLineDistances() { var u = this.geometry; if (!u.isBufferGeometry) u.isGeometry && console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); else if (u.index === null) { for (var y = u.attributes.position, v = [], m = 0, w = y.count; m < w; m += 2) h6.fromBufferAttribute(y, m), p.fromBufferAttribute(y, m + 1), v[m] = m == 0 ? 0 : v[m - 1], v[m + 1] = v[m] + h6.distanceTo(p); u.setAttribute("lineDistance", new d.Float32BufferAttribute(v, 1)); } else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry."); return this; } } g.prototype.isLineSegments = true; }, /* 13 */ /***/ (o, a, c) => { c.r(a), c.d(a, { /* harmony export */ Line: () => ( /* binding */ w ) /* harmony export */ }); var l = c(4), d = new l.Vector3(), h6 = new l.Vector3(), p = new l.Matrix4(), g = new l.Ray(), f = new l.Sphere(), u = new l.Vector3(), y = new l.Vector3(), v = new l.Vector3(), m = new l.Vector3(); class w extends l.Object3D { constructor() { var M = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : new l.BufferGeometry(), x = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : new l.LineBasicMaterial(); super(), this.type = "Line", this.geometry = M, this.material = x, this.updateMorphTargets(); } copy(M) { return super.copy(M), this.material = M.material, this.geometry = M.geometry, this; } computeLineDistances() { var M = this.geometry; if (!M.isBufferGeometry) M.isGeometry && console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); else if (M.index === null) { for (var x = M.attributes.position, _ = [0], E = 1, L = x.count; E < L; E++) d.fromBufferAttribute(x, E - 1), h6.fromBufferAttribute(x, E), _[E] = _[E - 1], _[E] += d.distanceTo(h6); M.setAttribute("lineDistance", new l.Float32BufferAttribute(_, 1)); } else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry."); return this; } raycast(M, x) { var _ = this.geometry, E = this.matrixWorld, L = M.params.Line.threshold, R = _.drawRange, C = _.morphAttributes.position; if (_.boundingSphere === null && _.computeBoundingSphere(), f.copy(_.boundingSphere), f.applyMatrix4(E), f.radius += L, M.ray.intersectsSphere(f) !== false) { p.copy(E).invert(), g.copy(M.ray).applyMatrix4(p); var A = L / ((this.scale.x + this.scale.y + this.scale.z) / 3), P = A * A, I = new l.Vector3(), b = new l.Vector3(), O = new l.Vector3(), N = new l.Vector3(), D = this.isLineSegments ? 2 : 1; if (_.isBufferGeometry) { var B = _.index, U = _.attributes, k = U.position; if (B !== null) for (var K = Math.max(0, R.start), ie = Math.min(B.count, R.start + R.count), j = K; j < ie - 1; j += D) { var G = B.getX(j), W = B.getX(j + 1); S(I, b, this, k, C, G, W); var q = g.distanceSqToSegment(I, b, N, O); if (!(q > P)) { N.applyMatrix4(this.matrixWorld); var Q = M.ray.origin.distanceTo(N); Q < M.near || Q > M.far || x.push({ distance: Q, // 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: j, face: null, faceIndex: null, object: this }); } } else for (var ee = Math.max(0, R.start), ne = Math.min(k.count, R.start + R.count), Y = ee; Y < ne - 1; Y += D) { S(I, b, this, k, C, Y, Y + 1); var te = g.distanceSqToSegment(I, b, N, O); if (!(te > P)) { N.applyMatrix4(this.matrixWorld); var F = M.ray.origin.distanceTo(N); F < M.near || F > M.far || x.push({ distance: F, // 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: Y, face: null, faceIndex: null, object: this }); } } } else _.isGeometry && console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); } } updateMorphTargets() { var M = this.geometry; if (M.isBufferGeometry) { var x = M.morphAttributes, _ = Object.keys(x); if (0 < _.length) { var E = x[_[0]]; if (E !== void 0) { this.morphTargetInfluences = [], this.morphTargetDictionary = {}; for (var L, R = 0, C = E.length; R < C; R++) L = E[R].name || R + "", this.morphTargetInfluences.push(0), this.morphTargetDictionary[L] = R; } } } else { var A = M.morphTargets; A !== void 0 && 0 < A.length && console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead."); } } } function S(T, M, x, _, E, L, R) { T.fromBufferAttribute(_, L), M.fromBufferAttribute(_, R); var C = x.morphTargetInfluences; if (x.material.morphTargets && E && C) { u.set(0, 0, 0), y.set(0, 0, 0); for (var A = 0, P = E.length; A < P; A++) { var I = C[A], b = E[A]; I !== 0 && (v.fromBufferAttribute(b, L), m.fromBufferAttribute(b, R), u.addScaledVector(v.sub(T), I), y.addScaledVector(m.sub(M), I)); } T.add(u), M.add(y); } } w.prototype.isLine = true; }, /* 14 */ /***/ (o, a, c) => { var l = c(4), d = new Image(128, 128); d.src = c(15); var h6 = new l.Texture(); h6.image = d, h6.needsUpdate = true; var p = [0.02, 0.03, 1], g = new l.SpriteMaterial({ map: h6, alphaTest: 0.5, transparent: true, depthTest: false, depthWrite: false, sizeAttenuation: false }), f = c(5).createNewSpriteText, u = function(y) { c(10).ZincObject.call(this), this.texture = h6; var v = void 0, m = void 0, w = void 0, S = void 0, T = void 0, M = true; this.morph = new l.Group(), this.group = this.morph, this.parent = y, this.isMarker = true; var x = false; this.ndc = new l.Vector3(); var _ = void 0, E = void 0, L = () => { v = new l.Sprite(g), v.center.set(0.5, 0), this.morph.add(v), this.morph.position.set(0, 0, 0), this.morph.renderOrder = 1e4, v.scale.set(p[0], p[1], p[2]), v.userData = this; }; this.updateVisual = (R, C) => { var A = 1, P = 0; R !== C && (P = 1 - (this.ndc.z - R) / (C - R), A = 0.6 + 0.4 * P), this.setSpriteSize(A); }, this.updateNDC = (R) => (this.ndc.copy(this.morph.position), this.ndc.project(R), this.ndc.z = Math.min(Math.max(this.ndc.z, 0), 1), this.ndc), this.setPosition = (R, C, A) => { this.morph.position.set(R, C, A); }, this.setSpriteSize = (R) => { v.scale.set(0.015, 0.02, 1), v.scale.multiplyScalar(R); }, this.setUserSprite = () => { S && (this.morph.add(S), M && (this.morph.remove(v), E && this.morph.remove(E), M = false)); }, this.setImageForUserSprite = (R, C) => { S && (this.morph.remove(S), S = void 0), m && m.dispose(), w && w.dispose(), m = new l.Texture(), m.image = R, m.needsUpdate = true, w = new l.SpriteMaterial({ map: m, alphaTest: 0.5, transparent: true, depthTest: false, depthWrite: false, sizeAttenuation: false }), C || (C = [0.05, 0.05, 1]), S = new l.Sprite(w), S.center.set(0.5, 0), S.scale.set(C[0], C[1], C[2]), S.userData = this, this.setUserSprite(); }, this.setDefaultSprite = () => { M || (M = true, this.morph.add(v), S && this.morph.remove(S), E && this.morph.add(E)); }, this.loadUserSprite = (R, C) => { if (R) if (R !== T) { T = R; var A = new Image(128, 128); A.crossOrigin = "anonymous", A.onload = () => { this.setImageForUserSprite(A, C); }, A.src = R; } else this.setUserSprite(); }, this.dispose = () => { this.morph && this.morph.clear(), v && (v.clear(), v = void 0), E && (E.material.map.dispose(), E.material.dispose(), E = void 0); }, this.isEnabled = () => x, this.setNumber = (R) => { (!R || _ != R) && E && (this.morph.remove(E), E.material.map.dispose(), E.material.dispose(), E = void 0), !E && R && (E = f(R, 0.012, "black", "Asap", 120, 700), this.morph.add(E)), _ = R; }, this.getNumber = () => _ || 1, this.setVisibility = function(R) { R !== this.visible && (this.visible = R, this.group.visible = R, this.parent.region && (this.parent.region.pickableUpdateRequired = true)); }, this.enable = () => { x = true, this.morph.visible = true, this.visible = true; }, this.disable = () => { x = false, this.morph.visible = false, this.visible = false; }, L(); }; u.prototype = Object.create(c(10).ZincObject.prototype), a.Marker = u; }, /* 15 */ /***/ (o) => { o.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgdmlld0JveD0iMCAwIDM2NSA1NjAiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4NCjxkZWZzPg0KPC9kZWZzPg0KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCAwKSIgaWQ9IjgwOGVkMjgzLTI1MjQtNDQwZi04OGFlLTNiZGI0N2JiNTc0OSIgID4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4NCjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItMTgyLjUiIHk9Ii0yODAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIC8+DQo8L2c+DQo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+DQo8ZyBzdHlsZT0iIiAgID4NCjwvZz4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCA5Ny41KSIgID4NCjxnIHN0eWxlPSIiICAgPg0KPC9nPg0KPC9nPg0KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMC45OSAwIDAgMC45OSAxODIuNSAyODApIiAgPg0KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii01NDAiIHk9Ii01NDAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjEwODAiIGhlaWdodD0iMTA4MCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHBhdGggc3R5bGU9InN0cm9rZTogcmdiKDAsMCwwKTsgc3Ryb2tlLXdpZHRoOiAwOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMCw4OSwxMTYpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB0cmFuc2Zvcm09IiB0cmFuc2xhdGUoLTE4Mi45LCAtMjc5Ljg1KSIgZD0iTSAxODIuOSA1NTEuNyBDIDE4Mi45IDU1MS44MDAwMDAwMDAwMDAxIDE4My4xIDU1MiAxODMuMSA1NTIgQyAxODMuMSA1NTIgMzU4LjMgMjgzIDM1OC4zIDE5NC42IEMgMzU4LjMgNjQuNSAyNjkuNSA3LjkwMDAwMDAwMDAwMDAwNiAxODIuOSA3LjY5OTk5OTk5OTk5OTk4OSBDIDk2LjMgNy45IDcuNSA2NC41IDcuNSAxOTQuNiBDIDcuNSAyODMgMTgyLjggNTUyIDE4Mi44IDU1MiBDIDE4Mi44IDU1MiAxODIuOSA1NTEuNyAxODIuOSA1NTEuNyB6IE0gMTIyLjIgMTg3LjIgQyAxMjIuMiAxNTMuNiAxNDkuNCAxMjYuMzk5OTk5OTk5OTk5OTkgMTgzIDEyNi4zOTk5OTk5OTk5OTk5OSBDIDIxNi42IDEyNi4zOTk5OTk5OTk5OTk5OSAyNDMuOCAxNTMuNiAyNDMuOCAxODcuMiBDIDI0My44IDIyMC43OTk5OTk5OTk5OTk5OCAyMTYuNSAyNDggMTgyLjkgMjQ4IEMgMTQ5LjQgMjQ4IDEyMi4yIDIyMC44IDEyMi4yIDE4Ny4yIHoiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPg0KPGNpcmNsZSBzdHlsZT0ic3Ryb2tlOiByZ2IoMCwwLDApOyBzdHJva2Utd2lkdGg6IDA7IHN0cm9rZS1kYXNoYXJyYXk6IG5vbmU7IHN0cm9rZS1saW5lY2FwOiBidXR0OyBzdHJva2UtZGFzaG9mZnNldDogMDsgc3Ryb2tlLWxpbmVqb2luOiBtaXRlcjsgc3Ryb2tlLW1pdGVybGltaXQ6IDQ7IGZpbGw6IHJnYigyNTUsMjU1LDI1NSk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIGN4PSIwIiBjeT0iMCIgcj0iMzUiIC8+DQo8L2c+DQo8L2c+DQo8L2c+DQo8L3N2Zz4="; }, /* 16 */ /***/ (o, a, c) => { var l = c(4), d = function(h6, p, g, f) { c(10).ZincObject.call(this); var u; p && (u = p.clone(), u.vertexColors = l.FaceColors), this.id = g; var y = void 0, v = void 0; this.isGlyph = true, this.fromMesh = (m) => !!(m && m.isMesh) && (this.morph = m.clone(), this.morph.userData = this, this.group.add(this.morph), true), h6 && u && this.fromMesh(new l.Mesh(h6, u)), this.getGlyphset = function() { return f; }, this.setLabel = (m) => { m && (typeof m == "string" || m instanceof String) && (v = m, this.morph && (this.morph.name = m)), y && this.showLabel(); }, this.showLabel = (m) => { if (y && (position = y.getPosition(), this.group.remove(y.getSprite()), y.dispose(), y = void 0), v && (typeof v == "string" || v instanceof String)) { var w = [0, 0, 0]; y = new (c(17)).Label(v, m), y.setPosition(w[0], w[1], w[2]), this.group.add(y.getSprite()); } }, this.getLabel = () => v, this.getMesh = () => this.morph, this.setTransformation = (m, w, S, T) => { this.morph && (this.morph.matrix.elements[0] = w[0], this.morph.matrix.elements[1] = w[1], this.morph.matrix.elements[2] = w[2], this.morph.matrix.elements[3] = 0, this.morph.matrix.elements[4] = S[0], this.morph.matrix.elements[5] = S[1], this.morph.matrix.elements[6] = S[2], this.morph.matrix.elements[7] = 0, this.morph.matrix.elements[8] = T[0], this.morph.matrix.elements[9] = T[1], this.morph.matrix.elements[10] = T[2], this.morph.matrix.elements[11] = 0, this.morph.matrix.elements[12] = m[0], this.morph.matrix.elements[13] = m[1], this.morph.matrix.elements[14] = m[2], this.morph.matrix.elements[15] = 1, this.morph.matrixAutoUpdate = false), y && y.setPosition(m[0], m[1], m[2]); }, this.setColour = (m) => { y && y.setColour(m), this.secondaryMesh && this.secondaryMesh.material && (this.secondaryMesh.material.color = colour), this.geometry.colorsNeedUpdate = true; }, this.dispose = () => { this.material && this.material.dispose(), this.morph = void 0; }; }; d.prototype = Object.create(c(10).ZincObject.prototype), a.Glyph = d; }, /* 17 */ /***/ (o, a, c) => { var l = c(7).default; a.Label = function(d, h6) { var p = d, g = void 0; g = h6 ? new l(p, 0.015, h6.getStyle()) : new l(p, 0.015), g.fontFace = "Asap", g.fontWeight = 700, g.material.map.generateMipmaps = false, g.material.sizeAttenuation = false, g.center.x = -0.05, g.center.y = 0, this.getPosition = () => g ? [g.position.x, g.position.y, g.position.z] : [0, 0, 0], this.setPosition = (f, u, y) => { g && g.position.set(f, u, y); }, this.setColour = (f) => { g.color = f.getStyle(); }, this.setScale = (f) => { g && 0 < f && g.scale.set(f, f, 1); }, this.dispose = () => { g.dispose(); }, this.getSprite = () => g, this.getString = () => p; }; }, /* 18 */ /***/ (o, a, c) => { function l(g) { throw new TypeError('"' + g + '" is read-only'); } var d = c(4), h6 = c(19).JSONLoader, p = function() { c(10).ZincObject.call(this); var g = [], f = void 0, u = void 0, y = void 0, v = void 0, m = void 0, w = void 0, S = void 0, T = 0, M = 0, x = [0, 0, 0], _ = [0, 0, 0], E = [0, 0, 0], L = "NONE"; this.ready = false; var R = false, C = false; this.isGlyphset = true; for (var A = new d.Matrix4(), P = new d.Color(), I = new d.Color(), b = new d.Box3(), O = new d.Box3(), N = new d.Box3(), D = [], B = [], U = [], k = [], K = [], ie = [], j = [], G = [], W = 0; 8 > W; W++) D[W] = new d.Vector3(); this.load = (F, $, J, z, V) => { f = F.axis1, u = F.axis2, y = F.axis3, v = F.positions, m = F.scale, w = F.colors, S = F.label, R = F.metadata.MorphColours, C = F.metadata.MorphVertices, T = F.metadata.number_of_time_steps, L = F.metadata.repeat_mode, M = F.metadata.number_of_vertices, L == "AXES_2D" || L == "MIRROR" ? M *= 2 : L == "AXES_3D" && (M *= 3), x = F.metadata.base_size, _ = F.metadata.offset, E = F.metadata.scale_factors; var oe = new h6(); this.geometry = new d.BufferGeometry(); var ue = new d.InstancedMesh(this.geometry, void 0, M); if (this.setMorph(ue), z) { var le = oe.parse($); te(J, V)(le.geometry, le.materials), le.geometry.dispose(); } else oe.crossOrigin = "Anonymous", oe.load($, te(J, V)); }; var q = (F, $, J, z, V, oe) => { if (L == "NONE" || L == "MIRROR") { for (var ue, le = [0, 0, 0], ve = [0, 0, 0], xe = [0, 0, 0], Te = [0, 0, 0], de = [0, 0, 0], we = [0, 0, 0], se = [0, 0, 0], Se2 = [0, 0, 0], ge = [0, 0, 0], be2 = 0; 3 > be2; be2++) ue = 0 > V[be2] ? -1 : 1, le[be2] = ue * x[be2] + V[be2] * E[be2]; for (var be2 = 0; 3 > be2; be2++) ve[be2] = $[be2] * le[0], xe[be2] = J[be2] * le[1], Te[be2] = z[be2] * le[2], de[be2] = F[be2] + _[0] * ve[be2] + _[1] * xe[be2] + _[2] * Te[be2], L == "MIRROR" && (we[be2] = -ve[be2], se[be2] = -xe[be2], Se2[be2] = -Te[be2], ge[be2] = de[be2], 0 > V[0] && (de[be2] -= ve[be2], ge[be2] -= we[be2])); 0 > Te[0] * (ve[1] * xe[2] - ve[2] * xe[1]) + Te[1] * (ve[2] * xe[0] - ve[0] * xe[2]) + Te[2] * (ve[0] * xe[1] - ve[1] * xe[0]) && (Te[0] = -Te[0], Te[1] = -Te[1], Te[2] = -Te[2]), oe[0] = [de, ve, xe, Te], L == "MIRROR" && (0 > Se2[0] * (we[1] * se[2] - we[2] * se[1]) + Se2[1] * (we[2] * se[0] - we[0] * se[2]) + Se2[2] * (we[0] * se[1] - we[1] * se[0]) && (Se2[0] = -Se2[0], Se2[1] = -Se2[1], Se2[2] = -Se2[2]), oe[1] = [ge, we, se, Se2]); } else if (L == "AXES_2D" || L == "AXES_3D") { for (var ue, Ie2 = [0, 0, 0], et2 = [0, 0, 0], be2 = 0; 3 > be2; be2++) ue = 0 > V[be2] ? -1 : 1, Ie2[be2] = ue * x[0] + V[be2] * E[0]; for (var be2 = 0; 3 > be2; be2++) et2[be2] = F[be2] + _[0] * Ie2[0] * $[be2] + _[1] * Ie2[1] * J[be2] + _[2] * Ie2[2] * z[be2]; for (var mt = glyph_repeat_mode == "AXES_2D" ? 2 : 3, Ue = 0; Ue < mt; Ue++) { var bt2 = void 0, Ve = void 0, lt = V[Ue], tt2 = [0, 0, 0], xt = [0, 0, 0], pt2 = [0, 0, 0]; Ue == 0 ? (bt2 = $, Ve = J) : Ue == 1 ? (bt2 = J, Ve = glyph_repeat_mode == "AXES_2D" ? $ : z) : (bt2 = z, Ve = $); var Vt2 = x[0] + lt * E[0]; tt2[0] = bt2[0] * Vt2, tt2[1] = bt2[1] * Vt2, tt2[2] = bt2[2] * Vt2, pt2[0] = tt2[1] * Ve[2] - Ve[1] * tt2[2], pt2[1] = tt2[2] * Ve[0] - Ve[2] * tt2[0], pt2[2] = tt2[0] * Ve[1] - tt2[1] * Ve[0]; var Nt2 = Math.sqrt(pt2[0] * pt2[0] + pt2[1] * pt2[1] + pt2[2] * pt2[2]); if (0 < Nt2) { var re = (x[2] + lt * E[2]) / Nt2; L == "AXES_2D" && 0 < Ue && (re *= -1), pt2[0] *= re, pt2[1] *= re, pt2[2] *= re; } if (xt[0] = pt2[1] * tt2[2] - tt2[1] * pt2[2], xt[1] = pt2[2] * tt2[0] - tt2[2] * pt2[0], xt[2] = pt2[0] * tt2[1] - pt2[1] * tt2[0], Nt2 = Math.sqrt(xt[0] * xt[0] + xt[1] * xt[1] + xt[2] * xt[2]), 0 < Nt2) { var Ee = (x[1] + lt * E[1]) / Nt2; xt[0] *= Ee, xt[1] *= Ee, xt[2] *= Ee; } oe[Ue] = [et2, tt2, xt, pt2]; } } return oe; }, Q = (F, $, J, z, V) => { var oe = 1; L == "AXES_2D" || L == "MIRROR" ? oe = 2 : L == "AXES_3D" && (oe = 3); var ue = F.length / 3, le = 0; G.length = oe; for (var ve = 0; ve < ue; ve++) { var xe = 3 * ve, Te = [F[xe], F[xe + 1], F[xe + 2]], de = [$[xe], $[xe + 1], $[xe + 2]], we = [J[xe], J[xe + 1], J[xe + 2]], se = [z[xe], z[xe + 1], z[xe + 2]], Se2 = [V[xe], V[xe + 1], V[xe + 2]], ge = q(Te, de, we, se, Se2, G); if (ge.length == oe) for (var be2 = 0; be2 < oe; be2++) { A.elements[0] = ge[be2][1][0], A.elements[1] = ge[be2][1][1], A.elements[2] = ge[be2][1][2], A.elements[3] = 0, A.elements[4] = ge[be2][2][0], A.elements[5] = ge[be2][2][1], A.elements[6] = ge[be2][2][2], A.elements[7] = 0, A.elements[8] = ge[be2][3][0], A.elements[9] = ge[be2][3][1], A.elements[10] = ge[be2][3][2], A.elements[11] = 0, A.elements[12] = ge[be2][0][0], A.elements[13] = ge[be2][0][1], A.elements[14] = ge[be2][0][2], A.elements[15] = 1, this.morph.setMatrixAt(le, A); var Ie2 = g[le]; Ie2 && Ie2.setTransformation(ge[be2][0], ge[be2][1], ge[be2][2], ge[be2][3]), le++; } } this.morph.instanceMatrix.needsUpdate = true; }, ee = (F) => { var $ = 1; L == "AXES_2D" || L == "MIRROR" ? $ = 2 : L == "AXES_3D" && ($ = 3); for (var J, z = F.length, V = 0, oe = 0; oe < z; oe++) { J = F[oe]; for (var ue = 0; ue < $; ue++) { P.setHex(J), this.morph.setColorAt(V, P); var le = g[V]; le && le.setColour(P), V++; } } this.morph.instanceColor.needsUpdate = true; }, ne = () => { var F = B, $ = U, J = k, z = K, V = ie, oe = j, ue = this.inbuildTime / this.duration * (T - 1), le = Math.floor(ue), ve = 1 - (ue - le), xe = Math.ceil(ue); if (C) { var Te = v[le.toString()], de = v[xe.toString()], we = f[le.toString()], se = f[xe.toString()], Se2 = u[le.toString()], ge = u[xe.toString()], be2 = y[le.toString()], Ie2 = y[xe.toString()], et2 = m[le.toString()], mt = m[xe.toString()]; B.length = Te.length, U.length = Te.length, k.length = Te.length, K.length = Te.length, ie.length = Te.length; for (var Ue = 0; Ue < Te.length; Ue++) F[Ue] = ve * Te[Ue] + (1 - ve) * de[Ue], $[Ue] = ve * we[Ue] + (1 - ve) * se[Ue], J[Ue] = ve * Se2[Ue] + (1 - ve) * ge[Ue], z[Ue] = ve * be2[Ue] + (1 - ve) * Ie2[Ue], V[Ue] = ve * et2[Ue] + (1 - ve) * mt[Ue]; } else v[0], l("current_positions"), f[0], l("current_axis1s"), u[0], l("current_axis2s"), y[0], l("current_axis3s"), m[0], l("current_scales"); if (Q(F, $, J, z, V), this.boundingBoxUpdateRequired = true, w != null) { if (R) { var bt2 = w[le.toString()], Ve = w[xe.toString()]; oe.length = bt2.length; for (var lt = 0; lt < bt2.length; lt++) P.setHex(bt2[lt]), I.setHex(Ve[lt]), P.setRGB(P.r * ve + I.r * (1 - ve), P.g * ve + I.g * (1 - ve), P.b * ve + I.b * (1 - ve)), oe[lt] = P.getHex(); } else w[0], l("current_colors"); ee(oe); } }; this.showLabel = () => { for (var F = 0; F < g.length; F++) g[F].showLabel(this.morph.material ? this.morph.material.color : void 0); }; var Y = (F) => { if (S != null && F) for (var $, J = 0; J < M; J++) $ = new (c(16)).Glyph(void 0, void 0, J, this), S != null && S[J] != null && $.setLabel(S[J]), 0 < T && $.setFrustumCulled(false), g[J] = $, this.morph.add($.getGroup()); S != null && F && this.showLabel(this.morph.material ? this.morph.material.color : void 0), Q(v[0], f[0], u[0], y[0], m[0]), w != null && ee(w[0]), this.ready = true, this.boundingBoxUpdateRequired = true; }; this.addCustomGlyph = (F) => { F.isGlyph && g.push(F), this.ready = true, this.boundingBoxUpdateRequired = true; }, this.addMeshAsGlyph = (F, $) => { if (F.isMesh) { var J = new (c(16)).Glyph(void 0, void 0, $, this); return J.fromMesh(F), g.push(J), this.morph.add(J.getGroup()), this.ready = true, this.boundingBoxUpdateRequired = true, J; } }, this.forEachGlyph = (F) => { for (var $ = 0; $ < g.length; $++) F(g[$]); }; var te = (F, $) => (J, z) => { var V = J.toBufferGeometry(); this.geometry.copy(V), this.geometry.computeBoundingSphere(), this.geometry.computeBoundingBox(), V.dispose(), z && z[0] && (this.morph.material = z[0]), Y($), this.morph.name = this.groupName, this.morph.userData = this, this.setMorph(this.morph), J.dispose(), F != null && typeof F == "function" && F(this); }; this.getClosestVertexIndex = function() { var F = -1; if (this.morph && this.ready) { this.getBoundingBox().getCenter(this._v1); for (var $, J = v[0], z = J.length / 3, V = -1, oe = 0, ue = 0; ue < z; ue++) $ = 3 * ue, this._v2.set(J[$], J[$ + 1], J[$ + 2]), oe = this._v1.distanceTo(this._v2), (V == -1 || V > oe) && (V = oe, F = ue); } return F; }, this.getClosestVertex = function() { if (this.closestVertexIndex == -1 && (this.closestVertexIndex = this.getClosestVertexIndex()), 0 <= this.closestVertexIndex && this.morph) { var F = new d.Vector3(); return this.morph.getMatrixAt(this.closestVertexIndex, A), F.setFromMatrixPosition(A), F; } }, this.getBoundingBox = () => { if (this.morph && this.ready && this.morph.visible) { if (this.boundingBoxUpdateRequired) { b.setFromBufferAttribute(this.morph.geometry.attributes.position); for (var F = 0; F < M; F++) this.morph.getMatrixAt(F, A), O.copy(b).applyMatrix4(A), F == 0 ? N.copy(O) : N.union(O); if (N) this.cachedBoundingBox.copy(N), this.morph.updateWorldMatrix(true, true), this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld), this.boundingBoxUpdateRequired = false; else return; } return this.cachedBoundingBox; } }, this.setMorphTime = (F) => { this.inbuildTime = F > this.duration ? this.duration : 0 > F ? 0 : F, (R || C) && (ne(), C && (this.markerUpdateRequired = true)); }, this.isTimeVarying = () => !!((this.ready === false || 0 < T) && (R || C)), this.getCurrentTime = () => this.inbuildTime, this.dispose = () => { for (var F = g.length - 1; 0 <= F; F--) g[F].dispose(); this.geometry && this.geometry.dispose(), this.morph && this.morph.material.dispose(), f = void 0, u = void 0, y = void 0, v = void 0, m = void 0, w = void 0, this.ready = false, this.groupName = void 0; }, this.render = (F, $, J) => { if ($ == true) { var z = this.inbuildTime + F; z > this.duration && (z -= this.duration), this.inbuildTime = z, (R || C) && ne(); } this.updateMarker($, J); }; }; p.prototype = Object.create(c(10).ZincObject.prototype), a.Glyphset = p; }, /* 19 */ /***/ (o, a, c) => { c.r(a), c.d(a, { /* harmony export */ JSONLoader: () => ( /* binding */ M ) /* harmony export */ }); var l = c(4), d = c(20).Loader, h6 = l.LoaderUtils, p = l.AnimationClip, g = l.Vector3, f = l.Vector4, u = l.Color, y = l.Vector2, v = c(6).Face3, m = c(6).Geometry, w = l.FileLoader, S = l.DefaultLoadingManager, T = c(21).VideoHandler; function M(x) { typeof x == "boolean" && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."), x = void 0), this.manager = x === void 0 ? S : x, this.withCredentials = false, this.paramsString = ""; } Object.assign(M.prototype, { load: function(_, E, L, R) { var C = this, A = this.texturePath && typeof this.texturePath == "string" ? this.texturePath : h6.extractUrlBase(_), P = new w(this.manager); _.split("?"), this.paramsString = _.length === 2 ? paramsStrings[1] : "", P.setWithCredentials(this.withCredentials), P.load(_, function(I) { var b = JSON.parse(I), O = b.metadata; if (O !== void 0) { var N = O.type; if (N !== void 0 && N.toLowerCase() === "object") return void console.error("THREE.JSONLoader: " + _ + " should be loaded with THREE.ObjectLoader instead."); } if (C && C.parse) { var D = C.parse(b, A); E(D.geometry, D.materials); } }, L, R); }, setTexturePath: function(_) { this.texturePath = _; }, parse: /* @__PURE__ */ function() { function x(R, C) { function A(Se2, ge) { return Se2 & 1 << ge; } var P, I, b, O, N, D, B, U, k, K, ie, j, G, W, q, Q, ee, ne, Y, te, F, $, J, z, V, oe, ue, le = R.faces, ve = R.vertices, xe = R.normals, Te = R.colors, de = R.scale, we = 0; if (R.uvs !== void 0) { for (P = 0; P < R.uvs.length; P++) R.uvs[P].length && we++; for (P = 0; P < we; P++) C.faceVertexUvs[P] = []; } for (O = 0, N = ve.length; O < N; ) ne = new g(), ne.x = ve[O++] * de, ne.y = ve[O++] * de, ne.z = ve[O++] * de, C.vertices.push(ne); if (O = 0, N = le.length, R.uvs) for (P = 0; P < R.uvs.length; P++) { C.uvs[P] = []; for (var se = 0; se < R.uvs[P].length; se++) C.uvs[P][se] = R.uvs[P][se]; } if (xe) for (P = 0; P < xe.length; P++) C.normals[P] = xe[P]; if (Te) for (P = 0; P < Te.length; P++) C.colors[P] = Te[P]; for (; O < N; ) if (K = le[O++], ie = A(K, 0), j = A(K, 1), G = A(K, 3), W = A(K, 4), q = A(K, 5), Q = A(K, 6), ee = A(K, 7), ie) { if (te = new v(), te.a = le[O], te.b = le[O + 1], te.c = le[O + 3], F = new v(), F.a = le[O + 1], F.b = le[O + 2], F.c = le[O + 3], O += 4, j && (k = le[O++], te.materialIndex = k, F.materialIndex = k), b = C.faces.length, G) for (P = 0; P < we; P++) for (z = R.uvs[P], C.faceVertexUvs[P][b] = [], C.faceVertexUvs[P][b + 1] = [], I = 0; 4 > I; I++) U = le[O++], oe = z[2 * U], ue = z[2 * U + 1], V = new y(oe, ue), I !== 2 && C.faceVertexUvs[P][b].push(V), I !== 0 && C.faceVertexUvs[P][b + 1].push(V); if (W && (B = 3 * le[O++], te.normal.set(xe[B++], xe[B++], xe[B]), F.normal.copy(te.normal)), q) for (P = 0; 4 > P; P++) B = 3 * le[O++], J = new g(xe[B++], xe[B++], xe[B]), P !== 2 && te.vertexNormals.push(J), P !== 0 && F.vertexNormals.push(J); if (Q && (D = le[O++], $ = Te[D], te.color.setHex($), F.color.setHex($)), ee) for (P = 0; 4 > P; P++) D = le[O++], $ = Te[D], P !== 2 && te.vertexColors.push(new u($)), P !== 0 && F.vertexColors.push(new u($)); C.faces.push(te), C.faces.push(F); } else { if (Y = new v(), Y.a = le[O++], Y.b = le[O++], Y.c = le[O++], j && (k = le[O++], Y.materialIndex = k), b = C.faces.length, G) for (P = 0; P < we; P++) for (z = R.uvs[P], C.faceVertexUvs[P][b] = [], I = 0; 3 > I; I++) U = le[O++], oe = z[2 * U], ue = z[2 * U + 1], V = new y(oe, ue), C.faceVertexUvs[P][b].push(V); if (W && (B = 3 * le[O++], Y.normal.set(xe[B++], xe[B++], xe[B])), q) for (P = 0; 3 > P; P++) B = 3 * le[O++], J = new g(xe[B++], xe[B++], xe[B]), Y.vertexNormals.push(J); if (Q && (D = le[O++], Y.color.setHex(Te[D])), ee) for (P = 0; 3 > P; P++) D = le[O++], Y.vertexColors.push(new u(Te[D])); C.faces.push(Y); } } function _(R, C) { var A = R.influencesPerVertex === void 0 ? 2 : R.influencesPerVertex; if (R.skinWeights) for (var P = 0, I = R.skinWeights.length; P < I; P += A) { var b = R.skinWeights[P], O = 1 < A ? R.skinWeights[P + 1] : 0, N = 2 < A ? R.skinWeights[P + 2] : 0, D = 3 < A ? R.skinWeights[P + 3] : 0; C.skinWeights.push(new f(b, O, N, D)); } if (R.skinIndices) for (var P = 0, I = R.skinIndices.length; P < I; P += A) { var B = R.skinIndices[P], U = 1 < A ? R.skinIndices[P + 1] : 0, k = 2 < A ? R.skinIndices[P + 2] : 0, K = 3 < A ? R.skinIndices[P + 3] : 0; C.skinIndices.push(new f(B, U, k, K)); } C.bones = R.bones, C.bones && 0 < C.bones.length && (C.skinWeights.length !== C.skinIndices.length || C.skinIndices.length !== C.vertices.length) && console.warn("When skinning, number of vertices (" + C.vertices.length + "), skinIndices (" + C.skinIndices.length + "), and skinWeights (" + C.skinWeights.length + ") should match."); } function E(R, C) { var A = R.scale; if (R.morphTargets !== void 0) for (var P = 0, I = R.morphTargets.length; P < I; P++) { C.morphTargets[P] = {}, C.morphTargets[P].name = R.morphTargets[P].name, C.morphTargets[P].vertices = []; for (var b, O = C.morphTargets[P].vertices, N = R.morphTargets[P].vertices, D = 0, B = N.length; D < B; D += 3) b = new g(), b.x = N[D] * A, b.y = N[D + 1] * A, b.z = N[D + 2] * A, O.push(b); } if (R.morphNormals !== void 0) { for (var P = 0, I = R.morphNormals.length; P < I; P++) if (C.morphTargets[P]) { C.morphTargets[P].normals = []; for (var U, k = C.morphTargets[P].normals, K = R.morphNormals[P].normals, D = 0, B = K.length; D < B; D += 3) U = new g(), U.x = K[D], U.y = K[D + 1], U.z = K[D + 2], k.push(U); C.morphNormalsReady = true; } } if (R.morphColors !== void 0) { var P, I, ie, j, G, W, q; for (P = 0, I = R.morphColors.length; P < I; P++) for (C.morphColors[P] = {}, C.morphColors[P].name = R.morphColors[P].name, C.morphColors[P].colors = [], G = C.morphColors[P].colors, W = R.morphColors[P].colors, ie = 0, j = W.length; ie < j; ie += 3) q = new l.Color(16755200), q.setRGB(W[ie], W[ie + 1], W[ie + 2]), G.push(q); } } function L(R, C) { var A = [], P = []; R.animation !== void 0 && P.push(R.animation), R.animations !== void 0 && (R.animations.length ? P = P.concat(R.animations) : P.push(R.animations)); for (var I, b = 0; b < P.length; b++) I = p.parseAnimation(P[b], C.bones), I && A.push(I); if (C.morphTargets) { var O = p.CreateClipsFromMorphTargetSequences(C.morphTargets, 10); A = A.concat(O); } 0 < A.length && (C.animations = A); } return function(R, C) { R.data !== void 0 && (R = R.data), R.scale = R.scale === void 0 ? 1 : 1 / R.scale; var A = new m(); if (A.morphColors = [], x(R, A), _(R, A), E(R, A), L(R, A), A.computeFaceNormals(), A.computeBoundingSphere(), R.materials === void 0 || R.materials.length === 0) return { geometry: A }; var P = d.prototype.initMaterials(R.materials, C, "Anonymous"); if (R.materials[0].video) { var I = C + R.materials[0].video; this.paramsString && (I += "?".concat(this.paramsString)); var b = new T(I); A._video = b; } return P && 0 < P.length && (P[0].side = R.materials[0].singleSided ? l.FrontSide : R.materials[0].flipSided ? l.BackSide : l.DoubleSide, R.materials[0].specularCoef && (P[0].shininess = Math.floor(R.materials[0].specularCoef / 3))), { geometry: A, materials: P }; }; }() }); }, /* 20 */ /***/ (o, a, c) => { c.r(a), c.d(a, { /* harmony export */ Loader: () => ( /* binding */ d ) /* harmony export */ }); var l = c(4); c(4); function d() { } d.Handlers = { handlers: [], add: function(p, g) { this.handlers.push(p, g); }, get: function(p) { for (var g = this.handlers, f = 0, u = g.length; f < u; f += 2) { var y = g[f], v = g[f + 1]; if (y.test(p)) return v; } return null; } }, Object.assign(d.prototype, { crossOrigin: "anonymous", onLoadStart: function() { }, onLoadProgress: function() { }, onLoadComplete: function() { }, initMaterials: function(p, g, f) { for (var u = [], y = 0; y < p.length; ++y) u[y] = this.createMaterial(p[y], g, f); return u; }, createMaterial: function() { var h6 = { NoBlending: l.NoBlending, NormalBlending: l.NormalBlending, AdditiveBlending: l.AdditiveBlending, SubtractiveBlending: l.SubtractiveBlending, MultiplyBlending: l.MultiplyBlending, CustomBlending: l.CustomBlending }, p = new l.Color(), g = new l.TextureLoader(), f = new l.MaterialLoader(); return function(u, y, v) { function m(x, _, E, L, R) { var C, A = y + x, P = d.Handlers.get(A); P === null ? (g.setCrossOrigin(v), C = g.load(A)) : C = P.load(A), _ !== void 0 && (C.repeat.fromArray(_), _[0] !== 1 && (C.wrapS = l.RepeatWrapping), _[1] !== 1 && (C.wrapT = l.RepeatWrapping)), E !== void 0 && C.offset.fromArray(E), L !== void 0 && (L[0] === "repeat" && (C.wrapS = l.RepeatWrapping), L[0] === "mirror" && (C.wrapS = l.MirroredRepeatWrapping), L[1] === "repeat" && (C.wrapT = l.RepeatWrapping), L[1] === "mirror" && (C.wrapT = l.MirroredRepeatWrapping)), R !== void 0 && (C.anisotropy = R); var I = l.MathUtils.generateUUID(); return w[I] = C, I; } var w = {}, S = { uuid: l.MathUtils.generateUUID(), type: "MeshLambertMaterial" }; for (var T in u) { var M = u[T]; switch (T) { case "DbgColor": case "DbgIndex": case "opticalDensity": case "illumination": break; case "DbgName": S.name = M; break; case "blending": S.blending = h6[M]; break; case "colorAmbient": case "mapAmbient": console.warn("THREE.Loader.createMaterial:", T, "is no longer supported."); break; case "colorDiffuse": S.color = p.fromArray(M).getHex(); break; case "colorSpecular": S.specular = p.fromArray(M).getHex(); break; case "colorEmissive": S.emissive = p.fromArray(M).getHex(); break; case "specularCoef": S.shininess = M; break; case "shading": M.toLowerCase() === "basic" && (S.type = "MeshBasicMaterial"), M.toLowerCase() === "phong" && (S.type = "MeshPhongMaterial"), M.toLowerCase() === "standard" && (S.type = "MeshStandardMaterial"); break; case "mapDiffuse": S.map = m(M, u.mapDiffuseRepeat, u.mapDiffuseOffset, u.mapDiffuseWrap, u.mapDiffuseAnisotropy); break; case "mapDiffuseRepeat": case "mapDiffuseOffset": case "mapDiffuseWrap": case "mapDiffuseAnisotropy": break; case "mapEmissive": S.emissiveMap = m(M, u.mapEmissiveRepeat, u.mapEmissiveOffset, u.mapEmissiveWrap, u.mapEmissiveAnisotropy); break; case "mapEmissiveRepeat": case "mapEmissiveOffset": case "mapEmissiveWrap": case "mapEmissiveAnisotropy": break; case "mapLight": S.lightMap = m(M, u.mapLightRepeat, u.mapLightOffset, u.mapLightWrap, u.mapLightAnisotropy); break; case "mapLightRepeat": case "mapLightOffset": case "mapLightWrap": case "mapLightAnisotropy": break; case "mapAO": S.aoMap = m(M, u.mapAORepeat, u.mapAOOffset, u.mapAOWrap, u.mapAOAnisotropy); break; case "mapAORepeat": case "mapAOOffset": case "mapAOWrap": case "mapAOAnisotropy": break; case "mapBump": S.bumpMap = m(M, u.mapBumpRepeat, u.mapBumpOffset, u.mapBumpWrap, u.mapBumpAnisotropy); break; case "mapBumpScale": S.bumpScale = M; break; case "mapBumpRepeat": case "mapBumpOffset": case "mapBumpWrap": case "mapBumpAnisotropy": break; case "mapNormal": S.normalMap = m(M, u.mapNormalRepeat, u.mapNormalOffset, u.mapNormalWrap, u.mapNormalAnisotropy); break; case "mapNormalFactor": S.normalScale = M; break; case "mapNormalRepeat": case "mapNormalOffset": case "mapNormalWrap": case "mapNormalAnisotropy": break; case "mapSpecular": S.specularMap = m(M, u.mapSpecularRepeat, u.mapSpecularOffset, u.mapSpecularWrap, u.mapSpecularAnisotropy); break; case "mapSpecularRepeat": case "mapSpecularOffset": case "mapSpecularWrap": case "mapSpecularAnisotropy": break; case "mapMetalness": S.metalnessMap = m(M, u.mapMetalnessRepeat, u.mapMetalnessOffset, u.mapMetalnessWrap, u.mapMetalnessAnisotropy); break; case "mapMetalnessRepeat": case "mapMetalnessOffset": case "mapMetalnessWrap": case "mapMetalnessAnisotropy": break; case "mapRoughness": S.roughnessMap = m(M, u.mapRoughnessRepeat, u.mapRoughnessOffset, u.mapRoughnessWrap, u.mapRoughnessAnisotropy); break; case "mapRoughnessRepeat": case "mapRoughnessOffset": case "mapRoughnessWrap": case "mapRoughnessAnisotropy": break; case "mapAlpha": S.alphaMap = m(M, u.mapAlphaRepeat, u.mapAlphaOffset, u.mapAlphaWrap, u.mapAlphaAnisotropy); break; case "mapAlphaRepeat": case "mapAlphaOffset": case "mapAlphaWrap": case "mapAlphaAnisotropy": break; case "flipSided": S.side = l.BackSide; break; case "doubleSided": S.side = l.DoubleSide; break; case "transparency": console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"), S.opacity = M; break; case "depthTest": case "depthWrite": case "colorWrite": case "opacity": case "reflectivity": case "transparent": case "visible": case "wireframe": S[T] = M; break; case "vertexColors": M === true && (S.vertexColors = l.VertexColors), M === "face" && (S.vertexColors = l.FaceColors); break; default: console.error("THREE.Loader.createMaterial: Unsupported", T, M); } } return S.type === "MeshBasicMaterial" && delete S.emissive, S.type !== "MeshPhongMaterial" && delete S.specular, 1 > S.opacity && (S.transparent = true), f.setTextures(w), f.parse(S); }; }() }); }, /* 21 */ /***/ (o, a, c) => { var l = c(4); a.VideoHandler = function(d) { var h6 = this; this.video = void 0, this.videoTexture = void 0, this.setMorphTime = function(p, g) { var f = p / g * h6.video.duration; h6.video.currentTime = f; }, this.getVideoDuration = function() { return h6.video.duration; }, this.createCanvasVideoTexture = function() { return h6.videoTexture = new l.VideoTexture(h6.video), h6.videoTexture.minFilter = l.LinearFilter, h6.videoTexture.magFilter = l.LinearFilter, h6.videoTexture.format = l.RGBFormat, h6.video.currentTime = 0, h6.videoTexture; }, this.getCurrentTime = function(p) { return h6.video ? p * (h6.video.currentTime / h6.video.duration) : 0; }, this.isReadyToPlay = function() { return !!(h6.video && 3 <= h6.video.readyState); }, function() { document && (h6.video = document.createElement("video"), h6.video.crossOrigin = "anonymous", h6.video.src = d, h6.video.load(), h6.video.loop = true); }(); }; }, /* 22 */ /***/ (o, a, c) => { var l = c(4), d = c(23).Points, h6 = c(5).toBufferGeometry, p = c(5).getCircularTexture, g = c(17).Label, f = function() { c(10).ZincObject.call(this), this.isPointset = true; var u = []; this.createMesh = (v, m, w) => { if (v && m) { var S = h6(v, w), T = p(); m.map = T; var M = new d(S, m); this.setMesh(M, w.localTimeEnabled, w.localMorphColour); } }; var y = (v, m, w, S) => { if (w) { var T = new l.Color(S), M = new g(w, T); M.setPosition(m[0], m[1], m[2]); var x = M.getSprite(); x.material.sizeAttenuation = false, x.material.alphaTest = 0.5, x.material.transparent = true, x.material.depthWrite = false, x.material.depthTest = false, this.group.add(x), u[v] = M; } }; this.addPoints = (v, m, w) => { if (v && 0 < v.length) { var S = this.drawRange - 1, T = this.addVertices(v), M = this.getMorph(); if (!M) { var x = new l.PointsMaterial({ alphaTest: 0.5, size: 10, color: w, sizeAttenuation: false }); T.colorsNeedUpdate = true, this.createMesh(T, x, { localTimeEnabled: false, localMorphColour: false }); } var _ = S + v.length, E = 0; if (Array.isArray(m) && m.length === v.length || typeof m == "string") for (S; S + E < _; ) { var L = typeof m == "string" ? m : m[E]; y(E, v[E], L, w), E++; } this.region && (this.region.pickableUpdateRequired = true); } }, this.setSize = (v) => { this.morph && this.morph.material && (this.morph.material.size = v, this.morph.material.needsUpdate = true); }, this.setSizeAttenuation = (v) => { this.morph && this.morph.material && (this.morph.material.sizeAttenuation = v, this.morph.material.needsUpdate = true); }, this.getVerticesByIndex = function(v) { if (0 <= v && this.drawRange > v) { var m = this.getMorph().geometry.getAttribute("position"); return [m.getX(v), m.getY(v), m.getZ(v)]; } }, this.editVertices = function(v, m) { if (v && v.length) { var w = this.getMorph(), S = m + v.length - 1; if (!w || 0 > m || S >= this.drawRange) return; var T = w.geometry.getAttribute("position"), M = m; v.forEach((x) => { var _ = u[M]; _ && _.setPosition(x[0], x[1], x[2]), T.setXYZ(M++, x[0], x[1], x[2]); }), T.needsUpdate = true, this.boundingBoxUpdateRequired = true; } }, this.render = (v, m, w, S) => { this.morph && w && (this.morph.sizePerPixel = w.pixelHeight), f.prototype.render.call(this, v, m, w, S); }; }; f.prototype = Object.create(c(10).ZincObject.prototype), a.Pointset = f; }, /* 23 */ /***/ (o, a, c) => { c.r(a), c.d(a, { /* harmony export */ Points: () => ( /* binding */ y ) /* harmony export */ }); var l = c(4), d = new l.Matrix4(), h6 = new l.Ray(), p = new l.Sphere(), g = new l.Vector3(), f = new l.Vector3(), u = new l.Vector3(); class y extends l.Object3D { constructor() { var S = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : new l.BufferGeometry(), T = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : new l.PointsMaterial(); super(), this.type = "Points", this.geometry = S, this.material = T, this.sizePerPixel = 1, this.updateMorphTargets(); } copy(S) { return super.copy(S), this.material = S.material, this.geometry = S.geometry, this; } raycast(S, T) { var M = this.geometry, x = this.matrixWorld, _ = S.params.Points.threshold, E = M.drawRange; if (M.boundingSphere === null && M.computeBoundingSphere(), p.copy(M.boundingSphere), p.applyMatrix4(x), p.radius += _, S.ray.intersectsSphere(p) !== false) { d.copy(x).invert(), h6.copy(S.ray).applyMatrix4(d); var L = _ / ((this.scale.x + this.scale.y + this.scale.z) / 3) * this.material.size * this.sizePerPixel, R = L * L; if (M.isBufferGeometry) { var C = M.index, A = M.attributes, P = A.position, I = M.morphAttributes.position; if (C !== null) for (var b, O = Math.max(0, E.start), N = Math.min(C.count, E.start + E.count), D = O; D < N; D++) b = C.getX(D), m(this, P, I, b), v(g, b, R, x, S, T, this); else for (var B = Math.max(0, E.start), U = Math.min(P.count, E.start + E.count), k = B; k < U; k++) m(this, P, I, k), v(g, k, R, x, S, T, this); } else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."); } } updateMorphTargets() { var S = this.geometry; if (S.isBufferGeometry) { var T = S.morphAttributes, M = Object.keys(T); if (0 < M.length) { var x = T[M[0]]; if (x !== void 0) { this.morphTargetInfluences = [], this.morphTargetDictionary = {}; for (var _, E = 0, L = x.length; E < L; E++) _ = x[E].name || E + "", this.morphTargetInfluences.push(0), this.morphTargetDictionary[_] = E; } } } else { var R = S.morphTargets; R !== void 0 && 0 < R.length && console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead."); } } } y.prototype.isPoints = true; function v(w, S, T, M, x, _, E) { var L = h6.distanceSqToPoint(w); if (L < T) { var R = new l.Vector3(); h6.closestPointToPoint(w, R), R.applyMatrix4(M); var C = x.ray.origin.distanceTo(R); if (C < x.near || C > x.far) return; _.push({ distance: C, distanceToRay: Math.sqrt(L), point: R, index: S, face: null, object: E }); } } function m(w, S, T, M) { g.fromBufferAttribute(S, M); var x = w.morphTargetInfluences; if (w.material.morphTargets && T && x) { f.set(0, 0, 0); for (var _ = 0, E = T.length; _ < E; _++) { var L = x[_], R = T[_]; L !== 0 && (u.fromBufferAttribute(R, M), f.addScaledVector(u.sub(g), L)); } g.add(f); } } }, /* 24 */ /***/ (o, a, c) => { var l = c(4), d = c(5).toBufferGeometry, h6 = function() { c(10).ZincObject.call(this), this.isLines = true, this.createLineSegment = (p, g, f) => { if (p && g) { var u = d(p, f); f.localMorphColour && u.morphAttributes.color && (g.onBeforeCompile = c(9).augmentMorphColor()); var y = new (c(12)).LineSegments(u, g); this.setMesh(y, f.localTimeEnabled, f.localMorphColour); } }, this.setWidth = (p) => { this.morph && this.morph.material && (this.morph.material.linewidth = p, this.morph.material.needsUpdate = true); }, this.addLines = (p, g) => { if (p && 0 < p.length) { var f = this.addVertices(p), u = this.getMorph(); if (!u) { var y = new l.LineBasicMaterial({ color: g }); f.colorsNeedUpdate = true, this.createLineSegment(f, y, { localTimeEnabled: false, localMorphColour: false }); } this.region && (this.region.pickableUpdateRequired = true); } }; }; h6.prototype = Object.create(c(10).ZincObject.prototype), a.Lines = h6; }, /* 25 */ /***/ (o, a, c) => { function l(g, f, u, y, v, m, w) { try { var S = g[m](w), T = S.value; } catch (M) { return void u(M); } S.done ? f(T) : Promise.resolve(T).then(y, v); } function d(g) { return function() { var f = this, u = arguments; return new Promise(function(y, v) { function m(T) { l(S, y, v, m, w, "next", T); } function w(T) { l(S, y, v, m, w, "throw", T); } var S = g.apply(f, u); m(void 0); }); }; } var h6 = c(4), p = function() { var g = this; c(26).Texture.call(this), this.isTextureArray = true, this.loadFromImages = function() { var f = d(function* (u) { var y = 1, v = 1, m = 0; if (u && u.length) { g.isLoading = true; var w = new Image(); w.crossOrigin = "Anonymous"; for (var S, T = document.createElement("canvas"), M = 0, x = Array(u.length), _ = 0; _ < u.length; _++) S = yield g.imageToUint8Array(g, w, u[_], T), S && S.array && (y = S.width, v = S.height, x[m] = S.array, M += x[m].length, m++); var E = new Uint8Array(M); M = 0, x.forEach((L) => { E.set(L, M), M += L.length; }), g.impl = new h6.DataTexture2DArray(E, y, v, m), g.size = { width: y, height: v, depth: m }, g.isLoading = false, g.impl.needsUpdate = true; } }); return function() { return f.apply(this, arguments); }; }(), this.getMaterial = (f) => { if (this.impl) { var u; if (!f) u = new h6.MeshBasicMaterial({ color: new h6.Color(1, 1, 1), transparent: false, opacity: 1, map: this.impl, side: h6.DoubleSide }); else if (f.vs && f.fs) { var y = true; f.transparent && (y = f.transparent); var v = h6.FrontSide; f.side && (v = f.side), u = new h6.ShaderMaterial({ transparent: y, uniforms: f.uniforms, vertexShader: f.vs, fragmentShader: f.fs, side: v }), f.glslVersion && (u.glslVersion = f.glslVersion); } if (u) return u.needsUpdate = true, u; } }; }; p.prototype = Object.create(c(26).Texture.prototype), a.TextureArray = p; }, /* 26 */ /***/ (o, a, c) => { function l(g, f, u, y, v, m, w) { try { var S = g[m](w), T = S.value; } catch (M) { return void u(M); } S.done ? f(T) : Promise.resolve(T).then(y, v); } function d(g) { return function() { var f = this, u = arguments; return new Promise(function(y, v) { function m(T) { l(S, y, v, m, w, "next", T); } function w(T) { l(S, y, v, m, w, "throw", T); } var S = g.apply(f, u); m(void 0); }); }; } var h6 = c(4), p = function() { this.isTexture = true, this.impl = void 0, this.isLoading = false, this.size = { width: 1, height: 1, depth: 0 }; }; p.prototype.loadImage = function(g, f) { return new Promise((u, y) => { g.onload = () => u(g), g.onerror = y, g.src = f; }); }, p.prototype.imageToUint8Array = function() { var g = d(function* (f, u, y, v) { yield f.loadImage(u, y), v.width = u.width, v.height = u.height; var m = v.getContext("2d"); return m.drawImage(u, 0, 0), { array: new Uint8Array(m.getImageData(0, 0, v.width, v.height).data.buffer), width: v.width, height: v.height }; }); return function() { return g.apply(this, arguments); }; }(), p.prototype.loadFromImages = function() { var g = d(function* () { }); return function() { return g.apply(this, arguments); }; }(), p.prototype.isReady = function() { return !(!this.impl || this.isLoading); }, p.prototype.getMaterial = function() { if (this.impl) return new h6.MeshBasicMaterial({ color: new h6.Color(1, 1, 1), transparent: false, opacity: 1, map: this.impl, side: h6.DoubleSide }); }, a.Texture = p; }, /* 27 */ /***/ (o, a, c) => { function l(v, m) { var w = Object.keys(v); if (Object.getOwnPropertySymbols) { var S = Object.getOwnPropertySymbols(v); m && (S = S.filter(function(T) { return Object.getOwnPropertyDescriptor(v, T).enumerable; })), w.push.apply(w, S); } return w; } function d(v) { for (var m, w = 1; w < arguments.length; w++) m = arguments[w] == null ? {} : arguments[w], w % 2 ? l(Object(m), true).forEach(function(S) { h6(v, S, m[S]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(v, Object.getOwnPropertyDescriptors(m)) : l(Object(m)).forEach(function(S) { Object.defineProperty(v, S, Object.getOwnPropertyDescriptor(m, S)); }); return v; } function h6(v, m, w) { return m = p(m), m in v ? Object.defineProperty(v, m, { value: w, enumerable: true, configurable: true, writable: true }) : v[m] = w, v; } function p(v) { var m = g(v, "string"); return typeof m == "symbol" ? m : m + ""; } function g(v, m) { if (typeof v != "object" || !v) return v; var w = v[Symbol.toPrimitive]; if (w !== void 0) { var S = w.call(v, m || "default"); if (typeof S != "object") return S; throw new TypeError("@@toPrimitive must return a primitive value."); } return (m === "string" ? String : Number)(v); } var f = c(4), u = c(28), y = function(v) { c(29).TexturePrimitive.call(this, v), this.isTextureSlides = true; var m = [], w = {}; this.morph = new f.Group(), this.group = this.morph, this.morph.userData = this; var S = true; this.createSlides = (x) => { x.forEach((_) => this.createSlide(_)); }; var T = (x, _) => { var E = x.material, L = E.uniforms; switch (x.rotation.x = 0, x.rotation.y = 0, x.rotation.z = 0, x.position.x = 0, x.position.y = 0, x.position.z = 0, _.direction) { case "x": var R = S ? -Math.PI / 2 : Math.PI / 2; x.rotation.y = R, L.direction.value = 1, L.slide.value.set(_.value, 0, 0), x.position.x = _.value; break; case "y": x.rotation.x = Math.PI / 2, L.direction.value = 2, L.slide.value.set(0, _.value, 0), x.position.y = _.value; break; case "z": L.direction.value = 3, L.slide.value.set(0, 0, _.value), x.position.z = _.value; break; } E.needsUpdate = true, this.boundingBoxUpdateRequired = true; }; this.modifySlideSettings = (x) => { x && x.id && x.id in w && w[x.id] && T(w[x.id], x); }, this.createSlide = (x) => { if (this.texture && this.texture.isTextureArray && this.texture.isReady() && x && x.direction && x.value !== void 0) { var _ = new f.PlaneGeometry(1, 1); _.translate(0.5, 0.5, 0); var E = u.getUniforms(); E.diffuse.value = this.texture.impl, E.depth.value = this.texture.size.depth, E.flipY.value = S; var L = { fs: u.fs, vs: u.vs, uniforms: E, glslVersion: u.glslVersion, side: f.DoubleSide, transparent: false }, R = this.texture.getMaterial(L); R.needsUpdate = true; var C = new f.Mesh(_, R); C.name = this.groupName, C.userData = this; var A = { value: x.value, direction: x.direction, id: C.id }; return m.push(A), T(C, A), w[C.id] = C, this.morph.add(C), this.boundingBoxUpdateRequired = true, A; } }, this.getTextureSettings = () => [...m], this.getTextureSettingsWithId = (x) => { for (var _ = 0; _ < m.length; _++) if (x === m[_].id) return d({}, m[_]); }, this.getSlides = () => this.morph ? [...this.morph.children] : [], this.removeSlide = (x) => { x && this.removeSlideWithId(x.id); }, this.removeSlideWithId = (x) => { if (this.morph && x in w && w[x]) { if (this.morph.getObjectById(x)) { var _ = w[x]; this.morph.remove(_), _.clear(), _.geometry && _.geometry.dispose(), _.material && _.material.dispose(), this.boundingBoxUpdateRequired = true; } var E = m.findIndex((L) => L.id === x); -1 < E && m.splice(E, 1); } }, this.dispose = () => { this.morph.children.forEach((x) => { x.geometry && x.geometry.dispose(), x.material && x.material.dispose(); }), c(29).TexturePrimitive.prototype.dispose.call(this), this.boundingBoxUpdateRequired = true; }; var M = (x, _, E) => { switch (_.direction.value) { case 1: E.copy(_.slide.value), x.expandByPoint(E), E.setY(1), E.setZ(1), x.expandByPoint(E); break; case 2: E.copy(_.slide.value), x.expandByPoint(E), E.setX(1), E.setZ(1), x.expandByPoint(E); break; case 3: E.copy(_.slide.value), x.expandByPoint(E), E.setX(1), E.setY(1), x.expandByPoint(E); break; } }; this.getBoundingBox = () => { if (this.morph && this.morph.children && this.morph.visible && this.boundingBoxUpdateRequired) { this.cachedBoundingBox.makeEmpty(); var x = new f.Vector3(0, 0, 0); this.morph.children.forEach((_) => { M(this.cachedBoundingBox, _.material.uniforms, x); }), this.morph.updateMatrixWorld(true, true), this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld), this.boundingBoxUpdateRequired = false; } return this.cachedBoundingBox; }, this.applyTransformation = (x, _, E) => { var L = new f.Matrix4(); L.set(x[0], x[1], x[2], 0, x[3], x[4], x[5], 0, x[6], x[7], x[8], 0, 0, 0, 0, 0); var R = new f.Quaternion().setFromRotationMatrix(L); this.morph.position.set(..._), this.morph.quaternion.copy(R), this.morph.scale.set(...E), this.morph.updateMatrix(), this.boundingBoxUpdateRequired = true; }, this.initialise = (x, _) => { if (x) { var E = x.locations; E && 0 < E.length && (this.applyTransformation(E[0].orientation, E[0].position, E[0].scale), "flipY" in E[0] && (S = E[0].flipY)), this.createSlides(x.settings.slides), _ != null && typeof _ == "function" && _(this); } }; }; y.prototype = Object.create(c(29).TexturePrimitive.prototype), y.prototype.constructor = y, a.TextureSlides = y; }, /* 28 */ /***/ (o, a, c) => { var l = c(4), d = l.GLSL3, h6 = ` 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 ); } `, p = ` 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); } `, g = function() { return { diffuse: { value: void 0 }, depth: { value: 1 }, slide: { value: new l.Vector3(0, 0, 1) }, direction: { value: 1 }, flipY: { value: true } }; }; a.fs = h6, a.vs = p, a.glslVersion = d, a.getUniforms = g; }, /* 29 */ /***/ (o, a, c) => { c(4); var l = c(5).resolveURL, d = function(h6) { c(10).ZincObject.call(this), this.isTexturePrimitive = true, this.texture = h6, this.load = (p, g) => { if (p && p.images && p.images.source) { var f = new (c(25)).TextureArray(), u = []; p.images.source.forEach((v) => { u.push(l(v)); }); var y = this; f.loadFromImages(u).then(() => { y.texture = f, y.initialise(p, g); }); } }, this.initialise = (p, g) => { g != null && typeof g == "function" && g(this); }; }; d.prototype = Object.create(c(10).ZincObject.prototype), d.prototype.constructor = d, a.TexturePrimitive = d; }, /* 30 */ /***/ (o, a, c) => { var l = c(4), d = c(31); a.Renderer = function(h6, p) { var g = h6, f = p, u = void 0, y = new l.Clock(false); this.playAnimation = true; var v = 1e3, m = [], w = 0, S = [], T = 0, M = void 0, x = void 0, _ = void 0, E = void 0, L = [], R = [], C = new l.Group(), A = void 0, P = void 0, I = false; this.getDrawingWidth = () => g ? g.clientWidth : A ? typeof A.clientWidth > "u" ? Math.round(A.width) : Math.round(A.clientWidth) : 0, this.getDrawingHeight = () => g ? g.clientHeight : A ? typeof A.clientHeight > "u" ? Math.round(A.height) : Math.round(A.clientHeight) : 0, this.onWindowResize = () => { u.onWindowResize(); var N = this.getDrawingWidth(), D = this.getDrawingHeight(); if (f != null) { var B; g ? (B = g.getBoundingClientRect(), f.setSize(N, D)) : A && (typeof A.getBoundingClientRect > "u" || (B = A.getBoundingClientRect(), A.width = N, A.height = D), f.setSize(N, D, false)), B && (B.left, B.top); var U = new l.Vector2(); f.getSize(U), U.x, U.y, console.log("onWindowResize"); } }, this.initialiseVisualisation = (N) => { if (N = N || {}, N.antialias === void 0) { var D = false; try { /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) && (D = true); } catch { D = false; } N.antialias = !D; } N.canvas && (g = void 0, A = N.canvas), f = new l.WebGLRenderer(N), g !== void 0 && g.appendChild(f.domElement), f.setClearColor(16777215, 1), A && A.style && (A.style.height = "100%", A.style.width = "100%"), f.autoClear = false; var B = this.createScene("default"); this.setCurrentScene(B); }, this.getCurrentScene = () => u, this.setCurrentScene = (N) => { if (N) { this.removeActiveScene(N); var D = u; u = N, D && D.setInteractiveControlEnable(false), u.setInteractiveControlEnable(true), u.setAdditionalScenesGroup(C), this.onWindowResize(); } }, this.getSceneByName = (N) => L[N], this.createScene = (N) => { if (L[N] == null) { var D; return D = A ? new (c(32)).Scene(A, f) : new (c(32)).Scene(g, f), L[N] = D, D.sceneName = N, D; } }, this.resetView = () => { u.resetView(); }, this.viewAll = () => { if (u) { var N = u.getBoundingBox(); if (N) { for (var D, B = 0; B < R.length; B++) D = R[B].getBoundingBox(), D && N.union(D); u.viewAllWithBoundingBox(N); } } }, this.loadModelsURL = (N, D, B, U, k, K) => { u.loadModelsURL(N, D, B, U, k, K); }, this.loadViewURL = (N) => { u.loadViewURL(N); }, this.loadFromViewURL = (N, D) => { u.loadFromViewURL(N, D); }, this.updateDirectionalLight = () => { u.updateDirectionalLight(); }; var b = () => { I ? (M = requestAnimationFrame(b), this.render()) : (cancelAnimationFrame(M), M = void 0); }; this.stopAnimate = () => { I && (y.stop(), I = false); }, this.animate = () => { I || (y.start(), I = true, b()); }, this.addPreRenderCallbackFunction = (N) => (++w, m[w] = N, w), this.removePreRenderCallbackFunction = (N) => { N in m && delete m[N]; }, this.addPostRenderCallbackFunction = (N) => (++T, S[T] = N, T), this.removePostRenderCallbackFunction = (N) => { N in S && delete S[N]; }, this.getPlayRate = () => v, this.setPlayRate = (N) => { v = N; }, this.getCurrentTime = () => u.getCurrentTime(), this.setMorphsTime = (N) => { u.setMorphsTime(N); }, this.getZincGeometryByID = (N) => u.getZincGeometryByID(N), this.addToScene = (N) => { u.addObject(N); }, this.addToOrthoScene = (N) => { if (_ == null && (_ = new l.Scene()), x == null) { var D = this.getDrawingWidth(), B = this.getDrawingHeight(); x = new l.OrthographicCamera(-D / 2, D / 2, B / 2, -B / 2, 1, 10), x.position.z = 10; } _.add(N); }; var O = (N) => (D) => { D.needsUpdate = true; var B = new l.SpriteMaterial({ map: D }), U = B.map.image.width, k = B.map.image.height; N.material = B, N.scale.set(U, k, 1); var K = this.getDrawingWidth(), ie = this.getDrawingHeight(); N.position.set((K - U) / 2, (-ie + k) / 2, 1), this.addToOrthoScene(N); }; this.addLogo = () => { E = new l.Sprite(), l.ImageUtils.loadTexture("images/abi_big_logo_transparent_small.png", void 0, O(E)); }, this.render = () => { P || (g ? 0 < g.clientWidth && 0 < g.clientHeight && (P = new d(g, this.onWindowResize)) : A && 0 < A.width && 0 < A.height && (P = new d(A, this.onWindowResize))); var N = y.getDelta(); u.renderGeometries(v, N, this.playAnimation); for (var D, B = 0; B < R.length; B++) D = R[B], D.renderGeometries(v, N, this.playAnimation); for (var U in x != null && _ != null && (f.clearDepth(), f.render(_, x)), m) m.hasOwnProperty(U) && m[U].call(); for (var k in u.render(f), S) S.hasOwnProperty(k) && S[k].call(); }, this.getThreeJSRenderer = () => f, this.isSceneActive = (N) => { if (u === N) return true; for (var D, B = 0; B < R.length; B++) if (D = R[B], D === N) return true; return false; }, this.addActiveScene = (N) => { this.isSceneActive(N) || (R.push(N), C.add(N.getThreeJSScene())); }, this.removeActiveScene = (N) => { for (var D, B = 0; B < R.length; B++) if (D = R[B], D === N) return R.splice(B, 1), void C.remove(N.getThreeJSScene()); }, this.clearAllActiveScene = () => { for (var N = 0; N < R.length; N++) C.remove(R[N].getThreeJSScene()); R.splice(0, R.length); }, this.dispose = () => { for (var N in I && cancelAnimationFrame(M), L) L.hasOwnProperty(N) && L[N].clearAll(); L = [], R = [], C = new l.Group(), this.stopAnimate(), m = [], w = 0, x = void 0, _ = void 0, E = void 0; var D = this.createScene("default"); this.setCurrentScene(D), P = void 0; }, this.transitionScene = (N, D) => { if (u) { var B = u.getZincCameraControls(), U = N.getBoundingBox(); if (U) { var k = U.min.distanceTo(U.max) / 2, K = (U.min.x + U.max.x) / 2, ie = (U.min.y + U.max.y) / 2, j = (U.min.z + U.max.z) / 2, G = B.getViewportFromCentreAndRadius(K, ie, j, k, 40, k * 4), W = B.getCurrentViewport(); B.cameraTransition(W, G, D), B.enableCameraTransition(); } } }, this.isWebGL2 = () => !!f && f.capabilities.isWebGL2; }; }, /* 31 */ /***/ (o) => { o.exports = nz(); }, /* 32 */ /***/ (o, a, c) => { var l = c(4), d = c(33).MarkerCluster, h6 = c(35).SceneLoader, p = c(41).SceneExporter, g = c(43).Viewport, f = c(5).createBufferGeometry, u = c(5).getCircularTexture, y = 0, v = function() { return "sc" + y++; }, m = function() { return { Duration: "6 secs", OriginalDuration: "-", TimeStamps: {} }; }, w = 6e3; a.Scene = function(S, T) { var M = this, x = S, _ = void 0, E = new h6(this), L = void 0, R = {}, C = 0, A = {}, P = 0, I = new l.Scene(), b = new (c(44)).Region(void 0, this); I.add(b.getGroup()); var O = new l.Group(); I.add(O), this.directionalLight = void 0, this.ambient = void 0, this.camera = void 0; var N = 6e3, D = void 0; this.sceneName = void 0; var B = false, U = void 0; this.autoClearFlag = true, this.displayMarkers = false, this.displayMinimap = false, this.minimapScissor = { x_offset: 16, y_offset: 16, width: 128, height: 128, align: "top-left", updateRequired: true }; var k = { x: 0, y: 0 }, K = m(), ie = new l.Vector2(), j = []; this.forcePickableObjectsUpdate = false, this.uuid = v(); var G = new d(this); G.disable(), I.add(G.group); var W = () => x ? typeof x.clientWidth > "u" ? x.width : x.clientWidth : 0, q = () => x ? typeof x.clientHeight > "u" ? x.height : x.clientHeight : 0; this.getDownloadProgress = () => E.getDownloadProgress(), this.onWindowResize = () => { var F = q(); this.camera.aspect = W() / F, this.camera.updateProjectionMatrix(), this.minimapScissor.updateRequired = true, D.onResize(), D.calculateHeightPerPixelAtZeroDepth(F); }, this.resetView = () => { this.onWindowResize(), D.resetView(); }, this.changeZoomByScrollRateUnit = (F) => { D.changeZoomByScrollRateUnit(F); }; var Q = () => { this.camera = new l.PerspectiveCamera(40, W() / q(), 0, 10), this.ambient = new l.AmbientLight(16777215, 0.2), I.add(this.ambient), this.directionalLight = new l.DirectionalLight(16777215, 0.8), I.add(this.directionalLight), D = new (c(43)).CameraControls(this.camera, T.domElement, T, this), D.setDirectionalLight(this.directionalLight), D.resetView(), L = new (c(49)).Minimap(this); }; Q(), this.loadView = (F) => { var $ = new g(); return $.setFromObject(F), D.setCurrentCameraSettings($), true; }, this.setupMultipleViews = (F, $) => { for (var [J, z] of Object.entries($)) { var V = new g(); V.setFromObject(z), D.addViewport(J, V); } D.setDefaultViewport(F); }, this.getBoundingBox = () => b.getBoundingBox(true), this.viewAllWithBoundingBox = (F) => { if (F) { var $ = D.getViewportFromBoundingBox(F, 1); D.setCurrentCameraSettings($), D.calculateHeightPerPixelAtZeroDepth(q()), G.markerUpdateRequired = true; } }, this.viewAll = () => { var F = this.getBoundingBox(); this.viewAllWithBoundingBox(F), G.markerUpdateRequired = true; }, this.forEachGeometry = (F) => { b.forEachGeometry(F, true); }, this.forEachGlyphset = (F) => { b.forEachGlyphset(F, true); }, this.forEachPointset = (F) => { b.forEachPointset(F, true); }, this.forEachLine = (F) => { b.forEachLine(F, true); }, this.findGeometriesWithGroupName = (F) => b.findGeometriesWithGroupName(F, true), this.findPointsetsWithGroupName = (F) => b.findPointsetsWithGroupName(F, true), this.findGlyphsetsWithGroupName = (F) => b.findGlyphsetsWithGroupName(F, true), this.findLinesWithGroupName = (F) => b.findLinesWithGroupName(F, true), this.findObjectsWithGroupName = (F) => b.findObjectsWithGroupName(F, true), this.findObjectsWithAnatomicalId = (F) => b.findObjectsWithAnatomicalId(F, true), this.getBoundingBoxOfZincObjects = (F) => { for (var $, J = void 0, z = 0; z < F.length; z++) $ = F[z].getBoundingBox(), $ && (J ? J.union($) : J = $); return J; }, this.vectorToScreenXY = (F) => { F.project(this.camera); var $ = W(), J = q(), z = $ / 2, V = J / 2; return F.x = F.x * z + z, F.y = -(F.y * V) + V, F; }, this.getObjectsScreenXY = (F) => { if (F && 0 < F.length) { var $ = this.getBoundingBoxOfZincObjects(F), J = new l.Vector3(); return $.getCenter(J), this.vectorToScreenXY(J); } }, this.getNamedObjectsScreenXY = (F) => { var $ = this.findObjectsWithGroupName(F); return this.getObjectsScreenXY($); }, this.addZincObject = (F) => { F && (b.addZincObject(F), D && D.calculateMaxAllowedDistance(this)); }, this.loadGlyphsetURL = (F, $, J, z) => { E.loadGlyphsetURL(b, F, $, J, z); }, this.loadPointsetURL = (F, $, J, z, V) => { E.loadPointsetURL(b, F, $, J, z, V); }, this.loadLinesURL = (F, $, J, z, V) => { E.loadLinesURL(b, F, $, J, z, V); }, this.loadSTL = (F, $, J) => { E.loadSTL(b, F, $, J); }, this.loadOBJ = (F, $, J) => { E.loadOBJ(b, F, $, J); }, this.loadMetadataURL = (F, $, J) => { E.loadMetadataURL(b, F, $, J); }, this.loadModelsURL = (F, $, J, z, V, oe) => { E.loadModelsURL(b.urls, $, J, z, V, oe); }, this.loadViewURL = (F) => { E.loadViewURL(F); }, this.loadFromViewURL = (F, $) => { E.loadFromViewURL(F, $); }, this.loadGLTF = (F, $, J, z) => { E.loadGLTF(b, F, $, J, z); }, this.updateDirectionalLight = () => { D.updateDirectionalLight(); }, this.addObject = (F) => { I.add(F); }, this.removeObject = (F) => { I.remove(F); }, this.getCurrentTime = () => { if (_ != null) return _.getCurrentTime(N); var F = b.getCurrentTime(); return F === -1 ? 0 : F; }, this.setMorphsTime = (F) => { _ != null && _.setMorphTime(F, N), b.setMorphTime(F, true); }, this.isTimeVarying = () => !!(_ && _.video && !_.video.error) || b.isTimeVarying(), this.renderGeometries = (F, $, J) => { var z = {}; if (z.camera = D, z.displayMarkers = this.displayMarkers, z.markerCluster = G, z.markersList = G.markers, z.ndcToBeUpdated = false, J && (z.markerCluster.markerUpdateRequired = true), !_) E.toBeDownloaded == 0 ? (z.ndcToBeUpdated = D.update($), z.ndcToBeUpdated && D.calculateHeightPerPixelAtZeroDepth(q()), b.renderGeometries(F, $, J, D, z, true)) : D.update(0); else if (_.isReadyToPlay()) { J ? _.video.play() : _.video.pause(); var V = _.video.currentTime / _.getVideoDuration() * N; E.toBeDownloaded == 0 ? (D.setTime(V), z.ndcToBeUpdated = D.update(0), z.ndcToBeUpdated && D.calculateHeightPerPixelAtZeroDepth(q()), b.setMorphTime(V, true), b.renderGeometries(0, 0, J, D, z, true)) : D.update(0); } else myPlayRate = 0; }, this.getThreeJSScene = () => I, this.setVideoHandler = (F) => { _ || (_ = F); }, this.setAdditionalScenesGroup = (F) => { I.add(F); }; var ee = (F, $, J, z, V, oe, ue) => { var le = 0, ve = 0; return ve = F.includes("top") ? ue - V - J : F.includes("bottom") ? J : Math.floor((ue - V) / 2), le = F.includes("left") ? $ : F.includes("right") ? oe - $ - z : Math.floor((oe - z) / 2), { x: le, y: ve }; }, ne = (F) => { this.displayMinimap === true && (F.setScissorTest(true), F.getSize(ie), this.minimapScissor.updateRequired && (k = ee(this.minimapScissor.align, this.minimapScissor.x_offset, this.minimapScissor.y_offset, this.minimapScissor.width, this.minimapScissor.height, ie.x, ie.y), this.minimapScissor.updateRequired = false), F.setScissor(k.x, k.y, this.minimapScissor.width, this.minimapScissor.height), F.setViewport(k.x, k.y, this.minimapScissor.width, this.minimapScissor.height), L.updateCamera(), I.add(L.mask), F.render(I, L.camera), I.remove(L.mask), F.setScissorTest(false), F.setViewport(0, 0, ie.x, ie.y)); }; this.render = (F) => { this.autoClearFlag && F.clear(), B && U ? U.render(I, this.camera) : (F.render(I, this.camera), ne(F)); }, this.setInteractiveControlEnable = (F) => { F == true ? D.enable() : D.disable(); }, this.getZincCameraControls = () => D, this.getThreeJSScene = () => I, this.setDuration = (F) => { b.setDuration(F), N = F, D.setPathDuration(F), E.duration = F; }, this.getDuration = () => N, this.setStereoEffectEnable = (F) => { F != true || U || (U = new c(43).StereoEffect(T)), T.setSize(W(), q()), this.camera.updateProjectionMatrix(), B = F; }, this.objectIsInScene = (F) => b.objectIsInRegion(F, true), this.alignBoundingBoxToCameraView = (F, $) => { if (F) { var J = new l.Vector3(); F.getCenter(J); var z = this.getZincCameraControls().getCurrentViewport(), V = new l.Vector3(z.targetPosition[0], z.targetPosition[1], z.targetPosition[2]), oe = new l.Vector3(z.eyePosition[0], z.eyePosition[1], z.eyePosition[2]), ue = new l.Vector3(), le = new l.Vector3(); ue.subVectors(V, oe).normalize(), le.subVectors(V, J).normalize(); var ve = new l.Vector3(); ve.crossVectors(ue, le); var xe = ue.angleTo(le); 0 < $ ? (this.getZincCameraControls().rotateCameraTransition(ve, xe, $), this.getZincCameraControls().enableCameraTransition()) : this.getZincCameraControls().rotateAboutLookAtpoint(ve, xe), G.markerUpdateRequired = true; } }, this.translateBoundingBoxToCameraView = (F, $, J) => { if (F) { var z = this.getZincCameraControls().getCurrentViewport(), V = this.getZincCameraControls().getViewportFromBoundingBox(F, $); 0 < J && (this.getZincCameraControls().cameraTransition(z, V, J), this.getZincCameraControls().enableCameraTransition()), G.markerUpdateRequired = true; } }, this.alignObjectToCameraView = (F, $) => { if (this.objectIsInScene(F)) { var J = F.getBoundingBox(); this.alignBoundingBoxToCameraView(J, $); } }, this.setCameraTargetToObject = (F) => { if (this.objectIsInScene(F)) { var $ = new l.Vector3(), J = F.getBoundingBox(), z = this.getZincCameraControls().getCurrentViewport(); J.getCenter($); var V = new l.Vector3(z.targetPosition[0], z.targetPosition[1], z.targetPosition[2]), oe = new l.Vector3(z.eyePosition[0], z.eyePosition[1], z.eyePosition[2]), ue = new l.Vector3(), le = new l.Vector3(); ue.subVectors(oe, V), le.addVectors($, ue), z.eyePosition[0] = le.x, z.eyePosition[1] = le.y, z.eyePosition[2] = le.z, z.targetPosition[0] = $.x, z.targetPosition[1] = $.y, z.targetPosition[2] = $.z, this.getZincCameraControls().setCurrentCameraSettings(z), G.markerUpdateRequired = true; } }, this.isStereoEffectEnable = () => B, this.removeZincObject = (F) => { b.removeZincObject(F), D && D.calculateMaxAllowedDistance(this), G.markerUpdateRequired = true; }, this.updatePickableThreeJSObjects = () => { j.length = 0, G.isEnabled && j.push(G.group), b.getPickableThreeJSObjects(j, true), this.forcePickableObjectsUpdate = false; }, this.getPickableThreeJSObjects = () => ((this.forcePickableObjectsUpdate || b.checkPickableUpdateRequred(true)) && this.updatePickableThreeJSObjects(), j), this.getNormalisedMinimapCoordinates = (F, $) => { if (this.displayMinimap) { var J = new l.Vector2(); F.getSize(J); var z = J.y - $.clientY; if (k.x + this.minimapScissor.width > $.clientX && $.clientX > k.x && k.y + this.minimapScissor.height > z && z > k.y) { var V = 2 * (($.clientX - k.x) / this.minimapScissor.width) - 1, oe = 2 * ((z - k.y) / this.minimapScissor.height) - 1; return { x: V, y: oe }; } } }, this.getMinimapDiffFromNormalised = (F, $) => L ? L.getDiffFromNormalised(F, $) : void 0, this.isWebGL2 = () => T.isWebGL2(), this.clearAll = () => { G.clear(), b.clear(true), this.clearZincObjectAddedCallbacks(), this.clearZincObjectRemovedCallbacks(), E.toBeDwonloaded = 0, D && D.calculateMaxAllowedDistance(this), G.markerUpdateRequired = true; }, this.addMetadataTimeStamp = (F, $) => { K.TimeStamps[F] = te($); }, this.getMetadataTag = (F) => K[F], this.getMetadata = () => K, this.setMetadataTag = (F, $) => { K[F] = $; }, this.removeMetadataTag = (F) => { delete K[F]; }, this.resetMetadata = () => { K = m(); }, this.resetDuration = () => { this.setDuration(w); }; var Y = (F) => [...F.years ? ["".concat(F.years, "years")] : [], ...F.months ? ["".concat(F.months, "months")] : [], ...F.weeks ? ["".concat(F.weeks, "weeks")] : [], ...F.days ? ["".concat(F.days, "days")] : [], ...F.hours ? ["".concat(F.hours, "hours")] : [], ...F.mins ? ["".concat(F.mins, "mins")] : [], ...F.secs ? ["".concat(F.secs, "secs")] : []].join(" "), te = (F) => F.years ? 31536e6 * F.years : 0 + F.months ? 2592e6 * F.months : 0 + F.weeks ? 6048e5 * F.weeks : 0 + F.days ? 864e5 * F.days : 0 + F.hours ? 36e5 * F.hours : 0 + F.mins ? 6e4 * F.mins : 0 + F.secs ? 1e3 * F.secs : 0; this.setDurationFromObject = (F) => { var $ = Y(F), J = te(F); this.setMetadataTag("Duration", $), this.setDuration(J); }, this.setOriginalDurationFromObject = (F) => { var $ = Y(F); this.setMetadataTag("OriginalDuration", $); }, this.exportGLTF = (F) => { var $ = new p(this); return $.exportGLTF(F); }, this.getRootRegion = () => b, this.createLines = (F, $, J, z) => { var V = b.findChildFromPath(F); return V === void 0 && (V = b.createChildFromPath(F)), V.createLines($, J, z); }, this.createPoints = (F, $, J, z, V) => { var oe = b.findChildFromPath(F); return oe === void 0 && (oe = b.createChildFromPath(F)), oe.createPoints($, J, z, V); }, this.addZincObjectAddedCallbacks = (F) => (++C, R[C] = F, C), this.addZincObjectRemovedCallbacks = (F) => (++P, A[P] = F, P), this.removeZincObjectAddedCallbacks = (F) => { F in C && delete R[F]; }, this.removeZincObjectRemovedCallbacks = (F) => { F in P && delete A[F]; }, this.clearZincObjectAddedCallbacks = () => { R = {}, C = 0; }, this.clearZincObjectRemovedCallbacks = () => { A = {}, P = 0; }, this.triggerObjectAddedCallback = (F) => { for (var $ in R) R.hasOwnProperty($) && R[$](F); }, this.triggerObjectRemovedCallback = (F) => { for (var $ in A) A.hasOwnProperty($) && A[$](F); }, this.addTemporaryPoints = (F, $) => { var J = f(F.length, F), z = new l.PointsMaterial({ alphaTest: 0.5, size: 15, color: $, sizeAttenuation: false }), V = u(); z.map = V; var oe = new (c(23)).Points(J, z); return O.add(oe), oe; }, this.addTemporaryLines = (F, $) => { var J = f(F.length, F), z = new l.LineBasicMaterial({ color: $ }), V = new (c(12)).LineSegments(J, z); return O.add(V), V; }, this.removeTemporaryPrimitive = (F) => { O.remove(F), F.geometry.dispose(), F.material.dispose(); }, this.clearTemporaryPrimitives = () => { var F = 0, $ = O.children; return $.forEach((J) => { J.geometry.dispose(), J.material.dispose(), F++; }), O.clear(), F; }, this.addBoundingBoxPrimitive = function(F, $, J, z, V) { var oe = 5 < arguments.length && arguments[5] !== void 0 ? arguments[5] : void 0, ue = b.findChildFromPath(F); ue === void 0 && (ue = b.createChildFromPath(F)); var le = oe || M.getBoundingBox(), ve = new l.Vector3().subVectors(le.max, le.min), xe = new l.BoxGeometry(ve.x, ve.y, ve.z), Te = ue.createGeometryFromThreeJSGeometry($, xe, J, z, V, 1e4); return ve.addVectors(le.min, le.max).multiplyScalar(0.5), Te.setPosition(ve.x, ve.y, ve.z), Te; }, this.addSlicesPrimitive = function(F, $, J, z, V) { var oe = 5 < arguments.length && arguments[5] !== void 0 ? arguments[5] : void 0; if ($ && 3 <= $.length && J && 3 <= J.length) { var ue = b.findChildFromPath(F); ue === void 0 && (ue = b.createChildFromPath(F)); var le = oe || M.getBoundingBox(), ve = new l.Vector3().subVectors(le.max, le.min), xe = [], Te = 0; return ["x", "y", "z"].forEach((de) => { var we; switch (de) { case "x": we = new l.PlaneGeometry(ve.z, ve.y), we.rotateY(Math.PI / 2); break; case "y": we = new l.PlaneGeometry(ve.x, ve.z), we.rotateX(Math.PI / 2); break; case "z": we = new l.PlaneGeometry(ve.x, ve.y); break; } var se = ue.createGeometryFromThreeJSGeometry($[Te], we, J[Te], z, V, 10001); xe.push(se), Te++; }), ve.addVectors(le.min, le.max).multiplyScalar(0.5), xe.forEach((de) => { de.setPosition(ve.x, ve.y, ve.z); }), xe; } }, this.enableMarkerCluster = (F) => { F ? (G.markerUpdateRequired = true, G.enable()) : (G.markerUpdateRequired = false, G.disable()), this.forcePickableObjectsUpdate = true; }; }; }, /* 33 */ /***/ (o, a, c) => { function l(T, M) { var x = Object.keys(T); if (Object.getOwnPropertySymbols) { var _ = Object.getOwnPropertySymbols(T); M && (_ = _.filter(function(E) { return Object.getOwnPropertyDescriptor(T, E).enumerable; })), x.push.apply(x, _); } return x; } function d(T) { for (var M, x = 1; x < arguments.length; x++) M = arguments[x] == null ? {} : arguments[x], x % 2 ? l(Object(M), true).forEach(function(_) { h6(T, _, M[_]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(T, Object.getOwnPropertyDescriptors(M)) : l(Object(M)).forEach(function(_) { Object.defineProperty(T, _, Object.getOwnPropertyDescriptor(M, _)); }); return T; } function h6(T, M, x) { return M = p(M), M in T ? Object.defineProperty(T, M, { value: x, enumerable: true, configurable: true, writable: true }) : T[M] = x, T; } function p(T) { var M = g(T, "string"); return typeof M == "symbol" ? M : M + ""; } function g(T, M) { if (typeof T != "object" || !T) return T; var x = T[Symbol.toPrimitive]; if (x !== void 0) { var _ = x.call(T, M || "default"); if (typeof _ != "object") return _; throw new TypeError("@@toPrimitive must return a primitive value."); } return (M === "string" ? String : Number)(T); } var f = c(4), u = new Image(128, 128); u.src = c(34); var y = new f.Texture(); y.image = u, y.needsUpdate = true; var v = [0.02, 0.03, 1], m = new f.SpriteMaterial({ map: y, alphaTest: 0.5, transparent: true, depthTest: false, depthWrite: false, sizeAttenuation: false }), w = c(5).createNewSpriteText, S = function(T) { c(10).ZincObject.call(this), this.texture = y; var M = void 0; this.morph = new f.Group(), this.group = this.morph, this.isMarkerCluster = true; var x = true, _ = []; this.markers = {}; var E = new f.Vector2(), L = new f.Vector2(), R = Date.now(); this.setSpriteSize = (b) => { M.scale.set(0.015, 0.02, 1), M.scale.multiplyScalar(b); }, this.clear = () => { this.group.clear(), this.markers = {}; }, this.dispose = () => { this.clear(), this.morph && this.morph.clear(); }; var C = (b) => { var O = new f.Group(), N = new f.Sprite(m); return N.clusterIndex = b, N.center.set(0.5, 0), N.position.set(0, 0, 0), N.renderOrder = 1e4, N.scale.set(v[0], v[1], v[2]), N.userData = this, O.add(N), this.group.add(O), { group: O, marker: N, label: void 0, number: 0, min: [0, 0, 0], max: [1, 1, 1] }; }, A = (b, O, N) => { b.group.visible = true, b.group.position.set(O.coords[0], O.coords[1], O.coords[2]), (b.label === void 0 || N !== b.number) && (b.label && (b.group.remove(b.label), b.label.material.map.dispose(), b.label.material.dispose()), b.label = w(N, 0.012, "black", "Asap", 120, 700), b.number = N, b.group.add(b.label)), b.min = O.min, b.max = O.max; }, P = (b) => { var O = 0; for (b.forEach((N) => { var D = N.members.length, B = 0; D === 1 ? N.members[0].setVisibility(true) : (N.members.forEach((U) => { B += U.getNumber(), U.setVisibility(false); }), !_[O] && _.push(C(O)), A(_[O], N, B), O++); }), O; O < _.length; O++) _[O].group.visible = false; }, I = (b, O) => { var N = true, D = { members: [], coords: [0, 0, 0], min: [0, 0, 0], max: [1, 1, 1] }, B = 0; for (var U in b) N ? (E.set(b[U].ndc.x, b[U].ndc.y), this._b1.setFromPoints([b[U].morph.position]), N = false, D.members.push(b[U]), D.coords = [b[U].morph.position.x, b[U].morph.position.y, b[U].morph.position.z], O.push(D), delete b[U]) : (L.set(b[U].ndc.x, b[U].ndc.y), B = E.distanceTo(L), 0.1 > B && (D.members.push(b[U]), this._b1.expandByPoint(b[U].morph.position), delete b[U])); D.min = [this._b1.min.x, this._b1.min.y, this._b1.min.z], D.max = [this._b1.max.x, this._b1.max.y, this._b1.max.z], N != true && I(b, O); }; this.calculate = () => { if (x) { var b = Date.now(); if (500 < b - R) { var O = []; I(d({}, this.markers), O), P(O), R = Date.now(), this.markerUpdateRequired = false; } } }, this.isEnabled = () => x, this.enable = () => { x = true, this.morph.visible = true; }, this.disable = () => { for (var b in x = false, this.morph.visible = false, this.markers) { var O; (O = this.markers[b]) !== null && O !== void 0 && O.isMarker && this.markers[b].isEnabled() && this.markers[b].setVisibility(true); } }, this.zoomToCluster = (b) => !!(b !== void 0 && -1 < b && (this._v1.set(..._[b].min), this._v2.set(..._[b].max), Math.abs(0 < this._v1.distanceTo(this._v2)))) && (this._b1.set(this._v1, this._v2), T.translateBoundingBoxToCameraView(this._b1, 3, 300), this.markerUpdateRequired = true, true), this.clusterIsVisible = (b) => { if (b !== void 0 && -1 < b && _[b]) { var O; return (O = _[b].group) === null || O === void 0 ? void 0 : O.visible; } return false; }; }; S.prototype = Object.create(c(10).ZincObject.prototype), a.MarkerCluster = S; }, /* 34 */ /***/ (o) => { o.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZlcnNpb249IjEuMSIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIHZpZXdCb3g9IjAgMCAzNjUgNTYwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4KPGRlZnM+CjwvZGVmcz4KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDApIiBpZD0iODA4ZWQyODMtMjUyNC00NDBmLTg4YWUtM2JkYjQ3YmI1NzQ5IiAgPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii0xODIuNSIgeT0iLTI4MCIgcng9IjAiIHJ5PSIwIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgLz4KPC9nPgo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+CjxnIHN0eWxlPSIiICAgPgo8L2c+CjwvZz4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDk3LjUpIiAgPgo8ZyBzdHlsZT0iIiAgID4KPC9nPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDAuOTkgMCAwIDAuOTkgMTgyLjUgMjgwKSIgID4KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItNTQwIiB5PSItNTQwIiByeD0iMCIgcnk9IjAiIHdpZHRoPSIxMDgwIiBoZWlnaHQ9IjEwODAiIC8+CjwvZz4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxwYXRoIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwxNjUsMCk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHRyYW5zZm9ybT0iIHRyYW5zbGF0ZSgtMTgyLjksIC0yNzkuODUpIiBkPSJNIDE4Mi45IDU1MS43IEMgMTgyLjkgNTUxLjgwMDAwMDAwMDAwMDEgMTgzLjEgNTUyIDE4My4xIDU1MiBDIDE4My4xIDU1MiAzNTguMyAyODMgMzU4LjMgMTk0LjYgQyAzNTguMyA2NC41IDI2OS41IDcuOTAwMDAwMDAwMDAwMDA2IDE4Mi45IDcuNjk5OTk5OTk5OTk5OTg5IEMgOTYuMyA3LjkgNy41IDY0LjUgNy41IDE5NC42IEMgNy41IDI4MyAxODIuOCA1NTIgMTgyLjggNTUyIEMgMTgyLjggNTUyIDE4Mi45IDU1MS43IDE4Mi45IDU1MS43IHogTSAxMjIuMiAxODcuMiBDIDEyMi4yIDE1My42IDE0OS40IDEyNi4zOTk5OTk5OTk5OTk5OSAxODMgMTI2LjM5OTk5OTk5OTk5OTk5IEMgMjE2LjYgMTI2LjM5OTk5OTk5OTk5OTk5IDI0My44IDE1My42IDI0My44IDE4Ny4yIEMgMjQzLjggMjIwLjc5OTk5OTk5OTk5OTk4IDIxNi41IDI0OCAxODIuOSAyNDggQyAxNDkuNCAyNDggMTIyLjIgMjIwLjggMTIyLjIgMTg3LjIgeiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiAvPgo8L2c+CgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPgo8Y2lyY2xlIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgY3g9IjAiIGN5PSIwIiByPSIzNSIgLz4KPC9nPgo8L2c+CjwvZz4KPC9zdmc+"; }, /* 35 */ /***/ (o, a, c) => { var l = c(4), d = c(5).resolveURL, h6 = c(5).createNewURL, p = c(36).STLLoader, g = c(37).OBJLoader, f = c(38).PrimitivesLoader; a.SceneLoader = function(u) { var y = u; this.toBeDownloaded = 0, this.progressMap = {}; var v = false, m = false, w = new f(); this.getDownloadProgress = () => { var j = 0, G = 0, W = false; for (var q in this.progressMap) { var Q = this.progressMap[q]; j += Q[1], G += Q[0], Q[1] == 0 && (W = true); } return W && (j = 0), [j, G, m]; }, this.onProgress = (j) => (G) => { this.progressMap[j] = [G.loaded, G.total]; }, this.onError = (j) => (G) => { --this.toBeDownloaded, m = true, console.error("There is an issue with one of the external resource: ".concat(G == null ? void 0 : G.responseURL, ".")), j && j(); }; var S = (j, G) => { var W = G.Default; if (G.Inline) y.setupMultipleViews(W, G.Entries); else { var q = [], Q = function(te) { j && (newURL = h6(ne, j), q.push(new Promise((F, $) => { fetch(newURL).then((J) => J.json()).then((J) => F({ key: te, data: J })).catch((J) => $(J)); }))); }; for (var [ee, ne] of Object.entries(G.Entries)) Q(ee); Promise.all(q).then((Y) => { var te = {}; Y.forEach(($) => { te[$.key] = $.data; }), y.setupMultipleViews(W, te); var F = y.getZincCameraControls(); F && F.setCurrentViewport(W), v = true; }); } }; this.loadViewURL = (j, G) => { this.toBeDownloaded += 1; var W = new XMLHttpRequest(); W.onreadystatechange = () => { if (W.readyState == 4) if (W.status == 200) { var Q = JSON.parse(W.responseText); y.setupMultipleViews("default", { default: Q }), y.resetView(), v = true, --this.toBeDownloaded, G != null && typeof G == "function" && G(); } else this.onError(); }; var q = d(j); W.open("GET", q, true), W.send(); }, this.loadModelsURL = (j, G, W, q, Q, ee, ne) => { var Y = G.length; this.toBeDownloaded += Y; for (var te = 0; te < Y; te++) { var F = G[te], $ = c(0).defaultMaterialColor, J = c(0).defaultOpacity; W != null && W[te] != null && ($ = !!W[te]), q != null && q[te] != null && (J = q[te]); var z = 0; Q != null && Q[te] != null && (z = !!Q[te]); var V = 0; ee != null && ee[te] != null && (V = !!ee[te]), w.load(d(F), P(j, $, J, z, V, void 0, void 0, void 0, void 0, ne), this.onProgress(F), this.onError(ne)); } }, this.loadFromViewURL = (j, G, W) => { var q = new XMLHttpRequest(); q.onreadystatechange = () => { if (q.readyState == 4 && q.status == 200) { var ee = JSON.parse(q.responseText); y.loadView(ee); for (var ne, Y = [], te = G + "_", F = 0; F < ee.numberOfResources; F++) ne = te + (F + 1) + ".json", Y.push(ne); this.loadModelsURL(j, Y, ee.colour, ee.opacity, ee.timeEnabled, ee.morphColour, W); } }; var Q = d(G + "_view.json"); q.open("GET", Q, true), q.send(); }; var T = (j, G, W, q, Q, ee, ne, Y) => (te, F) => { var $ = new (c(24)).Lines(), J = void 0; F && F[0] && (J = new l.LineBasicMaterial({ color: F[0].color.clone() }), 1 > F[0].opacity && (J.transparent = true), J.opacity = F[0].opacity, J.morphTargets = G, J.vertexColors = F[0].vertexColors); var z = { localTimeEnabled: G, localMorphColour: W }; if ($ && ($.createLineSegment(te, J, z), $.setName(q), $.anatomicalId = Q, $.setRenderOrder(ee), j.addZincObject($), $.setDuration(y.getDuration()), console.log(ne), ne && ne.levels)) for (var [V, oe] of Object.entries(ne.levels)) $.addLOD(w, V, oe.URL, oe.Index, ne.preload); --this.toBeDownloaded, te.dispose(), Y != null && typeof Y == "function" && Y($); }; this.loadLinesURL = (j, G, W, q, Q, ee, ne) => { var Y = 0; this.toBeDownloaded += 1; var te = !!(ne && ne.isInline) && ne.isInline, F = ne && ne.anatomicalId ? ne.anatomicalId : void 0, $ = ne && ne.renderOrder ? ne.renderOrder : void 0; W != null && (Y = !!W); var J = 0; if (q != null && (J = !!q), te) { var z = w.parse(G); T(j, Y, J, Q, F, $, ne.lod, ee)(z.geometry, z.materials); } else w.load(G, T(j, Y, J, Q, F, $, ne.lod, ee), this.onProgress(G), this.onError(ee), ne.loaderOptions); }; var M = (j, G, W, q, Q, ee) => { var ne = ee && ee.isInline ? ee.isInline : void 0, Y = ee && ee.anatomicalId ? ee.anatomicalId : void 0, te = ee && ee.displayLabels ? ee.displayLabels : void 0, F = ee && ee.renderOrder ? ee.renderOrder : void 0, $ = new (c(18)).Glyphset(); $.setDuration(y.getDuration()), $.groupName = q; var J = () => { --this.toBeDownloaded, Q != null && typeof Q == "function" && Q($); }; ++this.toBeDownloaded, ne ? $.load(G, W, J, ne, te) : $.load(G, d(W), J, ne, te), $.anatomicalId = Y, $.setRenderOrder(F), j.addZincObject($); }, x = (j, G, W, q, Q, ee) => () => { if (G.readyState == 4 && G.status == 200) { var ne = JSON.parse(G.responseText); M(j, ne, W, q, Q, ee); } }, _ = (j, G, W, q, Q, ee, ne) => (Y, te) => { var F = new (c(22)).Pointset(), $ = new l.PointsMaterial({ alphaTest: 0.5, size: 10, sizeAttenuation: false }); te && te[0] && (1 > te[0].opacity && ($.transparent = true), $.opacity = te[0].opacity, $.color = te[0].color, $.morphTargets = G, $.vertexColors = te[0].vertexColors); var J = {}; J.localTimeEnabled = G, J.localMorphColour = W, F && (F.createMesh(Y, $, J), F.setName(q), F.anatomicalId = Q, j.addZincObject(F), F.setDuration(y.getDuration()), F.setRenderOrder(ee)), Y.dispose(), --this.toBeDownloaded, ne != null && typeof ne == "function" && ne(F); }; this.loadSTL = (j, G, W, q) => { this.toBeDownloaded += 1; var Q = c(0).defaultMaterialColor, ee = c(0).defaultOpacity, ne = new p(); ne.crossOrigin = "Anonymous", ne.load(d(G), P(j, Q, ee, false, false, W, void 0, void 0, void 0, q)); }, this.loadOBJ = (j, G, W, q) => { this.toBeDownloaded += 1; var Q = c(0).defaultMaterialColor, ee = c(0).defaultOpacity, ne = new g(); ne.crossOrigin = "Anonymous", ne.load(d(G), P(j, Q, ee, false, false, W, void 0, void 0, void 0, q)); }; var E = (j, G, W, q, Q, ee, ne) => { this.toBeDownloaded += 1; var Y = c(0).defaultMaterialColor, te = c(0).defaultOpacity, F = 0, $ = !!(ne && ne.isInline) && ne.isInline, J = ne && ne.fileFormat ? ne.fileFormat : void 0, z = ne && ne.anatomicalId ? ne.anatomicalId : void 0, V = ne && ne.renderOrder ? ne.renderOrder : void 0; W != null && (F = !!W); var oe = 0; q != null && (oe = !!q); var ue = w; if (J !== void 0) { if (J == "STL") ue = new p(); else if (J == "OBJ") return ue = new g(), ue.crossOrigin = "Anonymous", void ue.load(G, objloader(j, Y, te, F, oe, Q, z, ee), this.onProgress(G), this.onError, ne.loaderOptions); } if ($) { var le = w.parse(G); P(j, Y, te, F, oe, Q, z, V, ne, ee)(le.geometry, le.materials); } else ue.crossOrigin = "Anonymous", w.load(G, P(j, Y, te, F, oe, Q, z, V, ne, ee), this.onProgress(G), this.onError(ee), ne.loaderOptions); }, L = function(G, W, q) { var Q = 0; return (ee) => { if (++Q, ee && W != null && typeof W == "function") { W(ee); var ne = y.getZincCameraControls(); ne && ne.calculateMaxAllowedDistance(y); } Q == G && (v == false && y.viewAll(), q != null && typeof q == "function" && q()); }; }; this.loadPointsetURL = (j, G, W, q, Q, ee, ne) => { var Y = 0; this.toBeDownloaded += 1, W != null && (Y = !!W); var te = 0; q != null && (te = !!q); var F = !!(ne && ne.isInline) && ne.isInline, $ = ne && ne.anatomicalId ? ne.anatomicalId : void 0, J = ne && ne.renderOrder ? ne.renderOrder : void 0; if (F) { var z = w.parse(G); _(j, Y, te, Q, $, J, ee)(z.geometry, z.materials); } else w.load(G, _(j, Y, te, Q, $, J, ee), this.onProgress(G), this.onError(ee), ne.loaderOptions); }; var R = (j, G, W, q, Q, ee) => { var ne = ee && ee.isInline ? ee.isInline : void 0, Y = ee && ee.anatomicalId ? ee.anatomicalId : void 0, te = ee && ee.renderOrder ? ee.renderOrder : void 0, F = void 0; if (W) { if (G && W.images && W.images.source) for (var $, J = W.images.source, z = 0; z < J.length; z++) $ = h6(J[z], G), W.images.source[z] = $; if (W.type === "slides" && (F = new (c(27)).TextureSlides()), F) { F.groupName = q; var V = () => { --this.toBeDownloaded, Q != null && typeof Q == "function" && Q(F); }; ++this.toBeDownloaded, F.load(W, V, ne), F.anatomicalId = Y, F.setRenderOrder(te), j.addZincObject(F); } } }, C = (j, G, W, q, Q) => () => { if (G.readyState == 4 && G.status == 200) { var ee = JSON.parse(G.responseText); R(j, G.responseURL, ee, W, q, Q); } }; this.loadTextureURL = (j, G, W, q, Q) => { var ee = !!(Q && Q.isInline) && Q.isInline; if (ee) R(j, void 0, G, W, q, Q); else { var ne = new XMLHttpRequest(); ne.onreadystatechange = C(j, ne, W, q, Q), ne.open("GET", d(G), true), ne.send(); } }, this.loadGlyphsetURL = (j, G, W, q, Q, ee) => { var ne = !!(ee && ee.isInline) && ee.isInline; if (ne) M(j, G, W, q, Q, ee); else { var Y = new XMLHttpRequest(); Y.onreadystatechange = x(j, Y, W, q, Q, ee), Y.open("GET", d(G), true), Y.send(); } }; var A = (j, G, W, q, Q, ee, ne, Y, te) => { var F = { colour: W, opacity: q, localTimeEnabled: Q, localMorphColour: ee }, $ = new (c(3)).Geometry(); return $.createMesh(G, Y, F), $.getMorph() ? ($.setName(te), j && j.addZincObject($), $.setDuration(y.getDuration()), $.videoHandler && y.setVideoHandler($.videoHandler), $) : void 0; }, P = (j, G, W, q, Q, ee, ne, Y, te, F) => ($, J) => { var z; J && J[0] && (z = J[0]); var V = A(j, $, G, W, q, Q, void 0, z, ee); if (V.anatomicalId = ne, V.setRenderOrder(Y), te.lod && te.lod.levels) for (var [oe, ue] of Object.entries(te.lod.levels)) V.addLOD(w, oe, ue.URL, ue.Index, te.lod.preload); --this.toBeDownloaded, $.dispose(), F != null && typeof F == "function" && F(V); }, I = (j) => { var G = /P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/, [, W, q, Q, ee, ne, Y, te] = j.match(G); return { years: W, months: q, weeks: Q, days: ee, hours: ne, mins: Y, secs: te }; }; this.loadSettings = (j) => { if (j) { if (j.Duration) { var G = I(j.Duration); y.setDurationFromObject(G); } if (j.OriginalDuration) { var W = I(j.OriginalDuration); y.setOriginalDurationFromObject(W); } if (j.TimeStamps) for (var q in j.TimeStamps) { var Q = I(j.TimeStamps[q]); y.addMetadataTimeStamp(q, Q); } } }; var b = (j, G, W, q, Q) => { if (W) { var ee = void 0, ne = false; W.URL ? (ee = W.URL, G && (ee = h6(ee, G))) : W.Inline && (ee = W.Inline.URL, ne = true); var Y = {}; if (W.LOD && W.LOD.Levels) { Y.preload = !!W.LOD.Preload, Y.levels = {}; for (var [te, F] of Object.entries(W.LOD.Levels)) Y.levels[te] = {}, Y.levels[te].URL = h6(F.URL, G), Y.levels[te].Index = F.Index; } var $ = W.GroupName; ($ === void 0 || $ === "") && ($ = "_Unnamed"); var J = { loaderOptions: { index: W.Index }, isInline: ne, fileFormat: W.FileFormat, anatomicalId: W.AnatomicalId, compression: W.compression, lod: Y, renderOrder: q }; switch (W.Type) { case "Surfaces": E(j, ee, W.MorphVertices, W.MorphColours, $, Q, J); break; case "Glyph": var z; ne ? z = W.Inline.GlyphGeometriesURL : (z = W.GlyphGeometriesURL, z = h6(W.GlyphGeometriesURL, G)), W.DisplayLabels && (J.displayLabels = true), this.loadGlyphsetURL(j, ee, z, $, Q, J); break; case "Points": this.loadPointsetURL(j, ee, W.MorphVertices, W.MorphColours, $, Q, J); break; case "Lines": this.loadLinesURL(j, ee, W.MorphVertices, W.MorphColours, $, Q, J); break; case "Texture": this.loadTextureURL(j, ee, $, Q, J); break; } } }, O = (j, G, W) => { if (G) { var q = void 0, Q = false; switch (G.URL ? (q = G.URL, j && (q = h6(G.URL, j))) : G.Inline && (q = G.Inline.URL, Q = true), G.Type) { case "View": Q ? (y.setupMultipleViews("default", { default: q }), v = true, W != null && typeof W == "function" && W()) : this.loadViewURL(q, W); break; case "Settings": this.loadSettings(G); break; } } }; this.loadGLTF = (j, G, W, q, Q) => { var ee = new (c(39)).GLTFToZincJSLoader(); ee.load(y, j, G, W, q, Q); }; var N = (j, G, W, q) => { if (W.Primitives && W.Primitives.forEach((Y) => { var te = 1; Y.Order && (te = Y.Order), b(j, G, Y, te, q); }), W.Transformation && j.setTransformation(W.Transformation), W.Children) for (var [Q, ee] of Object.entries(W.Children)) { var ne = j.findOrCreateChildFromPath(Q); ne && N(ne, G, ee, q); } }, D = (j, G) => { if (Array.isArray(j)) { for (var W = 0, q = 0; q < j.length; q++) j[q].Type && (G && j[q].Type === "View" || j[q].Type === "Surfaces" || j[q].Type === "Glyph" || j[q].Type === "Points" || j[q].Type === "Lines" || j[q].Type === "Texture") && W++; return W; } return 0; }, B = (j) => { var G = j.Primitives ? D(j.Primitives, false) : 0; return j.Children && Object.values(j.Children).forEach((W) => { G += B(W); }), G; }, U = (j) => Array.isArray(j) ? D(j, true) : typeof j == "object" && j !== null && j.Version === "2.0" ? B(j.Regions) : void 0, k = (j, G, W, q, Q) => { var ee = j; W.RegionPath && W.RegionPath !== "" && (ee = j.findOrCreateChildFromPath(W.RegionPath)), b(ee, G, W, 2 * q, Q); }, K = (j, G, W, q, Q) => { for (var ee = U(G), ne = new L(ee, q, Q), Y = 0; Y < G.length; Y++) O(W, G[Y], ne); for (var te = 0; te < G.length; te++) k(j, W, G[te], te, ne); }, ie = (j, G, W, q, Q) => { var ee = U(G), ne = new L(ee, q, Q); G.Settings && this.loadSettings(G.Settings), G.Views && S(W, G.Views), G.Regions && N(j, W, G.Regions, ne); }; this.loadMetadataURL = (j, G, W, q) => { var Q = new XMLHttpRequest(), ee = d(G); Q.onreadystatechange = () => { if (Q.readyState == 4 && Q.status == 200) { y.resetMetadata(), y.resetDuration(), v = false; var ne = Q.responseURL; ne === void 0 && (ne = new URL(ee).href); var Y = JSON.parse(Q.responseText); Array.isArray(Y) ? K(j, Y, ne, W, q) : typeof Y == "object" && Y !== null && Y.Version == "2.0" && ie(j, Y, ne, W, q); } }, Q.open("GET", ee, true), Q.send(); }; }; }, /* 36 */ /***/ (o, a, c) => { c.r(a), c.d(a, { /* harmony export */ STLLoader: () => ( /* binding */ d ) /* harmony export */ }); var l = c(4); class d extends l.Loader { constructor(p) { super(p); } load(p, g, f, u) { var y = this, v = new l.FileLoader(this.manager); v.setPath(this.path), v.setResponseType("arraybuffer"), v.setRequestHeader(this.requestHeader), v.setWithCredentials(this.withCredentials), v.load(p, function(m) { try { g(y.parse(m)); } catch (w) { u ? u(w) : console.error(w), y.manager.itemError(p); } }, f, u); } parse(p) { function g(u, y, v) { for (var m = 0, w = u.length; m < w; m++) if (u[m] !== y.getUint8(v + m, false)) return false; return true; } var f = function(u) { if (typeof u == "string") { for (var y = new Uint8Array(u.length), v = 0; v < u.length; v++) y[v] = 255 & u.charCodeAt(v); return y.buffer || y; } return u; }(p); return function(u) { var y = new DataView(u), v = y.getUint32(80, true); if (84 + v * 50 === y.byteLength) return true; for (var m = [115, 111, 108, 105, 100], w = 0; 5 > w; w++) if (g(m, y, w)) return false; return true; }(f) ? function(u) { for (var y, v, m, w, S, T, M, x, _ = new DataView(u), E = _.getUint32(80, true), L = false, R = 0; R < 70; R++) _.getUint32(R, false) == 1129270351 && _.getUint8(R + 4) == 82 && _.getUint8(R + 5) == 61 && (L = true, w = new Float32Array(3 * (3 * E)), S = _.getUint8(R + 6) / 255, T = _.getUint8(R + 7) / 255, M = _.getUint8(R + 8) / 255, x = _.getUint8(R + 9) / 255); for (var C = new l.BufferGeometry(), A = new Float32Array(3 * (3 * E)), P = new Float32Array(3 * (3 * E)), I = 0; I < E; I++) { var b = 84 + I * 50, O = _.getFloat32(b, true), N = _.getFloat32(b + 4, true), D = _.getFloat32(b + 8, true); if (L) { var B = _.getUint16(b + 48, true); 32768 & B ? (y = S, v = T, m = M) : (y = (31 & B) / 31, v = (31 & B >> 5) / 31, m = (31 & B >> 10) / 31); } for (var U = 1; 3 >= U; U++) { var k = b + 12 * U, K = 3 * (3 * I) + 3 * (U - 1); A[K] = _.getFloat32(k, true), A[K + 1] = _.getFloat32(k + 4, true), A[K + 2] = _.getFloat32(k + 8, true), P[K] = O, P[K + 1] = N, P[K + 2] = D, L && (w[K] = y, w[K + 1] = v, w[K + 2] = m); } } return C.setAttribute("position", new l.BufferAttribute(A, 3)), C.setAttribute("normal", new l.BufferAttribute(P, 3)), L && (C.setAttribute("color", new l.BufferAttribute(w, 3)), C.hasColors = true, C.alpha = x), C; }(f) : function(u) { for (var y, v = new l.BufferGeometry(), m = /solid([\s\S]*?)endsolid/g, w = /facet([\s\S]*?)endfacet/g, S = 0, T = /[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source, M = new RegExp("vertex" + T + T + T, "g"), x = new RegExp("normal" + T + T + T, "g"), _ = [], E = [], L = new l.Vector3(), R = 0, C = 0, A = 0; (y = m.exec(u)) !== null; ) { C = A; for (var P = y[0]; (y = w.exec(P)) !== null; ) { for (var I = 0, b = 0, O = y[0]; (y = x.exec(O)) !== null; ) L.x = parseFloat(y[1]), L.y = parseFloat(y[2]), L.z = parseFloat(y[3]), b++; for (; (y = M.exec(O)) !== null; ) _.push(parseFloat(y[1]), parseFloat(y[2]), parseFloat(y[3])), E.push(L.x, L.y, L.z), I++, A++; b !== 1 && console.error("THREE.STLLoader: Something isn't right with the normal of face number " + S), I !== 3 && console.error("THREE.STLLoader: Something isn't right with the vertices of face number " + S), S++; } var N = C, D = A - C; v.addGroup(N, D, R), R++; } return v.setAttribute("position", new l.Float32BufferAttribute(_, 3)), v.setAttribute("normal", new l.Float32BufferAttribute(E, 3)), v; }(function(u) { return typeof u == "string" ? u : l.LoaderUtils.decodeText(new Uint8Array(u)); }(p)); } } }, /* 37 */ /***/ (o, a, c) => { c.r(a), c.d(a, { /* harmony export */ OBJLoader: () => ( /* binding */ S ) /* harmony export */ }); var l = c(4), d = /^[og]\s*(.+)?/, h6 = /^mtllib /, p = /^usemtl /, g = /^usemap /, f = new l.Vector3(), u = new l.Vector3(), y = new l.Vector3(), v = new l.Vector3(), m = new l.Vector3(); function w() { var T = { objects: [], object: {}, vertices: [], normals: [], colors: [], uvs: [], materials: {}, materialLibraries: [], startObject: function(x, _) { if (this.object && this.object.fromDeclaration === false) return this.object.name = x, void (this.object.fromDeclaration = _ !== false); var E = this.object && typeof this.object.currentMaterial == "function" ? this.object.currentMaterial() : void 0; if (this.object && typeof this.object._finalize == "function" && this.object._finalize(true), this.object = { name: x || "", fromDeclaration: _ !== false, geometry: { vertices: [], normals: [], colors: [], uvs: [], hasUVIndices: false }, materials: [], smooth: true, startMaterial: function(C, A) { var P = this._finalize(false); P && (P.inherited || 0 >= P.groupCount) && this.materials.splice(P.index, 1); var I = { index: this.materials.length, name: C || "", mtllib: Array.isArray(A) && 0 < A.length ? A[A.length - 1] : "", smooth: P === void 0 ? this.smooth : P.smooth, groupStart: P === void 0 ? 0 : P.groupEnd, groupEnd: -1, groupCount: -1, inherited: false, clone: function(O) { var N = { index: typeof O == "number" ? O : this.index, name: this.name, mtllib: this.mtllib, smooth: this.smooth, groupStart: 0, groupEnd: -1, groupCount: -1, inherited: false }; return N.clone = this.clone.bind(N), N; } }; return this.materials.push(I), I; }, currentMaterial: function() { return 0 < this.materials.length ? this.materials[this.materials.length - 1] : void 0; }, _finalize: function(C) { var A = this.currentMaterial(); if (A && A.groupEnd === -1 && (A.groupEnd = this.geometry.vertices.length / 3, A.groupCount = A.groupEnd - A.groupStart, A.inherited = false), C && 1 < this.materials.length) for (var P = this.materials.length - 1; 0 <= P; P--) 0 >= this.materials[P].groupCount && this.materials.splice(P, 1); return C && this.materials.length === 0 && this.materials.push({ name: "", smooth: this.smooth }), A; } }, E && E.name && typeof E.clone == "function") { var L = E.clone(0); L.inherited = true, this.object.materials.push(L); } this.objects.push(this.object); }, finalize: function() { this.object && typeof this.object._finalize == "function" && this.object._finalize(true); }, parseVertexIndex: function(x, _) { var E = parseInt(x, 10); return 3 * (0 <= E ? E - 1 : E + _ / 3); }, parseNormalIndex: function(x, _) { var E = parseInt(x, 10); return 3 * (0 <= E ? E - 1 : E + _ / 3); }, parseUVIndex: function(x, _) { var E = parseInt(x, 10); return 2 * (0 <= E ? E - 1 : E + _ / 2); }, addVertex: function(x, _, E) { var L = this.vertices, R = this.object.geometry.vertices; R.push(L[x + 0], L[x + 1], L[x + 2]), R.push(L[_ + 0], L[_ + 1], L[_ + 2]), R.push(L[E + 0], L[E + 1], L[E + 2]); }, addVertexPoint: function(x) { var _ = this.vertices, E = this.object.geometry.vertices; E.push(_[x + 0], _[x + 1], _[x + 2]); }, addVertexLine: function(x) { var _ = this.vertices, E = this.object.geometry.vertices; E.push(_[x + 0], _[x + 1], _[x + 2]); }, addNormal: function(x, _, E) { var L = this.normals, R = this.object.geometry.normals; R.push(L[x + 0], L[x + 1], L[x + 2]), R.push(L[_ + 0], L[_ + 1], L[_ + 2]), R.push(L[E + 0], L[E + 1], L[E + 2]); }, addFaceNormal: function(x, _, E) { var L = this.vertices, R = this.object.geometry.normals; f.fromArray(L, x), u.fromArray(L, _), y.fromArray(L, E), m.subVectors(y, u), v.subVectors(f, u), m.cross(v), m.normalize(), R.push(m.x, m.y, m.z), R.push(m.x, m.y, m.z), R.push(m.x, m.y, m.z); }, addColor: function(x, _, E) { var L = this.colors, R = this.object.geometry.colors; L[x] !== void 0 && R.push(L[x + 0], L[x + 1], L[x + 2]), L[_] !== void 0 && R.push(L[_ + 0], L[_ + 1], L[_ + 2]), L[E] !== void 0 && R.push(L[E + 0], L[E + 1], L[E + 2]); }, addUV: function(x, _, E) { var L = this.uvs, R = this.object.geometry.uvs; R.push(L[x + 0], L[x + 1]), R.push(L[_ + 0], L[_ + 1]), R.push(L[E + 0], L[E + 1]); }, addDefaultUV: function() { var x = this.object.geometry.uvs; x.push(0, 0), x.push(0, 0), x.push(0, 0); }, addUVLine: function(x) { var _ = this.uvs, E = this.object.geometry.uvs; E.push(_[x + 0], _[x + 1]); }, addFace: function(x, _, E, L, R, C, A, P, I) { var b = this.vertices.length, O = this.parseVertexIndex(x, b), N = this.parseVertexIndex(_, b), D = this.parseVertexIndex(E, b); if (this.addVertex(O, N, D), this.addColor(O, N, D), A !== void 0 && A !== "") { var B = this.normals.length; O = this.parseNormalIndex(A, B), N = this.parseNormalIndex(P, B), D = this.parseNormalIndex(I, B), this.addNormal(O, N, D); } else this.addFaceNormal(O, N, D); if (L !== void 0 && L !== "") { var U = this.uvs.length; O = this.parseUVIndex(L, U), N = this.parseUVIndex(R, U), D = this.parseUVIndex(C, U), this.addUV(O, N, D), this.object.geometry.hasUVIndices = true; } else this.addDefaultUV(); }, addPointGeometry: function(x) { this.object.geometry.type = "Points"; for (var _, E = this.vertices.length, L = 0, R = x.length; L < R; L++) _ = this.parseVertexIndex(x[L], E), this.addVertexPoint(_), this.addColor(_); }, addLineGeometry: function(x, _) { this.object.geometry.type = "Line"; for (var E = this.vertices.length, L = this.uvs.length, R = 0, C = x.length; R < C; R++) this.addVertexLine(this.parseVertexIndex(x[R], E)); for (var A = 0, P = _.length; A < P; A++) this.addUVLine(this.parseUVIndex(_[A], L)); } }; return T.startObject("", false), T; } class S extends l.Loader { constructor(M) { super(M), this.materials = null; } load(M, x, _, E) { var L = this, R = new l.FileLoader(this.manager); R.setPath(this.path), R.setRequestHeader(this.requestHeader), R.setWithCredentials(this.withCredentials), R.load(M, function(C) { try { x(L.parse(C)); } catch (A) { E ? E(A) : console.error(A), L.manager.itemError(M); } }, _, E); } setMaterials(M) { return this.materials = M, this; } parse(M) { var x = new w(); M.indexOf(`\r `) !== -1 && (M = M.replace(/\r\n/g, ` `)), M.indexOf(`\\ `) !== -1 && (M = M.replace(/\\\n/g, "")); for (var _ = M.split(` `), E = "", L = "", R = 0, C = [], A = typeof "".trimLeft == "function", P = 0, I = _.length; P < I; P++) if (E = _[P], E = A ? E.trimLeft() : E.trim(), R = E.length, R !== 0 && (L = E.charAt(0), L !== "#")) if (L === "v") { var b = E.split(/\s+/); switch (b[0]) { case "v": x.vertices.push(parseFloat(b[1]), parseFloat(b[2]), parseFloat(b[3])), 7 <= b.length ? x.colors.push(parseFloat(b[4]), parseFloat(b[5]), parseFloat(b[6])) : x.colors.push(void 0, void 0, void 0); break; case "vn": x.normals.push(parseFloat(b[1]), parseFloat(b[2]), parseFloat(b[3])); break; case "vt": x.uvs.push(parseFloat(b[1]), parseFloat(b[2])); } } else if (L === "f") { for (var O, N = E.substr(1).trim(), D = N.split(/\s+/), B = [], U = 0, k = D.length; U < k; U++) if (O = D[U], 0 < O.length) { var K = O.split("/"); B.push(K); } for (var ie = B[0], j = 1, G = B.length - 1; j < G; j++) { var W = B[j], q = B[j + 1]; x.addFace(ie[0], W[0], q[0], ie[1], W[1], q[1], ie[2], W[2], q[2]); } } else if (L === "l") { var Q = E.substring(1).trim().split(" "), ee = [], ne = []; if (E.indexOf("/") === -1) ee = Q; else for (var Y, te = 0, F = Q.length; te < F; te++) Y = Q[te].split("/"), Y[0] !== "" && ee.push(Y[0]), Y[1] !== "" && ne.push(Y[1]); x.addLineGeometry(ee, ne); } else if (L === "p") { var $ = E.substr(1).trim(), J = $.split(" "); x.addPointGeometry(J); } else if ((C = d.exec(E)) !== null) { var z = (" " + C[0].substr(1).trim()).substr(1); x.startObject(z); } else if (p.test(E)) x.object.startMaterial(E.substring(7).trim(), x.materialLibraries); else if (h6.test(E)) x.materialLibraries.push(E.substring(7).trim()); else if (g.test(E)) console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.'); else if (L === "s") { if (C = E.split(" "), 1 < C.length) { var V = C[1].trim().toLowerCase(); x.object.smooth = V !== "0" && V !== "off"; } else x.object.smooth = true; var oe = x.object.currentMaterial(); oe && (oe.smooth = x.object.smooth); } else { if (E === "\0") continue; console.warn('THREE.OBJLoader: Unexpected line: "' + E + '"'); } x.finalize(); var ue = new l.Group(); ue.materialLibraries = [].concat(x.materialLibraries); var le = x.objects.length !== 1 || x.objects[0].geometry.vertices.length !== 0; if (le == true) for (var ve = 0, xe = x.objects.length; ve < xe; ve++) { var Te = x.objects[ve], de = Te.geometry, we = Te.materials, se = de.type === "Line", Se2 = de.type === "Points", ge = false; if (de.vertices.length !== 0) { var be2 = new l.BufferGeometry(); be2.setAttribute("position", new l.Float32BufferAttribute(de.vertices, 3)), 0 < de.normals.length && be2.setAttribute("normal", new l.Float32BufferAttribute(de.normals, 3)), 0 < de.colors.length && (ge = true, be2.setAttribute("color", new l.Float32BufferAttribute(de.colors, 3))), de.hasUVIndices === true && be2.setAttribute("uv", new l.Float32BufferAttribute(de.uvs, 2)); for (var Ie2 = [], et2 = 0, mt = we.length; et2 < mt; et2++) { var Ue = we[et2], bt2 = Ue.name + "_" + Ue.smooth + "_" + ge, Ve = x.materials[bt2]; if (this.materials !== null) { if (Ve = this.materials.create(Ue.name), se && Ve && !(Ve instanceof l.LineBasicMaterial)) { var lt = new l.LineBasicMaterial(); l.Material.prototype.copy.call(lt, Ve), lt.color.copy(Ve.color), Ve = lt; } else if (Se2 && Ve && !(Ve instanceof l.PointsMaterial)) { var tt2 = new l.PointsMaterial({ size: 10, sizeAttenuation: false }); l.Material.prototype.copy.call(tt2, Ve), tt2.color.copy(Ve.color), tt2.map = Ve.map, Ve = tt2; } } Ve === void 0 && (Ve = se ? new l.LineBasicMaterial() : Se2 ? new l.PointsMaterial({ size: 1, sizeAttenuation: false }) : new l.MeshPhongMaterial(), Ve.name = Ue.name, Ve.flatShading = !Ue.smooth, Ve.vertexColors = ge, x.materials[bt2] = Ve), Ie2.push(Ve); } var xt = void 0; if (1 < Ie2.length) { for (var pt2, Vt2 = 0, Nt2 = we.length; Vt2 < Nt2; Vt2++) pt2 = we[Vt2], be2.addGroup(pt2.groupStart, pt2.groupCount, Vt2); xt = se ? new l.LineSegments(be2, Ie2) : Se2 ? new l.Points(be2, Ie2) : new l.Mesh(be2, Ie2); } else xt = se ? new l.LineSegments(be2, Ie2[0]) : Se2 ? new l.Points(be2, Ie2[0]) : new l.Mesh(be2, Ie2[0]); xt.name = Te.name, ue.add(xt); } } else if (0 < x.vertices.length) { var re = new l.PointsMaterial({ size: 1, sizeAttenuation: false }), Ee = new l.BufferGeometry(); Ee.setAttribute("position", new l.Float32BufferAttribute(x.vertices, 3)), 0 < x.colors.length && x.colors[0] !== void 0 && (Ee.setAttribute("color", new l.Float32BufferAttribute(x.colors, 3)), re.vertexColors = true); var Ne = new l.Points(Ee, re); ue.add(Ne); } return ue; } } }, /* 38 */ /***/ (o, a, c) => { function l(S, T) { var M = Object.keys(S); if (Object.getOwnPropertySymbols) { var x = Object.getOwnPropertySymbols(S); T && (x = x.filter(function(_) { return Object.getOwnPropertyDescriptor(S, _).enumerable; })), M.push.apply(M, x); } return M; } function d(S) { for (var T, M = 1; M < arguments.length; M++) T = arguments[M] == null ? {} : arguments[M], M % 2 ? l(Object(T), true).forEach(function(x) { h6(S, x, T[x]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(S, Object.getOwnPropertyDescriptors(T)) : l(Object(T)).forEach(function(x) { Object.defineProperty(S, x, Object.getOwnPropertyDescriptor(T, x)); }); return S; } function h6(S, T, M) { return T = p(T), T in S ? Object.defineProperty(S, T, { value: M, enumerable: true, configurable: true, writable: true }) : S[T] = M, S; } function p(S) { var T = g(S, "string"); return typeof T == "symbol" ? T : T + ""; } function g(S, T) { if (typeof S != "object" || !S) return S; var M = S[Symbol.toPrimitive]; if (M !== void 0) { var x = M.call(S, T || "default"); if (typeof x != "object") return x; throw new TypeError("@@toPrimitive must return a primitive value."); } return (T === "string" ? String : Number)(S); } var f = c(19).JSONLoader, u = c(4), y = u.FileLoader, v = (S) => { var T = (x, _) => { x.merge(_); }; if (S && 0 < S.length) { for (; 1 < S.length; ) { var M = S.splice(1, 1); T(S[0], M[0]); } return S[0]; } }, m = function(T, M, x) { var _ = new y(), E = new f(); _.crossOrigin = M; var L = T, R = x, C = void 0, A = false, P = false, I = void 0, b = [], O = (U) => { var k = C[U.index]; if (k) { var K = E.parse(k); U.onLoad(K.geometry, K.materials); } else N(U); }, N = (U) => { U.onError && (!I && (I = { responseURL: L }), U.onError(I)); }; this.downloadCompleted = (U) => { try { C = JSON.parse(U[0]), A = false, P = true, Array.isArray(C) ? b.forEach((k) => O(k)) : b.forEach((k) => N(k)); } catch { b.forEach((K) => N(K)); } }; var D = () => (U) => { I = U, P = true, A = false, b.forEach((k) => { N(k); }); }, B = () => (U) => { b.forEach((k) => { k.onProgress && k.onProgress(U); }); }; this.load = (U, k, K, ie) => { var j = { index: U, onLoad: k, onProgress: K, onError: ie }; P ? C ? O(j) : N(I) : A ? b.push(j) : (b.push(j), A = true, _.load(L, R, B, D)); }; }, w = function(T, M) { var x = [], _ = T, E = M, L = 0; this.itemDownloaded = (R, C) => { if (x[R] = C, L++, L == _) { for (var A = x[0][1], P = x.map((O) => O[0]), I = v(P), b = 1; b < _; b++) x[R][0].dispose(), x[R][1].forEach((O) => O.dispose()); E(I, A); } }; }; a.PrimitivesLoader = function() { var S = 0, T = 20; this.crossOrigin = "Anonymous"; var M = new f(), x = [], _ = {}, E = (A, P, I, b, O) => { var N = A.length, D = new w(N, P), B = 0; A.forEach((U) => { var k = O ? d({}, O) : {}; k.msHandler = D, k.order = B, B++, R(U, P, I, b, k); }); }, L = (A, P, I, b, O) => { var N = O ? d({}, O) : {}, D = _[A]; if (!D) if (T > S) { var B = new C(void 0, this, N); ++S, D = new m(A, this.crossOrigin, B), _[A] = D; } else x.push({ url: A, onLoad: P, onProgress: I, onError: b, options: O }); D && (N.isHandler = D, D.load(O.index, P, I, b)); }, R = (A, P, I, b, O) => { if (O && O.index !== void 0) L(A, P, I, b, O); else if (T > S) { ++S; var N = new C(P, this, O), D = new C(b, this, O); M.crossOrigin = this.crossOrigin, M.load(A, N, I, D); } else x.push({ url: A, onLoad: P, onProgress: I, onError: b, options: O }); }; this.load = (A, P, I, b, O) => { Array.isArray(A) ? E(A, P, I, b, O) : R(A, P, I, b, O); }, this.loadFromWaitingList = () => { for (; T > S; ) { var A = x.shift(); if (A) this.load(A.url, A.onLoad, A.onProgress, A.onError, A.options); else return; } }, this.itemRemainingCheck = () => { if (x.length === 0 && S == 0) for (var A in _) _.hasOwnProperty(A) && delete _[A]; }; var C = function(P, I, b) { return function() { --S; for (var O = arguments.length, N = Array(O), D = 0; D < O; D++) N[D] = arguments[D]; b != null && b.msHandler ? b.msHandler.itemDownloaded(b.order, N) : b != null && b.isHandler ? b.isHandler.downloadCompleted(N) : P && P(...N), I.loadFromWaitingList(), I.itemRemainingCheck(); }; }; this.parse = (A) => M.parse(A); }; }, /* 39 */ /***/ (o, a, c) => { c(4); var l = c(40).GLTFLoader, d = function() { var h6 = this; this.parseGLTFObjects = (p, g, f, u) => { var y = g; if (f !== 0) { if (p.type !== "Object3D") { var v; if (p.type === "Mesh" ? v = new (c(3)).Geometry() : p.type === "LineSegments" ? v = new (c(24)).Lines() : p.type === "Points" && (v = new (c(22)).Pointset()), v) { var m = false, w = false; p.geometry && p.geometry.morphAttributes && (m = !!p.geometry.morphAttributes.position, w = !!p.geometry.morphAttributes.color), v.setMesh(p.clone(), m, w); var S = v.getMorph(); v.groupName = S.name, S.matrixAutoUpdate = true, g.addZincObject(v), u != null && typeof u == "function" && u(v); } } else if (p.name !== "" && (g && (y = g.findOrCreateChildFromPath(p.name)), y)) { var T = y.getGroup(); T.position.copy(p.position), T.rotation.copy(p.rotation), T.quaternion.copy(p.quaternion), T.matrixAutoUpdate = true; } } f++, p.children.forEach((M) => { h6.parseGLTFObjects(M, y, f, u); }); }, this.setCamera = (p) => { p.viewAll(); var g = p.getZincCameraControls(), f = g.getCurrentViewport(); g.addViewport("default", f), g.setDefaultViewport("default"); }, this.load = (p, g, f, u, y) => { var v = f.substring(0, f.lastIndexOf("/") + 1), m = f.substring(f.lastIndexOf("/") + 1, f.length), w = new l().setPath(v); w.load(m, function(S) { console.log(S), h6.parseGLTFObjects(S.scene, g, 0, u), h6.setCamera(p), y != null && typeof y == "function" && y(); }); }; }; a.GLTFToZincJSLoader = d; }, /* 40 */ /***/ (o) => { o.exports = Tz; }, /* 41 */ /***/ (o, a, c) => { var l = c(42).GLTFExporter, d = function(h6) { var p = h6; this.exportGLTF = (g) => { var f = p.getRootRegion(), u = f.getAllObjects(true), y = []; u.forEach((w) => { w.animationClip && y.push({ clip: w.animationClip[0], mesh: w.getMorph() }); }); var v = new l(), m = { binary: g, animations: y }; return new Promise((w) => { v.parse(p.getThreeJSScene(), function(S) { w(S); }, m); }); }; }; a.SceneExporter = d; }, /* 42 */ /***/ (o, a, c) => { c.r(a), c.d(a, { /* harmony export */ GLTFExporter: () => ( /* binding */ d ) /* harmony export */ }); var l = c(4); class d { constructor() { this.pluginCallbacks = [], this.register(function(b) { return new C(b); }), this.register(function(b) { return new A(b); }), this.register(function(b) { return new P(b); }); } register(b) { return this.pluginCallbacks.indexOf(b) === -1 && this.pluginCallbacks.push(b), this; } unregister(b) { return this.pluginCallbacks.indexOf(b) !== -1 && this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(b), 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(b, O, N) { for (var D = new R(), B = [], U = 0, k = this.pluginCallbacks.length; U < k; U++) B.push(this.pluginCallbacks[U](D)); D.setPlugins(B), D.write(b, O, N); } } var h6 = { 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 }, p = {}; p[l.NearestFilter] = h6.NEAREST, p[l.NearestMipmapNearestFilter] = h6.NEAREST_MIPMAP_NEAREST, p[l.NearestMipmapLinearFilter] = h6.NEAREST_MIPMAP_LINEAR, p[l.LinearFilter] = h6.LINEAR, p[l.LinearMipmapNearestFilter] = h6.LINEAR_MIPMAP_NEAREST, p[l.LinearMipmapLinearFilter] = h6.LINEAR_MIPMAP_LINEAR, p[l.ClampToEdgeWrapping] = h6.CLAMP_TO_EDGE, p[l.RepeatWrapping] = h6.REPEAT, p[l.MirroredRepeatWrapping] = h6.MIRRORED_REPEAT; var g = { scale: "scale", position: "translation", quaternion: "rotation", morphTargetInfluences: "weights" }, f = 12, u = 1179937895, y = 2, v = 8, m = 1313821514, w = 5130562; function S(I, b) { return I.length === b.length && I.every(function(O, N) { return O === b[N]; }); } function T(I) { if (window.TextEncoder !== void 0) return new TextEncoder().encode(I).buffer; for (var b, O = new Uint8Array(new ArrayBuffer(I.length)), N = 0, D = I.length; N < D; N++) b = I.charCodeAt(N), O[N] = 255 < b ? 32 : b; return O.buffer; } function M(I) { return S(I.elements, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]); } function x(I, b, O) { for (var N = { min: Array(I.itemSize).fill(Number.POSITIVE_INFINITY), max: Array(I.itemSize).fill(Number.NEGATIVE_INFINITY) }, D = b; D < b + O; D++) for (var B, U = 0; U < I.itemSize; U++) B = void 0, 4 < I.itemSize ? B = I.array[D * I.itemSize + U] : U === 0 ? B = I.getX(D) : U === 1 ? B = I.getY(D) : U === 2 ? B = I.getZ(D) : U == 3 && (B = I.getW(D)), N.min[U] = Math.min(N.min[U], B), N.max[U] = Math.max(N.max[U], B); return N; } function _(I) { return 4 * Math.ceil(I / 4); } function E(I) { var b = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : 0, O = _(I.byteLength); if (O !== I.byteLength) { var N = new Uint8Array(O); if (N.set(new Uint8Array(I)), b !== 0) for (var D = I.byteLength; D < O; D++) N[D] = b; return N.buffer; } return I; } var L = null; class R { 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(b) { this.plugins = b; } /** * 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(b, O, N) { this.options = Object.assign({}, { // default options binary: false, trs: false, onlyVisible: true, truncateDrawRange: true, embedImages: true, maxTextureSize: 1 / 0, animations: [], includeCustomExtensions: false }, N), 0 < this.options.animations.length && (this.options.trs = true), this.processInput(b); var D = this; Promise.all(this.pending).then(function() { var B = D.buffers, U = D.json, k = D.options, K = D.extensionsUsed, ie = new Blob(B, { type: "application/octet-stream" }), j = Object.keys(K); if (0 < j.length && (U.extensionsUsed = j), U.buffers && 0 < U.buffers.length && (U.buffers[0].byteLength = ie.size), k.binary === true) { var G = new window.FileReader(); G.readAsArrayBuffer(ie), G.onloadend = function() { var q = E(G.result), Q = new DataView(new ArrayBuffer(v)); Q.setUint32(0, q.byteLength, true), Q.setUint32(4, w, true); var ee = E(T(JSON.stringify(U)), 32), ne = new DataView(new ArrayBuffer(v)); ne.setUint32(0, ee.byteLength, true), ne.setUint32(4, m, true); var Y = new ArrayBuffer(f), te = new DataView(Y); te.setUint32(0, u, true), te.setUint32(4, y, true); var F = f + ne.byteLength + ee.byteLength + Q.byteLength + q.byteLength; te.setUint32(8, F, true); var $ = new Blob([Y, ne, ee, Q, q], { type: "application/octet-stream" }), J = new window.FileReader(); J.readAsArrayBuffer($), J.onloadend = function() { O(J.result); }; }; } else if (U.buffers && 0 < U.buffers.length) { var W = new window.FileReader(); W.readAsDataURL(ie), W.onloadend = function() { var q = W.result; U.buffers[0].uri = q, O(U); }; } else O(U); }); } /** * Serializes a userData. * * @param {THREE.Object3D|THREE.Material} object * @param {Object} objectDef */ serializeUserData(b, O) { if (!(b.userData && b.userData.isZincObject) && Object.keys(b.userData).length !== 0) { var N = this.options, D = this.extensionsUsed; try { var B = JSON.parse(JSON.stringify(b.userData)); if (N.includeCustomExtensions && B.gltfExtensions) { for (var U in O.extensions === void 0 && (O.extensions = {}), B.gltfExtensions) O.extensions[U] = B.gltfExtensions[U], D[U] = true; delete B.gltfExtensions; } 0 < Object.keys(B).length && (O.extras = B); } catch (k) { console.warn("THREE.GLTFExporter: userData of '" + b.name + "' won't be serialized because of JSON.stringify error - " + k.message); } } } /** * Assign and return a temporal unique id for an object * especially which doesn't have .uuid * @param {Object} object * @return {Integer} */ getUID(b) { return this.uids.has(b) || this.uids.set(b, this.uid++), this.uids.get(b); } /** * Checks if normal attribute values are normalized. * * @param {BufferAttribute} normal * @returns {Boolean} */ isNormalizedNormalAttribute(b) { var O = this.cache; if (O.attributesNormalized.has(b)) return false; for (var N = new l.Vector3(), D = 0, B = b.count; D < B; D++) if (5e-4 < Math.abs(N.fromBufferAttribute(b, D).length() - 1)) return false; return true; } /** * Creates normalized normal buffer attribute. * * @param {BufferAttribute} normal * @returns {BufferAttribute} * */ createNormalizedNormalAttribute(b) { var O = this.cache; if (O.attributesNormalized.has(b)) return O.attributesNormalized.get(b); for (var N = b.clone(), D = new l.Vector3(), B = 0, U = N.count; B < U; B++) D.fromBufferAttribute(N, B), D.x === 0 && D.y === 0 && D.z === 0 ? D.setX(1) : D.normalize(), N.setXYZ(B, D.x, D.y, D.z); return O.attributesNormalized.set(b, N), N; } /** * Applies a texture transform, if present, to the map definition. Requires * the KHR_texture_transform extension. * * @param {Object} mapDef * @param {THREE.Texture} texture */ applyTextureTransform(b, O) { var N = false, D = {}; (O.offset.x !== 0 || O.offset.y !== 0) && (D.offset = O.offset.toArray(), N = true), O.rotation !== 0 && (D.rotation = O.rotation, N = true), (O.repeat.x !== 1 || O.repeat.y !== 1) && (D.scale = O.repeat.toArray(), N = true), N && (b.extensions = b.extensions || {}, b.extensions.KHR_texture_transform = D, this.extensionsUsed.KHR_texture_transform = true); } /** * Process a buffer to append to the default one. * @param {ArrayBuffer} buffer * @return {Integer} */ processBuffer(b) { var O = this.json, N = this.buffers; return O.buffers || (O.buffers = [{ byteLength: 0 }]), N.push(b), 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(b, O, N, D, B) { var U = this.json; U.bufferViews || (U.bufferViews = []); for (var k = O === h6.UNSIGNED_BYTE ? 1 : O === h6.UNSIGNED_SHORT ? 2 : 4, K = _(D * b.itemSize * k), ie = new DataView(new ArrayBuffer(K)), j = 0, G = N; G < N + D; G++) for (var W, q = 0; q < b.itemSize; q++) W = void 0, 4 < b.itemSize ? W = b.array[G * b.itemSize + q] : q === 0 ? W = b.getX(G) : q === 1 ? W = b.getY(G) : q === 2 ? W = b.getZ(G) : q == 3 && (W = b.getW(G)), O === h6.FLOAT ? ie.setFloat32(j, W, true) : O === h6.UNSIGNED_INT ? ie.setUint32(j, W, true) : O === h6.UNSIGNED_SHORT ? ie.setUint16(j, W, true) : O === h6.UNSIGNED_BYTE && ie.setUint8(j, W), j += k; var Q = { buffer: this.processBuffer(ie.buffer), byteOffset: this.byteOffset, byteLength: K }; B !== void 0 && (Q.target = B), B === h6.ARRAY_BUFFER && (Q.byteStride = b.itemSize * k), this.byteOffset += K, U.bufferViews.push(Q); var ee = { id: U.bufferViews.length - 1, byteLength: 0 }; return ee; } /** * Process and generate a BufferView from an image Blob. * @param {Blob} blob * @return {Promise} */ processBufferViewImage(b) { var O = this, N = O.json; return N.bufferViews || (N.bufferViews = []), new Promise(function(D) { var B = new window.FileReader(); B.readAsArrayBuffer(b), B.onloadend = function() { var U = E(B.result), k = { buffer: O.processBuffer(U), byteOffset: O.byteOffset, byteLength: U.byteLength }; O.byteOffset += U.byteLength, D(N.bufferViews.push(k) - 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(b, O, N, D) { var B, U = this.options, k = this.json; if (b.array.constructor === Float32Array) B = h6.FLOAT; else if (b.array.constructor === Uint32Array) B = h6.UNSIGNED_INT; else if (b.array.constructor === Uint16Array) B = h6.UNSIGNED_SHORT; else if (b.array.constructor === Uint8Array) B = h6.UNSIGNED_BYTE; else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type."); if (N === void 0 && (N = 0), D === void 0 && (D = b.count), U.truncateDrawRange && O !== void 0 && O.index === null) { var K = N + D, ie = O.drawRange.count === 1 / 0 ? b.count : O.drawRange.start + O.drawRange.count; N = Math.max(N, O.drawRange.start), D = Math.min(K, ie) - N, 0 > D && (D = 0); } if (D === 0) return null; var j, G = x(b, N, D); O !== void 0 && (j = b === O.index ? h6.ELEMENT_ARRAY_BUFFER : h6.ARRAY_BUFFER); var W = this.processBufferView(b, B, N, D, j), q = { bufferView: W.id, byteOffset: W.byteOffset, componentType: B, count: D, max: G.max, min: G.min, type: { 1: "SCALAR", 2: "VEC2", 3: "VEC3", 4: "VEC4", 16: "MAT4" }[b.itemSize] }; return b.normalized === true && (q.normalized = true), k.accessors || (k.accessors = []), k.accessors.push(q) - 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(b, O, N) { var D = this, B = D.cache, U = D.json, k = D.options, K = D.pending; B.images.has(b) || B.images.set(b, {}); var ie = B.images.get(b), j = O === l.RGBAFormat ? "image/png" : "image/jpeg", G = j + ":flipY/" + N.toString(); if (ie[G] !== void 0) return ie[G]; U.images || (U.images = []); var W = { mimeType: j }; if (k.embedImages) { var q = L = L || document.createElement("canvas"); q.width = Math.min(b.width, k.maxTextureSize), q.height = Math.min(b.height, k.maxTextureSize); var Q = q.getContext("2d"); if (N === true && (Q.translate(0, q.height), Q.scale(1, -1)), typeof HTMLImageElement < "u" && b instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && b instanceof HTMLCanvasElement || typeof OffscreenCanvas < "u" && b instanceof OffscreenCanvas || typeof ImageBitmap < "u" && b instanceof ImageBitmap) Q.drawImage(b, 0, 0, q.width, q.height); else { O !== l.RGBAFormat && O !== l.RGBFormat && console.error("GLTFExporter: Only RGB and RGBA formats are supported."), (b.width > k.maxTextureSize || b.height > k.maxTextureSize) && console.warn("GLTFExporter: Image size is bigger than maxTextureSize", b); var ee = new Uint8ClampedArray(4 * (b.height * b.width)); if (O === l.RGBAFormat) for (var ne = 0; ne < ee.length; ne += 4) ee[ne + 0] = b.data[ne + 0], ee[ne + 1] = b.data[ne + 1], ee[ne + 2] = b.data[ne + 2], ee[ne + 3] = b.data[ne + 3]; else for (var Y = 0, te = 0; Y < ee.length; Y += 4, te += 3) ee[Y + 0] = b.data[te + 0], ee[Y + 1] = b.data[te + 1], ee[Y + 2] = b.data[te + 2], ee[Y + 3] = 255; Q.putImageData(new ImageData(ee, b.width, b.height), 0, 0); } k.binary === true ? K.push(new Promise(function($) { q.toBlob(function(J) { D.processBufferViewImage(J).then(function(z) { W.bufferView = z, $(); }); }, j); })) : W.uri = q.toDataURL(j); } else W.uri = b.src; var F = U.images.push(W) - 1; return ie[G] = F, F; } /** * Process sampler * @param {Texture} map Texture to process * @return {Integer} Index of the processed texture in the "samplers" array */ processSampler(b) { var O = this.json; O.samplers || (O.samplers = []); var N = { magFilter: p[b.magFilter], minFilter: p[b.minFilter], wrapS: p[b.wrapS], wrapT: p[b.wrapT] }; return O.samplers.push(N) - 1; } /** * Process texture * @param {Texture} map Map to process * @return {Integer} Index of the processed texture in the "textures" array */ processTexture(b) { var O = this.cache, N = this.json; if (O.textures.has(b)) return O.textures.get(b); N.textures || (N.textures = []); var D = { sampler: this.processSampler(b), source: this.processImage(b.image, b.format, b.flipY) }; b.name && (D.name = b.name), this._invokeAll(function(U) { U.writeTexture && U.writeTexture(b, D); }); var B = N.textures.push(D) - 1; return O.textures.set(b, B), B; } /** * Process material * @param {THREE.Material} material Material to process * @return {Integer|null} Index of the processed material in the "materials" array */ processMaterial(b) { var O = this.cache, N = this.json; if (O.materials.has(b)) return O.materials.get(b); if (b.isShaderMaterial) return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."), null; N.materials || (N.materials = []); var D = { pbrMetallicRoughness: {} }; b.isMeshStandardMaterial !== true && b.isMeshBasicMaterial !== true && console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results."); var B = b.color.toArray().concat([b.opacity]); if (S(B, [1, 1, 1, 1]) || (D.pbrMetallicRoughness.baseColorFactor = B), b.isMeshStandardMaterial ? (D.pbrMetallicRoughness.metallicFactor = b.metalness, D.pbrMetallicRoughness.roughnessFactor = b.roughness) : (D.pbrMetallicRoughness.metallicFactor = 0.5, D.pbrMetallicRoughness.roughnessFactor = 0.5), b.metalnessMap || b.roughnessMap) if (b.metalnessMap === b.roughnessMap) { var U = { index: this.processTexture(b.metalnessMap) }; this.applyTextureTransform(U, b.metalnessMap), D.pbrMetallicRoughness.metallicRoughnessTexture = U; } else console.warn("THREE.GLTFExporter: Ignoring metalnessMap and roughnessMap because they are not the same Texture."); if (b.map) { var k = { index: this.processTexture(b.map) }; this.applyTextureTransform(k, b.map), D.pbrMetallicRoughness.baseColorTexture = k; } if (b.emissive) { var K = b.emissive.clone().multiplyScalar(b.emissiveIntensity), ie = Math.max(K.r, K.g, K.b); if (1 < ie && (K.multiplyScalar(1 / ie), console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")), 0 < ie && (D.emissiveFactor = K.toArray()), b.emissiveMap) { var j = { index: this.processTexture(b.emissiveMap) }; this.applyTextureTransform(j, b.emissiveMap), D.emissiveTexture = j; } } if (b.normalMap) { var G = { index: this.processTexture(b.normalMap) }; b.normalScale && b.normalScale.x !== -1 && (b.normalScale.x !== b.normalScale.y && console.warn("THREE.GLTFExporter: Normal scale components are different, ignoring Y and exporting X."), G.scale = b.normalScale.x), this.applyTextureTransform(G, b.normalMap), D.normalTexture = G; } if (b.aoMap) { var W = { index: this.processTexture(b.aoMap), texCoord: 1 }; b.aoMapIntensity !== 1 && (W.strength = b.aoMapIntensity), this.applyTextureTransform(W, b.aoMap), D.occlusionTexture = W; } b.transparent ? D.alphaMode = "BLEND" : 0 < b.alphaTest && (D.alphaMode = "MASK", D.alphaCutoff = b.alphaTest), b.side === l.DoubleSide && (D.doubleSided = true), b.name !== "" && (D.name = b.name), this.serializeUserData(b, D), this._invokeAll(function(Q) { Q.writeMaterial && Q.writeMaterial(b, D); }); var q = N.materials.push(D) - 1; return O.materials.set(b, q), q; } /** * Process mesh * @param {THREE.Mesh} mesh Mesh to process * @return {Integer|null} Index of the processed mesh in the "meshes" array */ processMesh(b) { var O = this.cache, N = this.json, D = [b.geometry.uuid]; if (Array.isArray(b.material)) for (var B = 0, U = b.material.length; B < U; B++) D.push(b.material[B].uuid); else D.push(b.material.uuid); var k = D.join(":"); if (O.meshes.has(k)) return O.meshes.get(k); var K, ie = b.geometry; if (K = b.isLineSegments ? h6.LINES : b.isLineLoop ? h6.LINE_LOOP : b.isLine ? h6.LINE_STRIP : b.isPoints ? h6.POINTS : b.material.wireframe ? h6.LINES : h6.TRIANGLES, ie.isBufferGeometry !== true) throw new Error("THREE.GLTFExporter: Geometry is not of type THREE.BufferGeometry."); var j = {}, G = {}, W = [], q = [], Q = { uv: "TEXCOORD_0", uv2: "TEXCOORD_1", color: "COLOR_0", skinWeight: "WEIGHTS_0", skinIndex: "JOINTS_0" }, ee = ie.getAttribute("normal"); ee === void 0 || this.isNormalizedNormalAttribute(ee) || (console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."), ie.setAttribute("normal", this.createNormalizedNormalAttribute(ee))); var ne = null; for (var Y in ie.attributes) if (Y.substr(0, 5) !== "morph") { var te = ie.attributes[Y]; Y = Q[Y] || Y.toUpperCase(); var F = /^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/; if (F.test(Y) || (Y = "_" + Y), O.attributes.has(this.getUID(te))) { G[Y] = O.attributes.get(this.getUID(te)); continue; } ne = null; var $ = te.array; Y !== "JOINTS_0" || $ instanceof Uint16Array || $ instanceof Uint8Array || (console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'), ne = new l.BufferAttribute(new Uint16Array($), te.itemSize, te.normalized)); var J = this.processAccessor(ne || te, ie); J !== null && (G[Y] = J, O.attributes.set(this.getUID(te), J)); } if (ee !== void 0 && ie.setAttribute("normal", ee), Object.keys(G).length === 0) return null; if (b.morphTargetInfluences !== void 0 && 0 < b.morphTargetInfluences.length) { var z = [], V = [], oe = {}; if (b.morphTargetDictionary !== void 0) for (var ue in b.morphTargetDictionary) oe[b.morphTargetDictionary[ue]] = ue; for (var le = 0; le < b.morphTargetInfluences.length; ++le) { var ve = {}, xe = false; for (var Te in ie.morphAttributes) { if (Te != "position" && Te !== "normal" && Te !== "color") { xe || (console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."), xe = true); continue; } var de = ie.morphAttributes[Te][le], we = Te.toUpperCase(); Q[Te] && (we = Q[Te]); var se = ie.attributes[Te]; if (O.attributes.has(this.getUID(de))) { ve[we] = O.attributes.get(this.getUID(de)); continue; } var Se2 = se.clone(); if (!ie.morphTargetsRelative) if (se) for (var ge = 0, be2 = de.count; ge < be2; ge++) se.count > ge && Se2.setXYZ(ge, de.getX(ge) - se.getX(ge), de.getY(ge) - se.getY(ge), de.getZ(ge) - se.getZ(ge)); else for (var Ie2 = 0, et2 = de.count; Ie2 < et2; Ie2++) Se2.setXYZ(Ie2, 0, 0, 0); ve[we] = this.processAccessor(Se2, ie), O.attributes.set(this.getUID(se), ve[we]); } q.push(ve), z.push(b.morphTargetInfluences[le]), b.morphTargetDictionary !== void 0 && V.push(oe[le]); } j.weights = z, 0 < V.length && (j.extras = {}, j.extras.targetNames = V); } var mt = Array.isArray(b.material); if (mt && ie.groups.length === 0) return null; for (var Ue, bt2 = mt ? b.material : [b.material], Ve = mt ? ie.groups : [{ materialIndex: 0, start: void 0, count: void 0 }], lt = 0, tt2 = Ve.length; lt < tt2; lt++) { if (Ue = { mode: K, attributes: G }, this.serializeUserData(ie, Ue), 0 < q.length && (Ue.targets = q), ie.index !== null) { var xt = this.getUID(ie.index); (Ve[lt].start !== void 0 || Ve[lt].count !== void 0) && (xt += ":" + Ve[lt].start + ":" + Ve[lt].count), O.attributes.has(xt) ? Ue.indices = O.attributes.get(xt) : (Ue.indices = this.processAccessor(ie.index, ie, Ve[lt].start, Ve[lt].count), O.attributes.set(xt, Ue.indices)), Ue.indices === null && delete Ue.indices; } var pt2 = this.processMaterial(bt2[Ve[lt].materialIndex]); pt2 !== null && (Ue.material = pt2), W.push(Ue); } j.primitives = W, N.meshes || (N.meshes = []), this._invokeAll(function(Nt2) { Nt2.writeMesh && Nt2.writeMesh(b, j); }); var Vt2 = N.meshes.push(j) - 1; return O.meshes.set(k, Vt2), Vt2; } /** * Process camera * @param {THREE.Camera} camera Camera to process * @return {Integer} Index of the processed mesh in the "camera" array */ processCamera(b) { var O = this.json; O.cameras || (O.cameras = []); var N = b.isOrthographicCamera, D = { type: N ? "orthographic" : "perspective" }; return N ? D.orthographic = { xmag: 2 * b.right, ymag: 2 * b.top, zfar: 0 >= b.far ? 1e-3 : b.far, znear: 0 > b.near ? 0 : b.near } : D.perspective = { aspectRatio: b.aspect, yfov: l.MathUtils.degToRad(b.fov), zfar: 0 >= b.far ? 1e-3 : b.far, znear: 0 > b.near ? 0 : b.near }, b.name !== "" && (D.name = b.type), O.cameras.push(D) - 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(b, O) { var N = this.json, D = this.nodeMap; N.animations || (N.animations = []), b = d.Utils.mergeMorphTargetTracks(b.clone(), O); for (var B = b.tracks, U = [], k = [], K = 0; K < B.length; ++K) { var ie = B[K], j = l.PropertyBinding.parseTrackName(ie.name), G = l.PropertyBinding.findNode(O, j.nodeName), W = g[j.propertyName]; if (j.objectName === "bones" && (G.isSkinnedMesh === true ? G = G.skeleton.getBoneByName(j.objectIndex) : G = void 0), !G || !W) return console.warn('THREE.GLTFExporter: Could not export animation track "%s".', ie.name), null; var q = 1, Q = ie.values.length / ie.times.length; W === g.morphTargetInfluences && (Q /= G.morphTargetInfluences.length); var ee = void 0; ie.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline === true ? (ee = "CUBICSPLINE", Q /= 3) : ie.getInterpolation() === l.InterpolateDiscrete ? ee = "STEP" : ee = "LINEAR", k.push({ input: this.processAccessor(new l.BufferAttribute(ie.times, q)), output: this.processAccessor(new l.BufferAttribute(ie.values, Q)), interpolation: ee }), U.push({ sampler: k.length - 1, target: { node: D.get(G), path: W } }); } return N.animations.push({ name: b.name || "clip_" + N.animations.length, samplers: k, channels: U }), N.animations.length - 1; } /** * @param {THREE.Object3D} object * @return {number|null} */ processSkin(b) { var O = this.json, N = this.nodeMap, D = O.nodes[N.get(b)], B = b.skeleton; if (B === void 0) return null; var U = b.skeleton.bones[0]; if (U === void 0) return null; for (var k = [], K = new Float32Array(16 * B.bones.length), ie = new l.Matrix4(), j = 0; j < B.bones.length; ++j) k.push(N.get(B.bones[j])), ie.copy(B.boneInverses[j]), ie.multiply(b.bindMatrix).toArray(K, 16 * j); O.skins === void 0 && (O.skins = []), O.skins.push({ inverseBindMatrices: this.processAccessor(new l.BufferAttribute(K, 16)), joints: k, skeleton: N.get(U) }); var G = D.skin = O.skins.length - 1; return G; } /** * Process Object3D node * @param {THREE.Object3D} node Object3D to processNode * @return {Integer} Index of the node in the nodes list */ processNode(b) { var O = this.json, N = this.options, D = this.nodeMap; O.nodes || (O.nodes = []); var B = {}; if (N.trs) { var U = b.quaternion.toArray(), k = b.position.toArray(), K = b.scale.toArray(); S(U, [0, 0, 0, 1]) || (B.rotation = U), S(k, [0, 0, 0]) || (B.translation = k), S(K, [1, 1, 1]) || (B.scale = K); } else b.matrixAutoUpdate && b.updateMatrix(), M(b.matrix) === false && (B.matrix = b.matrix.elements); if (b.name !== "" && (B.name = b.name + ""), this.serializeUserData(b, B), b.isMesh || b.isLine || b.isPoints) { var ie = this.processMesh(b); ie !== null && (B.mesh = ie); } else b.isCamera && (B.camera = this.processCamera(b)); if (b.isSkinnedMesh && this.skins.push(b), 0 < b.children.length) { for (var j, G = [], W = 0, q = b.children.length; W < q; W++) if (j = b.children[W], j.visible || N.onlyVisible === false) { var Q = this.processNode(j); Q !== null && G.push(Q); } 0 < G.length && (B.children = G); } this._invokeAll(function(ne) { ne.writeNode && ne.writeNode(b, B); }); var ee = O.nodes.push(B) - 1; return D.set(b, ee), ee; } /** * Process Scene * @param {Scene} node Scene to process */ processScene(b) { var O = this.json, N = this.options; O.scenes || (O.scenes = [], O.scene = 0); var D = {}; b.name !== "" && (D.name = b.name), O.scenes.push(D); for (var B, U = [], k = 0, K = b.children.length; k < K; k++) if (B = b.children[k], B.visible || N.onlyVisible === false) { var ie = this.processNode(B); ie !== null && U.push(ie); } 0 < U.length && (D.nodes = U), this.serializeUserData(b, D); } /** * Creates a Scene to hold a list of objects and parse it * @param {Array} objects List of objects to process */ processObjects(b) { var O = new l.Scene(); O.name = "AuxScene"; for (var N = 0; N < b.length; N++) O.children.push(b[N]); this.processScene(O); } /** * @param {THREE.Object3D|Array} input */ processInput(b) { var O = this.options; b = b instanceof Array ? b : [b], this._invokeAll(function(k) { k.beforeParse && k.beforeParse(b); }); for (var N = [], D = 0; D < b.length; D++) b[D] instanceof l.Scene ? this.processScene(b[D]) : N.push(b[D]); 0 < N.length && this.processObjects(N); for (var B = 0; B < this.skins.length; ++B) this.processSkin(this.skins[B]); for (var U = 0; U < O.animations.length; ++U) this.processAnimation(O.animations[U].clip, O.animations[U].mesh); this._invokeAll(function(k) { k.afterParse && k.afterParse(b); }); } _invokeAll(b) { for (var O = 0, N = this.plugins.length; O < N; O++) b(this.plugins[O]); } } class C { constructor(b) { this.writer = b, this.name = "KHR_lights_punctual"; } writeNode(b, O) { if (b.isLight) { if (!b.isDirectionalLight && !b.isPointLight && !b.isSpotLight) return void console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.", b); var N = this.writer, D = N.json, B = N.extensionsUsed, U = {}; b.name && (U.name = b.name), U.color = b.color.toArray(), U.intensity = b.intensity, b.isDirectionalLight ? U.type = "directional" : b.isPointLight ? (U.type = "point", 0 < b.distance && (U.range = b.distance)) : b.isSpotLight && (U.type = "spot", 0 < b.distance && (U.range = b.distance), U.spot = {}, U.spot.innerConeAngle = -1 * ((b.penumbra - 1) * b.angle), U.spot.outerConeAngle = b.angle), b.decay !== void 0 && b.decay !== 2 && console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."), b.target && (b.target.parent !== b || b.target.position.x !== 0 || b.target.position.y !== 0 || b.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."), B[this.name] || (D.extensions = D.extensions || {}, D.extensions[this.name] = { lights: [] }, B[this.name] = true); var k = D.extensions[this.name].lights; k.push(U), O.extensions = O.extensions || {}, O.extensions[this.name] = { light: k.length - 1 }; } } } class A { constructor(b) { this.writer = b, this.name = "KHR_materials_unlit"; } writeMaterial(b, O) { if (b.isMeshBasicMaterial) { var N = this.writer, D = N.extensionsUsed; O.extensions = O.extensions || {}, O.extensions[this.name] = {}, D[this.name] = true, O.pbrMetallicRoughness.metallicFactor = 0, O.pbrMetallicRoughness.roughnessFactor = 0.9; } } } class P { constructor(b) { this.writer = b, this.name = "KHR_materials_pbrSpecularGlossiness"; } writeMaterial(b, O) { if (b.isGLTFSpecularGlossinessMaterial) { var N = this.writer, D = N.extensionsUsed, B = {}; O.pbrMetallicRoughness.baseColorFactor && (B.diffuseFactor = O.pbrMetallicRoughness.baseColorFactor); var U = [1, 1, 1]; if (b.specular.toArray(U, 0), B.specularFactor = U, B.glossinessFactor = b.glossiness, O.pbrMetallicRoughness.baseColorTexture && (B.diffuseTexture = O.pbrMetallicRoughness.baseColorTexture), b.specularMap) { var k = { index: N.processTexture(b.specularMap) }; N.applyTextureTransform(k, b.specularMap), B.specularGlossinessTexture = k; } O.extensions = O.extensions || {}, O.extensions[this.name] = B, D[this.name] = true; } } } d.Utils = { insertKeyframe: function(b, O) { var N, D = 1e-3, B = b.getValueSize(), U = new b.TimeBufferType(b.times.length + 1), k = new b.ValueBufferType(b.values.length + B), K = b.createInterpolant(new b.ValueBufferType(B)); if (b.times.length === 0) { U[0] = O; for (var ie = 0; ie < B; ie++) k[ie] = 0; N = 0; } else if (O < b.times[0]) { if (Math.abs(b.times[0] - O) < D) return 0; U[0] = O, U.set(b.times, 1), k.set(K.evaluate(O), 0), k.set(b.values, B), N = 0; } else if (O > b.times[b.times.length - 1]) { if (Math.abs(b.times[b.times.length - 1] - O) < D) return b.times.length - 1; U[U.length - 1] = O, U.set(b.times, 0), k.set(b.values, 0), k.set(K.evaluate(O), b.values.length), N = U.length - 1; } else for (var j = 0; j < b.times.length; j++) { if (Math.abs(b.times[j] - O) < D) return j; if (b.times[j] < O && b.times[j + 1] > O) { U.set(b.times.slice(0, j + 1), 0), U[j + 1] = O, U.set(b.times.slice(j + 1), j + 2), k.set(b.values.slice(0, (j + 1) * B), 0), k.set(K.evaluate(O), (j + 1) * B), k.set(b.values.slice((j + 1) * B), (j + 2) * B), N = j + 1; break; } } return b.times = U, b.values = k, N; }, mergeMorphTargetTracks: function(b, O) { for (var N = [], D = {}, B = b.tracks, U = 0; U < B.length; ++U) { var k = B[U], K = l.PropertyBinding.parseTrackName(k.name), ie = l.PropertyBinding.findNode(O, K.nodeName); if (K.propertyName !== "morphTargetInfluences" || K.propertyIndex === void 0) { N.push(k); continue; } if (k.createInterpolant !== k.InterpolantFactoryMethodDiscrete && k.createInterpolant !== k.InterpolantFactoryMethodLinear) { if (k.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."), k = k.clone(), k.setInterpolation(l.InterpolateLinear); } var j = ie.morphTargetInfluences.length, G = ie.morphTargetDictionary[K.propertyIndex]; if (G === void 0) throw new Error("THREE.GLTFExporter: Morph target name not found: " + K.propertyIndex); var W = void 0; if (D[ie.uuid] === void 0) { W = k.clone(); for (var q = new W.ValueBufferType(j * W.times.length), Q = 0; Q < W.times.length; Q++) q[Q * j + G] = W.values[Q]; W.name = (K.nodeName || "") + ".morphTargetInfluences", W.values = q, D[ie.uuid] = W, N.push(W); continue; } var ee = k.createInterpolant(new k.ValueBufferType(1)); W = D[ie.uuid]; for (var ne = 0; ne < W.times.length; ne++) W.values[ne * j + G] = ee.evaluate(W.times[ne]); for (var Y, te = 0; te < k.times.length; te++) Y = this.insertKeyframe(W, k.times[te]), W.values[Y * j + G] = k.values[te]; } return b.tracks = N, b; } }; }, /* 43 */ /***/ (o, a, c) => { var l = c(4), d = c(5).resolveURL, h6 = 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 T = this; this.setFromObject = (M) => { var { nearPlane: x, farPlane: _, eyePosition: E, targetPosition: L, upVector: R } = M; T.nearPlane = x, T.farPlane = _, T.eyePosition = E, T.targetPosition = L, T.upVector = R; }; }, p = function(T, M, x, _) { var E = { NONE: -1, DEFAULT: 0, PATH: 1, SMOOTH_CAMERA_TRANSITION: 2, AUTO_TUMBLE: 3, ROTATE_TRANSITION: 4, MINIMAP: 5, SYNC_CONTROL: 6 }, L = { NONE: -1, ROTATE: 0, ZOOM: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_ZOOM: 4, TOUCH_PAN: 5, SCROLL: 6 }, R = { NONE: -1, FREE: 1, HORIZONTAL: 2, VERTICAL: 3 }, C = {}; C.MAIN = L.ROTATE, C.AUXILIARY = L.ZOOM, C.SECONDARY = L.PAN, this.cameraObject = T, this.domElement = M === void 0 ? document : M, this.renderer = x, this.scene = _, 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 A = 6e3, P = true, I = 0, b = void 0, O = void 0, N = false, D = 500, B = void 0, U = "default", k = E.DEFAULT, K = void 0, ie = void 0, j = void 0, G = 0, W = R.FREE; this._state = L.NONE; var q; this.targetTouchId = -1; var Q = void 0, ee = new l.Vector3(), ne = new l.Vector3(), Y = new l.Vector3(), te = new l.Vector3(), F = new l.Vector3(), $ = new l.Vector3(), J = new l.Vector3(), z = new l.Vector3(), V = new l.Sphere(), oe = new l.Vector3(), ue = false, le = void 0, ve = 0, xe = { default: new h6() }; xe.default.nearPlane = 0.1, xe.default.farPlane = 2e3, xe.default.eyePosition = [0, 0, 0], xe.default.targetPosition = [0, 0, -1], xe.default.upVector = [0, 1, 0], this.cameraObject.target === void 0 && (this.cameraObject.target = new l.Vector3(...xe.default.targetPosition)), this.calculateMaxAllowedDistance = (re) => { var Ee = re.getBoundingBox(); if (Ee) { Ee.getBoundingSphere(V), ve = 6 * V.radius; var Ne = 0; this.cameraObject && (Ne = this.cameraObject.position.distanceTo(V.center)), ve = Ne > ve ? Ne : ve; } else ve = 0; }, this.addViewport = (re, Ee) => { re && Ee && (xe[re] = Ee); }, this.setDefaultViewport = (re) => !!(re && re in xe) && (U = re, true), this.getDefaultViewport = () => U, this.getViewportOfName = (re) => xe[re], this.setCurrentViewport = (re) => re in xe && (this.setCurrentCameraSettings(xe[re]), true), this.setRotationMode = (re) => { switch (re) { case "none": W = R.NONE; break; case "horizontal": W = R.HORIZONTAL; break; case "vertical": W = R.VERTICAL; break; case "free": default: W = R.FREE; } }, this.onResize = () => { Q && (Q = void 0), le && le.setCurrentCameraSettings(this.cameraObject, xe[U]); }, this.getVisibleHeightAtZDepth = (re) => { var Ee = this.cameraObject.position.distanceTo(this.cameraObject.target); re < Ee ? re -= Ee : re += Ee; var Ne = this.cameraObject.fov * Math.PI / 180; return 2 * Math.tan(Ne / 2) * Math.abs(re); }, this.calculateHeightPerPixelAtZeroDepth = (re) => { var Ee = this.getVisibleHeightAtZDepth(0); return this.pixelHeight = Ee / re, this.pixelHeight; }, this.getNDCFromDocumentCoords = (re, Ee, Ne) => { Ue(false); var je2 = Ne || new l.Vector2(), rt2 = 2 * ((re - Q.left) / Q.width) - 1, gt = 2 * -((Ee - Q.top) / Q.height) + 1; return je2.set(rt2, gt); }, this.getRelativeCoordsFromNDC = (re, Ee, Ne) => { Ue(false); var je2 = Ne || new l.Vector2(); return je2.x = (re + 1) * Q.width / 2, je2.y = (1 - Ee) * Q.height / 2, je2; }, this.setMouseButtonAction = (re, Ee) => { C[re] = L[Ee]; }; var Te = () => { if (0 < ve) { var re = oe.distanceTo(V.center); return ve > re || this.cameraObject.position.distanceTo(V.center) > re; } return true; }, de = (re) => { oe.copy(this.cameraObject.position).add(re), Te() && (this.cameraObject.target.add(re), this.cameraObject.position.add(re), this.updateDirectionalLight()); }, we = (re) => { Ue(false); var Ee; if (k === E.DEFAULT && (Ee = this.scene.getNormalisedMinimapCoordinates(this.renderer, re)), !Ee) re.button == 0 ? re.ctrlKey ? this._state = C.AUXILIARY : re.shiftKey ? this._state = C.SECONDARY : this._state = C.MAIN : re.button == 1 ? (re.preventDefault(), this._state = C.AUXILIARY) : re.button == 2 && (this._state = C.SECONDARY), this.pointer_x = re.clientX - Q.left, this.pointer_y = re.clientY - Q.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 { k = E.MINIMAP; var Ne = this.scene.getMinimapDiffFromNormalised(Ee.x, Ee.y); de(Ne); } }, se = (re) => { if (Ue(false), Q) if (this.pointer_x = re.clientX - Q.left, this.pointer_y = re.clientY - Q.top, k === E.MINIMAP) { var Ee = this.scene.getNormalisedMinimapCoordinates(this.renderer, re); if (Ee) { var Ne = this.scene.getMinimapDiffFromNormalised(Ee.x, Ee.y); de(Ne); } } else this._state === L.NONE && q !== void 0 && q.move(this, re.clientX, re.clientY, this.renderer); }, Se2 = (re) => { this._state = L.NONE, k == E.MINIMAP && (k = E.DEFAULT), q !== void 0 && this.pointer_x_start == re.clientX - Q.left && this.pointer_y_start == re.clientY - Q.top && q.pick(this, re.clientX, re.clientY, this.renderer); }, ge = (re) => { this._state = L.NONE; }, be2 = (re) => { Ue(false); var Ee = re.touches.length; if (Ee == 1) this._state = L.TOUCH_ROTATE, this.pointer_x = re.touches[0].clientX - Q.left, this.pointer_y = re.touches[0].clientY - Q.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 (Ee == 2) { this._state = L.TOUCH_ZOOM; var Ne = re.touches[0].clientX - re.touches[1].clientX, je2 = re.touches[0].clientY - re.touches[1].clientY; this.touchZoomDistanceEnd = this.touchZoomDistanceStart = Math.sqrt(Ne * Ne + je2 * je2); } else Ee == 3 && (this._state = L.TOUCH_PAN, this.targetTouchId = re.touches[0].identifier, this.pointer_x = re.touches[0].clientX - Q.left, this.pointer_y = re.touches[0].clientY - Q.top, this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y); }, Ie2 = (re) => { re.preventDefault(), re.stopPropagation(); var Ee = re.touches.length; if (Ee == 1) this.pointer_x = re.touches[0].clientX - Q.left, this.pointer_y = re.touches[0].clientY - Q.top; else if (Ee == 2) { if (this._state === L.TOUCH_ZOOM) { var Ne = re.touches[0].clientX - re.touches[1].clientX, je2 = re.touches[0].clientY - re.touches[1].clientY; this.touchZoomDistanceEnd = Math.sqrt(Ne * Ne + je2 * je2); } } else if (Ee == 3 && this._state === L.TOUCH_PAN) for (var rt2 = 0; 3 > rt2; rt2++) re.touches[rt2].identifier == this.targetTouchId && (this.pointer_x = re.touches[0].clientX - Q.left, this.pointer_y = re.touches[0].clientY - Q.top); }, et2 = (re) => { var Ee = re.touches.length; this.touchZoomDistanceStart = this.touchZoomDistanceEnd = 0, this.targetTouchId = -1, this._state = L.NONE, Ee == 1 && q !== void 0 && this.pointer_x_start == re.touches[0].clientX - Q.left && this.pointer_y_start == re.touches[0].clientY - Q.top && q.pick(this.cameraObject, re.touches[0].clientX, re.touches[0].clientY, this.renderer); }, mt = () => { Ue(true); }, Ue = (re) => { if (re || Q === void 0) { var Ee = new IntersectionObserver((Ne) => { for (var je2 of Ne) Q = je2.boundingClientRect; Ee.disconnect(); }); Ee.observe(this.domElement); } }, bt2 = (re) => { Ue(false), this._state = L.SCROLL; var Ee = 0; 0 < re.deltaY ? Ee = this.scrollRate : 0 > re.deltaY && (Ee = -1 * this.scrollRate), G += Ee, re.preventDefault(), re.stopImmediatePropagation(); }, Ve = () => { if (typeof this.cameraObject < "u") { var re = Q.height, Ee = this.cameraObject.position.distanceTo(this.cameraObject.target), Ne = 0; this.cameraObject.far > this.cameraObject.near && Ee >= this.cameraObject.near && Ee <= this.cameraObject.far && (Ne = (Ee - this.cameraObject.near) / (this.cameraObject.far - this.cameraObject.near)), ne.set(this.previous_pointer_x, re - this.previous_pointer_y, 0), Y.set(this.previous_pointer_x, re - this.previous_pointer_y, 1), te.set(this.pointer_x, re - this.pointer_y, 0), F.set(this.pointer_x, re - this.pointer_y, 1), ne.unproject(this.cameraObject), Y.unproject(this.cameraObject), te.unproject(this.cameraObject), F.unproject(this.cameraObject); var je2 = -2e-3; te.sub(ne).multiplyScalar(1 - Ne), F.sub(Y).multiplyScalar(Ne), te.add(F).multiplyScalar(je2), de(te); } this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y; }; this.getVectorsFromRotateAboutLookAtPoints = (re, Ee) => { re.normalize(), J.copy(this.cameraObject.position).sub(this.cameraObject.target), z.copy(J), J.normalize(), 0.8 < Math.abs(J.dot(re)) && J.copy(this.cameraObject.up), ne.crossVectors(re, J).normalize(), Y.crossVectors(re, ne); var Ne = re.dot(z), je2 = ne.dot(z), rt2 = Y.dot(z), gt = re.dot(this.cameraObject.up), Tt = ne.dot(this.cameraObject.up), Lt2 = Y.dot(this.cameraObject.up), kt = Math.cos(Ee), Z = Math.sin(Ee); return te.set(kt * ne.x + Z * Y.x, kt * ne.y + Z * Y.y, kt * ne.z + Z * Y.z), F.set(kt * Y.x - Z * ne.x, kt * Y.y - Z * ne.y, kt * Y.z - Z * ne.z), J.copy(this.cameraObject.target), J.x = J.x + re.x * Ne + te.x * je2 + F.x * rt2, J.y = J.y + re.y * Ne + te.y * je2 + F.y * rt2, J.z = J.z + re.z * Ne + te.z * je2 + F.z * rt2, ee.set(re.x * gt + te.x * Tt + F.x * Lt2, re.y * gt + te.y * Tt + F.y * Lt2, re.z * gt + te.z * Tt + F.z * Lt2), { position: J, up: ee }; }, this.rotateAboutLookAtpoint = (re, Ee) => { var Ne = this.getVectorsFromRotateAboutLookAtPoints(re, Ee); this.cameraObject.position.copy(Ne.position), this.updateDirectionalLight(), this.cameraObject.up.copy(Ne.up); }; var lt = () => { if (typeof this.cameraObject < "u") { var re = Q.width, Ee = Q.height; if (0 < re && 0 < Ee) { var Ne = 0.25 * (re + Ee), je2 = 0, rt2 = 0; (W === R.FREE || W === R.HORIZONTAL) && (je2 = this.pointer_x - this.previous_pointer_x), (W === R.FREE || W === R.VERTICAL) && (rt2 = this.previous_pointer_y - this.pointer_y); var gt = Math.sqrt(je2 * je2 + rt2 * rt2); if (0 < gt) { var Tt = 1 * -rt2 / gt, Lt2 = 1 * je2 / gt, kt = 0; W === R.FREE && Tt * (this.pointer_x - 0.5 * (re - 1)) + Lt2 * (0.5 * (Ee - 1) - this.pointer_y); var Z = Math.acos(kt / Ne) - 0.5 * Math.PI, ye = this.tumble_rate * gt / Ne; ee.copy(this.cameraObject.position).sub(this.cameraObject.target).normalize(), ne.copy(this.cameraObject.up).normalize(), Y.copy(ne).cross(ee).normalize().multiplyScalar(Tt), ne.multiplyScalar(Lt2), $.addVectors(Y, ne).multiplyScalar(Math.cos(Z)), ee.multiplyScalar(Math.sin(Z)), $.add(ee), this.rotateAboutLookAtpoint($, -ye); } } } this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y; }, tt2 = () => { var re = 0; return this._state === L.ZOOM ? re = this.previous_pointer_y - this.pointer_y : this._state === L.SCROLL ? re = G : (re = -1 * (this.touchZoomDistanceEnd - this.touchZoomDistanceStart), this.touchZoomDistanceStart = this.touchZoomDistanceEnd), re; }; this.changeZoomByScrollRateUnit = (re) => { var Ee = re * this.scrollRate; this.changeZoomByValue(Ee); }, this.changeZoomByValue = (re) => { if (typeof this.cameraObject < "u") { var Ee = Q.height, Ne = this.cameraObject.position.clone(); Ne.sub(this.cameraObject.target); var je2 = Ne.length(), rt2 = 1.5 * re / Ee; if (0.01 < je2 + rt2 * je2 && (Ne.normalize(), oe.copy(this.cameraObject.position), oe.x += Ne.x * rt2 * je2, oe.y += Ne.y * rt2 * je2, oe.z += Ne.z * rt2 * je2, Te())) { this.cameraObject.position.copy(oe), this.updateDirectionalLight(); var gt = 1e-5; if (gt * this.cameraObject.far < this.cameraObject.near + rt2 * je2 + this.near_plane_fly_debt) this.near_plane_fly_debt != 0 && (this.near_plane_fly_debt += rt2 * je2, 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 += rt2 * je2, this.cameraObject.far += rt2 * je2)); else { if (this.near_plane_fly_debt == 0) { var Tt = this.cameraObject.near - gt * this.cameraObject.far; this.cameraObject.near = gt * this.cameraObject.far, this.cameraObject.far -= Tt, this.near_plane_fly_debt -= gt * this.cameraObject.far; } this.near_plane_fly_debt += rt2 * je2; } ue = true; } } }; var xt = () => { var re = tt2(); this.changeZoomByValue(re), this._state === L.ZOOM && (this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y), this._state === L.SCROLL && (G = 0, this._state = L.NONE); }; this.setDirectionalLight = (re) => { this.directionalLight = re; }, 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 = true, this.domElement && this.domElement.addEventListener && (this.domElement.addEventListener("mousedown", we, false), this.domElement.addEventListener("mousemove", se, false), this.domElement.addEventListener("mouseup", Se2, false), this.domElement.addEventListener("mouseleave", ge, false), this.domElement.addEventListener("touchstart", be2, false), this.domElement.addEventListener("touchmove", Ie2, false), this.domElement.addEventListener("touchend", et2, false), this.domElement.addEventListener("wheel", bt2, false), this.domElement.addEventListener("contextmenu", (re) => { re.preventDefault(); }, false), this.domElement.addEventListener("mouseenter", mt, false)); }, this.disable = function() { P = false, this.domElement && this.domElement.removeEventListener && (this.domElement.removeEventListener("mousedown", we, false), this.domElement.removeEventListener("mousemove", se, false), this.domElement.removeEventListener("mouseup", Se2, false), this.domElement.removeEventListener("mouseleave", ge, false), this.domElement.removeEventListener("touchstart", be2, false), this.domElement.removeEventListener("touchmove", Ie2, false), this.domElement.removeEventListener("touchend", et2, false), this.domElement.removeEventListener("wheel", bt2, false), this.domElement.removeEventListener("mouseenter", mt, false), this.domElement.removeEventListener("contextmenu", (re) => { re.preventDefault(); }, false)); }, this.loadPath = (re) => { b = re.CameraPath, O = re.NumberOfPoints; }, this.loadPathURL = (re, Ee) => { var Ne = new XMLHttpRequest(); Ne.onreadystatechange = () => { if (Ne.readyState == 4 && Ne.status == 200) { var rt2 = JSON.parse(Ne.responseText); this.loadPath(rt2), Ee != null && typeof Ee == "function" && Ee(); } }; var je2 = d(re); Ne.open("GET", je2, true), Ne.send(); }, this.setPathDuration = (re) => { A = re, K && K.setDuration(A), ie && ie.setDuration(A); }, this.getPlayRate = () => D, this.setPlayRate = (re) => { D = re; }; var pt2 = (re) => { var Ee = I + re; Ee > A && (Ee -= A), I = Ee; }; this.getTime = () => I, this.setTime = (re) => { I = re > A ? A : 0 > re ? 0 : re; }, this.getNumberOfTimeFrame = () => O, this.getCurrentTimeFrame = () => { if (2 < O) { var re = I / A * (O - 1), Ee = Math.floor(re), Ne = 1 - (re - Ee), je2 = Math.ceil(re); return Ee == je2 ? Ee == O - 1 ? [Ee - 1, je2, 0] : [Ee, je2 + 1, 1] : [Ee, je2, Ne]; } return O == 1 ? [0, 0, 0] : void 0; }, this.setCurrentTimeFrame = (re) => { 2 < O && (I = A * re / (O - 1), 0 > I && (I = 0), I > A && (I = A)); }; var Vt2 = (re) => { if (k === E.PATH && (pt2(re), b)) { for (var Ee = this.getCurrentTimeFrame(), Ne = Ee[0], je2 = Ee[1], rt2 = Ee[2], gt = [b[3 * Ne], b[3 * Ne + 1], b[3 * Ne + 2]], Tt = [b[3 * je2], b[3 * je2 + 1], b[3 * je2 + 2]], Lt2 = [], kt = 0; kt < gt.length; kt++) Lt2.push(rt2 * gt[kt] + (1 - rt2) * Tt[kt]); this.cameraObject.position.set(Lt2[0], Lt2[1], Lt2[2]), this.cameraObject.target.set(Tt[0], Tt[1], Tt[2]), B && this.cameraObject.lookAt(this.cameraObject.target), N && (this.directionalLight.position.set(Lt2[0], Lt2[1], Lt2[2]), this.directionalLight.target.position.set(Tt[0], Tt[1], Tt[2])); } }; this.calculatePathNow = () => { Vt2(0); }; var Nt2 = () => { this._state === L.ROTATE || this._state === L.TOUCH_ROTATE ? lt() : this._state === L.PAN || this._state === L.TOUCH_PAN ? (Ve(), le.triggerCallback()) : (this._state === L.ZOOM || this._state === L.TOUCH_ZOOM || this._state === L.SCROLL) && (le.zoom(tt2()), this.previous_pointer_x = this.pointer_x, this.previous_pointer_y = this.pointer_y, this._state === L.SCROLL && (this._state = L.NONE), G = 0, le.triggerCallback()); }; this.update = (re) => { var Ee = re * D, Ne = P, je2 = true; return k === E.PATH ? Vt2(Ee) : k === E.SMOOTH_CAMERA_TRANSITION && K ? (K.update(Ee), K.isTransitionCompleted() && (k = E.DEFAULT), Ne = false) : k === E.ROTATE_CAMERA_TRANSITION && ie ? (ie.update(Ee), ie.isTransitionCompleted() && (k = E.DEFAULT), Ne = false) : k === E.AUTO_TUMBLE && j ? j.update(Ee) : k === E.SYNC_CONTROL && le ? (Nt2(), Ne = false) : je2 = false, Ne && (this._state !== L.NONE && (je2 = true), this._state === L.ROTATE || this._state === L.TOUCH_ROTATE ? lt() : this._state === L.PAN || this._state === L.TOUCH_PAN ? Ve() : (this._state === L.ZOOM || this._state === L.TOUCH_ZOOM || this._state === L.SCROLL) && xt(), this._state !== L.NONE && k === E.AUTO_TUMBLE && j && j.stopOnCameraInput, this._state === L.SCROLL && (this._state = L.NONE)), B ? (je2 = true, B.update()) : this.cameraObject.lookAt(this.cameraObject.target), je2 = je2 || ue, ue = false, je2; }, this.playPath = () => { k = E.PATH; }, this.stopPath = () => { k = E.DEFAULT; }, this.isPlayingPath = () => k === E.PATH, this.enableDirectionalLightUpdateWithPath = (re) => { N = re; }, this.enableDeviceOrientation = () => { B || (B = new w(this.cameraObject)); }, this.disableDeviceOrientation = () => { B && (B.dispose(), B = void 0); }, this.isDeviceOrientationEnabled = () => !!B, this.resetView = () => { var re = xe[U]; this.cameraObject.near = re.nearPlane, this.cameraObject.far = re.farPlane, this.cameraObject.position.set(re.eyePosition[0], re.eyePosition[1], re.eyePosition[2]), this.cameraObject.target.set(re.targetPosition[0], re.targetPosition[1], re.targetPosition[2]), this.cameraObject.up.set(re.upVector[0], re.upVector[1], re.upVector[2]), this.cameraObject.updateProjectionMatrix(), this.updateDirectionalLight(); }, this.setCurrentCameraSettings = (re) => { re.nearPlane && (this.cameraObject.near = re.nearPlane), re.farPlane && (this.cameraObject.far = re.farPlane), re.eyePosition && this.cameraObject.position.set(re.eyePosition[0], re.eyePosition[1], re.eyePosition[2]), re.targetPosition && this.cameraObject.target.set(re.targetPosition[0], re.targetPosition[1], re.targetPosition[2]), re.upVector && this.cameraObject.up.set(re.upVector[0], re.upVector[1], re.upVector[2]), this.cameraObject.updateProjectionMatrix(), this.updateDirectionalLight(), ue = true; }, this.getViewportFromCentreAndRadius = (re, Ee, Ne, je2, rt2, gt) => { var Tt = this.cameraObject.position.x - this.cameraObject.target.x, Lt2 = this.cameraObject.position.y - this.cameraObject.target.y, kt = this.cameraObject.position.z - this.cameraObject.target.z, Z = 1 / Math.sqrt(Tt * Tt + Lt2 * Lt2 + kt * kt); Tt *= Z, Lt2 *= Z, kt *= Z; var ye = [re, Ee, Ne], me = je2 / Math.tan(rt2 * Math.PI / 360), Me = [re + Tt * me, Ee + Lt2 * me, Ne + kt * me], Oe = me + gt, he = 0, _e = 0.95; he = gt > _e * me ? (1 - _e) * me : me - gt; var Ce = new h6(); return Ce.nearPlane = he, Ce.farPlane = Oe, Ce.eyePosition = Me, Ce.targetPosition = ye, Ce.upVector = [this.cameraObject.up.x, this.cameraObject.up.y, this.cameraObject.up.z], Ce; }, this.getViewportFromBoundingBox = (re, Ee) => { var Ne = re.min.distanceTo(re.max) / 2 * Ee, je2 = (re.min.x + re.max.x) / 2, rt2 = (re.min.y + re.max.y) / 2, gt = (re.min.z + re.max.z) / 2, Tt = 4, Lt2 = this.getViewportFromCentreAndRadius(je2, rt2, gt, Ne, 40, Ne * Tt); return Lt2; }, this.getCurrentViewport = () => { var re = new h6(); return re.nearPlane = this.cameraObject.near, re.farPlane = this.cameraObject.far, re.eyePosition[0] = this.cameraObject.position.x, re.eyePosition[1] = this.cameraObject.position.y, re.eyePosition[2] = this.cameraObject.position.z, re.targetPosition[0] = this.cameraObject.target.x, re.targetPosition[1] = this.cameraObject.target.y, re.targetPosition[2] = this.cameraObject.target.z, re.upVector[0] = this.cameraObject.up.x, re.upVector[1] = this.cameraObject.up.y, re.upVector[2] = this.cameraObject.up.z, re; }, this.getDefaultEyePosition = () => eyePosition, this.getDefaultTargetPosition = () => targetPosition, this.cameraTransition = (re, Ee, Ne) => { ie == null && (K = new g(re, Ee, this, Ne)); }, this.rotateCameraTransition = (re, Ee, Ne) => { K == null && (ie = new f(re, Ee, this, Ne)); }, this.enableCameraTransition = () => { K && (k = E.SMOOTH_CAMERA_TRANSITION), ie && (k = E.ROTATE_CAMERA_TRANSITION); }, this.pauseCameraTransition = () => { k = E.DEFAULT; }, this.stopCameraTransition = () => { k = E.DEFAULT, K = void 0, ie = void 0; }, this.isTransitioningCamera = () => k === E.SMOOTH_CAMERA_TRANSITION || k === E.ROTATE_CAMERA_TRANSITION, this.autoTumble = (re, Ee, Ne) => { j = new y(re, Ee, Ne, this); }, this.enableAutoTumble = () => { k = E.AUTO_TUMBLE; }, this.stopAutoTumble = () => { k = E.DEFAULT, j = void 0; }, this.updateAutoTumble = () => { j && (j.requireUpdate = true); }, this.isAutoTumble = () => k === E.AUTO_TUMBLE, this.enableRaycaster = (re, Ee, Ne) => { q == null && (q = new u(re, this.scene, Ee, Ne, this.renderer)); }, this.disableRaycaster = () => { q.disable(), q = void 0; }, this.isSyncControl = () => currentMpde === E.SYNC_CONTROL, this.enableSyncControl = () => (k = E.SYNC_CONTROL, le || (le = new S()), le.setCurrentCameraSettings(this.cameraObject, xe[U]), le), this.disableSyncControl = () => { k = E.DEFAULT, this.cameraObject.zoom = 1, this.cameraObject.updateProjectionMatrix(); }, this.enable(); }, g = function(M, x, _, E) { var L = M.eyePosition, R = M.targetPosition, C = M.upVector, A = x.eyePosition, P = x.targetPosition, I = x.upVector, b = _, O = E, N = 0, D = false; b.near = Math.min(M.nearPlane, x.nearPlane), b.far = Math.max(M.farPlane, x.farPlane), b.cameraObject.up.set(x.upVector[0], x.upVector[1], x.upVector[2]), this.setDuration = (k) => { O = k; }; var B = (k) => { var K = N + k; K > O && (K = O), N = K; }, U = () => { var k = N / O, K = [L[0] * (1 - k) + A[0] * k, L[1] * (1 - k) + A[1] * k, L[2] * (1 - k) + A[2] * k], ie = [R[0] * (1 - k) + P[0] * k, R[1] * (1 - k) + P[1] * k, R[2] * (1 - k) + P[2] * k]; C[0] * (1 - k) + I[0] * k, C[1] * (1 - k) + I[1] * k, C[2] * (1 - k) + I[2] * k, b.cameraObject.position.set(K[0], K[1], K[2]), b.cameraObject.target.set(ie[0], ie[1], ie[2]); }; this.update = (k) => { this.enabled === false || (B(k), U(), N == O && (D = true)); }, this.isTransitionCompleted = () => D; }, f = function(M, x, _, E) { var L = M, R = x, C = _, A = E, P = 0, I = false; this.setDuration = (O) => { A = O; }; var b = (O) => { var N = P, D = P + O; D > A && (D = A), P = D; var B = P - N, U = B / A, k = U * R; C.rotateAboutLookAtpoint(L, k); }; this.update = (O) => { this.enabled === false || (b(O), P == A && (I = true)); }, this.isTransitionCompleted = () => I; }, u = function(M, x, _, E, L) { var R = M, C = x, A = L, P = _, I = E, b = new l.Raycaster(); b.params.Line.threshold = 0.1, b.params.Points.threshold = 1; var O = new l.Vector2(), N = false, D = /* @__PURE__ */ new Date(), B = false, U = 0, k = [], K = { zincCamera: void 0, x: -1, y: -1 }, ie = void 0; this.enable = () => { enable = true; }, this.disable = () => { enable = false; }, this.getIntersectsObject = (W) => { if (C !== R) { var q = R.getThreeJSScene(); A.render(q, W.cameraObject); } var Q = ie || R.getPickableThreeJSObjects(); return k.length = 0, b.intersectObjects(Q, true, k); }, this.setPickableObjects = (W) => { W === void 0 ? ie = void 0 : (ie = [], W.forEach((q) => { q.getGroup() && q.getGroup().visible && ie.push(q.getGroup()); })); }, this.getIntersectsObjectWithOrigin = (W, q, Q) => (b.set(q, Q), this.getIntersectsObject(W)), this.getIntersectsObjectWithCamera = (W, q, Q) => (W.getNDCFromDocumentCoords(q, Q, O), b.setFromCamera(O, W.cameraObject), this.getIntersectsObject(W)), this.pick = (W, q, Q) => { if (A && R && W && P) { this.getIntersectsObjectWithCamera(W, q, Q); for (var ee, ne = k.length, Y = 0; Y < ne; Y++) if (ee = k[Y].object ? k[Y].object.userData : void 0, ee && ee.isMarkerCluster && ee.visible && ee.clusterIsVisible(k[Y].object.clusterIndex) && ee.zoomToCluster(k[Y].object.clusterIndex)) return; P(k, q, Q); } }; var j = (W, q, Q) => { if (A && R && W && I) { if (this.getIntersectsObjectWithCamera(W, q, Q), D.setTime(Date.now()), k.length === 0) { if (B) return; B = true; } else B = false; I(k, q, Q); } }; this.move = (W, q, Q) => { A && R && W && I && (R.displayMarkers ? j(W, q, Q) : (K.zincCamera = W, K.x = q, K.y = Q, !N && (U = D ? Date.now() - D.getTime() : 250, 250 <= U ? j(W, q, Q) : (N = true, setTimeout(G(K), U))))); }; var G = (W) => function() { N = false, j(W.zincCamera, W.x, W.y); }; }, y = function(M, x, _, E) { var L = new l.Vector3(), R = -x, C = E, A = M; this.stopOnCameraInput = _, this.requireUpdate = true; var P = new l.Vector3(), I = new l.Vector3(), b = (O) => { var N = Math.sqrt(O[0] * O[0] + O[1] * O[1]), D = 4 * Math.abs(O[0]), B = 4 * Math.abs(O[1]), U = 0.25 * (D + B), k = -O[1] / N, K = O[0] / N, ie = k * O[0] + K * -O[1]; ie > U ? ie = U : ie < -U && (ie = -U); var j = Math.acos(ie / U) - 0.5 * Math.PI; L.copy(C.cameraObject.position).sub(C.cameraObject.target).normalize(), P.copy(C.cameraObject.up).normalize(), I.crossVectors(P, L).normalize().multiplyScalar(k), P.multiplyScalar(K), P.add(I).multiplyScalar(Math.cos(j)), L.multiplyScalar(Math.sin(j)).add(P); }; this.update = (O) => { this.enabled === false || (this.requireUpdate && (b(A), this.requireUpdate = false), C.rotateAboutLookAtpoint(L, R * O / 1e3)); }; }, v = function() { this.type = "StereoCamera", this.aspect = 1, this.cameraL = new l.PerspectiveCamera(), this.cameraL.layers.enable(1), this.cameraL.matrixAutoUpdate = false, this.cameraR = new l.PerspectiveCamera(), this.cameraR.layers.enable(2), this.cameraR.matrixAutoUpdate = false; }; Object.assign(v.prototype, { update: (() => { var T, M, x, _, E, L, R = new l.Matrix4(), C = new l.Matrix4(); return function(P) { var I = T !== P.focus || M !== P.fov || x !== P.aspect * this.aspect || _ !== P.near || E !== P.far || L !== P.zoom; if (I) { T = P.focus, M = P.fov, x = P.aspect * this.aspect, _ = P.near, E = P.far, L = P.zoom; var b, O, N = P.projectionMatrix.clone(), D = 0.064 / 2, B = D * _ / T, U = _ * Math.tan(0.5 * (l.Math.DEG2RAD * M)) / P.zoom; C.elements[12] = -D, R.elements[12] = D, b = -U * x + B, O = U * x + B, N.elements[0] = 2 * _ / (O - b), N.elements[8] = (O + b) / (O - b), this.cameraL.projectionMatrix.copy(N), b = -U * x - B, O = U * x - B, N.elements[0] = 2 * _ / (O - b), N.elements[8] = (O + b) / (O - b), this.cameraR.projectionMatrix.copy(N); } this.cameraL.matrixWorld.copy(P.matrixWorld).multiply(C), this.cameraR.matrixWorld.copy(P.matrixWorld).multiply(R); }; })() }); var m = function(M) { var x = new v(); x.aspect = 0.5, this.setSize = (_, E) => { M.setSize(_, E); }, this.render = (_, E) => { _.updateMatrixWorld(), E.parent === null && E.updateMatrixWorld(), x.update(E); var L = M.getSize(); M.setScissorTest(true), M.clear(), M.setScissor(0, 0, L.width / 2, L.height), M.setViewport(0, 0, L.width / 2, L.height), M.render(_, x.cameraL), M.setScissor(L.width / 2, 0, L.width / 2, L.height), M.setViewport(L.width / 2, 0, L.width / 2, L.height), M.render(_, x.cameraR), M.setScissorTest(false); }; }, w = function(M) { var x = this; this.object = M, this.object.rotation.reorder("YXZ"), this.enabled = true, this.deviceOrientation = {}, this.screenOrientation = 0; var _ = (R) => { x.deviceOrientation = R; }, E = () => { typeof window < "u" && (x.screenOrientation = window.orientation || 0); }, L = (() => { var R = new l.Vector3(0, 0, 1), C = new l.Euler(), A = new l.Quaternion(), P = new l.Quaternion(-Math.sqrt(0.5), 0, 0, Math.sqrt(0.5)); return (I, b, O, N, D) => { var B = new l.Vector3(0, 0, 1); B.subVectors(I.target, I.position), C.set(O, b, -N, "YXZ"); var U = new l.Quaternion(); U.setFromEuler(C), U.multiply(P), U.multiply(A.setFromAxisAngle(R, -D)), B.applyQuaternion(U), B.addVectors(I.position, B), I.lookAt(B); }; })(); this.connect = () => { E(), typeof window < "u" && (window.addEventListener("orientationchange", E, false), window.addEventListener("deviceorientation", _, false)), x.enabled = true; }, this.disconnect = () => { typeof window < "u" && (window.removeEventListener("orientationchange", E, false), window.removeEventListener("deviceorientation", _, false)), x.enabled = false; }, this.update = () => { if (x.enabled !== false) { var R = x.deviceOrientation.alpha ? l.Math.degToRad(x.deviceOrientation.alpha) : 0, C = x.deviceOrientation.beta ? l.Math.degToRad(x.deviceOrientation.beta) : 0, A = x.deviceOrientation.gamma ? l.Math.degToRad(x.deviceOrientation.gamma) : 0, P = x.screenOrientation ? l.Math.degToRad(x.screenOrientation) : 0; L(x.object, R, C, A, P); } }, this.dispose = function() { this.disconnect(); }, this.connect(); }, S = function() { var M = void 0, x = void 0, _ = void 0, E = new l.Vector3(), L = new l.Vector3(), R = new l.Vector3(), C = new l.Vector3(), A = void 0; this.setCurrentCameraSettings = (P, I) => { M = P.clone(), x = P, _ = I, M.near = _.nearPlane, _.farPlane && (M.far = _.farPlane), _.eyePosition && M.position.set(_.eyePosition[0], _.eyePosition[1], _.eyePosition[2]), _.upVector && M.up.set(_.upVector[0], _.upVector[1], _.upVector[2]), _.targetPosition && (M.target = new l.Vector3(_.targetPosition[0], _.targetPosition[1], _.targetPosition[2]), M.lookAt(M.target)), M.updateProjectionMatrix(), E.copy(M.position).project(M), L.copy(M.target).project(M); }, this.getCurrentPosition = () => (L.copy(x.target).project(M), [L.x, L.y]), this.zoom = (P) => { var I = 2e-3 * P, b = Math.max(x.zoom - I, 1); x.zoom = b, x.updateProjectionMatrix(); }, this.zoomToBox = (P, I) => { P.getCenter(R), R.project(M), this.setCenterZoom([R.x, R.y], I); }, this.getPanZoom = () => ({ target: this.getCurrentPosition(), zoom: x.zoom }), this.setCenterZoom = (P, I) => { R.set(P[0], P[1], L.z).unproject(M), C.copy(R).sub(x.target), x.target.copy(R), x.lookAt(x.target), x.position.add(C), x.zoom = I, x.updateProjectionMatrix(); }, this.setEventCallback = (P) => { (P === void 0 || typeof P == "function") && (A = P); }, this.triggerCallback = () => { A !== void 0 && typeof A == "function" && A(); }; }; a.Viewport = h6, a.CameraControls = p, a.SmoothCameraTransition = g, a.RotateCameraTransition = f, a.RayCaster = u, a.CameraAutoTumble = y, a.StereoEffect = m, a.NDCCameraControl = S; }, /* 44 */ /***/ (o, a, c) => { var { Group: l, Matrix4: d } = c(4), h6 = c(22).Pointset; c(24).Lines; var p = c(45).Lines2, g = c(3).Geometry, f = c(4), u = 0, y = function() { return "re" + u++; }, v = function(m, w) { var S = m, T = new l(); T.matrixAutoUpdate = false, T.userData = this; var M = [], x = "", _ = [], E = w, L = new d(), R = 3e3; L.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this.pickableUpdateRequired = true, this.isRegion = true, this.uuid = y(), this.hideAllPrimitives = () => { M.forEach((C) => C.hideAllPrimitives()), _.forEach((C) => C.setVisibility(false)); }, this.showAllPrimitives = () => { M.forEach((C) => C.showAllPrimitives()), _.forEach((C) => C.setVisibility(true)); }, this.setVisibility = (C) => { C != T.visible && (T.visible = C, this.pickableUpdateRequired = true); }, this.getVisibility = () => T.visible, this.getGroup = () => T, this.setTransformation = (C) => { L.set(...C), T.matrix.copy(L), T.updateMatrixWorld(); }, this.setName = (C) => { C && C !== "" && (x = C); }, this.getName = () => x, this.getParent = () => S, this.getFullSeparatedPath = () => { var C = []; if (x !== "") { C.push(x); for (var A, P = S; P !== void 0; ) A = P.getName(), A !== "" && C.unshift(A), P = P.getParent(); } return C; }, this.getFullPath = () => { var C = this.getFullSeparatedPath(); if (0 < C.length) { var A = C.shift(); return C.forEach((P) => { A = A.concat("/", P); }), A; } return ""; }, this.createChild = (C) => { var A = new v(this, E); return A.setName(C), M.push(A), T.add(A.getGroup()), A; }, this.getChildWithName = (C) => { if (C) { for (var A = C.toLowerCase(), P = 0; P < M.length; P++) if (M[P].getName().toLowerCase() === A) return M[P]; } }, this.findChildFromSeparatedPath = (C) => { if (C && 0 < C.length && C[0] === "" && C.shift(), C && 0 < C.length) { var A = this.getChildWithName(C[0]); return A ? (C.shift(), A.findChildFromSeparatedPath(C)) : void 0; } return this; }, this.findChildFromPath = (C) => { var A = C.split("/"); return this.findChildFromSeparatedPath(A); }, this.createChildFromSeparatedPath = (C) => { if (0 < C.length && C[0] === "" && C.shift(), 0 < C.length) { var A = this.getChildWithName(C[0]); return A || (A = this.createChild(C[0])), C.shift(), A.createChildFromSeparatedPath(C); } return this; }, this.createChildFromPath = (C) => { var A = C.split("/"); return this.createChildFromSeparatedPath(A); }, this.findOrCreateChildFromPath = (C) => { var A = this.findChildFromPath(C); return A || (A = this.createChildFromPath(C)), A; }, this.addZincObject = (C) => { C && (C.setRegion(this), T.add(C.getGroup()), _.push(C), this.pickableUpdateRequired = true, E && E.triggerObjectAddedCallback(C)); }, this.removeZincObject = (C) => { for (var A = 0; A < _.length; A++) if (C === _[A]) return T.remove(C.getGroup()), _.splice(A, 1), E && E.triggerObjectRemovedCallback(C), C.dispose(), void (this.pickableUpdateRequired = true); }, this.checkPickableUpdateRequred = (C) => { if (this.pickableUpdateRequired) return true; if (C) { for (var A = false, P = 0; P < M.length; P++) if (A = M[P].checkPickableUpdateRequred(C), A) return true; } return false; }, this.getPickableThreeJSObjects = (C, A) => (T.visible && (_.forEach((P) => { if (P.getGroup() && P.getGroup().visible) { var I = P.marker; I && I.isEnabled() && C.push(I.getMorph()), C.push(P.getGroup()); } }), A && M.forEach((P) => { P.getPickableThreeJSObjects(C, A); }), this.pickableUpdateRequired = false), C), this.setDuration = (C) => { R = C, _.forEach((A) => A.setDuration(C)), M.forEach((A) => A.setDuration(C)); }, this.getDuration = () => R, this.getBoundingBox = (C) => { var A, P; return _.forEach((I) => { P = I.getBoundingBox(), P && (A == null ? A = P.clone() : A.union(P)); }), C && M.forEach((I) => { P = I.getBoundingBox(C), P && (A == null ? A = P.clone() : A.union(P)); }), A; }, this.clear = (C) => { C && M.forEach((A) => A.clear(C)), _.forEach((A) => { T.remove(A.getGroup()), A.dispose(); }), M = [], _ = []; }, this.objectIsInRegion = (C, A) => { for (var P = 0; P < _.length; P++) if (C === _[P]) return true; if (A) { for (var I = 0; I < M.length; I++) if (M[I].objectIsInRegion(C, A)) return true; } return false; }, this.forEachGeometry = (C, A) => { _.forEach((P) => { P.isGeometry && C(P); }), A && M.forEach((P) => P.forEachGeometry(C, A)); }, this.forEachGlyphset = (C, A) => { _.forEach((P) => { P.isGlyphset && C(P); }), A && M.forEach((P) => P.forEachGlyphset(C, A)); }, this.forEachPointset = (C, A) => { _.forEach((P) => { P.isPointset && C(P); }), A && M.forEach((P) => P.forEachPointset(C, A)); }, this.forEachLine = (C, A) => { _.forEach((P) => { P.isLines && C(P); }), A && M.forEach((P) => P.forEachLine(C, A)); }, this.findObjectsWithAnatomicalId = (C, A) => (_.forEach((P) => { P.anatomicalId === C && objectsArray.push(P); }), A && M.forEach((P) => { var I = P.findObjectsWithAnatomicalId(C, A); objectsArray.push(...I); }), objectsArray), this.findObjectsWithGroupName = (C, A) => { var P = []; return _.forEach((I) => { var b = I.groupName ? I.groupName.toLowerCase() : I.groupName, O = C && C.toLowerCase(); b === O && P.push(I); }), A && M.forEach((I) => { var b = I.findObjectsWithGroupName(C, A); P.push(...b); }), P; }, this.findGeometriesWithGroupName = (C, A) => { var P = this.findObjectsWithGroupName(C, A), I = P.filter((b) => b.isGeometry); return I; }, this.findPointsetsWithGroupName = (C, A) => { var P = this.findObjectsWithGroupName(C, A), I = P.filter((b) => b.isPointset); return I; }, this.findGlyphsetsWithGroupName = (C, A) => { var P = this.findObjectsWithGroupName(C, A), I = P.filter((b) => b.isGlyphset); return I; }, this.findLinesWithGroupName = (C, A) => { var P = this.findObjectsWithGroupName(C, A), I = P.filter((b) => b.isLines); return I; }, this.getAllObjects = (C) => { var A = [..._]; return C && M.forEach((P) => { var I = P.getAllObjects(C); A.push(...I); }), A; }, this.getChildRegions = (C) => { var A = [...M]; return C && M.forEach((P) => { var I = P.getChildRegions(C); A.push(...I); }), A; }, this.getCurrentTime = () => { if (_[0] != null) return _[0].getCurrentTime(); for (var C, A = 0; A < M.length; A++) if (C = M[A].getCurrentTime(), C !== -1) return C; return -1; }, this.setMorphTime = (C, A) => { _.forEach((P) => { P.setMorphTime(C); }), A && M.forEach((P) => { P.setMorphTime(C); }); }, this.isTimeVarying = () => { for (var C = 0; C < _.length; C++) if (_[C].isTimeVarying()) return true; for (var A = 0; A < M.length; A++) if (M[A].isTimeVarying()) return true; return false; }, this.renderGeometries = (C, A, P, I, b, O) => { var N, D = this.getAllObjects(O); D.forEach((B) => { B.render(C * A, P, I, b); }), b && P === false && (N = b.markerCluster) !== null && N !== void 0 && N.markerUpdateRequired && b.markerCluster.calculate(); }, this.createPoints = (C, A, P, I) => { var b = false, O = this.findObjectsWithGroupName(C, false), N = O.findIndex((B) => B.isPointset), D = -1 < N ? O[N] : new h6(); return D.addPoints(A, P, I), N === -1 ? (D.setName(C), this.addZincObject(D), b = true) : this.pickableUpdateRequired = true, { zincObject: D, isNew: b }; }, this.createLines = (C, A, P) => { var I = false, b = this.findObjectsWithGroupName(C, false), O = b.findIndex((D) => D.isLines), N = -1 < O ? b[O] : new p(); return N.addLines(A, P), O === -1 ? (N.setName(C), this.addZincObject(N), I = true) : this.pickableUpdateRequired = true, { zincObject: N, isNew: I }; }, this.createGeometryFromThreeJSGeometry = (C, A, P, I, b, O) => { var N = new g(), D = new f.MeshPhongMaterial({ color: P, morphTargets: false, morphNormals: false, transparent: true, opacity: I, side: f.DoubleSide }); return N.createMesh(A, D, { localTimeEnabled: false, localMorphColour: false }), N.getMorph() ? (N.setVisibility(false), N.setName(C), N.setRenderOrder(O), this.addZincObject(N), N) : void 0; }; }; a.Region = v; }, /* 45 */ /***/ (o, a, c) => { c(4), c(5).toBufferGeometry; var l = c(46).LineSegments2, d = c(48).LineMaterial, h6 = c(47).LineSegmentsGeometry, p = function() { c(24).Lines.call(this), this.isLines2 = true; var g = Array(300); this.createLineSegment = (f, u, y) => { if (f && u) { var v = new h6(); v.setPositions(f), v.colorsNeedUpdate = true; var m = new l(v, u); m.scale.set(1, 1, 1), m.computeLineDistances(), this.setMesh(m, y.localTimeEnabled, y.localMorphColour); } }, this.setWidth = (f) => { this.morph && this.morph.material && (this.morph.material.linewidth = f, this.morph.material.needsUpdate = true); }, this.addVertices = function(f) { if (f && f.length) { var u = this.getMorph(); u || (this.drawRange = 0); var y = 3 * this.drawRange; if (f.forEach((v) => { g[y++] = v[0], g[y++] = v[1], g[y++] = v[2], this.drawRange++; }), !u) for (; 300 > y; ) g[y++] = f[0][0], g[y++] = f[0][1], g[y++] = f[0][2]; u && (u.geometry.setPositions(g), u.computeLineDistances(), this.boundingBoxUpdateRequired = true); } return g; }, this.getVerticesByFaceIndex = function(f) { var u = 3 * (2 * f), y = this.getMorph(); if (y && 3 * this.drawRange > u) { var v = y.geometry.getAttribute("instanceStart"); return [[v.data.array[u], v.data.array[++u], v.data.array[++u]], [v.data.array[++u], v.data.array[++u], v.data.array[++u]]]; } return []; }, this.editVertices = function(f, u) { if (f && f.length) { var y = this.getMorph(), v = u + f.length - 1; if (!y || 0 > u || v >= this.drawRange) return; var m = 3 * u; for (f.forEach((w) => { g[m++] = w[0], g[m++] = w[1], g[m++] = w[2]; }), m = 3 * this.drawRange; 300 > m; ) g[m++] = f[0][0], g[m++] = f[0][1], g[m++] = f[0][2]; y.geometry.setPositions(g), y.computeLineDistances(), this.boundingBoxUpdateRequired = true; } return g; }, this.addLines = (f, u) => { if (f && 0 < f.length) { this.addVertices(f); var y = this.getMorph(); if (!y) { var v = new d({ color: u, linewidth: 1, vertexColors: false, worldUnits: false }); v.resolution.set(window.innerWidth, window.innerHeight), this.createLineSegment(g, v, { localTimeEnabled: false, localMorphColour: false }); } this.region && (this.region.pickableUpdateRequired = true); } }, this.render = () => { var f = this.getMorph().material; f.resolution.set(window.innerWidth, window.innerHeight); }; }; p.prototype = Object.create(c(24).Lines.prototype), p.prototype.constructor = p, a.Lines2 = p; }, /* 46 */ /***/ (o, a, c) => { c.r(a), c.d(a, { /* harmony export */ LineSegments2: () => ( /* binding */ _ ) /* harmony export */ }); var l = c(4), d = c(47), h6 = c(48), p = new l.Vector3(), g = new l.Vector3(), f = new l.Vector4(), u = new l.Vector4(), y = new l.Vector4(), v = new l.Vector3(), m = new l.Matrix4(), w = new l.Line3(), S = new l.Vector3(), T = new l.Box3(), M = new l.Sphere(), x = new l.Vector4(); class _ extends l.Mesh { constructor() { var L = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : new d.LineSegmentsGeometry(), R = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : new h6.LineMaterial({ color: 16777215 * Math.random() }); super(L, R), this.type = "LineSegments2"; } // for backwards-compatability, but could be a method of LineSegmentsGeometry... computeLineDistances() { for (var L = this.geometry, R = L.attributes.instanceStart, C = L.attributes.instanceEnd, A = new Float32Array(2 * R.count), P = 0, I = 0, b = R.count; P < b; P++, I += 2) p.fromBufferAttribute(R, P), g.fromBufferAttribute(C, P), A[I] = I == 0 ? 0 : A[I - 1], A[I + 1] = A[I] + p.distanceTo(g); var O = new l.InstancedInterleavedBuffer(A, 2, 1); return L.setAttribute("instanceDistanceStart", new l.InterleavedBufferAttribute(O, 1, 0)), L.setAttribute("instanceDistanceEnd", new l.InterleavedBufferAttribute(O, 1, 1)), this; } raycast(L, R) { L.camera === null && console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.'); var C = L.params.Line2 === void 0 ? 0 : L.params.Line2.threshold || 0, A = L.ray, P = L.camera, I = P.projectionMatrix, b = this.matrixWorld, O = this.geometry, N = this.material, D = N.resolution, B = N.linewidth + C, U = O.attributes.instanceStart, k = O.attributes.instanceEnd, K = -P.near, ie = 2 * Math.max(B / D.width, B / D.height); O.boundingSphere === null && O.computeBoundingSphere(), M.copy(O.boundingSphere).applyMatrix4(b); var j = Math.max(P.near, M.distanceToPoint(A.origin)); x.set(0, 0, -j, 1).applyMatrix4(P.projectionMatrix), x.multiplyScalar(1 / x.w), x.applyMatrix4(P.projectionMatrixInverse); var G = 0.5 * Math.abs(ie / x.w); if (M.radius += G, L.ray.intersectsSphere(M) !== false) { O.boundingBox === null && O.computeBoundingBox(), T.copy(O.boundingBox).applyMatrix4(b); var W = Math.max(P.near, T.distanceToPoint(A.origin)); x.set(0, 0, -W, 1).applyMatrix4(P.projectionMatrix), x.multiplyScalar(1 / x.w), x.applyMatrix4(P.projectionMatrixInverse); var q = 0.5 * Math.abs(ie / x.w); if (T.max.x += q, T.max.y += q, T.max.z += q, T.min.x -= q, T.min.y -= q, T.min.z -= q, L.ray.intersectsBox(T) !== false) { A.at(1, y), y.w = 1, y.applyMatrix4(P.matrixWorldInverse), y.applyMatrix4(I), y.multiplyScalar(1 / y.w), y.x *= D.x / 2, y.y *= D.y / 2, y.z = 0, v.copy(y), m.multiplyMatrices(P.matrixWorldInverse, b); for (var Q = 0, ee = U.count; Q < ee; Q++) { f.fromBufferAttribute(U, Q), u.fromBufferAttribute(k, Q), f.w = 1, u.w = 1, f.applyMatrix4(m), u.applyMatrix4(m); var ne = f.z > K && u.z > K; if (!ne) { if (f.z > K) { var Y = f.z - u.z, te = (f.z - K) / Y; f.lerp(u, te); } else if (u.z > K) { var F = u.z - f.z, $ = (u.z - K) / F; u.lerp(f, $); } f.applyMatrix4(I), u.applyMatrix4(I), f.multiplyScalar(1 / f.w), u.multiplyScalar(1 / u.w), f.x *= D.x / 2, f.y *= D.y / 2, u.x *= D.x / 2, u.y *= D.y / 2, w.start.copy(f), w.start.z = 0, w.end.copy(u), w.end.z = 0; var J = w.closestPointToPointParameter(v, true); w.at(J, S); var z = l.MathUtils.lerp(f.z, u.z, J), V = -1 <= z && 1 >= z, oe = v.distanceTo(S) < 0.5 * B; if (V && oe) { w.start.fromBufferAttribute(U, Q), w.end.fromBufferAttribute(k, Q), w.start.applyMatrix4(b), w.end.applyMatrix4(b); var ue = new l.Vector3(), le = new l.Vector3(); A.distanceSqToSegment(w.start, w.end, le, ue), R.push({ point: le, pointOnLine: ue, distance: A.origin.distanceTo(le), object: this, face: null, faceIndex: Q, uv: null, uv2: null }); } } } } } } } _.prototype.LineSegments2 = true; }, /* 47 */ /***/ (o, a, c) => { c.r(a), c.d(a, { /* harmony export */ LineSegmentsGeometry: () => ( /* binding */ p ) /* harmony export */ }); var l = c(4), d = new l.Box3(), h6 = new l.Vector3(); class p 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(f) { var u = this.attributes.instanceStart, y = this.attributes.instanceEnd; return u !== void 0 && (u.applyMatrix4(f), y.applyMatrix4(f), u.needsUpdate = true), this.boundingBox !== null && this.computeBoundingBox(), this.boundingSphere !== null && this.computeBoundingSphere(), this; } setPositions(f) { var u; f instanceof Float32Array ? u = f : Array.isArray(f) && (u = new Float32Array(f)); var y = new l.InstancedInterleavedBuffer(u, 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(f) { var u; f instanceof Float32Array ? u = f : Array.isArray(f) && (u = new Float32Array(f)); var y = new l.InstancedInterleavedBuffer(u, 6, 1); return this.setAttribute("instanceColorStart", new l.InterleavedBufferAttribute(y, 3, 0)), this.setAttribute("instanceColorEnd", new l.InterleavedBufferAttribute(y, 3, 3)), this; } fromWireframeGeometry(f) { return this.setPositions(f.attributes.position.array), this; } fromEdgesGeometry(f) { return this.setPositions(f.attributes.position.array), this; } fromMesh(f) { return this.fromWireframeGeometry(new l.WireframeGeometry(f.geometry)), this; } fromLineSegments(f) { var u = f.geometry; return u.isGeometry ? void console.error("THREE.LineSegmentsGeometry no longer supports Geometry. Use THREE.BufferGeometry instead.") : (u.isBufferGeometry && this.setPositions(u.attributes.position.array), this); } computeBoundingBox() { this.boundingBox === null && (this.boundingBox = new l.Box3()); var f = this.attributes.instanceStart, u = this.attributes.instanceEnd; f !== void 0 && u !== void 0 && (this.boundingBox.setFromBufferAttribute(f), d.setFromBufferAttribute(u), this.boundingBox.union(d)); } computeBoundingSphere() { this.boundingSphere === null && (this.boundingSphere = new l.Sphere()), this.boundingBox === null && this.computeBoundingBox(); var f = this.attributes.instanceStart, u = this.attributes.instanceEnd; if (f !== void 0 && u !== void 0) { var y = this.boundingSphere.center; this.boundingBox.getCenter(y); for (var v = 0, m = 0, w = f.count; m < w; m++) h6.fromBufferAttribute(f, m), v = Math.max(v, y.distanceToSquared(h6)), h6.fromBufferAttribute(u, m), v = Math.max(v, y.distanceToSquared(h6)); this.boundingSphere.radius = Math.sqrt(v), 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(f) { return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."), this.applyMatrix4(f); } } p.prototype.isLineSegmentsGeometry = true; }, /* 48 */ /***/ (o, a, c) => { c.r(a), c.d(a, { /* harmony export */ LineMaterial: () => ( /* binding */ d ) /* 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 d extends l.ShaderMaterial { constructor(p) { super({ type: "LineMaterial", uniforms: l.UniformsUtils.clone(l.ShaderLib.line.uniforms), vertexShader: l.ShaderLib.line.vertexShader, fragmentShader: l.ShaderLib.line.fragmentShader, clipping: true // required for clipping support }), Object.defineProperties(this, { color: { enumerable: true, get: function() { return this.uniforms.diffuse.value; }, set: function(f) { this.uniforms.diffuse.value = f; } }, linewidth: { enumerable: true, get: function() { return this.uniforms.linewidth.value; }, set: function(f) { this.uniforms.linewidth.value = f; } }, dashed: { enumerable: true, get: function() { return "USE_DASH" in this.defines; }, set(g) { !!g != "USE_DASH" in this.defines && (this.needsUpdate = true), g === true ? this.defines.USE_DASH = "" : delete this.defines.USE_DASH; } }, dashScale: { enumerable: true, get: function() { return this.uniforms.dashScale.value; }, set: function(f) { this.uniforms.dashScale.value = f; } }, dashSize: { enumerable: true, get: function() { return this.uniforms.dashSize.value; }, set: function(f) { this.uniforms.dashSize.value = f; } }, dashOffset: { enumerable: true, get: function() { return this.uniforms.dashOffset.value; }, set: function(f) { this.uniforms.dashOffset.value = f; } }, gapSize: { enumerable: true, get: function() { return this.uniforms.gapSize.value; }, set: function(f) { this.uniforms.gapSize.value = f; } }, opacity: { enumerable: true, get: function() { return this.uniforms.opacity.value; }, set: function(f) { this.uniforms.opacity.value = f; } }, resolution: { enumerable: true, get: function() { return this.uniforms.resolution.value; }, set: function(f) { this.uniforms.resolution.value.copy(f); } }, alphaToCoverage: { enumerable: true, get: function() { return "ALPHA_TO_COVERAGE" in this.defines; }, set: function(f) { !!f != "ALPHA_TO_COVERAGE" in this.defines && (this.needsUpdate = true), f === true ? (this.defines.ALPHA_TO_COVERAGE = "", this.extensions.derivatives = true) : (delete this.defines.ALPHA_TO_COVERAGE, this.extensions.derivatives = false); } } }), this.setValues(p); } } d.prototype.isLineMaterial = true; }, /* 49 */ /***/ (o, a, c) => { var l = c(4); a.Minimap = function(d) { var h6 = d; this.camera = new l.OrthographicCamera(-0.5, 0.5, 0.5, -0.5, 0.01, 10), this.helper = void 0; var p = new l.BufferGeometry(), g = new Float32Array([-1, -1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1]), f = new l.BufferAttribute(g, 3); p.setAttribute("position", f); var u = new l.MeshBasicMaterial({ color: 3355443, depthTest: false, depthWrite: false, opacity: 0.5, transparent: true }); this.mask = new l.Mesh(p, u); var y = new l.Box3(), v = new l.Vector3(); this.getDiffFromNormalised = (w, S) => { y.setFromBufferAttribute(f).getCenter(v); var T = v.clone().project(this.camera), M = new l.Vector3(w, S, T.z).unproject(this.camera); return M.sub(v); }; var m = (w, S) => { h6.camera.near && (this.camera.near = h6.camera.near), S.farPlane && (this.camera.far = S.farPlane), S.eyePosition && this.camera.position.set(S.eyePosition[0], S.eyePosition[1], S.eyePosition[2]), S.upVector && this.camera.up.set(S.upVector[0], S.upVector[1], S.upVector[2]), S.targetPosition && this.camera.lookAt(new l.Vector3(S.targetPosition[0], S.targetPosition[1], S.targetPosition[2])), this.camera.zoom = 1 / w, this.camera.updateProjectionMatrix(); }; this.getBoundary = () => { var w = new l.Vector3().copy(h6.camera.target).project(h6.camera), S = new l.Vector3(-1, -1, w.z).unproject(h6.camera), T = new l.Vector3(1, -1, w.z).unproject(h6.camera), M = new l.Vector3(1, 1, w.z).unproject(h6.camera), x = new l.Vector3(-1, 1, w.z).unproject(h6.camera); f.copyVector3sArray([S, T, M, M, x, S]), f.needsUpdate = true; }, this.updateCamera = () => { this.getBoundary(); var w = h6.getZincCameraControls(), S = h6.getBoundingBox(); if (S) { var T = S.min.distanceTo(S.max), M = T / 2, x = (S.min.x + S.max.x) / 2, _ = (S.min.y + S.max.y) / 2, E = (S.min.z + S.max.z) / 2, L = w.getViewportFromCentreAndRadius(x, _, E, M, 40, M * 4); m(T, L); } }; }; }, /* 50 */ /***/ (o, a, c) => { var l = c(4), d = c(51)(l), h6 = c(3).Geometry, p = c(52), g = c(53).default, f = l.BufferGeometryLoader, u = function(y) { var v; y && y.isGeometry && (v = y); var m = void 0, w = void 0, S = false, T = void 0, M = (R) => { var C = v.getMorph().material.clone(); C.morphTargets = false; var A = new h6(), P = new f(), I = P.parse(R), b = new l.Mesh(I.geometry, C); return A.geometry = b.geometry, b.userData = A, A.setMorph(b), A; }, x = (R) => { switch (R.data.action) { case "message": console.log(R.data.message); break; case "result": var C = new u(M(R.data.object)); T && T(C), T = void 0, S = false; break; default: throw "Cannot handle specified action."; } }, _ = (R) => { if (p !== void 0 && (w = p( /*require.resolve*/ 54 )), !w) m = new (c(55)).GeometryCSGInternal(R); else if (R && R.isGeometry) { var C = R.getMorph(), A = C.geometry.clone().applyMatrix(C.matrix).toJSON(); w.addEventListener("message", function(P) { x(P); }), w.postMessage({ action: "initialise", object: A }); } }; this.getHostGeometry = () => { var R = new d(v.getMorph()); return new E(R); }, this.getGeometry = () => v; var E = (R) => { var C = v.getMorph().material.clone(); C.morphTargets = false; var A = R.toMesh(C), P = new h6(); return P.geometry = A.geometry, A.userData = P, P.setMorph(A), P; }; this.setCSG = (R) => { m.setCSG(R); }; var L = (R, C, A, P) => { if (S) P("On progress"); else { var I = R.getMorph(), b = I.geometry.clone().applyMatrix(I.matrix).toJSON(); T = A, S = true, w.postMessage({ action: C, object: b }); } }; this.intersect = (R) => new g((C, A) => { if (w) L(R, "intersect", C, A); else { var P = m.intersect(R), I = new u(E(P)); I.setCSG(P), C(I); } }), this.subtract = (R) => new g((C, A) => { if (w) L(R, "intersect", C, A); else { var P = m.subtract(R), I = new u(E(P)); I.setCSG(P), C(I); } }), this.union = (R) => new g((C, A) => { if (w) L(R, "intersect", C, A); else { var P = m.union(R), I = new u(E(P)); I.setCSG(P), C(I); } }), this.terminateWorker = () => { w && w.terminate(); }, _(y); }; a.GeometryCSG = u; }, /* 51 */ /***/ (o) => { var a = 1e-5, c = 0, l = 1, d = 2, h6 = 3; o.exports = function(p) { var g = function(f) { var u, y, v, m, w, S, T, M = []; if (f.isBufferGeometry && (f = new p.Geometry().fromBufferGeometry(f)), f instanceof p.Geometry) this.matrix = new p.Matrix4(); else if (f.isMesh) f.updateMatrix(), this.matrix = f.matrix.clone(), f = f.geometry, f.isBufferGeometry && (f = new p.Geometry().fromBufferGeometry(f)), f.mergeVertices(), f.computeVertexNormals(false); else { if (f instanceof g.Node) return this.tree = f, this.matrix = new p.Matrix4(), this; throw "ThreeBSP: Given geometry is unsupported"; } for (u = 0, y = f.faces.length; u < y; u++) v = f.faces[u], w = f.faceVertexUvs[0][u], T = new g.Polygon(), v instanceof p.Face3 ? (m = f.vertices[v.a], S = w ? new p.Vector2(w[0].x, w[0].y) : null, m = new g.Vertex(m.x, m.y, m.z, v.vertexNormals[0], S), m.applyMatrix4(this.matrix), T.vertices.push(m), m = f.vertices[v.b], S = w ? new p.Vector2(w[1].x, w[1].y) : null, m = new g.Vertex(m.x, m.y, m.z, v.vertexNormals[2], S), m.applyMatrix4(this.matrix), T.vertices.push(m), m = f.vertices[v.c], S = w ? new p.Vector2(w[2].x, w[2].y) : null, m = new g.Vertex(m.x, m.y, m.z, v.vertexNormals[2], S), m.applyMatrix4(this.matrix), T.vertices.push(m)) : (p.Face4, m = f.vertices[v.a], S = w ? new p.Vector2(w[0].x, w[0].y) : null, m = new g.Vertex(m.x, m.y, m.z, v.vertexNormals[0], S), m.applyMatrix4(this.matrix), T.vertices.push(m), m = f.vertices[v.b], S = w ? new p.Vector2(w[1].x, w[1].y) : null, m = new g.Vertex(m.x, m.y, m.z, v.vertexNormals[1], S), m.applyMatrix4(this.matrix), T.vertices.push(m), m = f.vertices[v.c], S = w ? new p.Vector2(w[2].x, w[2].y) : null, m = new g.Vertex(m.x, m.y, m.z, v.vertexNormals[2], S), m.applyMatrix4(this.matrix), T.vertices.push(m), m = f.vertices[v.d], S = w ? new p.Vector2(w[3].x, w[3].y) : null, m = new g.Vertex(m.x, m.y, m.z, v.vertexNormals[3], S), m.applyMatrix4(this.matrix), T.vertices.push(m)), T.calculateProperties(), M.push(T); this.tree = new g.Node(M); }; return g.prototype.subtract = function(f) { var u = this.tree.clone(), y = f.tree.clone(); return u.invert(), u.clipTo(y), y.clipTo(u), y.invert(), y.clipTo(u), y.invert(), u.build(y.allPolygons()), u.invert(), u = new g(u), u.matrix = this.matrix, u; }, g.prototype.union = function(f) { var u = this.tree.clone(), y = f.tree.clone(); return u.clipTo(y), y.clipTo(u), y.invert(), y.clipTo(u), y.invert(), u.build(y.allPolygons()), u = new g(u), u.matrix = this.matrix, u; }, g.prototype.intersect = function(f) { var u = this.tree.clone(), y = f.tree.clone(); return u.invert(), y.clipTo(u), y.invert(), u.clipTo(y), y.clipTo(u), u.build(y.allPolygons()), u.invert(), u = new g(u), u.matrix = this.matrix, u; }, g.prototype.toGeometry = function() { var f, u, y, v, m, w, S, T, M, x, _ = new p.Matrix4().getInverse(this.matrix), E = new p.Geometry(), L = this.tree.allPolygons(), R = L.length, C = {}; for (f = 0; f < R; f++) for (y = L[f], v = y.vertices.length, u = 2; u < v; u++) x = [], T = y.vertices[0], x.push(new p.Vector2(T.uv.x, T.uv.y)), T = new p.Vector3(T.x, T.y, T.z), T.applyMatrix4(_), typeof C[T.x + "," + T.y + "," + T.z] > "u" ? (E.vertices.push(T), m = C[T.x + "," + T.y + "," + T.z] = E.vertices.length - 1) : m = C[T.x + "," + T.y + "," + T.z], T = y.vertices[u - 1], x.push(new p.Vector2(T.uv.x, T.uv.y)), T = new p.Vector3(T.x, T.y, T.z), T.applyMatrix4(_), typeof C[T.x + "," + T.y + "," + T.z] > "u" ? (E.vertices.push(T), w = C[T.x + "," + T.y + "," + T.z] = E.vertices.length - 1) : w = C[T.x + "," + T.y + "," + T.z], T = y.vertices[u], x.push(new p.Vector2(T.uv.x, T.uv.y)), T = new p.Vector3(T.x, T.y, T.z), T.applyMatrix4(_), typeof C[T.x + "," + T.y + "," + T.z] > "u" ? (E.vertices.push(T), S = C[T.x + "," + T.y + "," + T.z] = E.vertices.length - 1) : S = C[T.x + "," + T.y + "," + T.z], M = new p.Face3(m, w, S, new p.Vector3(y.normal.x, y.normal.y, y.normal.z)), E.faces.push(M), E.faceVertexUvs[0].push(x); return E; }, g.prototype.toBufferGeometry = function() { var f = this.toGeometry(), u = new p.BufferGeometry().fromGeometry(f); return u; }, g.prototype.toMesh = function(f) { var u = this.toBufferGeometry(), y = new p.Mesh(u, f); return y.position.setFromMatrixPosition(this.matrix), y.rotation.setFromRotationMatrix(this.matrix), y; }, g.Polygon = function(f) { f instanceof Array || (f = []), this.vertices = f, 0 < f.length ? this.calculateProperties() : this.normal = this.w = void 0; }, g.Polygon.prototype.calculateProperties = function() { var f = this.vertices[0], u = this.vertices[1], y = this.vertices[2]; return this.normal = u.clone().subtract(f).cross(y.clone().subtract(f)).normalize(), this.w = this.normal.clone().dot(f), this; }, g.Polygon.prototype.clone = function() { var f, u, y = new g.Polygon(); for (f = 0, u = this.vertices.length; f < u; f++) y.vertices.push(this.vertices[f].clone()); return y.calculateProperties(), y; }, g.Polygon.prototype.flip = function() { var f, u = []; for (this.normal.multiplyScalar(-1), this.w *= -1, f = this.vertices.length - 1; 0 <= f; f--) u.push(this.vertices[f]); return this.vertices = u, this; }, g.Polygon.prototype.classifyVertex = function(f) { var u = this.normal.dot(f) - this.w; return u < -a ? d : u > a ? l : c; }, g.Polygon.prototype.classifySide = function(f) { var u, y, v, m = 0, w = 0, S = f.vertices.length; for (u = 0; u < S; u++) y = f.vertices[u], v = this.classifyVertex(y), v === l ? m++ : v === d && w++; return 0 < m && w === 0 ? l : m === 0 && 0 < w ? d : m === 0 && w === 0 ? c : h6; }, g.Polygon.prototype.splitPolygon = function(f, u, y, v, m) { var w = this.classifySide(f); if (w === c) (0 < this.normal.dot(f.normal) ? u : y).push(f); else if (w === l) v.push(f); else if (w === d) m.push(f); else { var S, T, M, x, _, E, L, R, C, A = [], P = []; for (T = 0, S = f.vertices.length; T < S; T++) M = (T + 1) % S, E = f.vertices[T], L = f.vertices[M], x = this.classifyVertex(E), _ = this.classifyVertex(L), x != d && A.push(E), x != l && P.push(E), (x | _) == h6 && (R = (this.w - this.normal.dot(E)) / this.normal.dot(L.clone().subtract(E)), C = E.interpolate(L, R), A.push(C), P.push(C)); 3 <= A.length && v.push(new g.Polygon(A).calculateProperties()), 3 <= P.length && m.push(new g.Polygon(P).calculateProperties()); } }, g.Vertex = function(f, u, y, v, m) { this.x = f, this.y = u, this.z = y, this.normal = v || new p.Vector3(), this.uv = m || new p.Vector2(); }, g.Vertex.prototype.clone = function() { return new g.Vertex(this.x, this.y, this.z, this.normal.clone(), this.uv.clone()); }, g.Vertex.prototype.add = function(f) { return this.x += f.x, this.y += f.y, this.z += f.z, this; }, g.Vertex.prototype.subtract = function(f) { return this.x -= f.x, this.y -= f.y, this.z -= f.z, this; }, g.Vertex.prototype.multiplyScalar = function(f) { return this.x *= f, this.y *= f, this.z *= f, this; }, g.Vertex.prototype.cross = function(f) { var u = this.x, y = this.y, v = this.z; return this.x = y * f.z - v * f.y, this.y = v * f.x - u * f.z, this.z = u * f.y - y * f.x, this; }, g.Vertex.prototype.normalize = function() { var f = Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); return this.x /= f, this.y /= f, this.z /= f, this; }, g.Vertex.prototype.dot = function(f) { return this.x * f.x + this.y * f.y + this.z * f.z; }, g.Vertex.prototype.lerp = function(f, u) { return this.add(f.clone().subtract(this).multiplyScalar(u)), this.normal.add(f.normal.clone().sub(this.normal).multiplyScalar(u)), this.uv.add(f.uv.clone().sub(this.uv).multiplyScalar(u)), this; }, g.Vertex.prototype.interpolate = function(f, u) { return this.clone().lerp(f, u); }, g.Vertex.prototype.applyMatrix4 = function(f) { var u = this.x, y = this.y, v = this.z, m = f.elements; return this.x = m[0] * u + m[4] * y + m[8] * v + m[12], this.y = m[1] * u + m[5] * y + m[9] * v + m[13], this.z = m[2] * u + m[6] * y + m[10] * v + m[14], this; }, g.Node = function(f) { var u, y, v = [], m = []; if (this.polygons = [], this.front = this.back = void 0, f instanceof Array && f.length !== 0) { for (this.divider = f[0].clone(), u = 0, y = f.length; u < y; u++) this.divider.splitPolygon(f[u], this.polygons, this.polygons, v, m); 0 < v.length && (this.front = new g.Node(v)), 0 < m.length && (this.back = new g.Node(m)); } }, g.Node.isConvex = function(f) { var u, y; for (u = 0; u < f.length; u++) for (y = 0; y < f.length; y++) if (u !== y && f[u].classifySide(f[y]) !== d) return false; return true; }, g.Node.prototype.build = function(f) { var u, y, v = [], m = []; for (this.divider || (this.divider = f[0].clone()), u = 0, y = f.length; u < y; u++) this.divider.splitPolygon(f[u], this.polygons, this.polygons, v, m); 0 < v.length && (!this.front && (this.front = new g.Node()), this.front.build(v)), 0 < m.length && (!this.back && (this.back = new g.Node()), this.back.build(m)); }, g.Node.prototype.allPolygons = function() { var f = this.polygons.slice(); return this.front && (f = f.concat(this.front.allPolygons())), this.back && (f = f.concat(this.back.allPolygons())), f; }, g.Node.prototype.clone = function() { var f = new g.Node(); return f.divider = this.divider.clone(), f.polygons = this.polygons.map(function(u) { return u.clone(); }), f.front = this.front && this.front.clone(), f.back = this.back && this.back.clone(), f; }, g.Node.prototype.invert = function() { var f, u, y; for (f = 0, u = this.polygons.length; f < u; f++) this.polygons[f].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; }, g.Node.prototype.clipPolygons = function(f) { var u, y, v, m; if (!this.divider) return f.slice(); for (v = [], m = [], u = 0, y = f.length; u < y; u++) this.divider.splitPolygon(f[u], v, m, v, m); return this.front && (v = this.front.clipPolygons(v)), m = this.back ? this.back.clipPolygons(m) : [], v.concat(m); }, g.Node.prototype.clipTo = function(f) { this.polygons = f.clipPolygons(this.polygons), this.front && this.front.clipTo(f), this.back && this.back.clipTo(f); }, g; }; }, /* 52 */ /***/ (o) => { o.exports = Ez(); }, /* 53 */ /***/ (o) => { o.exports = Nz; }, /* 54 */ /***/ (o, a, c) => { var l = c(3).Geometry, d = c(4), h6 = d.BufferGeometryLoader; o.exports = function(p) { var g = void 0, f = function(S) { var T = new h6(), M = T.parse(S), x = new d.MeshPhongMaterial(), _ = new d.Mesh(M.geometry, x), E = new l(); return E.setMorph(_), E; }, u = function(S) { var T = f(S); g = new (c(55)).GeometryCSGInternal(T), p.postMessage({ action: "message", message: "Initialised" }); }, y = function(S) { if (g) { var T = f(S), M = g.intersect(T), x = M.toBufferGeometry().toJSON(); p.postMessage({ action: "result", object: x }); } }, v = function(S) { if (g) { var T = f(S), M = g.subtract(T), x = M.toBufferGeometry().toJSON(); p.postMessage({ action: "result", object: x }); } }, m = function(S) { if (g) { var T = f(S), M = g.union(T), x = M.toBufferGeometry().toJSON(); p.postMessage({ action: "result", object: x }); } }; p.addEventListener("message", function(w) { switch (w.data.action) { case "initialise": u(w.data.object); break; case "intersect": y(w.data.object); break; case "subtract": v(w.data.object); break; case "union": m(w.data.object); break; default: throw "Cannot handle specified action."; } }); }; }, /* 55 */ /***/ (o, a, c) => { var l = c(4), d = c(51)(l); c(3).Geometry, c(50).GeometryCSG; var h6 = function(p) { var g; p && p.isGeometry && (g = p); var f; this.setGeometry = (y) => { y && y.isGeometry && (g = y), f = void 0; }, this.setCSG = (y) => { f = y; }; var u = (y) => { if (g && g.morph && y && y.morph) { f === void 0 && (f = new d(g.morph)); var v = new d(y.morph); return v; } }; this.intersect = (y) => { var v = u(y); return f && v ? f.intersect(v) : void 0; }, this.subtract = (y) => { var v = u(y); return f && v ? f.subtract(v) : void 0; }, this.union = (y) => { var v = u(y); return f && v ? f.union(v) : void 0; }; }; a.GeometryCSGInternal = h6; }, /* 56 */ /***/ (o, a, c) => { var l = c(4), d = c(51)(l); c(18).Glyphset; var h6 = function(p) { var g; p && p.isGlyphset && (g = p); var f = []; this.setGlyphset = (v) => { v && v.isGlyphset && (g = v), hostCSG = void 0; }, this.getGlyphset = () => g; var u = () => (v) => { var m = v.getMesh(), w = v.getLabel(); if (m) { var S = new d(m.geometry.clone().applyMatrix(m.matrix)), T = []; T.csg = S, T.label = w, m.material && (T.material = m.material.clone()), f.push(T); } }, y = (v) => { if (g && v && v.getMorph()) { f.length == 0 && g.forEachGlyph(u()); var m = new d(v.getMorph()); return m; } }; this.intersect = (v) => { var m = y(v); if (0 < f.length && m) { for (var w = new (c(18)).Glyphset(), S = 0; S < f.length; S++) { var T = f[S], M = T.csg.intersect(m), x = M.toMesh(); if (x && x.geometry && 0 < x.geometry.vertices.length) { T.material && (x.material = T.material, x.material.side = l.DoubleSide, x.material.clippingPlanes = null); var _ = w.addMeshAsGlyph(x, S + 1); _.setLabel(T.label); } } var E = new h6(w); return E; } }; }; a.GlyphsetCSG = h6; } /******/ ], i = {}; function r(o) { var a = i[o]; if (a !== void 0) return a.exports; var c = i[o] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; return t13[o].call(c.exports, c, c.exports, r), c.exports; } r.n = (o) => { var a = o && o.__esModule ? ( /******/ () => o.default ) : ( /******/ () => o ); return r.d(a, { a }), a; }, r.d = (o, a) => { for (var c in a) r.o(a, c) && !r.o(o, c) && Object.defineProperty(o, c, { enumerable: true, get: a[c] }); }, r.o = (o, a) => Object.prototype.hasOwnProperty.call(o, a), r.r = (o) => { typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(o, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(o, "__esModule", { value: true }); }; var s = r(0); return s; })() )); })(Dy2); var Ur2 = Dy2.exports; var Gc2 = rL2(Ur2); var $v2 = (n, e) => { if (n) { let t13 = ""; n.forEach((i) => { t13 = i.uuid, i.region && (t13 = i.region.uuid + "/" + t13), i && i.getVisibility() && e.push(t13); }); } return e; }; var Yd2 = (n, e) => { const t13 = n[0] - e[0], i = n[1] - e[1], r = n[2] - e[2]; return Math.sqrt(t13 * t13 + i * i + r * r); }; var Fz = (n) => { const e = n.zincObjects; if (e.length > 0 && e[0]) { const t13 = e[0]; if (t13.isEditable && t13.isLines2) { const i = n.identifiers[0].extraData.intersected; if (i && i.faceIndex > -1) { const r = t13.getVerticesByFaceIndex(i.faceIndex), s = n.identifiers[0].extraData.intersected.pointOnLine; if (r.length > 1) { const o = Yd2(r[0], [s.x, s.y, s.z]), a = Yd2(r[1], [s.x, s.y, s.z]); return o > a ? { zincObject: t13, faceIndex: i.faceIndex, vertexIndex: i.faceIndex * 2 + 1, point: r[0] } : { zincObject: t13, faceIndex: i.faceIndex, vertexIndex: i.faceIndex * 2, point: r[1] }; } } } } }; var Bz = (n) => { const e = n.zincObjects; if (e.length > 0 && e[0]) { const t13 = e[0]; if (t13.isEditable) return t13; } }; var zz = (n, e, t13) => { if (n != null && n.isEditable && (n != null && n.isPointset)) { let i = false; for (let r = 0; r < 3 && !i; r++) t13[r] !== 0 && (i = true); if (i && e > -1) { const r = n.getVerticesByIndex(e); return r && (r[0] = r[0] + t13[0], r[1] = r[1] + t13[1], r[2] = r[2] + t13[2]), n.editVertices([r], e), n.boundingBoxUpdateRequired = true, true; } } return false; }; var Pc2 = (n, e) => { if (n != null && n.isEditable && (n != null && n.isLines2) && e > -1) { const t13 = n.getVerticesByFaceIndex(e); if (t13 && t13.length > 1) return Yd2(t13[1], t13[0]); } return 0; }; var Wh2 = (n, e, t13, i) => { if (n && t13 !== 0 && n.isEditable && n.isLines2 && e > -1) { const r = n.getVerticesByFaceIndex(e); let s = [r[1][0] - r[0][0], r[1][1] - r[0][1], r[1][2] - r[0][2]]; const o = Math.sqrt(s[0] * s[0] + s[1] * s[1] + s[2] * s[2]); for (let a = 0; a < 3; a++) s[a] = s[a] / o * t13, i ? r[1][a] = r[0][a] + s[a] : (r[0][a] = r[0][a] + s[a], r[1][a] = r[1][a] + s[a]); return n.editVertices(r, e * 2), n.boundingBoxUpdateRequired = true, true; } return false; }; var Uz = (n, e) => { const t13 = e.getBoundingBox(), i = new Ur2.THREE.Vector3().subVectors(t13.max, t13.min), r = new Ur2.THREE.BoxGeometry(i.x, i.y, i.z); i.addVectors(t13.min, t13.max).multiplyScalar(0.5); const s = r.getAttribute("position"), o = s.count, a = []; for (let c = 0; c < o; c++) a[c] = [ s.array[c * 3], s.array[c * 3 + 1], s.array[c * 3 + 2] ]; n.editVertices(a, 0), n.setPosition(i.x, i.y, i.z), r.dispose(); }; var Pw2 = (n, e) => { let t13 = ""; n.isRegion && (t13 = `__r${n.regionPath}`), n.isPrimitives && (t13 = `${n.regionPath}/${n.label}`), e.push(t13), n.children && n.children.forEach((i) => Pw2(i, e)); }; var Ao2 = (n, e, t13, i) => { let r = n; const s = []; if (t13 && (r = n.findChildFromPath(t13)), r) { const o = Array.isArray(e); let a = e; o || (a = [a]), a.forEach((c) => { const l = r.findObjectsWithGroupName(c, i); s.push(...l); }); } return s; }; var Jd2 = (n, e, t13) => { const i = n.findIndex((s) => s.uuid === e); let r; return i > -1 && (r = n[i], t13 && n.splice(i, 1)), r; }; var Vz = (n, e) => { const t13 = []; if (n && e && e.length > 0) { const i = {}, r = {}, s = [n, ...n.getChildRegions(true)]; let o, a, c; e.forEach((l) => { const d = l.split("/"); c = d[0], o = Jd2(s, c, false), o && (r[c] || (r[c] = o.getFullPath()), d[1] ? (i[c] || (i[c] = o.getAllObjects(false)), a = Jd2(i[c], d[1], true), a && t13.push(`${r[c]}/${a.groupName}`)) : t13.push(`__r/${r[c]}`)); }); } return t13; }; var kz = (n) => { if (n) { const e = []; return n.forEach((i) => { i.isZincObject ? e.push(i) : i.isRegion && e.push(...i.getAllObjects(true)); }), Object.values( e.reduce((i, r) => ({ ...i, [r.uuid]: r }), {}) ); } return []; }; var Zv2 = (n, e) => { const t13 = { label: "Multiple selections", regionPath: "", objects: [] }; if (e && n) { const i = {}, r = n.getRootRegion(); e.length > 0 && (t13.regionPath = e[0].data.region, t13.label = e[0].data.group), e.forEach((s) => { s.data.region.includes(t13.regionPath) || (t13.regionPath = ""), t13.label !== s.data.group && (t13.label = "Multiple selections"); const o = r.findChildFromPath(s.data.region); i[o.uuid] || (i[o.uuid] = o.getAllObjects(false)); const a = Jd2(i[o.uuid], s.data.uuid); a && t13.objects.push(a); }); } return t13; }; var Gz = (n) => { const e = n.getMorph(); let t13 = "position"; n.isLines2 && (t13 = "instanceStart"); const i = []; let r = 0; const s = e.geometry.getAttribute(t13); for (let o = 0; o < n.drawRange; o++) i.push([ s.array[r++], s.array[r++], s.array[r++] ]); return i; }; var Hz = (n, e, t13, i, r) => { let s; if (n.isPointset ? s = "MultiPoint" : n.isLines2 && (s = "MultiLineString"), s) { const o = Gz(n); let a = e.slice(-1) === "/" ? e : e + "/"; a = a + t13; const c = a, l = { resource: i, item: { id: c }, body: { evidence: [], comment: r }, feature: { id: c, properties: { drawn: true, label: "Drawn annotation" }, geometry: { coordinates: o, type: s } } }; return r === "Deleted" && (l.feature = void 0), l; } }; var Xv2 = (n, e, t13, i, r, s, o) => { const a = Hz(t13, i, r, s, o); if (a) return n && n.currentUser && (a.creator = { ...n.currentUser }, a.creator.orcid || (a.creator.orcid = "0000-0000-0000-0000"), n.addAnnotation(e, a).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"); })), a; }; var Yv2 = async (n, e, t13) => { const i = t13; return await n.drawnFeatures(e, i); }; var jh2 = (n, e) => { n && e.forEach((t13) => { const i = t13.geometry, r = decodeURIComponent(t13.id), s = r.lastIndexOf("/"), o = r.substring(0, s), a = r.substring(s + 1); let c; i.type === "MultiPoint" ? c = n.createPoints( o, a, i.coordinates, a, 8942 ) : i.type === "MultiLineString" && (c = n.createLines( o, a, i.coordinates, 60962 )), c && (c.zincObject.isEditable = true); }); }; var wr = (n, e) => { const t13 = n.__vccOpts || n; for (const [i, r] of e) t13[i] = r; return t13; }; var Wz = { name: "LinesControls", components: { Button: sa2, Col: _i2, Container: Wi2, InputNumber: yr2, Main: vr2, Slider: ci2, ElIconArrowLeft: jr, ElIconArrowRight: $r }, props: { createData: { type: Object } }, data: function() { return { adjust: 0, pAdjust: 0, lengthScale: 0, distance: 0, newDistance: 0, width: 1, currentIndex: 0, ElIconArrowLeft: shallowRef(jr), ElIconArrowRight: shallowRef($r), edited: false, zincObject: void 0 }; }, watch: { "createData.faceIndex": { handler: function(n) { var e; (e = this.zincObject) != null && e.isLines2 && (this.currentIndex = n, this.distance = Pc2(this.zincObject, this.currentIndex)); }, immediate: true } }, methods: { changeIndex: function(n) { n ? Pc2(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 = Wh2( this.zincObject, this.currentIndex, this.newDistance, true ) || this.edited) : this.newDistance = this.distance; }, onLengthSliding: function() { this.newDistance = Math.pow(10, this.lengthScale) * this.distance, this.edited = Wh2( this.zincObject, this.currentIndex, this.newDistance, true ) || this.edited; }, onMoveSliding: function() { const n = (this.adjust - this.pAdjust) * this.distance; this.edited = Wh2( this.zincObject, this.currentIndex, n, false ) || this.edited, this.pAdjust = this.adjust; }, reset: function() { this.adjust = 0, this.pAdjust = 0, this.lengthScale = 0, this.distance = Pc2(this.zincObject, this.currentIndex), this.newDistance = this.distance, this.edited && (this.$emit("primitivesUpdated", this.zincObject), this.edited = false); }, setObject: function(n) { this.currentIndex = -1, this.distance = 0, n.isLines2 ? (this.zincObject = markRaw(n), this.width = this.zincObject.getMorph().material.linewidth, n.isEditable && (this.currentIndex = 0, this.distance = Pc2(n, this.currentIndex))) : (this.zincObject = void 0, this.width = 10); }, modifyWidth: function() { this.zincObject.setWidth(this.width); } } }; function jz(n, e, t13, i, r, s) { const o = _i2, a = ci2, c = yr2, l = Hi2, d = sa2, h6 = vr2, p = Wi2; return openBlock(), createBlock(p, { class: "lines-container" }, { default: withCtx(() => [ createVNode(h6, { class: "slides-block" }, { default: withCtx(() => [ createVNode(l, null, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => [ createTextVNode(" Width: ") ]), _: 1 }), createVNode(o, { offset: 0, span: 12 }, { default: withCtx(() => [ createVNode(a, { modelValue: n.width, "onUpdate:modelValue": e[0] || (e[0] = (g) => n.width = g), class: "my-slider", step: 1, min: 1, max: 100, "show-tooltip": false, onInput: s.modifyWidth }, null, 8, ["modelValue", "onInput"]) ]), _: 1 }), createVNode(o, { offset: 0, span: 4 }, { default: withCtx(() => [ createVNode(c, { modelValue: n.width, "onUpdate:modelValue": e[1] || (e[1] = (g) => n.width = g), step: 1, min: 1, max: 100, controls: false, class: "input-box number-input" }, null, 8, ["modelValue"]) ]), _: 1 }) ]), _: 1 }), n.currentIndex > -1 && n.distance > 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ createVNode(l, null, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 4 }, { default: withCtx(() => [ createVNode(d, { size: "small", disabled: n.currentIndex === 0, icon: n.ElIconArrowLeft, onClick: e[2] || (e[2] = (g) => s.changeIndex(false)) }, null, 8, ["disabled", "icon"]) ]), _: 1 }), createVNode(o, { offset: 4, span: 9 }, { default: withCtx(() => [ createTextVNode(" Editing Line " + toDisplayString(n.currentIndex + 1), 1) ]), _: 1 }), createVNode(o, { offset: 2, span: 2 }, { default: withCtx(() => [ createVNode(d, { size: "small", icon: n.ElIconArrowRight, onClick: e[3] || (e[3] = (g) => s.changeIndex(true)) }, null, 8, ["icon"]) ]), _: 1 }) ]), _: 1 }), createVNode(l, null, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => [ createTextVNode(" Move: ") ]), _: 1 }), createVNode(o, { offset: 0, span: 16 }, { default: withCtx(() => [ createVNode(a, { modelValue: n.adjust, "onUpdate:modelValue": e[4] || (e[4] = (g) => n.adjust = g), step: 0.01, min: -3, max: 3, "show-tooltip": false, onInput: e[5] || (e[5] = (g) => s.onMoveSliding()), onChange: e[6] || (e[6] = (g) => s.reset()) }, null, 8, ["modelValue"]) ]), _: 1 }) ]), _: 1 }), createVNode(l, null, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => [ createTextVNode(" Length: ") ]), _: 1 }), createVNode(o, { offset: 0, span: 10 }, { default: withCtx(() => [ createVNode(a, { modelValue: n.lengthScale, "onUpdate:modelValue": e[7] || (e[7] = (g) => n.lengthScale = g), step: 0.01, min: -1, max: 1, "show-tooltip": false, onInput: e[8] || (e[8] = (g) => s.onLengthSliding()), onChange: e[9] || (e[9] = (g) => s.reset()) }, null, 8, ["modelValue"]) ]), _: 1 }), createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => [ createVNode(c, { modelValue: n.newDistance, "onUpdate:modelValue": e[10] || (e[10] = (g) => n.newDistance = g), controls: false, class: "input-box number-input", onChange: s.onLengthInput }, null, 8, ["modelValue", "onChange"]) ]), _: 1 }) ]), _: 1 }) ], 64)) : createCommentVNode("", true) ]), _: 1 }) ]), _: 1 }); } var Iw2 = wr(Wz, [["render", jz], ["__scopeId", "data-v-6581aa67"]]); var $z = { name: "PointsControls", components: { Col: _i2, Container: Wi2, InputNumber: yr2, Main: vr2, Select: oa2, Slider: ci2, Row: Hi2, Option: aa, ElIconArrowLeft: jr, ElIconArrowRight: $r }, inject: ["boundingDims"], data: function() { return { attenuation: false, size: 10, choices: [ { value: true, label: "On" }, { value: false, label: "off" } ], min: [0, 0, 0], max: [1, 1, 1], translation: [0, 0, 0], pTranslation: [0, 0, 0], currentIndex: -1, ElIconArrowLeft: shallowRef(jr), ElIconArrowRight: shallowRef($r), edited: false, zincObject: void 0 }; }, watch: { boundingDims: { handler: function(n) { const e = n.size; this.min = [ -e[0] / 2, -e[1] / 2, -e[2] / 2 ], this.max = [ e[0] / 2, e[1] / 2, e[2] / 2 ]; }, immediate: true, deep: true } }, methods: { changeIndex: function(n) { n ? this.zincObject.drawRange > this.currentIndex + 1 && (this.currentIndex++, this.reset()) : (this.currentIndex--, this.reset()); }, onMoveSliding: function() { const n = [ this.translation[0] - this.pTranslation[0], this.translation[1] - this.pTranslation[1], this.translation[2] - this.pTranslation[2] ]; this.edited = zz(this.zincObject, this.currentIndex, n) || 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 = false); }, setObject: function(n) { this.currentIndex = -1, n.isPointset ? (this.zincObject = markRaw(n), this.size = this.zincObject.morph.material.size, this.attenuation = this.zincObject.morph.material.sizeAttenuation, n.isEditable && this.zincObject.drawRange > 0 && (this.currentIndex = 0)) : (this.zincObject = void 0, this.size = 10, this.attenuation = false); }, modifyAttenuation: function(n) { this.attenuation = n, this.zincObject.setSizeAttenuation(n); }, modifySize: function() { this.zincObject.setSize(this.size); } } }; function Zz(n, e, t13, i, r, s) { const o = _i2, a = ci2, c = yr2, l = Hi2, d = aa, h6 = oa2, p = sa2, g = vr2, f = Wi2; return openBlock(), createBlock(f, { class: "pointset-container" }, { default: withCtx(() => [ createVNode(g, { class: "slides-block" }, { default: withCtx(() => [ createVNode(l, null, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => [ createTextVNode(" Size: ") ]), _: 1 }), createVNode(o, { offset: 0, span: 10 }, { default: withCtx(() => [ createVNode(a, { modelValue: n.size, "onUpdate:modelValue": e[0] || (e[0] = (u) => n.size = u), class: "my-slider", step: 1, min: 0, max: 100, "show-tooltip": false, onInput: e[1] || (e[1] = (u) => s.modifySize()) }, null, 8, ["modelValue"]) ]), _: 1 }), createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => [ createVNode(c, { modelValue: n.size, "onUpdate:modelValue": e[2] || (e[2] = (u) => n.size = u), step: 1, min: 0, max: 100, controls: false, class: "input-box number-input" }, null, 8, ["modelValue"]) ]), _: 1 }) ]), _: 1 }), createVNode(l, null, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 16 }, { default: withCtx(() => [ createTextVNode(" Size attenuation: ") ]), _: 1 }), createVNode(o, { offset: 0, span: 5 }, { default: withCtx(() => [ createVNode(h6, { teleported: false, "model-value": n.attenuation, placeholder: "Select", class: "input-box", "popper-class": "viewer_dropdown", onChange: e[3] || (e[3] = (u) => s.modifyAttenuation(u, n.slide)) }, { default: withCtx(() => [ (openBlock(true), createElementBlock(Fragment, null, renderList(n.choices, (u) => (openBlock(), createBlock(d, { key: u.value, label: u.label, value: u.value }, null, 8, ["label", "value"]))), 128)) ]), _: 1 }, 8, ["model-value"]) ]), _: 1 }) ]), _: 1 }), n.currentIndex > -1 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ createVNode(l, null, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 4 }, { default: withCtx(() => [ createVNode(p, { size: "small", disabled: n.currentIndex === 0, icon: n.ElIconArrowLeft, onClick: e[4] || (e[4] = (u) => s.changeIndex(false)) }, null, 8, ["disabled", "icon"]) ]), _: 1 }), createVNode(o, { offset: 4, span: 9 }, { default: withCtx(() => [ createTextVNode(" Editing Point " + toDisplayString(n.currentIndex + 1), 1) ]), _: 1 }), createVNode(o, { offset: 2, span: 2 }, { default: withCtx(() => [ createVNode(p, { size: "small", icon: n.ElIconArrowRight, onClick: e[5] || (e[5] = (u) => s.changeIndex(true)) }, null, 8, ["icon"]) ]), _: 1 }) ]), _: 1 }), createVNode(l, null, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => [ createTextVNode(" x: ") ]), _: 1 }), createVNode(o, { offset: 0, span: 16 }, { default: withCtx(() => [ createVNode(a, { modelValue: n.translation[0], "onUpdate:modelValue": e[6] || (e[6] = (u) => n.translation[0] = u), step: 0.01, min: n.min[0], max: n.max[0], "show-tooltip": false, onInput: e[7] || (e[7] = (u) => s.onMoveSliding()), onChange: e[8] || (e[8] = (u) => s.reset()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }) ]), _: 1 }), createVNode(l, null, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => [ createTextVNode(" y: ") ]), _: 1 }), createVNode(o, { offset: 0, span: 16 }, { default: withCtx(() => [ createVNode(a, { modelValue: n.translation[1], "onUpdate:modelValue": e[9] || (e[9] = (u) => n.translation[1] = u), step: 0.01, min: n.min[1], max: n.max[1], "show-tooltip": false, onInput: e[10] || (e[10] = (u) => s.onMoveSliding()), onChange: e[11] || (e[11] = (u) => s.reset()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }) ]), _: 1 }), createVNode(l, null, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => [ createTextVNode(" z: ") ]), _: 1 }), createVNode(o, { offset: 0, span: 16 }, { default: withCtx(() => [ createVNode(a, { modelValue: n.translation[2], "onUpdate:modelValue": e[12] || (e[12] = (u) => n.translation[2] = u), step: 0.01, min: n.min[2], max: n.max[2], "show-tooltip": false, onInput: e[13] || (e[13] = (u) => s.onMoveSliding()), onChange: e[14] || (e[14] = (u) => s.reset()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }) ]), _: 1 }) ], 64)) : createCommentVNode("", true) ]), _: 1 }) ]), _: 1 }); } var Ow2 = wr($z, [["render", Zz], ["__scopeId", "data-v-d1de9c65"]]); var Xz = { name: "TextureSlidesControls", components: { Col: _i2, Container: Wi2, Footer: Ty2, Icon: Bt, InputNumber: yr2, Main: vr2, Row: Hi2, Select: oa2, Slider: ci2, Option: aa, ElIconDelete: Xc2, ElIconPlus: fu2 }, data: function() { return { settings: [], directions: [ { value: "x", label: "x" }, { value: "y", label: "y" }, { value: "z", label: "z" } ], zincObject: void 0 }; }, methods: { setObject: function(n) { n.isTextureSlides ? (this.zincObject = markRaw(n), this.settings = this.zincObject.getTextureSettings()) : (this.zincObject = void 0, this.settings = []); }, addNewSlide: function() { const n = { direction: "x", value: 0 }, e = this.zincObject.createSlide(n); this.settings.push(e); }, modifyDirection: function(n, e) { e && (e.direction = n, this.zincObject.modifySlideSettings(e)); }, modifySlide: function(n) { n && this.zincObject.modifySlideSettings(n); }, removeSlide: function(n, e) { this.zincObject.removeSlideWithId(e.id), this.settings.splice(n, 1); } } }; function Yz(n, e, t13, i, r, s) { const o = aa, a = oa2, c = _i2, l = ci2, d = yr2, h6 = Xc2, p = Bt, g = Hi2, f = vr2, u = fu2, y = Ty2, v = Wi2; return openBlock(), createBlock(v, { class: "t-slides-container" }, { default: withCtx(() => [ createVNode(f, { class: "slides-block" }, { default: withCtx(() => [ (openBlock(true), createElementBlock(Fragment, null, renderList(n.settings, (m, w) => (openBlock(), createBlock(g, { key: m.id, class: "slide-row" }, { default: withCtx(() => [ createVNode(c, { offset: 0, span: 6 }, { default: withCtx(() => [ createVNode(a, { teleported: false, "model-value": m.direction, placeholder: "Select", class: "input-box", "popper-class": "viewer_dropdown", onChange: (S) => s.modifyDirection(S, m) }, { default: withCtx(() => [ (openBlock(true), createElementBlock(Fragment, null, renderList(n.directions, (S) => (openBlock(), createBlock(o, { key: S.value, label: S.label, value: S.value }, null, 8, ["label", "value"]))), 128)) ]), _: 2 }, 1032, ["model-value", "onChange"]) ]), _: 2 }, 1024), createVNode(c, { offset: 0, span: 10 }, { default: withCtx(() => [ createVNode(l, { modelValue: m.value, "onUpdate:modelValue": (S) => m.value = S, class: "my-slider", step: 0.01, min: 0, max: 1, "show-tooltip": false, onInput: (S) => s.modifySlide(m) }, null, 8, ["modelValue", "onUpdate:modelValue", "onInput"]) ]), _: 2 }, 1024), createVNode(c, { offset: 0, span: 6 }, { default: withCtx(() => [ createVNode(d, { modelValue: m.value, "onUpdate:modelValue": (S) => m.value = S, step: 0.01, min: 0, max: 1, controls: false, class: "input-box number-input" }, null, 8, ["modelValue", "onUpdate:modelValue"]) ]), _: 2 }, 1024), createVNode(c, { offset: 0, span: 2 }, { default: withCtx(() => [ createVNode(p, { class: "delete-icon", onClick: (S) => s.removeSlide(w, m) }, { default: withCtx(() => [ createVNode(h6) ]), _: 2 }, 1032, ["onClick"]) ]), _: 2 }, 1024) ]), _: 2 }, 1024))), 128)) ]), _: 1 }), createVNode(y, { height: "30px", class: "add-slides-text", onClick: s.addNewSlide }, { default: withCtx(() => [ createVNode(g, null, { default: withCtx(() => [ createVNode(c, { span: 2 }, { default: withCtx(() => [ createVNode(p, null, { default: withCtx(() => [ createVNode(u) ]), _: 1 }) ]), _: 1 }), createVNode(c, { span: 20 }, { default: withCtx(() => [ createTextVNode(" Add a new slide ") ]), _: 1 }) ]), _: 1 }) ]), _: 1 }, 8, ["onClick"]) ]), _: 1 }); } var Dw2 = wr(Xz, [["render", Yz], ["__scopeId", "data-v-12185b7f"]]); var Jz = { name: "TransformationControls", components: { Col: _i2, Container: Wi2, InputNumber: yr2, Main: vr2, Slider: ci2 }, 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(n) { const e = n.centre, t13 = n.size; this.min = [ e[0] - t13[0], e[1] - t13[1], e[2] - t13[2] ], this.max = [ e[0] + t13[0], e[1] + t13[1], e[2] + t13[2] ]; }, immediate: true, deep: true } }, methods: { setObject: function(n) { if (n.isZincObject) { this.zincObject = markRaw(n); 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 qz(n, e, t13, i, r, s) { const o = _i2, a = ci2, c = yr2, l = Hi2, d = vr2, h6 = Wi2; return openBlock(), createBlock(h6, { class: "transformation-container" }, { default: withCtx(() => [ createVNode(d, { class: "slides-block" }, { default: withCtx(() => [ createVNode(l, { class: "tool-row" }, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => [ createTextVNode(" x: ") ]), _: 1 }), createVNode(o, { offset: 0, span: 10 }, { default: withCtx(() => [ createVNode(a, { modelValue: n.x, "onUpdate:modelValue": e[0] || (e[0] = (p) => n.x = p), step: 0.01, min: n.min[0], max: n.max[0], "show-tooltip": false, onInput: e[1] || (e[1] = (p) => s.modifyPosition()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }), createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => [ createVNode(c, { modelValue: n.x, "onUpdate:modelValue": e[2] || (e[2] = (p) => n.x = p), step: 0.01, min: n.min[0], max: n.max[0], controls: false, class: "input-box number-input", onChange: e[3] || (e[3] = (p) => s.modifyPosition()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }) ]), _: 1 }), createVNode(l, { class: "tool-row" }, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => [ createTextVNode(" y: ") ]), _: 1 }), createVNode(o, { offset: 0, span: 10 }, { default: withCtx(() => [ createVNode(a, { modelValue: n.y, "onUpdate:modelValue": e[4] || (e[4] = (p) => n.y = p), step: 0.01, min: n.min[1], max: n.max[1], "show-tooltip": false, onInput: e[5] || (e[5] = (p) => s.modifyPosition()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }), createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => [ createVNode(c, { modelValue: n.y, "onUpdate:modelValue": e[6] || (e[6] = (p) => n.y = p), step: 0.01, min: n.min[1], max: n.max[1], controls: false, class: "input-box number-input", onChange: e[7] || (e[7] = (p) => s.modifyPosition()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }) ]), _: 1 }), createVNode(l, { class: "tool-row" }, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => [ createTextVNode(" z: ") ]), _: 1 }), createVNode(o, { offset: 0, span: 10 }, { default: withCtx(() => [ createVNode(a, { modelValue: n.z, "onUpdate:modelValue": e[8] || (e[8] = (p) => n.z = p), step: 0.01, min: n.min[2], max: n.max[2], "show-tooltip": false, onInput: e[9] || (e[9] = (p) => s.modifyPosition()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }), createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => [ createVNode(c, { modelValue: n.z, "onUpdate:modelValue": e[10] || (e[10] = (p) => n.z = p), step: 0.01, min: n.min[2], max: n.max[2], controls: false, class: "input-box number-input", onChange: e[11] || (e[11] = (p) => s.modifyPosition()) }, null, 8, ["modelValue", "min", "max"]) ]), _: 1 }) ]), _: 1 }), createVNode(l, { class: "tool-row" }, { default: withCtx(() => [ createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => [ createTextVNode(" Scale: ") ]), _: 1 }), createVNode(o, { offset: 0, span: 10 }, { default: withCtx(() => [ createVNode(a, { modelValue: n.scale, "onUpdate:modelValue": e[12] || (e[12] = (p) => n.scale = p), step: 0.01, min: 0, max: 5, "show-tooltip": false, onInput: e[13] || (e[13] = (p) => s.modifyScale()) }, null, 8, ["modelValue"]) ]), _: 1 }), createVNode(o, { offset: 0, span: 6 }, { default: withCtx(() => [ createVNode(c, { modelValue: n.scale, "onUpdate:modelValue": e[14] || (e[14] = (p) => n.scale = p), step: 0.01, min: 0, max: 5, controls: false, class: "input-box number-input", onChange: e[15] || (e[15] = (p) => s.modifyScale()) }, null, 8, ["modelValue"]) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }); } var Nw2 = wr(Jz, [["render", qz], ["__scopeId", "data-v-6b3997b7"]]); var Kz = { name: "OpacityControls", components: { Container: Wi2, Header: JL2, Main: vr2, Slider: ci2 }, 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(n) { return this.displayString = Math.floor(100 * n + 0.5) + "%", this.displayString; } } }; var Qz = { class: "block" }; var eU = { class: "display" }; function tU(n, e, t13, i, r, s) { const o = ci2, a = Wi2; return t13.material ? (openBlock(), createBlock(a, { key: 0, class: "opacity-container" }, { default: withCtx(() => [ createBaseVNode("div", Qz, [ createBaseVNode("span", eU, toDisplayString(n.displayString), 1), createVNode(o, { modelValue: t13.material.opacity, "onUpdate:modelValue": e[0] || (e[0] = (c) => t13.material.opacity = c), class: "my-slider", step: 0.01, min: 0, max: 1, "format-tooltip": s.formatTooltip, "show-tooltip": false }, null, 8, ["modelValue", "format-tooltip"]) ]) ]), _: 1 })) : createCommentVNode("", true); } var Fw2 = wr(Kz, [["render", tU], ["__scopeId", "data-v-cbfc46a5"]]); var nU = { name: "PrimitiveControls", components: { Collapse: by2, CollapseItem: xy2, LinesControls: Iw2, OpacityControls: Fw2, PointsControls: Ow2, TextureSlidesControls: Dw2, TransformationControls: Nw2, ElIconArrowRight: $r }, props: { createData: { type: Object } }, data: function() { return { activeName: "oControls", material: void 0, isTextureSlides: false, isPointset: false, isLines: false, drawerOpen: true, zincObject: void 0, isEditable: false, displayString: "100%" }; }, methods: { formatTooltip: function(n) { return this.displayString = Math.floor(100 * n + 0.5) + "%", this.displayString; }, toggleDrawer: function() { this.drawerOpen = !this.drawerOpen; }, setObject: function(n) { var e; n ? this.zincObject = markRaw(n) : this.zincObject = void 0, this.isEditable = !!((e = this.zincObject) != null && e.isEditable), this.isPointset = false, this.isTextureSlides = false, this.isLines = false, this.activeName = "trControls", n && (n.isTextureSlides ? (this.isTextureSlides = true, this.$refs.tSlidesControls.setObject(n), this.activeName = "tsControls") : n.isPointset ? (this.isPointset = true, this.$refs.pointsetControls.setObject(n), this.activeName = "pControls") : n.isLines2 && (this.isLines = true, this.$refs.linesControls.setObject(n), this.activeName = "lControls"), n.isTextureSlides || this.$refs.transformationControls.setObject(n)), n && n.getMorph() ? this.material = n.getMorph().material : this.material = void 0; } } }; function iU(n, e, t13, i, r, s) { const o = Fw2, a = xy2, c = Nw2, l = Dw2, d = Ow2, h6 = Iw2, p = by2, g = $r, f = Bt; return withDirectives((openBlock(), createElementBlock("div", { class: normalizeClass(["primitive-controls", { open: n.drawerOpen, close: !n.drawerOpen }]) }, [ createBaseVNode("div", { class: normalizeClass(["my-drawer", { open: n.drawerOpen, close: !n.drawerOpen }]) }, [ createVNode(p, { class: "collapse", modelValue: n.activeName, "onUpdate:modelValue": e[2] || (e[2] = (u) => n.activeName = u), accordion: "" }, { default: withCtx(() => [ withDirectives(createVNode(a, { title: "Opacity", name: "oControls" }, { default: withCtx(() => [ createVNode(o, { material: n.material, zincObject: n.zincObject, ref: "opacityControls" }, null, 8, ["material", "zincObject"]) ]), _: 1 }, 512), [ [vShow, !n.isTextureSlides] ]), withDirectives(createVNode(a, { title: "Transformation", name: "trControls" }, { default: withCtx(() => [ createVNode(c, { class: "transformation-controls", ref: "transformationControls" }, null, 512) ]), _: 1 }, 512), [ [vShow, !n.isEditable] ]), withDirectives(createVNode(a, { title: "Texture Slides", name: "tsControls" }, { default: withCtx(() => [ createVNode(l, { class: "texture-controls", ref: "tSlidesControls" }, null, 512) ]), _: 1 }, 512), [ [vShow, n.isTextureSlides] ]), withDirectives(createVNode(a, { title: "Points", name: "pControls" }, { default: withCtx(() => [ createVNode(d, { class: "pointset-controls", ref: "pointsetControls", onPrimitivesUpdated: e[0] || (e[0] = (u) => n.$emit("primitivesUpdated", u)) }, null, 512) ]), _: 1 }, 512), [ [vShow, n.isPointset] ]), withDirectives(createVNode(a, { title: "Lines", name: "lControls" }, { default: withCtx(() => [ createVNode(h6, { class: "lines-controls", ref: "linesControls", createData: t13.createData, onPrimitivesUpdated: e[1] || (e[1] = (u) => n.$emit("primitivesUpdated", u)) }, null, 8, ["createData"]) ]), _: 1 }, 512), [ [vShow, n.isLines] ]) ]), _: 1 }, 8, ["modelValue"]) ], 2), createBaseVNode("div", { class: normalizeClass(["drawer-button", { open: n.drawerOpen, close: !n.drawerOpen }]), onClick: e[3] || (e[3] = (...u) => s.toggleDrawer && s.toggleDrawer(...u)) }, [ createVNode(f, null, { default: withCtx(() => [ createVNode(g) ]), _: 1 }) ], 2) ], 2)), [ [vShow, n.material || n.isTextureSlides] ]); } var Bw2 = wr(nU, [["render", iU], ["__scopeId", "data-v-764a8efa"]]); var rU = (n, e) => { const t13 = n.label.toUpperCase(), i = e.label.toUpperCase(); return t13 < i ? -1 : t13 > i ? 1 : 0; }; var sU = { name: "ScaffoldTreeControls", components: { ElIconArrowLeft: jr, TreeControls: zF }, props: { /** * Enable/disable colour picker */ showColourPicker: Boolean, isReady: Boolean }, data: function() { return { treeData: [ { label: "Root", regionPath: "", id: void 0, children: [] } ], active: [], hover: [], drawerOpen: true, nodeNumbers: 0, module: void 0 }; }, computed: { treeDataEntry: function() { return this.treeData[0].children; } }, watch: { treeDataEntry: { deep: true, handler: function(n) { this.isReady && this.setColourField(n); } } }, methods: { addTreeItem: function(n, e, t13) { n.some((i) => i.label === e.label) || (Object.assign(e, { activeColour: this.getColour(e) }), n.push(e), n.sort((i, r) => rU(i, r)), this.nodeNumbers++, this.$nextTick(() => { !this.$refs.treeControls.$refs.regionTree.getCheckedKeys().includes(e.id) && t13.getVisibility() && this.$refs.treeControls.$refs.regionTree.setChecked(e.id, true); })); }, // find or create new region, region id is always prefixed with // '__r/' findOrCreateRegion: function(n, e, t13) { if (this.module && this.module.scene && (this.treeData[0].id = this.module.scene.getRootRegion().uuid, this.treeData[0].isRegion = true), e.length > 0) { const i = [...e]; let r = n.children.find( (a) => a.label == i[0] ); const s = t13 + "/" + e[0], o = this.module.scene.getRootRegion().findChildFromPath(s); return r || (r = { label: i[0], id: o.uuid, children: [], regionPath: s, isRegion: true }, this.addTreeItem(n.children, r, o), s === "/_helper" && this.$nextTick(() => { this.$refs.treeControls.$refs.regionTree.setChecked(r.id, false); })), i.shift(), this.findOrCreateRegion(r, i, s); } else return n; }, /** * This is called when a new zinc object is read into the scene. */ zincObjectAdded: function(n) { const e = n.region; if (e) { const t13 = e.getFullSeparatedPath(), i = this.findOrCreateRegion(this.treeData[0], t13, ""); if (n.groupName && i) { i.children || (i.children = []); const r = { label: n.groupName, id: e.uuid + "/" + n.uuid, isPrimitives: true, regionPath: n.region.getFullPath(), isTextureSlides: !!n.isTextureSlides }; this.addTreeItem(i.children, r, n); } } }, zincObjectRemoved: function(n) { const e = n.groupName; if (n.region.findObjectsWithGroupName(e, false).length === 0) { const i = n.region.getFullSeparatedPath(), r = this.findOrCreateRegion(this.treeData[0], i, ""); if (r.children) { for (let s = 0; s < r.children.length; s++) if (r.children[s].label === e) { r.children.splice(s, 1), this.nodeNumbers--; return; } } } }, checkChanged: function(n, e) { const t13 = n.isRegion, i = n.isPrimitives, r = e.checkedKeys.includes(n.id), s = this.module.scene.getRootRegion().findChildFromPath(n.regionPath); t13 && (r ? s.showAllPrimitives() : s.hideAllPrimitives()), i && s.findObjectsWithGroupName(n.label).forEach((a) => { a.setVisibility(r); }); }, updateActiveUI: function(n) { this.active.length = 0, $v2(n, this.active); }, changeActiveByPrimitives: function(n, e) { n && n.length > 0 ? (this.updateActiveUI(n), this.$emit("object-selected", n, e)) : this.removeActive(e), this.removeHover(e); }, updateHoverUI: function(n) { this.hover.length = 0, $v2(n, this.hover); }, changeHoverByPrimitives: function(n, e) { n && n.length > 0 ? (this.updateHoverUI(n), this.$emit("object-hovered", n, e)) : this.removeHover(e); }, /** * Select a region by its name. */ changeActiveByNames: function(n, e, t13) { const i = this.module.scene.getRootRegion(), r = Ao2( i, n, e, true ); this.changeActiveByPrimitives(r, t13); }, /** * Hover a region by its name. */ changeHoverByNames: function(n, e, t13) { const i = this.module.scene.getRootRegion(), r = Ao2( i, n, e, true ); this.changeHoverByPrimitives(r, t13); }, changeActiveByNode: function(n, e) { if (n.isPrimitives || n.isRegion) { const t13 = !!n.isRegion, i = this.getZincObjectsFromNode(n, t13); this.changeActiveByPrimitives(i, e); } }, changeHoverByNode: function(n, e) { if (n.isPrimitives) { const t13 = this.getZincObjectsFromNode(n, false); this.changeHoverByPrimitives(t13, e); } }, /** * Unselect the current selected region. */ removeActive: function(n) { this.active = [], this.$emit("object-selected", [], n); }, /** * Unselect the current hover region. */ removeHover: function(n) { this.hover = [], this.$emit("object-hovered", [], n); }, /** * 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(n) { if (n) { let t13 = this.getZincObjectsFromNode(n, false)[0]; if (t13) { let i = t13.getColourHex(); if (i) return "#" + i; } } return "#FFFFFF"; }, getZincObjectsFromNode: function(n, e) { const t13 = this.module.scene.getRootRegion(); if (n.isPrimitives) return Ao2( t13, n.label, n.regionPath, e ); if (n.isRegion && n.regionPath) { let i = t13.findChildFromPath(n.regionPath); if (i) return i.getAllObjects(e); } return []; }, //Set this right at the beginning. setModule: function(n) { this.module = markRaw(n), this.nodeNumbers = 0, this.module.scene.getRootRegion().getAllObjects(true).forEach((t13) => { this.zincObjectAdded(t13); }), this.module.addOrganPartAddedCallback(this.zincObjectAdded), this.module.addOrganPartRemovedCallback(this.zincObjectRemoved); }, setColourField: function(n, e = void 0) { n.filter((t13) => e && !t13.children ? t13.id === e.id : true).map((t13) => { if (t13.children) this.setColourField(t13.children, e); else { const i = this.getColour(t13); t13.defaultColour || (t13.defaultColour = i), t13.activeColour = i; } }); }, setColour: function(n, e) { n && n.isPrimitives && this.getZincObjectsFromNode(n, false).forEach((i) => { let s = (e || n.defaultColour).replace("#", "0x"); i.setColourHex(s), this.setColourField(this.treeData[0].children, n); }); }, visibilityToggle: function(n, e) { this.module.changeOrganPartsVisibility(n, e), e == false && (this.activeRegion === n && this.removeActive(true), this.hoverRegion === n && this.removeHover(true)); }, 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(n, e, t13, i) { let r = false, s = ""; n.isRegion && (s = `__r${n.regionPath}`), n.isPrimitives && (s = `${n.regionPath}/${n.label}`); const o = e.indexOf(s); o > -1 && (r = true, e.splice(o, 1), t13.push(n.id)); const a = this.module.scene.getRootRegion().findChildFromPath(n.regionPath); s && s !== "__r" && n.isPrimitives && a.findObjectsWithGroupName(n.label).forEach((l) => l.setVisibility(r)), n.children && n.children.forEach((c) => { this.setTreeVisibilityWithFullPaths(c, e, t13, true); }); }, checkAllKeys: function() { const n = [], e = []; Pw2(this.treeData[0], n), this.setTreeVisibilityWithFullPaths( this.treeData[0], n, e, true ), this.$refs.treeControls.$refs.regionTree.setCheckedKeys(e); }, getState: function() { let n = this.$refs.treeControls.$refs.regionTree.getCheckedKeys(); return n.length === this.nodeNumbers ? { checkAll: true, version: "2.0" } : { checkedItems: Vz( this.module.scene.getRootRegion(), n ), version: "2.0" }; }, setState: function(n) { if (n) { if (n.checkAll) this.checkAllKeys(); else if (n.checkedItems) { let e = []; n.version !== "2.0" ? (e = n.checkedItems.map((i) => "/" + i), e.shift("__r/")) : e.push(...n.checkedItems); const t13 = []; this.setTreeVisibilityWithFullPaths( this.treeData[0], e, t13, true ), this.$refs.treeControls.$refs.regionTree.setCheckedKeys(t13); } } } } }; var oU = { class: "traditional-container" }; function aU(n, e, t13, i, r, s) { const o = resolveComponent("TreeControls"), a = jr, c = Bt; return openBlock(), createElementBlock("div", { class: normalizeClass(["tree-controls", { open: n.drawerOpen, close: !n.drawerOpen }]) }, [ createBaseVNode("div", oU, [ createVNode(o, { mapType: "scaffold", title: "Regions", isReady: t13.isReady, treeData: s.treeDataEntry, active: n.active, hover: n.hover, showColourPicker: t13.showColourPicker, onSetColour: s.setColour, onCheckChanged: s.checkChanged, onChangeActive: s.changeActiveByNode, onChangeHover: s.changeHoverByNode, ref: "treeControls" }, null, 8, ["isReady", "treeData", "active", "hover", "showColourPicker", "onSetColour", "onCheckChanged", "onChangeActive", "onChangeHover"]) ]), createBaseVNode("div", { class: normalizeClass(["drawer-button", { open: n.drawerOpen, close: !n.drawerOpen }]), onClick: e[0] || (e[0] = (...l) => s.toggleDrawer && s.toggleDrawer(...l)) }, [ createVNode(c, null, { default: withCtx(() => [ createVNode(a) ]), _: 1 }) ], 2) ], 2); } var zw2 = wr(sU, [["render", aU], ["__scopeId", "data-v-13a8c030"]]); var lU = false; function Ic2(n, e, t13) { return Array.isArray(n) ? (n.length = Math.max(n.length, e), n.splice(e, 1, t13), t13) : (n[e] = t13, t13); } function $h2(n, e) { if (Array.isArray(n)) { n.splice(e, 1); return; } delete n[e]; } var Na2; var ru2 = (n) => Na2 = n; var cU = true ? Symbol("pinia") : ( /* istanbul ignore next */ Symbol() ); function Us2(n) { return n && typeof n == "object" && Object.prototype.toString.call(n) === "[object Object]" && typeof n.toJSON != "function"; } var Wa2; (function(n) { n.direct = "direct", n.patchObject = "patch object", n.patchFunction = "patch function"; })(Wa2 || (Wa2 = {})); var Fa2 = typeof window < "u"; function Uw2(n, e) { for (const t13 in e) { const i = e[t13]; if (!(t13 in n)) continue; const r = n[t13]; Us2(r) && Us2(i) && !isRef(i) && !isReactive(i) ? n[t13] = Uw2(r, i) : n[t13] = i; } return n; } var Vw2 = () => { }; function Jv2(n, e, t13, i = Vw2) { n.push(e); const r = () => { const s = n.indexOf(e); s > -1 && (n.splice(s, 1), i()); }; return !t13 && getCurrentScope() && onScopeDispose(r), r; } function vo(n, ...e) { n.slice().forEach((t13) => { t13(...e); }); } var uU = (n) => n(); var qv2 = Symbol(); var Zh2 = Symbol(); function qd2(n, e) { n instanceof Map && e instanceof Map ? e.forEach((t13, i) => n.set(i, t13)) : n instanceof Set && e instanceof Set && e.forEach(n.add, n); for (const t13 in e) { if (!e.hasOwnProperty(t13)) continue; const i = e[t13], r = n[t13]; Us2(r) && Us2(i) && n.hasOwnProperty(t13) && !isRef(i) && !isReactive(i) ? n[t13] = qd2(r, i) : n[t13] = i; } return n; } var hU = true ? Symbol("pinia:skipHydration") : ( /* istanbul ignore next */ Symbol() ); function dU(n) { return !Us2(n) || !n.hasOwnProperty(hU); } var { assign: ni2 } = Object; function Kv2(n) { return !!(isRef(n) && n.effect); } function Qv2(n, e, t13, i) { const { state: r, actions: s, getters: o } = e, a = t13.state.value[n]; let c; function l() { !a && !i && (t13.state.value[n] = r ? r() : {}); const d = i ? ( // use ref() to unwrap refs inside state TODO: check if this is still necessary toRefs(ref(r ? r() : {}).value) ) : toRefs(t13.state.value[n]); return ni2(d, s, Object.keys(o || {}).reduce((h6, p) => (p in d && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${p}" in store "${n}".`), h6[p] = markRaw(computed(() => { ru2(t13); const g = t13._s.get(n); return o[p].call(g, g); })), h6), {})); } return c = Kd2(n, l, e, t13, i, true), c; } function Kd2(n, e, t13 = {}, i, r, s) { let o; const a = ni2({ actions: {} }, t13); if (!i._e.active) throw new Error("Pinia destroyed"); const c = { deep: true }; !lU && (c.onTrigger = (L) => { l ? g = L : l == false && !x._hotUpdating && (Array.isArray(g) ? g.push(L) : console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.")); }); let l, d, h6 = [], p = [], g; const f = i.state.value[n]; !s && !f && !r && (i.state.value[n] = {}); const u = ref({}); let y; function v(L) { let R; l = d = false, g = [], typeof L == "function" ? (L(i.state.value[n]), R = { type: Wa2.patchFunction, storeId: n, events: g }) : (qd2(i.state.value[n], L), R = { type: Wa2.patchObject, payload: L, storeId: n, events: g }); const C = y = Symbol(); nextTick().then(() => { y === C && (l = true); }), d = true, vo(h6, R, i.state.value[n]); } const m = s ? function() { const { state: R } = t13, C = R ? R() : {}; this.$patch((A) => { ni2(A, C); }); } : ( /* istanbul ignore next */ true ? () => { throw new Error(`🍍: Store "${n}" is built using the setup syntax and does not implement $reset().`); } : Vw2 ); function w() { o.stop(), h6 = [], p = [], i._s.delete(n); } const S = (L, R = "") => { if (qv2 in L) return L[Zh2] = R, L; const C = function() { ru2(i); const A = Array.from(arguments), P = [], I = []; function b(D) { P.push(D); } function O(D) { I.push(D); } vo(p, { args: A, name: C[Zh2], store: x, after: b, onError: O }); let N; try { N = L.apply(this && this.$id === n ? this : x, A); } catch (D) { throw vo(I, D), D; } return N instanceof Promise ? N.then((D) => (vo(P, D), D)).catch((D) => (vo(I, D), Promise.reject(D))) : (vo(P, N), N); }; return C[qv2] = true, C[Zh2] = R, C; }, T = markRaw({ actions: {}, getters: {}, state: [], hotState: u }), M = { _p: i, // _s: scope, $id: n, $onAction: Jv2.bind(null, p), $patch: v, $reset: m, $subscribe(L, R = {}) { const C = Jv2(h6, L, R.detached, () => A()), A = o.run(() => watch(() => i.state.value[n], (P) => { (R.flush === "sync" ? d : l) && L({ storeId: n, type: Wa2.direct, events: g }, P); }, ni2({}, c, R))); return C; }, $dispose: w }, x = reactive(true ? ni2( { _hmrPayload: T, _customProperties: markRaw(/* @__PURE__ */ new Set()) // devtools custom properties }, M // must be added later // setupStore ) : M); i._s.set(n, x); const E = (i._a && i._a.runWithContext || uU)(() => i._e.run(() => (o = effectScope()).run(() => e({ action: S })))); for (const L in E) { const R = E[L]; if (isRef(R) && !Kv2(R) || isReactive(R)) r ? Ic2(u.value, L, toRef(E, L)) : s || (f && dU(R) && (isRef(R) ? R.value = f[L] : qd2(R, f[L])), i.state.value[n][L] = R), T.state.push(L); else if (typeof R == "function") { const C = r ? R : S(R, L); E[L] = C, T.actions[L] = R, a.actions[L] = R; } else Kv2(R) && (T.getters[L] = s ? ( // @ts-expect-error t13.getters[L] ) : R, Fa2 && (E._getters || // @ts-expect-error: same (E._getters = markRaw([]))).push(L)); } if (ni2(x, E), ni2(toRaw(x), E), Object.defineProperty(x, "$state", { get: () => r ? u.value : i.state.value[n], set: (L) => { if (r) throw new Error("cannot set hotState"); v((R) => { ni2(R, L); }); } }), x._hotUpdate = markRaw((L) => { x._hotUpdating = true, L._hmrPayload.state.forEach((R) => { if (R in x.$state) { const C = L.$state[R], A = x.$state[R]; typeof C == "object" && Us2(C) && Us2(A) ? Uw2(C, A) : L.$state[R] = A; } Ic2(x, R, toRef(L.$state, R)); }), Object.keys(x.$state).forEach((R) => { R in L.$state || $h2(x, R); }), l = false, d = false, i.state.value[n] = toRef(L._hmrPayload, "hotState"), d = true, nextTick().then(() => { l = true; }); for (const R in L._hmrPayload.actions) { const C = L[R]; Ic2(x, R, S(C, R)); } for (const R in L._hmrPayload.getters) { const C = L._hmrPayload.getters[R], A = s ? ( // special handling of options api computed(() => (ru2(i), C.call(x, x))) ) : C; Ic2(x, R, A); } Object.keys(x._hmrPayload.getters).forEach((R) => { R in L._hmrPayload.getters || $h2(x, R); }), Object.keys(x._hmrPayload.actions).forEach((R) => { R in L._hmrPayload.actions || $h2(x, R); }), x._hmrPayload = L._hmrPayload, x._getters = L._getters, x._hotUpdating = false; }), Fa2) { const L = { writable: true, configurable: true, // avoid warning on devtools trying to display this property enumerable: false }; ["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((R) => { Object.defineProperty(x, R, ni2({ value: x[R] }, L)); }); } return i._p.forEach((L) => { if (Fa2) { const R = o.run(() => L({ store: x, app: i._a, pinia: i, options: a })); Object.keys(R || {}).forEach((C) => x._customProperties.add(C)), ni2(x, R); } else ni2(x, o.run(() => L({ store: x, app: i._a, pinia: i, options: a }))); }), x.$state && typeof x.$state == "object" && typeof x.$state.constructor == "function" && !x.$state.constructor.toString().includes("[native code]") && console.warn(`[🍍]: The "state" must be a plain object. It cannot be state: () => new MyClass() Found in store "${x.$id}".`), f && s && t13.hydrate && t13.hydrate(x.$state, f), l = true, d = true, x; } function fU(n, e, t13) { let i, r; const s = typeof e == "function"; i = n, r = s ? t13 : e; function o(a, c) { const l = hasInjectionContext(); if (a = // in test mode, ignore the argument provided as we can always retrieve a // pinia instance with getActivePinia() (false ? null : a) || (l ? inject(cU, null) : null), a && ru2(a), !Na2) 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.`); a = Na2, a._s.has(i) || (s ? Kd2(i, e, r, a) : Qv2(i, r, a), o._pinia = a); const d = a._s.get(i); if (c) { const h6 = "__hot:" + i, p = s ? Kd2(h6, e, r, a, true) : Qv2(h6, ni2({}, r), a, true); c._hotUpdate(p), delete a.state.value[h6], a._s.delete(h6); } if (Fa2) { const h6 = getCurrentInstance(); if (h6 && h6.proxy && // avoid adding stores that are just built for hot module replacement !c) { const p = h6.proxy, g = "_pStores" in p ? p._pStores : p._pStores = {}; g[i] = d; } } return d; } return o.$id = i, o; } function kw2(n, e) { return Array.isArray(e) ? e.reduce((t13, i) => (t13[i] = function() { return n(this.$pinia)[i]; }, t13), {}) : Object.keys(e).reduce((t13, i) => (t13[i] = function() { const r = n(this.$pinia), s = e[i]; return typeof s == "function" ? s.call(this, r) : r[s]; }, t13), {}); } var Gw2 = fU("main", { state: () => ({ userProfile: { token: "" } }), getters: { userToken(n) { return n.userProfile.token; } }, actions: { setUserToken(n) { this.userProfile.token = n; } } }); var pU = { name: "ScaffoldTooltip", components: { Col: _i2, CreateTooltipContent: IF, ElIconDelete: Xc2, Icon: Bt, Popover: Mu2, Row: Hi2, Tooltip: RF }, props: { createData: { type: Object, default: { toBeConfirmed: false, points: [], shape: "", x: 0, y: 0 } }, label: { type: String, default: "" }, annotationDisplay: { type: Boolean, default: false }, region: { type: String, default: "" }, visible: { type: Boolean, default: false }, x: { type: Number, default: 200 }, y: { type: Number, default: 200 } }, inject: ["scaffoldUrl"], provide() { return { userApiKey: this.userToken }; }, data: function() { return { display: false, annotationEntry: {}, ElIconDelete: shallowRef(Xc2) }; }, computed: { ...kw2(Gw2, ["userToken"]), position: function() { let n = 40; return this.region && (n = 55), { left: this.x - 40 + "px", top: this.y - n + "px" }; } }, methods: { checkForDisplay: function() { if (this.visible && this.label && this.label !== "") { if (this.display = true, this.annotationDisplay) { const n = this.region ? this.region + "/" : ""; this.annotationEntry = { featureId: n + this.label, resourceId: this.scaffoldUrl, resource: this.scaffoldUrl }; } } else this.display = false, this.annotationEntry = {}; }, hideTriggered: function() { this.$emit("tooltip-hide"); } }, watch: { label: { handler: function() { this.checkForDisplay(); }, immediate: true }, visible: { handler: function() { this.checkForDisplay(); }, immediate: true }, annotationDisplay: { handler: function() { this.checkForDisplay(); }, immediate: true } } }; var mU = { class: "tooltip-text" }; var gU = { key: 0, class: "tooltip-text" }; var vU = { key: 1, class: "delete-container" }; function yU(n, e, t13, i, r, s) { const o = resolveComponent("CreateTooltipContent"), a = resolveComponent("Tooltip"), c = _i2, l = sa2, d = Hi2, h6 = Mu2; return openBlock(), createElementBlock("div", { style: normalizeStyle(s.position), class: "region-tooltip" }, [ createVNode(h6, { ref: "tooltip", visible: t13.visible, placement: "top", "show-arrow": false, teleported: false, trigger: "manual", "popper-class": "tooltip-popper non-selectable", "virtual-triggering": "", onHide: s.hideTriggered }, { default: withCtx(() => [ createBaseVNode("div", mU, toDisplayString(t13.label), 1), t13.region ? (openBlock(), createElementBlock("div", gU, "Region: " + toDisplayString(t13.region), 1)) : createCommentVNode("", true), withDirectives(createVNode(o, { createData: t13.createData, onConfirmCreate: e[0] || (e[0] = (p) => n.$emit("confirm-create", p)), onCancelCreate: e[1] || (e[1] = (p) => n.$emit("cancel-create")) }, null, 8, ["createData"]), [ [vShow, t13.createData.toBeConfirmed] ]), withDirectives(createVNode(a, { class: "p-tooltip", ref: "annotationTooltip", annotationDisplay: true, annotationEntry: n.annotationEntry }, null, 8, ["annotationEntry"]), [ [vShow, t13.annotationDisplay && !t13.createData.toBeConfirmed] ]), t13.createData.toBeDeleted ? (openBlock(), createElementBlock("div", vU, [ createVNode(d, null, { default: withCtx(() => [ createVNode(c, { span: 10 }, { default: withCtx(() => [ createTextVNode("Delete this feature?") ]), _: 1 }), createVNode(c, { span: 7 }, { default: withCtx(() => [ createVNode(l, { class: "delete-button", icon: n.ElIconDelete, onClick: e[2] || (e[2] = (p) => n.$emit("confirm-delete")) }, { default: withCtx(() => [ createTextVNode(" Delete ") ]), _: 1 }, 8, ["icon"]) ]), _: 1 }), createVNode(c, { span: 6 }, { default: withCtx(() => [ createVNode(l, { class: "delete-button", onClick: e[3] || (e[3] = (p) => n.$emit("cancel-create")) }, { default: withCtx(() => [ createTextVNode(" Dismiss ") ]), _: 1 }) ]), _: 1 }) ]), _: 1 }) ])) : createCommentVNode("", true) ]), _: 1 }, 8, ["visible", "onHide"]) ], 4); } var Hw2 = wr(pU, [["render", yU], ["__scopeId", "data-v-e665391a"]]); function Oc(n) { for (var e = 1; e < arguments.length; e++) { var t13 = arguments[e]; for (var i in t13) n[i] = t13[i]; } return n; } var bU = { read: function(n) { return n[0] === '"' && (n = n.slice(1, -1)), n.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent); }, write: function(n) { return encodeURIComponent(n).replace( /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent ); } }; function Qd2(n, e) { function t13(r, s, o) { if (!(typeof document > "u")) { o = Oc({}, e, o), typeof o.expires == "number" && (o.expires = new Date(Date.now() + o.expires * 864e5)), o.expires && (o.expires = o.expires.toUTCString()), r = encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape); var a = ""; for (var c in o) o[c] && (a += "; " + c, o[c] !== true && (a += "=" + o[c].split(";")[0])); return document.cookie = r + "=" + n.write(s, r) + a; } } function i(r) { if (!(typeof document > "u" || arguments.length && !r)) { for (var s = document.cookie ? document.cookie.split("; ") : [], o = {}, a = 0; a < s.length; a++) { var c = s[a].split("="), l = c.slice(1).join("="); try { var d = decodeURIComponent(c[0]); if (o[d] = n.read(l, d), r === d) break; } catch { } } return r ? o[r] : o; } } return Object.create( { set: t13, get: i, remove: function(r, s) { t13( r, "", Oc({}, s, { expires: -1 }) ); }, withAttributes: function(r) { return Qd2(this.converter, Oc({}, this.attributes, r)); }, withConverter: function(r) { return Qd2(Oc({}, this.converter, r), this.attributes); } }, { attributes: { value: Object.freeze(e) }, converter: { value: Object.freeze(n) } } ); } var ef2 = Qd2(bU, { path: "/" }); var Ei2 = function(n, e, t13, i, r) { if (i === "m") throw new TypeError("Private method is not writable"); if (i === "a" && !r) throw new TypeError("Private accessor was defined without a setter"); if (typeof e == "function" ? n !== e || !r : !e.has(n)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return i === "a" ? r.call(n, t13) : r ? r.value = t13 : e.set(n, t13), t13; }; var Ht2 = function(n, e, t13, i) { if (t13 === "a" && !i) throw new TypeError("Private accessor was defined without a getter"); if (typeof e == "function" ? n !== e || !i : !e.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return t13 === "m" ? i : t13 === "a" ? i.call(n) : i ? i.value : e.get(n); }; var Ki2; var ja2; var Ai2; var An2; var Dr2; var xU = 1e4; var wU = class { /** * @param serverEndpoint The URL of a map annotation service. */ constructor(e) { Ki2.add(this), ja2.set(this, void 0), Ai2.set(this, null), An2.set( this, null /** * @param serverEndpoint The URL of a map annotation service. */ ), e.slice(-1) === "/" ? Ei2(this, ja2, e.slice(0, -1), "f") : Ei2(this, ja2, e, "f"); } /** * Get information about the logged-in SPARC user. * * Requires {@linkcode authenticate} to first be called. */ get currentUser() { return Ht2(this, Ai2, "f"); } /** * Get information about any error from the last call * to {@linkcode authenticate}. */ get currentError() { return Ht2(this, An2, "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) { Ei2(this, An2, null, "f"), Ei2(this, Ai2, null, "f"); const t13 = await Ht2(this, Ki2, "m", Dr2).call(this, e, "authenticate"); return "error" in t13 ? (ef2.remove("annotation-key"), Promise.resolve(Ht2(this, An2, "f"))) : (ef2.set("annotation-key", t13.session, { secure: true, expires: 1 }), Ei2(this, Ai2, t13.data, "f"), Promise.resolve(Ht2(this, Ai2, "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) { Ei2(this, An2, null, "f"), Ei2(this, Ai2, null, "f"); const t13 = await Ht2(this, Ki2, "m", Dr2).call(this, e, "unauthenticate"); return "success" in t13 ? Promise.resolve(t13) : Promise.resolve(Ht2(this, An2, "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, t13, i, r) { const s = { resource: t13 }; i !== void 0 && (s.user = i), r !== void 0 && (s.participated = r); const o = await Ht2(this, Ki2, "m", Dr2).call(this, e, "items/", "GET", s); return "error" in o ? Promise.resolve(Ht2(this, An2, "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, t13, i) { const r = { resource: t13 }; i !== void 0 && (r.items = i); const s = await Ht2(this, Ki2, "m", Dr2).call(this, e, "features/", "GET", r); return "error" in s ? Promise.resolve(Ht2(this, An2, "f")) : Promise.resolve(s); } /** * 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, t13, i) { const r = await Ht2(this, Ki2, "m", Dr2).call(this, e, "annotations/", "GET", { resource: t13, item: i }); return "error" in r ? Promise.resolve(Ht2(this, An2, "f")) : Promise.resolve(r); } /** * 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, t13) { const i = await Ht2(this, Ki2, "m", Dr2).call(this, e, "annotation/", "GET", { annotation: t13 }); return "error" in i ? Promise.resolve(Ht2(this, An2, "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, t13) { if (Ht2(this, Ai2, "f") && Ht2(this, Ai2, "f").canUpdate) { const i = Object.assign({ creator: Ht2(this, Ai2, "f"), created: (/* @__PURE__ */ new Date()).toISOString() }, t13), r = await Ht2(this, Ki2, "m", Dr2).call(this, e, "annotation/", "POST", { data: i }); if (!("error" in r)) return Promise.resolve(r); Ei2(this, An2, r, "f"); } else Ei2(this, An2, { error: "user cannot add annotation" }, "f"); return Promise.resolve(Ht2(this, An2, "f")); } }; ja2 = /* @__PURE__ */ new WeakMap(), Ai2 = /* @__PURE__ */ new WeakMap(), An2 = /* @__PURE__ */ new WeakMap(), Ki2 = /* @__PURE__ */ new WeakSet(), Dr2 = async function(e, t13, i = "GET", r = {}) { let s = true; const o = new AbortController(); setTimeout(() => { s && (console.log("Annotation server timeout..."), o.abort()); }, xU); const a = { method: i, signal: o.signal }; let c = `${Ht2(this, ja2, "f")}/${t13}`; const l = ef2.get("annotation-key") || ""; if (i === "GET") { const h6 = []; for (const [p, g] of Object.entries(r)) h6.push(`${p}=${encodeURIComponent(JSON.stringify(g))}`); h6.push(`key=${encodeURIComponent(e)}`), h6.push(`session=${encodeURIComponent(l)}`), c += "?" + h6.join("&"), a.headers = { Accept: "application/json; charset=utf-8", "Cache-Control": "no-store" }; } else if (i === "POST") { const h6 = Object.assign({ key: e, session: l }, r); a.body = JSON.stringify(h6), a.headers = { Accept: "application/json; charset=utf-8", "Content-Type": "application/json; charset=utf-8", "Cache-Control": "no-store" }; } const d = await fetch(c, a); return s = false, d.ok ? Promise.resolve(await d.json()) : (Ei2(this, An2, { error: `${d.status} ${d.statusText}` }, "f"), Promise.resolve(Ht2(this, An2, "f"))); }; var ul2 = { ALL: 0, SELECTED: 1, HIGHLIGHTED: 2, MOVE: 3 }; var MU = function(n, e, t13) { this.eventType = n, this.identifiers = e, this.zincObjects = t13; }; var SU = function(n, e, t13) { this.targetedID = []; const i = n, r = e; this.targetEventType = t13; const s = this; t13 === void 0 && (this.targetEventType = ul2.ALL), this.getEventType = function() { return t13; }, this.notify = function(o, a, c, l) { if (o !== i && (s.targetEventType === ul2.ALL || s.targetEventType === a)) { const d = new MU(a, c, l); r(d); } }; }; var _U = function() { const n = []; this.publish = function(e, t13, i, r) { for (let s = 0; s < n.length; s++) n[s].notify(e, t13, i, r); }, this.subscribe = function(e, t13, i) { if (typeof t13 == "function") { const r = new SU(e, t13, i); return n.push(r), r; } }, this.unsubscribe = function(e) { for (let t13 = 0; t13 < n.length; t13++) if (e === n[t13]) { n.splice(t13, 1); return; } }; }; var e02 = { isWebGLAvailable: function() { try { var n = document.createElement("canvas"); return !!(window.WebGLRenderingContext && (n.getContext("webgl") || n.getContext("experimental-webgl"))); } catch { return false; } }, isWebGL2Available: function() { try { var n = document.createElement("canvas"); return !!(window.WebGL2RenderingContext && n.getContext("webgl2")); } catch { return false; } }, getWebGLErrorMessage: function() { return this.getErrorMessage(1); }, getWebGL2ErrorMessage: function() { return this.getErrorMessage(2); }, getErrorMessage: function(n) { var e = { 1: "WebGL", 2: "WebGL 2" }, t13 = { 1: window.WebGLRenderingContext, 2: window.WebGL2RenderingContext }, i = 'This module requires $1 support but your $0 does not seem to support it.', r = document.createElement("div"); return r.id = "webglmessage", r.style.fontFamily = "monospace", r.style.fontSize = "20px", r.style.fontWeight = "normal", r.style.textAlign = "center", r.style.background = "#fff", r.style.color = "#000", r.style.padding = "1.5em", r.style.width = "400px", r.style.margin = "5em auto 0", t13[n] ? i = i.replace("$0", "graphics card") : i = i.replace("$0", "browser"), i = i.replace("$1", e[n]), r.innerHTML = i, r; } }; var Bp2 = { ALL: 0, DESTROYED: 1, NAME_CHANGED: 2, SETTINGS_CHANGED: 3 }; var ei2 = function() { this.typeName = "Base Module", this.instanceName = "default", this.onChangedCallbacks = [], this.eventNotifiers = []; }; ei2.prototype.setName = function(n) { if (n && this.instanceName !== n) { this.instanceName = n; const e = this.onChangedCallbacks.slice(); for (let t13 = 0; t13 < e.length; t13++) e[t13](this, Bp2.NAME_CHANGED); } }; ei2.prototype.settingsChanged = function() { const n = this.onChangedCallbacks.slice(); for (let e = 0; e < n.length; e++) n[e](this, Bp2.SETTINGS_CHANGED); }; ei2.prototype.exportSettings = function() { const n = {}; return n.dialog = this.typeName, n.name = this.instanceName, n; }; ei2.prototype.importSettings = function(n) { return n.dialog == this.typeName ? (this.setName(n.name), true) : false; }; ei2.prototype.publishChanges = function(n, e, t13) { for (let i = 0; i < this.eventNotifiers.length; i++) this.eventNotifiers[i].publish(this, e, n, t13); }; ei2.prototype.getName = function() { return this.instanceName; }; ei2.prototype.destroy = function() { const n = this.onChangedCallbacks.slice(); for (let e = 0; e < n.length; e++) n[e](this, Bp2.DESTROYED); delete this; }; ei2.prototype.addChangedCallback = function(n) { this.onChangedCallbacks.includes(n) == false && this.onChangedCallbacks.push(n); }; ei2.prototype.removeChangedCallback = function(n) { const e = this.onChangedCallbacks.indexOf(n); e > -1 && this.onChangedCallbacks.splice(e, 1); }; ei2.prototype.addNotifier = function(n) { this.eventNotifiers.push(n); }; var Dc2 = (n, e, t13) => { for (let i = 0; i < n.length; i++) if (n[i] && n[i].material && n[i].material.emissive) { let r = n[i].userData; r && r.isZincObject ? r.setEmissiveRGB(e) : n[i].material && n[i].material.emissive && n[i].material.emissive.setRGB(...e), t13 && n[i].material.depthFunc && (n[i].material.depthFunc = Ur2.THREE.LessEqualDepth), n[i].children.forEach((s) => { const o = s.userData; o && o.isZincObject && s.material && s.material.emissive && s.material.emissive.setRGB(...e); }); } }; var TU = function() { let n = [], e = []; this.highlightColour = [1, 0, 0], this.selectColour = [0, 1, 0], this.originalColour = [0, 0, 0]; const t13 = [], i = [], r = this, s = function(c, l) { if (c.length == 0 && l.length == 0) return false; for (let d = 0; d < c.length; d++) { let h6 = false; for (let p = 0; p < l.length; p++) c[d] === l[p] && (h6 = true); if (!h6) return true; } for (let d = 0; d < l.length; d++) { let h6 = false; for (let p = 0; p < c.length; p++) l[d] === c[p] && (h6 = true); if (!h6) return true; } return false; }, o = function(c, l) { if (t13.length = 0, l.length == 0) return c; for (let d = 0; d < c.length; d++) { let h6 = false; for (let p = 0; p < l.length; p++) c[d] === l[p] && (h6 = true); h6 || t13.push(c[d]); } return t13; }; this.setHighlighted = function(c) { const l = [...n]; r.resetHighlighted(); const d = o(c, e), h6 = a(d); return Dc2(h6, r.highlightColour, false), n = d, s(n, l); }, this.setSelected = function(c) { const l = [...e]; r.resetHighlighted(), r.resetSelected(); const d = a(c); return Dc2(d, r.selectColour, false), e = c, s(e, l); }; const a = 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 = a(n); Dc2(c, r.originalColour, true), n = []; }, this.resetSelected = function() { const c = a(e); Dc2(c, r.originalColour, true), e = []; }, this.getSelected = function() { return e; }, this.reset = function() { r.resetSelected(), r.resetHighlighted(); }; }; var zp2 = Gc2.THREE; var EU = function() { const n = document.createElement("div"); let e; if (n.style.height = "100%", e02.isWebGLAvailable()) e = new Gc2.Renderer(n, window), Gc2.defaultMaterialColor = 16777116, e.initialiseVisualisation(), e.playAnimation = false; else { const t13 = e02.getWebGLErrorMessage(); n.appendChild(t13); } return { Zinc: Gc2, renderer: e, container: n }; }; var $t2 = function() { ei2.call(this), this.scene = void 0, this.rendererContainer = void 0, this.displayArea = void 0, this.graphicsHighlight = new TU(), this.selectObjectOnPick = true, this.zincRenderer = null, this.selectedScreenCoordinates = new zp2.Vector3(), this.selectedCenter = void 0, this.liveUpdatesObjects = void 0, this.ignorePreviousSelected = false; }; $t2.prototype = Object.create(ei2.prototype); $t2.prototype.getIntersectedObject = function(n) { if (n) { const e = n.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 t13 = e.indexOf(1); return t13 = t13 > -1 ? t13 : e.indexOf(2), n[t13]; } }; $t2.prototype.getAnnotationsFromObjects = function(n) { const e = []; for (var t13 = 0; t13 < n.length; t13++) { const i = n[t13].userData; let r; if (i) { if (i.isGlyph || i.isGlyphset) { let s = i; i.isGlyph && (s = i.getGlyphset()), r = s.userData ? s.userData.annotation : void 0, r && r.data && (n[t13].name && n[t13].name != "" ? r.data.id = n[t13].name : r.data.id = s.groupName); } else r = i.userData ? i.userData.annotation : void 0, r && r.data && (r.data.id = n[t13].name); r && (r.data.zincObject = i); } r && e.push(r); } return e; }; $t2.prototype.setHighlightedByObjects = function(n, e, t13, i) { const r = this.graphicsHighlight.setHighlighted(n), s = this.objectsToZincObjects(n); if (i) { let o = ul2.MOVE; r && (o = ul2.HIGHLIGHTED); const a = this.getAnnotationsFromObjects(n); a.length > 0 && (a[0].coords = e, a[0].extraData = t13), this.publishChanges(a, o, s); } return r; }; $t2.prototype.setHighlightedByZincObjects = function(n, e, t13, i) { let r = []; return n && n.forEach((s) => { s && s.getMorph() && r.push(s.getMorph()); }), this.setHighlightedByObjects(r, e, t13, i); }; $t2.prototype.setupLiveCoordinates = function(n) { if (this.liveUpdatesObjects = n, n && n.length > 0) { const e = this.scene.getBoundingBoxOfZincObjects(n); let t13 = new zp2.Vector3(); e ? (e.getCenter(t13), this.selectedCenter == null ? this.selectedCenter = t13 : this.selectedCenter.copy(t13)) : this.selectedCenter = void 0; } else this.selectedCenter = void 0; }; $t2.prototype.objectsToZincObjects = function(n) { const e = []; for (let t13 = 0; t13 < n.length; t13++) { let i = n[t13].userData; if (i) if (i.isGlyph || i.isGlyphset) { let r = i; i.isGlyph && (r = i.getGlyphset()), e.push(r); } else e.push(i); } return e; }; $t2.prototype.setSelectedByObjects = function(n, e, t13, i) { let r = false; if (this.selectObjectOnPick ? r = this.graphicsHighlight.setSelected(n) : r = true, r || this.ignorePreviousSelected) { const s = this.objectsToZincObjects(n); if (this.selectObjectOnPick && this.setupLiveCoordinates(s), i) { const o = ul2.SELECTED, a = this.getAnnotationsFromObjects(n); a.length > 0 && (a[0].coords = e, a[0].extraData = t13), this.publishChanges(a, o, s); } } return r; }; $t2.prototype.setSelectedByZincObjects = function(n, e, t13, i) { let r = []; return n && n.forEach((s) => { if (s) { const o = s.getMorph(); o && r.push(o); } }), this.setSelectedByObjects(r, e, t13, i); }; $t2.prototype.findObjectsByGroupName = function(n) { return this.scene.findObjectsWithGroupName(n); }; $t2.prototype.setHighlightedByGroupName = function(n, e) { const t13 = this.findObjectsByGroupName(n); return this.setHighlightedByObjects(t13, void 0, {}, e); }; $t2.prototype.setSelectedByGroupName = function(n, e) { const t13 = this.findObjectsByGroupName(n); return this.setSelectedByObjects(t13, void 0, {}, e); }; $t2.prototype.changeBackgroundColour = function(n) { const e = new zp2.Color(n); this.zincRenderer && this.zincRenderer.getThreeJSRenderer().setClearColor(e, 1); }; $t2.prototype.resetView = function() { this.zincRenderer && this.zincRenderer.resetView(); }; $t2.prototype.viewAll = function() { this.zincRenderer && this.zincRenderer.viewAll(); }; $t2.prototype.playAnimation = function(n) { this.zincRenderer && (this.zincRenderer.playAnimation = n); }; $t2.prototype.setPlayRate = function(n) { this.zincRenderer && this.zincRenderer.setPlayRate(n); }; $t2.prototype.getPlayRate = function(n) { return this.zincRenderer ? this.zincRenderer.getPlayRate() : 0; }; $t2.prototype.initialiseRenderer = function(n) { if (this.zincRenderer === void 0 || this.rendererContainer === void 0) { let e = EU(); this.Zinc = e.Zinc, this.zincRenderer = e.renderer, this.rendererContainer = e.container; } n && (this.displayArea = n, this.displayArea.appendChild(this.rendererContainer), this.zincRenderer && this.zincRenderer.animate()); }; $t2.prototype.destroy = function() { this.zincRenderer && (this.zincRenderer.dispose(), this.zincRenderer.getThreeJSRenderer().dispose(), this.zincRenderer = void 0), ei2.prototype.destroy.call(this); }; var AU = function() { this.type = "anatomical", this.data = void 0, this.isAnnotation = true; }; var CU = function() { this.currentName = "", this.currentSystem = "", this.currentPart = "", this.currentSpecies = "", this.metaURL = "", this.viewURL = "", this.timeVarying = false, this.currentTime = 0; }; var Ww2 = function(n) { $t2.call(this); const e = this; let t13; this.sceneData = new CU(); const i = new Array(), r = new Array(), s = new Array(), o = new Array(); let a; const c = n; this.NDCCameraControl = void 0, e.typeName = "Organ Viewer", this.getSceneData = function() { return e.sceneData; }, this.updateTime = function(_) { let E = 6e3; e.scene && (E = e.scene.getDuration()); const L = _ / 100 * E; e.sceneData.nerveMapIsActive || e.scene && e.scene.setMorphsTime(L), e.sceneData.currentTime = _; }; const l = function() { let _ = 3e3; e.scene && (_ = e.scene.getDuration()); const E = e.zincRenderer.getCurrentTime(); for (let L = 0; L < i.length; L++) i[L](E); !e.sceneData.nerveMapIsActive && t13 && t13.setMorphsTime(E), e.sceneData.nerveMap && e.sceneData.nerveMap.additionalReader && e.sceneData.nerveMap.additionalReader.setTime(E / _), e.sceneData.currentTime = E / _ * 100; }; this.getCurrentTime = function() { return e.sceneData.currentTime; }, this.toggleSyncControl = (_, E) => { let L = this.scene.getZincCameraControls(); _ ? (L.resetView(), this.NDCCameraControl = L.enableSyncControl(), L.setRotationMode(E)) : (L.disableSyncControl(), this.NDCCameraControl = void 0, L.setRotationMode("free")); }, this.isSyncControl = () => this.NDCCameraControl !== void 0, this.setSyncControlZoomToBox = (_) => { this.NDCCameraControl && this.NDCCameraControl.zoomToBox(_, 2); }, this.setSyncControlCallback = (_) => { this.NDCCameraControl && this.NDCCameraControl.setEventCallback(_); }, this.setSyncControlCenterZoom = (_, E) => { this.NDCCameraControl && this.NDCCameraControl.setCenterZoom(_, E); }; const d = function() { if (e.zincRenderer.playAnimation && e.liveUpdatesObjects && e.setupLiveCoordinates(e.liveUpdatesObjects), e.selectedCenter) { const _ = new Ur2.THREE.Vector3(); _.copy(e.selectedCenter); const E = e.scene.vectorToScreenXY(_); e.selectedScreenCoordinates.x = E.x, e.selectedScreenCoordinates.y = E.y; } }, h6 = function() { return function() { l(); }; }, p = function() { return function() { d(); }; }; this.addTimeChangedCallback = function(_) { i.push(_); }, this.setTexturePos = function(_) { e.sceneData.nerveMap && e.sceneData.nerveMap.additionalReader && e.sceneData.nerveMap.additionalReader.setSliderPos(_); }, this.addSceneChangedCallback = function(_) { r.push(_); }, this.addOrganPartAddedCallback = function(_) { s.push(_); }, this.addOrganPartRemovedCallback = function(_) { o.push(_); }, this.setFinishDownloadCallback = function(_) { a = _; }, this.unsetFinishDownloadCallback = function() { a = void 0; }, this.getNamedObjectsToScreenCoordinates = function(_, E) { const L = new Ur2.THREE.Vector3(); L.setFromMatrixPosition(obj.matrixWorld); const R = width / 2, C = height / 2; return L.project(E), L.x = L.x * R + R, L.y = -(L.y * C) + C, L; }; const g = function(_) { let E, L; if (_ !== void 0) { let R = false; _.object.userData && _.object.userData.isMarker ? (R = true, L = _.object.userData.parent.getMorph()) : L = _.object; try { L.userData.userData.annotation.data.lastActionOnMarker = R; } finally { } if (L) if (L.name) E = L.name; else { const C = e.getAnnotationsFromObjects( [L] ); C && C[0] && (E = C[0].data.group); } } return { id: E, object: L }; }, f = function() { return function(_, E, L) { var I; const R = e.getIntersectedObject(_), C = g(R), A = { worldCoords: [ R ? R.point.x : 0, R ? R.point.y : 0, R ? R.point.z : 0 ], intersected: R, intersects: _ }, P = { x: E, y: L }; if (C.id) { A.threeID = (I = C.object) == null ? void 0 : I.id, C.object.userData.isGlyph ? C.object.name ? e.setSelectedByObjects( [C.object], P, A, true ) : e.setSelectedByZincObjects( C.object.userData.getGlyphset(), P, A, true ) : e.setSelectedByObjects([C.object], P, A, true); return; } else e.setSelectedByObjects([], P, A, true); }; }, u = function() { return function(_, E, L) { var I; const R = e.getIntersectedObject(_), C = g(R), A = { worldCoords: [ R ? R.point.x : 0, R ? R.point.y : 0, R ? R.point.z : 0 ] }, P = { x: E, y: L }; if (C.id) { A.threeID = (I = C.object) == null ? void 0 : I.id, e.displayArea.style.cursor = "pointer", e.setHighlightedByObjects([C.object], P, A, true); return; } else e.displayArea.style.cursor = "auto", e.setHighlightedByObjects([], P, A, true); }; }, y = function(_, E, L, R) { if (R == "all" || R == "geometries") { const C = _.findGeometriesWithGroupName(E); for (let A = 0; A < C.length; A++) C[A].setVisibility(L); } if (R == "all" || R == "glyphsets") { const C = _.findGlyphsetsWithGroupName(E); for (let A = 0; A < C.length; A++) C[A].setVisibility(L); } if (R == "all" || R == "pointsets") { const C = _.findPointsetsWithGroupName(E); for (let A = 0; A < C.length; A++) C[A].setVisibility(L); } if (R == "all" || R == "lines") { const C = _.findLinesWithGroupName(E); for (let A = 0; A < C.length; A++) C[A].setVisibility(L); } }; this.changeGeometriesVisibility = function(_, E) { y(e.scene, _, E, "geometries"); }, this.changeGlyphsetsVisibility = function(_, E) { y(e.scene, _, E, "glyphsets"); }, this.changeLinesVisibility = function(_, E) { y(e.scene, _, E, "lines"); }, this.changePointsetsVisibility = function(_, E) { y(e.scene, _, E, "pointsets"); }, this.changeOrganPartsVisibility = function(_, E, L) { let R = "all"; L !== void 0 && (R = L), y(e.scene, _, E, R); }, this.changeOrganPartsVisibilityCallback = function(_) { return function(E) { e.changeOrganPartsVisibility(_, E); }; }, this.changeBackgroundColour = function(_) { const E = new Ur2.THREE.Color(_); e.zincRenderer && e.zincRenderer.getThreeJSRenderer().setClearColor(E, 1); }; const v = function(_, E, L, R) { for (let P = 0; P < s.length; P++) s[P](R, e.scene.isTimeVarying()); const C = new AU(), A = R.region.getFullPath(); C.data = { species: e.sceneData.currentSpecies, system: _, part: E, group: R.groupName, region: A, uuid: R.uuid, lastActionOnMarker: false }, R.userData.annotation = C; }, m = function(_, E, L, R) { for (let C = 0; C < o.length; C++) o[C](R); }, w = function(_, E, L) { return function(R) { v(_, E, L, R); }; }, S = function(_, E, L) { return function(R) { m(_, E, L, R); }; }, T = function() { return function() { e.settingsChanged(), e.sceneData.timeVarying = e.scene.isTimeVarying(), a && a(); }; }; this.updateFieldvisibility = function(_, E) { for (let L = 0; L < _.length; L++) if (E != L) { const R = _[L].PartName; e.changeOrganPartsVisibility(R, false); } if (E > -1) { const L = _[E].PartName; if (e.scene.findGeometriesWithGroupName(L).length > 0 || e.scene.findGlyphsetsWithGroupName(L).length > 0) e.changeOrganPartsVisibility(L, true); else { const R = getOrganDetails(_[E].SystemName, L); R != null && e.scene.loadMetadataURL(c.getOrgansDirectoryPrefix() + "/" + R.meta); } } }, this.getAvailableSpecies = function(_, E, L) { const R = new Array(); R.push("none"); const C = Object.keys(organsFileMap); for (index in C) { const A = C[index]; A != _ && organsFileMap[A].hasOwnProperty(E) && organsFileMap[A][E].hasOwnProperty(L) && R.push(A); } return R; }, this.getCentreAndSize = function() { const _ = new Ur2.THREE.Vector3(), E = this.scene.getBoundingBox(); E.getCenter(_); const L = [_.x, _.y, _.z]; E.getSize(_); const R = [_.x, _.y, _.z]; return { centre: L, size: R }; }; const M = function(_, E, L, R) { e.sceneData.nerveMapIsActive = false, e.sceneData.nerveMap = void 0, e.sceneData.metaURL = "", e.sceneData.viewURL = "", e.sceneData.currentSpecies = _, e.sceneData.currentSystem = E, e.sceneData.currentPart = L, e.sceneData.currentTime = 0, e.sceneData.timeVarying = false; let C = ""; _ && (C = _ + "/"), E && (C = E + "/"), L && (C = L), e.sceneData.currentName = C; }; this.loadOrgansFromURL = function(_, E, L, R, C, A) { if (e.zincRenderer && R && e.sceneData.metaURL !== _) { M(E, L, R); const P = e.sceneData.currentName; let I = e.zincRenderer.getSceneByName(P); I ? A && I.clearAll() : I = e.zincRenderer.createScene(P), e.selectObjectOnPick = true; for (let O = 0; O < r.length; O++) r[O](e.sceneData); C && C != "" ? (e.sceneData.viewURL = C, I.loadViewURL(e.sceneData.viewURL)) : e.sceneData.viewURL = void 0, e.sceneData.metaURL = _, I.addZincObjectAddedCallbacks(w(L, R, false)), I.addZincObjectRemovedCallbacks(S(void 0, R, false)), I.loadMetadataURL(_, void 0, T()), e.scene = I, e.zincRenderer.setCurrentScene(I), e.graphicsHighlight.reset(); const b = I.getZincCameraControls(); b.enableRaycaster(I, f(), u()), b.setMouseButtonAction("AUXILIARY", "ZOOM"), b.setMouseButtonAction("SECONDARY", "PAN"); } }, this.loadGLTFFromURL = function(_, E, L) { if (e.zincRenderer && E && e.sceneData.metaURL !== _) { M(void 0, void 0, E); const R = e.sceneData.currentName; let C = e.zincRenderer.getSceneByName(R); C ? L && C.clearAll() : C = e.zincRenderer.createScene(R); for (let P = 0; P < r.length; P++) r[P](e.sceneData); e.sceneData.viewURL = void 0, e.sceneData.metaURL = _, C.addZincObjectAddedCallbacks(w(void 0, E, false)), C.addZincObjectRemovedCallbacks(S(void 0, E, false)), C.loadGLTF(_, void 0, T()), e.scene = C, e.zincRenderer.setCurrentScene(C), e.graphicsHighlight.reset(); const A = C.getZincCameraControls(); A.enableRaycaster(C, f(), u()), A.setMouseButtonAction("AUXILIARY", "ZOOM"), A.setMouseButtonAction("SECONDARY", "PAN"); } }, this.alignCameraWithSelectedObject = function(_) { const E = e.graphicsHighlight.getSelected(); E && E[0] && E[0].userData && e.scene.alignObjectToCameraView(E[0].userData, _); }, this.exportSettings = function() { const _ = {}; return _.name = e.instanceName, e.sceneData.currentSystem && (_.system = e.sceneData.currentSystem), e.sceneData.currentSpecies && (_.species = e.sceneData.currentSpecies), e.sceneData.currentPart && (_.part = e.sceneData.currentPart), _.metaURL = e.sceneData.metaURL, e.sceneData.viewURL && (_.viewURL = e.sceneData.viewURL), _.dialog = "Organ Viewer", _; }, this.importSettings = function(_) { return _ && _.dialog == this.typeName ? (e.setName(_.name), _.metaURL !== void 0 && _.metaURL != "" ? e.loadOrgansFromURL( _.metaURL, _.species, _.system, _.part, _.viewURL, true ) : e.loadOrgans(_.species, _.system, _.part), true) : false; }, function() { e.initialiseRenderer(void 0), e.zincRenderer && (e.zincRenderer.addPreRenderCallbackFunction(h6()), e.zincRenderer.addPostRenderCallbackFunction(p())); }(); }; Ww2.prototype = Object.create($t2.prototype); var Ct = function() { return Ct = Object.assign || function(e) { for (var t13, i = 1, r = arguments.length; i < r; i++) { t13 = arguments[i]; for (var s in t13) Object.prototype.hasOwnProperty.call(t13, s) && (e[s] = t13[s]); } return e; }, Ct.apply(this, arguments); }; function LU(n, e, t13, i) { function r(s) { return s instanceof t13 ? s : new t13(function(o) { o(s); }); } return new (t13 || (t13 = Promise))(function(s, o) { function a(d) { try { l(i.next(d)); } catch (h6) { o(h6); } } function c(d) { try { l(i.throw(d)); } catch (h6) { o(h6); } } function l(d) { d.done ? s(d.value) : r(d.value).then(a, c); } l((i = i.apply(n, [])).next()); }); } function RU(n, e) { var t13 = { label: 0, sent: function() { if (s[0] & 1) throw s[1]; return s[1]; }, trys: [], ops: [] }, i, r, s, o; return o = { next: a(0), throw: a(1), return: a(2) }, typeof Symbol == "function" && (o[Symbol.iterator] = function() { return this; }), o; function a(l) { return function(d) { return c([l, d]); }; } function c(l) { if (i) throw new TypeError("Generator is already executing."); for (; o && (o = 0, l[0] && (t13 = 0)), t13; ) try { if (i = 1, r && (s = l[0] & 2 ? r.return : l[0] ? r.throw || ((s = r.return) && s.call(r), 0) : r.next) && !(s = s.call(r, l[1])).done) return s; switch (r = 0, s && (l = [l[0] & 2, s.value]), l[0]) { case 0: case 1: s = l; break; case 4: return t13.label++, { value: l[1], done: false }; case 5: t13.label++, r = l[1], l = [0]; continue; case 7: l = t13.ops.pop(), t13.trys.pop(); continue; default: if (s = t13.trys, !(s = s.length > 0 && s[s.length - 1]) && (l[0] === 6 || l[0] === 2)) { t13 = 0; continue; } if (l[0] === 3 && (!s || l[1] > s[0] && l[1] < s[3])) { t13.label = l[1]; break; } if (l[0] === 6 && t13.label < s[1]) { t13.label = s[1], s = l; break; } if (s && t13.label < s[2]) { t13.label = s[2], t13.ops.push(l); break; } s[2] && t13.ops.pop(), t13.trys.pop(); continue; } l = e.call(n, t13); } catch (d) { l = [6, d], r = 0; } finally { i = s = 0; } if (l[0] & 5) throw l[1]; return { value: l[0] ? l[1] : void 0, done: true }; } } function st2(n) { var e = typeof Symbol == "function" && Symbol.iterator, t13 = e && n[e], i = 0; if (t13) return t13.call(n); if (n && typeof n.length == "number") return { next: function() { return n && i >= n.length && (n = void 0), { value: n && n[i++], done: !n }; } }; throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined."); } function Jt(n, e) { var t13 = typeof Symbol == "function" && n[Symbol.iterator]; if (!t13) return n; var i = t13.call(n), r, s = [], o; try { for (; (e === void 0 || e-- > 0) && !(r = i.next()).done; ) s.push(r.value); } catch (a) { o = { error: a }; } finally { try { r && !r.done && (t13 = i.return) && t13.call(i); } finally { if (o) throw o.error; } } return s; } var PU = "ENTRIES"; var jw2 = "KEYS"; var $w2 = "VALUES"; var bn2 = ""; var Xh2 = ( /** @class */ function() { function n(e, t13) { var i = e._tree, r = Array.from(i.keys()); this.set = e, this._type = t13, this._path = r.length > 0 ? [{ node: i, keys: r }] : []; } return n.prototype.next = function() { var e = this.dive(); return this.backtrack(), e; }, n.prototype.dive = function() { if (this._path.length === 0) return { done: true, value: void 0 }; var e = yo2(this._path), t13 = e.node, i = e.keys; if (yo2(i) === bn2) return { done: false, value: this.result() }; var r = t13.get(yo2(i)); return this._path.push({ node: r, keys: Array.from(r.keys()) }), this.dive(); }, n.prototype.backtrack = function() { if (this._path.length !== 0) { var e = yo2(this._path).keys; e.pop(), !(e.length > 0) && (this._path.pop(), this.backtrack()); } }, n.prototype.key = function() { return this.set._prefix + this._path.map(function(e) { var t13 = e.keys; return yo2(t13); }).filter(function(e) { return e !== bn2; }).join(""); }, n.prototype.value = function() { return yo2(this._path).node.get(bn2); }, n.prototype.result = function() { switch (this._type) { case $w2: return this.value(); case jw2: return this.key(); default: return [this.key(), this.value()]; } }, n.prototype[Symbol.iterator] = function() { return this; }, n; }() ); var yo2 = function(n) { return n[n.length - 1]; }; var IU = function(n, e, t13) { var i = /* @__PURE__ */ new Map(); if (e === void 0) return i; for (var r = e.length + 1, s = r + t13, o = new Uint8Array(s * r).fill(t13 + 1), a = 0; a < r; ++a) o[a] = a; for (var c = 1; c < s; ++c) o[c * r] = c; return Zw2(n, e, t13, i, o, 1, r, ""), i; }; var Zw2 = function(n, e, t13, i, r, s, o, a) { var c, l, d = s * o; try { e: for (var h6 = st2(n.keys()), p = h6.next(); !p.done; p = h6.next()) { var g = p.value; if (g === bn2) { var f = r[d - 1]; f <= t13 && i.set(a, [n.get(g), f]); } else { for (var u = s, y = 0; y < g.length; ++y, ++u) { for (var v = g[y], m = o * u, w = m - o, S = r[m], T = Math.max(0, u - t13 - 1), M = Math.min(o - 1, u + t13), x = T; x < M; ++x) { var _ = v !== e[x], E = r[w + x] + +_, L = r[w + x + 1] + 1, R = r[m + x] + 1, C = r[m + x + 1] = Math.min(E, L, R); C < S && (S = C); } if (S > t13) continue e; } Zw2(n.get(g), e, t13, i, r, u, o, a + g); } } } catch (A) { c = { error: A }; } finally { try { p && !p.done && (l = h6.return) && l.call(h6); } finally { if (c) throw c.error; } } }; var Yh2 = ( /** @class */ function() { function n(e, t13) { e === void 0 && (e = /* @__PURE__ */ new Map()), t13 === void 0 && (t13 = ""), this._size = void 0, this._tree = e, this._prefix = t13; } return n.prototype.atPrefix = function(e) { var t13, i; if (!e.startsWith(this._prefix)) throw new Error("Mismatched prefix"); var r = Jt(su2(this._tree, e.slice(this._prefix.length)), 2), s = r[0], o = r[1]; if (s === void 0) { var a = Jt(Up2(o), 2), c = a[0], l = a[1]; try { for (var d = st2(c.keys()), h6 = d.next(); !h6.done; h6 = d.next()) { var p = h6.value; if (p !== bn2 && p.startsWith(l)) { var g = /* @__PURE__ */ new Map(); return g.set(p.slice(l.length), c.get(p)), new n(g, e); } } } catch (f) { t13 = { error: f }; } finally { try { h6 && !h6.done && (i = d.return) && i.call(d); } finally { if (t13) throw t13.error; } } } return new n(s, e); }, n.prototype.clear = function() { this._size = void 0, this._tree.clear(); }, n.prototype.delete = function(e) { return this._size = void 0, OU(this._tree, e); }, n.prototype.entries = function() { return new Xh2(this, PU); }, n.prototype.forEach = function(e) { var t13, i; try { for (var r = st2(this), s = r.next(); !s.done; s = r.next()) { var o = Jt(s.value, 2), a = o[0], c = o[1]; e(a, c, this); } } catch (l) { t13 = { error: l }; } finally { try { s && !s.done && (i = r.return) && i.call(r); } finally { if (t13) throw t13.error; } } }, n.prototype.fuzzyGet = function(e, t13) { return IU(this._tree, e, t13); }, n.prototype.get = function(e) { var t13 = tf2(this._tree, e); return t13 !== void 0 ? t13.get(bn2) : void 0; }, n.prototype.has = function(e) { var t13 = tf2(this._tree, e); return t13 !== void 0 && t13.has(bn2); }, n.prototype.keys = function() { return new Xh2(this, jw2); }, n.prototype.set = function(e, t13) { if (typeof e != "string") throw new Error("key must be a string"); this._size = void 0; var i = Jh2(this._tree, e); return i.set(bn2, t13), this; }, Object.defineProperty(n.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: false, configurable: true }), n.prototype.update = function(e, t13) { if (typeof e != "string") throw new Error("key must be a string"); this._size = void 0; var i = Jh2(this._tree, e); return i.set(bn2, t13(i.get(bn2))), this; }, n.prototype.fetch = function(e, t13) { if (typeof e != "string") throw new Error("key must be a string"); this._size = void 0; var i = Jh2(this._tree, e), r = i.get(bn2); return r === void 0 && i.set(bn2, r = t13()), r; }, n.prototype.values = function() { return new Xh2(this, $w2); }, n.prototype[Symbol.iterator] = function() { return this.entries(); }, n.from = function(e) { var t13, i, r = new n(); try { for (var s = st2(e), o = s.next(); !o.done; o = s.next()) { var a = Jt(o.value, 2), c = a[0], l = a[1]; r.set(c, l); } } catch (d) { t13 = { error: d }; } finally { try { o && !o.done && (i = s.return) && i.call(s); } finally { if (t13) throw t13.error; } } return r; }, n.fromObject = function(e) { return n.from(Object.entries(e)); }, n; }() ); var su2 = function(n, e, t13) { var i, r; if (t13 === void 0 && (t13 = []), e.length === 0 || n == null) return [n, t13]; try { for (var s = st2(n.keys()), o = s.next(); !o.done; o = s.next()) { var a = o.value; if (a !== bn2 && e.startsWith(a)) return t13.push([n, a]), su2(n.get(a), e.slice(a.length), t13); } } catch (c) { i = { error: c }; } finally { try { o && !o.done && (r = s.return) && r.call(s); } finally { if (i) throw i.error; } } return t13.push([n, e]), su2(void 0, "", t13); }; var tf2 = function(n, e) { var t13, i; if (e.length === 0 || n == null) return n; try { for (var r = st2(n.keys()), s = r.next(); !s.done; s = r.next()) { var o = s.value; if (o !== bn2 && e.startsWith(o)) return tf2(n.get(o), e.slice(o.length)); } } catch (a) { t13 = { error: a }; } finally { try { s && !s.done && (i = r.return) && i.call(r); } finally { if (t13) throw t13.error; } } }; var Jh2 = function(n, e) { var t13, i, r = e.length; e: for (var s = 0; n && s < r; ) { try { for (var o = (t13 = void 0, st2(n.keys())), a = o.next(); !a.done; a = o.next()) { var c = a.value; if (c !== bn2 && e[s] === c[0]) { for (var l = Math.min(r - s, c.length), d = 1; d < l && e[s + d] === c[d]; ) ++d; var h6 = n.get(c); if (d === c.length) n = h6; else { var p = /* @__PURE__ */ new Map(); p.set(c.slice(d), h6), n.set(e.slice(s, s + d), p), n.delete(c), n = p; } s += d; continue e; } } } catch (f) { t13 = { error: f }; } finally { try { a && !a.done && (i = o.return) && i.call(o); } finally { if (t13) throw t13.error; } } var g = /* @__PURE__ */ new Map(); return n.set(e.slice(s), g), g; } return n; }; var OU = function(n, e) { var t13 = Jt(su2(n, e), 2), i = t13[0], r = t13[1]; if (i !== void 0) { if (i.delete(bn2), i.size === 0) Xw2(r); else if (i.size === 1) { var s = Jt(i.entries().next().value, 2), o = s[0], a = s[1]; Yw2(r, o, a); } } }; var Xw2 = function(n) { if (n.length !== 0) { var e = Jt(Up2(n), 2), t13 = e[0], i = e[1]; if (t13.delete(i), t13.size === 0) Xw2(n.slice(0, -1)); else if (t13.size === 1) { var r = Jt(t13.entries().next().value, 2), s = r[0], o = r[1]; s !== bn2 && Yw2(n.slice(0, -1), s, o); } } }; var Yw2 = function(n, e, t13) { if (n.length !== 0) { var i = Jt(Up2(n), 2), r = i[0], s = i[1]; r.set(s + e, t13), r.delete(s); } }; var Up2 = function(n) { return n[n.length - 1]; }; var Oa; var Vp2 = "or"; var Jw2 = "and"; var DU = "and_not"; var NU = ( /** @class */ function() { function n(e) { if ((e == null ? void 0 : e.fields) == null) throw new Error('MiniSearch: option "fields" must be provided'); var t13 = e.autoVacuum == null || e.autoVacuum === true ? Qh2 : e.autoVacuum; this._options = Ct(Ct(Ct({}, Kh2), e), { autoVacuum: t13, searchOptions: Ct(Ct({}, t02), e.searchOptions || {}), autoSuggestOptions: Ct(Ct({}, VU), e.autoSuggestOptions || {}) }), this._index = new Yh2(), 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 = rf2, this.addFields(this._options.fields); } return n.prototype.add = function(e) { var t13, i, r, s, o, a, c = this._options, l = c.extractField, d = c.tokenize, h6 = c.processTerm, p = c.fields, g = c.idField, f = l(e, g); if (f == null) throw new Error('MiniSearch: document does not have ID field "'.concat(g, '"')); if (this._idToShortId.has(f)) throw new Error("MiniSearch: duplicate ID ".concat(f)); var u = this.addDocumentId(f); this.saveStoredFields(u, e); try { for (var y = st2(p), v = y.next(); !v.done; v = y.next()) { var m = v.value, w = l(e, m); if (w != null) { var S = d(w.toString(), m), T = this._fieldIds[m], M = new Set(S).size; this.addFieldLength(u, T, this._documentCount - 1, M); try { for (var x = (r = void 0, st2(S)), _ = x.next(); !_.done; _ = x.next()) { var E = _.value, L = h6(E, m); if (Array.isArray(L)) try { for (var R = (o = void 0, st2(L)), C = R.next(); !C.done; C = R.next()) { var A = C.value; this.addTerm(T, u, A); } } catch (P) { o = { error: P }; } finally { try { C && !C.done && (a = R.return) && a.call(R); } finally { if (o) throw o.error; } } else L && this.addTerm(T, u, L); } } catch (P) { r = { error: P }; } finally { try { _ && !_.done && (s = x.return) && s.call(x); } finally { if (r) throw r.error; } } } } } catch (P) { t13 = { error: P }; } finally { try { v && !v.done && (i = y.return) && i.call(y); } finally { if (t13) throw t13.error; } } }, n.prototype.addAll = function(e) { var t13, i; try { for (var r = st2(e), s = r.next(); !s.done; s = r.next()) { var o = s.value; this.add(o); } } catch (a) { t13 = { error: a }; } finally { try { s && !s.done && (i = r.return) && i.call(r); } finally { if (t13) throw t13.error; } } }, n.prototype.addAllAsync = function(e, t13) { var i = this; t13 === void 0 && (t13 = {}); var r = t13.chunkSize, s = r === void 0 ? 10 : r, o = { chunk: [], promise: Promise.resolve() }, a = e.reduce(function(d, h6, p) { var g = d.chunk, f = d.promise; return g.push(h6), (p + 1) % s === 0 ? { chunk: [], promise: f.then(function() { return new Promise(function(u) { return setTimeout(u, 0); }); }).then(function() { return i.addAll(g); }) } : { chunk: g, promise: f }; }, o), c = a.chunk, l = a.promise; return l.then(function() { return i.addAll(c); }); }, n.prototype.remove = function(e) { var t13, i, r, s, o, a, c = this._options, l = c.tokenize, d = c.processTerm, h6 = c.extractField, p = c.fields, g = c.idField, f = h6(e, g); if (f == null) throw new Error('MiniSearch: document does not have ID field "'.concat(g, '"')); var u = this._idToShortId.get(f); if (u == null) throw new Error("MiniSearch: cannot remove document with ID ".concat(f, ": it is not in the index")); try { for (var y = st2(p), v = y.next(); !v.done; v = y.next()) { var m = v.value, w = h6(e, m); if (w != null) { var S = l(w.toString(), m), T = this._fieldIds[m], M = new Set(S).size; this.removeFieldLength(u, T, this._documentCount, M); try { for (var x = (r = void 0, st2(S)), _ = x.next(); !_.done; _ = x.next()) { var E = _.value, L = d(E, m); if (Array.isArray(L)) try { for (var R = (o = void 0, st2(L)), C = R.next(); !C.done; C = R.next()) { var A = C.value; this.removeTerm(T, u, A); } } catch (P) { o = { error: P }; } finally { try { C && !C.done && (a = R.return) && a.call(R); } finally { if (o) throw o.error; } } else L && this.removeTerm(T, u, L); } } catch (P) { r = { error: P }; } finally { try { _ && !_.done && (s = x.return) && s.call(x); } finally { if (r) throw r.error; } } } } } catch (P) { t13 = { error: P }; } finally { try { v && !v.done && (i = y.return) && i.call(y); } finally { if (t13) throw t13.error; } } this._storedFields.delete(u), this._documentIds.delete(u), this._idToShortId.delete(f), this._fieldLength.delete(u), this._documentCount -= 1; }, n.prototype.removeAll = function(e) { var t13, i; if (e) try { for (var r = st2(e), s = r.next(); !s.done; s = r.next()) { var o = s.value; this.remove(o); } } catch (a) { t13 = { error: a }; } finally { try { s && !s.done && (i = r.return) && i.call(r); } finally { if (t13) throw t13.error; } } else { if (arguments.length > 0) throw new Error("Expected documents to be present. Omit the argument to remove all documents."); this._index = new Yh2(), 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; } }, n.prototype.discard = function(e) { var t13 = 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(r, s) { t13.removeFieldLength(i, s, t13._documentCount, r); }), this._fieldLength.delete(i), this._documentCount -= 1, this._dirtCount += 1, this.maybeAutoVacuum(); }, n.prototype.maybeAutoVacuum = function() { if (this._options.autoVacuum !== false) { var e = this._options.autoVacuum, t13 = e.minDirtFactor, i = e.minDirtCount, r = e.batchSize, s = e.batchWait; this.conditionalVacuum({ batchSize: r, batchWait: s }, { minDirtCount: i, minDirtFactor: t13 }); } }, n.prototype.discardAll = function(e) { var t13, i, r = this._options.autoVacuum; try { this._options.autoVacuum = false; try { for (var s = st2(e), o = s.next(); !o.done; o = s.next()) { var a = o.value; this.discard(a); } } catch (c) { t13 = { error: c }; } finally { try { o && !o.done && (i = s.return) && i.call(s); } finally { if (t13) throw t13.error; } } } finally { this._options.autoVacuum = r; } this.maybeAutoVacuum(); }, n.prototype.replace = function(e) { var t13 = this._options, i = t13.idField, r = t13.extractField, s = r(e, i); this.discard(s), this.add(e); }, n.prototype.vacuum = function(e) { return e === void 0 && (e = {}), this.conditionalVacuum(e); }, n.prototype.conditionalVacuum = function(e, t13) { var i = this; return this._currentVacuum ? (this._enqueuedVacuumConditions = this._enqueuedVacuumConditions && t13, this._enqueuedVacuum != null ? this._enqueuedVacuum : (this._enqueuedVacuum = this._currentVacuum.then(function() { var r = i._enqueuedVacuumConditions; return i._enqueuedVacuumConditions = rf2, i.performVacuuming(e, r); }), this._enqueuedVacuum)) : this.vacuumConditionsMet(t13) === false ? Promise.resolve() : (this._currentVacuum = this.performVacuuming(e), this._currentVacuum); }, n.prototype.performVacuuming = function(e, t13) { return LU(this, void 0, void 0, function() { var i, r, s, o, a, c, l, d, h6, p, g, f, u, y, v, m, w, S, T, M, x, _, E, L, R; return RU(this, function(C) { switch (C.label) { case 0: if (i = this._dirtCount, !this.vacuumConditionsMet(t13)) return [3, 10]; r = e.batchSize || nf2.batchSize, s = e.batchWait || nf2.batchWait, o = 1, C.label = 1; case 1: C.trys.push([1, 7, 8, 9]), a = st2(this._index), c = a.next(), C.label = 2; case 2: if (c.done) return [3, 6]; l = Jt(c.value, 2), d = l[0], h6 = l[1]; try { for (p = (_ = void 0, st2(h6)), g = p.next(); !g.done; g = p.next()) { f = Jt(g.value, 2), u = f[0], y = f[1]; try { for (v = (L = void 0, st2(y)), m = v.next(); !m.done; m = v.next()) w = Jt(m.value, 1), S = w[0], !this._documentIds.has(S) && (y.size <= 1 ? h6.delete(u) : y.delete(S)); } catch (A) { L = { error: A }; } finally { try { m && !m.done && (R = v.return) && R.call(v); } finally { if (L) throw L.error; } } } } catch (A) { _ = { error: A }; } finally { try { g && !g.done && (E = p.return) && E.call(p); } finally { if (_) throw _.error; } } return this._index.get(d).size === 0 && this._index.delete(d), o % r !== 0 ? [3, 4] : [4, new Promise(function(A) { return setTimeout(A, s); })]; case 3: C.sent(), C.label = 4; case 4: o += 1, C.label = 5; case 5: return c = a.next(), [3, 2]; case 6: return [3, 9]; case 7: return T = C.sent(), M = { error: T }, [3, 9]; case 8: try { c && !c.done && (x = a.return) && x.call(a); } finally { if (M) throw M.error; } return [ 7 /*endfinally*/ ]; case 9: this._dirtCount -= i, C.label = 10; case 10: return [4, null]; case 11: return C.sent(), this._currentVacuum = this._enqueuedVacuum, this._enqueuedVacuum = null, [ 2 /*return*/ ]; } }); }); }, n.prototype.vacuumConditionsMet = function(e) { if (e == null) return true; var t13 = e.minDirtCount, i = e.minDirtFactor; return t13 = t13 || Qh2.minDirtCount, i = i || Qh2.minDirtFactor, this.dirtCount >= t13 && this.dirtFactor >= i; }, Object.defineProperty(n.prototype, "isVacuuming", { /** * Is `true` if a vacuuming operation is ongoing, `false` otherwise */ get: function() { return this._currentVacuum != null; }, enumerable: false, configurable: true }), Object.defineProperty(n.prototype, "dirtCount", { /** * The number of documents discarded since the most recent vacuuming */ get: function() { return this._dirtCount; }, enumerable: false, configurable: true }), Object.defineProperty(n.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: false, configurable: true }), n.prototype.has = function(e) { return this._idToShortId.has(e); }, n.prototype.getStoredFields = function(e) { var t13 = this._idToShortId.get(e); if (t13 != null) return this._storedFields.get(t13); }, n.prototype.search = function(e, t13) { var i, r; t13 === void 0 && (t13 = {}); var s = this.executeQuery(e, t13), o = []; try { for (var a = st2(s), c = a.next(); !c.done; c = a.next()) { var l = Jt(c.value, 2), d = l[0], h6 = l[1], p = h6.score, g = h6.terms, f = h6.match, u = g.length || 1, y = { id: this._documentIds.get(d), score: p * u, terms: Object.keys(f), queryTerms: g, match: f }; Object.assign(y, this._storedFields.get(d)), (t13.filter == null || t13.filter(y)) && o.push(y); } } catch (v) { i = { error: v }; } finally { try { c && !c.done && (r = a.return) && r.call(a); } finally { if (i) throw i.error; } } return e === n.wildcard && t13.boostDocument == null && this._options.searchOptions.boostDocument == null || o.sort(i02), o; }, n.prototype.autoSuggest = function(e, t13) { var i, r, s, o; t13 === void 0 && (t13 = {}), t13 = Ct(Ct({}, this._options.autoSuggestOptions), t13); var a = /* @__PURE__ */ new Map(); try { for (var c = st2(this.search(e, t13)), l = c.next(); !l.done; l = c.next()) { var d = l.value, h6 = d.score, p = d.terms, g = p.join(" "), f = a.get(g); f != null ? (f.score += h6, f.count += 1) : a.set(g, { score: h6, terms: p, count: 1 }); } } catch (T) { i = { error: T }; } finally { try { l && !l.done && (r = c.return) && r.call(c); } finally { if (i) throw i.error; } } var u = []; try { for (var y = st2(a), v = y.next(); !v.done; v = y.next()) { var m = Jt(v.value, 2), f = m[0], w = m[1], h6 = w.score, p = w.terms, S = w.count; u.push({ suggestion: f, terms: p, score: h6 / S }); } } catch (T) { s = { error: T }; } finally { try { v && !v.done && (o = y.return) && o.call(y); } finally { if (s) throw s.error; } } return u.sort(i02), u; }, Object.defineProperty(n.prototype, "documentCount", { /** * Total number of documents available to search */ get: function() { return this._documentCount; }, enumerable: false, configurable: true }), Object.defineProperty(n.prototype, "termCount", { /** * Number of terms in the index */ get: function() { return this._index.size; }, enumerable: false, configurable: true }), n.loadJSON = function(e, t13) { if (t13 == null) throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index"); return this.loadJS(JSON.parse(e), t13); }, n.getDefault = function(e) { if (Kh2.hasOwnProperty(e)) return qh2(Kh2, e); throw new Error('MiniSearch: unknown option "'.concat(e, '"')); }, n.loadJS = function(e, t13) { var i, r, s, o, a, c, l = e.index, d = e.documentCount, h6 = e.nextId, p = e.documentIds, g = e.fieldIds, f = e.fieldLength, u = e.averageFieldLength, y = e.storedFields, v = e.dirtCount, m = e.serializationVersion; if (m !== 1 && m !== 2) throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version"); var w = new n(t13); w._documentCount = d, w._nextId = h6, w._documentIds = Nc2(p), w._idToShortId = /* @__PURE__ */ new Map(), w._fieldIds = g, w._fieldLength = Nc2(f), w._avgFieldLength = u, w._storedFields = Nc2(y), w._dirtCount = v || 0, w._index = new Yh2(); try { for (var S = st2(w._documentIds), T = S.next(); !T.done; T = S.next()) { var M = Jt(T.value, 2), x = M[0], _ = M[1]; w._idToShortId.set(_, x); } } catch (D) { i = { error: D }; } finally { try { T && !T.done && (r = S.return) && r.call(S); } finally { if (i) throw i.error; } } try { for (var E = st2(l), L = E.next(); !L.done; L = E.next()) { var R = Jt(L.value, 2), C = R[0], A = R[1], P = /* @__PURE__ */ new Map(); try { for (var I = (a = void 0, st2(Object.keys(A))), b = I.next(); !b.done; b = I.next()) { var O = b.value, N = A[O]; m === 1 && (N = N.ds), P.set(parseInt(O, 10), Nc2(N)); } } catch (D) { a = { error: D }; } finally { try { b && !b.done && (c = I.return) && c.call(I); } finally { if (a) throw a.error; } } w._index.set(C, P); } } catch (D) { s = { error: D }; } finally { try { L && !L.done && (o = E.return) && o.call(E); } finally { if (s) throw s.error; } } return w; }, n.prototype.executeQuery = function(e, t13) { var i = this; if (t13 === void 0 && (t13 = {}), e === n.wildcard) return this.executeWildcardQuery(t13); if (typeof e != "string") { var r = Ct(Ct(Ct({}, t13), e), { queries: void 0 }), s = e.queries.map(function(y) { return i.executeQuery(y, r); }); return this.combineResults(s, r.combineWith); } var o = this._options, a = o.tokenize, c = o.processTerm, l = o.searchOptions, d = Ct(Ct({ tokenize: a, processTerm: c }, l), t13), h6 = d.tokenize, p = d.processTerm, g = h6(e).flatMap(function(y) { return p(y); }).filter(function(y) { return !!y; }), f = g.map(UU(d)), u = f.map(function(y) { return i.executeQuerySpec(y, d); }); return this.combineResults(u, d.combineWith); }, n.prototype.executeQuerySpec = function(e, t13) { var i, r, s, o, a = Ct(Ct({}, this._options.searchOptions), t13), c = (a.fields || this._options.fields).reduce(function(O, N) { var D; return Ct(Ct({}, O), (D = {}, D[N] = qh2(a.boost, N) || 1, D)); }, {}), l = a.boostDocument, d = a.weights, h6 = a.maxFuzzy, p = a.bm25, g = Ct(Ct({}, t02.weights), d), f = g.fuzzy, u = g.prefix, y = this._index.get(e.term), v = this.termResults(e.term, e.term, 1, y, c, l, p), m, w; if (e.prefix && (m = this._index.atPrefix(e.term)), e.fuzzy) { var S = e.fuzzy === true ? 0.2 : e.fuzzy, T = S < 1 ? Math.min(h6, Math.round(e.term.length * S)) : S; T && (w = this._index.fuzzyGet(e.term, T)); } if (m) try { for (var M = st2(m), x = M.next(); !x.done; x = M.next()) { var _ = Jt(x.value, 2), E = _[0], L = _[1], R = E.length - e.term.length; if (R) { w == null || w.delete(E); var C = u * E.length / (E.length + 0.3 * R); this.termResults(e.term, E, C, L, c, l, p, v); } } } catch (O) { i = { error: O }; } finally { try { x && !x.done && (r = M.return) && r.call(M); } finally { if (i) throw i.error; } } if (w) try { for (var A = st2(w.keys()), P = A.next(); !P.done; P = A.next()) { var E = P.value, I = Jt(w.get(E), 2), b = I[0], R = I[1]; if (R) { var C = f * E.length / (E.length + R); this.termResults(e.term, E, C, b, c, l, p, v); } } } catch (O) { s = { error: O }; } finally { try { P && !P.done && (o = A.return) && o.call(A); } finally { if (s) throw s.error; } } return v; }, n.prototype.executeWildcardQuery = function(e) { var t13, i, r = /* @__PURE__ */ new Map(), s = Ct(Ct({}, this._options.searchOptions), e); try { for (var o = st2(this._documentIds), a = o.next(); !a.done; a = o.next()) { var c = Jt(a.value, 2), l = c[0], d = c[1], h6 = s.boostDocument ? s.boostDocument(d, "", this._storedFields.get(l)) : 1; r.set(l, { score: h6, terms: [], match: {} }); } } catch (p) { t13 = { error: p }; } finally { try { a && !a.done && (i = o.return) && i.call(o); } finally { if (t13) throw t13.error; } } return r; }, n.prototype.combineResults = function(e, t13) { if (t13 === void 0 && (t13 = Vp2), e.length === 0) return /* @__PURE__ */ new Map(); var i = t13.toLowerCase(); return e.reduce(FU[i]) || /* @__PURE__ */ new Map(); }, n.prototype.toJSON = function() { var e, t13, i, r, s = []; try { for (var o = st2(this._index), a = o.next(); !a.done; a = o.next()) { var c = Jt(a.value, 2), l = c[0], d = c[1], h6 = {}; try { for (var p = (i = void 0, st2(d)), g = p.next(); !g.done; g = p.next()) { var f = Jt(g.value, 2), u = f[0], y = f[1]; h6[u] = Object.fromEntries(y); } } catch (v) { i = { error: v }; } finally { try { g && !g.done && (r = p.return) && r.call(p); } finally { if (i) throw i.error; } } s.push([l, h6]); } } catch (v) { e = { error: v }; } finally { try { a && !a.done && (t13 = o.return) && t13.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: s, serializationVersion: 2 }; }, n.prototype.termResults = function(e, t13, i, r, s, o, a, c) { var l, d, h6, p, g; if (c === void 0 && (c = /* @__PURE__ */ new Map()), r == null) return c; try { for (var f = st2(Object.keys(s)), u = f.next(); !u.done; u = f.next()) { var y = u.value, v = s[y], m = this._fieldIds[y], w = r.get(m); if (w != null) { var S = w.size, T = this._avgFieldLength[m]; try { for (var M = (h6 = void 0, st2(w.keys())), x = M.next(); !x.done; x = M.next()) { var _ = x.value; if (!this._documentIds.has(_)) { this.removeTerm(m, _, t13), S -= 1; continue; } var E = o ? o(this._documentIds.get(_), t13, this._storedFields.get(_)) : 1; if (E) { var L = w.get(_), R = this._fieldLength.get(_)[m], C = zU(L, S, this._documentCount, R, T, a), A = i * v * E * C, P = c.get(_); if (P) { P.score += A, kU(P.terms, e); var I = qh2(P.match, t13); I ? I.push(y) : P.match[t13] = [y]; } else c.set(_, { score: A, terms: [e], match: (g = {}, g[t13] = [y], g) }); } } } catch (b) { h6 = { error: b }; } finally { try { x && !x.done && (p = M.return) && p.call(M); } finally { if (h6) throw h6.error; } } } } } catch (b) { l = { error: b }; } finally { try { u && !u.done && (d = f.return) && d.call(f); } finally { if (l) throw l.error; } } return c; }, n.prototype.addTerm = function(e, t13, i) { var r = this._index.fetch(i, r02), s = r.get(e); if (s == null) s = /* @__PURE__ */ new Map(), s.set(t13, 1), r.set(e, s); else { var o = s.get(t13); s.set(t13, (o || 0) + 1); } }, n.prototype.removeTerm = function(e, t13, i) { if (!this._index.has(i)) { this.warnDocumentChanged(t13, e, i); return; } var r = this._index.fetch(i, r02), s = r.get(e); s == null || s.get(t13) == null ? this.warnDocumentChanged(t13, e, i) : s.get(t13) <= 1 ? s.size <= 1 ? r.delete(e) : s.delete(t13) : s.set(t13, s.get(t13) - 1), this._index.get(i).size === 0 && this._index.delete(i); }, n.prototype.warnDocumentChanged = function(e, t13, i) { var r, s; try { for (var o = st2(Object.keys(this._fieldIds)), a = o.next(); !a.done; a = o.next()) { var c = a.value; if (this._fieldIds[c] === t13) { 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) { r = { error: l }; } finally { try { a && !a.done && (s = o.return) && s.call(o); } finally { if (r) throw r.error; } } }, n.prototype.addDocumentId = function(e) { var t13 = this._nextId; return this._idToShortId.set(e, t13), this._documentIds.set(t13, e), this._documentCount += 1, this._nextId += 1, t13; }, n.prototype.addFields = function(e) { for (var t13 = 0; t13 < e.length; t13++) this._fieldIds[e[t13]] = t13; }, n.prototype.addFieldLength = function(e, t13, i, r) { var s = this._fieldLength.get(e); s == null && this._fieldLength.set(e, s = []), s[t13] = r; var o = this._avgFieldLength[t13] || 0, a = o * i + r; this._avgFieldLength[t13] = a / (i + 1); }, n.prototype.removeFieldLength = function(e, t13, i, r) { if (i === 1) { this._avgFieldLength[t13] = 0; return; } var s = this._avgFieldLength[t13] * i - r; this._avgFieldLength[t13] = s / (i - 1); }, n.prototype.saveStoredFields = function(e, t13) { var i, r, s = this._options, o = s.storeFields, a = s.extractField; if (!(o == null || o.length === 0)) { var c = this._storedFields.get(e); c == null && this._storedFields.set(e, c = {}); try { for (var l = st2(o), d = l.next(); !d.done; d = l.next()) { var h6 = d.value, p = a(t13, h6); p !== void 0 && (c[h6] = p); } } catch (g) { i = { error: g }; } finally { try { d && !d.done && (r = l.return) && r.call(l); } finally { if (i) throw i.error; } } } }, n.wildcard = Symbol("*"), n; }() ); var qh2 = function(n, e) { return Object.prototype.hasOwnProperty.call(n, e) ? n[e] : void 0; }; var FU = (Oa = {}, Oa[Vp2] = function(n, e) { var t13, i; try { for (var r = st2(e.keys()), s = r.next(); !s.done; s = r.next()) { var o = s.value, a = n.get(o); if (a == null) n.set(o, e.get(o)); else { var c = e.get(o), l = c.score, d = c.terms, h6 = c.match; a.score = a.score + l, a.match = Object.assign(a.match, h6), n02(a.terms, d); } } } catch (p) { t13 = { error: p }; } finally { try { s && !s.done && (i = r.return) && i.call(r); } finally { if (t13) throw t13.error; } } return n; }, Oa[Jw2] = function(n, e) { var t13, i, r = /* @__PURE__ */ new Map(); try { for (var s = st2(e.keys()), o = s.next(); !o.done; o = s.next()) { var a = o.value, c = n.get(a); if (c != null) { var l = e.get(a), d = l.score, h6 = l.terms, p = l.match; n02(c.terms, h6), r.set(a, { score: c.score + d, terms: c.terms, match: Object.assign(c.match, p) }); } } } catch (g) { t13 = { error: g }; } finally { try { o && !o.done && (i = s.return) && i.call(s); } finally { if (t13) throw t13.error; } } return r; }, Oa[DU] = function(n, e) { var t13, i; try { for (var r = st2(e.keys()), s = r.next(); !s.done; s = r.next()) { var o = s.value; n.delete(o); } } catch (a) { t13 = { error: a }; } finally { try { s && !s.done && (i = r.return) && i.call(r); } finally { if (t13) throw t13.error; } } return n; }, Oa); var BU = { k: 1.2, b: 0.7, d: 0.5 }; var zU = function(n, e, t13, i, r, s) { var o = s.k, a = s.b, c = s.d, l = Math.log(1 + (t13 - e + 0.5) / (e + 0.5)); return l * (c + n * (o + 1) / (n + o * (1 - a + a * i / r))); }; var UU = function(n) { return function(e, t13, i) { var r = typeof n.fuzzy == "function" ? n.fuzzy(e, t13, i) : n.fuzzy || false, s = typeof n.prefix == "function" ? n.prefix(e, t13, i) : n.prefix === true; return { term: e, fuzzy: r, prefix: s }; }; }; var Kh2 = { idField: "id", extractField: function(n, e) { return n[e]; }, tokenize: function(n) { return n.split(GU); }, processTerm: function(n) { return n.toLowerCase(); }, fields: void 0, searchOptions: void 0, storeFields: [], logger: function(n, e) { typeof (console == null ? void 0 : console[n]) == "function" && console[n](e); }, autoVacuum: true }; var t02 = { combineWith: Vp2, prefix: false, fuzzy: false, maxFuzzy: 6, boost: {}, weights: { fuzzy: 0.45, prefix: 0.375 }, bm25: BU }; var VU = { combineWith: Jw2, prefix: function(n, e, t13) { return e === t13.length - 1; } }; var nf2 = { batchSize: 1e3, batchWait: 10 }; var rf2 = { minDirtFactor: 0.1, minDirtCount: 20 }; var Qh2 = Ct(Ct({}, nf2), rf2); var kU = function(n, e) { n.includes(e) || n.push(e); }; var n02 = function(n, e) { var t13, i; try { for (var r = st2(e), s = r.next(); !s.done; s = r.next()) { var o = s.value; n.includes(o) || n.push(o); } } catch (a) { t13 = { error: a }; } finally { try { s && !s.done && (i = r.return) && i.call(r); } finally { if (t13) throw t13.error; } } }; var i02 = function(n, e) { var t13 = n.score, i = e.score; return i - t13; }; var r02 = function() { return /* @__PURE__ */ new Map(); }; var Nc2 = function(n) { var e, t13, i = /* @__PURE__ */ new Map(); try { for (var r = st2(Object.keys(n)), s = r.next(); !s.done; s = r.next()) { var o = s.value; i.set(parseInt(o, 10), n[o]); } } catch (a) { e = { error: a }; } finally { try { s && !s.done && (t13 = r.return) && t13.call(r); } finally { if (e) throw e.error; } } return i; }; var GU = /[\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; var HU = class { constructor() { this._searchEngine = new NU({ fields: ["path", "name"], storeFields: ["path"], tokenize: (e, t13) => e.split(/[\s/]+/) // indexing tokenizer }), this.idMaps = {}; } addZincObject(e, t13) { const i = e.getRegion().getFullPath(); let r = e.groupName, s = i ? `${i}/${e.groupName}` : e.groupName; r = r.replaceAll('"', ""), s = s.replaceAll('"', ""); const o = { path: s, name: r, id: t13 }; this._searchEngine.add(o), this.idMaps[t13] = { path: s, zincObject: e }; } removeZincObject(e, t13) { const i = e.getRegion().getFullPath(); let r = e.groupName, s = i ? `${i}/${e.groupName}` : e.groupName; r = r.replaceAll('"', ""), s = s.replaceAll('"', ""); const o = { path: s, name: r, id: t13 }; this._searchEngine.remove(o), delete this.idMaps[t13]; } addRegion(e, t13) { let i = e.getFullPath(), r = e.getName(); i = i.replaceAll('"', ""), r = r.replaceAll('"', ""); const s = { path: i, name: r, id: t13 }; this._searchEngine.add(s), this.idMaps[t13] = { path: i, zincObject: e }; } clearResults() { this._; } removeAll() { this._searchEngine.removeAll(), this.idMaps = {}; } auto_suggest(e) { let t13 = []; e.length > 2 && ["'", '"'].includes(e.slice(0, 1)) ? (e = e.replaceAll(e.slice(0, 1), ""), t13 = this._searchEngine.search(e, { prefix: true, combineWith: "AND" })) : e.length > 1 && (t13 = this._searchEngine.search(e, { prefix: true })); const i = []; t13.forEach((o) => { o.id in this.idMaps && i.push(this.idMaps[o.id].path); }); const r = [...new Set(i)], s = []; return r.forEach((o) => s.push({ suggestion: '"' + o + '"' })), s; } processResults(e, t13) { const i = { regionPath: void 0, label: 'Search Results for "' }; return Array.isArray(t13) ? i.label += ",".join(t13) : i.label += t13, 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 = kz(e), i; } search(e) { let t13; e.length > 2 && ["'", '"'].includes(e.slice(0, 1)) ? (e = e.replaceAll(e.slice(0, 1), ""), t13 = this._searchEngine.search(e, { prefix: true, combineWith: "AND" })) : e.length > 1 && (t13 = this._searchEngine.search(e, { prefix: true })); const i = []; return t13.forEach((r) => { r.id in this.idMaps && i.push(this.idMaps[r.id].zincObject); }), i; } searchTerms(e) { let t13 = []; return e.forEach((i) => { const r = this.search(i); t13.push(...r); }), t13; } searchAndProcessResult(e) { let t13 = []; return Array.isArray(e) ? t13 = this.searchTerms(e) : t13 = this.search(e), this.processResults(t13, e); } }; var WU = { name: "ScaffoldVuer", components: { Button: sa2, Col: _i2, Loading: SP2, Option: aa, Popover: Mu2, Row: Hi2, Select: oa2, Slider: ci2, TabPane: Oy2, Tabs: Iy2, MapSvgIcon: wn, MapSvgSpriteColor: hn, PrimitiveControls: Bw2, ScaffoldTooltip: Hw2, ElIconWarningFilled: I02, ElIconArrowDown: vf2, ElIconArrowLeft: jr, DrawToolbar: NF, ScaffoldTreeControls: zw2 }, setup(n) { let e = inject("$annotator"); return e || (e = markRaw(new wU(`${n.flatmapAPI}annotator`)), provide("$annotator", e)), { annotator: e }; }, props: { /** * The option to show annotation information in sidebar */ annotationSidebar: { type: Boolean, default: false }, /** * 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: false }, /** * Flag to show/hide the UI. */ displayUI: { type: Boolean, default: true }, /** * Display all graphics at start. * * This setting only works when traditional is set to false. */ displayAtStartUp: { type: Boolean, default: true }, /** * Use for toggling the help tooltips. */ helpMode: { type: Boolean, default: false }, /** * 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: false }, /** * The last item of help mode. */ helpModeLastItem: { type: Boolean, default: false }, /** * 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: true }, /** * Warning message for the hovered over text * on the warning icon. */ warningMessage: { type: String, default: "Beta feature - under active development" }, displayLatestChanges: { type: Boolean, default: false }, latestChangesMessage: { type: String, default: "New feature - Local search is now available" }, /** * Show/hide pickable markers for regions. */ displayMarkers: { type: Boolean, default: false }, /** * Display adjacent markers with a cluster marker. */ markerCluster: { type: Boolean, default: false }, /** * 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: false }, /** * 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: false }, /** * 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: true }, /** * 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: false } }, provide() { return { flatmapAPI: this.flatmapAPI, scaffoldUrl: this.url, boundingDims: this.boundingDims }; }, data: function() { return { annotator: void 0, createData: { drawingBox: false, toBeConfirmed: false, points: [], shape: "", x: 0, y: 0, editingIndex: -1, faceIndex: -1, toBeDeleted: false }, currentTime: 0, timeVarying: false, isPlaying: false, isReady: false, /** * This is set when scene is transitioning. */ isTransitioning: false, tooltipAppendToBody: false, hoverVisibilities: [ { value: false, ref: "zoomInPopover" }, // 0 { value: false, ref: "zoomOutPopover" }, // 1 { value: false, ref: "zoomFitPopover" }, // 2 { value: false, ref: "openMapPopover" }, // 3 { value: false, ref: "settingsPopover" }, // 4 { value: false, ref: "sliderPopover" }, // 5 { value: false, ref: "regionVisibilityPopover" }, // 6 { value: false, ref: "warningPopover" }, // 7 { value: false, ref: "whatsNewPopover" }, // 8 { value: false, refs: "toolbarPopover", ref: "editPopover" }, // 9 { value: false, refs: "toolbarPopover", ref: "pointPopover" }, // 10 { value: false, refs: "toolbarPopover", ref: "lineStringPopover" }, // 11 { value: false, refs: "toolbarPopover", ref: "deletePopover" } // 11 ], inHelp: false, helpModeActiveIndex: this.helpModeInitialIndex, loading: false, duration: 3e3, drawerOpen: true, currentBackground: "white", availableBackground: ["white", "lightskyblue", "black"], minimisedSlider: false, 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: false, x: 200, y: 200, active: false }, fileFormat: "metadata", previousMarkerLabels: markRaw({}), 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: markRaw([]), boundingDims: { centre: [0, 0, 0], size: [1, 1, 1] }, lastSelected: markRaw({ region: "", group: "", isSearch: false }) }; }, watch: { format: { handler: function(n) { this.fileFormat = n; }, immediate: true }, url: { handler: function(n) { (this.state === void 0 || this.state.url === void 0) && this.setURL(n); }, immediate: true }, region: { handler: function(n) { this.state || this.viewURL || this.setFocusedRegion(n); }, immediate: true }, state: { handler: function(n) { this.setState(n); }, immediate: true, deep: true }, viewURL: { handler: function(n) { this.updateViewURL(n); }, immediate: true }, helpMode: function(n, e) { n !== e && this.setHelpMode(n); }, helpModeActiveItem: function() { this.helpMode && (this.helpModeActiveIndex += 1, this.setHelpMode(this.helpMode)); }, displayMarkers: function(n) { this.$module.scene.displayMarkers = n, this.$module.scene.forcePickableObjectsUpdate = true; }, displayMinimap: function(n) { this.$module.scene.displayMinimap = n; }, currentTime: { handler: function() { this.$emit("timeChanged", this.currentTime); } }, duration: function() { this.$module.scene.setDuration(this.duration); }, minimapSettings: { deep: true, handler: "updateMinimapScissor" }, render: function(n) { this.toggleRendering(n); }, markerCluster: { handler: function(n) { this.$module.scene.enableMarkerCluster(n); }, immediate: true }, markerLabels: function(n) { for (const [e, t13] of Object.entries(this.previousMarkerLabels)) this.setMarkerModeForObjectsWithName(e, t13, "off"); for (const [e, t13] of Object.entries(n)) this.setMarkerModeForObjectsWithName(e, t13, "on"); this.previousMarkerLabels = markRaw({ ...n }); }, annotationDisplay: function(n) { if (this.annotationSidebar) if (n) { const t13 = { featureId: (this.tData.region ? this.tData.region + "/" : "") + this.tData.label, resourceId: this.url, resource: this.url }; this.$emit("annotation-open", { annotationEntry: t13, commitCallback: this.commitAnnotationEvent }); } else (!this.createData.toBeConfirmed || !this.createData.toBeDeleted) && this.$emit("annotation-close"); } }, beforeCreate: function() { this.$module = new Ww2(), this.selectedObjects = [], this.hoveredObjects = [], this.currentBackground = "white", this._currentURL = void 0, this.availableBackground = ["white", "black", "lightskyblue"], this.$_searchIndex = new HU(); }, mounted: function() { this.openMapRef = shallowRef(this.$refs.openMapRef), this.backgroundIconRef = shallowRef(this.$refs.backgroundIconRef), this.$refs.scaffoldTreeControls.setModule(this.$module); let n = new _U(); n.subscribe(this, this.eventNotifierCallback), this.$module.addNotifier(n), 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: { ...kw2(Gw2, ["userToken"]), annotationDisplay: function() { return this.viewingMode === "Annotation" && this.tData.active === true && 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(n) { this.$module.scene && this.$module.scene.addZincObject(n); }, /** * Internal only. * This is called when a new zinc object is read into the scene. */ zincObjectAdded: function(n) { this.loading = false, this.$_searchIndex.addZincObject(n, n.uuid), this.timeVarying === false && n.isTimeVarying() && (this.timeVarying = true), this.$emit("zinc-object-added", n); }, /** * Internal only. * Remove an entry matching region and group from * local annotation list. */ removeFromLocalAnnotationList: function(n, e) { for (let t13 = 0; t13 < this.localAnnotationsList.length; t13++) { const i = this.localAnnotationsList[t13]; if (i.region === n && i.group === e) { this.localAnnotationsList.splice(t13, 1); return; } } }, /** * Internal only. * This is called when a zinc object is removed. */ zincObjectRemoved: function(n) { if (this.$module.scene) { const e = n.region.getFullPath(), t13 = n.groupName; n.region.findObjectsWithGroupName(t13, false).length === 0 && (this.$_searchIndex.removeZincObject(n, n.uuid), this.removeFromLocalAnnotationList(e, t13)); } }, /** * Internal only. * Add regions to search index. */ addRegionsToSearchIndex: function() { this.$module.scene.getRootRegion().getChildRegions(true).forEach((t13) => { this.$_searchIndex.addRegion(t13, t13.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(n) { this.currentBackground = n, 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 n = 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 = n, e.click(), e.remove(); }, /** * @public * Function for capturing a screenshot of the current rendering. * * @arg {String} "filename given to the screenshot." */ captureScreenshot: function(n) { this.captureFilename = n, 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(n, e, t13, i) { const r = Xv2( this.annotator, this.userToken, t13, n, e, this.url, i ); if (this.enableLocalAnnotations) { r.group = e; let s = n; s.slice(-1) === "/" && (s = s.slice(0, -1)), r.region = s, this.removeFromLocalAnnotationList(s, e), this.localAnnotationsList.push(r); } this.$emit("userPrimitivesUpdated", { region: n, group: e, zincObject: t13 }); }, /** * @public * Callback for when primitives have been update using primitive controls. * This is only called from callback. * @arg `object` */ primitivesUpdated: function(n) { if (n.isZincObject && n.isEditable) { const e = n.groupName, t13 = n.region.getFullPath(); this.addAndEditAnnotations(t13, e, n, "Position Updated"); } }, /** * @public * Confirm creation of new primitive. This is only called from callback. * @arg `payload` */ confirmCreate: function(n) { if (n) { let e; if (n.shape === "Point") e = this.$module.scene.createPoints( n.region, n.group, this.createData.points, n.group, 8942 ); else if (n.shape === "LineString") e = this.$module.scene.createLines( n.region, n.group, [this.createData.points[0], this.createData.points[1]], 60962 ); else if (n.editingIndex > -1 && this._editingZincObject) { this._editingZincObject.editVertices( [this.createData.points[1]], n.editingIndex ); const t13 = this._editingZincObject.region.getFullPath() + "/", i = this._editingZincObject.groupName; this.addAndEditAnnotations(t13, i, this._editingZincObject, "Position Updated"); } e && (this.addAndEditAnnotations(n.region, n.group, e.zincObject, "Create"), e.zincObject.isEditable = true, this.tData.region = n.region, this.tData.label = n.group, this.changeActiveByName([n.group], n.region, false)); } this.cancelCreate(); }, /** * Internal only. * Cancel create workflows. Reset all relevant UIs and data. */ cancelCreate: function() { this.createData.points.length = 0, this.createData.toBeConfirmed = false, this._editingZincObject = void 0, this.createData.editingIndex = -1, this.createData.faceIndex = -1, this.tData.visible = false, this.createData.toBeDeleted = false, 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 n; if ((n = this._editingZincObject) != null && n.isEditable) { const e = this._editingZincObject.region.getFullPath() + "/", t13 = this._editingZincObject.groupName; Xv2( this.annotator, this.userToken, this._editingZincObject, e, t13, 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(n) { if (this.timeMax >= 1e3 && n) { let e = (n % 6e4 / 1e3).toFixed(2) + "s"; return (n > 6e4 ? (n / 6e4).toFixed(0) + "m " : "") + e; } return n ? n.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 n = false; this._boundingBoxGeo && (n = this._boundingBoxGeo.getVisibility(), this._boundingBoxGeo.setVisibility(false)), this.$module.scene.viewAll(), this._boundingBoxGeo && (Uz(this._boundingBoxGeo, this.$module.scene), this._boundingBoxGeo.setVisibility(n)); } }, /** * @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(n) { this.currentSpeed = n, this.$module.setPlayRate(this.defaultRate * this.currentSpeed); }, /** * Function used to stop the free spin * * @public */ stopFreeSpin: function() { this.$module.scene.getZincCameraControls().stopAutoTumble(), this.isTransitioning = false; }, /** * Return a list of obejcts with the provided name. * @arg "Group name to search." * * @public */ findObjectsWithGroupName: function(n) { let e = []; return n && n != "" && this.$module.scene && (e = this.$module.scene.findObjectsWithGroupName(n)), e; }, /** * @public * Switch active drawing type * @arg {String} `type` * @arg {String} `icon` */ toggleDrawing: function(n, e) { this.createData.toBeDeleted = false, n === "mode" ? (this.cancelCreate(), this.activeDrawMode = e, this.createData.shape = "", this.$module.selectObjectOnPick = true) : n === "tool" && (this.activeDrawTool = e, this.createData.shape = this.activeDrawTool ? this.activeDrawTool : "", this.$module.selectObjectOnPick = false); }, /** * 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(n) { const e = this.$module.scene.getRootRegion(), t13 = Array.isArray(n) ? n : [n], i = Ao2(e, t13, "", true); let r = this.$module.scene.getBoundingBoxOfZincObjects(i); if (r) { if (this.$module.isSyncControl()) this.$module.setSyncControlZoomToBox(r); else { const s = this.$module.scene.camera.far - this.$module.scene.camera.near; this.$module.scene.viewAllWithBoundingBox(r), this.$module.scene.camera.far = this.$module.scene.camera.near + s, this.$module.scene.camera.updateProjectionMatrix(); } return true; } return false; }, setFocusedRegion: function(n) { n && (this.isReady ? this.viewRegion(n) : this.$module.setFinishDownloadCallback( this.setURLFinishCallback({ region: n }) )); }, updateViewURL: function(n) { if (n) if (this.isReady) { const e = new URL(n, this.url); this.$module.scene.loadViewURL(e); } else this.$module.setFinishDownloadCallback( this.setURLFinishCallback({ viewURL: n }) ); }, createEditTemporaryLines: function(n) { const e = n[0].extraData.worldCoords; if (e && (this.createData.shape === "LineString" || this.createData.editingIndex > -1) && this.createData.points.length === 1) if (this.showRegionTooltipWithAnnotations(n, true, false), this.tData.x = 50, this.tData.y = 200, this._tempLine) { const t13 = this._tempLine.geometry.getAttribute("position"); t13.setXYZ(1, e[0], e[1], e[2]), t13.needsUpdate = true; } else this._tempLine = this.$module.scene.addTemporaryLines( [this.createData.points[0], e], 65535 ); }, draw: function(n) { n && n.length > 0 && n[0].data.group && n[0].extraData.worldCoords && (this.createData.shape === "Point" ? this.drawPoint(n[0].extraData.worldCoords, n) : (this.createData.shape === "LineString" || this.createData.editingIndex > -1) && this.drawLine(n[0].extraData.worldCoords, n)); }, drawPoint: function(n, e) { this.createData.toBeConfirmed === false && (this.createData.points.length = 0, this.createData.points.push(n), this.createData.toBeConfirmed = true, this.showRegionTooltipWithAnnotations(e, true, false), this.tData.x = 50, this.tData.y = 200, this._tempPoint = this.$module.scene.addTemporaryPoints([n], 16776960)); }, drawLine: function(n, e) { this.createData.toBeConfirmed === false && (this.createData.points.length === 1 ? (this.createData.points.push(n), this.createData.toBeConfirmed = true, this.showRegionTooltipWithAnnotations(e, true, false), this.tData.x = 50, this.tData.y = 200) : (this._tempPoint = this.$module.scene.addTemporaryPoints([n], 16776960), this.createData.points.push(n))); }, /** * 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 n = this.$module.scene.getZincCameraControls(); this.isTransitioning = true, n.enableAutoTumble(), n.autoTumble([1, 0], Math.PI, true), setTimeout(this.stopFreeSpin, 4e3); } }, activateAnnotationMode: function(n, e) { if (this.userInformation || this.enableLocalAnnotations) if (this.createData.toBeDeleted = false, this.createData.shape !== "" || this.createData.editingIndex > -1) n.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 t13 = Fz(e); t13 && this.activateEditingMode( t13.zincObject, t13.faceIndex, t13.vertexIndex, t13.point ); } else if (this.activeDrawMode === "Delete") { const t13 = Bz(e); t13 && (this.createData.toBeDeleted = true, this._editingZincObject = t13); } this.activeDrawMode !== "Point" && this.activeDrawMode !== "LineString" ? this.showRegionTooltipWithAnnotations(e.identifiers, true, false) : this.showRegionTooltipWithAnnotations(e.identifiers, true, true); } else this.showRegionTooltipWithAnnotations(e.identifiers, true, true); }, activateEditingMode: function(n, e, t13, i) { this._editingZincObject = n, this.createData.faceIndex = e, this.createData.editingIndex = t13, this.drawLine(i, void 0); }, /** * Callback when a region is selected/highlighted. * It will also update other controls. * */ eventNotifierCallback: function(n) { if (!(this.createData.toBeConfirmed || this.createData.toBeDeleted)) { const e = []; let t13 = []; (n.eventType == 1 || n.eventType == 2) && (n.identifiers.forEach((s) => { if (s) { let o = s.data.id ? s.data.id : s.data.group; e.push(o); } }), t13 = n.zincObjects); let i, r; if (n.identifiers.length > 0 && n.identifiers[0] && (i = n.identifiers[0].data.id ? n.identifiers[0].data.id : n.identifiers[0].data.group, n.identifiers[0].data.region && (r = n.identifiers[0].data.region)), n.eventType == 1) this.viewingMode === "Annotation" ? (this.tData.label = i, this.tData.region = r, this.activateAnnotationMode(e, n)) : (this.$refs.scaffoldTreeControls && (e.length > 0 ? (this.$refs.scaffoldTreeControls.updateActiveUI(t13), this.updatePrimitiveControls(t13)) : (this.hideRegionTooltip(), this.$refs.scaffoldTreeControls.removeActive(false))), n.identifiers.length === 1 ? (this.lastSelected.isSearch = false, this.lastSelected.region = r, this.lastSelected.group = n.identifiers[0].data.group) : n.identifiers.length === 0 && (this.lastSelected.isSearch = false, this.lastSelected.region = "", this.lastSelected.group = ""), this.$emit("scaffold-selected", n.identifiers)); else if (n.eventType == 2) this.selectedObjects.length === 0 && (this.hideRegionTooltip(), this.$refs.scaffoldTreeControls && (e.length > 0 ? this.$refs.scaffoldTreeControls.updateHoverUI(t13) : this.$refs.scaffoldTreeControls.removeHover(true)), n.identifiers.length > 0 && n.identifiers[0] && n.identifiers[0].coords && (this.tData.active = false, (this.viewingMode !== "Annotation" || !this.annotationSidebar) && (this.tData.visible = true), this.tData.label = i, this.tData.region = r, this.tData.x = n.identifiers[0].coords.x, this.tData.y = n.identifiers[0].coords.y, this.createEditTemporaryLines(n.identifiers)), this.$emit("scaffold-highlighted", n.identifiers)); else if (n.eventType == 3 && n.identifiers.length > 0 && n.identifiers[0]) { if (n.identifiers[0].coords) { const s = this.$refs.scaffoldContainer.getBoundingClientRect(); this.tData.x = n.identifiers[0].coords.x - s.left, this.tData.y = n.identifiers[0].coords.y - s.top; } this.createEditTemporaryLines(n.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(n) { let e = n / 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(n) { this.selectedObjects = n, 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(n, e) { this.updatePrimitiveControls(n), this.$module.setSelectedByZincObjects(n, 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(n, e) { this.hoveredObjects = n, this.$module.setHighlightedByZincObjects(n, void 0, {}, e); }, /** * Set the selected by name. * * @param {} name Name of the group */ changeActiveByName: function(n, e, t13) { const i = Array.isArray(n); if (n === void 0 || i && n.length === 0) this.$refs.scaffoldTreeControls.removeActive(t13); else { let r = n; i || (r = [r]), this.$refs.scaffoldTreeControls.changeActiveByNames(r, e, t13); } }, /** * Set the highlighted by name. * * @param {name} name Name of the group */ changeHighlightedByName: function(n, e, t13) { const i = Array.isArray(n); if (n === void 0 || i && n.length === 0) this.$refs.scaffoldTreeControls.removeHover(t13); else { let r = n; i || (r = [r]), this.$refs.scaffoldTreeControls.changeHoverByNames(r, e, t13); } }, /** * @public * Start the animation. * * @arg "flag to turn the animation on/off" */ play: function(n) { this.$module.playAnimation(n), this.isPlaying = n; }, /** * @public * Function to toggle on/off overlay help. */ setHelpMode: function(n) { const e = this.hoverVisibilities.length, t13 = e - 1, i = this.hoverVisibilities[this.helpModeActiveIndex]; if (i) { const r = i == null ? void 0 : i.refs, s = i == null ? void 0 : i.ref; this.$refs[r || s] || (this.helpModeActiveIndex += 1); } n || (this.helpModeActiveIndex = this.helpModeInitialIndex), n && this.helpModeActiveIndex >= t13 && this.$emit("help-mode-last-item", true), n && !this.helpModeDialog ? (this.inHelp = true, this.hoverVisibilities.forEach((r) => { r.value = true; })) : n && this.helpModeDialog && e > this.helpModeActiveIndex ? this.helpModeActiveIndex > -1 && setTimeout(() => { this.inHelp = false, this.hoverVisibilities.forEach((r) => { r.value = false; }), this.showHelpText(this.helpModeActiveIndex, 200); }, 300) : (this.inHelp = false, this.hoverVisibilities.forEach((r) => { r.value = false; })); }, /** * Callback function used by showRegionTooltip in the case when the tooltip * is out of view. */ displayTooltipOfObjectsCallback: function(n, e, t13, i, r) { const s = this; return function() { s.$module.zincRenderer.removePostRenderCallbackFunction( s.$_regionTooltipCallback ), s.$_regionTooltipCallback = void 0, s.displayTooltipOfObjects(n, e, t13, i, r); }; }, liveUpdateTooltipPosition: function() { this.$module.selectedCenter && (this.tData.x = this.$module.selectedScreenCoordinates.x, this.tData.y = this.$module.selectedScreenCoordinates.y); }, displayTooltipOfObjects: function(n, e, t13, i, r) { if (e.length > 0) { let s = e[0].getClosestVertexDOMElementCoords( this.$module.scene ); if (s) return s.inView ? (n.includes("Search Results for") ? this.tData.active = false : this.tData.active = true, this.tData.visible = true, this.tData.label = n, this.tData.x = s.position.x, this.tData.y = s.position.y, this.tData.region = t13, this.$_liveCoordinatesUpdated && this.$module.zincRenderer.removePostRenderCallbackFunction( this.$_liveCoordinatesUpdated ), r && (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( n, e, t13, i, r ) ))), true; } return this.hideRegionTooltip(), false; }, /** * 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(n, e, t13, i, r) { return n && e && e.length > 0 && this.$module.scene ? this.displayTooltipOfObjects( n, e, t13, i, r ) : (this.hideRegionTooltip(), false); }, /** * 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(n, e, t13) { if (n && this.$module.scene) { const i = this.$module.scene.getRootRegion(), s = Ao2(i, [n], "", true); let o; return s && s.length > 0 && (o = s[0].getRegion().getFullPath()), this.showRegionTooltipWithObjects( n, s, o, e, t13 ); } return this.hideRegionTooltip(), false; }, /** * 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(n, e, t13) { if (this.$module.scene) { const i = Zv2(this.$module.scene, n); if (i && i.objects.length > 0) if (this.annotationSidebar) { const s = { featureId: (this.tData.region ? this.tData.region + "/" : "") + this.tData.label, resourceId: this.url, resource: this.url }; this.$emit("annotation-open", { annotationEntry: s, createData: this.createData, confirmCreate: this.confirmCreate, cancelCreate: this.cancelCreate, confirmDelete: this.confirmDelete }); return; } else return this.showRegionTooltipWithObjects( i.label, i.objects, i.regionPath, e, t13 ); } return this.hideRegionTooltip(), false; }, /** * Callback on viewing mode change * Optional, can be used to update the view mode. */ changeViewingMode: function(n) { if (this.$module) { if (n && (this.viewingMode = n), this.viewingMode === "Annotation") { let e = false; this.userInformation && (e = true), this.userInformation = void 0, this.annotator.authenticate(this.userToken).then((t13) => { t13.name && t13.email && t13.canUpdate && (this.userInformation = t13, e || (Yv2(this.annotator, this.userToken, this.url).then((i) => { i && i.features && jh2(this.$module.scene, i.features); }), Yv2(this.annotator, this.userToken, encodeURIComponent(this.url)).then((i) => { i && i.features && jh2(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 = true : this.$module.selectObjectOnPick = false, this.cancelCreate(); } }, /** * @public * Hide the tooltip */ hideRegionTooltip: function() { this.$_liveCoordinatesUpdated && (this.$module.zincRenderer.removePostRenderCallbackFunction( this.$_liveCoordinatesUpdated ), this.$module.setupLiveCoordinates(void 0)), this.tData.active = false, this.tData.visible = false, 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(n, e, t13) { if (n && this.$module.scene) { let i = e; typeof e == "number" && (i = { number: e, imgURL: void 0 }); const r = this.$module.scene.getRootRegion(); Ao2(r, [n], "", true).forEach((a) => a.setMarkerMode(t13, i)); } }, /** * @public * Set the marker modes for objects specified by the list of annotations * @arg `annotations` * @arg `mode` */ setMarkerModeWithAnnotations: function(n, e) { if (this.$module.scene) { const t13 = Zv2(this.$module.scene, n); t13 && t13.objects.length > 0 && t13.objects.forEach((i) => i.setMarkerMode(e)); } }, /** * This is called when mouse cursor enters supported elements * with help tootltips. */ showHelpText: function(n, e = 500) { this.inHelp || (clearTimeout(this.helpTextWait[n]), this.helpTextWait[n] = setTimeout(() => { this.hoverVisibilities[n].value = true, this.$emit("shown-tooltip"); }, e)); }, /** * This is called when mouse cursor exits supported element.. */ hideHelpText: function(n, e = 500) { this.inHelp || (clearTimeout(this.helpTextWait[n]), this.helpTextWait[n] = setTimeout(() => { this.hoverVisibilities[n].value = false; }, e)); }, /** * @public * * Search a object and display the tooltip * @arg "text to search across" * @arg "toggle the tooltip if this is set" */ search: function(n, e) { if (this.$_searchIndex) { if (n === void 0 || n === "" || Array.isArray(n) && n.length === 0) return this.lastSelected.region = "", this.lastSelected.group = "", this.lastSelected.isSearch = true, this.objectSelected([], true), false; { this.lastSelected.region = "", this.lastSelected.group = n, this.lastSelected.isSearch = true; const t13 = this.$_searchIndex.searchAndProcessResult(n), i = t13.zincObjects; if (i.length > 0) { if (this.objectSelected(i, true), e) for (let r = 0; r < i.length; r++) i[r] && i[r].groupName && this.showRegionTooltipWithObjects( t13.label, i, t13.regionPath, true, true ); return true; } else this.objectSelected([], true); } } return false; }, /** * @public * * Get the list of suggested terms based on the provided term. * This can be used for autocomplete. * @arg `term` */ fetchSuggestions: function(n) { return this.$_searchIndex === void 0 ? [] : this.$_searchIndex.auto_suggest(n); }, /** * Called when minimap settings has changed. Pass the * parameters to ZincJS and marked it for update. */ updateMinimapScissor: function() { Object.keys(this.minimapSettings).forEach((n) => { this.$module.scene.minimapScissor[n] = this.minimapSettings[n]; }), this.$module.scene.minimapScissor.updateRequired = true; }, 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 n = this.$module.scene.getMetadataTag("TimeStamps"); this.timeStamps = {}; for (const e in n) this.timeStamps[n[e]] = e; this.timeMax = this.$module.scene.getDuration(); }, restoreSettings: function(n) { if (n) { if (n.viewport) this.$module.scene.getZincCameraControls().setCurrentCameraSettings(n.viewport); else if (n.viewURL && n.viewURL !== "") { const t13 = new URL(n.viewURL, this.url); this.$module.scene.loadViewURL(t13); } else n.region && n.region !== "" && this.viewRegion(n.region); n.visibility && this.$nextTick(() => { this.$refs.scaffoldTreeControls.setState(n.visibility); }), n.background && this.backgroundChangeCallback(n.background), n.viewingMode && this.changeViewingMode(n.viewingMode); const e = n.search; e && e.group && (e.isSearch ? this.search(e.group, true) : this.changeActiveByName(e.group, e.region, true)); } }, setURLFinishCallback: function(n) { 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: t13 } = this.$module.getCentreAndSize(); this.boundingDims.centre = e, this.boundingDims.size = t13, this.$nextTick(() => this.restoreSettings(n)), this.isReady = true; }; }, /** * Function used for getting the current states of the scene. This exported states * can be imported using the importStates method. * * @public */ getState: function() { let n = { format: this.fileFormat, url: this._currentURL, viewport: void 0, visibility: void 0, background: this.currentBackground, viewingMode: this.viewingMode }; if (this.$refs.scaffoldTreeControls && (n.visibility = this.$refs.scaffoldTreeControls.getState()), this.$module.scene) { let e = this.$module.scene.getZincCameraControls(); n.viewport = e.getCurrentViewport(); } return this.lastSelected && this.lastSelected.group && (n.search = { ...this.lastSelected }), n; }, /** * 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(n) { n && (n.url && n.url !== this._currentURL ? this.setURLAndState(n.url, { fileFormat: n.fileFormat, viewport: n.viewport, visibility: n.visibility, background: n.background, viewingMode: this.viewingMode, search: n.search }) : (n.background || n.search || n.viewport || n.viewingMode || n.visibility) && (this.isReady && this.$module.scene ? this.restoreSettings(n) : this.$module.setFinishDownloadCallback( this.setURLFinishCallback({ background: n.background, viewingMode: n.viewingMode, viewport: n.viewport, visibility: n.visibility, search: n.search }) ))); }, /** * export current scene in GLTF. * @arg "Return in binary form when set to true" * * @public */ exportGLTF: function(n) { return this.$module.scene.exportGLTF(n); }, /** * 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(n) { if (this.enableLocalAnnotations) { n.forEach((t13) => { const i = t13.group, r = t13.region; let s = r.slice(-1) === "/" ? r : r + "/"; const o = s.slice(0, -1); t13.region = o, s = s + i; const a = s; t13.item.id = a, t13.feature.id = a; }); const e = n.map((t13) => t13.feature); jh2(this.$module.scene, e), n.forEach((t13) => { this.localAnnotationsList.push({ ...t13 }); }); } }, /** * 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(n, e) { n != this._currentURL && (e != null && e.format && (this.fileFormat = e.format), this._currentURL = n, this.$refs.scaffoldTreeControls && this.$refs.scaffoldTreeControls.clear(), this.loading = true, this.timeVarying = false, this.isReady = false, 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(n, "scene", true) : this.$module.loadOrgansFromURL( n, void 0, void 0, "scene", void 0, true ), this.$module && this.$module.scene && (this.$module.scene.displayMarkers = this.displayMarkers, this.$module.scene.forcePickableObjectsUpdate = true, 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(n) { this.setURLAndState(n, void 0); }, /** * Callback when drawer is toggled. */ drawerToggled: function(n) { this.drawerOpen = n, this.adjustLayout(); }, /** * Callback using ResizeObserver. */ adjustLayout: function() { if (this.$refs.scaffoldContainer) { let n = this.$refs.scaffoldContainer.clientWidth; this.minimisedSlider = n < 812, this.minimisedSlider ? this.sliderPosition = this.drawerOpen ? "right" : "left" : this.sliderPosition = ""; } }, toggleRendering: function(n) { this.$module.zincRenderer && (n ? 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 n = this.$module.NDCCameraControl.getPanZoom(); this.tData.visible && this.showRegionTooltip(this.tData.label, true, true), this.$emit("scaffold-navigated", n); }, /** * Rotate mode - "none", "horizontal", "vertical", "free" but * it will be ignored if flag is set to false. */ toggleSyncControl: function(n, e) { this.$module.toggleSyncControl(n, e), this.$module.setSyncControlCallback(this.syncControlCallback); }, /** * Set the markers for the scene. */ setMarkers: function() { for (const [n, e] of Object.entries(this.markerLabels)) this.setMarkerModeForObjectsWithName(n, e, "on"); } } }; var kp2 = (n) => (pushScopeId("data-v-3a5a2c2d"), n = n(), popScopeId(), n); var jU = { ref: "scaffoldContainer", class: "scaffold-container", "element-loading-text": "Loading...", "element-loading-background": "rgba(0, 0, 0, 0.3)" }; var $U = kp2(() => createBaseVNode("span", { class: "message-text" }, "Beta", -1)); var ZU = kp2(() => createBaseVNode("span", { class: "message-text" }, "What's new?", -1)); var XU = { class: "primitive-controls-box" }; var YU = { class: "animation-data" }; var JU = { class: "purple" }; var qU = { class: "animation-data" }; var KU = { class: "purple" }; var QU = { class: "animation-data" }; var e42 = { class: "bottom-right-control" }; var t42 = kp2(() => createBaseVNode("div", null, [ createTextVNode(" Fit to "), createBaseVNode("br"), createTextVNode(" window ") ], -1)); var n42 = { style: { "margin-bottom": "2px" } }; var i42 = { key: 0, class: "viewing-mode-title" }; var r42 = ["onClick"]; var s42 = ["onClick"]; function o42(n, e, t13, i, r, s) { const o = resolveComponent("map-svg-sprite-color"), a = Hw2, c = resolveComponent("DrawToolbar"), l = I02, d = Bt, h6 = Mu2, p = zw2, g = Bw2, f = resolveComponent("map-svg-icon"), u = ci2, y = Hi2, v = Oy2, m = aa, w = oa2, S = Iy2, T = sa2, M = vd2; return withDirectives((openBlock(), createElementBlock("div", jU, [ createVNode(o), createVNode(a, { createData: n.createData, label: n.tData.label, region: n.tData.region, visible: n.tData.visible, x: n.tData.x, y: n.tData.y, annotationDisplay: s.annotationDisplay, onConfirmCreate: e[0] || (e[0] = (x) => s.confirmCreate(x)), onCancelCreate: e[1] || (e[1] = (x) => s.cancelCreate()), onConfirmDelete: e[2] || (e[2] = (x) => s.confirmDelete()), onTooltipHide: e[3] || (e[3] = (x) => s.onTooltipHide()) }, null, 8, ["createData", "label", "region", "visible", "x", "y", "annotationDisplay"]), createBaseVNode("div", { id: "organsDisplayArea", ref: "display", tabindex: "-1", style: { height: "100%", width: "100%" }, onKeydown: e[4] || (e[4] = withKeys((...x) => s.backgroundChangeCallback && s.backgroundChangeCallback(...x), ["66"])) }, null, 544), withDirectives(createBaseVNode("div", null, [ n.viewingMode === "Annotation" && (n.userInformation || t13.enableLocalAnnotations) ? (openBlock(), createBlock(c, { key: 0, toolbarOptions: n.toolbarOptions, activeDrawTool: n.activeDrawTool, activeDrawMode: n.activeDrawMode, hoverVisibilities: n.hoverVisibilities, onClickToolbar: s.toggleDrawing, onShowTooltip: s.showHelpText, onHideTooltip: s.hideHelpText, ref: "toolbarPopover" }, null, 8, ["toolbarOptions", "activeDrawTool", "activeDrawMode", "hoverVisibilities", "onClickToolbar", "onShowTooltip", "onHideTooltip"])) : createCommentVNode("", true), t13.displayWarning ? (openBlock(), createBlock(h6, { key: 1, ref: "warningPopover", visible: n.hoverVisibilities[7].value, content: t13.warningMessage, placement: "right", width: "max-content", teleported: false, "popper-class": "scaffold-popper message-popper right-popper non-selectable" }, { reference: withCtx(() => [ t13.displayWarning ? (openBlock(), createElementBlock("div", { key: 0, class: "message-icon warning-icon", onMouseover: e[5] || (e[5] = (x) => s.showHelpText(7)), onMouseout: e[6] || (e[6] = (x) => s.hideHelpText(7)) }, [ createVNode(d, null, { default: withCtx(() => [ createVNode(l) ]), _: 1 }), $U ], 32)) : createCommentVNode("", true) ]), _: 1 }, 8, ["visible", "content"])) : createCommentVNode("", true), t13.displayLatestChanges ? (openBlock(), createBlock(h6, { key: 2, visible: n.hoverVisibilities[8].value, content: t13.latestChangesMessage, placement: "right", teleported: false, trigger: "manual", "popper-class": "scaffold-popper message-popper right-popper non-selectable", ref: "whatsNewPopover" }, { reference: withCtx(() => [ t13.displayLatestChanges && t13.latestChangesMessage ? (openBlock(), createElementBlock("div", { key: 0, class: "el-icon-warning message-icon latest-changesicon", onMouseover: e[7] || (e[7] = (x) => s.showHelpText(8)), onMouseout: e[8] || (e[8] = (x) => s.hideHelpText(8)) }, [ createVNode(d, null, { default: withCtx(() => [ createVNode(l) ]), _: 1 }), ZU ], 32)) : createCommentVNode("", true) ]), _: 1 }, 8, ["visible", "content"])) : createCommentVNode("", true), createVNode(h6, { visible: n.hoverVisibilities[6].value, content: "Change region visibility", placement: "right", width: "max-content", teleported: false, trigger: "manual", "popper-class": "scaffold-popper right-popper non-selectable", ref: "regionVisibilityPopover" }, { reference: withCtx(() => [ createVNode(p, { ref: "scaffoldTreeControls", isReady: n.isReady, "show-colour-picker": t13.showColourPicker, onObjectSelected: s.objectSelected, onObjectHovered: s.objectHovered, onDrawerToggled: s.drawerToggled }, null, 8, ["isReady", "show-colour-picker", "onObjectSelected", "onObjectHovered", "onDrawerToggled"]) ]), _: 1 }, 8, ["visible"]), createBaseVNode("div", XU, [ createVNode(g, { ref: "primitiveControls", createData: n.createData, onPrimitivesUpdated: s.primitivesUpdated }, null, 8, ["createData", "onPrimitivesUpdated"]) ]), n.timeVarying ? (openBlock(), createBlock(h6, { key: 3, ref: "sliderPopover", width: "max-content", visible: n.hoverVisibilities[5].value, content: "Move the slider to animate the region", placement: "top", teleported: false, trigger: "manual", "popper-class": "scaffold-popper top-popper non-selectable" }, { reference: withCtx(() => [ n.timeVarying ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(["time-slider-container", [n.minimisedSlider ? "minimised" : "", n.sliderPosition]]) }, [ createVNode(S, { type: "card" }, { default: withCtx(() => [ createVNode(v, { label: "Animate scaffold" }, { default: withCtx(() => [ createVNode(y, { class: "tab-content" }, { default: withCtx(() => [ n.isPlaying ? (openBlock(), createBlock(f, { key: 0, icon: "pause", class: "icon-button video-button", onClick: e[9] || (e[9] = (x) => s.play(false)) })) : (openBlock(), createBlock(f, { key: 1, icon: "play", class: "video-button icon-button", onClick: e[10] || (e[10] = (x) => s.play(true)) })), createVNode(u, { min: 0, max: n.timeMax, "model-value": n.currentTime / 100 * n.timeMax, step: 0.1, "tooltip-class": "time-slider-tooltip", class: "slider", "format-tooltip": s.formatTooltip, marks: n.timeStamps, onInput: e[11] || (e[11] = (x) => s.timeChange(x)) }, null, 8, ["max", "model-value", "format-tooltip", "marks"]) ]), _: 1 }) ]), _: 1 }), createVNode(v, { label: "Animation data" }, { default: withCtx(() => [ createVNode(y, { class: "tab-content" }, { default: withCtx(() => [ createBaseVNode("div", YU, [ createTextVNode(" Original duration: "), createBaseVNode("div", JU, toDisplayString(n.orginalDuration), 1) ]), createBaseVNode("div", qU, [ createTextVNode(" Animation duration: "), createBaseVNode("div", KU, toDisplayString(n.animateDuration), 1) ]), createBaseVNode("div", QU, [ createTextVNode(" Playback speed "), createVNode(w, { teleported: true, "model-value": n.currentSpeed, placeholder: "Select", class: "scaffold-select-box speed", "popper-class": "scaffold_viewer_dropdown", onChange: e[12] || (e[12] = (x) => s.speedChanged(x)) }, { default: withCtx(() => [ (openBlock(true), createElementBlock(Fragment, null, renderList(n.playSpeed, (x) => (openBlock(), createBlock(m, { key: x.value, label: x.label, value: x.value }, null, 8, ["label", "value"]))), 128)) ]), _: 1 }, 8, ["model-value"]) ]) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }) ], 2)) : createCommentVNode("", true) ]), _: 1 }, 8, ["visible"])) : createCommentVNode("", true), createBaseVNode("div", e42, [ createVNode(h6, { visible: n.hoverVisibilities[0].value, content: "Zoom in", width: "max-content", placement: "left", teleported: false, trigger: "manual", "popper-class": "scaffold-popper left-popper non-selectable", ref: "zoomInPopover" }, { reference: withCtx(() => [ createVNode(f, { icon: "zoomIn", class: "icon-button zoomIn", onClick: e[13] || (e[13] = (x) => s.zoomIn()), onMouseover: e[14] || (e[14] = (x) => s.showHelpText(0)), onMouseout: e[15] || (e[15] = (x) => s.hideHelpText(0)) }) ]), _: 1 }, 8, ["visible"]), createVNode(h6, { visible: n.hoverVisibilities[1].value, content: "Zoom out", placement: "top-end", width: "max-content", teleported: false, trigger: "manual", "popper-class": "scaffold-popper popper-zoomout non-selectable", ref: "zoomOutPopover" }, { reference: withCtx(() => [ createVNode(f, { icon: "zoomOut", class: "icon-button zoomOut", onClick: e[16] || (e[16] = (x) => s.zoomOut()), onMouseover: e[17] || (e[17] = (x) => s.showHelpText(1)), onMouseout: e[18] || (e[18] = (x) => s.hideHelpText(1)) }) ]), _: 1 }, 8, ["visible"]), createVNode(h6, { visible: n.hoverVisibilities[2].value, placement: "top", teleported: false, trigger: "manual", width: "max-content", "popper-class": "scaffold-popper non-selectable", ref: "zoomFitPopover" }, { reference: withCtx(() => [ createVNode(f, { icon: "fitWindow", class: "icon-button fitWindow", onClick: e[19] || (e[19] = (x) => s.fitWindow()), onMouseover: e[20] || (e[20] = (x) => s.showHelpText(2)), onMouseout: e[21] || (e[21] = (x) => s.hideHelpText(2)) }) ]), default: withCtx(() => [ t42 ]), _: 1 }, 8, ["visible"]) ]), n.openMapRef ? (openBlock(), createBlock(h6, { key: 4, ref: "open-map-popover", "virtual-ref": n.openMapRef, placement: "top-start", width: "128", teleported: false, trigger: "click", "popper-class": "open-map-popper", "virtual-triggering": "" }, { default: withCtx(() => [ (openBlock(true), createElementBlock(Fragment, null, renderList(t13.openMapOptions, (x) => (openBlock(), createBlock(y, { key: x.key }, { default: withCtx(() => [ createVNode(T, { type: "primary", plain: "", onClick: (_) => n.$emit("open-map", x.key) }, { default: withCtx(() => [ createTextVNode(toDisplayString(x.display), 1) ]), _: 2 }, 1032, ["onClick"]) ]), _: 2 }, 1024))), 128)) ]), _: 1 }, 8, ["virtual-ref"])) : createCommentVNode("", true), createVNode(h6, { ref: "backgroundPopover", "virtual-ref": n.backgroundIconRef, placement: "top-start", width: "128", teleported: false, trigger: "click", "popper-class": "background-popper non-selectable h-auto", "virtual-triggering": "" }, { default: withCtx(() => [ createBaseVNode("div", null, [ createVNode(y, { class: "backgroundText" }, { default: withCtx(() => [ createTextVNode("Viewing Mode") ]), _: 1 }), createVNode(y, { class: "backgroundControl" }, { default: withCtx(() => [ createBaseVNode("div", n42, [ (openBlock(true), createElementBlock(Fragment, null, renderList(n.viewingModes, (x, _, E) => (openBlock(), createElementBlock(Fragment, { key: _ }, [ _ === n.viewingMode ? (openBlock(), createElementBlock("span", i42, [ createBaseVNode("b", null, toDisplayString(_), 1) ])) : (openBlock(), createElementBlock("span", { key: 1, class: "viewing-mode-unselected", onClick: (L) => s.changeViewingMode(_) }, toDisplayString(_), 9, r42)) ], 64))), 128)) ]), createVNode(y, { class: "viewing-mode-description" }, { default: withCtx(() => [ createTextVNode(toDisplayString(n.viewingModes[n.viewingMode]), 1) ]), _: 1 }) ]), _: 1 }), createVNode(y, { class: "backgroundSpacer" }), createVNode(y, { class: "backgroundText" }, { default: withCtx(() => [ createTextVNode(" Change background ") ]), _: 1 }), createVNode(y, { class: "backgroundChooser" }, { default: withCtx(() => [ (openBlock(true), createElementBlock(Fragment, null, renderList(n.availableBackground, (x) => (openBlock(), createElementBlock("div", { key: x, class: normalizeClass([ "backgroundChoice", x, x == n.currentBackground ? "active" : "" ]), onClick: (_) => s.backgroundChangeCallback(x) }, null, 10, s42))), 128)) ]), _: 1 }) ]) ]), _: 1 }, 8, ["virtual-ref"]), createBaseVNode("div", { class: normalizeClass(["settings-group", { open: n.drawerOpen, close: !n.drawerOpen }]) }, [ createVNode(y, null, { default: withCtx(() => [ createVNode(h6, { visible: n.hoverVisibilities[3].value, content: "Open new map", placement: "right", teleported: false, trigger: "manual", width: "max-content", "popper-class": "scaffold-popper right-popper non-selectable", ref: "openMapPopover" }, { reference: withCtx(() => [ t13.enableOpenMapUI && t13.openMapOptions.length > 0 ? (openBlock(), createBlock(f, { key: 0, ref: "openMapRef", icon: "openMap", class: "icon-button open-map-button", onMouseover: e[22] || (e[22] = (x) => s.showHelpText(3)), onMouseout: e[23] || (e[23] = (x) => s.hideHelpText(3)) }, null, 512)) : createCommentVNode("", true) ]), _: 1 }, 8, ["visible"]) ]), _: 1 }), createVNode(y, null, { default: withCtx(() => [ createVNode(h6, { visible: n.hoverVisibilities[4].value, content: "Change background color", placement: "right", width: "max-content", teleported: false, trigger: "manual", "popper-class": "scaffold-popper right-popper non-selectable", ref: "settingsPopover" }, { reference: withCtx(() => [ createVNode(f, { ref: "backgroundIconRef", icon: "changeBckgd", class: "icon-button", onMouseover: e[24] || (e[24] = (x) => s.showHelpText(4)), onMouseout: e[25] || (e[25] = (x) => s.hideHelpText(4)) }, null, 512) ]), _: 1 }, 8, ["visible"]) ]), _: 1 }) ], 2) ], 512), [ [vShow, t13.displayUI && !n.isTransitioning] ]) ])), [ [M, n.loading] ]); } var u42 = wr(WU, [["render", o42], ["__scopeId", "data-v-3a5a2c2d"]]); export { u42 as ScaffoldVuer }; /*! Bundled license information: @abi-software/map-utilities/dist/map-utilities.js: (** * @vue/shared v3.4.27 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **) (*! Element Plus Icons Vue v2.3.1 *) (*! Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) Licensed under The MIT License (http://opensource.org/licenses/MIT) *) (*! Event object based on jQuery events, MIT license https://jquery.org/license/ https://tldrlegal.com/license/mit-license https://github.com/jquery/jquery/blob/master/src/event.js *) (*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License *) (*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License *) @abi-software/scaffoldvuer/dist/scaffoldvuer.js: (** * @vue/shared v3.5.11 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **) (*! Element Plus Icons Vue v2.3.1 *) (** * @license * Copyright 2010-2021 Three.js Authors * SPDX-License-Identifier: MIT *) (*! * pinia v2.2.1 * (c) 2024 Eduardo San Martin Morote * @license MIT *) (*! js-cookie v3.0.5 | MIT *) */ //# sourceMappingURL=@abi-software_scaffoldvuer.js.map