import { R as K1, U as Q1, w as ew, h as tw, q as iw, G as rw, _ as nw, K as ow, E as Wu } from "./index-DsKXfcyp.js";
import { C as aw } from "./ContentMixin-BDLOq1Mp.js";
import { ref as Ae, defineComponent as Ie, computed as ce, openBlock as fe, createElementBlock as Ce, mergeProps as Pr, unref as H, renderSlot as qe, useAttrs as sw, useSlots as au, shallowRef as Pi, watch as Je, nextTick as _t, onMounted as ni, toRef as ki, createCommentVNode as Ve, Fragment as Gt, normalizeClass as Le, createElementVNode as ke, createBlock as He, withCtx as pe, resolveDynamicComponent as Fi, withModifiers as ui, createVNode as se, toDisplayString as wt, normalizeStyle as It, provide as pi, reactive as Yi, onActivated as lw, onUpdated as rp, inject as ct, onBeforeUnmount as sr, withDirectives as Bt, cloneVNode as cw, Text as o0, Comment as uw, Transition as hl, vShow as yi, readonly as a0, onDeactivated as hw, toHandlers as dw, withKeys as gr, createTextVNode as yt, createSlots as pw, toRefs as cn, getCurrentInstance as si, h as ba, renderList as rr, onUnmounted as s0, markRaw as Ai, watchEffect as l0, warn as fw, onBeforeMount as mw, toRaw as np, getCurrentScope as c0, onScopeDispose as u0, isRef as Ro, isVNode as Qh, Teleport as gw, resolveComponent as Ri, resolveDirective as vw, toHandlerKey as yw, vModelText as bw, createApp as xw, hasInjectionContext as ww, effectScope as _w, isReactive as op, pushScopeId as Mw, popScopeId as Sw } from "vue";
const Kr = (i, e, { checkForDefaultPrevented: t = !0 } = {}) => (r) => {
const n = i == null ? void 0 : i(r);
if (t === !1 || !n)
return e == null ? void 0 : e(r);
};
var Tw = Object.defineProperty, Ew = Object.defineProperties, Aw = Object.getOwnPropertyDescriptors, Vf = Object.getOwnPropertySymbols, Cw = Object.prototype.hasOwnProperty, Lw = Object.prototype.propertyIsEnumerable, Hf = (i, e, t) => e in i ? Tw(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, Rw = (i, e) => {
for (var t in e || (e = {}))
Cw.call(e, t) && Hf(i, t, e[t]);
if (Vf)
for (var t of Vf(e))
Lw.call(e, t) && Hf(i, t, e[t]);
return i;
}, Ow = (i, e) => Ew(i, Aw(e));
function jf(i, e) {
var t;
const r = Pi();
return l0(() => {
r.value = i();
}, Ow(Rw({}, e), {
flush: (t = void 0) != null ? t : "sync"
})), a0(r);
}
var Gf;
const ii = typeof window < "u", Pw = (i) => typeof i == "string", h0 = () => {
}, ed = ii && ((Gf = window == null ? void 0 : window.navigator) == null ? void 0 : Gf.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
function d0(i) {
return typeof i == "function" ? i() : H(i);
}
function Iw(i) {
return i;
}
function su(i) {
return c0() ? (u0(i), !0) : !1;
}
function Dw(i, e = !0) {
si() ? ni(i) : e ? i() : _t(i);
}
function rn(i) {
var e;
const t = d0(i);
return (e = t == null ? void 0 : t.$el) != null ? e : t;
}
const dl = ii ? window : void 0, Nw = ii ? window.document : void 0;
function hi(...i) {
let e, t, r, n;
if (Pw(i[0]) || Array.isArray(i[0]) ? ([t, r, n] = i, e = dl) : [e, t, r, n] = i, !e)
return h0;
Array.isArray(t) || (t = [t]), Array.isArray(r) || (r = [r]);
const o = [], a = () => {
o.forEach((h) => h()), o.length = 0;
}, s = (h, u, p, m) => (h.addEventListener(u, p, m), () => h.removeEventListener(u, p, m)), c = Je(() => [rn(e), d0(n)], ([h, u]) => {
a(), h && o.push(...t.flatMap((p) => r.map((m) => s(h, p, m, u))));
}, { immediate: !0, flush: "post" }), l = () => {
c(), a();
};
return su(l), l;
}
let Wf = !1;
function Bw(i, e, t = {}) {
const { window: r = dl, ignore: n = [], capture: o = !0, detectIframe: a = !1 } = t;
if (!r)
return;
ed && !Wf && (Wf = !0, Array.from(r.document.body.children).forEach((h) => h.addEventListener("click", h0)));
let s = !0;
const c = (h) => n.some((u) => {
if (typeof u == "string")
return Array.from(r.document.querySelectorAll(u)).some((p) => p === h.target || h.composedPath().includes(p));
{
const p = rn(u);
return p && (h.target === p || h.composedPath().includes(p));
}
}), l = [
hi(r, "click", (h) => {
const u = rn(i);
if (!(!u || u === h.target || h.composedPath().includes(u))) {
if (h.detail === 0 && (s = !c(h)), !s) {
s = !0;
return;
}
e(h);
}
}, { passive: !0, capture: o }),
hi(r, "pointerdown", (h) => {
const u = rn(i);
u && (s = !h.composedPath().includes(u) && !c(h));
}, { passive: !0 }),
a && hi(r, "blur", (h) => {
var u;
const p = rn(i);
((u = r.document.activeElement) == null ? void 0 : u.tagName) === "IFRAME" && !(p != null && p.contains(r.document.activeElement)) && e(h);
})
].filter(Boolean);
return () => l.forEach((h) => h());
}
function p0(i, e = !1) {
const t = Ae(), r = () => t.value = !!i();
return r(), Dw(r, e), t;
}
const $f = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, qf = "__vueuse_ssr_handlers__";
$f[qf] = $f[qf] || {};
function kw({ document: i = Nw } = {}) {
if (!i)
return Ae("visible");
const e = Ae(i.visibilityState);
return hi(i, "visibilitychange", () => {
e.value = i.visibilityState;
}), e;
}
var Xf = Object.getOwnPropertySymbols, Fw = Object.prototype.hasOwnProperty, zw = Object.prototype.propertyIsEnumerable, Uw = (i, e) => {
var t = {};
for (var r in i)
Fw.call(i, r) && e.indexOf(r) < 0 && (t[r] = i[r]);
if (i != null && Xf)
for (var r of Xf(i))
e.indexOf(r) < 0 && zw.call(i, r) && (t[r] = i[r]);
return t;
};
function ir(i, e, t = {}) {
const r = t, { window: n = dl } = r, o = Uw(r, ["window"]);
let a;
const s = p0(() => n && "ResizeObserver" in n), c = () => {
a && (a.disconnect(), a = void 0);
}, l = Je(() => rn(i), (u) => {
c(), s.value && n && u && (a = new ResizeObserver(e), a.observe(u, o));
}, { immediate: !0, flush: "post" }), h = () => {
c(), l();
};
return su(h), {
isSupported: s,
stop: h
};
}
var Zf = Object.getOwnPropertySymbols, Vw = Object.prototype.hasOwnProperty, Hw = Object.prototype.propertyIsEnumerable, jw = (i, e) => {
var t = {};
for (var r in i)
Vw.call(i, r) && e.indexOf(r) < 0 && (t[r] = i[r]);
if (i != null && Zf)
for (var r of Zf(i))
e.indexOf(r) < 0 && Hw.call(i, r) && (t[r] = i[r]);
return t;
};
function Gw(i, e, t = {}) {
const r = t, { window: n = dl } = r, o = jw(r, ["window"]);
let a;
const s = p0(() => n && "MutationObserver" in n), c = () => {
a && (a.disconnect(), a = void 0);
}, l = Je(() => rn(i), (u) => {
c(), s.value && n && u && (a = new MutationObserver(e), a.observe(u, o));
}, { immediate: !0 }), h = () => {
c(), l();
};
return su(h), {
isSupported: s,
stop: h
};
}
var Yf;
(function(i) {
i.UP = "UP", i.RIGHT = "RIGHT", i.DOWN = "DOWN", i.LEFT = "LEFT", i.NONE = "NONE";
})(Yf || (Yf = {}));
var Ww = Object.defineProperty, Jf = Object.getOwnPropertySymbols, $w = Object.prototype.hasOwnProperty, qw = Object.prototype.propertyIsEnumerable, Kf = (i, e, t) => e in i ? Ww(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, Xw = (i, e) => {
for (var t in e || (e = {}))
$w.call(e, t) && Kf(i, t, e[t]);
if (Jf)
for (var t of Jf(e))
qw.call(e, t) && Kf(i, t, e[t]);
return i;
};
const Zw = {
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]
};
Xw({
linear: Iw
}, Zw);
function Yw({ window: i = dl } = {}) {
if (!i)
return Ae(!1);
const e = Ae(i.document.hasFocus());
return hi(i, "blur", () => {
e.value = !1;
}), hi(i, "focus", () => {
e.value = !0;
}), e;
}
const Jw = () => ii && /firefox/i.test(window.navigator.userAgent);
/**
* @vue/shared v3.5.11
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
process.env.NODE_ENV !== "production" && Object.freeze({});
process.env.NODE_ENV !== "production" && Object.freeze([]);
const $s = () => {
}, Kw = Object.prototype.hasOwnProperty, Qf = (i, e) => Kw.call(i, e), zi = Array.isArray, Ci = (i) => typeof i == "function", Ii = (i) => typeof i == "string", Oi = (i) => i !== null && typeof i == "object", Qw = Object.prototype.toString, e_ = (i) => Qw.call(i), $u = (i) => e_(i).slice(8, -1), ap = (i) => {
const e = /* @__PURE__ */ Object.create(null);
return (t) => e[t] || (e[t] = i(t));
}, t_ = /-(\w)/g, i_ = ap(
(i) => i.replace(t_, (e, t) => t ? t.toUpperCase() : "")
), r_ = /\B([A-Z])/g, n_ = ap(
(i) => i.replace(r_, "-$1").toLowerCase()
), o_ = ap((i) => i.charAt(0).toUpperCase() + i.slice(1));
var f0 = typeof global == "object" && global && global.Object === Object && global, a_ = typeof self == "object" && self && self.Object === Object && self, Vr = f0 || a_ || Function("return this")(), Br = Vr.Symbol, m0 = Object.prototype, s_ = m0.hasOwnProperty, l_ = m0.toString, gs = Br ? Br.toStringTag : void 0;
function c_(i) {
var e = s_.call(i, gs), t = i[gs];
try {
i[gs] = void 0;
var r = !0;
} catch {
}
var n = l_.call(i);
return r && (e ? i[gs] = t : delete i[gs]), n;
}
var u_ = Object.prototype, h_ = u_.toString;
function d_(i) {
return h_.call(i);
}
var p_ = "[object Null]", f_ = "[object Undefined]", em = Br ? Br.toStringTag : void 0;
function ts(i) {
return i == null ? i === void 0 ? f_ : p_ : em && em in Object(i) ? c_(i) : d_(i);
}
function Ca(i) {
return i != null && typeof i == "object";
}
var m_ = "[object Symbol]";
function lu(i) {
return typeof i == "symbol" || Ca(i) && ts(i) == m_;
}
function g_(i, e) {
for (var t = -1, r = i == null ? 0 : i.length, n = Array(r); ++t < r; )
n[t] = e(i[t], t, i);
return n;
}
var br = Array.isArray, v_ = 1 / 0, tm = Br ? Br.prototype : void 0, im = tm ? tm.toString : void 0;
function g0(i) {
if (typeof i == "string")
return i;
if (br(i))
return g_(i, g0) + "";
if (lu(i))
return im ? im.call(i) : "";
var e = i + "";
return e == "0" && 1 / i == -v_ ? "-0" : e;
}
var y_ = /\s/;
function b_(i) {
for (var e = i.length; e-- && y_.test(i.charAt(e)); )
;
return e;
}
var x_ = /^\s+/;
function w_(i) {
return i && i.slice(0, b_(i) + 1).replace(x_, "");
}
function Gn(i) {
var e = typeof i;
return i != null && (e == "object" || e == "function");
}
var rm = NaN, __ = /^[-+]0x[0-9a-f]+$/i, M_ = /^0b[01]+$/i, S_ = /^0o[0-7]+$/i, T_ = parseInt;
function nm(i) {
if (typeof i == "number")
return i;
if (lu(i))
return rm;
if (Gn(i)) {
var e = typeof i.valueOf == "function" ? i.valueOf() : i;
i = Gn(e) ? e + "" : e;
}
if (typeof i != "string")
return i === 0 ? i : +i;
i = w_(i);
var t = M_.test(i);
return t || S_.test(i) ? T_(i.slice(2), t ? 2 : 8) : __.test(i) ? rm : +i;
}
function v0(i) {
return i;
}
var E_ = "[object AsyncFunction]", A_ = "[object Function]", C_ = "[object GeneratorFunction]", L_ = "[object Proxy]";
function y0(i) {
if (!Gn(i))
return !1;
var e = ts(i);
return e == A_ || e == C_ || e == E_ || e == L_;
}
var qu = Vr["__core-js_shared__"], om = function() {
var i = /[^.]+$/.exec(qu && qu.keys && qu.keys.IE_PROTO || "");
return i ? "Symbol(src)_1." + i : "";
}();
function R_(i) {
return !!om && om in i;
}
var O_ = Function.prototype, P_ = O_.toString;
function Vo(i) {
if (i != null) {
try {
return P_.call(i);
} catch {
}
try {
return i + "";
} catch {
}
}
return "";
}
var I_ = /[\\^$.*+?()[\]{}|]/g, D_ = /^\[object .+?Constructor\]$/, N_ = Function.prototype, B_ = Object.prototype, k_ = N_.toString, F_ = B_.hasOwnProperty, z_ = RegExp(
"^" + k_.call(F_).replace(I_, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function U_(i) {
if (!Gn(i) || R_(i))
return !1;
var e = y0(i) ? z_ : D_;
return e.test(Vo(i));
}
function V_(i, e) {
return i == null ? void 0 : i[e];
}
function Ho(i, e) {
var t = V_(i, e);
return U_(t) ? t : void 0;
}
var td = Ho(Vr, "WeakMap");
function H_(i, e, t) {
switch (t.length) {
case 0:
return i.call(e);
case 1:
return i.call(e, t[0]);
case 2:
return i.call(e, t[0], t[1]);
case 3:
return i.call(e, t[0], t[1], t[2]);
}
return i.apply(e, t);
}
var j_ = 800, G_ = 16, W_ = Date.now;
function $_(i) {
var e = 0, t = 0;
return function() {
var r = W_(), n = G_ - (r - t);
if (t = r, n > 0) {
if (++e >= j_)
return arguments[0];
} else
e = 0;
return i.apply(void 0, arguments);
};
}
function q_(i) {
return function() {
return i;
};
}
var jc = function() {
try {
var i = Ho(Object, "defineProperty");
return i({}, "", {}), i;
} catch {
}
}(), X_ = jc ? function(i, e) {
return jc(i, "toString", {
configurable: !0,
enumerable: !1,
value: q_(e),
writable: !0
});
} : v0, Z_ = $_(X_);
function Y_(i, e, t, r) {
i.length;
for (var n = t + 1; n--; )
if (e(i[n], n, i))
return n;
return -1;
}
var J_ = 9007199254740991, K_ = /^(?:0|[1-9]\d*)$/;
function sp(i, e) {
var t = typeof i;
return e = e ?? J_, !!e && (t == "number" || t != "symbol" && K_.test(i)) && i > -1 && i % 1 == 0 && i < e;
}
function Q_(i, e, t) {
e == "__proto__" && jc ? jc(i, e, {
configurable: !0,
enumerable: !0,
value: t,
writable: !0
}) : i[e] = t;
}
function lp(i, e) {
return i === e || i !== i && e !== e;
}
var eM = Object.prototype, tM = eM.hasOwnProperty;
function iM(i, e, t) {
var r = i[e];
(!(tM.call(i, e) && lp(r, t)) || t === void 0 && !(e in i)) && Q_(i, e, t);
}
var am = Math.max;
function rM(i, e, t) {
return e = am(e === void 0 ? i.length - 1 : e, 0), function() {
for (var r = arguments, n = -1, o = am(r.length - e, 0), a = Array(o); ++n < o; )
a[n] = r[e + n];
n = -1;
for (var s = Array(e + 1); ++n < e; )
s[n] = r[n];
return s[e] = t(a), H_(i, this, s);
};
}
var nM = 9007199254740991;
function cp(i) {
return typeof i == "number" && i > -1 && i % 1 == 0 && i <= nM;
}
function oM(i) {
return i != null && cp(i.length) && !y0(i);
}
var aM = Object.prototype;
function sM(i) {
var e = i && i.constructor, t = typeof e == "function" && e.prototype || aM;
return i === t;
}
function lM(i, e) {
for (var t = -1, r = Array(i); ++t < i; )
r[t] = e(t);
return r;
}
var cM = "[object Arguments]";
function sm(i) {
return Ca(i) && ts(i) == cM;
}
var b0 = Object.prototype, uM = b0.hasOwnProperty, hM = b0.propertyIsEnumerable, up = sm(/* @__PURE__ */ function() {
return arguments;
}()) ? sm : function(i) {
return Ca(i) && uM.call(i, "callee") && !hM.call(i, "callee");
};
function dM() {
return !1;
}
var x0 = typeof exports == "object" && exports && !exports.nodeType && exports, lm = x0 && typeof module == "object" && module && !module.nodeType && module, pM = lm && lm.exports === x0, cm = pM ? Vr.Buffer : void 0, fM = cm ? cm.isBuffer : void 0, id = fM || dM, mM = "[object Arguments]", gM = "[object Array]", vM = "[object Boolean]", yM = "[object Date]", bM = "[object Error]", xM = "[object Function]", wM = "[object Map]", _M = "[object Number]", MM = "[object Object]", SM = "[object RegExp]", TM = "[object Set]", EM = "[object String]", AM = "[object WeakMap]", CM = "[object ArrayBuffer]", LM = "[object DataView]", RM = "[object Float32Array]", OM = "[object Float64Array]", PM = "[object Int8Array]", IM = "[object Int16Array]", DM = "[object Int32Array]", NM = "[object Uint8Array]", BM = "[object Uint8ClampedArray]", kM = "[object Uint16Array]", FM = "[object Uint32Array]", Ot = {};
Ot[RM] = Ot[OM] = Ot[PM] = Ot[IM] = Ot[DM] = Ot[NM] = Ot[BM] = Ot[kM] = Ot[FM] = !0;
Ot[mM] = Ot[gM] = Ot[CM] = Ot[vM] = Ot[LM] = Ot[yM] = Ot[bM] = Ot[xM] = Ot[wM] = Ot[_M] = Ot[MM] = Ot[SM] = Ot[TM] = Ot[EM] = Ot[AM] = !1;
function zM(i) {
return Ca(i) && cp(i.length) && !!Ot[ts(i)];
}
function UM(i) {
return function(e) {
return i(e);
};
}
var w0 = typeof exports == "object" && exports && !exports.nodeType && exports, ks = w0 && typeof module == "object" && module && !module.nodeType && module, VM = ks && ks.exports === w0, Xu = VM && f0.process, um = function() {
try {
var i = ks && ks.require && ks.require("util").types;
return i || Xu && Xu.binding && Xu.binding("util");
} catch {
}
}(), hm = um && um.isTypedArray, _0 = hm ? UM(hm) : zM, HM = Object.prototype, jM = HM.hasOwnProperty;
function GM(i, e) {
var t = br(i), r = !t && up(i), n = !t && !r && id(i), o = !t && !r && !n && _0(i), a = t || r || n || o, s = a ? lM(i.length, String) : [], c = s.length;
for (var l in i)
jM.call(i, l) && !(a && // Safari 9 has enumerable `arguments.length` in strict mode.
(l == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
n && (l == "offset" || l == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
o && (l == "buffer" || l == "byteLength" || l == "byteOffset") || // Skip index properties.
sp(l, c))) && s.push(l);
return s;
}
function WM(i, e) {
return function(t) {
return i(e(t));
};
}
var $M = WM(Object.keys, Object), qM = Object.prototype, XM = qM.hasOwnProperty;
function ZM(i) {
if (!sM(i))
return $M(i);
var e = [];
for (var t in Object(i))
XM.call(i, t) && t != "constructor" && e.push(t);
return e;
}
function M0(i) {
return oM(i) ? GM(i) : ZM(i);
}
var YM = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, JM = /^\w*$/;
function hp(i, e) {
if (br(i))
return !1;
var t = typeof i;
return t == "number" || t == "symbol" || t == "boolean" || i == null || lu(i) ? !0 : JM.test(i) || !YM.test(i) || e != null && i in Object(e);
}
var qs = Ho(Object, "create");
function KM() {
this.__data__ = qs ? qs(null) : {}, this.size = 0;
}
function QM(i) {
var e = this.has(i) && delete this.__data__[i];
return this.size -= e ? 1 : 0, e;
}
var eS = "__lodash_hash_undefined__", tS = Object.prototype, iS = tS.hasOwnProperty;
function rS(i) {
var e = this.__data__;
if (qs) {
var t = e[i];
return t === eS ? void 0 : t;
}
return iS.call(e, i) ? e[i] : void 0;
}
var nS = Object.prototype, oS = nS.hasOwnProperty;
function aS(i) {
var e = this.__data__;
return qs ? e[i] !== void 0 : oS.call(e, i);
}
var sS = "__lodash_hash_undefined__";
function lS(i, e) {
var t = this.__data__;
return this.size += this.has(i) ? 0 : 1, t[i] = qs && e === void 0 ? sS : e, this;
}
function Oo(i) {
var e = -1, t = i == null ? 0 : i.length;
for (this.clear(); ++e < t; ) {
var r = i[e];
this.set(r[0], r[1]);
}
}
Oo.prototype.clear = KM;
Oo.prototype.delete = QM;
Oo.prototype.get = rS;
Oo.prototype.has = aS;
Oo.prototype.set = lS;
function cS() {
this.__data__ = [], this.size = 0;
}
function cu(i, e) {
for (var t = i.length; t--; )
if (lp(i[t][0], e))
return t;
return -1;
}
var uS = Array.prototype, hS = uS.splice;
function dS(i) {
var e = this.__data__, t = cu(e, i);
if (t < 0)
return !1;
var r = e.length - 1;
return t == r ? e.pop() : hS.call(e, t, 1), --this.size, !0;
}
function pS(i) {
var e = this.__data__, t = cu(e, i);
return t < 0 ? void 0 : e[t][1];
}
function fS(i) {
return cu(this.__data__, i) > -1;
}
function mS(i, e) {
var t = this.__data__, r = cu(t, i);
return r < 0 ? (++this.size, t.push([i, e])) : t[r][1] = e, this;
}
function fn(i) {
var e = -1, t = i == null ? 0 : i.length;
for (this.clear(); ++e < t; ) {
var r = i[e];
this.set(r[0], r[1]);
}
}
fn.prototype.clear = cS;
fn.prototype.delete = dS;
fn.prototype.get = pS;
fn.prototype.has = fS;
fn.prototype.set = mS;
var Xs = Ho(Vr, "Map");
function gS() {
this.size = 0, this.__data__ = {
hash: new Oo(),
map: new (Xs || fn)(),
string: new Oo()
};
}
function vS(i) {
var e = typeof i;
return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? i !== "__proto__" : i === null;
}
function uu(i, e) {
var t = i.__data__;
return vS(e) ? t[typeof e == "string" ? "string" : "hash"] : t.map;
}
function yS(i) {
var e = uu(this, i).delete(i);
return this.size -= e ? 1 : 0, e;
}
function bS(i) {
return uu(this, i).get(i);
}
function xS(i) {
return uu(this, i).has(i);
}
function wS(i, e) {
var t = uu(this, i), r = t.size;
return t.set(i, e), this.size += t.size == r ? 0 : 1, this;
}
function mn(i) {
var e = -1, t = i == null ? 0 : i.length;
for (this.clear(); ++e < t; ) {
var r = i[e];
this.set(r[0], r[1]);
}
}
mn.prototype.clear = gS;
mn.prototype.delete = yS;
mn.prototype.get = bS;
mn.prototype.has = xS;
mn.prototype.set = wS;
var _S = "Expected a function";
function dp(i, e) {
if (typeof i != "function" || e != null && typeof e != "function")
throw new TypeError(_S);
var t = function() {
var r = arguments, n = e ? e.apply(this, r) : r[0], o = t.cache;
if (o.has(n))
return o.get(n);
var a = i.apply(this, r);
return t.cache = o.set(n, a) || o, a;
};
return t.cache = new (dp.Cache || mn)(), t;
}
dp.Cache = mn;
var MS = 500;
function SS(i) {
var e = dp(i, function(r) {
return t.size === MS && t.clear(), r;
}), t = e.cache;
return e;
}
var TS = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, ES = /\\(\\)?/g, AS = SS(function(i) {
var e = [];
return i.charCodeAt(0) === 46 && e.push(""), i.replace(TS, function(t, r, n, o) {
e.push(n ? o.replace(ES, "$1") : r || t);
}), e;
});
function CS(i) {
return i == null ? "" : g0(i);
}
function hu(i, e) {
return br(i) ? i : hp(i, e) ? [i] : AS(CS(i));
}
var LS = 1 / 0;
function pl(i) {
if (typeof i == "string" || lu(i))
return i;
var e = i + "";
return e == "0" && 1 / i == -LS ? "-0" : e;
}
function pp(i, e) {
e = hu(e, i);
for (var t = 0, r = e.length; i != null && t < r; )
i = i[pl(e[t++])];
return t && t == r ? i : void 0;
}
function Qr(i, e, t) {
var r = i == null ? void 0 : pp(i, e);
return r === void 0 ? t : r;
}
function S0(i, e) {
for (var t = -1, r = e.length, n = i.length; ++t < r; )
i[n + t] = e[t];
return i;
}
var dm = Br ? Br.isConcatSpreadable : void 0;
function RS(i) {
return br(i) || up(i) || !!(dm && i && i[dm]);
}
function OS(i, e, t, r, n) {
var o = -1, a = i.length;
for (t || (t = RS), n || (n = []); ++o < a; ) {
var s = i[o];
t(s) ? S0(n, s) : n[n.length] = s;
}
return n;
}
function PS(i) {
var e = i == null ? 0 : i.length;
return e ? OS(i) : [];
}
function IS(i) {
return Z_(rM(i, void 0, PS), i + "");
}
function Lr() {
if (!arguments.length)
return [];
var i = arguments[0];
return br(i) ? i : [i];
}
function DS() {
this.__data__ = new fn(), this.size = 0;
}
function NS(i) {
var e = this.__data__, t = e.delete(i);
return this.size = e.size, t;
}
function BS(i) {
return this.__data__.get(i);
}
function kS(i) {
return this.__data__.has(i);
}
var FS = 200;
function zS(i, e) {
var t = this.__data__;
if (t instanceof fn) {
var r = t.__data__;
if (!Xs || r.length < FS - 1)
return r.push([i, e]), this.size = ++t.size, this;
t = this.__data__ = new mn(r);
}
return t.set(i, e), this.size = t.size, this;
}
function nn(i) {
var e = this.__data__ = new fn(i);
this.size = e.size;
}
nn.prototype.clear = DS;
nn.prototype.delete = NS;
nn.prototype.get = BS;
nn.prototype.has = kS;
nn.prototype.set = zS;
function US(i, e) {
for (var t = -1, r = i == null ? 0 : i.length, n = 0, o = []; ++t < r; ) {
var a = i[t];
e(a, t, i) && (o[n++] = a);
}
return o;
}
function VS() {
return [];
}
var HS = Object.prototype, jS = HS.propertyIsEnumerable, pm = Object.getOwnPropertySymbols, GS = pm ? function(i) {
return i == null ? [] : (i = Object(i), US(pm(i), function(e) {
return jS.call(i, e);
}));
} : VS;
function WS(i, e, t) {
var r = e(i);
return br(i) ? r : S0(r, t(i));
}
function fm(i) {
return WS(i, M0, GS);
}
var rd = Ho(Vr, "DataView"), nd = Ho(Vr, "Promise"), od = Ho(Vr, "Set"), mm = "[object Map]", $S = "[object Object]", gm = "[object Promise]", vm = "[object Set]", ym = "[object WeakMap]", bm = "[object DataView]", qS = Vo(rd), XS = Vo(Xs), ZS = Vo(nd), YS = Vo(od), JS = Vo(td), Nn = ts;
(rd && Nn(new rd(new ArrayBuffer(1))) != bm || Xs && Nn(new Xs()) != mm || nd && Nn(nd.resolve()) != gm || od && Nn(new od()) != vm || td && Nn(new td()) != ym) && (Nn = function(i) {
var e = ts(i), t = e == $S ? i.constructor : void 0, r = t ? Vo(t) : "";
if (r)
switch (r) {
case qS:
return bm;
case XS:
return mm;
case ZS:
return gm;
case YS:
return vm;
case JS:
return ym;
}
return e;
});
var xm = Vr.Uint8Array, KS = "__lodash_hash_undefined__";
function QS(i) {
return this.__data__.set(i, KS), this;
}
function eT(i) {
return this.__data__.has(i);
}
function Gc(i) {
var e = -1, t = i == null ? 0 : i.length;
for (this.__data__ = new mn(); ++e < t; )
this.add(i[e]);
}
Gc.prototype.add = Gc.prototype.push = QS;
Gc.prototype.has = eT;
function tT(i, e) {
for (var t = -1, r = i == null ? 0 : i.length; ++t < r; )
if (e(i[t], t, i))
return !0;
return !1;
}
function iT(i, e) {
return i.has(e);
}
var rT = 1, nT = 2;
function T0(i, e, t, r, n, o) {
var a = t & rT, s = i.length, c = e.length;
if (s != c && !(a && c > s))
return !1;
var l = o.get(i), h = o.get(e);
if (l && h)
return l == e && h == i;
var u = -1, p = !0, m = t & nT ? new Gc() : void 0;
for (o.set(i, e), o.set(e, i); ++u < s; ) {
var g = i[u], d = e[u];
if (r)
var y = a ? r(d, g, u, e, i, o) : r(g, d, u, i, e, o);
if (y !== void 0) {
if (y)
continue;
p = !1;
break;
}
if (m) {
if (!tT(e, function(f, v) {
if (!iT(m, v) && (g === f || n(g, f, t, r, o)))
return m.push(v);
})) {
p = !1;
break;
}
} else if (!(g === d || n(g, d, t, r, o))) {
p = !1;
break;
}
}
return o.delete(i), o.delete(e), p;
}
function oT(i) {
var e = -1, t = Array(i.size);
return i.forEach(function(r, n) {
t[++e] = [n, r];
}), t;
}
function aT(i) {
var e = -1, t = Array(i.size);
return i.forEach(function(r) {
t[++e] = r;
}), t;
}
var sT = 1, lT = 2, cT = "[object Boolean]", uT = "[object Date]", hT = "[object Error]", dT = "[object Map]", pT = "[object Number]", fT = "[object RegExp]", mT = "[object Set]", gT = "[object String]", vT = "[object Symbol]", yT = "[object ArrayBuffer]", bT = "[object DataView]", wm = Br ? Br.prototype : void 0, Zu = wm ? wm.valueOf : void 0;
function xT(i, e, t, r, n, o, a) {
switch (t) {
case bT:
if (i.byteLength != e.byteLength || i.byteOffset != e.byteOffset)
return !1;
i = i.buffer, e = e.buffer;
case yT:
return !(i.byteLength != e.byteLength || !o(new xm(i), new xm(e)));
case cT:
case uT:
case pT:
return lp(+i, +e);
case hT:
return i.name == e.name && i.message == e.message;
case fT:
case gT:
return i == e + "";
case dT:
var s = oT;
case mT:
var c = r & sT;
if (s || (s = aT), i.size != e.size && !c)
return !1;
var l = a.get(i);
if (l)
return l == e;
r |= lT, a.set(i, e);
var h = T0(s(i), s(e), r, n, o, a);
return a.delete(i), h;
case vT:
if (Zu)
return Zu.call(i) == Zu.call(e);
}
return !1;
}
var wT = 1, _T = Object.prototype, MT = _T.hasOwnProperty;
function ST(i, e, t, r, n, o) {
var a = t & wT, s = fm(i), c = s.length, l = fm(e), h = l.length;
if (c != h && !a)
return !1;
for (var u = c; u--; ) {
var p = s[u];
if (!(a ? p in e : MT.call(e, p)))
return !1;
}
var m = o.get(i), g = o.get(e);
if (m && g)
return m == e && g == i;
var d = !0;
o.set(i, e), o.set(e, i);
for (var y = a; ++u < c; ) {
p = s[u];
var f = i[p], v = e[p];
if (r)
var _ = a ? r(v, f, p, e, i, o) : r(f, v, p, i, e, o);
if (!(_ === void 0 ? f === v || n(f, v, t, r, o) : _)) {
d = !1;
break;
}
y || (y = p == "constructor");
}
if (d && !y) {
var M = i.constructor, T = e.constructor;
M != T && "constructor" in i && "constructor" in e && !(typeof M == "function" && M instanceof M && typeof T == "function" && T instanceof T) && (d = !1);
}
return o.delete(i), o.delete(e), d;
}
var TT = 1, _m = "[object Arguments]", Mm = "[object Array]", Nl = "[object Object]", ET = Object.prototype, Sm = ET.hasOwnProperty;
function AT(i, e, t, r, n, o) {
var a = br(i), s = br(e), c = a ? Mm : Nn(i), l = s ? Mm : Nn(e);
c = c == _m ? Nl : c, l = l == _m ? Nl : l;
var h = c == Nl, u = l == Nl, p = c == l;
if (p && id(i)) {
if (!id(e))
return !1;
a = !0, h = !1;
}
if (p && !h)
return o || (o = new nn()), a || _0(i) ? T0(i, e, t, r, n, o) : xT(i, e, c, t, r, n, o);
if (!(t & TT)) {
var m = h && Sm.call(i, "__wrapped__"), g = u && Sm.call(e, "__wrapped__");
if (m || g) {
var d = m ? i.value() : i, y = g ? e.value() : e;
return o || (o = new nn()), n(d, y, t, r, o);
}
}
return p ? (o || (o = new nn()), ST(i, e, t, r, n, o)) : !1;
}
function du(i, e, t, r, n) {
return i === e ? !0 : i == null || e == null || !Ca(i) && !Ca(e) ? i !== i && e !== e : AT(i, e, t, r, du, n);
}
var CT = 1, LT = 2;
function RT(i, e, t, r) {
var n = t.length, o = n;
if (i == null)
return !o;
for (i = Object(i); n--; ) {
var a = t[n];
if (a[2] ? a[1] !== i[a[0]] : !(a[0] in i))
return !1;
}
for (; ++n < o; ) {
a = t[n];
var s = a[0], c = i[s], l = a[1];
if (a[2]) {
if (c === void 0 && !(s in i))
return !1;
} else {
var h = new nn(), u;
if (!(u === void 0 ? du(l, c, CT | LT, r, h) : u))
return !1;
}
}
return !0;
}
function E0(i) {
return i === i && !Gn(i);
}
function OT(i) {
for (var e = M0(i), t = e.length; t--; ) {
var r = e[t], n = i[r];
e[t] = [r, n, E0(n)];
}
return e;
}
function A0(i, e) {
return function(t) {
return t == null ? !1 : t[i] === e && (e !== void 0 || i in Object(t));
};
}
function PT(i) {
var e = OT(i);
return e.length == 1 && e[0][2] ? A0(e[0][0], e[0][1]) : function(t) {
return t === i || RT(t, i, e);
};
}
function IT(i, e) {
return i != null && e in Object(i);
}
function DT(i, e, t) {
e = hu(e, i);
for (var r = -1, n = e.length, o = !1; ++r < n; ) {
var a = pl(e[r]);
if (!(o = i != null && t(i, a)))
break;
i = i[a];
}
return o || ++r != n ? o : (n = i == null ? 0 : i.length, !!n && cp(n) && sp(a, n) && (br(i) || up(i)));
}
function C0(i, e) {
return i != null && DT(i, e, IT);
}
var NT = 1, BT = 2;
function kT(i, e) {
return hp(i) && E0(e) ? A0(pl(i), e) : function(t) {
var r = Qr(t, i);
return r === void 0 && r === e ? C0(t, i) : du(e, r, NT | BT);
};
}
function FT(i) {
return function(e) {
return e == null ? void 0 : e[i];
};
}
function zT(i) {
return function(e) {
return pp(e, i);
};
}
function UT(i) {
return hp(i) ? FT(pl(i)) : zT(i);
}
function VT(i) {
return typeof i == "function" ? i : i == null ? v0 : typeof i == "object" ? br(i) ? kT(i[0], i[1]) : PT(i) : UT(i);
}
var Yu = function() {
return Vr.Date.now();
}, HT = "Expected a function", jT = Math.max, GT = Math.min;
function ad(i, e, t) {
var r, n, o, a, s, c, l = 0, h = !1, u = !1, p = !0;
if (typeof i != "function")
throw new TypeError(HT);
e = nm(e) || 0, Gn(t) && (h = !!t.leading, u = "maxWait" in t, o = u ? jT(nm(t.maxWait) || 0, e) : o, p = "trailing" in t ? !!t.trailing : p);
function m(w) {
var b = r, E = n;
return r = n = void 0, l = w, a = i.apply(E, b), a;
}
function g(w) {
return l = w, s = setTimeout(f, e), h ? m(w) : a;
}
function d(w) {
var b = w - c, E = w - l, S = e - b;
return u ? GT(S, o - E) : S;
}
function y(w) {
var b = w - c, E = w - l;
return c === void 0 || b >= e || b < 0 || u && E >= o;
}
function f() {
var w = Yu();
if (y(w))
return v(w);
s = setTimeout(f, d(w));
}
function v(w) {
return s = void 0, p && r ? m(w) : (r = n = void 0, a);
}
function _() {
s !== void 0 && clearTimeout(s), l = 0, r = c = n = s = void 0;
}
function M() {
return s === void 0 ? a : v(Yu());
}
function T() {
var w = Yu(), b = y(w);
if (r = arguments, n = this, c = w, b) {
if (s === void 0)
return g(c);
if (u)
return clearTimeout(s), s = setTimeout(f, e), m(c);
}
return s === void 0 && (s = setTimeout(f, e)), a;
}
return T.cancel = _, T.flush = M, T;
}
function WT(i, e, t) {
var r = i == null ? 0 : i.length;
if (!r)
return -1;
var n = r - 1;
return Y_(i, VT(e), n);
}
function Wc(i) {
for (var e = -1, t = i == null ? 0 : i.length, r = {}; ++e < t; ) {
var n = i[e];
r[n[0]] = n[1];
}
return r;
}
function sd(i, e) {
return du(i, e);
}
function on(i) {
return i == null;
}
function $T(i) {
return i === void 0;
}
function qT(i, e, t, r) {
if (!Gn(i))
return i;
e = hu(e, i);
for (var n = -1, o = e.length, a = o - 1, s = i; s != null && ++n < o; ) {
var c = pl(e[n]), l = t;
if (c === "__proto__" || c === "constructor" || c === "prototype")
return i;
if (n != a) {
var h = s[c];
l = void 0, l === void 0 && (l = Gn(h) ? h : sp(e[n + 1]) ? [] : {});
}
iM(s, c, l), s = s[c];
}
return i;
}
function XT(i, e, t) {
for (var r = -1, n = e.length, o = {}; ++r < n; ) {
var a = e[r], s = pp(i, a);
t(s, a) && qT(o, hu(a, i), s);
}
return o;
}
function ZT(i, e) {
return XT(i, e, function(t, r) {
return C0(i, r);
});
}
var YT = IS(function(i, e) {
return i == null ? {} : ZT(i, e);
});
const vr = (i) => i === void 0, fp = (i) => typeof i == "boolean", Mt = (i) => typeof i == "number", Mo = (i) => typeof Element > "u" ? !1 : i instanceof Element, JT = (i) => Ii(i) ? !Number.isNaN(Number(i)) : !1, KT = (i = "") => i.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"), kn = (i) => o_(i), Tm = (i) => Object.keys(i);
class L0 extends Error {
constructor(e) {
super(e), this.name = "ElementPlusError";
}
}
function is(i, e) {
throw new L0(`[${i}] ${e}`);
}
function Qt(i, e) {
if (process.env.NODE_ENV !== "production") {
const t = Ii(i) ? new L0(`[${i}] ${e}`) : i;
console.warn(t);
}
}
const QT = "utils/dom/style", R0 = (i = "") => i.split(" ").filter((e) => !!e.trim()), Em = (i, e) => {
!i || !e.trim() || i.classList.add(...R0(e));
}, $c = (i, e) => {
!i || !e.trim() || i.classList.remove(...R0(e));
}, vs = (i, e) => {
var t;
if (!ii || !i || !e)
return "";
let r = i_(e);
r === "float" && (r = "cssFloat");
try {
const n = i.style[r];
if (n)
return n;
const o = (t = document.defaultView) == null ? void 0 : t.getComputedStyle(i, "");
return o ? o[r] : "";
} catch {
return i.style[r];
}
};
function qc(i, e = "px") {
if (!i)
return "";
if (Mt(i) || JT(i))
return `${i}${e}`;
if (Ii(i))
return i;
Qt(QT, "binding value must be a string or number");
}
function eE(i, e) {
if (!ii)
return;
if (!e) {
i.scrollTop = 0;
return;
}
const t = [];
let r = e.offsetParent;
for (; r !== null && i !== r && i.contains(r); )
t.push(r), r = r.offsetParent;
const n = e.offsetTop + t.reduce((c, l) => c + l.offsetTop, 0), o = n + e.offsetHeight, a = i.scrollTop, s = a + i.clientHeight;
n < a ? i.scrollTop = n : o > s && (i.scrollTop = o - i.clientHeight);
}
/*! Element Plus Icons Vue v2.3.1 */
var tE = /* @__PURE__ */ Ie({
name: "ArrowDown",
__name: "arrow-down",
setup(i) {
return (e, t) => (fe(), Ce("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("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"
})
]));
}
}), mp = tE, iE = /* @__PURE__ */ Ie({
name: "ArrowLeft",
__name: "arrow-left",
setup(i) {
return (e, t) => (fe(), Ce("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("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"
})
]));
}
}), Wn = iE, rE = /* @__PURE__ */ Ie({
name: "ArrowRight",
__name: "arrow-right",
setup(i) {
return (e, t) => (fe(), Ce("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("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"
})
]));
}
}), $n = rE, nE = /* @__PURE__ */ Ie({
name: "ArrowUp",
__name: "arrow-up",
setup(i) {
return (e, t) => (fe(), Ce("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("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"
})
]));
}
}), oE = nE, aE = /* @__PURE__ */ Ie({
name: "CircleCheck",
__name: "circle-check",
setup(i) {
return (e, t) => (fe(), Ce("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("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"
}),
ke("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"
})
]));
}
}), sE = aE, lE = /* @__PURE__ */ Ie({
name: "CircleClose",
__name: "circle-close",
setup(i) {
return (e, t) => (fe(), Ce("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("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"
}),
ke("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"
})
]));
}
}), gp = lE, cE = /* @__PURE__ */ Ie({
name: "Close",
__name: "close",
setup(i) {
return (e, t) => (fe(), Ce("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("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"
})
]));
}
}), ld = cE, uE = /* @__PURE__ */ Ie({
name: "Delete",
__name: "delete",
setup(i) {
return (e, t) => (fe(), Ce("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("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"
})
]));
}
}), Xc = uE, hE = /* @__PURE__ */ Ie({
name: "Hide",
__name: "hide",
setup(i) {
return (e, t) => (fe(), Ce("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("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"
}),
ke("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"
})
]));
}
}), dE = hE, pE = /* @__PURE__ */ Ie({
name: "Loading",
__name: "loading",
setup(i) {
return (e, t) => (fe(), Ce("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("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"
})
]));
}
}), O0 = pE, fE = /* @__PURE__ */ Ie({
name: "Minus",
__name: "minus",
setup(i) {
return (e, t) => (fe(), Ce("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("path", {
fill: "currentColor",
d: "M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64"
})
]));
}
}), mE = fE, gE = /* @__PURE__ */ Ie({
name: "Plus",
__name: "plus",
setup(i) {
return (e, t) => (fe(), Ce("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("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"
})
]));
}
}), pu = gE, vE = /* @__PURE__ */ Ie({
name: "View",
__name: "view",
setup(i) {
return (e, t) => (fe(), Ce("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("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"
})
]));
}
}), yE = vE, bE = /* @__PURE__ */ Ie({
name: "WarningFilled",
__name: "warning-filled",
setup(i) {
return (e, t) => (fe(), Ce("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
ke("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"
})
]));
}
}), P0 = bE;
const I0 = "__epPropKey", Xe = (i) => i, xE = (i) => Oi(i) && !!i[I0], fu = (i, e) => {
if (!Oi(i) || xE(i))
return i;
const { values: t, required: r, default: n, type: o, validator: a } = i, s = {
type: o,
required: !!r,
validator: t || a ? (c) => {
let l = !1, h = [];
if (t && (h = Array.from(t), Qf(i, "default") && h.push(n), l || (l = h.includes(c))), a && (l || (l = a(c))), !l && h.length > 0) {
const u = [...new Set(h)].map((p) => JSON.stringify(p)).join(", ");
fw(`Invalid prop: validation failed${e ? ` for prop "${e}"` : ""}. Expected one of [${u}], got value ${JSON.stringify(c)}.`);
}
return l;
} : void 0,
[I0]: !0
};
return Qf(i, "default") && (s.default = n), s;
}, ht = (i) => Wc(Object.entries(i).map(([e, t]) => [
e,
fu(t, e)
])), qn = Xe([
String,
Object,
Function
]), D0 = {
validating: O0,
success: sE,
error: gp
}, fi = (i, e) => {
if (i.install = (t) => {
for (const r of [i, ...Object.values(e ?? {})])
t.component(r.name, r);
}, e)
for (const [t, r] of Object.entries(e))
i[t] = r;
return i;
}, wE = (i, e) => (i.install = (t) => {
t.directive(e, i);
}, i), gn = (i) => (i.install = $s, i), Ir = {
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"
}, Dt = "update:modelValue", Qn = "change", So = "input", N0 = ["", "default", "small", "large"], Bc = (i) => {
const e = zi(i) ? i : [i], t = [];
return e.forEach((r) => {
var n;
zi(r) ? t.push(...Bc(r)) : Qh(r) && zi(r.children) ? t.push(...Bc(r.children)) : (t.push(r), Qh(r) && (n = r.component) != null && n.subTree && t.push(...Bc(r.component.subTree)));
}), t;
}, _E = (i) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(i), en = (i) => i, ME = ["class", "style"], SE = /^on[A-Z]/, TE = (i = {}) => {
const { excludeListeners: e = !1, excludeKeys: t } = i, r = ce(() => ((t == null ? void 0 : t.value) || []).concat(ME)), n = si();
return n ? ce(() => {
var o;
return Wc(Object.entries((o = n.proxy) == null ? void 0 : o.$attrs).filter(([a]) => !r.value.includes(a) && !(e && SE.test(a))));
}) : (Qt("use-attrs", "getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"), ce(() => ({})));
}, EE = ({ from: i, replacement: e, scope: t, version: r, ref: n, type: o = "API" }, a) => {
Je(() => H(a), (s) => {
s && Qt(t, `[${o}] ${i} is about to be deprecated in version ${r}, please use ${e} instead.
For more detail, please visit: ${n}
`);
}, {
immediate: !0
});
};
var AE = {
name: "en",
el: {
breadcrumb: {
label: "Breadcrumb"
},
colorpicker: {
confirm: "OK",
clear: "Clear",
defaultLabel: "color picker",
description: "current color is {color}. press enter to select a new color.",
alphaLabel: "pick alpha value"
},
datepicker: {
now: "Now",
today: "Today",
cancel: "Cancel",
clear: "Clear",
confirm: "OK",
dateTablePrompt: "Use the arrow keys and enter to select the day of the month",
monthTablePrompt: "Use the arrow keys and enter to select the month",
yearTablePrompt: "Use the arrow keys and enter to select the year",
selectedDate: "Selected date",
selectDate: "Select date",
selectTime: "Select time",
startDate: "Start Date",
startTime: "Start Time",
endDate: "End Date",
endTime: "End Time",
prevYear: "Previous Year",
nextYear: "Next Year",
prevMonth: "Previous Month",
nextMonth: "Next Month",
year: "",
month1: "January",
month2: "February",
month3: "March",
month4: "April",
month5: "May",
month6: "June",
month7: "July",
month8: "August",
month9: "September",
month10: "October",
month11: "November",
month12: "December",
week: "week",
weeks: {
sun: "Sun",
mon: "Mon",
tue: "Tue",
wed: "Wed",
thu: "Thu",
fri: "Fri",
sat: "Sat"
},
weeksFull: {
sun: "Sunday",
mon: "Monday",
tue: "Tuesday",
wed: "Wednesday",
thu: "Thursday",
fri: "Friday",
sat: "Saturday"
},
months: {
jan: "Jan",
feb: "Feb",
mar: "Mar",
apr: "Apr",
may: "May",
jun: "Jun",
jul: "Jul",
aug: "Aug",
sep: "Sep",
oct: "Oct",
nov: "Nov",
dec: "Dec"
}
},
inputNumber: {
decrease: "decrease number",
increase: "increase number"
},
select: {
loading: "Loading",
noMatch: "No matching data",
noData: "No data",
placeholder: "Select"
},
mention: {
loading: "Loading"
},
dropdown: {
toggleDropdown: "Toggle Dropdown"
},
cascader: {
noMatch: "No matching data",
loading: "Loading",
placeholder: "Select",
noData: "No data"
},
pagination: {
goto: "Go to",
pagesize: "/page",
total: "Total {total}",
pageClassifier: "",
page: "Page",
prev: "Go to previous page",
next: "Go to next page",
currentPage: "page {pager}",
prevPages: "Previous {pager} pages",
nextPages: "Next {pager} pages",
deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details"
},
dialog: {
close: "Close this dialog"
},
drawer: {
close: "Close this dialog"
},
messagebox: {
title: "Message",
confirm: "OK",
cancel: "Cancel",
error: "Illegal input",
close: "Close this dialog"
},
upload: {
deleteTip: "press delete to remove",
delete: "Delete",
preview: "Preview",
continue: "Continue"
},
slider: {
defaultLabel: "slider between {min} and {max}",
defaultRangeStartLabel: "pick start value",
defaultRangeEndLabel: "pick end value"
},
table: {
emptyText: "No Data",
confirmFilter: "Confirm",
resetFilter: "Reset",
clearFilter: "All",
sumText: "Sum"
},
tour: {
next: "Next",
previous: "Previous",
finish: "Finish"
},
tree: {
emptyText: "No Data"
},
transfer: {
noMatch: "No matching data",
noData: "No data",
titles: ["List 1", "List 2"],
filterPlaceholder: "Enter keyword",
noCheckedFormat: "{total} items",
hasCheckedFormat: "{checked}/{total} checked"
},
image: {
error: "FAILED"
},
pageHeader: {
title: "Back"
},
popconfirm: {
confirmButtonText: "Yes",
cancelButtonText: "No"
},
carousel: {
leftArrow: "Carousel arrow left",
rightArrow: "Carousel arrow right",
indicator: "Carousel switch to index {index}"
}
}
};
const CE = (i) => (e, t) => LE(e, t, H(i)), LE = (i, e, t) => Qr(t, i, i).replace(/\{(\w+)\}/g, (r, n) => {
var o;
return `${(o = e == null ? void 0 : e[n]) != null ? o : `{${n}}`}`;
}), RE = (i) => {
const e = ce(() => H(i).name), t = Ro(i) ? i : Ae(i);
return {
lang: e,
locale: t,
t: CE(i)
};
}, B0 = Symbol("localeContextKey"), mu = (i) => {
const e = i || ct(B0, Ae());
return RE(ce(() => e.value || AE));
}, kc = "el", OE = "is-", lo = (i, e, t, r, n) => {
let o = `${i}-${e}`;
return t && (o += `-${t}`), r && (o += `__${r}`), n && (o += `--${n}`), o;
}, k0 = Symbol("namespaceContextKey"), vp = (i) => {
const e = i || (si() ? ct(k0, Ae(kc)) : Ae(kc));
return ce(() => H(e) || kc);
}, it = (i, e) => {
const t = vp(e);
return {
namespace: t,
b: (r = "") => lo(t.value, i, r, "", ""),
e: (r) => r ? lo(t.value, i, "", r, "") : "",
m: (r) => r ? lo(t.value, i, "", "", r) : "",
be: (r, n) => r && n ? lo(t.value, i, r, n, "") : "",
em: (r, n) => r && n ? lo(t.value, i, "", r, n) : "",
bm: (r, n) => r && n ? lo(t.value, i, r, "", n) : "",
bem: (r, n, o) => r && n && o ? lo(t.value, i, r, n, o) : "",
is: (r, ...n) => {
const o = n.length >= 1 ? n[0] : !0;
return r && o ? `${OE}${r}` : "";
},
cssVar: (r) => {
const n = {};
for (const o in r)
r[o] && (n[`--${t.value}-${o}`] = r[o]);
return n;
},
cssVarName: (r) => `--${t.value}-${r}`,
cssVarBlock: (r) => {
const n = {};
for (const o in r)
r[o] && (n[`--${t.value}-${i}-${o}`] = r[o]);
return n;
},
cssVarBlockName: (r) => `--${t.value}-${i}-${r}`
};
}, PE = fu({
type: Xe(Boolean),
default: null
}), IE = fu({
type: Xe(Function)
}), DE = (i) => {
const e = `update:${i}`, t = `onUpdate:${i}`, r = [e], n = {
[i]: PE,
[t]: IE
};
return {
useModelToggle: ({
indicator: o,
toggleReason: a,
shouldHideWhenRouteChanges: s,
shouldProceed: c,
onShow: l,
onHide: h
}) => {
const u = si(), { emit: p } = u, m = u.props, g = ce(() => Ci(m[t])), d = ce(() => m[i] === null), y = (w) => {
o.value !== !0 && (o.value = !0, a && (a.value = w), Ci(l) && l(w));
}, f = (w) => {
o.value !== !1 && (o.value = !1, a && (a.value = w), Ci(h) && h(w));
}, v = (w) => {
if (m.disabled === !0 || Ci(c) && !c())
return;
const b = g.value && ii;
b && p(e, !0), (d.value || !b) && y(w);
}, _ = (w) => {
if (m.disabled === !0 || !ii)
return;
const b = g.value && ii;
b && p(e, !1), (d.value || !b) && f(w);
}, M = (w) => {
fp(w) && (m.disabled && w ? g.value && p(e, !1) : o.value !== w && (w ? y() : f()));
}, T = () => {
o.value ? _() : v();
};
return Je(() => m[i], M), s && u.appContext.config.globalProperties.$route !== void 0 && Je(() => ({
...u.proxy.$route
}), () => {
s.value && o.value && _();
}), ni(() => {
M(m[i]);
}), {
hide: _,
show: v,
toggle: T,
hasUpdateHandler: g
};
},
useModelToggleProps: n,
useModelToggleEmits: r
};
}, F0 = (i) => {
const e = si();
return ce(() => {
var t, r;
return (r = (t = e == null ? void 0 : e.proxy) == null ? void 0 : t.$props) == null ? void 0 : r[i];
});
};
var Vi = "top", or = "bottom", ar = "right", Hi = "left", yp = "auto", fl = [Vi, or, ar, Hi], La = "start", Zs = "end", NE = "clippingParents", z0 = "viewport", ys = "popper", BE = "reference", Am = fl.reduce(function(i, e) {
return i.concat([e + "-" + La, e + "-" + Zs]);
}, []), rs = [].concat(fl, [yp]).reduce(function(i, e) {
return i.concat([e, e + "-" + La, e + "-" + Zs]);
}, []), kE = "beforeRead", FE = "read", zE = "afterRead", UE = "beforeMain", VE = "main", HE = "afterMain", jE = "beforeWrite", GE = "write", WE = "afterWrite", $E = [kE, FE, zE, UE, VE, HE, jE, GE, WE];
function kr(i) {
return i ? (i.nodeName || "").toLowerCase() : null;
}
function _r(i) {
if (i == null) return window;
if (i.toString() !== "[object Window]") {
var e = i.ownerDocument;
return e && e.defaultView || window;
}
return i;
}
function Ra(i) {
var e = _r(i).Element;
return i instanceof e || i instanceof Element;
}
function nr(i) {
var e = _r(i).HTMLElement;
return i instanceof e || i instanceof HTMLElement;
}
function bp(i) {
if (typeof ShadowRoot > "u") return !1;
var e = _r(i).ShadowRoot;
return i instanceof e || i instanceof ShadowRoot;
}
function qE(i) {
var e = i.state;
Object.keys(e.elements).forEach(function(t) {
var r = e.styles[t] || {}, n = e.attributes[t] || {}, o = e.elements[t];
!nr(o) || !kr(o) || (Object.assign(o.style, r), Object.keys(n).forEach(function(a) {
var s = n[a];
s === !1 ? o.removeAttribute(a) : o.setAttribute(a, s === !0 ? "" : s);
}));
});
}
function XE(i) {
var e = i.state, t = { popper: { position: e.options.strategy, left: "0", top: "0", margin: "0" }, arrow: { position: "absolute" }, reference: {} };
return Object.assign(e.elements.popper.style, t.popper), e.styles = t, e.elements.arrow && Object.assign(e.elements.arrow.style, t.arrow), function() {
Object.keys(e.elements).forEach(function(r) {
var n = e.elements[r], o = e.attributes[r] || {}, a = Object.keys(e.styles.hasOwnProperty(r) ? e.styles[r] : t[r]), s = a.reduce(function(c, l) {
return c[l] = "", c;
}, {});
!nr(n) || !kr(n) || (Object.assign(n.style, s), Object.keys(o).forEach(function(c) {
n.removeAttribute(c);
}));
});
};
}
var U0 = { name: "applyStyles", enabled: !0, phase: "write", fn: qE, effect: XE, requires: ["computeStyles"] };
function Dr(i) {
return i.split("-")[0];
}
var To = Math.max, Zc = Math.min, Oa = Math.round;
function Pa(i, e) {
e === void 0 && (e = !1);
var t = i.getBoundingClientRect(), r = 1, n = 1;
if (nr(i) && e) {
var o = i.offsetHeight, a = i.offsetWidth;
a > 0 && (r = Oa(t.width) / a || 1), o > 0 && (n = Oa(t.height) / o || 1);
}
return { width: t.width / r, height: t.height / n, top: t.top / n, right: t.right / r, bottom: t.bottom / n, left: t.left / r, x: t.left / r, y: t.top / n };
}
function xp(i) {
var e = Pa(i), t = i.offsetWidth, r = i.offsetHeight;
return Math.abs(e.width - t) <= 1 && (t = e.width), Math.abs(e.height - r) <= 1 && (r = e.height), { x: i.offsetLeft, y: i.offsetTop, width: t, height: r };
}
function V0(i, e) {
var t = e.getRootNode && e.getRootNode();
if (i.contains(e)) return !0;
if (t && bp(t)) {
var r = e;
do {
if (r && i.isSameNode(r)) return !0;
r = r.parentNode || r.host;
} while (r);
}
return !1;
}
function un(i) {
return _r(i).getComputedStyle(i);
}
function ZE(i) {
return ["table", "td", "th"].indexOf(kr(i)) >= 0;
}
function eo(i) {
return ((Ra(i) ? i.ownerDocument : i.document) || window.document).documentElement;
}
function gu(i) {
return kr(i) === "html" ? i : i.assignedSlot || i.parentNode || (bp(i) ? i.host : null) || eo(i);
}
function Cm(i) {
return !nr(i) || un(i).position === "fixed" ? null : i.offsetParent;
}
function YE(i) {
var e = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1, t = navigator.userAgent.indexOf("Trident") !== -1;
if (t && nr(i)) {
var r = un(i);
if (r.position === "fixed") return null;
}
var n = gu(i);
for (bp(n) && (n = n.host); nr(n) && ["html", "body"].indexOf(kr(n)) < 0; ) {
var o = un(n);
if (o.transform !== "none" || o.perspective !== "none" || o.contain === "paint" || ["transform", "perspective"].indexOf(o.willChange) !== -1 || e && o.willChange === "filter" || e && o.filter && o.filter !== "none") return n;
n = n.parentNode;
}
return null;
}
function ml(i) {
for (var e = _r(i), t = Cm(i); t && ZE(t) && un(t).position === "static"; ) t = Cm(t);
return t && (kr(t) === "html" || kr(t) === "body" && un(t).position === "static") ? e : t || YE(i) || e;
}
function wp(i) {
return ["top", "bottom"].indexOf(i) >= 0 ? "x" : "y";
}
function Fs(i, e, t) {
return To(i, Zc(e, t));
}
function JE(i, e, t) {
var r = Fs(i, e, t);
return r > t ? t : r;
}
function H0() {
return { top: 0, right: 0, bottom: 0, left: 0 };
}
function j0(i) {
return Object.assign({}, H0(), i);
}
function G0(i, e) {
return e.reduce(function(t, r) {
return t[r] = i, t;
}, {});
}
var KE = function(i, e) {
return i = typeof i == "function" ? i(Object.assign({}, e.rects, { placement: e.placement })) : i, j0(typeof i != "number" ? i : G0(i, fl));
};
function QE(i) {
var e, t = i.state, r = i.name, n = i.options, o = t.elements.arrow, a = t.modifiersData.popperOffsets, s = Dr(t.placement), c = wp(s), l = [Hi, ar].indexOf(s) >= 0, h = l ? "height" : "width";
if (!(!o || !a)) {
var u = KE(n.padding, t), p = xp(o), m = c === "y" ? Vi : Hi, g = c === "y" ? or : ar, d = t.rects.reference[h] + t.rects.reference[c] - a[c] - t.rects.popper[h], y = a[c] - t.rects.reference[c], f = ml(o), v = f ? c === "y" ? f.clientHeight || 0 : f.clientWidth || 0 : 0, _ = d / 2 - y / 2, M = u[m], T = v - p[h] - u[g], w = v / 2 - p[h] / 2 + _, b = Fs(M, w, T), E = c;
t.modifiersData[r] = (e = {}, e[E] = b, e.centerOffset = b - w, e);
}
}
function eA(i) {
var e = i.state, t = i.options, r = t.element, n = r === void 0 ? "[data-popper-arrow]" : r;
n != null && (typeof n == "string" && (n = e.elements.popper.querySelector(n), !n) || !V0(e.elements.popper, n) || (e.elements.arrow = n));
}
var tA = { name: "arrow", enabled: !0, phase: "main", fn: QE, effect: eA, requires: ["popperOffsets"], requiresIfExists: ["preventOverflow"] };
function Ia(i) {
return i.split("-")[1];
}
var iA = { top: "auto", right: "auto", bottom: "auto", left: "auto" };
function rA(i) {
var e = i.x, t = i.y, r = window, n = r.devicePixelRatio || 1;
return { x: Oa(e * n) / n || 0, y: Oa(t * n) / n || 0 };
}
function Lm(i) {
var e, t = i.popper, r = i.popperRect, n = i.placement, o = i.variation, a = i.offsets, s = i.position, c = i.gpuAcceleration, l = i.adaptive, h = i.roundOffsets, u = i.isFixed, p = a.x, m = p === void 0 ? 0 : p, g = a.y, d = g === void 0 ? 0 : g, y = typeof h == "function" ? h({ x: m, y: d }) : { x: m, y: d };
m = y.x, d = y.y;
var f = a.hasOwnProperty("x"), v = a.hasOwnProperty("y"), _ = Hi, M = Vi, T = window;
if (l) {
var w = ml(t), b = "clientHeight", E = "clientWidth";
if (w === _r(t) && (w = eo(t), un(w).position !== "static" && s === "absolute" && (b = "scrollHeight", E = "scrollWidth")), w = w, n === Vi || (n === Hi || n === ar) && o === Zs) {
M = or;
var S = u && w === T && T.visualViewport ? T.visualViewport.height : w[b];
d -= S - r.height, d *= c ? 1 : -1;
}
if (n === Hi || (n === Vi || n === or) && o === Zs) {
_ = ar;
var C = u && w === T && T.visualViewport ? T.visualViewport.width : w[E];
m -= C - r.width, m *= c ? 1 : -1;
}
}
var R = Object.assign({ position: s }, l && iA), L = h === !0 ? rA({ x: m, y: d }) : { x: m, y: d };
if (m = L.x, d = L.y, c) {
var A;
return Object.assign({}, R, (A = {}, A[M] = v ? "0" : "", A[_] = f ? "0" : "", A.transform = (T.devicePixelRatio || 1) <= 1 ? "translate(" + m + "px, " + d + "px)" : "translate3d(" + m + "px, " + d + "px, 0)", A));
}
return Object.assign({}, R, (e = {}, e[M] = v ? d + "px" : "", e[_] = f ? m + "px" : "", e.transform = "", e));
}
function nA(i) {
var e = i.state, t = i.options, r = t.gpuAcceleration, n = r === void 0 ? !0 : r, o = t.adaptive, a = o === void 0 ? !0 : o, s = t.roundOffsets, c = s === void 0 ? !0 : s, l = { placement: Dr(e.placement), variation: Ia(e.placement), popper: e.elements.popper, popperRect: e.rects.popper, gpuAcceleration: n, isFixed: e.options.strategy === "fixed" };
e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, Lm(Object.assign({}, l, { offsets: e.modifiersData.popperOffsets, position: e.options.strategy, adaptive: a, roundOffsets: c })))), e.modifiersData.arrow != null && (e.styles.arrow = Object.assign({}, e.styles.arrow, Lm(Object.assign({}, l, { offsets: e.modifiersData.arrow, position: "absolute", adaptive: !1, roundOffsets: c })))), e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-placement": e.placement });
}
var W0 = { name: "computeStyles", enabled: !0, phase: "beforeWrite", fn: nA, data: {} }, Bl = { passive: !0 };
function oA(i) {
var e = i.state, t = i.instance, r = i.options, n = r.scroll, o = n === void 0 ? !0 : n, a = r.resize, s = a === void 0 ? !0 : a, c = _r(e.elements.popper), l = [].concat(e.scrollParents.reference, e.scrollParents.popper);
return o && l.forEach(function(h) {
h.addEventListener("scroll", t.update, Bl);
}), s && c.addEventListener("resize", t.update, Bl), function() {
o && l.forEach(function(h) {
h.removeEventListener("scroll", t.update, Bl);
}), s && c.removeEventListener("resize", t.update, Bl);
};
}
var $0 = { name: "eventListeners", enabled: !0, phase: "write", fn: function() {
}, effect: oA, data: {} }, aA = { left: "right", right: "left", bottom: "top", top: "bottom" };
function Fc(i) {
return i.replace(/left|right|bottom|top/g, function(e) {
return aA[e];
});
}
var sA = { start: "end", end: "start" };
function Rm(i) {
return i.replace(/start|end/g, function(e) {
return sA[e];
});
}
function _p(i) {
var e = _r(i), t = e.pageXOffset, r = e.pageYOffset;
return { scrollLeft: t, scrollTop: r };
}
function Mp(i) {
return Pa(eo(i)).left + _p(i).scrollLeft;
}
function lA(i) {
var e = _r(i), t = eo(i), r = e.visualViewport, n = t.clientWidth, o = t.clientHeight, a = 0, s = 0;
return r && (n = r.width, o = r.height, /^((?!chrome|android).)*safari/i.test(navigator.userAgent) || (a = r.offsetLeft, s = r.offsetTop)), { width: n, height: o, x: a + Mp(i), y: s };
}
function cA(i) {
var e, t = eo(i), r = _p(i), n = (e = i.ownerDocument) == null ? void 0 : e.body, o = To(t.scrollWidth, t.clientWidth, n ? n.scrollWidth : 0, n ? n.clientWidth : 0), a = To(t.scrollHeight, t.clientHeight, n ? n.scrollHeight : 0, n ? n.clientHeight : 0), s = -r.scrollLeft + Mp(i), c = -r.scrollTop;
return un(n || t).direction === "rtl" && (s += To(t.clientWidth, n ? n.clientWidth : 0) - o), { width: o, height: a, x: s, y: c };
}
function Sp(i) {
var e = un(i), t = e.overflow, r = e.overflowX, n = e.overflowY;
return /auto|scroll|overlay|hidden/.test(t + n + r);
}
function q0(i) {
return ["html", "body", "#document"].indexOf(kr(i)) >= 0 ? i.ownerDocument.body : nr(i) && Sp(i) ? i : q0(gu(i));
}
function zs(i, e) {
var t;
e === void 0 && (e = []);
var r = q0(i), n = r === ((t = i.ownerDocument) == null ? void 0 : t.body), o = _r(r), a = n ? [o].concat(o.visualViewport || [], Sp(r) ? r : []) : r, s = e.concat(a);
return n ? s : s.concat(zs(gu(a)));
}
function cd(i) {
return Object.assign({}, i, { left: i.x, top: i.y, right: i.x + i.width, bottom: i.y + i.height });
}
function uA(i) {
var e = Pa(i);
return e.top = e.top + i.clientTop, e.left = e.left + i.clientLeft, e.bottom = e.top + i.clientHeight, e.right = e.left + i.clientWidth, e.width = i.clientWidth, e.height = i.clientHeight, e.x = e.left, e.y = e.top, e;
}
function Om(i, e) {
return e === z0 ? cd(lA(i)) : Ra(e) ? uA(e) : cd(cA(eo(i)));
}
function hA(i) {
var e = zs(gu(i)), t = ["absolute", "fixed"].indexOf(un(i).position) >= 0, r = t && nr(i) ? ml(i) : i;
return Ra(r) ? e.filter(function(n) {
return Ra(n) && V0(n, r) && kr(n) !== "body";
}) : [];
}
function dA(i, e, t) {
var r = e === "clippingParents" ? hA(i) : [].concat(e), n = [].concat(r, [t]), o = n[0], a = n.reduce(function(s, c) {
var l = Om(i, c);
return s.top = To(l.top, s.top), s.right = Zc(l.right, s.right), s.bottom = Zc(l.bottom, s.bottom), s.left = To(l.left, s.left), s;
}, Om(i, o));
return a.width = a.right - a.left, a.height = a.bottom - a.top, a.x = a.left, a.y = a.top, a;
}
function X0(i) {
var e = i.reference, t = i.element, r = i.placement, n = r ? Dr(r) : null, o = r ? Ia(r) : null, a = e.x + e.width / 2 - t.width / 2, s = e.y + e.height / 2 - t.height / 2, c;
switch (n) {
case Vi:
c = { x: a, y: e.y - t.height };
break;
case or:
c = { x: a, y: e.y + e.height };
break;
case ar:
c = { x: e.x + e.width, y: s };
break;
case Hi:
c = { x: e.x - t.width, y: s };
break;
default:
c = { x: e.x, y: e.y };
}
var l = n ? wp(n) : null;
if (l != null) {
var h = l === "y" ? "height" : "width";
switch (o) {
case La:
c[l] = c[l] - (e[h] / 2 - t[h] / 2);
break;
case Zs:
c[l] = c[l] + (e[h] / 2 - t[h] / 2);
break;
}
}
return c;
}
function Ys(i, e) {
e === void 0 && (e = {});
var t = e, r = t.placement, n = r === void 0 ? i.placement : r, o = t.boundary, a = o === void 0 ? NE : o, s = t.rootBoundary, c = s === void 0 ? z0 : s, l = t.elementContext, h = l === void 0 ? ys : l, u = t.altBoundary, p = u === void 0 ? !1 : u, m = t.padding, g = m === void 0 ? 0 : m, d = j0(typeof g != "number" ? g : G0(g, fl)), y = h === ys ? BE : ys, f = i.rects.popper, v = i.elements[p ? y : h], _ = dA(Ra(v) ? v : v.contextElement || eo(i.elements.popper), a, c), M = Pa(i.elements.reference), T = X0({ reference: M, element: f, strategy: "absolute", placement: n }), w = cd(Object.assign({}, f, T)), b = h === ys ? w : M, E = { top: _.top - b.top + d.top, bottom: b.bottom - _.bottom + d.bottom, left: _.left - b.left + d.left, right: b.right - _.right + d.right }, S = i.modifiersData.offset;
if (h === ys && S) {
var C = S[n];
Object.keys(E).forEach(function(R) {
var L = [ar, or].indexOf(R) >= 0 ? 1 : -1, A = [Vi, or].indexOf(R) >= 0 ? "y" : "x";
E[R] += C[A] * L;
});
}
return E;
}
function pA(i, e) {
e === void 0 && (e = {});
var t = e, r = t.placement, n = t.boundary, o = t.rootBoundary, a = t.padding, s = t.flipVariations, c = t.allowedAutoPlacements, l = c === void 0 ? rs : c, h = Ia(r), u = h ? s ? Am : Am.filter(function(g) {
return Ia(g) === h;
}) : fl, p = u.filter(function(g) {
return l.indexOf(g) >= 0;
});
p.length === 0 && (p = u);
var m = p.reduce(function(g, d) {
return g[d] = Ys(i, { placement: d, boundary: n, rootBoundary: o, padding: a })[Dr(d)], g;
}, {});
return Object.keys(m).sort(function(g, d) {
return m[g] - m[d];
});
}
function fA(i) {
if (Dr(i) === yp) return [];
var e = Fc(i);
return [Rm(i), e, Rm(e)];
}
function mA(i) {
var e = i.state, t = i.options, r = i.name;
if (!e.modifiersData[r]._skip) {
for (var n = t.mainAxis, o = n === void 0 ? !0 : n, a = t.altAxis, s = a === void 0 ? !0 : a, c = t.fallbackPlacements, l = t.padding, h = t.boundary, u = t.rootBoundary, p = t.altBoundary, m = t.flipVariations, g = m === void 0 ? !0 : m, d = t.allowedAutoPlacements, y = e.options.placement, f = Dr(y), v = f === y, _ = c || (v || !g ? [Fc(y)] : fA(y)), M = [y].concat(_).reduce(function(ne, q) {
return ne.concat(Dr(q) === yp ? pA(e, { placement: q, boundary: h, rootBoundary: u, padding: l, flipVariations: g, allowedAutoPlacements: d }) : q);
}, []), T = e.rects.reference, w = e.rects.popper, b = /* @__PURE__ */ new Map(), E = !0, S = M[0], C = 0; C < M.length; C++) {
var R = M[C], L = Dr(R), A = Ia(R) === La, P = [Vi, or].indexOf(L) >= 0, O = P ? "width" : "height", x = Ys(e, { placement: R, boundary: h, rootBoundary: u, altBoundary: p, padding: l }), I = P ? A ? ar : Hi : A ? or : Vi;
T[O] > w[O] && (I = Fc(I));
var N = Fc(I), D = [];
if (o && D.push(x[L] <= 0), s && D.push(x[I] <= 0, x[N] <= 0), D.every(function(ne) {
return ne;
})) {
S = R, E = !1;
break;
}
b.set(R, D);
}
if (E) for (var k = g ? 3 : 1, F = function(ne) {
var q = M.find(function(z) {
var j = b.get(z);
if (j) return j.slice(0, ne).every(function(Q) {
return Q;
});
});
if (q) return S = q, "break";
}, W = k; W > 0; W--) {
var K = F(W);
if (K === "break") break;
}
e.placement !== S && (e.modifiersData[r]._skip = !0, e.placement = S, e.reset = !0);
}
}
var gA = { name: "flip", enabled: !0, phase: "main", fn: mA, requiresIfExists: ["offset"], data: { _skip: !1 } };
function Pm(i, e, t) {
return t === void 0 && (t = { x: 0, y: 0 }), { top: i.top - e.height - t.y, right: i.right - e.width + t.x, bottom: i.bottom - e.height + t.y, left: i.left - e.width - t.x };
}
function Im(i) {
return [Vi, ar, or, Hi].some(function(e) {
return i[e] >= 0;
});
}
function vA(i) {
var e = i.state, t = i.name, r = e.rects.reference, n = e.rects.popper, o = e.modifiersData.preventOverflow, a = Ys(e, { elementContext: "reference" }), s = Ys(e, { altBoundary: !0 }), c = Pm(a, r), l = Pm(s, n, o), h = Im(c), u = Im(l);
e.modifiersData[t] = { referenceClippingOffsets: c, popperEscapeOffsets: l, isReferenceHidden: h, hasPopperEscaped: u }, e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-reference-hidden": h, "data-popper-escaped": u });
}
var yA = { name: "hide", enabled: !0, phase: "main", requiresIfExists: ["preventOverflow"], fn: vA };
function bA(i, e, t) {
var r = Dr(i), n = [Hi, Vi].indexOf(r) >= 0 ? -1 : 1, o = typeof t == "function" ? t(Object.assign({}, e, { placement: i })) : t, a = o[0], s = o[1];
return a = a || 0, s = (s || 0) * n, [Hi, ar].indexOf(r) >= 0 ? { x: s, y: a } : { x: a, y: s };
}
function xA(i) {
var e = i.state, t = i.options, r = i.name, n = t.offset, o = n === void 0 ? [0, 0] : n, a = rs.reduce(function(h, u) {
return h[u] = bA(u, e.rects, o), h;
}, {}), s = a[e.placement], c = s.x, l = s.y;
e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += c, e.modifiersData.popperOffsets.y += l), e.modifiersData[r] = a;
}
var wA = { name: "offset", enabled: !0, phase: "main", requires: ["popperOffsets"], fn: xA };
function _A(i) {
var e = i.state, t = i.name;
e.modifiersData[t] = X0({ reference: e.rects.reference, element: e.rects.popper, strategy: "absolute", placement: e.placement });
}
var Z0 = { name: "popperOffsets", enabled: !0, phase: "read", fn: _A, data: {} };
function MA(i) {
return i === "x" ? "y" : "x";
}
function SA(i) {
var e = i.state, t = i.options, r = i.name, n = t.mainAxis, o = n === void 0 ? !0 : n, a = t.altAxis, s = a === void 0 ? !1 : a, c = t.boundary, l = t.rootBoundary, h = t.altBoundary, u = t.padding, p = t.tether, m = p === void 0 ? !0 : p, g = t.tetherOffset, d = g === void 0 ? 0 : g, y = Ys(e, { boundary: c, rootBoundary: l, padding: u, altBoundary: h }), f = Dr(e.placement), v = Ia(e.placement), _ = !v, M = wp(f), T = MA(M), w = e.modifiersData.popperOffsets, b = e.rects.reference, E = e.rects.popper, S = typeof d == "function" ? d(Object.assign({}, e.rects, { placement: e.placement })) : d, C = typeof S == "number" ? { mainAxis: S, altAxis: S } : Object.assign({ mainAxis: 0, altAxis: 0 }, S), R = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, L = { x: 0, y: 0 };
if (w) {
if (o) {
var A, P = M === "y" ? Vi : Hi, O = M === "y" ? or : ar, x = M === "y" ? "height" : "width", I = w[M], N = I + y[P], D = I - y[O], k = m ? -E[x] / 2 : 0, F = v === La ? b[x] : E[x], W = v === La ? -E[x] : -b[x], K = e.elements.arrow, ne = m && K ? xp(K) : { width: 0, height: 0 }, q = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : H0(), z = q[P], j = q[O], Q = Fs(0, b[x], ne[x]), Y = _ ? b[x] / 2 - k - Q - z - C.mainAxis : F - Q - z - C.mainAxis, ee = _ ? -b[x] / 2 + k + Q + j + C.mainAxis : W + Q + j + C.mainAxis, G = e.elements.arrow && ml(e.elements.arrow), J = G ? M === "y" ? G.clientTop || 0 : G.clientLeft || 0 : 0, re = (A = R == null ? void 0 : R[M]) != null ? A : 0, B = I + Y - re - J, $ = I + ee - re, te = Fs(m ? Zc(N, B) : N, I, m ? To(D, $) : D);
w[M] = te, L[M] = te - I;
}
if (s) {
var U, V = M === "x" ? Vi : Hi, ae = M === "x" ? or : ar, ue = w[T], de = T === "y" ? "height" : "width", ve = ue + y[V], ye = ue - y[ae], le = [Vi, Hi].indexOf(f) !== -1, Se = (U = R == null ? void 0 : R[T]) != null ? U : 0, Te = le ? ve : ue - b[de] - E[de] - Se + C.altAxis, oe = le ? ue + b[de] + E[de] - Se - C.altAxis : ye, Me = m && le ? JE(Te, ue, oe) : Fs(m ? Te : ve, ue, m ? oe : ye);
w[T] = Me, L[T] = Me - ue;
}
e.modifiersData[r] = L;
}
}
var TA = { name: "preventOverflow", enabled: !0, phase: "main", fn: SA, requiresIfExists: ["offset"] };
function EA(i) {
return { scrollLeft: i.scrollLeft, scrollTop: i.scrollTop };
}
function AA(i) {
return i === _r(i) || !nr(i) ? _p(i) : EA(i);
}
function CA(i) {
var e = i.getBoundingClientRect(), t = Oa(e.width) / i.offsetWidth || 1, r = Oa(e.height) / i.offsetHeight || 1;
return t !== 1 || r !== 1;
}
function LA(i, e, t) {
t === void 0 && (t = !1);
var r = nr(e), n = nr(e) && CA(e), o = eo(e), a = Pa(i, n), s = { scrollLeft: 0, scrollTop: 0 }, c = { x: 0, y: 0 };
return (r || !r && !t) && ((kr(e) !== "body" || Sp(o)) && (s = AA(e)), nr(e) ? (c = Pa(e, !0), c.x += e.clientLeft, c.y += e.clientTop) : o && (c.x = Mp(o))), { x: a.left + s.scrollLeft - c.x, y: a.top + s.scrollTop - c.y, width: a.width, height: a.height };
}
function RA(i) {
var e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set(), r = [];
i.forEach(function(o) {
e.set(o.name, o);
});
function n(o) {
t.add(o.name);
var a = [].concat(o.requires || [], o.requiresIfExists || []);
a.forEach(function(s) {
if (!t.has(s)) {
var c = e.get(s);
c && n(c);
}
}), r.push(o);
}
return i.forEach(function(o) {
t.has(o.name) || n(o);
}), r;
}
function OA(i) {
var e = RA(i);
return $E.reduce(function(t, r) {
return t.concat(e.filter(function(n) {
return n.phase === r;
}));
}, []);
}
function PA(i) {
var e;
return function() {
return e || (e = new Promise(function(t) {
Promise.resolve().then(function() {
e = void 0, t(i());
});
})), e;
};
}
function IA(i) {
var e = i.reduce(function(t, r) {
var n = t[r.name];
return t[r.name] = n ? Object.assign({}, n, r, { options: Object.assign({}, n.options, r.options), data: Object.assign({}, n.data, r.data) }) : r, t;
}, {});
return Object.keys(e).map(function(t) {
return e[t];
});
}
var Dm = { placement: "bottom", modifiers: [], strategy: "absolute" };
function Nm() {
for (var i = arguments.length, e = new Array(i), t = 0; t < i; t++) e[t] = arguments[t];
return !e.some(function(r) {
return !(r && typeof r.getBoundingClientRect == "function");
});
}
function Tp(i) {
i === void 0 && (i = {});
var e = i, t = e.defaultModifiers, r = t === void 0 ? [] : t, n = e.defaultOptions, o = n === void 0 ? Dm : n;
return function(a, s, c) {
c === void 0 && (c = o);
var l = { placement: "bottom", orderedModifiers: [], options: Object.assign({}, Dm, o), modifiersData: {}, elements: { reference: a, popper: s }, attributes: {}, styles: {} }, h = [], u = !1, p = { state: l, setOptions: function(d) {
var y = typeof d == "function" ? d(l.options) : d;
g(), l.options = Object.assign({}, o, l.options, y), l.scrollParents = { reference: Ra(a) ? zs(a) : a.contextElement ? zs(a.contextElement) : [], popper: zs(s) };
var f = OA(IA([].concat(r, l.options.modifiers)));
return l.orderedModifiers = f.filter(function(v) {
return v.enabled;
}), m(), p.update();
}, forceUpdate: function() {
if (!u) {
var d = l.elements, y = d.reference, f = d.popper;
if (Nm(y, f)) {
l.rects = { reference: LA(y, ml(f), l.options.strategy === "fixed"), popper: xp(f) }, l.reset = !1, l.placement = l.options.placement, l.orderedModifiers.forEach(function(E) {
return l.modifiersData[E.name] = Object.assign({}, E.data);
});
for (var v = 0; v < l.orderedModifiers.length; v++) {
if (l.reset === !0) {
l.reset = !1, v = -1;
continue;
}
var _ = l.orderedModifiers[v], M = _.fn, T = _.options, w = T === void 0 ? {} : T, b = _.name;
typeof M == "function" && (l = M({ state: l, options: w, name: b, instance: p }) || l);
}
}
}
}, update: PA(function() {
return new Promise(function(d) {
p.forceUpdate(), d(l);
});
}), destroy: function() {
g(), u = !0;
} };
if (!Nm(a, s)) return p;
p.setOptions(c).then(function(d) {
!u && c.onFirstUpdate && c.onFirstUpdate(d);
});
function m() {
l.orderedModifiers.forEach(function(d) {
var y = d.name, f = d.options, v = f === void 0 ? {} : f, _ = d.effect;
if (typeof _ == "function") {
var M = _({ state: l, name: y, instance: p, options: v }), T = function() {
};
h.push(M || T);
}
});
}
function g() {
h.forEach(function(d) {
return d();
}), h = [];
}
return p;
};
}
Tp();
var DA = [$0, Z0, W0, U0];
Tp({ defaultModifiers: DA });
var NA = [$0, Z0, W0, U0, wA, gA, TA, tA, yA], BA = Tp({ defaultModifiers: NA });
const kA = (i, e, t = {}) => {
const r = {
name: "updateState",
enabled: !0,
phase: "write",
fn: ({ state: c }) => {
const l = FA(c);
Object.assign(a.value, l);
},
requires: ["computeStyles"]
}, n = ce(() => {
const { onFirstUpdate: c, placement: l, strategy: h, modifiers: u } = H(t);
return {
onFirstUpdate: c,
placement: l || "bottom",
strategy: h || "absolute",
modifiers: [
...u || [],
r,
{ name: "applyStyles", enabled: !1 }
]
};
}), o = Pi(), a = Ae({
styles: {
popper: {
position: H(n).strategy,
left: "0",
top: "0"
},
arrow: {
position: "absolute"
}
},
attributes: {}
}), s = () => {
o.value && (o.value.destroy(), o.value = void 0);
};
return Je(n, (c) => {
const l = H(o);
l && l.setOptions(c);
}, {
deep: !0
}), Je([i, e], ([c, l]) => {
s(), !(!c || !l) && (o.value = BA(c, l, H(n)));
}), sr(() => {
s();
}), {
state: ce(() => {
var c;
return { ...((c = H(o)) == null ? void 0 : c.state) || {} };
}),
styles: ce(() => H(a).styles),
attributes: ce(() => H(a).attributes),
update: () => {
var c;
return (c = H(o)) == null ? void 0 : c.update();
},
forceUpdate: () => {
var c;
return (c = H(o)) == null ? void 0 : c.forceUpdate();
},
instanceRef: ce(() => H(o))
};
};
function FA(i) {
const e = Object.keys(i.elements), t = Wc(e.map((n) => [n, i.styles[n] || {}])), r = Wc(e.map((n) => [n, i.attributes[n]]));
return {
styles: t,
attributes: r
};
}
function Bm() {
let i;
const e = (r, n) => {
t(), i = window.setTimeout(r, n);
}, t = () => window.clearTimeout(i);
return su(() => t()), {
registerTimeout: e,
cancelTimeout: t
};
}
const ud = {
prefix: Math.floor(Math.random() * 1e4),
current: 0
}, zA = Symbol("elIdInjection"), Ep = () => si() ? ct(zA, ud) : ud, vu = (i) => {
const e = Ep();
!ii && e === ud && Qt("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 t = vp();
return ce(() => H(i) || `${t.value}-id-${e.prefix}-${e.current++}`);
};
let xa = [];
const km = (i) => {
const e = i;
e.key === Ir.esc && xa.forEach((t) => t(e));
}, UA = (i) => {
ni(() => {
xa.length === 0 && document.addEventListener("keydown", km), ii && xa.push(i);
}), sr(() => {
xa = xa.filter((e) => e !== i), xa.length === 0 && ii && document.removeEventListener("keydown", km);
});
};
let Fm;
const Y0 = () => {
const i = vp(), e = Ep(), t = ce(() => `${i.value}-popper-container-${e.prefix}`), r = ce(() => `#${t.value}`);
return {
id: t,
selector: r
};
}, VA = (i) => {
const e = document.createElement("div");
return e.id = i, document.body.appendChild(e), e;
}, HA = () => {
const { id: i, selector: e } = Y0();
return mw(() => {
ii && (process.env.NODE_ENV === "test" || !Fm || !document.body.querySelector(e.value)) && (Fm = VA(i.value));
}), {
id: i,
selector: e
};
}, jA = ht({
showAfter: {
type: Number,
default: 0
},
hideAfter: {
type: Number,
default: 200
},
autoClose: {
type: Number,
default: 0
}
}), GA = ({
showAfter: i,
hideAfter: e,
autoClose: t,
open: r,
close: n
}) => {
const { registerTimeout: o } = Bm(), {
registerTimeout: a,
cancelTimeout: s
} = Bm();
return {
onOpen: (c) => {
o(() => {
r(c);
const l = H(t);
Mt(l) && l > 0 && a(() => {
n(c);
}, l);
}, H(i));
},
onClose: (c) => {
s(), o(() => {
n(c);
}, H(e));
}
};
}, J0 = Symbol("elForwardRef"), WA = (i) => {
pi(J0, {
setForwardRef: (e) => {
i.value = e;
}
});
}, $A = (i) => ({
mounted(e) {
i(e);
},
updated(e) {
i(e);
},
unmounted() {
i(null);
}
}), zm = {
current: 0
}, Um = Ae(0), K0 = 2e3, Vm = Symbol("elZIndexContextKey"), Q0 = Symbol("zIndexContextKey"), ey = (i) => {
const e = si() ? ct(Vm, zm) : zm, t = i || (si() ? ct(Q0, void 0) : void 0), r = ce(() => {
const a = H(t);
return Mt(a) ? a : K0;
}), n = ce(() => r.value + Um.value), o = () => (e.current++, Um.value = e.current, n.value);
return !ii && !ct(Vm) && Qt("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: r,
currentZIndex: n,
nextZIndex: o
};
};
function qA(i) {
let e;
function t() {
if (i.value == null)
return;
const { selectionStart: n, selectionEnd: o, value: a } = i.value;
if (n == null || o == null)
return;
const s = a.slice(0, Math.max(0, n)), c = a.slice(Math.max(0, o));
e = {
selectionStart: n,
selectionEnd: o,
value: a,
beforeTxt: s,
afterTxt: c
};
}
function r() {
if (i.value == null || e == null)
return;
const { value: n } = i.value, { beforeTxt: o, afterTxt: a, selectionStart: s } = e;
if (o == null || a == null || s == null)
return;
let c = n.length;
if (n.endsWith(a))
c = n.length - a.length;
else if (n.startsWith(o))
c = o.length;
else {
const l = o[s - 1], h = n.indexOf(l, s - 1);
h !== -1 && (c = h + 1);
}
i.value.setSelectionRange(c, c);
}
return [t, r];
}
const XA = (i, e, t) => Bc(i.subTree).filter((r) => {
var n;
return Qh(r) && ((n = r.type) == null ? void 0 : n.name) === e && !!r.component;
}).map((r) => r.component.uid).map((r) => t[r]).filter((r) => !!r), ZA = (i, e) => {
const t = {}, r = Pi([]);
return {
children: r,
addChild: (n) => {
t[n.uid] = n, r.value = XA(i, e, t);
},
removeChild: (n) => {
delete t[n], r.value = r.value.filter((o) => o.uid !== n);
}
};
}, Da = fu({
type: String,
values: N0,
required: !1
}), ty = Symbol("size"), YA = () => {
const i = ct(ty, {});
return ce(() => H(i.size) || "");
};
function iy(i, {
beforeFocus: e,
afterFocus: t,
beforeBlur: r,
afterBlur: n
} = {}) {
const o = si(), { emit: a } = o, s = Pi(), c = Ae(!1), l = (p) => {
Ci(e) && e(p) || c.value || (c.value = !0, a("focus", p), t == null || t());
}, h = (p) => {
var m;
Ci(r) && r(p) || p.relatedTarget && (m = s.value) != null && m.contains(p.relatedTarget) || (c.value = !1, a("blur", p), n == null || n());
}, u = () => {
var p, m;
(p = s.value) != null && p.contains(document.activeElement) && s.value !== document.activeElement || (m = i.value) == null || m.focus();
};
return Je(s, (p) => {
p && p.setAttribute("tabindex", "-1");
}), hi(s, "focus", l, !0), hi(s, "blur", h, !0), hi(s, "click", u, !0), process.env.NODE_ENV === "test" && ni(() => {
const p = Mo(i.value) ? i.value : document.querySelector("input,textarea");
p && (hi(p, "focus", l, !0), hi(p, "blur", h, !0));
}), {
isFocused: c,
wrapperRef: s,
handleFocus: l,
handleBlur: h
};
}
function ry({
afterComposition: i,
emit: e
}) {
const t = Ae(!1), r = (a) => {
e == null || e("compositionstart", a), t.value = !0;
}, n = (a) => {
var s;
e == null || e("compositionupdate", a);
const c = (s = a.target) == null ? void 0 : s.value, l = c[c.length - 1] || "";
t.value = !_E(l);
}, o = (a) => {
e == null || e("compositionend", a), t.value && (t.value = !1, _t(() => i(a)));
};
return {
isComposing: t,
handleComposition: (a) => {
a.type === "compositionend" ? o(a) : n(a);
},
handleCompositionStart: r,
handleCompositionUpdate: n,
handleCompositionEnd: o
};
}
const ny = Symbol("emptyValuesContextKey"), JA = "use-empty-values", KA = ["", void 0, null], QA = void 0, e2 = ht({
emptyValues: Array,
valueOnClear: {
type: [String, Number, Boolean, Function],
default: void 0,
validator: (i) => Ci(i) ? !i() : !i
}
}), t2 = (i, e) => {
const t = si() ? ct(ny, Ae({})) : Ae({}), r = ce(() => i.emptyValues || t.value.emptyValues || KA), n = ce(() => Ci(i.valueOnClear) ? i.valueOnClear() : i.valueOnClear !== void 0 ? i.valueOnClear : Ci(t.value.valueOnClear) ? t.value.valueOnClear() : t.value.valueOnClear !== void 0 ? t.value.valueOnClear : QA), o = (a) => r.value.includes(a);
return r.value.includes(n.value) || Qt(JA, "value-on-clear should be a value of empty-values"), {
emptyValues: r,
valueOnClear: n,
isEmptyValue: o
};
}, i2 = ht({
ariaLabel: String,
ariaOrientation: {
type: String,
values: ["horizontal", "vertical", "undefined"]
},
ariaControls: String
}), jo = (i) => YT(i2, i), oy = Symbol(), Yc = Ae();
function Ap(i, e = void 0) {
const t = si() ? ct(oy, Yc) : Yc;
return i ? ce(() => {
var r, n;
return (n = (r = t.value) == null ? void 0 : r[i]) != null ? n : e;
}) : t;
}
function r2(i, e) {
const t = Ap(), r = it(i, ce(() => {
var s;
return ((s = t.value) == null ? void 0 : s.namespace) || kc;
})), n = mu(ce(() => {
var s;
return (s = t.value) == null ? void 0 : s.locale;
})), o = ey(ce(() => {
var s;
return ((s = t.value) == null ? void 0 : s.zIndex) || K0;
})), a = ce(() => {
var s;
return H(e) || ((s = t.value) == null ? void 0 : s.size) || "";
});
return n2(ce(() => H(t) || {})), {
ns: r,
locale: n,
zIndex: o,
size: a
};
}
const n2 = (i, e, t = !1) => {
var r;
const n = !!si(), o = n ? Ap() : void 0, a = (r = void 0) != null ? r : n ? pi : void 0;
if (!a) {
Qt("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup().");
return;
}
const s = ce(() => {
const c = H(i);
return o != null && o.value ? o2(o.value, c) : c;
});
return a(oy, s), a(B0, ce(() => s.value.locale)), a(k0, ce(() => s.value.namespace)), a(Q0, ce(() => s.value.zIndex)), a(ty, {
size: ce(() => s.value.size || "")
}), a(ny, ce(() => ({
emptyValues: s.value.emptyValues,
valueOnClear: s.value.valueOnClear
}))), (t || !Yc.value) && (Yc.value = s.value), s;
}, o2 = (i, e) => {
const t = [.../* @__PURE__ */ new Set([...Tm(i), ...Tm(e)])], r = {};
for (const n of t)
r[n] = e[n] !== void 0 ? e[n] : i[n];
return r;
};
var at = (i, e) => {
const t = i.__vccOpts || i;
for (const [r, n] of e)
t[r] = n;
return t;
};
const a2 = ht({
size: {
type: Xe([Number, String])
},
color: {
type: String
}
}), s2 = Ie({
name: "ElIcon",
inheritAttrs: !1
}), l2 = /* @__PURE__ */ Ie({
...s2,
props: a2,
setup(i) {
const e = i, t = it("icon"), r = ce(() => {
const { size: n, color: o } = e;
return !n && !o ? {} : {
fontSize: vr(n) ? void 0 : qc(n),
"--color": o
};
});
return (n, o) => (fe(), Ce("i", Pr({
class: H(t).b(),
style: H(r)
}, n.$attrs), [
qe(n.$slots, "default")
], 16));
}
});
var c2 = /* @__PURE__ */ at(l2, [["__file", "icon.vue"]]);
const kt = fi(c2), Cp = Symbol("formContextKey"), Jc = Symbol("formItemContextKey"), ns = (i, e = {}) => {
const t = Ae(void 0), r = e.prop ? t : F0("size"), n = e.global ? t : YA(), o = e.form ? { size: void 0 } : ct(Cp, void 0), a = e.formItem ? { size: void 0 } : ct(Jc, void 0);
return ce(() => r.value || H(i) || (a == null ? void 0 : a.size) || (o == null ? void 0 : o.size) || n.value || "");
}, yu = (i) => {
const e = F0("disabled"), t = ct(Cp, void 0);
return ce(() => e.value || H(i) || (t == null ? void 0 : t.disabled) || !1);
}, gl = () => {
const i = ct(Cp, void 0), e = ct(Jc, void 0);
return {
form: i,
formItem: e
};
}, Lp = (i, {
formItemContext: e,
disableIdGeneration: t,
disableIdManagement: r
}) => {
t || (t = Ae(!1)), r || (r = Ae(!1));
const n = Ae();
let o;
const a = ce(() => {
var s;
return !!(!(i.label || i.ariaLabel) && e && e.inputIds && ((s = e.inputIds) == null ? void 0 : s.length) <= 1);
});
return ni(() => {
o = Je([ki(i, "id"), t], ([s, c]) => {
const l = s ?? (c ? void 0 : vu().value);
l !== n.value && (e != null && e.removeInputId && (n.value && e.removeInputId(n.value), !(r != null && r.value) && !c && l && e.addInputId(l)), n.value = l);
}, { immediate: !0 });
}), s0(() => {
o && o(), e != null && e.removeInputId && n.value && e.removeInputId(n.value);
}), {
isLabeledByFormItem: a,
inputId: n
};
};
let cr;
const u2 = `
height:0 !important;
visibility:hidden !important;
${Jw() ? "" : "overflow:hidden !important;"}
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important;
`, h2 = [
"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 d2(i) {
const e = window.getComputedStyle(i), t = e.getPropertyValue("box-sizing"), r = Number.parseFloat(e.getPropertyValue("padding-bottom")) + Number.parseFloat(e.getPropertyValue("padding-top")), n = Number.parseFloat(e.getPropertyValue("border-bottom-width")) + Number.parseFloat(e.getPropertyValue("border-top-width"));
return { contextStyle: h2.map((o) => `${o}:${e.getPropertyValue(o)}`).join(";"), paddingSize: r, borderSize: n, boxSizing: t };
}
function Hm(i, e = 1, t) {
var r;
cr || (cr = document.createElement("textarea"), document.body.appendChild(cr));
const { paddingSize: n, borderSize: o, boxSizing: a, contextStyle: s } = d2(i);
cr.setAttribute("style", `${s};${u2}`), cr.value = i.value || i.placeholder || "";
let c = cr.scrollHeight;
const l = {};
a === "border-box" ? c = c + o : a === "content-box" && (c = c - n), cr.value = "";
const h = cr.scrollHeight - n;
if (Mt(e)) {
let u = h * e;
a === "border-box" && (u = u + n + o), c = Math.max(u, c), l.minHeight = `${u}px`;
}
if (Mt(t)) {
let u = h * t;
a === "border-box" && (u = u + n + o), c = Math.min(u, c);
}
return l.height = `${c}px`, (r = cr.parentNode) == null || r.removeChild(cr), cr = void 0, l;
}
const p2 = ht({
id: {
type: String,
default: void 0
},
size: Da,
disabled: Boolean,
modelValue: {
type: Xe([
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: Xe([Boolean, Object]),
default: !1
},
autocomplete: {
type: String,
default: "off"
},
formatter: {
type: Function
},
parser: {
type: Function
},
placeholder: {
type: String
},
form: {
type: String
},
readonly: Boolean,
clearable: Boolean,
showPassword: Boolean,
showWordLimit: Boolean,
suffixIcon: {
type: qn
},
prefixIcon: {
type: qn
},
containerRole: {
type: String,
default: void 0
},
tabindex: {
type: [String, Number],
default: 0
},
validateEvent: {
type: Boolean,
default: !0
},
inputStyle: {
type: Xe([Object, Array, String]),
default: () => en({})
},
autofocus: Boolean,
rows: {
type: Number,
default: 2
},
...jo(["ariaLabel"])
}), f2 = {
[Dt]: (i) => Ii(i),
input: (i) => Ii(i),
change: (i) => Ii(i),
focus: (i) => i instanceof FocusEvent,
blur: (i) => i instanceof FocusEvent,
clear: () => !0,
mouseleave: (i) => i instanceof MouseEvent,
mouseenter: (i) => i instanceof MouseEvent,
keydown: (i) => i instanceof Event,
compositionstart: (i) => i instanceof CompositionEvent,
compositionupdate: (i) => i instanceof CompositionEvent,
compositionend: (i) => i instanceof CompositionEvent
}, m2 = Ie({
name: "ElInput",
inheritAttrs: !1
}), g2 = /* @__PURE__ */ Ie({
...m2,
props: p2,
emits: f2,
setup(i, { expose: e, emit: t }) {
const r = i, n = sw(), o = au(), a = ce(() => {
const le = {};
return r.containerRole === "combobox" && (le["aria-haspopup"] = n["aria-haspopup"], le["aria-owns"] = n["aria-owns"], le["aria-expanded"] = n["aria-expanded"]), le;
}), s = ce(() => [
r.type === "textarea" ? y.b() : d.b(),
d.m(m.value),
d.is("disabled", g.value),
d.is("exceed", K.value),
{
[d.b("group")]: o.prepend || o.append,
[d.m("prefix")]: o.prefix || r.prefixIcon,
[d.m("suffix")]: o.suffix || r.suffixIcon || r.clearable || r.showPassword,
[d.bm("suffix", "password-clear")]: D.value && k.value,
[d.b("hidden")]: r.type === "hidden"
},
n.class
]), c = ce(() => [
d.e("wrapper"),
d.is("focus", S.value)
]), l = TE({
excludeKeys: ce(() => Object.keys(a.value))
}), { form: h, formItem: u } = gl(), { inputId: p } = Lp(r, {
formItemContext: u
}), m = ns(), g = yu(), d = it("input"), y = it("textarea"), f = Pi(), v = Pi(), _ = Ae(!1), M = Ae(!1), T = Ae(), w = Pi(r.inputStyle), b = ce(() => f.value || v.value), { wrapperRef: E, isFocused: S, handleFocus: C, handleBlur: R } = iy(b, {
beforeFocus() {
return g.value;
},
afterBlur() {
var le;
r.validateEvent && ((le = u == null ? void 0 : u.validate) == null || le.call(u, "blur").catch((Se) => Qt(Se)));
}
}), L = ce(() => {
var le;
return (le = h == null ? void 0 : h.statusIcon) != null ? le : !1;
}), A = ce(() => (u == null ? void 0 : u.validateState) || ""), P = ce(() => A.value && D0[A.value]), O = ce(() => M.value ? yE : dE), x = ce(() => [
n.style
]), I = ce(() => [
r.inputStyle,
w.value,
{ resize: r.resize }
]), N = ce(() => on(r.modelValue) ? "" : String(r.modelValue)), D = ce(() => r.clearable && !g.value && !r.readonly && !!N.value && (S.value || _.value)), k = ce(() => r.showPassword && !g.value && !r.readonly && !!N.value && (!!N.value || S.value)), F = ce(() => r.showWordLimit && !!r.maxlength && (r.type === "text" || r.type === "textarea") && !g.value && !r.readonly && !r.showPassword), W = ce(() => N.value.length), K = ce(() => !!F.value && W.value > Number(r.maxlength)), ne = ce(() => !!o.suffix || !!r.suffixIcon || D.value || r.showPassword || F.value || !!A.value && L.value), [q, z] = qA(f);
ir(v, (le) => {
if (Q(), !F.value || r.resize !== "both")
return;
const Se = le[0], { width: Te } = Se.contentRect;
T.value = {
right: `calc(100% - ${Te + 15 + 6}px)`
};
});
const j = () => {
const { type: le, autosize: Se } = r;
if (!(!ii || le !== "textarea" || !v.value))
if (Se) {
const Te = Oi(Se) ? Se.minRows : void 0, oe = Oi(Se) ? Se.maxRows : void 0, Me = Hm(v.value, Te, oe);
w.value = {
overflowY: "hidden",
...Me
}, _t(() => {
v.value.offsetHeight, w.value = Me;
});
} else
w.value = {
minHeight: Hm(v.value).minHeight
};
}, Q = /* @__PURE__ */ ((le) => {
let Se = !1;
return () => {
var Te;
Se || !r.autosize || ((Te = v.value) == null ? void 0 : Te.offsetParent) === null || (le(), Se = !0);
};
})(j), Y = () => {
const le = b.value, Se = r.formatter ? r.formatter(N.value) : N.value;
!le || le.value === Se || (le.value = Se);
}, ee = async (le) => {
q();
let { value: Se } = le.target;
if (r.formatter && (Se = r.parser ? r.parser(Se) : Se), !J.value) {
if (Se === N.value) {
Y();
return;
}
t(Dt, Se), t("input", Se), await _t(), Y(), z();
}
}, G = (le) => {
t("change", le.target.value);
}, {
isComposing: J,
handleCompositionStart: re,
handleCompositionUpdate: B,
handleCompositionEnd: $
} = ry({ emit: t, afterComposition: ee }), te = () => {
M.value = !M.value, U();
}, U = async () => {
var le;
await _t(), (le = b.value) == null || le.focus();
}, V = () => {
var le;
return (le = b.value) == null ? void 0 : le.blur();
}, ae = (le) => {
_.value = !1, t("mouseleave", le);
}, ue = (le) => {
_.value = !0, t("mouseenter", le);
}, de = (le) => {
t("keydown", le);
}, ve = () => {
var le;
(le = b.value) == null || le.select();
}, ye = () => {
t(Dt, ""), t("change", ""), t("clear"), t("input", "");
};
return Je(() => r.modelValue, () => {
var le;
_t(() => j()), r.validateEvent && ((le = u == null ? void 0 : u.validate) == null || le.call(u, "change").catch((Se) => Qt(Se)));
}), Je(N, () => Y()), Je(() => r.type, async () => {
await _t(), Y(), j();
}), ni(() => {
!r.formatter && r.parser && Qt("ElInput", "If you set the parser, you also need to set the formatter."), Y(), _t(j);
}), e({
input: f,
textarea: v,
ref: b,
textareaStyle: I,
autosize: ki(r, "autosize"),
isComposing: J,
focus: U,
blur: V,
select: ve,
clear: ye,
resizeTextarea: j
}), (le, Se) => (fe(), Ce("div", Pr(H(a), {
class: [
H(s),
{
[H(d).bm("group", "append")]: le.$slots.append,
[H(d).bm("group", "prepend")]: le.$slots.prepend
}
],
style: H(x),
role: le.containerRole,
onMouseenter: ue,
onMouseleave: ae
}), [
Ve(" input "),
le.type !== "textarea" ? (fe(), Ce(Gt, { key: 0 }, [
Ve(" prepend slot "),
le.$slots.prepend ? (fe(), Ce("div", {
key: 0,
class: Le(H(d).be("group", "prepend"))
}, [
qe(le.$slots, "prepend")
], 2)) : Ve("v-if", !0),
ke("div", {
ref_key: "wrapperRef",
ref: E,
class: Le(H(c))
}, [
Ve(" prefix slot "),
le.$slots.prefix || le.prefixIcon ? (fe(), Ce("span", {
key: 0,
class: Le(H(d).e("prefix"))
}, [
ke("span", {
class: Le(H(d).e("prefix-inner"))
}, [
qe(le.$slots, "prefix"),
le.prefixIcon ? (fe(), He(H(kt), {
key: 0,
class: Le(H(d).e("icon"))
}, {
default: pe(() => [
(fe(), He(Fi(le.prefixIcon)))
]),
_: 1
}, 8, ["class"])) : Ve("v-if", !0)
], 2)
], 2)) : Ve("v-if", !0),
ke("input", Pr({
id: H(p),
ref_key: "input",
ref: f,
class: H(d).e("inner")
}, H(l), {
minlength: le.minlength,
maxlength: le.maxlength,
type: le.showPassword ? M.value ? "text" : "password" : le.type,
disabled: H(g),
readonly: le.readonly,
autocomplete: le.autocomplete,
tabindex: le.tabindex,
"aria-label": le.ariaLabel,
placeholder: le.placeholder,
style: le.inputStyle,
form: le.form,
autofocus: le.autofocus,
onCompositionstart: H(re),
onCompositionupdate: H(B),
onCompositionend: H($),
onInput: ee,
onChange: G,
onKeydown: de
}), null, 16, ["id", "minlength", "maxlength", "type", "disabled", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form", "autofocus", "onCompositionstart", "onCompositionupdate", "onCompositionend"]),
Ve(" suffix slot "),
H(ne) ? (fe(), Ce("span", {
key: 1,
class: Le(H(d).e("suffix"))
}, [
ke("span", {
class: Le(H(d).e("suffix-inner"))
}, [
!H(D) || !H(k) || !H(F) ? (fe(), Ce(Gt, { key: 0 }, [
qe(le.$slots, "suffix"),
le.suffixIcon ? (fe(), He(H(kt), {
key: 0,
class: Le(H(d).e("icon"))
}, {
default: pe(() => [
(fe(), He(Fi(le.suffixIcon)))
]),
_: 1
}, 8, ["class"])) : Ve("v-if", !0)
], 64)) : Ve("v-if", !0),
H(D) ? (fe(), He(H(kt), {
key: 1,
class: Le([H(d).e("icon"), H(d).e("clear")]),
onMousedown: ui(H($s), ["prevent"]),
onClick: ye
}, {
default: pe(() => [
se(H(gp))
]),
_: 1
}, 8, ["class", "onMousedown"])) : Ve("v-if", !0),
H(k) ? (fe(), He(H(kt), {
key: 2,
class: Le([H(d).e("icon"), H(d).e("password")]),
onClick: te
}, {
default: pe(() => [
(fe(), He(Fi(H(O))))
]),
_: 1
}, 8, ["class"])) : Ve("v-if", !0),
H(F) ? (fe(), Ce("span", {
key: 3,
class: Le(H(d).e("count"))
}, [
ke("span", {
class: Le(H(d).e("count-inner"))
}, wt(H(W)) + " / " + wt(le.maxlength), 3)
], 2)) : Ve("v-if", !0),
H(A) && H(P) && H(L) ? (fe(), He(H(kt), {
key: 4,
class: Le([
H(d).e("icon"),
H(d).e("validateIcon"),
H(d).is("loading", H(A) === "validating")
])
}, {
default: pe(() => [
(fe(), He(Fi(H(P))))
]),
_: 1
}, 8, ["class"])) : Ve("v-if", !0)
], 2)
], 2)) : Ve("v-if", !0)
], 2),
Ve(" append slot "),
le.$slots.append ? (fe(), Ce("div", {
key: 1,
class: Le(H(d).be("group", "append"))
}, [
qe(le.$slots, "append")
], 2)) : Ve("v-if", !0)
], 64)) : (fe(), Ce(Gt, { key: 1 }, [
Ve(" textarea "),
ke("textarea", Pr({
id: H(p),
ref_key: "textarea",
ref: v,
class: [H(y).e("inner"), H(d).is("focus", H(S))]
}, H(l), {
minlength: le.minlength,
maxlength: le.maxlength,
tabindex: le.tabindex,
disabled: H(g),
readonly: le.readonly,
autocomplete: le.autocomplete,
style: H(I),
"aria-label": le.ariaLabel,
placeholder: le.placeholder,
form: le.form,
autofocus: le.autofocus,
rows: le.rows,
onCompositionstart: H(re),
onCompositionupdate: H(B),
onCompositionend: H($),
onInput: ee,
onFocus: H(C),
onBlur: H(R),
onChange: G,
onKeydown: de
}), null, 16, ["id", "minlength", "maxlength", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form", "autofocus", "rows", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onFocus", "onBlur"]),
H(F) ? (fe(), Ce("span", {
key: 0,
style: It(T.value),
class: Le(H(d).e("count"))
}, wt(H(W)) + " / " + wt(le.maxlength), 7)) : Ve("v-if", !0)
], 64))
], 16, ["role"]));
}
});
var v2 = /* @__PURE__ */ at(g2, [["__file", "input.vue"]]);
const y2 = fi(v2), Yo = 4, b2 = {
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"
}
}, x2 = ({
move: i,
size: e,
bar: t
}) => ({
[t.size]: e,
transform: `translate${t.axis}(${i}%)`
}), Rp = Symbol("scrollbarContextKey"), w2 = ht({
vertical: Boolean,
size: String,
move: Number,
ratio: {
type: Number,
required: !0
},
always: Boolean
}), _2 = "Thumb", M2 = /* @__PURE__ */ Ie({
__name: "thumb",
props: w2,
setup(i) {
const e = i, t = ct(Rp), r = it("scrollbar");
t || is(_2, "can not inject scrollbar context");
const n = Ae(), o = Ae(), a = Ae({}), s = Ae(!1);
let c = !1, l = !1, h = ii ? document.onselectstart : null;
const u = ce(() => b2[e.vertical ? "vertical" : "horizontal"]), p = ce(() => x2({
size: e.size,
move: e.move,
bar: u.value
})), m = ce(() => n.value[u.value.offset] ** 2 / t.wrapElement[u.value.scrollSize] / e.ratio / o.value[u.value.offset]), g = (w) => {
var b;
if (w.stopPropagation(), w.ctrlKey || [1, 2].includes(w.button))
return;
(b = window.getSelection()) == null || b.removeAllRanges(), y(w);
const E = w.currentTarget;
E && (a.value[u.value.axis] = E[u.value.offset] - (w[u.value.client] - E.getBoundingClientRect()[u.value.direction]));
}, d = (w) => {
if (!o.value || !n.value || !t.wrapElement)
return;
const b = Math.abs(w.target.getBoundingClientRect()[u.value.direction] - w[u.value.client]), E = o.value[u.value.offset] / 2, S = (b - E) * 100 * m.value / n.value[u.value.offset];
t.wrapElement[u.value.scroll] = S * t.wrapElement[u.value.scrollSize] / 100;
}, y = (w) => {
w.stopImmediatePropagation(), c = !0, document.addEventListener("mousemove", f), document.addEventListener("mouseup", v), h = document.onselectstart, document.onselectstart = () => !1;
}, f = (w) => {
if (!n.value || !o.value || c === !1)
return;
const b = a.value[u.value.axis];
if (!b)
return;
const E = (n.value.getBoundingClientRect()[u.value.direction] - w[u.value.client]) * -1, S = o.value[u.value.offset] - b, C = (E - S) * 100 * m.value / n.value[u.value.offset];
t.wrapElement[u.value.scroll] = C * t.wrapElement[u.value.scrollSize] / 100;
}, v = () => {
c = !1, a.value[u.value.axis] = 0, document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", v), T(), l && (s.value = !1);
}, _ = () => {
l = !1, s.value = !!e.size;
}, M = () => {
l = !0, s.value = c;
};
sr(() => {
T(), document.removeEventListener("mouseup", v);
});
const T = () => {
document.onselectstart !== h && (document.onselectstart = h);
};
return hi(ki(t, "scrollbarElement"), "mousemove", _), hi(ki(t, "scrollbarElement"), "mouseleave", M), (w, b) => (fe(), He(hl, {
name: H(r).b("fade"),
persisted: ""
}, {
default: pe(() => [
Bt(ke("div", {
ref_key: "instance",
ref: n,
class: Le([H(r).e("bar"), H(r).is(H(u).key)]),
onMousedown: d
}, [
ke("div", {
ref_key: "thumb",
ref: o,
class: Le(H(r).e("thumb")),
style: It(H(p)),
onMousedown: g
}, null, 38)
], 34), [
[yi, w.always || s.value]
])
]),
_: 1
}, 8, ["name"]));
}
});
var jm = /* @__PURE__ */ at(M2, [["__file", "thumb.vue"]]);
const S2 = ht({
always: {
type: Boolean,
default: !0
},
minSize: {
type: Number,
required: !0
}
}), T2 = /* @__PURE__ */ Ie({
__name: "bar",
props: S2,
setup(i, { expose: e }) {
const t = i, r = ct(Rp), n = Ae(0), o = Ae(0), a = Ae(""), s = Ae(""), c = Ae(1), l = Ae(1);
return e({
handleScroll: (h) => {
if (h) {
const u = h.offsetHeight - Yo, p = h.offsetWidth - Yo;
o.value = h.scrollTop * 100 / u * c.value, n.value = h.scrollLeft * 100 / p * l.value;
}
},
update: () => {
const h = r == null ? void 0 : r.wrapElement;
if (!h)
return;
const u = h.offsetHeight - Yo, p = h.offsetWidth - Yo, m = u ** 2 / h.scrollHeight, g = p ** 2 / h.scrollWidth, d = Math.max(m, t.minSize), y = Math.max(g, t.minSize);
c.value = m / (u - m) / (d / (u - d)), l.value = g / (p - g) / (y / (p - y)), s.value = d + Yo < u ? `${d}px` : "", a.value = y + Yo < p ? `${y}px` : "";
}
}), (h, u) => (fe(), Ce(Gt, null, [
se(jm, {
move: n.value,
ratio: l.value,
size: a.value,
always: h.always
}, null, 8, ["move", "ratio", "size", "always"]),
se(jm, {
move: o.value,
ratio: c.value,
size: s.value,
vertical: "",
always: h.always
}, null, 8, ["move", "ratio", "size", "always"])
], 64));
}
});
var E2 = /* @__PURE__ */ at(T2, [["__file", "bar.vue"]]);
const A2 = ht({
height: {
type: [String, Number],
default: ""
},
maxHeight: {
type: [String, Number],
default: ""
},
native: {
type: Boolean,
default: !1
},
wrapStyle: {
type: Xe([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,
...jo(["ariaLabel", "ariaOrientation"])
}), C2 = {
scroll: ({
scrollTop: i,
scrollLeft: e
}) => [i, e].every(Mt)
}, hd = "ElScrollbar", L2 = Ie({
name: hd
}), R2 = /* @__PURE__ */ Ie({
...L2,
props: A2,
emits: C2,
setup(i, { expose: e, emit: t }) {
const r = i, n = it("scrollbar");
let o, a, s = 0, c = 0;
const l = Ae(), h = Ae(), u = Ae(), p = Ae(), m = ce(() => {
const T = {};
return r.height && (T.height = qc(r.height)), r.maxHeight && (T.maxHeight = qc(r.maxHeight)), [r.wrapStyle, T];
}), g = ce(() => [
r.wrapClass,
n.e("wrap"),
{ [n.em("wrap", "hidden-default")]: !r.native }
]), d = ce(() => [n.e("view"), r.viewClass]), y = () => {
var T;
h.value && ((T = p.value) == null || T.handleScroll(h.value), s = h.value.scrollTop, c = h.value.scrollLeft, t("scroll", {
scrollTop: h.value.scrollTop,
scrollLeft: h.value.scrollLeft
}));
};
function f(T, w) {
Oi(T) ? h.value.scrollTo(T) : Mt(T) && Mt(w) && h.value.scrollTo(T, w);
}
const v = (T) => {
if (!Mt(T)) {
Qt(hd, "value must be a number");
return;
}
h.value.scrollTop = T;
}, _ = (T) => {
if (!Mt(T)) {
Qt(hd, "value must be a number");
return;
}
h.value.scrollLeft = T;
}, M = () => {
var T;
(T = p.value) == null || T.update();
};
return Je(() => r.noresize, (T) => {
T ? (o == null || o(), a == null || a()) : ({ stop: o } = ir(u, M), a = hi("resize", M));
}, { immediate: !0 }), Je(() => [r.maxHeight, r.height], () => {
r.native || _t(() => {
var T;
M(), h.value && ((T = p.value) == null || T.handleScroll(h.value));
});
}), pi(Rp, Yi({
scrollbarElement: l,
wrapElement: h
})), lw(() => {
h.value && (h.value.scrollTop = s, h.value.scrollLeft = c);
}), ni(() => {
r.native || _t(() => {
M();
});
}), rp(() => M()), e({
wrapRef: h,
update: M,
scrollTo: f,
setScrollTop: v,
setScrollLeft: _,
handleScroll: y
}), (T, w) => (fe(), Ce("div", {
ref_key: "scrollbarRef",
ref: l,
class: Le(H(n).b())
}, [
ke("div", {
ref_key: "wrapRef",
ref: h,
class: Le(H(g)),
style: It(H(m)),
tabindex: T.tabindex,
onScroll: y
}, [
(fe(), He(Fi(T.tag), {
id: T.id,
ref_key: "resizeRef",
ref: u,
class: Le(H(d)),
style: It(T.viewStyle),
role: T.role,
"aria-label": T.ariaLabel,
"aria-orientation": T.ariaOrientation
}, {
default: pe(() => [
qe(T.$slots, "default")
]),
_: 3
}, 8, ["id", "class", "style", "role", "aria-label", "aria-orientation"]))
], 46, ["tabindex"]),
T.native ? Ve("v-if", !0) : (fe(), He(E2, {
key: 0,
ref_key: "barRef",
ref: p,
always: T.always,
"min-size": T.minSize
}, null, 8, ["always", "min-size"]))
], 2));
}
});
var O2 = /* @__PURE__ */ at(R2, [["__file", "scrollbar.vue"]]);
const P2 = fi(O2), Op = Symbol("popper"), ay = Symbol("popperContent"), I2 = [
"dialog",
"grid",
"group",
"listbox",
"menu",
"navigation",
"tooltip",
"tree"
], sy = ht({
role: {
type: String,
values: I2,
default: "tooltip"
}
}), D2 = Ie({
name: "ElPopper",
inheritAttrs: !1
}), N2 = /* @__PURE__ */ Ie({
...D2,
props: sy,
setup(i, { expose: e }) {
const t = i, r = Ae(), n = Ae(), o = Ae(), a = Ae(), s = ce(() => t.role), c = {
triggerRef: r,
popperInstanceRef: n,
contentRef: o,
referenceRef: a,
role: s
};
return e(c), pi(Op, c), (l, h) => qe(l.$slots, "default");
}
});
var B2 = /* @__PURE__ */ at(N2, [["__file", "popper.vue"]]);
const ly = ht({
arrowOffset: {
type: Number,
default: 5
}
}), k2 = Ie({
name: "ElPopperArrow",
inheritAttrs: !1
}), F2 = /* @__PURE__ */ Ie({
...k2,
props: ly,
setup(i, { expose: e }) {
const t = i, r = it("popper"), { arrowOffset: n, arrowRef: o, arrowStyle: a } = ct(ay, void 0);
return Je(() => t.arrowOffset, (s) => {
n.value = s;
}), sr(() => {
o.value = void 0;
}), e({
arrowRef: o
}), (s, c) => (fe(), Ce("span", {
ref_key: "arrowRef",
ref: o,
class: Le(H(r).e("arrow")),
style: It(H(a)),
"data-popper-arrow": ""
}, null, 6));
}
});
var z2 = /* @__PURE__ */ at(F2, [["__file", "arrow.vue"]]);
const Ju = "ElOnlyChild", U2 = Ie({
name: Ju,
setup(i, {
slots: e,
attrs: t
}) {
var r;
const n = ct(J0), o = $A((r = n == null ? void 0 : n.setForwardRef) != null ? r : $s);
return () => {
var a;
const s = (a = e.default) == null ? void 0 : a.call(e, t);
if (!s)
return null;
if (s.length > 1)
return Qt(Ju, "requires exact only one valid child."), null;
const c = cy(s);
return c ? Bt(cw(c, t), [[o]]) : (Qt(Ju, "no valid child node found"), null);
};
}
});
function cy(i) {
if (!i)
return null;
const e = i;
for (const t of e) {
if (Oi(t))
switch (t.type) {
case uw:
continue;
case o0:
case "svg":
return Gm(t);
case Gt:
return cy(t.children);
default:
return t;
}
return Gm(t);
}
return null;
}
function Gm(i) {
const e = it("only-child");
return se("span", {
class: e.e("content")
}, [i]);
}
const uy = ht({
virtualRef: {
type: Xe(Object)
},
virtualTriggering: Boolean,
onMouseenter: {
type: Xe(Function)
},
onMouseleave: {
type: Xe(Function)
},
onClick: {
type: Xe(Function)
},
onKeydown: {
type: Xe(Function)
},
onFocus: {
type: Xe(Function)
},
onBlur: {
type: Xe(Function)
},
onContextmenu: {
type: Xe(Function)
},
id: String,
open: Boolean
}), V2 = Ie({
name: "ElPopperTrigger",
inheritAttrs: !1
}), H2 = /* @__PURE__ */ Ie({
...V2,
props: uy,
setup(i, { expose: e }) {
const t = i, { role: r, triggerRef: n } = ct(Op, void 0);
WA(n);
const o = ce(() => s.value ? t.id : void 0), a = ce(() => {
if (r && r.value === "tooltip")
return t.open && t.id ? t.id : void 0;
}), s = ce(() => {
if (r && r.value !== "tooltip")
return r.value;
}), c = ce(() => s.value ? `${t.open}` : void 0);
let l;
const h = [
"onMouseenter",
"onMouseleave",
"onClick",
"onKeydown",
"onFocus",
"onBlur",
"onContextmenu"
];
return ni(() => {
Je(() => t.virtualRef, (u) => {
u && (n.value = rn(u));
}, {
immediate: !0
}), Je(n, (u, p) => {
l == null || l(), l = void 0, Mo(u) && (h.forEach((m) => {
var g;
const d = t[m];
d && (u.addEventListener(m.slice(2).toLowerCase(), d), (g = p == null ? void 0 : p.removeEventListener) == null || g.call(p, m.slice(2).toLowerCase(), d));
}), l = Je([o, a, s, c], (m) => {
[
"aria-controls",
"aria-describedby",
"aria-haspopup",
"aria-expanded"
].forEach((g, d) => {
on(m[d]) ? u.removeAttribute(g) : u.setAttribute(g, m[d]);
});
}, { immediate: !0 })), Mo(p) && [
"aria-controls",
"aria-describedby",
"aria-haspopup",
"aria-expanded"
].forEach((m) => p.removeAttribute(m));
}, {
immediate: !0
});
}), sr(() => {
if (l == null || l(), l = void 0, n.value && Mo(n.value)) {
const u = n.value;
h.forEach((p) => {
const m = t[p];
m && u.removeEventListener(p.slice(2).toLowerCase(), m);
}), n.value = void 0;
}
}), e({
triggerRef: n
}), (u, p) => u.virtualTriggering ? Ve("v-if", !0) : (fe(), He(H(U2), Pr({ key: 0 }, u.$attrs, {
"aria-controls": H(o),
"aria-describedby": H(a),
"aria-expanded": H(c),
"aria-haspopup": H(s)
}), {
default: pe(() => [
qe(u.$slots, "default")
]),
_: 3
}, 16, ["aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup"]));
}
});
var j2 = /* @__PURE__ */ at(H2, [["__file", "trigger.vue"]]);
const Ku = "focus-trap.focus-after-trapped", Qu = "focus-trap.focus-after-released", G2 = "focus-trap.focusout-prevented", Wm = {
cancelable: !0,
bubbles: !1
}, W2 = {
cancelable: !0,
bubbles: !1
}, $m = "focusAfterTrapped", qm = "focusAfterReleased", $2 = Symbol("elFocusTrap"), Pp = Ae(), bu = Ae(0), Ip = Ae(0);
let kl = 0;
const hy = (i) => {
const e = [], t = document.createTreeWalker(i, NodeFilter.SHOW_ELEMENT, {
acceptNode: (r) => {
const n = r.tagName === "INPUT" && r.type === "hidden";
return r.disabled || r.hidden || n ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 || r === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
}
});
for (; t.nextNode(); )
e.push(t.currentNode);
return e;
}, Xm = (i, e) => {
for (const t of i)
if (!q2(t, e))
return t;
}, q2 = (i, e) => {
if (process.env.NODE_ENV === "test")
return !1;
if (getComputedStyle(i).visibility === "hidden")
return !0;
for (; i; ) {
if (e && i === e)
return !1;
if (getComputedStyle(i).display === "none")
return !0;
i = i.parentElement;
}
return !1;
}, X2 = (i) => {
const e = hy(i), t = Xm(e, i), r = Xm(e.reverse(), i);
return [t, r];
}, Z2 = (i) => i instanceof HTMLInputElement && "select" in i, Pn = (i, e) => {
if (i && i.focus) {
const t = document.activeElement;
i.focus({ preventScroll: !0 }), Ip.value = window.performance.now(), i !== t && Z2(i) && e && i.select();
}
};
function Zm(i, e) {
const t = [...i], r = i.indexOf(e);
return r !== -1 && t.splice(r, 1), t;
}
const Y2 = () => {
let i = [];
return {
push: (e) => {
const t = i[0];
t && e !== t && t.pause(), i = Zm(i, e), i.unshift(e);
},
remove: (e) => {
var t, r;
i = Zm(i, e), (r = (t = i[0]) == null ? void 0 : t.resume) == null || r.call(t);
}
};
}, J2 = (i, e = !1) => {
const t = document.activeElement;
for (const r of i)
if (Pn(r, e), document.activeElement !== t)
return;
}, Ym = Y2(), K2 = () => bu.value > Ip.value, Fl = () => {
Pp.value = "pointer", bu.value = window.performance.now();
}, Jm = () => {
Pp.value = "keyboard", bu.value = window.performance.now();
}, Q2 = () => (ni(() => {
kl === 0 && (document.addEventListener("mousedown", Fl), document.addEventListener("touchstart", Fl), document.addEventListener("keydown", Jm)), kl++;
}), sr(() => {
kl--, kl <= 0 && (document.removeEventListener("mousedown", Fl), document.removeEventListener("touchstart", Fl), document.removeEventListener("keydown", Jm));
}), {
focusReason: Pp,
lastUserFocusTimestamp: bu,
lastAutomatedFocusTimestamp: Ip
}), zl = (i) => new CustomEvent(G2, {
...W2,
detail: i
}), eC = Ie({
name: "ElFocusTrap",
inheritAttrs: !1,
props: {
loop: Boolean,
trapped: Boolean,
focusTrapEl: Object,
focusStartEl: {
type: [Object, String],
default: "first"
}
},
emits: [
$m,
qm,
"focusin",
"focusout",
"focusout-prevented",
"release-requested"
],
setup(i, { emit: e }) {
const t = Ae();
let r, n;
const { focusReason: o } = Q2();
UA((g) => {
i.trapped && !a.paused && e("release-requested", g);
});
const a = {
paused: !1,
pause() {
this.paused = !0;
},
resume() {
this.paused = !1;
}
}, s = (g) => {
if (!i.loop && !i.trapped || a.paused)
return;
const { key: d, altKey: y, ctrlKey: f, metaKey: v, currentTarget: _, shiftKey: M } = g, { loop: T } = i, w = d === Ir.tab && !y && !f && !v, b = document.activeElement;
if (w && b) {
const E = _, [S, C] = X2(E);
if (S && C) {
if (!M && b === C) {
const R = zl({
focusReason: o.value
});
e("focusout-prevented", R), R.defaultPrevented || (g.preventDefault(), T && Pn(S, !0));
} else if (M && [S, E].includes(b)) {
const R = zl({
focusReason: o.value
});
e("focusout-prevented", R), R.defaultPrevented || (g.preventDefault(), T && Pn(C, !0));
}
} else if (b === E) {
const R = zl({
focusReason: o.value
});
e("focusout-prevented", R), R.defaultPrevented || g.preventDefault();
}
}
};
pi($2, {
focusTrapRef: t,
onKeydown: s
}), Je(() => i.focusTrapEl, (g) => {
g && (t.value = g);
}, { immediate: !0 }), Je([t], ([g], [d]) => {
g && (g.addEventListener("keydown", s), g.addEventListener("focusin", h), g.addEventListener("focusout", u)), d && (d.removeEventListener("keydown", s), d.removeEventListener("focusin", h), d.removeEventListener("focusout", u));
});
const c = (g) => {
e($m, g);
}, l = (g) => e(qm, g), h = (g) => {
const d = H(t);
if (!d)
return;
const y = g.target, f = g.relatedTarget, v = y && d.contains(y);
i.trapped || f && d.contains(f) || (r = f), v && e("focusin", g), !a.paused && i.trapped && (v ? n = y : Pn(n, !0));
}, u = (g) => {
const d = H(t);
if (!(a.paused || !d))
if (i.trapped) {
const y = g.relatedTarget;
!on(y) && !d.contains(y) && setTimeout(() => {
if (!a.paused && i.trapped) {
const f = zl({
focusReason: o.value
});
e("focusout-prevented", f), f.defaultPrevented || Pn(n, !0);
}
}, 0);
} else {
const y = g.target;
y && d.contains(y) || e("focusout", g);
}
};
async function p() {
await _t();
const g = H(t);
if (g) {
Ym.push(a);
const d = g.contains(document.activeElement) ? r : document.activeElement;
if (r = d, !g.contains(d)) {
const y = new Event(Ku, Wm);
g.addEventListener(Ku, c), g.dispatchEvent(y), y.defaultPrevented || _t(() => {
let f = i.focusStartEl;
Ii(f) || (Pn(f), document.activeElement !== f && (f = "first")), f === "first" && J2(hy(g), !0), (document.activeElement === d || f === "container") && Pn(g);
});
}
}
}
function m() {
const g = H(t);
if (g) {
g.removeEventListener(Ku, c);
const d = new CustomEvent(Qu, {
...Wm,
detail: {
focusReason: o.value
}
});
g.addEventListener(Qu, l), g.dispatchEvent(d), !d.defaultPrevented && (o.value == "keyboard" || !K2() || g.contains(document.activeElement)) && Pn(r ?? document.body), g.removeEventListener(Qu, l), Ym.remove(a);
}
}
return ni(() => {
i.trapped && p(), Je(() => i.trapped, (g) => {
g ? p() : m();
});
}), sr(() => {
i.trapped && m(), t.value && (t.value.removeEventListener("keydown", s), t.value.removeEventListener("focusin", h), t.value.removeEventListener("focusout", u), t.value = void 0);
}), {
onKeydown: s
};
}
});
function tC(i, e, t, r, n, o) {
return qe(i.$slots, "default", { handleKeydown: i.onKeydown });
}
var iC = /* @__PURE__ */ at(eC, [["render", tC], ["__file", "focus-trap.vue"]]);
const rC = ["fixed", "absolute"], nC = ht({
boundariesPadding: {
type: Number,
default: 0
},
fallbackPlacements: {
type: Xe(Array),
default: void 0
},
gpuAcceleration: {
type: Boolean,
default: !0
},
offset: {
type: Number,
default: 12
},
placement: {
type: String,
values: rs,
default: "bottom"
},
popperOptions: {
type: Xe(Object),
default: () => ({})
},
strategy: {
type: String,
values: rC,
default: "absolute"
}
}), dy = ht({
...nC,
id: String,
style: {
type: Xe([String, Array, Object])
},
className: {
type: Xe([String, Array, Object])
},
effect: {
type: Xe(String),
default: "dark"
},
visible: Boolean,
enterable: {
type: Boolean,
default: !0
},
pure: Boolean,
focusOnShow: {
type: Boolean,
default: !1
},
trapping: {
type: Boolean,
default: !1
},
popperClass: {
type: Xe([String, Array, Object])
},
popperStyle: {
type: Xe([String, Array, Object])
},
referenceEl: {
type: Xe(Object)
},
triggerTargetEl: {
type: Xe(Object)
},
stopPopperMouseEvent: {
type: Boolean,
default: !0
},
virtualTriggering: Boolean,
zIndex: Number,
...jo(["ariaLabel"])
}), oC = {
mouseenter: (i) => i instanceof MouseEvent,
mouseleave: (i) => i instanceof MouseEvent,
focus: () => !0,
blur: () => !0,
close: () => !0
}, aC = (i, e = []) => {
const { placement: t, strategy: r, popperOptions: n } = i, o = {
placement: t,
strategy: r,
...n,
modifiers: [...lC(i), ...e]
};
return cC(o, n == null ? void 0 : n.modifiers), o;
}, sC = (i) => {
if (ii)
return rn(i);
};
function lC(i) {
const { offset: e, gpuAcceleration: t, fallbackPlacements: r } = i;
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: r
}
},
{
name: "computeStyles",
options: {
gpuAcceleration: t
}
}
];
}
function cC(i, e) {
e && (i.modifiers = [...i.modifiers, ...e ?? []]);
}
const uC = 0, hC = (i) => {
const { popperInstanceRef: e, contentRef: t, triggerRef: r, role: n } = ct(Op, void 0), o = Ae(), a = Ae(), s = ce(() => ({
name: "eventListeners",
enabled: !!i.visible
})), c = ce(() => {
var f;
const v = H(o), _ = (f = H(a)) != null ? f : uC;
return {
name: "arrow",
enabled: !$T(v),
options: {
element: v,
padding: _
}
};
}), l = ce(() => ({
onFirstUpdate: () => {
g();
},
...aC(i, [
H(c),
H(s)
])
})), h = ce(() => sC(i.referenceEl) || H(r)), { attributes: u, state: p, styles: m, update: g, forceUpdate: d, instanceRef: y } = kA(h, t, l);
return Je(y, (f) => e.value = f), ni(() => {
Je(() => {
var f;
return (f = H(h)) == null ? void 0 : f.getBoundingClientRect();
}, () => {
g();
});
}), {
attributes: u,
arrowRef: o,
contentRef: t,
instanceRef: y,
state: p,
styles: m,
role: n,
forceUpdate: d,
update: g
};
}, dC = (i, {
attributes: e,
styles: t,
role: r
}) => {
const { nextZIndex: n } = ey(), o = it("popper"), a = ce(() => H(e).popper), s = Ae(Mt(i.zIndex) ? i.zIndex : n()), c = ce(() => [
o.b(),
o.is("pure", i.pure),
o.is(i.effect),
i.popperClass
]), l = ce(() => [
{ zIndex: H(s) },
H(t).popper,
i.popperStyle || {}
]), h = ce(() => r.value === "dialog" ? "false" : void 0), u = ce(() => H(t).arrow || {});
return {
ariaModal: h,
arrowStyle: u,
contentAttrs: a,
contentClass: c,
contentStyle: l,
contentZIndex: s,
updateZIndex: () => {
s.value = Mt(i.zIndex) ? i.zIndex : n();
}
};
}, pC = (i, e) => {
const t = Ae(!1), r = Ae();
return {
focusStartRef: r,
trapped: t,
onFocusAfterReleased: (n) => {
var o;
((o = n.detail) == null ? void 0 : o.focusReason) !== "pointer" && (r.value = "first", e("blur"));
},
onFocusAfterTrapped: () => {
e("focus");
},
onFocusInTrap: (n) => {
i.visible && !t.value && (n.target && (r.value = n.target), t.value = !0);
},
onFocusoutPrevented: (n) => {
i.trapping || (n.detail.focusReason === "pointer" && n.preventDefault(), t.value = !1);
},
onReleaseRequested: () => {
t.value = !1, e("close");
}
};
}, fC = Ie({
name: "ElPopperContent"
}), mC = /* @__PURE__ */ Ie({
...fC,
props: dy,
emits: oC,
setup(i, { expose: e, emit: t }) {
const r = i, {
focusStartRef: n,
trapped: o,
onFocusAfterReleased: a,
onFocusAfterTrapped: s,
onFocusInTrap: c,
onFocusoutPrevented: l,
onReleaseRequested: h
} = pC(r, t), { attributes: u, arrowRef: p, contentRef: m, styles: g, instanceRef: d, role: y, update: f } = hC(r), {
ariaModal: v,
arrowStyle: _,
contentAttrs: M,
contentClass: T,
contentStyle: w,
updateZIndex: b
} = dC(r, {
styles: g,
attributes: u,
role: y
}), E = ct(Jc, void 0), S = Ae();
pi(ay, {
arrowStyle: _,
arrowRef: p,
arrowOffset: S
}), E && pi(Jc, {
...E,
addInputId: $s,
removeInputId: $s
});
let C;
const R = (A = !0) => {
f(), A && b();
}, L = () => {
R(!1), r.visible && r.focusOnShow ? o.value = !0 : r.visible === !1 && (o.value = !1);
};
return ni(() => {
Je(() => r.triggerTargetEl, (A, P) => {
C == null || C(), C = void 0;
const O = H(A || m.value), x = H(P || m.value);
Mo(O) && (C = Je([y, () => r.ariaLabel, v, () => r.id], (I) => {
["role", "aria-label", "aria-modal", "id"].forEach((N, D) => {
on(I[D]) ? O.removeAttribute(N) : O.setAttribute(N, I[D]);
});
}, { immediate: !0 })), x !== O && Mo(x) && ["role", "aria-label", "aria-modal", "id"].forEach((I) => {
x.removeAttribute(I);
});
}, { immediate: !0 }), Je(() => r.visible, L, { immediate: !0 });
}), sr(() => {
C == null || C(), C = void 0;
}), e({
popperContentRef: m,
popperInstanceRef: d,
updatePopper: R,
contentStyle: w
}), (A, P) => (fe(), Ce("div", Pr({
ref_key: "contentRef",
ref: m
}, H(M), {
style: H(w),
class: H(T),
tabindex: "-1",
onMouseenter: (O) => A.$emit("mouseenter", O),
onMouseleave: (O) => A.$emit("mouseleave", O)
}), [
se(H(iC), {
trapped: H(o),
"trap-on-focus-in": !0,
"focus-trap-el": H(m),
"focus-start-el": H(n),
onFocusAfterTrapped: H(s),
onFocusAfterReleased: H(a),
onFocusin: H(c),
onFocusoutPrevented: H(l),
onReleaseRequested: H(h)
}, {
default: pe(() => [
qe(A.$slots, "default")
]),
_: 3
}, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested"])
], 16, ["onMouseenter", "onMouseleave"]));
}
});
var gC = /* @__PURE__ */ at(mC, [["__file", "content.vue"]]);
const vC = fi(B2), Dp = Symbol("elTooltip"), qi = ht({
...jA,
...dy,
appendTo: {
type: Xe([String, Object])
},
content: {
type: String,
default: ""
},
rawContent: Boolean,
persistent: Boolean,
visible: {
type: Xe(Boolean),
default: null
},
transition: String,
teleported: {
type: Boolean,
default: !0
},
disabled: Boolean,
...jo(["ariaLabel"])
}), Js = ht({
...uy,
disabled: Boolean,
trigger: {
type: Xe([String, Array]),
default: "hover"
},
triggerKeys: {
type: Xe(Array),
default: () => [Ir.enter, Ir.space]
}
}), {
useModelToggleProps: yC,
useModelToggleEmits: bC,
useModelToggle: xC
} = DE("visible"), wC = ht({
...sy,
...yC,
...qi,
...Js,
...ly,
showArrow: {
type: Boolean,
default: !0
}
}), _C = [
...bC,
"before-show",
"before-hide",
"show",
"hide",
"open",
"close"
], MC = (i, e) => zi(i) ? i.includes(e) : i === e, Jo = (i, e, t) => (r) => {
MC(H(i), e) && t(r);
}, SC = Ie({
name: "ElTooltipTrigger"
}), TC = /* @__PURE__ */ Ie({
...SC,
props: Js,
setup(i, { expose: e }) {
const t = i, r = it("tooltip"), { controlled: n, id: o, open: a, onOpen: s, onClose: c, onToggle: l } = ct(Dp, void 0), h = Ae(null), u = () => {
if (H(n) || t.disabled)
return !0;
}, p = ki(t, "trigger"), m = Kr(u, Jo(p, "hover", s)), g = Kr(u, Jo(p, "hover", c)), d = Kr(u, Jo(p, "click", (M) => {
M.button === 0 && l(M);
})), y = Kr(u, Jo(p, "focus", s)), f = Kr(u, Jo(p, "focus", c)), v = Kr(u, Jo(p, "contextmenu", (M) => {
M.preventDefault(), l(M);
})), _ = Kr(u, (M) => {
const { code: T } = M;
t.triggerKeys.includes(T) && (M.preventDefault(), l(M));
});
return e({
triggerRef: h
}), (M, T) => (fe(), He(H(j2), {
id: H(o),
"virtual-ref": M.virtualRef,
open: H(a),
"virtual-triggering": M.virtualTriggering,
class: Le(H(r).e("trigger")),
onBlur: H(f),
onClick: H(d),
onContextmenu: H(v),
onFocus: H(y),
onMouseenter: H(m),
onMouseleave: H(g),
onKeydown: H(_)
}, {
default: pe(() => [
qe(M.$slots, "default")
]),
_: 3
}, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"]));
}
});
var EC = /* @__PURE__ */ at(TC, [["__file", "trigger.vue"]]);
const AC = ht({
to: {
type: Xe([String, Object]),
required: !0
},
disabled: Boolean
}), CC = /* @__PURE__ */ Ie({
__name: "teleport",
props: AC,
setup(i) {
return (e, t) => e.disabled ? qe(e.$slots, "default", { key: 0 }) : (fe(), He(gw, {
key: 1,
to: e.to
}, [
qe(e.$slots, "default")
], 8, ["to"]));
}
});
var LC = /* @__PURE__ */ at(CC, [["__file", "teleport.vue"]]);
const RC = fi(LC), OC = Ie({
name: "ElTooltipContent",
inheritAttrs: !1
}), PC = /* @__PURE__ */ Ie({
...OC,
props: qi,
setup(i, { expose: e }) {
const t = i, { selector: r } = Y0(), n = it("tooltip"), o = Ae(null);
let a;
const {
controlled: s,
id: c,
open: l,
trigger: h,
onClose: u,
onOpen: p,
onShow: m,
onHide: g,
onBeforeShow: d,
onBeforeHide: y
} = ct(Dp, void 0), f = ce(() => t.transition || `${n.namespace.value}-fade-in-linear`), v = ce(() => process.env.NODE_ENV === "test" ? !0 : t.persistent);
sr(() => {
a == null || a();
});
const _ = ce(() => H(v) ? !0 : H(l)), M = ce(() => t.disabled ? !1 : H(l)), T = ce(() => t.appendTo || r.value), w = ce(() => {
var x;
return (x = t.style) != null ? x : {};
}), b = Ae(!0), E = () => {
g(), b.value = !0;
}, S = () => {
if (H(s))
return !0;
}, C = Kr(S, () => {
t.enterable && H(h) === "hover" && p();
}), R = Kr(S, () => {
H(h) === "hover" && u();
}), L = () => {
var x, I;
(I = (x = o.value) == null ? void 0 : x.updatePopper) == null || I.call(x), d == null || d();
}, A = () => {
y == null || y();
}, P = () => {
m(), a = Bw(ce(() => {
var x;
return (x = o.value) == null ? void 0 : x.popperContentRef;
}), () => {
H(s) || H(h) !== "hover" && u();
});
}, O = () => {
t.virtualTriggering || u();
};
return Je(() => H(l), (x) => {
x ? b.value = !1 : a == null || a();
}, {
flush: "post"
}), Je(() => t.content, () => {
var x, I;
(I = (x = o.value) == null ? void 0 : x.updatePopper) == null || I.call(x);
}), e({
contentRef: o
}), (x, I) => (fe(), He(H(RC), {
disabled: !x.teleported,
to: H(T)
}, {
default: pe(() => [
se(hl, {
name: H(f),
onAfterLeave: E,
onBeforeEnter: L,
onAfterEnter: P,
onBeforeLeave: A
}, {
default: pe(() => [
H(_) ? Bt((fe(), He(H(gC), Pr({
key: 0,
id: H(c),
ref_key: "contentRef",
ref: o
}, x.$attrs, {
"aria-label": x.ariaLabel,
"aria-hidden": b.value,
"boundaries-padding": x.boundariesPadding,
"fallback-placements": x.fallbackPlacements,
"gpu-acceleration": x.gpuAcceleration,
offset: x.offset,
placement: x.placement,
"popper-options": x.popperOptions,
strategy: x.strategy,
effect: x.effect,
enterable: x.enterable,
pure: x.pure,
"popper-class": x.popperClass,
"popper-style": [x.popperStyle, H(w)],
"reference-el": x.referenceEl,
"trigger-target-el": x.triggerTargetEl,
visible: H(M),
"z-index": x.zIndex,
onMouseenter: H(C),
onMouseleave: H(R),
onBlur: O,
onClose: H(u)
}), {
default: pe(() => [
qe(x.$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"])), [
[yi, H(M)]
]) : Ve("v-if", !0)
]),
_: 3
}, 8, ["name"])
]),
_: 3
}, 8, ["disabled", "to"]));
}
});
var IC = /* @__PURE__ */ at(PC, [["__file", "content.vue"]]);
const DC = Ie({
name: "ElTooltip"
}), NC = /* @__PURE__ */ Ie({
...DC,
props: wC,
emits: _C,
setup(i, { expose: e, emit: t }) {
const r = i;
HA();
const n = vu(), o = Ae(), a = Ae(), s = () => {
var f;
const v = H(o);
v && ((f = v.popperInstanceRef) == null || f.update());
}, c = Ae(!1), l = Ae(), { show: h, hide: u, hasUpdateHandler: p } = xC({
indicator: c,
toggleReason: l
}), { onOpen: m, onClose: g } = GA({
showAfter: ki(r, "showAfter"),
hideAfter: ki(r, "hideAfter"),
autoClose: ki(r, "autoClose"),
open: h,
close: u
}), d = ce(() => fp(r.visible) && !p.value);
pi(Dp, {
controlled: d,
id: n,
open: a0(c),
trigger: ki(r, "trigger"),
onOpen: (f) => {
m(f);
},
onClose: (f) => {
g(f);
},
onToggle: (f) => {
H(c) ? g(f) : m(f);
},
onShow: () => {
t("show", l.value);
},
onHide: () => {
t("hide", l.value);
},
onBeforeShow: () => {
t("before-show", l.value);
},
onBeforeHide: () => {
t("before-hide", l.value);
},
updatePopper: s
}), Je(() => r.disabled, (f) => {
f && c.value && (c.value = !1);
});
const y = (f) => {
var v, _;
const M = (_ = (v = a.value) == null ? void 0 : v.contentRef) == null ? void 0 : _.popperContentRef, T = (f == null ? void 0 : f.relatedTarget) || document.activeElement;
return M && M.contains(T);
};
return hw(() => c.value && u()), e({
popperRef: o,
contentRef: a,
isFocusInsideContent: y,
updatePopper: s,
onOpen: m,
onClose: g,
hide: u
}), (f, v) => (fe(), He(H(vC), {
ref_key: "popperRef",
ref: o,
role: f.role
}, {
default: pe(() => [
se(EC, {
disabled: f.disabled,
trigger: f.trigger,
"trigger-keys": f.triggerKeys,
"virtual-ref": f.virtualRef,
"virtual-triggering": f.virtualTriggering
}, {
default: pe(() => [
f.$slots.default ? qe(f.$slots, "default", { key: 0 }) : Ve("v-if", !0)
]),
_: 3
}, 8, ["disabled", "trigger", "trigger-keys", "virtual-ref", "virtual-triggering"]),
se(IC, {
ref_key: "contentRef",
ref: a,
"aria-label": f.ariaLabel,
"boundaries-padding": f.boundariesPadding,
content: f.content,
disabled: f.disabled,
effect: f.effect,
enterable: f.enterable,
"fallback-placements": f.fallbackPlacements,
"hide-after": f.hideAfter,
"gpu-acceleration": f.gpuAcceleration,
offset: f.offset,
persistent: f.persistent,
"popper-class": f.popperClass,
"popper-style": f.popperStyle,
placement: f.placement,
"popper-options": f.popperOptions,
pure: f.pure,
"raw-content": f.rawContent,
"reference-el": f.referenceEl,
"trigger-target-el": f.triggerTargetEl,
"show-after": f.showAfter,
strategy: f.strategy,
teleported: f.teleported,
transition: f.transition,
"virtual-triggering": f.virtualTriggering,
"z-index": f.zIndex,
"append-to": f.appendTo
}, {
default: pe(() => [
qe(f.$slots, "content", {}, () => [
f.rawContent ? (fe(), Ce("span", {
key: 0,
innerHTML: f.content
}, null, 8, ["innerHTML"])) : (fe(), Ce("span", { key: 1 }, wt(f.content), 1))
]),
f.showArrow ? (fe(), He(H(z2), {
key: 0,
"arrow-offset": f.arrowOffset
}, null, 8, ["arrow-offset"])) : Ve("v-if", !0)
]),
_: 3
}, 8, ["aria-label", "boundaries-padding", "content", "disabled", "effect", "enterable", "fallback-placements", "hide-after", "gpu-acceleration", "offset", "persistent", "popper-class", "popper-style", "placement", "popper-options", "pure", "raw-content", "reference-el", "trigger-target-el", "show-after", "strategy", "teleported", "transition", "virtual-triggering", "z-index", "append-to"])
]),
_: 3
}, 8, ["role"]));
}
});
var BC = /* @__PURE__ */ at(NC, [["__file", "tooltip.vue"]]);
const Np = fi(BC), py = Symbol("buttonGroupContextKey"), kC = (i, e) => {
EE({
from: "type.text",
replacement: "link",
version: "3.0.0",
scope: "props",
ref: "https://element-plus.org/en-US/component/button.html#button-attributes"
}, ce(() => i.type === "text"));
const t = ct(py, void 0), r = Ap("button"), { form: n } = gl(), o = ns(ce(() => t == null ? void 0 : t.size)), a = yu(), s = Ae(), c = au(), l = ce(() => i.type || (t == null ? void 0 : t.type) || ""), h = ce(() => {
var m, g, d;
return (d = (g = i.autoInsertSpace) != null ? g : (m = r.value) == null ? void 0 : m.autoInsertSpace) != null ? d : !1;
}), u = ce(() => i.tag === "button" ? {
ariaDisabled: a.value || i.loading,
disabled: a.value || i.loading,
autofocus: i.autofocus,
type: i.nativeType
} : {}), p = ce(() => {
var m;
const g = (m = c.default) == null ? void 0 : m.call(c);
if (h.value && (g == null ? void 0 : g.length) === 1) {
const d = g[0];
if ((d == null ? void 0 : d.type) === o0) {
const y = d.children;
return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(y.trim());
}
}
return !1;
});
return {
_disabled: a,
_size: o,
_type: l,
_ref: s,
_props: u,
shouldAddSpace: p,
handleClick: (m) => {
if (a.value || i.loading) {
m.stopPropagation();
return;
}
i.nativeType === "reset" && (n == null || n.resetFields()), e("click", m);
}
};
}, FC = [
"default",
"primary",
"success",
"warning",
"info",
"danger",
"text",
""
], zC = ["button", "submit", "reset"], dd = ht({
size: Da,
disabled: Boolean,
type: {
type: String,
values: FC,
default: ""
},
icon: {
type: qn
},
nativeType: {
type: String,
values: zC,
default: "button"
},
loading: Boolean,
loadingIcon: {
type: qn,
default: () => O0
},
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: Xe([String, Object]),
default: "button"
}
}), UC = {
click: (i) => i instanceof MouseEvent
};
function xi(i, e) {
VC(i) && (i = "100%");
var t = HC(i);
return i = e === 360 ? i : Math.min(e, Math.max(0, parseFloat(i))), t && (i = parseInt(String(i * e), 10) / 100), Math.abs(i - e) < 1e-6 ? 1 : (e === 360 ? i = (i < 0 ? i % e + e : i % e) / parseFloat(String(e)) : i = i % e / parseFloat(String(e)), i);
}
function Ul(i) {
return Math.min(1, Math.max(0, i));
}
function VC(i) {
return typeof i == "string" && i.indexOf(".") !== -1 && parseFloat(i) === 1;
}
function HC(i) {
return typeof i == "string" && i.indexOf("%") !== -1;
}
function fy(i) {
return i = parseFloat(i), (isNaN(i) || i < 0 || i > 1) && (i = 1), i;
}
function Vl(i) {
return i <= 1 ? "".concat(Number(i) * 100, "%") : i;
}
function xo(i) {
return i.length === 1 ? "0" + i : String(i);
}
function jC(i, e, t) {
return {
r: xi(i, 255) * 255,
g: xi(e, 255) * 255,
b: xi(t, 255) * 255
};
}
function Km(i, e, t) {
i = xi(i, 255), e = xi(e, 255), t = xi(t, 255);
var r = Math.max(i, e, t), n = Math.min(i, e, t), o = 0, a = 0, s = (r + n) / 2;
if (r === n)
a = 0, o = 0;
else {
var c = r - n;
switch (a = s > 0.5 ? c / (2 - r - n) : c / (r + n), r) {
case i:
o = (e - t) / c + (e < t ? 6 : 0);
break;
case e:
o = (t - i) / c + 2;
break;
case t:
o = (i - e) / c + 4;
break;
}
o /= 6;
}
return { h: o, s: a, l: s };
}
function eh(i, e, t) {
return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? i + (e - i) * (6 * t) : t < 1 / 2 ? e : t < 2 / 3 ? i + (e - i) * (2 / 3 - t) * 6 : i;
}
function GC(i, e, t) {
var r, n, o;
if (i = xi(i, 360), e = xi(e, 100), t = xi(t, 100), e === 0)
n = t, o = t, r = t;
else {
var a = t < 0.5 ? t * (1 + e) : t + e - t * e, s = 2 * t - a;
r = eh(s, a, i + 1 / 3), n = eh(s, a, i), o = eh(s, a, i - 1 / 3);
}
return { r: r * 255, g: n * 255, b: o * 255 };
}
function Qm(i, e, t) {
i = xi(i, 255), e = xi(e, 255), t = xi(t, 255);
var r = Math.max(i, e, t), n = Math.min(i, e, t), o = 0, a = r, s = r - n, c = r === 0 ? 0 : s / r;
if (r === n)
o = 0;
else {
switch (r) {
case i:
o = (e - t) / s + (e < t ? 6 : 0);
break;
case e:
o = (t - i) / s + 2;
break;
case t:
o = (i - e) / s + 4;
break;
}
o /= 6;
}
return { h: o, s: c, v: a };
}
function WC(i, e, t) {
i = xi(i, 360) * 6, e = xi(e, 100), t = xi(t, 100);
var r = Math.floor(i), n = i - r, o = t * (1 - e), a = t * (1 - n * e), s = t * (1 - (1 - n) * e), c = r % 6, l = [t, a, o, o, s, t][c], h = [s, t, t, a, o, o][c], u = [o, o, s, t, t, a][c];
return { r: l * 255, g: h * 255, b: u * 255 };
}
function eg(i, e, t, r) {
var n = [
xo(Math.round(i).toString(16)),
xo(Math.round(e).toString(16)),
xo(Math.round(t).toString(16))
];
return r && n[0].startsWith(n[0].charAt(1)) && n[1].startsWith(n[1].charAt(1)) && n[2].startsWith(n[2].charAt(1)) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) : n.join("");
}
function $C(i, e, t, r, n) {
var o = [
xo(Math.round(i).toString(16)),
xo(Math.round(e).toString(16)),
xo(Math.round(t).toString(16)),
xo(qC(r))
];
return n && o[0].startsWith(o[0].charAt(1)) && o[1].startsWith(o[1].charAt(1)) && o[2].startsWith(o[2].charAt(1)) && o[3].startsWith(o[3].charAt(1)) ? o[0].charAt(0) + o[1].charAt(0) + o[2].charAt(0) + o[3].charAt(0) : o.join("");
}
function qC(i) {
return Math.round(parseFloat(i) * 255).toString(16);
}
function tg(i) {
return $i(i) / 255;
}
function $i(i) {
return parseInt(i, 16);
}
function XC(i) {
return {
r: i >> 16,
g: (i & 65280) >> 8,
b: i & 255
};
}
var pd = {
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 ZC(i) {
var e = { r: 0, g: 0, b: 0 }, t = 1, r = null, n = null, o = null, a = !1, s = !1;
return typeof i == "string" && (i = KC(i)), typeof i == "object" && (Gr(i.r) && Gr(i.g) && Gr(i.b) ? (e = jC(i.r, i.g, i.b), a = !0, s = String(i.r).substr(-1) === "%" ? "prgb" : "rgb") : Gr(i.h) && Gr(i.s) && Gr(i.v) ? (r = Vl(i.s), n = Vl(i.v), e = WC(i.h, r, n), a = !0, s = "hsv") : Gr(i.h) && Gr(i.s) && Gr(i.l) && (r = Vl(i.s), o = Vl(i.l), e = GC(i.h, r, o), a = !0, s = "hsl"), Object.prototype.hasOwnProperty.call(i, "a") && (t = i.a)), t = fy(t), {
ok: a,
format: i.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: t
};
}
var YC = "[-\\+]?\\d+%?", JC = "[-\\+]?\\d*\\.\\d+%?", Fn = "(?:".concat(JC, ")|(?:").concat(YC, ")"), th = "[\\s|\\(]+(".concat(Fn, ")[,|\\s]+(").concat(Fn, ")[,|\\s]+(").concat(Fn, ")\\s*\\)?"), ih = "[\\s|\\(]+(".concat(Fn, ")[,|\\s]+(").concat(Fn, ")[,|\\s]+(").concat(Fn, ")[,|\\s]+(").concat(Fn, ")\\s*\\)?"), fr = {
CSS_UNIT: new RegExp(Fn),
rgb: new RegExp("rgb" + th),
rgba: new RegExp("rgba" + ih),
hsl: new RegExp("hsl" + th),
hsla: new RegExp("hsla" + ih),
hsv: new RegExp("hsv" + th),
hsva: new RegExp("hsva" + ih),
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 KC(i) {
if (i = i.trim().toLowerCase(), i.length === 0)
return !1;
var e = !1;
if (pd[i])
i = pd[i], e = !0;
else if (i === "transparent")
return { r: 0, g: 0, b: 0, a: 0, format: "name" };
var t = fr.rgb.exec(i);
return t ? { r: t[1], g: t[2], b: t[3] } : (t = fr.rgba.exec(i), t ? { r: t[1], g: t[2], b: t[3], a: t[4] } : (t = fr.hsl.exec(i), t ? { h: t[1], s: t[2], l: t[3] } : (t = fr.hsla.exec(i), t ? { h: t[1], s: t[2], l: t[3], a: t[4] } : (t = fr.hsv.exec(i), t ? { h: t[1], s: t[2], v: t[3] } : (t = fr.hsva.exec(i), t ? { h: t[1], s: t[2], v: t[3], a: t[4] } : (t = fr.hex8.exec(i), t ? {
r: $i(t[1]),
g: $i(t[2]),
b: $i(t[3]),
a: tg(t[4]),
format: e ? "name" : "hex8"
} : (t = fr.hex6.exec(i), t ? {
r: $i(t[1]),
g: $i(t[2]),
b: $i(t[3]),
format: e ? "name" : "hex"
} : (t = fr.hex4.exec(i), t ? {
r: $i(t[1] + t[1]),
g: $i(t[2] + t[2]),
b: $i(t[3] + t[3]),
a: tg(t[4] + t[4]),
format: e ? "name" : "hex8"
} : (t = fr.hex3.exec(i), t ? {
r: $i(t[1] + t[1]),
g: $i(t[2] + t[2]),
b: $i(t[3] + t[3]),
format: e ? "name" : "hex"
} : !1)))))))));
}
function Gr(i) {
return !!fr.CSS_UNIT.exec(String(i));
}
var QC = (
/** @class */
function() {
function i(e, t) {
e === void 0 && (e = ""), t === void 0 && (t = {});
var r;
if (e instanceof i)
return e;
typeof e == "number" && (e = XC(e)), this.originalInput = e;
var n = ZC(e);
this.originalInput = e, this.r = n.r, this.g = n.g, this.b = n.b, this.a = n.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (r = t.format) !== null && r !== void 0 ? r : n.format, this.gradientType = t.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = n.ok;
}
return i.prototype.isDark = function() {
return this.getBrightness() < 128;
}, i.prototype.isLight = function() {
return !this.isDark();
}, i.prototype.getBrightness = function() {
var e = this.toRgb();
return (e.r * 299 + e.g * 587 + e.b * 114) / 1e3;
}, i.prototype.getLuminance = function() {
var e = this.toRgb(), t, r, n, o = e.r / 255, a = e.g / 255, s = e.b / 255;
return o <= 0.03928 ? t = o / 12.92 : t = 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), s <= 0.03928 ? n = s / 12.92 : n = Math.pow((s + 0.055) / 1.055, 2.4), 0.2126 * t + 0.7152 * r + 0.0722 * n;
}, i.prototype.getAlpha = function() {
return this.a;
}, i.prototype.setAlpha = function(e) {
return this.a = fy(e), this.roundA = Math.round(100 * this.a) / 100, this;
}, i.prototype.isMonochrome = function() {
var e = this.toHsl().s;
return e === 0;
}, i.prototype.toHsv = function() {
var e = Qm(this.r, this.g, this.b);
return { h: e.h * 360, s: e.s, v: e.v, a: this.a };
}, i.prototype.toHsvString = function() {
var e = Qm(this.r, this.g, this.b), t = Math.round(e.h * 360), r = Math.round(e.s * 100), n = Math.round(e.v * 100);
return this.a === 1 ? "hsv(".concat(t, ", ").concat(r, "%, ").concat(n, "%)") : "hsva(".concat(t, ", ").concat(r, "%, ").concat(n, "%, ").concat(this.roundA, ")");
}, i.prototype.toHsl = function() {
var e = Km(this.r, this.g, this.b);
return { h: e.h * 360, s: e.s, l: e.l, a: this.a };
}, i.prototype.toHslString = function() {
var e = Km(this.r, this.g, this.b), t = Math.round(e.h * 360), r = Math.round(e.s * 100), n = Math.round(e.l * 100);
return this.a === 1 ? "hsl(".concat(t, ", ").concat(r, "%, ").concat(n, "%)") : "hsla(".concat(t, ", ").concat(r, "%, ").concat(n, "%, ").concat(this.roundA, ")");
}, i.prototype.toHex = function(e) {
return e === void 0 && (e = !1), eg(this.r, this.g, this.b, e);
}, i.prototype.toHexString = function(e) {
return e === void 0 && (e = !1), "#" + this.toHex(e);
}, i.prototype.toHex8 = function(e) {
return e === void 0 && (e = !1), $C(this.r, this.g, this.b, this.a, e);
}, i.prototype.toHex8String = function(e) {
return e === void 0 && (e = !1), "#" + this.toHex8(e);
}, i.prototype.toHexShortString = function(e) {
return e === void 0 && (e = !1), this.a === 1 ? this.toHexString(e) : this.toHex8String(e);
}, i.prototype.toRgb = function() {
return {
r: Math.round(this.r),
g: Math.round(this.g),
b: Math.round(this.b),
a: this.a
};
}, i.prototype.toRgbString = function() {
var e = Math.round(this.r), t = Math.round(this.g), r = Math.round(this.b);
return this.a === 1 ? "rgb(".concat(e, ", ").concat(t, ", ").concat(r, ")") : "rgba(".concat(e, ", ").concat(t, ", ").concat(r, ", ").concat(this.roundA, ")");
}, i.prototype.toPercentageRgb = function() {
var e = function(t) {
return "".concat(Math.round(xi(t, 255) * 100), "%");
};
return {
r: e(this.r),
g: e(this.g),
b: e(this.b),
a: this.a
};
}, i.prototype.toPercentageRgbString = function() {
var e = function(t) {
return Math.round(xi(t, 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, ")");
}, i.prototype.toName = function() {
if (this.a === 0)
return "transparent";
if (this.a < 1)
return !1;
for (var e = "#" + eg(this.r, this.g, this.b, !1), t = 0, r = Object.entries(pd); t < r.length; t++) {
var n = r[t], o = n[0], a = n[1];
if (e === a)
return o;
}
return !1;
}, i.prototype.toString = function(e) {
var t = !!e;
e = e ?? this.format;
var r = !1, n = this.a < 1 && this.a >= 0, o = !t && n && (e.startsWith("hex") || e === "name");
return o ? e === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (r = this.toRgbString()), e === "prgb" && (r = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (r = this.toHexString()), e === "hex3" && (r = this.toHexString(!0)), e === "hex4" && (r = this.toHex8String(!0)), e === "hex8" && (r = this.toHex8String()), e === "name" && (r = this.toName()), e === "hsl" && (r = this.toHslString()), e === "hsv" && (r = this.toHsvString()), r || this.toHexString());
}, i.prototype.toNumber = function() {
return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
}, i.prototype.clone = function() {
return new i(this.toString());
}, i.prototype.lighten = function(e) {
e === void 0 && (e = 10);
var t = this.toHsl();
return t.l += e / 100, t.l = Ul(t.l), new i(t);
}, i.prototype.brighten = function(e) {
e === void 0 && (e = 10);
var t = this.toRgb();
return t.r = Math.max(0, Math.min(255, t.r - Math.round(255 * -(e / 100)))), t.g = Math.max(0, Math.min(255, t.g - Math.round(255 * -(e / 100)))), t.b = Math.max(0, Math.min(255, t.b - Math.round(255 * -(e / 100)))), new i(t);
}, i.prototype.darken = function(e) {
e === void 0 && (e = 10);
var t = this.toHsl();
return t.l -= e / 100, t.l = Ul(t.l), new i(t);
}, i.prototype.tint = function(e) {
return e === void 0 && (e = 10), this.mix("white", e);
}, i.prototype.shade = function(e) {
return e === void 0 && (e = 10), this.mix("black", e);
}, i.prototype.desaturate = function(e) {
e === void 0 && (e = 10);
var t = this.toHsl();
return t.s -= e / 100, t.s = Ul(t.s), new i(t);
}, i.prototype.saturate = function(e) {
e === void 0 && (e = 10);
var t = this.toHsl();
return t.s += e / 100, t.s = Ul(t.s), new i(t);
}, i.prototype.greyscale = function() {
return this.desaturate(100);
}, i.prototype.spin = function(e) {
var t = this.toHsl(), r = (t.h + e) % 360;
return t.h = r < 0 ? 360 + r : r, new i(t);
}, i.prototype.mix = function(e, t) {
t === void 0 && (t = 50);
var r = this.toRgb(), n = new i(e).toRgb(), o = t / 100, a = {
r: (n.r - r.r) * o + r.r,
g: (n.g - r.g) * o + r.g,
b: (n.b - r.b) * o + r.b,
a: (n.a - r.a) * o + r.a
};
return new i(a);
}, i.prototype.analogous = function(e, t) {
e === void 0 && (e = 6), t === void 0 && (t = 30);
var r = this.toHsl(), n = 360 / t, o = [this];
for (r.h = (r.h - (n * e >> 1) + 720) % 360; --e; )
r.h = (r.h + n) % 360, o.push(new i(r));
return o;
}, i.prototype.complement = function() {
var e = this.toHsl();
return e.h = (e.h + 180) % 360, new i(e);
}, i.prototype.monochromatic = function(e) {
e === void 0 && (e = 6);
for (var t = this.toHsv(), r = t.h, n = t.s, o = t.v, a = [], s = 1 / e; e--; )
a.push(new i({ h: r, s: n, v: o })), o = (o + s) % 1;
return a;
}, i.prototype.splitcomplement = function() {
var e = this.toHsl(), t = e.h;
return [
this,
new i({ h: (t + 72) % 360, s: e.s, l: e.l }),
new i({ h: (t + 216) % 360, s: e.s, l: e.l })
];
}, i.prototype.onBackground = function(e) {
var t = this.toRgb(), r = new i(e).toRgb(), n = t.a + r.a * (1 - t.a);
return new i({
r: (t.r * t.a + r.r * r.a * (1 - t.a)) / n,
g: (t.g * t.a + r.g * r.a * (1 - t.a)) / n,
b: (t.b * t.a + r.b * r.a * (1 - t.a)) / n,
a: n
});
}, i.prototype.triad = function() {
return this.polyad(3);
}, i.prototype.tetrad = function() {
return this.polyad(4);
}, i.prototype.polyad = function(e) {
for (var t = this.toHsl(), r = t.h, n = [this], o = 360 / e, a = 1; a < e; a++)
n.push(new i({ h: (r + a * o) % 360, s: t.s, l: t.l }));
return n;
}, i.prototype.equals = function(e) {
return this.toRgbString() === new i(e).toRgbString();
}, i;
}()
);
function _n(i, e = 20) {
return i.mix("#141414", e).toString();
}
function eL(i) {
const e = yu(), t = it("button");
return ce(() => {
let r = {}, n = i.color;
if (n) {
const o = n.match(/var\((.*?)\)/);
o && (n = window.getComputedStyle(window.document.documentElement).getPropertyValue(o[1]));
const a = new QC(n), s = i.dark ? a.tint(20).toString() : _n(a, 20);
if (i.plain)
r = t.cssVarBlock({
"bg-color": i.dark ? _n(a, 90) : a.tint(90).toString(),
"text-color": n,
"border-color": i.dark ? _n(a, 50) : a.tint(50).toString(),
"hover-text-color": `var(${t.cssVarName("color-white")})`,
"hover-bg-color": n,
"hover-border-color": n,
"active-bg-color": s,
"active-text-color": `var(${t.cssVarName("color-white")})`,
"active-border-color": s
}), e.value && (r[t.cssVarBlockName("disabled-bg-color")] = i.dark ? _n(a, 90) : a.tint(90).toString(), r[t.cssVarBlockName("disabled-text-color")] = i.dark ? _n(a, 50) : a.tint(50).toString(), r[t.cssVarBlockName("disabled-border-color")] = i.dark ? _n(a, 80) : a.tint(80).toString());
else {
const c = i.dark ? _n(a, 30) : a.tint(30).toString(), l = a.isDark() ? `var(${t.cssVarName("color-white")})` : `var(${t.cssVarName("color-black")})`;
if (r = t.cssVarBlock({
"bg-color": n,
"text-color": l,
"border-color": n,
"hover-bg-color": c,
"hover-text-color": l,
"hover-border-color": c,
"active-bg-color": s,
"active-border-color": s
}), e.value) {
const h = i.dark ? _n(a, 50) : a.tint(50).toString();
r[t.cssVarBlockName("disabled-bg-color")] = h, r[t.cssVarBlockName("disabled-text-color")] = i.dark ? "rgba(255, 255, 255, 0.5)" : `var(${t.cssVarName("color-white")})`, r[t.cssVarBlockName("disabled-border-color")] = h;
}
}
}
return r;
});
}
const tL = Ie({
name: "ElButton"
}), iL = /* @__PURE__ */ Ie({
...tL,
props: dd,
emits: UC,
setup(i, { expose: e, emit: t }) {
const r = i, n = eL(r), o = it("button"), { _ref: a, _size: s, _type: c, _disabled: l, _props: h, shouldAddSpace: u, handleClick: p } = kC(r, t), m = ce(() => [
o.b(),
o.m(c.value),
o.m(s.value),
o.is("disabled", l.value),
o.is("loading", r.loading),
o.is("plain", r.plain),
o.is("round", r.round),
o.is("circle", r.circle),
o.is("text", r.text),
o.is("link", r.link),
o.is("has-bg", r.bg)
]);
return e({
ref: a,
size: s,
type: c,
disabled: l,
shouldAddSpace: u
}), (g, d) => (fe(), He(Fi(g.tag), Pr({
ref_key: "_ref",
ref: a
}, H(h), {
class: H(m),
style: H(n),
onClick: H(p)
}), {
default: pe(() => [
g.loading ? (fe(), Ce(Gt, { key: 0 }, [
g.$slots.loading ? qe(g.$slots, "loading", { key: 0 }) : (fe(), He(H(kt), {
key: 1,
class: Le(H(o).is("loading"))
}, {
default: pe(() => [
(fe(), He(Fi(g.loadingIcon)))
]),
_: 1
}, 8, ["class"]))
], 64)) : g.icon || g.$slots.icon ? (fe(), He(H(kt), { key: 1 }, {
default: pe(() => [
g.icon ? (fe(), He(Fi(g.icon), { key: 0 })) : qe(g.$slots, "icon", { key: 1 })
]),
_: 3
})) : Ve("v-if", !0),
g.$slots.default ? (fe(), Ce("span", {
key: 2,
class: Le({ [H(o).em("text", "expand")]: H(u) })
}, [
qe(g.$slots, "default")
], 2)) : Ve("v-if", !0)
]),
_: 3
}, 16, ["class", "style", "onClick"]));
}
});
var rL = /* @__PURE__ */ at(iL, [["__file", "button.vue"]]);
const nL = {
size: dd.size,
type: dd.type
}, oL = Ie({
name: "ElButtonGroup"
}), aL = /* @__PURE__ */ Ie({
...oL,
props: nL,
setup(i) {
const e = i;
pi(py, Yi({
size: ki(e, "size"),
type: ki(e, "type")
}));
const t = it("button");
return (r, n) => (fe(), Ce("div", {
class: Le(H(t).b("group"))
}, [
qe(r.$slots, "default")
], 2));
}
});
var my = /* @__PURE__ */ at(aL, [["__file", "button-group.vue"]]);
const os = fi(rL, {
ButtonGroup: my
});
gn(my);
var Bn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function sL(i) {
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
}
function xu(i) {
if (i.__esModule) return i;
var e = i.default;
if (typeof e == "function") {
var t = function r() {
return this instanceof r ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments);
};
t.prototype = e.prototype;
} else t = {};
return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(i).forEach(function(r) {
var n = Object.getOwnPropertyDescriptor(i, r);
Object.defineProperty(t, r, n.get ? n : {
enumerable: !0,
get: function() {
return i[r];
}
});
}), t;
}
const In = /* @__PURE__ */ new Map();
if (ii) {
let i;
document.addEventListener("mousedown", (e) => i = e), document.addEventListener("mouseup", (e) => {
if (i) {
for (const t of In.values())
for (const { documentHandler: r } of t)
r(e, i);
i = void 0;
}
});
}
function ig(i, e) {
let t = [];
return Array.isArray(e.arg) ? t = e.arg : Mo(e.arg) && t.push(e.arg), function(r, n) {
const o = e.instance.popperRef, a = r.target, s = n == null ? void 0 : n.target, c = !e || !e.instance, l = !a || !s, h = i.contains(a) || i.contains(s), u = i === a, p = t.length && t.some((g) => g == null ? void 0 : g.contains(a)) || t.length && t.includes(s), m = o && (o.contains(a) || o.contains(s));
c || l || h || u || p || m || e.value(r, n);
};
}
const lL = {
beforeMount(i, e) {
In.has(i) || In.set(i, []), In.get(i).push({
documentHandler: ig(i, e),
bindingFn: e.value
});
},
updated(i, e) {
In.has(i) || In.set(i, []);
const t = In.get(i), r = t.findIndex((o) => o.bindingFn === e.oldValue), n = {
documentHandler: ig(i, e),
bindingFn: e.value
};
r >= 0 ? t.splice(r, 1, n) : t.push(n);
},
unmounted(i) {
In.delete(i);
}
}, cL = 100, uL = 600, rg = {
beforeMount(i, e) {
const t = e.value, { interval: r = cL, delay: n = uL } = Ci(t) ? {} : t;
let o, a;
const s = () => Ci(t) ? t() : t.handler(), c = () => {
a && (clearTimeout(a), a = void 0), o && (clearInterval(o), o = void 0);
};
i.addEventListener("mousedown", (l) => {
l.button === 0 && (c(), s(), document.addEventListener("mouseup", () => c(), {
once: !0
}), a = setTimeout(() => {
o = setInterval(() => {
s();
}, r);
}, n));
});
}
}, fd = ht({
type: {
type: String,
values: ["primary", "success", "info", "warning", "danger"],
default: "primary"
},
closable: Boolean,
disableTransitions: Boolean,
hit: Boolean,
color: String,
size: {
type: String,
values: N0
},
effect: {
type: String,
values: ["dark", "light", "plain"],
default: "light"
},
round: Boolean
}), hL = {
close: (i) => i instanceof MouseEvent,
click: (i) => i instanceof MouseEvent
}, dL = Ie({
name: "ElTag"
}), pL = /* @__PURE__ */ Ie({
...dL,
props: fd,
emits: hL,
setup(i, { emit: e }) {
const t = i, r = ns(), n = it("tag"), o = ce(() => {
const { type: l, hit: h, effect: u, closable: p, round: m } = t;
return [
n.b(),
n.is("closable", p),
n.m(l || "primary"),
n.m(r.value),
n.m(u),
n.is("hit", h),
n.is("round", m)
];
}), a = (l) => {
e("close", l);
}, s = (l) => {
e("click", l);
}, c = (l) => {
l.component.subTree.component.bum = null;
};
return (l, h) => l.disableTransitions ? (fe(), Ce("span", {
key: 0,
class: Le(H(o)),
style: It({ backgroundColor: l.color }),
onClick: s
}, [
ke("span", {
class: Le(H(n).e("content"))
}, [
qe(l.$slots, "default")
], 2),
l.closable ? (fe(), He(H(kt), {
key: 0,
class: Le(H(n).e("close")),
onClick: ui(a, ["stop"])
}, {
default: pe(() => [
se(H(ld))
]),
_: 1
}, 8, ["class", "onClick"])) : Ve("v-if", !0)
], 6)) : (fe(), He(hl, {
key: 1,
name: `${H(n).namespace.value}-zoom-in-center`,
appear: "",
onVnodeMounted: c
}, {
default: pe(() => [
ke("span", {
class: Le(H(o)),
style: It({ backgroundColor: l.color }),
onClick: s
}, [
ke("span", {
class: Le(H(n).e("content"))
}, [
qe(l.$slots, "default")
], 2),
l.closable ? (fe(), He(H(kt), {
key: 0,
class: Le(H(n).e("close")),
onClick: ui(a, ["stop"])
}, {
default: pe(() => [
se(H(ld))
]),
_: 1
}, 8, ["class", "onClick"])) : Ve("v-if", !0)
], 6)
]),
_: 3
}, 8, ["name"]));
}
});
var fL = /* @__PURE__ */ at(pL, [["__file", "tag.vue"]]);
const mL = fi(fL), gy = Symbol("rowContextKey"), gL = [
"start",
"center",
"end",
"space-around",
"space-between",
"space-evenly"
], vL = ["top", "middle", "bottom"], yL = ht({
tag: {
type: String,
default: "div"
},
gutter: {
type: Number,
default: 0
},
justify: {
type: String,
values: gL,
default: "start"
},
align: {
type: String,
values: vL
}
}), bL = Ie({
name: "ElRow"
}), xL = /* @__PURE__ */ Ie({
...bL,
props: yL,
setup(i) {
const e = i, t = it("row"), r = ce(() => e.gutter);
pi(gy, {
gutter: r
});
const n = ce(() => {
const a = {};
return e.gutter && (a.marginRight = a.marginLeft = `-${e.gutter / 2}px`), a;
}), o = ce(() => [
t.b(),
t.is(`justify-${e.justify}`, e.justify !== "start"),
t.is(`align-${e.align}`, !!e.align)
]);
return (a, s) => (fe(), He(Fi(a.tag), {
class: Le(H(o)),
style: It(H(n))
}, {
default: pe(() => [
qe(a.$slots, "default")
]),
_: 3
}, 8, ["class", "style"]));
}
});
var wL = /* @__PURE__ */ at(xL, [["__file", "row.vue"]]);
const Hr = fi(wL), _L = ht({
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: Xe([Number, Object]),
default: () => en({})
},
sm: {
type: Xe([Number, Object]),
default: () => en({})
},
md: {
type: Xe([Number, Object]),
default: () => en({})
},
lg: {
type: Xe([Number, Object]),
default: () => en({})
},
xl: {
type: Xe([Number, Object]),
default: () => en({})
}
}), ML = Ie({
name: "ElCol"
}), SL = /* @__PURE__ */ Ie({
...ML,
props: _L,
setup(i) {
const e = i, { gutter: t } = ct(gy, { gutter: ce(() => 0) }), r = it("col"), n = ce(() => {
const a = {};
return t.value && (a.paddingLeft = a.paddingRight = `${t.value / 2}px`), a;
}), o = ce(() => {
const a = [];
return ["span", "offset", "pull", "push"].forEach((s) => {
const c = e[s];
Mt(c) && (s === "span" ? a.push(r.b(`${e[s]}`)) : c > 0 && a.push(r.b(`${s}-${e[s]}`)));
}), ["xs", "sm", "md", "lg", "xl"].forEach((s) => {
Mt(e[s]) ? a.push(r.b(`${s}-${e[s]}`)) : Oi(e[s]) && Object.entries(e[s]).forEach(([c, l]) => {
a.push(c !== "span" ? r.b(`${s}-${c}-${l}`) : r.b(`${s}-${l}`));
});
}), t.value && a.push(r.is("guttered")), [r.b(), a];
});
return (a, s) => (fe(), He(Fi(a.tag), {
class: Le(H(o)),
style: It(H(n))
}, {
default: pe(() => [
qe(a.$slots, "default")
]),
_: 3
}, 8, ["class", "style"]));
}
});
var TL = /* @__PURE__ */ at(SL, [["__file", "col.vue"]]);
const Mr = fi(TL), ng = (i) => Mt(i) || Ii(i) || zi(i), EL = ht({
accordion: Boolean,
modelValue: {
type: Xe([Array, String, Number]),
default: () => en([])
}
}), AL = {
[Dt]: ng,
[Qn]: ng
}, vy = Symbol("collapseContextKey"), CL = (i, e) => {
const t = Ae(Lr(i.modelValue)), r = (o) => {
t.value = o;
const a = i.accordion ? t.value[0] : t.value;
e(Dt, a), e(Qn, a);
}, n = (o) => {
if (i.accordion)
r([t.value[0] === o ? "" : o]);
else {
const a = [...t.value], s = a.indexOf(o);
s > -1 ? a.splice(s, 1) : a.push(o), r(a);
}
};
return Je(() => i.modelValue, () => t.value = Lr(i.modelValue), { deep: !0 }), pi(vy, {
activeNames: t,
handleItemClick: n
}), {
activeNames: t,
setActiveNames: r
};
}, LL = () => {
const i = it("collapse");
return {
rootKls: ce(() => i.b())
};
}, RL = Ie({
name: "ElCollapse"
}), OL = /* @__PURE__ */ Ie({
...RL,
props: EL,
emits: AL,
setup(i, { expose: e, emit: t }) {
const r = i, { activeNames: n, setActiveNames: o } = CL(r, t), { rootKls: a } = LL();
return e({
activeNames: n,
setActiveNames: o
}), (s, c) => (fe(), Ce("div", {
class: Le(H(a))
}, [
qe(s.$slots, "default")
], 2));
}
});
var PL = /* @__PURE__ */ at(OL, [["__file", "collapse.vue"]]);
const IL = Ie({
name: "ElCollapseTransition"
}), DL = /* @__PURE__ */ Ie({
...IL,
setup(i) {
const e = it("collapse-transition"), t = (n) => {
n.style.maxHeight = "", n.style.overflow = n.dataset.oldOverflow, n.style.paddingTop = n.dataset.oldPaddingTop, n.style.paddingBottom = n.dataset.oldPaddingBottom;
}, r = {
beforeEnter(n) {
n.dataset || (n.dataset = {}), n.dataset.oldPaddingTop = n.style.paddingTop, n.dataset.oldPaddingBottom = n.style.paddingBottom, n.style.height && (n.dataset.elExistsHeight = n.style.height), n.style.maxHeight = 0, n.style.paddingTop = 0, n.style.paddingBottom = 0;
},
enter(n) {
requestAnimationFrame(() => {
n.dataset.oldOverflow = n.style.overflow, n.dataset.elExistsHeight ? n.style.maxHeight = n.dataset.elExistsHeight : n.scrollHeight !== 0 ? n.style.maxHeight = `${n.scrollHeight}px` : n.style.maxHeight = 0, n.style.paddingTop = n.dataset.oldPaddingTop, n.style.paddingBottom = n.dataset.oldPaddingBottom, n.style.overflow = "hidden";
});
},
afterEnter(n) {
n.style.maxHeight = "", n.style.overflow = n.dataset.oldOverflow;
},
enterCancelled(n) {
t(n);
},
beforeLeave(n) {
n.dataset || (n.dataset = {}), n.dataset.oldPaddingTop = n.style.paddingTop, n.dataset.oldPaddingBottom = n.style.paddingBottom, n.dataset.oldOverflow = n.style.overflow, n.style.maxHeight = `${n.scrollHeight}px`, n.style.overflow = "hidden";
},
leave(n) {
n.scrollHeight !== 0 && (n.style.maxHeight = 0, n.style.paddingTop = 0, n.style.paddingBottom = 0);
},
afterLeave(n) {
t(n);
},
leaveCancelled(n) {
t(n);
}
};
return (n, o) => (fe(), He(hl, Pr({
name: H(e).b()
}, dw(r)), {
default: pe(() => [
qe(n.$slots, "default")
]),
_: 3
}, 16, ["name"]));
}
});
var NL = /* @__PURE__ */ at(DL, [["__file", "collapse-transition.vue"]]);
const BL = fi(NL), kL = ht({
title: {
type: String,
default: ""
},
name: {
type: Xe([String, Number]),
default: void 0
},
icon: {
type: qn,
default: $n
},
disabled: Boolean
}), FL = (i) => {
const e = ct(vy), { namespace: t } = it("collapse"), r = Ae(!1), n = Ae(!1), o = Ep(), a = ce(() => o.current++), s = ce(() => {
var l;
return (l = i.name) != null ? l : `${t.value}-id-${o.prefix}-${H(a)}`;
}), c = ce(() => e == null ? void 0 : e.activeNames.value.includes(H(s)));
return {
focusing: r,
id: a,
isActive: c,
handleFocus: () => {
setTimeout(() => {
n.value ? n.value = !1 : r.value = !0;
}, 50);
},
handleHeaderClick: () => {
i.disabled || (e == null || e.handleItemClick(H(s)), r.value = !1, n.value = !0);
},
handleEnterClick: () => {
e == null || e.handleItemClick(H(s));
}
};
}, zL = (i, { focusing: e, isActive: t, id: r }) => {
const n = it("collapse"), o = ce(() => [
n.b("item"),
n.is("active", H(t)),
n.is("disabled", i.disabled)
]), a = ce(() => [
n.be("item", "header"),
n.is("active", H(t)),
{ focusing: H(e) && !i.disabled }
]), s = ce(() => [
n.be("item", "arrow"),
n.is("active", H(t))
]), c = ce(() => n.be("item", "wrap")), l = ce(() => n.be("item", "content")), h = ce(() => n.b(`content-${H(r)}`)), u = ce(() => n.b(`head-${H(r)}`));
return {
arrowKls: s,
headKls: a,
rootKls: o,
itemWrapperKls: c,
itemContentKls: l,
scopedContentId: h,
scopedHeadId: u
};
}, UL = Ie({
name: "ElCollapseItem"
}), VL = /* @__PURE__ */ Ie({
...UL,
props: kL,
setup(i, { expose: e }) {
const t = i, {
focusing: r,
id: n,
isActive: o,
handleFocus: a,
handleHeaderClick: s,
handleEnterClick: c
} = FL(t), {
arrowKls: l,
headKls: h,
rootKls: u,
itemWrapperKls: p,
itemContentKls: m,
scopedContentId: g,
scopedHeadId: d
} = zL(t, { focusing: r, isActive: o, id: n });
return e({
isActive: o
}), (y, f) => (fe(), Ce("div", {
class: Le(H(u))
}, [
ke("button", {
id: H(d),
class: Le(H(h)),
"aria-expanded": H(o),
"aria-controls": H(g),
"aria-describedby": H(g),
tabindex: y.disabled ? -1 : 0,
type: "button",
onClick: H(s),
onKeydown: gr(ui(H(c), ["stop", "prevent"]), ["space", "enter"]),
onFocus: H(a),
onBlur: (v) => r.value = !1
}, [
qe(y.$slots, "title", {}, () => [
yt(wt(y.title), 1)
]),
qe(y.$slots, "icon", { isActive: H(o) }, () => [
se(H(kt), {
class: Le(H(l))
}, {
default: pe(() => [
(fe(), He(Fi(y.icon)))
]),
_: 1
}, 8, ["class"])
])
], 42, ["id", "aria-expanded", "aria-controls", "aria-describedby", "tabindex", "onClick", "onKeydown", "onFocus", "onBlur"]),
se(H(BL), null, {
default: pe(() => [
Bt(ke("div", {
id: H(g),
role: "region",
class: Le(H(p)),
"aria-hidden": !H(o),
"aria-labelledby": H(d)
}, [
ke("div", {
class: Le(H(m))
}, [
qe(y.$slots, "default")
], 2)
], 10, ["id", "aria-hidden", "aria-labelledby"]), [
[yi, H(o)]
])
]),
_: 3
})
], 2));
}
});
var yy = /* @__PURE__ */ at(VL, [["__file", "collapse-item.vue"]]);
const by = fi(PL, {
CollapseItem: yy
}), xy = gn(yy), HL = Ie({
name: "ElContainer"
}), jL = /* @__PURE__ */ Ie({
...HL,
props: {
direction: {
type: String
}
},
setup(i) {
const e = i, t = au(), r = it("container"), n = ce(() => e.direction === "vertical" ? !0 : e.direction === "horizontal" ? !1 : t && t.default ? t.default().some((o) => {
const a = o.type.name;
return a === "ElHeader" || a === "ElFooter";
}) : !1);
return (o, a) => (fe(), Ce("section", {
class: Le([H(r).b(), H(r).is("vertical", H(n))])
}, [
qe(o.$slots, "default")
], 2));
}
});
var GL = /* @__PURE__ */ at(jL, [["__file", "container.vue"]]);
const WL = Ie({
name: "ElAside"
}), $L = /* @__PURE__ */ Ie({
...WL,
props: {
width: {
type: String,
default: null
}
},
setup(i) {
const e = i, t = it("aside"), r = ce(() => e.width ? t.cssVarBlock({ width: e.width }) : {});
return (n, o) => (fe(), Ce("aside", {
class: Le(H(t).b()),
style: It(H(r))
}, [
qe(n.$slots, "default")
], 6));
}
});
var wy = /* @__PURE__ */ at($L, [["__file", "aside.vue"]]);
const qL = Ie({
name: "ElFooter"
}), XL = /* @__PURE__ */ Ie({
...qL,
props: {
height: {
type: String,
default: null
}
},
setup(i) {
const e = i, t = it("footer"), r = ce(() => e.height ? t.cssVarBlock({ height: e.height }) : {});
return (n, o) => (fe(), Ce("footer", {
class: Le(H(t).b()),
style: It(H(r))
}, [
qe(n.$slots, "default")
], 6));
}
});
var _y = /* @__PURE__ */ at(XL, [["__file", "footer.vue"]]);
const ZL = Ie({
name: "ElHeader"
}), YL = /* @__PURE__ */ Ie({
...ZL,
props: {
height: {
type: String,
default: null
}
},
setup(i) {
const e = i, t = it("header"), r = ce(() => e.height ? t.cssVarBlock({
height: e.height
}) : {});
return (n, o) => (fe(), Ce("header", {
class: Le(H(t).b()),
style: It(H(r))
}, [
qe(n.$slots, "default")
], 6));
}
});
var My = /* @__PURE__ */ at(YL, [["__file", "header.vue"]]);
const JL = Ie({
name: "ElMain"
}), KL = /* @__PURE__ */ Ie({
...JL,
setup(i) {
const e = it("main");
return (t, r) => (fe(), Ce("main", {
class: Le(H(e).b())
}, [
qe(t.$slots, "default")
], 2));
}
});
var Sy = /* @__PURE__ */ at(KL, [["__file", "main.vue"]]);
const jr = fi(GL, {
Aside: wy,
Footer: _y,
Header: My,
Main: Sy
});
gn(wy);
const Ty = gn(_y), QL = gn(My), vn = gn(Sy), e3 = /* @__PURE__ */ Ie({
inheritAttrs: !1
});
function t3(i, e, t, r, n, o) {
return qe(i.$slots, "default");
}
var i3 = /* @__PURE__ */ at(e3, [["render", t3], ["__file", "collection.vue"]]);
const r3 = /* @__PURE__ */ Ie({
name: "ElCollectionItem",
inheritAttrs: !1
});
function n3(i, e, t, r, n, o) {
return qe(i.$slots, "default");
}
var o3 = /* @__PURE__ */ at(r3, [["render", n3], ["__file", "collection-item.vue"]]);
const a3 = "data-el-collection-item", s3 = (i) => {
const e = `El${i}Collection`, t = `${e}Item`, r = Symbol(e), n = Symbol(t), o = {
...i3,
name: e,
setup() {
const s = Ae(null), c = /* @__PURE__ */ new Map();
pi(r, {
itemMap: c,
getItems: () => {
const l = H(s);
if (!l)
return [];
const h = Array.from(l.querySelectorAll(`[${a3}]`));
return [...c.values()].sort((u, p) => h.indexOf(u.ref) - h.indexOf(p.ref));
},
collectionRef: s
});
}
}, a = {
...o3,
name: t,
setup(s, { attrs: c }) {
const l = Ae(null), h = ct(r, void 0);
pi(n, {
collectionItemRef: l
}), ni(() => {
const u = H(l);
u && h.itemMap.set(u, {
ref: u,
...c
});
}), sr(() => {
const u = H(l);
h.itemMap.delete(u);
});
}
};
return {
COLLECTION_INJECTION_KEY: r,
COLLECTION_ITEM_INJECTION_KEY: n,
ElCollection: o,
ElCollectionItem: a
};
}, rh = ht({
trigger: Js.trigger,
effect: {
...qi.effect,
default: "light"
},
type: {
type: Xe(String)
},
placement: {
type: Xe(String),
default: "bottom"
},
popperOptions: {
type: Xe(Object),
default: () => ({})
},
id: String,
size: {
type: String,
default: ""
},
splitButton: Boolean,
hideOnClick: {
type: Boolean,
default: !0
},
loop: {
type: Boolean,
default: !0
},
showTimeout: {
type: Number,
default: 150
},
hideTimeout: {
type: Number,
default: 150
},
tabindex: {
type: Xe([Number, String]),
default: 0
},
maxHeight: {
type: Xe([Number, String]),
default: ""
},
popperClass: {
type: String,
default: ""
},
disabled: Boolean,
role: {
type: String,
default: "menu"
},
buttonProps: {
type: Xe(Object)
},
teleported: qi.teleported
});
ht({
command: {
type: [Object, String, Number],
default: () => ({})
},
disabled: Boolean,
divided: Boolean,
textValue: String,
icon: {
type: qn
}
});
ht({
onKeydown: { type: Xe(Function) }
});
s3("Dropdown");
const l3 = ht({
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: Da,
controls: {
type: Boolean,
default: !0
},
controlsPosition: {
type: String,
default: "",
values: ["", "right"]
},
valueOnClear: {
type: [String, Number, null],
validator: (i) => i === null || Mt(i) || ["min", "max"].includes(i),
default: null
},
name: String,
placeholder: String,
precision: {
type: Number,
validator: (i) => i >= 0 && i === Number.parseInt(`${i}`, 10)
},
validateEvent: {
type: Boolean,
default: !0
},
...jo(["ariaLabel"])
}), c3 = {
[Qn]: (i, e) => e !== i,
blur: (i) => i instanceof FocusEvent,
focus: (i) => i instanceof FocusEvent,
[So]: (i) => Mt(i) || on(i),
[Dt]: (i) => Mt(i) || on(i)
}, u3 = Ie({
name: "ElInputNumber"
}), h3 = /* @__PURE__ */ Ie({
...u3,
props: l3,
emits: c3,
setup(i, { expose: e, emit: t }) {
const r = i, { t: n } = mu(), o = it("input-number"), a = Ae(), s = Yi({
currentValue: r.modelValue,
userInput: null
}), { formItem: c } = gl(), l = ce(() => Mt(r.modelValue) && r.modelValue <= r.min), h = ce(() => Mt(r.modelValue) && r.modelValue >= r.max), u = ce(() => {
const O = f(r.step);
return vr(r.precision) ? Math.max(f(r.modelValue), O) : (O > r.precision && Qt("InputNumber", "precision should not be less than the decimal places of step"), r.precision);
}), p = ce(() => r.controls && r.controlsPosition === "right"), m = ns(), g = yu(), d = ce(() => {
if (s.userInput !== null)
return s.userInput;
let O = s.currentValue;
if (on(O))
return "";
if (Mt(O)) {
if (Number.isNaN(O))
return "";
vr(r.precision) || (O = O.toFixed(r.precision));
}
return O;
}), y = (O, x) => {
if (vr(x) && (x = u.value), x === 0)
return Math.round(O);
let I = String(O);
const N = I.indexOf(".");
if (N === -1 || !I.replace(".", "").split("")[N + x])
return O;
const D = I.length;
return I.charAt(D - 1) === "5" && (I = `${I.slice(0, Math.max(0, D - 1))}6`), Number.parseFloat(Number(I).toFixed(x));
}, f = (O) => {
if (on(O))
return 0;
const x = O.toString(), I = x.indexOf(".");
let N = 0;
return I !== -1 && (N = x.length - I - 1), N;
}, v = (O, x = 1) => Mt(O) ? y(O + r.step * x) : s.currentValue, _ = () => {
if (r.readonly || g.value || h.value)
return;
const O = Number(d.value) || 0, x = v(O);
w(x), t(So, s.currentValue), A();
}, M = () => {
if (r.readonly || g.value || l.value)
return;
const O = Number(d.value) || 0, x = v(O, -1);
w(x), t(So, s.currentValue), A();
}, T = (O, x) => {
const { max: I, min: N, step: D, precision: k, stepStrictly: F, valueOnClear: W } = r;
I < N && is("InputNumber", "min should not be greater than max.");
let K = Number(O);
if (on(O) || Number.isNaN(K))
return null;
if (O === "") {
if (W === null)
return null;
K = Ii(W) ? { min: N, max: I }[W] : W;
}
return F && (K = y(Math.round(K / D) * D, k), K !== O && x && t(Dt, K)), vr(k) || (K = y(K, k)), (K > I || K < N) && (K = K > I ? I : N, x && t(Dt, K)), K;
}, w = (O, x = !0) => {
var I;
const N = s.currentValue, D = T(O);
if (!x) {
t(Dt, D);
return;
}
N === D && O || (s.userInput = null, t(Dt, D), N !== D && t(Qn, D, N), r.validateEvent && ((I = c == null ? void 0 : c.validate) == null || I.call(c, "change").catch((k) => Qt(k))), s.currentValue = D);
}, b = (O) => {
s.userInput = O;
const x = O === "" ? null : Number(O);
t(So, x), w(x, !1);
}, E = (O) => {
const x = O !== "" ? Number(O) : "";
(Mt(x) && !Number.isNaN(x) || O === "") && w(x), A(), s.userInput = null;
}, S = () => {
var O, x;
(x = (O = a.value) == null ? void 0 : O.focus) == null || x.call(O);
}, C = () => {
var O, x;
(x = (O = a.value) == null ? void 0 : O.blur) == null || x.call(O);
}, R = (O) => {
t("focus", O);
}, L = (O) => {
var x;
s.userInput = null, t("blur", O), r.validateEvent && ((x = c == null ? void 0 : c.validate) == null || x.call(c, "blur").catch((I) => Qt(I)));
}, A = () => {
s.currentValue !== r.modelValue && (s.currentValue = r.modelValue);
}, P = (O) => {
document.activeElement === O.target && O.preventDefault();
};
return Je(() => r.modelValue, (O, x) => {
const I = T(O, !0);
s.userInput === null && I !== x && (s.currentValue = I);
}, { immediate: !0 }), ni(() => {
var O;
const { min: x, max: I, modelValue: N } = r, D = (O = a.value) == null ? void 0 : O.input;
if (D.setAttribute("role", "spinbutton"), Number.isFinite(I) ? D.setAttribute("aria-valuemax", String(I)) : D.removeAttribute("aria-valuemax"), Number.isFinite(x) ? D.setAttribute("aria-valuemin", String(x)) : D.removeAttribute("aria-valuemin"), D.setAttribute("aria-valuenow", s.currentValue || s.currentValue === 0 ? String(s.currentValue) : ""), D.setAttribute("aria-disabled", String(g.value)), !Mt(N) && N != null) {
let k = Number(N);
Number.isNaN(k) && (k = null), t(Dt, k);
}
D.addEventListener("wheel", P, { passive: !1 });
}), rp(() => {
var O, x;
const I = (O = a.value) == null ? void 0 : O.input;
I == null || I.setAttribute("aria-valuenow", `${(x = s.currentValue) != null ? x : ""}`);
}), e({
focus: S,
blur: C
}), (O, x) => (fe(), Ce("div", {
class: Le([
H(o).b(),
H(o).m(H(m)),
H(o).is("disabled", H(g)),
H(o).is("without-controls", !O.controls),
H(o).is("controls-right", H(p))
]),
onDragstart: ui(() => {
}, ["prevent"])
}, [
O.controls ? Bt((fe(), Ce("span", {
key: 0,
role: "button",
"aria-label": H(n)("el.inputNumber.decrease"),
class: Le([H(o).e("decrease"), H(o).is("disabled", H(l))]),
onKeydown: gr(M, ["enter"])
}, [
qe(O.$slots, "decrease-icon", {}, () => [
se(H(kt), null, {
default: pe(() => [
H(p) ? (fe(), He(H(mp), { key: 0 })) : (fe(), He(H(mE), { key: 1 }))
]),
_: 1
})
])
], 42, ["aria-label", "onKeydown"])), [
[H(rg), M]
]) : Ve("v-if", !0),
O.controls ? Bt((fe(), Ce("span", {
key: 1,
role: "button",
"aria-label": H(n)("el.inputNumber.increase"),
class: Le([H(o).e("increase"), H(o).is("disabled", H(h))]),
onKeydown: gr(_, ["enter"])
}, [
qe(O.$slots, "increase-icon", {}, () => [
se(H(kt), null, {
default: pe(() => [
H(p) ? (fe(), He(H(oE), { key: 0 })) : (fe(), He(H(pu), { key: 1 }))
]),
_: 1
})
])
], 42, ["aria-label", "onKeydown"])), [
[H(rg), _]
]) : Ve("v-if", !0),
se(H(y2), {
id: O.id,
ref_key: "input",
ref: a,
type: "number",
step: O.step,
"model-value": H(d),
placeholder: O.placeholder,
readonly: O.readonly,
disabled: H(g),
size: H(m),
max: O.max,
min: O.min,
name: O.name,
"aria-label": O.ariaLabel,
"validate-event": !1,
onKeydown: [
gr(ui(_, ["prevent"]), ["up"]),
gr(ui(M, ["prevent"]), ["down"])
],
onBlur: L,
onFocus: R,
onInput: b,
onChange: E
}, pw({ _: 2 }, [
O.$slots.prefix ? {
name: "prefix",
fn: pe(() => [
qe(O.$slots, "prefix")
])
} : void 0,
O.$slots.suffix ? {
name: "suffix",
fn: pe(() => [
qe(O.$slots, "suffix")
])
} : void 0
]), 1032, ["id", "step", "model-value", "placeholder", "readonly", "disabled", "size", "max", "min", "name", "aria-label", "onKeydown"])
], 42, ["onDragstart"]));
}
});
var d3 = /* @__PURE__ */ at(h3, [["__file", "input-number.vue"]]);
const yn = fi(d3), Ey = Symbol("ElSelectGroup"), wu = Symbol("ElSelect");
function p3(i, e) {
const t = ct(wu), r = ct(Ey, { disabled: !1 }), n = ce(() => h(Lr(t.props.modelValue), i.value)), o = ce(() => {
var m;
if (t.props.multiple) {
const g = Lr((m = t.props.modelValue) != null ? m : []);
return !n.value && g.length >= t.props.multipleLimit && t.props.multipleLimit > 0;
} else
return !1;
}), a = ce(() => i.label || (Oi(i.value) ? "" : i.value)), s = ce(() => i.value || i.label || ""), c = ce(() => i.disabled || e.groupDisabled || o.value), l = si(), h = (m = [], g) => {
if (Oi(i.value)) {
const d = t.props.valueKey;
return m && m.some((y) => np(Qr(y, d)) === Qr(g, d));
} else
return m && m.includes(g);
}, u = () => {
!i.disabled && !r.disabled && (t.states.hoveringIndex = t.optionsArray.indexOf(l.proxy));
}, p = (m) => {
const g = new RegExp(KT(m), "i");
e.visible = g.test(a.value) || i.created;
};
return Je(() => a.value, () => {
!i.created && !t.props.remote && t.setSelected();
}), Je(() => i.value, (m, g) => {
const { remote: d, valueKey: y } = t.props;
if (m !== g && (t.onOptionDestroy(g, l.proxy), t.onOptionCreate(l.proxy)), !i.created && !d) {
if (y && Oi(m) && Oi(g) && m[y] === g[y])
return;
t.setSelected();
}
}), Je(() => r.disabled, () => {
e.groupDisabled = r.disabled;
}, { immediate: !0 }), {
select: t,
currentLabel: a,
currentValue: s,
itemSelected: n,
isDisabled: c,
hoverItem: u,
updateOption: p
};
}
const f3 = Ie({
name: "ElOption",
componentName: "ElOption",
props: {
value: {
required: !0,
type: [String, Number, Boolean, Object]
},
label: [String, Number],
created: Boolean,
disabled: Boolean
},
setup(i) {
const e = it("select"), t = vu(), r = ce(() => [
e.be("dropdown", "item"),
e.is("disabled", H(s)),
e.is("selected", H(a)),
e.is("hovering", H(p))
]), n = Yi({
index: -1,
groupDisabled: !1,
visible: !0,
hover: !1
}), {
currentLabel: o,
itemSelected: a,
isDisabled: s,
select: c,
hoverItem: l,
updateOption: h
} = p3(i, n), { visible: u, hover: p } = cn(n), m = si().proxy;
c.onOptionCreate(m), sr(() => {
const d = m.value, { selected: y } = c.states, f = (c.props.multiple ? y : [y]).some((v) => v.value === m.value);
_t(() => {
c.states.cachedOptions.get(d) === m && !f && c.states.cachedOptions.delete(d);
}), c.onOptionDestroy(d, m);
});
function g() {
s.value || c.handleOptionSelect(m);
}
return {
ns: e,
id: t,
containerKls: r,
currentLabel: o,
itemSelected: a,
isDisabled: s,
select: c,
hoverItem: l,
updateOption: h,
visible: u,
hover: p,
selectOptionClick: g,
states: n
};
}
});
function m3(i, e, t, r, n, o) {
return Bt((fe(), Ce("li", {
id: i.id,
class: Le(i.containerKls),
role: "option",
"aria-disabled": i.isDisabled || void 0,
"aria-selected": i.itemSelected,
onMouseenter: i.hoverItem,
onClick: ui(i.selectOptionClick, ["stop"])
}, [
qe(i.$slots, "default", {}, () => [
ke("span", null, wt(i.currentLabel), 1)
])
], 42, ["id", "aria-disabled", "aria-selected", "onMouseenter", "onClick"])), [
[yi, i.visible]
]);
}
var Bp = /* @__PURE__ */ at(f3, [["render", m3], ["__file", "option.vue"]]);
const g3 = Ie({
name: "ElSelectDropdown",
componentName: "ElSelectDropdown",
setup() {
const i = ct(wu), e = it("select"), t = ce(() => i.props.popperClass), r = ce(() => i.props.multiple), n = ce(() => i.props.fitInputWidth), o = Ae("");
function a() {
var s;
o.value = `${(s = i.selectRef) == null ? void 0 : s.offsetWidth}px`;
}
return ni(() => {
a(), ir(i.selectRef, a);
}), {
ns: e,
minWidth: o,
popperClass: t,
isMultiple: r,
isFitInputWidth: n
};
}
});
function v3(i, e, t, r, n, o) {
return fe(), Ce("div", {
class: Le([i.ns.b("dropdown"), i.ns.is("multiple", i.isMultiple), i.popperClass]),
style: It({ [i.isFitInputWidth ? "width" : "minWidth"]: i.minWidth })
}, [
i.$slots.header ? (fe(), Ce("div", {
key: 0,
class: Le(i.ns.be("dropdown", "header"))
}, [
qe(i.$slots, "header")
], 2)) : Ve("v-if", !0),
qe(i.$slots, "default"),
i.$slots.footer ? (fe(), Ce("div", {
key: 1,
class: Le(i.ns.be("dropdown", "footer"))
}, [
qe(i.$slots, "footer")
], 2)) : Ve("v-if", !0)
], 6);
}
var y3 = /* @__PURE__ */ at(g3, [["render", v3], ["__file", "select-dropdown.vue"]]);
const b3 = 11, x3 = (i, e) => {
const { t } = mu(), r = vu(), n = it("select"), o = it("input"), a = Yi({
inputValue: "",
options: /* @__PURE__ */ new Map(),
cachedOptions: /* @__PURE__ */ new Map(),
disabledOptions: /* @__PURE__ */ new Map(),
optionValues: [],
selected: [],
selectionWidth: 0,
calculatorWidth: 0,
collapseItemWidth: 0,
selectedLabel: "",
hoveringIndex: -1,
previousQuery: null,
inputHovering: !1,
menuVisibleOnFocus: !1,
isBeforeHide: !1
}), s = Ae(null), c = Ae(null), l = Ae(null), h = Ae(null), u = Ae(null), p = Ae(null), m = Ae(null), g = Ae(null), d = Ae(null), y = Ae(null), f = Ae(null), v = Ae(null), {
isComposing: _,
handleCompositionStart: M,
handleCompositionUpdate: T,
handleCompositionEnd: w
} = ry({
afterComposition: (he) => oe(he)
}), { wrapperRef: b, isFocused: E } = iy(u, {
beforeFocus() {
return x.value;
},
afterFocus() {
i.automaticDropdown && !S.value && (S.value = !0, a.menuVisibleOnFocus = !0);
},
beforeBlur(he) {
var we, De;
return ((we = l.value) == null ? void 0 : we.isFocusInsideContent(he)) || ((De = h.value) == null ? void 0 : De.isFocusInsideContent(he));
},
afterBlur() {
S.value = !1, a.menuVisibleOnFocus = !1;
}
}), S = Ae(!1), C = Ae(), { form: R, formItem: L } = gl(), { inputId: A } = Lp(i, {
formItemContext: L
}), { valueOnClear: P, isEmptyValue: O } = t2(i), x = ce(() => i.disabled || (R == null ? void 0 : R.disabled)), I = ce(() => zi(i.modelValue) ? i.modelValue.length > 0 : !O(i.modelValue)), N = ce(() => i.clearable && !x.value && a.inputHovering && I.value), D = ce(() => i.remote && i.filterable && !i.remoteShowSuffix ? "" : i.suffixIcon), k = ce(() => n.is("reverse", D.value && S.value)), F = ce(() => (L == null ? void 0 : L.validateState) || ""), W = ce(() => D0[F.value]), K = ce(() => i.remote ? 300 : 0), ne = ce(() => i.loading ? i.loadingText || t("el.select.loading") : i.remote && !a.inputValue && a.options.size === 0 ? !1 : i.filterable && a.inputValue && a.options.size > 0 && q.value === 0 ? i.noMatchText || t("el.select.noMatch") : a.options.size === 0 ? i.noDataText || t("el.select.noData") : null), q = ce(() => z.value.filter((he) => he.visible).length), z = ce(() => {
const he = Array.from(a.options.values()), we = [];
return a.optionValues.forEach((De) => {
const We = he.findIndex((Ze) => Ze.value === De);
We > -1 && we.push(he[We]);
}), we.length >= he.length ? we : he;
}), j = ce(() => Array.from(a.cachedOptions.values())), Q = ce(() => {
const he = z.value.filter((we) => !we.created).some((we) => we.currentLabel === a.inputValue);
return i.filterable && i.allowCreate && a.inputValue !== "" && !he;
}), Y = () => {
i.filterable && Ci(i.filterMethod) || i.filterable && i.remote && Ci(i.remoteMethod) || z.value.forEach((he) => {
var we;
(we = he.updateOption) == null || we.call(he, a.inputValue);
});
}, ee = ns(), G = ce(() => ["small"].includes(ee.value) ? "small" : "default"), J = ce({
get() {
return S.value && ne.value !== !1;
},
set(he) {
S.value = he;
}
}), re = ce(() => {
if (i.multiple && !vr(i.modelValue))
return Lr(i.modelValue).length === 0 && !a.inputValue;
const he = zi(i.modelValue) ? i.modelValue[0] : i.modelValue;
return i.filterable || vr(he) ? !a.inputValue : !0;
}), B = ce(() => {
var he;
const we = (he = i.placeholder) != null ? he : t("el.select.placeholder");
return i.multiple || !I.value ? we : a.selectedLabel;
}), $ = ce(() => ed ? null : "mouseenter");
Je(() => i.modelValue, (he, we) => {
i.multiple && i.filterable && !i.reserveKeyword && (a.inputValue = "", te("")), V(), !sd(he, we) && i.validateEvent && (L == null || L.validate("change").catch((De) => Qt(De)));
}, {
flush: "post",
deep: !0
}), Je(() => S.value, (he) => {
he ? te(a.inputValue) : (a.inputValue = "", a.previousQuery = null, a.isBeforeHide = !0), e("visible-change", he);
}), Je(() => a.options.entries(), () => {
var he;
if (!ii)
return;
const we = ((he = s.value) == null ? void 0 : he.querySelectorAll("input")) || [];
(!i.filterable && !i.defaultFirstOption && !vr(i.modelValue) || !Array.from(we).includes(document.activeElement)) && V(), i.defaultFirstOption && (i.filterable || i.remote) && q.value && U();
}, {
flush: "post"
}), Je(() => a.hoveringIndex, (he) => {
Mt(he) && he > -1 ? C.value = z.value[he] || {} : C.value = {}, z.value.forEach((we) => {
we.hover = C.value === we;
});
}), l0(() => {
a.isBeforeHide || Y();
});
const te = (he) => {
a.previousQuery === he || _.value || (a.previousQuery = he, i.filterable && Ci(i.filterMethod) ? i.filterMethod(he) : i.filterable && i.remote && Ci(i.remoteMethod) && i.remoteMethod(he), i.defaultFirstOption && (i.filterable || i.remote) && q.value ? _t(U) : _t(ue));
}, U = () => {
const he = z.value.filter((We) => We.visible && !We.disabled && !We.states.groupDisabled), we = he.find((We) => We.created), De = he[0];
a.hoveringIndex = bt(z.value, we || De);
}, V = () => {
if (i.multiple)
a.selectedLabel = "";
else {
const we = zi(i.modelValue) ? i.modelValue[0] : i.modelValue, De = ae(we);
a.selectedLabel = De.currentLabel, a.selected = [De];
return;
}
const he = [];
vr(i.modelValue) || Lr(i.modelValue).forEach((we) => {
he.push(ae(we));
}), a.selected = he;
}, ae = (he) => {
let we;
const De = $u(he).toLowerCase() === "object", We = $u(he).toLowerCase() === "null", Ze = $u(he).toLowerCase() === "undefined";
for (let Ke = a.cachedOptions.size - 1; Ke >= 0; Ke--) {
const dt = j.value[Ke];
if (De ? Qr(dt.value, i.valueKey) === Qr(he, i.valueKey) : dt.value === he) {
we = {
value: he,
currentLabel: dt.currentLabel,
get isDisabled() {
return dt.isDisabled;
}
};
break;
}
}
if (we)
return we;
const Qe = De ? he.label : !We && !Ze ? he : "";
return {
value: he,
currentLabel: Qe
};
}, ue = () => {
a.hoveringIndex = z.value.findIndex((he) => a.selected.some((we) => gt(we) === gt(he)));
}, de = () => {
a.selectionWidth = c.value.getBoundingClientRect().width;
}, ve = () => {
a.calculatorWidth = p.value.getBoundingClientRect().width;
}, ye = () => {
a.collapseItemWidth = f.value.getBoundingClientRect().width;
}, le = () => {
var he, we;
(we = (he = l.value) == null ? void 0 : he.updatePopper) == null || we.call(he);
}, Se = () => {
var he, we;
(we = (he = h.value) == null ? void 0 : he.updatePopper) == null || we.call(he);
}, Te = () => {
a.inputValue.length > 0 && !S.value && (S.value = !0), te(a.inputValue);
}, oe = (he) => {
if (a.inputValue = he.target.value, i.remote)
Me();
else
return Te();
}, Me = ad(() => {
Te();
}, K.value), ge = (he) => {
sd(i.modelValue, he) || e(Qn, he);
}, xe = (he) => WT(he, (we) => !a.disabledOptions.has(we)), Oe = (he) => {
if (i.multiple && he.code !== Ir.delete && he.target.value.length <= 0) {
const we = Lr(i.modelValue).slice(), De = xe(we);
if (De < 0)
return;
const We = we[De];
we.splice(De, 1), e(Dt, we), ge(we), e("remove-tag", We);
}
}, ut = (he, we) => {
const De = a.selected.indexOf(we);
if (De > -1 && !x.value) {
const We = Lr(i.modelValue).slice();
We.splice(De, 1), e(Dt, We), ge(We), e("remove-tag", we.value);
}
he.stopPropagation(), Ut();
}, mt = (he) => {
he.stopPropagation();
const we = i.multiple ? [] : P.value;
if (i.multiple)
for (const De of a.selected)
De.isDisabled && we.push(De.value);
e(Dt, we), ge(we), a.hoveringIndex = -1, S.value = !1, e("clear"), Ut();
}, ze = (he) => {
var we;
if (i.multiple) {
const De = Lr((we = i.modelValue) != null ? we : []).slice(), We = bt(De, he.value);
We > -1 ? De.splice(We, 1) : (i.multipleLimit <= 0 || De.length < i.multipleLimit) && De.push(he.value), e(Dt, De), ge(De), he.created && te(""), i.filterable && !i.reserveKeyword && (a.inputValue = "");
} else
e(Dt, he.value), ge(he.value), S.value = !1;
Ut(), !S.value && _t(() => {
Ue(he);
});
}, bt = (he = [], we) => {
if (!Oi(we))
return he.indexOf(we);
const De = i.valueKey;
let We = -1;
return he.some((Ze, Qe) => np(Qr(Ze, De)) === Qr(we, De) ? (We = Qe, !0) : !1), We;
}, Ue = (he) => {
var we, De, We, Ze, Qe;
const Ke = zi(he) ? he[0] : he;
let dt = null;
if (Ke != null && Ke.value) {
const Mi = z.value.filter((mi) => mi.value === Ke.value);
Mi.length > 0 && (dt = Mi[0].$el);
}
if (l.value && dt) {
const Mi = (Ze = (We = (De = (we = l.value) == null ? void 0 : we.popperRef) == null ? void 0 : De.contentRef) == null ? void 0 : We.querySelector) == null ? void 0 : Ze.call(We, `.${n.be("dropdown", "wrap")}`);
Mi && eE(Mi, dt);
}
(Qe = v.value) == null || Qe.handleScroll();
}, st = (he) => {
a.options.set(he.value, he), a.cachedOptions.set(he.value, he), he.disabled && a.disabledOptions.set(he.value, he);
}, et = (he, we) => {
a.options.get(he) === we && a.options.delete(he);
}, xt = ce(() => {
var he, we;
return (we = (he = l.value) == null ? void 0 : he.popperRef) == null ? void 0 : we.contentRef;
}), ft = () => {
a.isBeforeHide = !1, _t(() => Ue(a.selected));
}, Ut = () => {
var he;
(he = u.value) == null || he.focus();
}, Nt = () => {
var he;
(he = u.value) == null || he.blur();
}, ie = (he) => {
mt(he);
}, Ee = () => {
S.value = !1, E.value && Nt();
}, Ne = () => {
a.inputValue.length > 0 ? a.inputValue = "" : S.value = !1;
}, Ge = () => {
x.value || (ed && (a.inputHovering = !0), a.menuVisibleOnFocus ? a.menuVisibleOnFocus = !1 : S.value = !S.value);
}, rt = () => {
S.value ? z.value[a.hoveringIndex] && ze(z.value[a.hoveringIndex]) : Ge();
}, gt = (he) => Oi(he.value) ? Qr(he.value, i.valueKey) : he.value, Tt = ce(() => z.value.filter((he) => he.visible).every((he) => he.disabled)), Lt = ce(() => i.multiple ? i.collapseTags ? a.selected.slice(0, i.maxCollapseTags) : a.selected : []), Vt = ce(() => i.multiple ? i.collapseTags ? a.selected.slice(i.maxCollapseTags) : [] : []), X = (he) => {
if (!S.value) {
S.value = !0;
return;
}
if (!(a.options.size === 0 || a.filteredOptionsCount === 0 || _.value) && !Tt.value) {
he === "next" ? (a.hoveringIndex++, a.hoveringIndex === a.options.size && (a.hoveringIndex = 0)) : he === "prev" && (a.hoveringIndex--, a.hoveringIndex < 0 && (a.hoveringIndex = a.options.size - 1));
const we = z.value[a.hoveringIndex];
(we.disabled === !0 || we.states.groupDisabled === !0 || !we.visible) && X(he), _t(() => Ue(C.value));
}
}, be = () => {
if (!c.value)
return 0;
const he = window.getComputedStyle(c.value);
return Number.parseFloat(he.gap || "6px");
}, me = ce(() => {
const he = be();
return { maxWidth: `${f.value && i.maxCollapseTags === 1 ? a.selectionWidth - a.collapseItemWidth - he : a.selectionWidth}px` };
}), _e = ce(() => ({ maxWidth: `${a.selectionWidth}px` })), Pe = ce(() => ({
width: `${Math.max(a.calculatorWidth, b3)}px`
}));
return ir(c, de), ir(p, ve), ir(d, le), ir(b, le), ir(y, Se), ir(f, ye), ni(() => {
V();
}), {
inputId: A,
contentId: r,
nsSelect: n,
nsInput: o,
states: a,
isFocused: E,
expanded: S,
optionsArray: z,
hoverOption: C,
selectSize: ee,
filteredOptionsCount: q,
resetCalculatorWidth: ve,
updateTooltip: le,
updateTagTooltip: Se,
debouncedOnInputChange: Me,
onInput: oe,
deletePrevTag: Oe,
deleteTag: ut,
deleteSelected: mt,
handleOptionSelect: ze,
scrollToOption: Ue,
hasModelValue: I,
shouldShowPlaceholder: re,
currentPlaceholder: B,
mouseEnterEventName: $,
showClose: N,
iconComponent: D,
iconReverse: k,
validateState: F,
validateIcon: W,
showNewOption: Q,
updateOptions: Y,
collapseTagSize: G,
setSelected: V,
selectDisabled: x,
emptyText: ne,
handleCompositionStart: M,
handleCompositionUpdate: T,
handleCompositionEnd: w,
onOptionCreate: st,
onOptionDestroy: et,
handleMenuEnter: ft,
focus: Ut,
blur: Nt,
handleClearClick: ie,
handleClickOutside: Ee,
handleEsc: Ne,
toggleMenu: Ge,
selectOption: rt,
getValueKey: gt,
navigateOptions: X,
dropdownMenuVisible: J,
showTagList: Lt,
collapseTagList: Vt,
tagStyle: me,
collapseTagStyle: _e,
inputStyle: Pe,
popperRef: xt,
inputRef: u,
tooltipRef: l,
tagTooltipRef: h,
calculatorRef: p,
prefixRef: m,
suffixRef: g,
selectRef: s,
wrapperRef: b,
selectionRef: c,
scrollbarRef: v,
menuRef: d,
tagMenuRef: y,
collapseItemRef: f
};
};
var w3 = Ie({
name: "ElOptions",
setup(i, { slots: e }) {
const t = ct(wu);
let r = [];
return () => {
var n, o;
const a = (n = e.default) == null ? void 0 : n.call(e), s = [];
function c(l) {
zi(l) && l.forEach((h) => {
var u, p, m, g;
const d = (u = (h == null ? void 0 : h.type) || {}) == null ? void 0 : u.name;
d === "ElOptionGroup" ? c(!Ii(h.children) && !zi(h.children) && Ci((p = h.children) == null ? void 0 : p.default) ? (m = h.children) == null ? void 0 : m.default() : h.children) : d === "ElOption" ? s.push((g = h.props) == null ? void 0 : g.value) : zi(h.children) && c(h.children);
});
}
return a.length && c((o = a[0]) == null ? void 0 : o.children), sd(s, r) || (r = s, t && (t.states.optionValues = s)), a;
};
}
});
const _3 = ht({
name: String,
id: String,
modelValue: {
type: [Array, String, Number, Boolean, Object],
default: void 0
},
autocomplete: {
type: String,
default: "off"
},
automaticDropdown: Boolean,
size: Da,
effect: {
type: Xe(String),
default: "light"
},
disabled: Boolean,
clearable: Boolean,
filterable: Boolean,
allowCreate: Boolean,
loading: Boolean,
popperClass: {
type: String,
default: ""
},
popperOptions: {
type: Xe(Object),
default: () => ({})
},
remote: Boolean,
loadingText: String,
noMatchText: String,
noDataText: String,
remoteMethod: Function,
filterMethod: Function,
multiple: Boolean,
multipleLimit: {
type: Number,
default: 0
},
placeholder: {
type: String
},
defaultFirstOption: Boolean,
reserveKeyword: {
type: Boolean,
default: !0
},
valueKey: {
type: String,
default: "value"
},
collapseTags: Boolean,
collapseTagsTooltip: Boolean,
maxCollapseTags: {
type: Number,
default: 1
},
teleported: qi.teleported,
persistent: {
type: Boolean,
default: !0
},
clearIcon: {
type: qn,
default: gp
},
fitInputWidth: Boolean,
suffixIcon: {
type: qn,
default: mp
},
tagType: { ...fd.type, default: "info" },
tagEffect: { ...fd.effect, default: "light" },
validateEvent: {
type: Boolean,
default: !0
},
remoteShowSuffix: Boolean,
placement: {
type: Xe(String),
values: rs,
default: "bottom-start"
},
fallbackPlacements: {
type: Xe(Array),
default: ["bottom-start", "top-start", "right", "left"]
},
appendTo: String,
...e2,
...jo(["ariaLabel"])
}), og = "ElSelect", M3 = Ie({
name: og,
componentName: og,
components: {
ElSelectMenu: y3,
ElOption: Bp,
ElOptions: w3,
ElTag: mL,
ElScrollbar: P2,
ElTooltip: Np,
ElIcon: kt
},
directives: { ClickOutside: lL },
props: _3,
emits: [
Dt,
Qn,
"remove-tag",
"clear",
"visible-change",
"focus",
"blur"
],
setup(i, { emit: e }) {
const t = ce(() => {
const { modelValue: o, multiple: a } = i, s = a ? [] : void 0;
return zi(o) ? a ? o : s : a ? s : o;
}), r = Yi({
...cn(i),
modelValue: t
}), n = x3(r, e);
return pi(wu, Yi({
props: r,
states: n.states,
optionsArray: n.optionsArray,
handleOptionSelect: n.handleOptionSelect,
onOptionCreate: n.onOptionCreate,
onOptionDestroy: n.onOptionDestroy,
selectRef: n.selectRef,
setSelected: n.setSelected
})), {
...n,
modelValue: t
};
}
});
function S3(i, e, t, r, n, o) {
const a = Ri("el-tag"), s = Ri("el-tooltip"), c = Ri("el-icon"), l = Ri("el-option"), h = Ri("el-options"), u = Ri("el-scrollbar"), p = Ri("el-select-menu"), m = vw("click-outside");
return Bt((fe(), Ce("div", {
ref: "selectRef",
class: Le([i.nsSelect.b(), i.nsSelect.m(i.selectSize)]),
[yw(i.mouseEnterEventName)]: (g) => i.states.inputHovering = !0,
onMouseleave: (g) => i.states.inputHovering = !1
}, [
se(s, {
ref: "tooltipRef",
visible: i.dropdownMenuVisible,
placement: i.placement,
teleported: i.teleported,
"popper-class": [i.nsSelect.e("popper"), i.popperClass],
"popper-options": i.popperOptions,
"fallback-placements": i.fallbackPlacements,
effect: i.effect,
pure: "",
trigger: "click",
transition: `${i.nsSelect.namespace.value}-zoom-in-top`,
"stop-popper-mouse-event": !1,
"gpu-acceleration": !1,
persistent: i.persistent,
"append-to": i.appendTo,
onBeforeShow: i.handleMenuEnter,
onHide: (g) => i.states.isBeforeHide = !1
}, {
default: pe(() => {
var g;
return [
ke("div", {
ref: "wrapperRef",
class: Le([
i.nsSelect.e("wrapper"),
i.nsSelect.is("focused", i.isFocused),
i.nsSelect.is("hovering", i.states.inputHovering),
i.nsSelect.is("filterable", i.filterable),
i.nsSelect.is("disabled", i.selectDisabled)
]),
onClick: ui(i.toggleMenu, ["prevent"])
}, [
i.$slots.prefix ? (fe(), Ce("div", {
key: 0,
ref: "prefixRef",
class: Le(i.nsSelect.e("prefix"))
}, [
qe(i.$slots, "prefix")
], 2)) : Ve("v-if", !0),
ke("div", {
ref: "selectionRef",
class: Le([
i.nsSelect.e("selection"),
i.nsSelect.is("near", i.multiple && !i.$slots.prefix && !!i.states.selected.length)
])
}, [
i.multiple ? qe(i.$slots, "tag", { key: 0 }, () => [
(fe(!0), Ce(Gt, null, rr(i.showTagList, (d) => (fe(), Ce("div", {
key: i.getValueKey(d),
class: Le(i.nsSelect.e("selected-item"))
}, [
se(a, {
closable: !i.selectDisabled && !d.isDisabled,
size: i.collapseTagSize,
type: i.tagType,
effect: i.tagEffect,
"disable-transitions": "",
style: It(i.tagStyle),
onClose: (y) => i.deleteTag(y, d)
}, {
default: pe(() => [
ke("span", {
class: Le(i.nsSelect.e("tags-text"))
}, [
qe(i.$slots, "label", {
label: d.currentLabel,
value: d.value
}, () => [
yt(wt(d.currentLabel), 1)
])
], 2)
]),
_: 2
}, 1032, ["closable", "size", "type", "effect", "style", "onClose"])
], 2))), 128)),
i.collapseTags && i.states.selected.length > i.maxCollapseTags ? (fe(), He(s, {
key: 0,
ref: "tagTooltipRef",
disabled: i.dropdownMenuVisible || !i.collapseTagsTooltip,
"fallback-placements": ["bottom", "top", "right", "left"],
effect: i.effect,
placement: "bottom",
teleported: i.teleported
}, {
default: pe(() => [
ke("div", {
ref: "collapseItemRef",
class: Le(i.nsSelect.e("selected-item"))
}, [
se(a, {
closable: !1,
size: i.collapseTagSize,
type: i.tagType,
effect: i.tagEffect,
"disable-transitions": "",
style: It(i.collapseTagStyle)
}, {
default: pe(() => [
ke("span", {
class: Le(i.nsSelect.e("tags-text"))
}, " + " + wt(i.states.selected.length - i.maxCollapseTags), 3)
]),
_: 1
}, 8, ["size", "type", "effect", "style"])
], 2)
]),
content: pe(() => [
ke("div", {
ref: "tagMenuRef",
class: Le(i.nsSelect.e("selection"))
}, [
(fe(!0), Ce(Gt, null, rr(i.collapseTagList, (d) => (fe(), Ce("div", {
key: i.getValueKey(d),
class: Le(i.nsSelect.e("selected-item"))
}, [
se(a, {
class: "in-tooltip",
closable: !i.selectDisabled && !d.isDisabled,
size: i.collapseTagSize,
type: i.tagType,
effect: i.tagEffect,
"disable-transitions": "",
onClose: (y) => i.deleteTag(y, d)
}, {
default: pe(() => [
ke("span", {
class: Le(i.nsSelect.e("tags-text"))
}, [
qe(i.$slots, "label", {
label: d.currentLabel,
value: d.value
}, () => [
yt(wt(d.currentLabel), 1)
])
], 2)
]),
_: 2
}, 1032, ["closable", "size", "type", "effect", "onClose"])
], 2))), 128))
], 2)
]),
_: 3
}, 8, ["disabled", "effect", "teleported"])) : Ve("v-if", !0)
]) : Ve("v-if", !0),
i.selectDisabled ? Ve("v-if", !0) : (fe(), Ce("div", {
key: 1,
class: Le([
i.nsSelect.e("selected-item"),
i.nsSelect.e("input-wrapper"),
i.nsSelect.is("hidden", !i.filterable)
])
}, [
Bt(ke("input", {
id: i.inputId,
ref: "inputRef",
"onUpdate:modelValue": (d) => i.states.inputValue = d,
type: "text",
name: i.name,
class: Le([i.nsSelect.e("input"), i.nsSelect.is(i.selectSize)]),
disabled: i.selectDisabled,
autocomplete: i.autocomplete,
style: It(i.inputStyle),
role: "combobox",
readonly: !i.filterable,
spellcheck: "false",
"aria-activedescendant": ((g = i.hoverOption) == null ? void 0 : g.id) || "",
"aria-controls": i.contentId,
"aria-expanded": i.dropdownMenuVisible,
"aria-label": i.ariaLabel,
"aria-autocomplete": "none",
"aria-haspopup": "listbox",
onKeydown: [
gr(ui((d) => i.navigateOptions("next"), ["stop", "prevent"]), ["down"]),
gr(ui((d) => i.navigateOptions("prev"), ["stop", "prevent"]), ["up"]),
gr(ui(i.handleEsc, ["stop", "prevent"]), ["esc"]),
gr(ui(i.selectOption, ["stop", "prevent"]), ["enter"]),
gr(ui(i.deletePrevTag, ["stop"]), ["delete"])
],
onCompositionstart: i.handleCompositionStart,
onCompositionupdate: i.handleCompositionUpdate,
onCompositionend: i.handleCompositionEnd,
onInput: i.onInput,
onClick: ui(i.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"]), [
[bw, i.states.inputValue]
]),
i.filterable ? (fe(), Ce("span", {
key: 0,
ref: "calculatorRef",
"aria-hidden": "true",
class: Le(i.nsSelect.e("input-calculator")),
textContent: wt(i.states.inputValue)
}, null, 10, ["textContent"])) : Ve("v-if", !0)
], 2)),
i.shouldShowPlaceholder ? (fe(), Ce("div", {
key: 2,
class: Le([
i.nsSelect.e("selected-item"),
i.nsSelect.e("placeholder"),
i.nsSelect.is("transparent", !i.hasModelValue || i.expanded && !i.states.inputValue)
])
}, [
i.hasModelValue ? qe(i.$slots, "label", {
key: 0,
label: i.currentPlaceholder,
value: i.modelValue
}, () => [
ke("span", null, wt(i.currentPlaceholder), 1)
]) : (fe(), Ce("span", { key: 1 }, wt(i.currentPlaceholder), 1))
], 2)) : Ve("v-if", !0)
], 2),
ke("div", {
ref: "suffixRef",
class: Le(i.nsSelect.e("suffix"))
}, [
i.iconComponent && !i.showClose ? (fe(), He(c, {
key: 0,
class: Le([i.nsSelect.e("caret"), i.nsSelect.e("icon"), i.iconReverse])
}, {
default: pe(() => [
(fe(), He(Fi(i.iconComponent)))
]),
_: 1
}, 8, ["class"])) : Ve("v-if", !0),
i.showClose && i.clearIcon ? (fe(), He(c, {
key: 1,
class: Le([
i.nsSelect.e("caret"),
i.nsSelect.e("icon"),
i.nsSelect.e("clear")
]),
onClick: i.handleClearClick
}, {
default: pe(() => [
(fe(), He(Fi(i.clearIcon)))
]),
_: 1
}, 8, ["class", "onClick"])) : Ve("v-if", !0),
i.validateState && i.validateIcon ? (fe(), He(c, {
key: 2,
class: Le([i.nsInput.e("icon"), i.nsInput.e("validateIcon")])
}, {
default: pe(() => [
(fe(), He(Fi(i.validateIcon)))
]),
_: 1
}, 8, ["class"])) : Ve("v-if", !0)
], 2)
], 10, ["onClick"])
];
}),
content: pe(() => [
se(p, { ref: "menuRef" }, {
default: pe(() => [
i.$slots.header ? (fe(), Ce("div", {
key: 0,
class: Le(i.nsSelect.be("dropdown", "header")),
onClick: ui(() => {
}, ["stop"])
}, [
qe(i.$slots, "header")
], 10, ["onClick"])) : Ve("v-if", !0),
Bt(se(u, {
id: i.contentId,
ref: "scrollbarRef",
tag: "ul",
"wrap-class": i.nsSelect.be("dropdown", "wrap"),
"view-class": i.nsSelect.be("dropdown", "list"),
class: Le([i.nsSelect.is("empty", i.filteredOptionsCount === 0)]),
role: "listbox",
"aria-label": i.ariaLabel,
"aria-orientation": "vertical"
}, {
default: pe(() => [
i.showNewOption ? (fe(), He(l, {
key: 0,
value: i.states.inputValue,
created: !0
}, null, 8, ["value"])) : Ve("v-if", !0),
se(h, null, {
default: pe(() => [
qe(i.$slots, "default")
]),
_: 3
})
]),
_: 3
}, 8, ["id", "wrap-class", "view-class", "class", "aria-label"]), [
[yi, i.states.options.size > 0 && !i.loading]
]),
i.$slots.loading && i.loading ? (fe(), Ce("div", {
key: 1,
class: Le(i.nsSelect.be("dropdown", "loading"))
}, [
qe(i.$slots, "loading")
], 2)) : i.loading || i.filteredOptionsCount === 0 ? (fe(), Ce("div", {
key: 2,
class: Le(i.nsSelect.be("dropdown", "empty"))
}, [
qe(i.$slots, "empty", {}, () => [
ke("span", null, wt(i.emptyText), 1)
])
], 2)) : Ve("v-if", !0),
i.$slots.footer ? (fe(), Ce("div", {
key: 3,
class: Le(i.nsSelect.be("dropdown", "footer")),
onClick: ui(() => {
}, ["stop"])
}, [
qe(i.$slots, "footer")
], 10, ["onClick"])) : Ve("v-if", !0)
]),
_: 3
}, 512)
]),
_: 3
}, 8, ["visible", "placement", "teleported", "popper-class", "popper-options", "fallback-placements", "effect", "transition", "persistent", "append-to", "onBeforeShow", "onHide"])
], 16, ["onMouseleave"])), [
[m, i.handleClickOutside, i.popperRef]
]);
}
var T3 = /* @__PURE__ */ at(M3, [["render", S3], ["__file", "select.vue"]]);
const E3 = Ie({
name: "ElOptionGroup",
componentName: "ElOptionGroup",
props: {
label: String,
disabled: Boolean
},
setup(i) {
const e = it("select"), t = Ae(null), r = si(), n = Ae([]);
pi(Ey, Yi({
...cn(i)
}));
const o = ce(() => n.value.some((l) => l.visible === !0)), a = (l) => {
var h, u;
return ((h = l.type) == null ? void 0 : h.name) === "ElOption" && !!((u = l.component) != null && u.proxy);
}, s = (l) => {
const h = Lr(l), u = [];
return h.forEach((p) => {
var m, g;
a(p) ? u.push(p.component.proxy) : (m = p.children) != null && m.length ? u.push(...s(p.children)) : (g = p.component) != null && g.subTree && u.push(...s(p.component.subTree));
}), u;
}, c = () => {
n.value = s(r.subTree);
};
return ni(() => {
c();
}), Gw(t, c, {
attributes: !0,
subtree: !0,
childList: !0
}), {
groupRef: t,
visible: o,
ns: e
};
}
});
function A3(i, e, t, r, n, o) {
return Bt((fe(), Ce("ul", {
ref: "groupRef",
class: Le(i.ns.be("group", "wrap"))
}, [
ke("li", {
class: Le(i.ns.be("group", "title"))
}, wt(i.label), 3),
ke("li", null, [
ke("ul", {
class: Le(i.ns.b("group"))
}, [
qe(i.$slots, "default")
], 2)
])
], 2)), [
[yi, i.visible]
]);
}
var Ay = /* @__PURE__ */ at(E3, [["render", A3], ["__file", "option-group.vue"]]);
const as = fi(T3, {
Option: Bp,
OptionGroup: Ay
}), ss = gn(Bp);
gn(Ay);
const C3 = ht({
trigger: Js.trigger,
placement: rh.placement,
disabled: Js.disabled,
visible: qi.visible,
transition: qi.transition,
popperOptions: rh.popperOptions,
tabindex: rh.tabindex,
content: qi.content,
popperStyle: qi.popperStyle,
popperClass: qi.popperClass,
enterable: {
...qi.enterable,
default: !0
},
effect: {
...qi.effect,
default: "light"
},
teleported: qi.teleported,
title: String,
width: {
type: [String, Number],
default: 150
},
offset: {
type: Number,
default: void 0
},
showAfter: {
type: Number,
default: 0
},
hideAfter: {
type: Number,
default: 200
},
autoClose: {
type: Number,
default: 0
},
showArrow: {
type: Boolean,
default: !0
},
persistent: {
type: Boolean,
default: !0
},
"onUpdate:visible": {
type: Function
}
}), L3 = {
"update:visible": (i) => fp(i),
"before-enter": () => !0,
"before-leave": () => !0,
"after-enter": () => !0,
"after-leave": () => !0
}, R3 = "onUpdate:visible", O3 = Ie({
name: "ElPopover"
}), P3 = /* @__PURE__ */ Ie({
...O3,
props: C3,
emits: L3,
setup(i, { expose: e, emit: t }) {
const r = i, n = ce(() => r[R3]), o = it("popover"), a = Ae(), s = ce(() => {
var y;
return (y = H(a)) == null ? void 0 : y.popperRef;
}), c = ce(() => [
{
width: qc(r.width)
},
r.popperStyle
]), l = ce(() => [o.b(), r.popperClass, { [o.m("plain")]: !!r.content }]), h = ce(() => r.transition === `${o.namespace.value}-fade-in-linear`), u = () => {
var y;
(y = a.value) == null || y.hide();
}, p = () => {
t("before-enter");
}, m = () => {
t("before-leave");
}, g = () => {
t("after-enter");
}, d = () => {
t("update:visible", !1), t("after-leave");
};
return e({
popperRef: s,
hide: u
}), (y, f) => (fe(), He(H(Np), Pr({
ref_key: "tooltipRef",
ref: a
}, 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": H(l),
"popper-style": H(c),
teleported: y.teleported,
persistent: y.persistent,
"gpu-acceleration": H(h),
"onUpdate:visible": H(n),
onBeforeShow: p,
onBeforeHide: m,
onShow: g,
onHide: d
}), {
content: pe(() => [
y.title ? (fe(), Ce("div", {
key: 0,
class: Le(H(o).e("title")),
role: "title"
}, wt(y.title), 3)) : Ve("v-if", !0),
qe(y.$slots, "default", {}, () => [
yt(wt(y.content), 1)
])
]),
default: pe(() => [
y.$slots.reference ? qe(y.$slots, "reference", { key: 0 }) : Ve("v-if", !0)
]),
_: 3
}, 16, ["trigger", "placement", "disabled", "visible", "transition", "popper-options", "tabindex", "content", "offset", "show-after", "hide-after", "auto-close", "show-arrow", "aria-label", "effect", "enterable", "popper-class", "popper-style", "teleported", "persistent", "gpu-acceleration", "onUpdate:visible"]));
}
});
var I3 = /* @__PURE__ */ at(P3, [["__file", "popover.vue"]]);
const ag = (i, e) => {
const t = e.arg || e.value, r = t == null ? void 0 : t.popperRef;
r && (r.triggerRef = i);
};
var D3 = {
mounted(i, e) {
ag(i, e);
},
updated(i, e) {
ag(i, e);
}
};
const N3 = "popover", B3 = wE(D3, N3), _u = fi(I3, {
directive: B3
}), Cy = Symbol("sliderContextKey"), k3 = ht({
modelValue: {
type: Xe([Number, Array]),
default: 0
},
id: {
type: String,
default: void 0
},
min: {
type: Number,
default: 0
},
max: {
type: Number,
default: 100
},
step: {
type: Number,
default: 1
},
showInput: Boolean,
showInputControls: {
type: Boolean,
default: !0
},
size: Da,
inputSize: Da,
showStops: Boolean,
showTooltip: {
type: Boolean,
default: !0
},
formatTooltip: {
type: Xe(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: Xe(Function),
default: void 0
},
tooltipClass: {
type: String,
default: void 0
},
placement: {
type: String,
values: rs,
default: "top"
},
marks: {
type: Xe(Object)
},
validateEvent: {
type: Boolean,
default: !0
},
...jo(["ariaLabel"])
}), nh = (i) => Mt(i) || zi(i) && i.every(Mt), F3 = {
[Dt]: nh,
[So]: nh,
[Qn]: nh
}, z3 = (i, e, t) => {
const r = Ae();
return ni(async () => {
i.range ? (Array.isArray(i.modelValue) ? (e.firstValue = Math.max(i.min, i.modelValue[0]), e.secondValue = Math.min(i.max, i.modelValue[1])) : (e.firstValue = i.min, e.secondValue = i.max), e.oldValue = [e.firstValue, e.secondValue]) : (typeof i.modelValue != "number" || Number.isNaN(i.modelValue) ? e.firstValue = i.min : e.firstValue = Math.min(i.max, Math.max(i.min, i.modelValue)), e.oldValue = e.firstValue), hi(window, "resize", t), await _t(), t();
}), {
sliderWrapper: r
};
}, U3 = (i) => ce(() => i.marks ? Object.keys(i.marks).map(Number.parseFloat).sort((e, t) => e - t).filter((e) => e <= i.max && e >= i.min).map((e) => ({
point: e,
position: (e - i.min) * 100 / (i.max - i.min),
mark: i.marks[e]
})) : []), V3 = (i, e, t) => {
const { form: r, formItem: n } = gl(), o = Pi(), a = Ae(), s = Ae(), c = {
firstButton: a,
secondButton: s
}, l = ce(() => i.disabled || (r == null ? void 0 : r.disabled) || !1), h = ce(() => Math.min(e.firstValue, e.secondValue)), u = ce(() => Math.max(e.firstValue, e.secondValue)), p = ce(() => i.range ? `${100 * (u.value - h.value) / (i.max - i.min)}%` : `${100 * (e.firstValue - i.min) / (i.max - i.min)}%`), m = ce(() => i.range ? `${100 * (h.value - i.min) / (i.max - i.min)}%` : "0%"), g = ce(() => i.vertical ? { height: i.height } : {}), d = ce(() => i.vertical ? {
height: p.value,
bottom: m.value
} : {
width: p.value,
left: m.value
}), y = () => {
o.value && (e.sliderSize = o.value[`client${i.vertical ? "Height" : "Width"}`]);
}, f = (E) => {
const S = i.min + E * (i.max - i.min) / 100;
if (!i.range)
return a;
let C;
return Math.abs(h.value - S) < Math.abs(u.value - S) ? C = e.firstValue < e.secondValue ? "firstButton" : "secondButton" : C = e.firstValue > e.secondValue ? "firstButton" : "secondButton", c[C];
}, v = (E) => {
const S = f(E);
return S.value.setPosition(E), S;
}, _ = (E) => {
e.firstValue = E ?? i.min, T(i.range ? [h.value, u.value] : E ?? i.min);
}, M = (E) => {
e.secondValue = E, i.range && T([h.value, u.value]);
}, T = (E) => {
t(Dt, E), t(So, E);
}, w = async () => {
await _t(), t(Qn, i.range ? [h.value, u.value] : i.modelValue);
}, b = (E) => {
var S, C, R, L, A, P;
if (l.value || e.dragging)
return;
y();
let O = 0;
if (i.vertical) {
const x = (R = (C = (S = E.touches) == null ? void 0 : S.item(0)) == null ? void 0 : C.clientY) != null ? R : E.clientY;
O = (o.value.getBoundingClientRect().bottom - x) / e.sliderSize * 100;
} else {
const x = (P = (A = (L = E.touches) == null ? void 0 : L.item(0)) == null ? void 0 : A.clientX) != null ? P : E.clientX, I = o.value.getBoundingClientRect().left;
O = (x - I) / e.sliderSize * 100;
}
if (!(O < 0 || O > 100))
return v(O);
};
return {
elFormItem: n,
slider: o,
firstButton: a,
secondButton: s,
sliderDisabled: l,
minValue: h,
maxValue: u,
runwayStyle: g,
barStyle: d,
resetSize: y,
setPosition: v,
emitChange: w,
onSliderWrapperPrevent: (E) => {
var S, C;
((S = c.firstButton.value) != null && S.dragging || (C = c.secondButton.value) != null && C.dragging) && E.preventDefault();
},
onSliderClick: (E) => {
b(E) && w();
},
onSliderDown: async (E) => {
const S = b(E);
S && (await _t(), S.value.onButtonDown(E));
},
onSliderMarkerDown: (E) => {
l.value || e.dragging || v(E);
},
setFirstValue: _,
setSecondValue: M
};
}, { left: H3, down: j3, right: G3, up: W3, home: $3, end: q3, pageUp: X3, pageDown: Z3 } = Ir, Y3 = (i, e, t) => {
const r = Ae(), n = Ae(!1), o = ce(() => e.value instanceof Function), a = ce(() => o.value && e.value(i.modelValue) || i.modelValue), s = ad(() => {
t.value && (n.value = !0);
}, 50), c = ad(() => {
t.value && (n.value = !1);
}, 50);
return {
tooltip: r,
tooltipVisible: n,
formatValue: a,
displayTooltip: s,
hideTooltip: c
};
}, J3 = (i, e, t) => {
const {
disabled: r,
min: n,
max: o,
step: a,
showTooltip: s,
precision: c,
sliderSize: l,
formatTooltip: h,
emitChange: u,
resetSize: p,
updateDragging: m
} = ct(Cy), { tooltip: g, tooltipVisible: d, formatValue: y, displayTooltip: f, hideTooltip: v } = Y3(i, h, s), _ = Ae(), M = ce(() => `${(i.modelValue - n.value) / (o.value - n.value) * 100}%`), T = ce(() => i.vertical ? { bottom: M.value } : { left: M.value }), w = () => {
e.hovering = !0, f();
}, b = () => {
e.hovering = !1, e.dragging || v();
}, E = (W) => {
r.value || (W.preventDefault(), N(W), window.addEventListener("mousemove", D), window.addEventListener("touchmove", D), window.addEventListener("mouseup", k), window.addEventListener("touchend", k), window.addEventListener("contextmenu", k), _.value.focus());
}, S = (W) => {
r.value || (e.newPosition = Number.parseFloat(M.value) + W / (o.value - n.value) * 100, F(e.newPosition), u());
}, C = () => {
S(-a.value);
}, R = () => {
S(a.value);
}, L = () => {
S(-a.value * 4);
}, A = () => {
S(a.value * 4);
}, P = () => {
r.value || (F(0), u());
}, O = () => {
r.value || (F(100), u());
}, x = (W) => {
let K = !0;
[H3, j3].includes(W.key) ? C() : [G3, W3].includes(W.key) ? R() : W.key === $3 ? P() : W.key === q3 ? O() : W.key === Z3 ? L() : W.key === X3 ? A() : K = !1, K && W.preventDefault();
}, I = (W) => {
let K, ne;
return W.type.startsWith("touch") ? (ne = W.touches[0].clientY, K = W.touches[0].clientX) : (ne = W.clientY, K = W.clientX), {
clientX: K,
clientY: ne
};
}, N = (W) => {
e.dragging = !0, e.isClick = !0;
const { clientX: K, clientY: ne } = I(W);
i.vertical ? e.startY = ne : e.startX = K, e.startPosition = Number.parseFloat(M.value), e.newPosition = e.startPosition;
}, D = (W) => {
if (e.dragging) {
e.isClick = !1, f(), p();
let K;
const { clientX: ne, clientY: q } = I(W);
i.vertical ? (e.currentY = q, K = (e.startY - e.currentY) / l.value * 100) : (e.currentX = ne, K = (e.currentX - e.startX) / l.value * 100), e.newPosition = e.startPosition + K, F(e.newPosition);
}
}, k = () => {
e.dragging && (setTimeout(() => {
e.dragging = !1, e.hovering || v(), e.isClick || F(e.newPosition), u();
}, 0), window.removeEventListener("mousemove", D), window.removeEventListener("touchmove", D), window.removeEventListener("mouseup", k), window.removeEventListener("touchend", k), window.removeEventListener("contextmenu", k));
}, F = async (W) => {
if (W === null || Number.isNaN(+W))
return;
W < 0 ? W = 0 : W > 100 && (W = 100);
const K = 100 / ((o.value - n.value) / a.value);
let ne = Math.round(W / K) * K * (o.value - n.value) * 0.01 + n.value;
ne = Number.parseFloat(ne.toFixed(c.value)), ne !== i.modelValue && t(Dt, ne), !e.dragging && i.modelValue !== e.oldValue && (e.oldValue = i.modelValue), await _t(), e.dragging && f(), g.value.updatePopper();
};
return Je(() => e.dragging, (W) => {
m(W);
}), hi(_, "touchstart", E, { passive: !1 }), {
disabled: r,
button: _,
tooltip: g,
tooltipVisible: d,
showTooltip: s,
wrapperStyle: T,
formatValue: y,
handleMouseEnter: w,
handleMouseLeave: b,
onButtonDown: E,
onKeyDown: x,
setPosition: F
};
}, K3 = (i, e, t, r) => ({
stops: ce(() => {
if (!i.showStops || i.min > i.max)
return [];
if (i.step === 0)
return Qt("ElSlider", "step should not be 0."), [];
const n = (i.max - i.min) / i.step, o = 100 * i.step / (i.max - i.min), a = Array.from({ length: n - 1 }).map((s, c) => (c + 1) * o);
return i.range ? a.filter((s) => s < 100 * (t.value - i.min) / (i.max - i.min) || s > 100 * (r.value - i.min) / (i.max - i.min)) : a.filter((s) => s > 100 * (e.firstValue - i.min) / (i.max - i.min));
}),
getStopStyle: (n) => i.vertical ? { bottom: `${n}%` } : { left: `${n}%` }
}), Q3 = (i, e, t, r, n, o) => {
const a = (l) => {
n(Dt, l), n(So, l);
}, s = () => i.range ? ![t.value, r.value].every((l, h) => l === e.oldValue[h]) : i.modelValue !== e.oldValue, c = () => {
var l, h;
i.min > i.max && is("Slider", "min should not be greater than max.");
const u = i.modelValue;
i.range && Array.isArray(u) ? u[1] < i.min ? a([i.min, i.min]) : u[0] > i.max ? a([i.max, i.max]) : u[0] < i.min ? a([i.min, u[1]]) : u[1] > i.max ? a([u[0], i.max]) : (e.firstValue = u[0], e.secondValue = u[1], s() && (i.validateEvent && ((l = o == null ? void 0 : o.validate) == null || l.call(o, "change").catch((p) => Qt(p))), e.oldValue = u.slice())) : !i.range && typeof u == "number" && !Number.isNaN(u) && (u < i.min ? a(i.min) : u > i.max ? a(i.max) : (e.firstValue = u, s() && (i.validateEvent && ((h = o == null ? void 0 : o.validate) == null || h.call(o, "change").catch((p) => Qt(p))), e.oldValue = u)));
};
c(), Je(() => e.dragging, (l) => {
l || c();
}), Je(() => i.modelValue, (l, h) => {
e.dragging || Array.isArray(l) && Array.isArray(h) && l.every((u, p) => u === h[p]) && e.firstValue === l[0] && e.secondValue === l[1] || c();
}, {
deep: !0
}), Je(() => [i.min, i.max], () => {
c();
});
}, eR = ht({
modelValue: {
type: Number,
default: 0
},
vertical: Boolean,
tooltipClass: String,
placement: {
type: String,
values: rs,
default: "top"
}
}), tR = {
[Dt]: (i) => Mt(i)
}, iR = Ie({
name: "ElSliderButton"
}), rR = /* @__PURE__ */ Ie({
...iR,
props: eR,
emits: tR,
setup(i, { expose: e, emit: t }) {
const r = i, n = it("slider"), o = Yi({
hovering: !1,
dragging: !1,
isClick: !1,
startX: 0,
currentX: 0,
startY: 0,
currentY: 0,
startPosition: 0,
newPosition: 0,
oldValue: r.modelValue
}), {
disabled: a,
button: s,
tooltip: c,
showTooltip: l,
tooltipVisible: h,
wrapperStyle: u,
formatValue: p,
handleMouseEnter: m,
handleMouseLeave: g,
onButtonDown: d,
onKeyDown: y,
setPosition: f
} = J3(r, o, t), { hovering: v, dragging: _ } = cn(o);
return e({
onButtonDown: d,
onKeyDown: y,
setPosition: f,
hovering: v,
dragging: _
}), (M, T) => (fe(), Ce("div", {
ref_key: "button",
ref: s,
class: Le([H(n).e("button-wrapper"), { hover: H(v), dragging: H(_) }]),
style: It(H(u)),
tabindex: H(a) ? -1 : 0,
onMouseenter: H(m),
onMouseleave: H(g),
onMousedown: H(d),
onFocus: H(m),
onBlur: H(g),
onKeydown: H(y)
}, [
se(H(Np), {
ref_key: "tooltip",
ref: c,
visible: H(h),
placement: M.placement,
"fallback-placements": ["top", "bottom", "right", "left"],
"stop-popper-mouse-event": !1,
"popper-class": M.tooltipClass,
disabled: !H(l),
persistent: ""
}, {
content: pe(() => [
ke("span", null, wt(H(p)), 1)
]),
default: pe(() => [
ke("div", {
class: Le([H(n).e("button"), { hover: H(v), dragging: H(_) }])
}, null, 2)
]),
_: 1
}, 8, ["visible", "placement", "popper-class", "disabled"])
], 46, ["tabindex", "onMouseenter", "onMouseleave", "onMousedown", "onFocus", "onBlur", "onKeydown"]));
}
});
var sg = /* @__PURE__ */ at(rR, [["__file", "button.vue"]]);
const nR = ht({
mark: {
type: Xe([String, Object]),
default: void 0
}
});
var oR = Ie({
name: "ElSliderMarker",
props: nR,
setup(i) {
const e = it("slider"), t = ce(() => Ii(i.mark) ? i.mark : i.mark.label), r = ce(() => Ii(i.mark) ? void 0 : i.mark.style);
return () => ba("div", {
class: e.e("marks-text"),
style: r.value
}, t.value);
}
});
const aR = Ie({
name: "ElSlider"
}), sR = /* @__PURE__ */ Ie({
...aR,
props: k3,
emits: F3,
setup(i, { expose: e, emit: t }) {
const r = i, n = it("slider"), { t: o } = mu(), a = Yi({
firstValue: 0,
secondValue: 0,
oldValue: 0,
dragging: !1,
sliderSize: 1
}), {
elFormItem: s,
slider: c,
firstButton: l,
secondButton: h,
sliderDisabled: u,
minValue: p,
maxValue: m,
runwayStyle: g,
barStyle: d,
resetSize: y,
emitChange: f,
onSliderWrapperPrevent: v,
onSliderClick: _,
onSliderDown: M,
onSliderMarkerDown: T,
setFirstValue: w,
setSecondValue: b
} = V3(r, a, t), { stops: E, getStopStyle: S } = K3(r, a, p, m), { inputId: C, isLabeledByFormItem: R } = Lp(r, {
formItemContext: s
}), L = ns(), A = ce(() => r.inputSize || L.value), P = ce(() => r.ariaLabel || o("el.slider.defaultLabel", {
min: r.min,
max: r.max
})), O = ce(() => r.range ? r.rangeStartLabel || o("el.slider.defaultRangeStartLabel") : P.value), x = ce(() => r.formatValueText ? r.formatValueText(K.value) : `${K.value}`), I = ce(() => r.rangeEndLabel || o("el.slider.defaultRangeEndLabel")), N = ce(() => r.formatValueText ? r.formatValueText(ne.value) : `${ne.value}`), D = ce(() => [
n.b(),
n.m(L.value),
n.is("vertical", r.vertical),
{ [n.m("with-input")]: r.showInput }
]), k = U3(r);
Q3(r, a, p, m, t, s);
const F = ce(() => {
const j = [r.min, r.max, r.step].map((Q) => {
const Y = `${Q}`.split(".")[1];
return Y ? Y.length : 0;
});
return Math.max.apply(null, j);
}), { sliderWrapper: W } = z3(r, a, y), { firstValue: K, secondValue: ne, sliderSize: q } = cn(a), z = (j) => {
a.dragging = j;
};
return hi(W, "touchstart", v, {
passive: !1
}), hi(W, "touchmove", v, {
passive: !1
}), pi(Cy, {
...cn(r),
sliderSize: q,
disabled: u,
precision: F,
emitChange: f,
resetSize: y,
updateDragging: z
}), e({
onSliderClick: _
}), (j, Q) => {
var Y, ee;
return fe(), Ce("div", {
id: j.range ? H(C) : void 0,
ref_key: "sliderWrapper",
ref: W,
class: Le(H(D)),
role: j.range ? "group" : void 0,
"aria-label": j.range && !H(R) ? H(P) : void 0,
"aria-labelledby": j.range && H(R) ? (Y = H(s)) == null ? void 0 : Y.labelId : void 0
}, [
ke("div", {
ref_key: "slider",
ref: c,
class: Le([
H(n).e("runway"),
{ "show-input": j.showInput && !j.range },
H(n).is("disabled", H(u))
]),
style: It(H(g)),
onMousedown: H(M),
onTouchstartPassive: H(M)
}, [
ke("div", {
class: Le(H(n).e("bar")),
style: It(H(d))
}, null, 6),
se(sg, {
id: j.range ? void 0 : H(C),
ref_key: "firstButton",
ref: l,
"model-value": H(K),
vertical: j.vertical,
"tooltip-class": j.tooltipClass,
placement: j.placement,
role: "slider",
"aria-label": j.range || !H(R) ? H(O) : void 0,
"aria-labelledby": !j.range && H(R) ? (ee = H(s)) == null ? void 0 : ee.labelId : void 0,
"aria-valuemin": j.min,
"aria-valuemax": j.range ? H(ne) : j.max,
"aria-valuenow": H(K),
"aria-valuetext": H(x),
"aria-orientation": j.vertical ? "vertical" : "horizontal",
"aria-disabled": H(u),
"onUpdate:modelValue": H(w)
}, 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"]),
j.range ? (fe(), He(sg, {
key: 0,
ref_key: "secondButton",
ref: h,
"model-value": H(ne),
vertical: j.vertical,
"tooltip-class": j.tooltipClass,
placement: j.placement,
role: "slider",
"aria-label": H(I),
"aria-valuemin": H(K),
"aria-valuemax": j.max,
"aria-valuenow": H(ne),
"aria-valuetext": H(N),
"aria-orientation": j.vertical ? "vertical" : "horizontal",
"aria-disabled": H(u),
"onUpdate:modelValue": H(b)
}, null, 8, ["model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue"])) : Ve("v-if", !0),
j.showStops ? (fe(), Ce("div", { key: 1 }, [
(fe(!0), Ce(Gt, null, rr(H(E), (G, J) => (fe(), Ce("div", {
key: J,
class: Le(H(n).e("stop")),
style: It(H(S)(G))
}, null, 6))), 128))
])) : Ve("v-if", !0),
H(k).length > 0 ? (fe(), Ce(Gt, { key: 2 }, [
ke("div", null, [
(fe(!0), Ce(Gt, null, rr(H(k), (G, J) => (fe(), Ce("div", {
key: J,
style: It(H(S)(G.position)),
class: Le([H(n).e("stop"), H(n).e("marks-stop")])
}, null, 6))), 128))
]),
ke("div", {
class: Le(H(n).e("marks"))
}, [
(fe(!0), Ce(Gt, null, rr(H(k), (G, J) => (fe(), He(H(oR), {
key: J,
mark: G.mark,
style: It(H(S)(G.position)),
onMousedown: ui((re) => H(T)(G.position), ["stop"])
}, null, 8, ["mark", "style", "onMousedown"]))), 128))
], 2)
], 64)) : Ve("v-if", !0)
], 46, ["onMousedown", "onTouchstartPassive"]),
j.showInput && !j.range ? (fe(), He(H(yn), {
key: 0,
ref: "input",
"model-value": H(K),
class: Le(H(n).e("input")),
step: j.step,
disabled: H(u),
controls: j.showInputControls,
min: j.min,
max: j.max,
precision: H(F),
debounce: j.debounce,
size: H(A),
"onUpdate:modelValue": H(w),
onChange: H(f)
}, null, 8, ["model-value", "class", "step", "disabled", "controls", "min", "max", "precision", "debounce", "size", "onUpdate:modelValue", "onChange"])) : Ve("v-if", !0)
], 10, ["id", "role", "aria-label", "aria-labelledby"]);
};
}
});
var lR = /* @__PURE__ */ at(sR, [["__file", "slider.vue"]]);
const lr = fi(lR), Mu = Symbol("tabsRootContextKey"), cR = ht({
tabs: {
type: Xe(Array),
default: () => en([])
}
}), Ly = "ElTabBar", uR = Ie({
name: Ly
}), hR = /* @__PURE__ */ Ie({
...uR,
props: cR,
setup(i, { expose: e }) {
const t = i, r = si(), n = ct(Mu);
n || is(Ly, "");
const o = it("tabs"), a = Ae(), s = Ae(), c = () => {
let m = 0, g = 0;
const d = ["top", "bottom"].includes(n.props.tabPosition) ? "width" : "height", y = d === "width" ? "x" : "y", f = y === "x" ? "left" : "top";
return t.tabs.every((v) => {
var _, M;
const T = (M = (_ = r.parent) == null ? void 0 : _.refs) == null ? void 0 : M[`tab-${v.uid}`];
if (!T)
return !1;
if (!v.active)
return !0;
m = T[`offset${kn(f)}`], g = T[`client${kn(d)}`];
const w = window.getComputedStyle(T);
return d === "width" && (g -= Number.parseFloat(w.paddingLeft) + Number.parseFloat(w.paddingRight), m += Number.parseFloat(w.paddingLeft)), !1;
}), {
[d]: `${g}px`,
transform: `translate${kn(y)}(${m}px)`
};
}, l = () => s.value = c(), h = [], u = () => {
var m;
h.forEach((d) => d.stop()), h.length = 0;
const g = (m = r.parent) == null ? void 0 : m.refs;
if (g) {
for (const d in g)
if (d.startsWith("tab-")) {
const y = g[d];
y && h.push(ir(y, l));
}
}
};
Je(() => t.tabs, async () => {
await _t(), l(), u();
}, { immediate: !0 });
const p = ir(a, () => l());
return sr(() => {
h.forEach((m) => m.stop()), h.length = 0, p.stop();
}), e({
ref: a,
update: l
}), (m, g) => (fe(), Ce("div", {
ref_key: "barRef",
ref: a,
class: Le([H(o).e("active-bar"), H(o).is(H(n).props.tabPosition)]),
style: It(s.value)
}, null, 6));
}
});
var dR = /* @__PURE__ */ at(hR, [["__file", "tab-bar.vue"]]);
const pR = ht({
panes: {
type: Xe(Array),
default: () => en([])
},
currentName: {
type: [String, Number],
default: ""
},
editable: Boolean,
type: {
type: String,
values: ["card", "border-card", ""],
default: ""
},
stretch: Boolean
}), fR = {
tabClick: (i, e, t) => t instanceof Event,
tabRemove: (i, e) => e instanceof Event
}, lg = "ElTabNav", mR = Ie({
name: lg,
props: pR,
emits: fR,
setup(i, {
expose: e,
emit: t
}) {
const r = ct(Mu);
r || is(lg, "");
const n = it("tabs"), o = kw(), a = Yw(), s = Ae(), c = Ae(), l = Ae(), h = Ae(), u = Ae(!1), p = Ae(0), m = Ae(!1), g = Ae(!0), d = ce(() => ["top", "bottom"].includes(r.props.tabPosition) ? "width" : "height"), y = ce(() => ({
transform: `translate${d.value === "width" ? "X" : "Y"}(-${p.value}px)`
})), f = () => {
if (!s.value)
return;
const E = s.value[`offset${kn(d.value)}`], S = p.value;
if (!S)
return;
const C = S > E ? S - E : 0;
p.value = C;
}, v = () => {
if (!s.value || !c.value)
return;
const E = c.value[`offset${kn(d.value)}`], S = s.value[`offset${kn(d.value)}`], C = p.value;
if (E - C <= S)
return;
const R = E - C > S * 2 ? C + S : E - S;
p.value = R;
}, _ = async () => {
const E = c.value;
if (!u.value || !l.value || !s.value || !E)
return;
await _t();
const S = l.value.querySelector(".is-active");
if (!S)
return;
const C = s.value, R = ["top", "bottom"].includes(r.props.tabPosition), L = S.getBoundingClientRect(), A = C.getBoundingClientRect(), P = R ? E.offsetWidth - A.width : E.offsetHeight - A.height, O = p.value;
let x = O;
R ? (L.left < A.left && (x = O - (A.left - L.left)), L.right > A.right && (x = O + L.right - A.right)) : (L.top < A.top && (x = O - (A.top - L.top)), L.bottom > A.bottom && (x = O + (L.bottom - A.bottom))), x = Math.max(x, 0), p.value = Math.min(x, P);
}, M = () => {
var E;
if (!c.value || !s.value)
return;
i.stretch && ((E = h.value) == null || E.update());
const S = c.value[`offset${kn(d.value)}`], C = s.value[`offset${kn(d.value)}`], R = p.value;
C < S ? (u.value = u.value || {}, u.value.prev = R, u.value.next = R + C < S, S - R < C && (p.value = S - C)) : (u.value = !1, R > 0 && (p.value = 0));
}, T = (E) => {
const S = E.code, {
up: C,
down: R,
left: L,
right: A
} = Ir;
if (![C, R, L, A].includes(S))
return;
const P = Array.from(E.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")), O = P.indexOf(E.target);
let x;
S === L || S === C ? O === 0 ? x = P.length - 1 : x = O - 1 : O < P.length - 1 ? x = O + 1 : x = 0, P[x].focus({
preventScroll: !0
}), P[x].click(), w();
}, w = () => {
g.value && (m.value = !0);
}, b = () => m.value = !1;
return Je(o, (E) => {
E === "hidden" ? g.value = !1 : E === "visible" && setTimeout(() => g.value = !0, 50);
}), Je(a, (E) => {
E ? setTimeout(() => g.value = !0, 50) : g.value = !1;
}), ir(l, M), ni(() => setTimeout(() => _(), 0)), rp(() => M()), e({
scrollToActiveTab: _,
removeFocus: b
}), () => {
const E = u.value ? [se("span", {
class: [n.e("nav-prev"), n.is("disabled", !u.value.prev)],
onClick: f
}, [se(kt, null, {
default: () => [se(Wn, null, null)]
})]), se("span", {
class: [n.e("nav-next"), n.is("disabled", !u.value.next)],
onClick: v
}, [se(kt, null, {
default: () => [se($n, null, null)]
})])] : null, S = i.panes.map((C, R) => {
var L, A, P, O;
const x = C.uid, I = C.props.disabled, N = (A = (L = C.props.name) != null ? L : C.index) != null ? A : `${R}`, D = !I && (C.isClosable || i.editable);
C.index = `${R}`;
const k = D ? se(kt, {
class: "is-icon-close",
onClick: (K) => t("tabRemove", C, K)
}, {
default: () => [se(ld, null, null)]
}) : null, F = ((O = (P = C.slots).label) == null ? void 0 : O.call(P)) || C.props.label, W = !I && C.active ? 0 : -1;
return se("div", {
ref: `tab-${x}`,
class: [n.e("item"), n.is(r.props.tabPosition), n.is("active", C.active), n.is("disabled", I), n.is("closable", D), n.is("focus", m.value)],
id: `tab-${N}`,
key: `tab-${x}`,
"aria-controls": `pane-${N}`,
role: "tab",
"aria-selected": C.active,
tabindex: W,
onFocus: () => w(),
onBlur: () => b(),
onClick: (K) => {
b(), t("tabClick", C, N, K);
},
onKeydown: (K) => {
D && (K.code === Ir.delete || K.code === Ir.backspace) && t("tabRemove", C, K);
}
}, [F, k]);
});
return se("div", {
ref: l,
class: [n.e("nav-wrap"), n.is("scrollable", !!u.value), n.is(r.props.tabPosition)]
}, [E, se("div", {
class: n.e("nav-scroll"),
ref: s
}, [se("div", {
class: [n.e("nav"), n.is(r.props.tabPosition), n.is("stretch", i.stretch && ["top", "bottom"].includes(r.props.tabPosition))],
ref: c,
style: y.value,
role: "tablist",
onKeydown: T
}, [i.type ? null : se(dR, {
ref: h,
tabs: [...i.panes]
}, null), S])])]);
};
}
}), gR = ht({
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: Xe(Function),
default: () => !0
},
stretch: Boolean
}), oh = (i) => Ii(i) || Mt(i), vR = {
[Dt]: (i) => oh(i),
tabClick: (i, e) => e instanceof Event,
tabChange: (i) => oh(i),
edit: (i, e) => ["remove", "add"].includes(e),
tabRemove: (i) => oh(i),
tabAdd: () => !0
}, yR = Ie({
name: "ElTabs",
props: gR,
emits: vR,
setup(i, {
emit: e,
slots: t,
expose: r
}) {
var n;
const o = it("tabs"), a = ce(() => ["left", "right"].includes(i.tabPosition)), {
children: s,
addChild: c,
removeChild: l
} = ZA(si(), "ElTabPane"), h = Ae(), u = Ae((n = i.modelValue) != null ? n : "0"), p = async (f, v = !1) => {
var _, M, T;
if (!(u.value === f || vr(f)))
try {
await ((_ = i.beforeLeave) == null ? void 0 : _.call(i, f, u.value)) !== !1 && (u.value = f, v && (e(Dt, f), e("tabChange", f)), (T = (M = h.value) == null ? void 0 : M.removeFocus) == null || T.call(M));
} catch {
}
}, m = (f, v, _) => {
f.props.disabled || (p(v, !0), e("tabClick", f, _));
}, g = (f, v) => {
f.props.disabled || vr(f.props.name) || (v.stopPropagation(), e("edit", f.props.name, "remove"), e("tabRemove", f.props.name));
}, d = () => {
e("edit", void 0, "add"), e("tabAdd");
};
Je(() => i.modelValue, (f) => p(f)), Je(u, async () => {
var f;
await _t(), (f = h.value) == null || f.scrollToActiveTab();
}), pi(Mu, {
props: i,
currentName: u,
registerPane: (f) => {
s.value.push(f);
},
sortPane: c,
unregisterPane: l
}), r({
currentName: u
});
const y = ({
render: f
}) => f();
return () => {
const f = t["add-icon"], v = i.editable || i.addable ? se("div", {
class: [o.e("new-tab"), a.value && o.e("new-tab-vertical")],
tabindex: "0",
onClick: d,
onKeydown: (T) => {
T.code === Ir.enter && d();
}
}, [f ? qe(t, "add-icon") : se(kt, {
class: o.is("icon-plus")
}, {
default: () => [se(pu, null, null)]
})]) : null, _ = se("div", {
class: [o.e("header"), a.value && o.e("header-vertical"), o.is(i.tabPosition)]
}, [se(y, {
render: () => {
const T = s.value.some((w) => w.slots.label);
return se(mR, {
ref: h,
currentName: u.value,
editable: i.editable,
type: i.type,
panes: s.value,
stretch: i.stretch,
onTabClick: m,
onTabRemove: g
}, {
$stable: !T
});
}
}, null), v]), M = se("div", {
class: o.e("content")
}, [qe(t, "default")]);
return se("div", {
class: [o.b(), o.m(i.tabPosition), {
[o.m("card")]: i.type === "card",
[o.m("border-card")]: i.type === "border-card"
}]
}, [M, _]);
};
}
}), bR = ht({
label: {
type: String,
default: ""
},
name: {
type: [String, Number]
},
closable: Boolean,
disabled: Boolean,
lazy: Boolean
}), Ry = "ElTabPane", xR = Ie({
name: Ry
}), wR = /* @__PURE__ */ Ie({
...xR,
props: bR,
setup(i) {
const e = i, t = si(), r = au(), n = ct(Mu);
n || is(Ry, "usage: ");
const o = it("tab-pane"), a = Ae(), s = ce(() => e.closable || n.props.closable), c = jf(() => {
var m;
return n.currentName.value === ((m = e.name) != null ? m : a.value);
}), l = Ae(c.value), h = ce(() => {
var m;
return (m = e.name) != null ? m : a.value;
}), u = jf(() => !e.lazy || l.value || c.value);
Je(c, (m) => {
m && (l.value = !0);
});
const p = Yi({
uid: t.uid,
slots: r,
props: e,
paneName: h,
active: c,
index: a,
isClosable: s
});
return n.registerPane(p), ni(() => {
n.sortPane(p);
}), s0(() => {
n.unregisterPane(p.uid);
}), (m, g) => H(u) ? Bt((fe(), Ce("div", {
key: 0,
id: `pane-${H(h)}`,
class: Le(H(o).b()),
role: "tabpanel",
"aria-hidden": !H(c),
"aria-labelledby": `tab-${H(h)}`
}, [
qe(m.$slots, "default")
], 10, ["id", "aria-hidden", "aria-labelledby"])), [
[yi, H(c)]
]) : Ve("v-if", !0);
}
});
var Oy = /* @__PURE__ */ at(wR, [["__file", "tab-pane.vue"]]);
const Py = fi(yR, {
TabPane: Oy
}), Iy = gn(Oy);
function _R(i) {
let e;
const t = Ae(!1), r = Yi({
...i,
originalPosition: "",
originalOverflow: "",
visible: !1
});
function n(p) {
r.text = p;
}
function o() {
const p = r.parent, m = u.ns;
if (!p.vLoadingAddClassList) {
let g = p.getAttribute("loading-number");
g = Number.parseInt(g) - 1, g ? p.setAttribute("loading-number", g.toString()) : ($c(p, m.bm("parent", "relative")), p.removeAttribute("loading-number")), $c(p, m.bm("parent", "hidden"));
}
a(), h.unmount();
}
function a() {
var p, m;
(m = (p = u.$el) == null ? void 0 : p.parentNode) == null || m.removeChild(u.$el);
}
function s() {
var p;
i.beforeClose && !i.beforeClose() || (t.value = !0, clearTimeout(e), e = setTimeout(c, 400), r.visible = !1, (p = i.closed) == null || p.call(i));
}
function c() {
if (!t.value)
return;
const p = r.parent;
t.value = !1, p.vLoadingAddClassList = void 0, o();
}
const l = Ie({
name: "ElLoading",
setup(p, { expose: m }) {
const { ns: g, zIndex: d } = r2("loading");
return m({
ns: g,
zIndex: d
}), () => {
const y = r.spinner || r.svg, f = ba("svg", {
class: "circular",
viewBox: r.svgViewBox ? r.svgViewBox : "0 0 50 50",
...y ? { innerHTML: y } : {}
}, [
ba("circle", {
class: "path",
cx: "25",
cy: "25",
r: "20",
fill: "none"
})
]), v = r.text ? ba("p", { class: g.b("text") }, [r.text]) : void 0;
return ba(hl, {
name: g.b("fade"),
onAfterLeave: c
}, {
default: pe(() => [
Bt(se("div", {
style: {
backgroundColor: r.background || ""
},
class: [
g.b("mask"),
r.customClass,
r.fullscreen ? "is-fullscreen" : ""
]
}, [
ba("div", {
class: g.b("spinner")
}, [f, v])
]), [[yi, r.visible]])
])
});
};
}
}), h = xw(l), u = h.mount(document.createElement("div"));
return {
...cn(r),
setText: n,
removeElLoadingChild: a,
close: s,
handleAfterLeave: c,
vm: u,
get $el() {
return u.$el;
}
};
}
let Hl;
const md = function(i = {}) {
if (!ii)
return;
const e = MR(i);
if (e.fullscreen && Hl)
return Hl;
const t = _R({
...e,
closed: () => {
var n;
(n = e.closed) == null || n.call(e), e.fullscreen && (Hl = void 0);
}
});
SR(e, e.parent, t), cg(e, e.parent, t), e.parent.vLoadingAddClassList = () => cg(e, e.parent, t);
let r = e.parent.getAttribute("loading-number");
return r ? r = `${Number.parseInt(r) + 1}` : r = "1", e.parent.setAttribute("loading-number", r), e.parent.appendChild(t.$el), _t(() => t.visible.value = e.visible), e.fullscreen && (Hl = t), t;
}, MR = (i) => {
var e, t, r, n;
let o;
return Ii(i.target) ? o = (e = document.querySelector(i.target)) != null ? e : document.body : o = i.target || document.body, {
parent: o === document.body || i.body ? document.body : o,
background: i.background || "",
svg: i.svg || "",
svgViewBox: i.svgViewBox || "",
spinner: i.spinner || !1,
text: i.text || "",
fullscreen: o === document.body && ((t = i.fullscreen) != null ? t : !0),
lock: (r = i.lock) != null ? r : !1,
customClass: i.customClass || "",
visible: (n = i.visible) != null ? n : !0,
beforeClose: i.beforeClose,
closed: i.closed,
target: o
};
}, SR = async (i, e, t) => {
const { nextZIndex: r } = t.vm.zIndex || t.vm._.exposed.zIndex, n = {};
if (i.fullscreen)
t.originalPosition.value = vs(document.body, "position"), t.originalOverflow.value = vs(document.body, "overflow"), n.zIndex = r();
else if (i.parent === document.body) {
t.originalPosition.value = vs(document.body, "position"), await _t();
for (const o of ["top", "left"]) {
const a = o === "top" ? "scrollTop" : "scrollLeft";
n[o] = `${i.target.getBoundingClientRect()[o] + document.body[a] + document.documentElement[a] - Number.parseInt(vs(document.body, `margin-${o}`), 10)}px`;
}
for (const o of ["height", "width"])
n[o] = `${i.target.getBoundingClientRect()[o]}px`;
} else
t.originalPosition.value = vs(e, "position");
for (const [o, a] of Object.entries(n))
t.$el.style[o] = a;
}, cg = (i, e, t) => {
const r = t.vm.ns || t.vm._.exposed.ns;
["absolute", "fixed", "sticky"].includes(t.originalPosition.value) ? $c(e, r.bm("parent", "relative")) : Em(e, r.bm("parent", "relative")), i.fullscreen && i.lock ? Em(e, r.bm("parent", "hidden")) : $c(e, r.bm("parent", "hidden"));
}, zc = Symbol("ElLoading"), ug = (i, e) => {
var t, r, n, o;
const a = e.instance, s = (p) => Oi(e.value) ? e.value[p] : void 0, c = (p) => {
const m = Ii(p) && (a == null ? void 0 : a[p]) || p;
return m && Ae(m);
}, l = (p) => c(s(p) || i.getAttribute(`element-loading-${n_(p)}`)), h = (t = s("fullscreen")) != null ? t : e.modifiers.fullscreen, u = {
text: l("text"),
svg: l("svg"),
svgViewBox: l("svgViewBox"),
spinner: l("spinner"),
background: l("background"),
customClass: l("customClass"),
fullscreen: h,
target: (r = s("target")) != null ? r : h ? void 0 : i,
body: (n = s("body")) != null ? n : e.modifiers.body,
lock: (o = s("lock")) != null ? o : e.modifiers.lock
};
i[zc] = {
options: u,
instance: md(u)
};
}, TR = (i, e) => {
for (const t of Object.keys(e))
Ro(e[t]) && (e[t].value = i[t]);
}, gd = {
mounted(i, e) {
e.value && ug(i, e);
},
updated(i, e) {
const t = i[zc];
e.oldValue !== e.value && (e.value && !e.oldValue ? ug(i, e) : e.value && e.oldValue ? Oi(e.value) && TR(e.value, t.options) : t == null || t.instance.close());
},
unmounted(i) {
var e;
(e = i[zc]) == null || e.instance.close(), i[zc] = null;
}
}, ER = {
install(i) {
i.directive("loading", gd), i.config.globalProperties.$loading = md;
},
directive: gd,
service: md
};
var Dy = { exports: {} }, AR = {}, hg;
function CR() {
return hg || (hg = 1, function(i) {
var e = function() {
try {
return !!Symbol.iterator;
} catch {
return !1;
}
}, t = e(), r = function(l) {
var h = {
next: function() {
var u = l.shift();
return { done: u === void 0, value: u };
}
};
return t && (h[Symbol.iterator] = function() {
return h;
}), h;
}, n = function(l) {
return encodeURIComponent(l).replace(/%20/g, "+");
}, o = function(l) {
return decodeURIComponent(String(l).replace(/\+/g, " "));
}, a = function() {
var l = function(u) {
Object.defineProperty(this, "_entries", { writable: !0, value: {} });
var p = typeof u;
if (p !== "undefined") if (p === "string")
u !== "" && this._fromString(u);
else if (u instanceof l) {
var m = this;
u.forEach(function(f, v) {
m.append(v, f);
});
} else if (u !== null && p === "object")
if (Object.prototype.toString.call(u) === "[object Array]")
for (var g = 0; g < u.length; g++) {
var d = u[g];
if (Object.prototype.toString.call(d) === "[object Array]" || d.length !== 2)
this.append(d[0], d[1]);
else
throw new TypeError("Expected [string, any] as entry at index " + g + " of URLSearchParams's input");
}
else
for (var y in u)
u.hasOwnProperty(y) && this.append(y, u[y]);
else
throw new TypeError("Unsupported input's type for URLSearchParams");
}, h = l.prototype;
h.append = function(u, p) {
u in this._entries ? this._entries[u].push(String(p)) : this._entries[u] = [String(p)];
}, h.delete = function(u) {
delete this._entries[u];
}, h.get = function(u) {
return u in this._entries ? this._entries[u][0] : null;
}, h.getAll = function(u) {
return u in this._entries ? this._entries[u].slice(0) : [];
}, h.has = function(u) {
return u in this._entries;
}, h.set = function(u, p) {
this._entries[u] = [String(p)];
}, h.forEach = function(u, p) {
var m;
for (var g in this._entries)
if (this._entries.hasOwnProperty(g)) {
m = this._entries[g];
for (var d = 0; d < m.length; d++)
u.call(p, m[d], g, this);
}
}, h.keys = function() {
var u = [];
return this.forEach(function(p, m) {
u.push(m);
}), r(u);
}, h.values = function() {
var u = [];
return this.forEach(function(p) {
u.push(p);
}), r(u);
}, h.entries = function() {
var u = [];
return this.forEach(function(p, m) {
u.push([m, p]);
}), r(u);
}, t && (h[Symbol.iterator] = h.entries), h.toString = function() {
var u = [];
return this.forEach(function(p, m) {
u.push(n(m) + "=" + n(p));
}), u.join("&");
}, i.URLSearchParams = l;
}, s = function() {
try {
var l = i.URLSearchParams;
return new l("?a=1").toString() === "a=1" && typeof l.prototype.set == "function" && typeof l.prototype.entries == "function";
} catch {
return !1;
}
};
s() || a();
var c = i.URLSearchParams.prototype;
typeof c.sort != "function" && (c.sort = function() {
var l = this, h = [];
this.forEach(function(p, m) {
h.push([m, p]), l._entries || l.delete(m);
}), h.sort(function(p, m) {
return p[0] < m[0] ? -1 : p[0] > m[0] ? 1 : 0;
}), l._entries && (l._entries = {});
for (var u = 0; u < h.length; u++)
this.append(h[u][0], h[u][1]);
}), typeof c._fromString != "function" && Object.defineProperty(c, "_fromString", {
enumerable: !1,
configurable: !1,
writable: !1,
value: function(l) {
if (this._entries)
this._entries = {};
else {
var h = [];
this.forEach(function(g, d) {
h.push(d);
});
for (var u = 0; u < h.length; u++)
this.delete(h[u]);
}
l = l.replace(/^\?/, "");
for (var p = l.split("&"), m, u = 0; u < p.length; u++)
m = p[u].split("="), this.append(
o(m[0]),
m.length > 1 ? o(m[1]) : ""
);
}
});
}(
typeof Bn < "u" ? Bn : typeof window < "u" ? window : typeof self < "u" ? self : Bn
), function(i) {
var e = function() {
try {
var n = new i.URL("b", "http://a");
return n.pathname = "c d", n.href === "http://a/c%20d" && n.searchParams;
} catch {
return !1;
}
}, t = function() {
var n = i.URL, o = function(c, l) {
typeof c != "string" && (c = String(c)), l && typeof l != "string" && (l = String(l));
var h = document, u;
if (l && (i.location === void 0 || l !== i.location.href)) {
l = l.toLowerCase(), h = document.implementation.createHTMLDocument(""), u = h.createElement("base"), u.href = l, h.head.appendChild(u);
try {
if (u.href.indexOf(l) !== 0) throw new Error(u.href);
} catch (_) {
throw new Error("URL unable to set base " + l + " due to " + _);
}
}
var p = h.createElement("a");
p.href = c, u && (h.body.appendChild(p), p.href = p.href);
var m = h.createElement("input");
if (m.type = "url", m.value = c, p.protocol === ":" || !/:/.test(p.href) || !m.checkValidity() && !l)
throw new TypeError("Invalid URL");
Object.defineProperty(this, "_anchorElement", {
value: p
});
var g = new i.URLSearchParams(this.search), d = !0, y = !0, f = this;
["append", "delete", "set"].forEach(function(_) {
var M = g[_];
g[_] = function() {
M.apply(g, arguments), d && (y = !1, f.search = g.toString(), y = !0);
};
}), Object.defineProperty(this, "searchParams", {
value: g,
enumerable: !0
});
var v = void 0;
Object.defineProperty(this, "_updateSearchParams", {
enumerable: !1,
configurable: !1,
writable: !1,
value: function() {
this.search !== v && (v = this.search, y && (d = !1, this.searchParams._fromString(this.search), d = !0));
}
});
}, a = o.prototype, s = function(c) {
Object.defineProperty(a, c, {
get: function() {
return this._anchorElement[c];
},
set: function(l) {
this._anchorElement[c] = l;
},
enumerable: !0
});
};
["hash", "host", "hostname", "port", "protocol"].forEach(function(c) {
s(c);
}), Object.defineProperty(a, "search", {
get: function() {
return this._anchorElement.search;
},
set: function(c) {
this._anchorElement.search = c, this._updateSearchParams();
},
enumerable: !0
}), Object.defineProperties(a, {
toString: {
get: function() {
var c = this;
return function() {
return c.href;
};
}
},
href: {
get: function() {
return this._anchorElement.href.replace(/\?$/, "");
},
set: function(c) {
this._anchorElement.href = c, this._updateSearchParams();
},
enumerable: !0
},
pathname: {
get: function() {
return this._anchorElement.pathname.replace(/(^\/?)/, "/");
},
set: function(c) {
this._anchorElement.pathname = c;
},
enumerable: !0
},
origin: {
get: function() {
var c = { "http:": 80, "https:": 443, "ftp:": 21 }[this._anchorElement.protocol], l = this._anchorElement.port != c && this._anchorElement.port !== "";
return this._anchorElement.protocol + "//" + this._anchorElement.hostname + (l ? ":" + this._anchorElement.port : "");
},
enumerable: !0
},
password: {
// TODO
get: function() {
return "";
},
set: function(c) {
},
enumerable: !0
},
username: {
// TODO
get: function() {
return "";
},
set: function(c) {
},
enumerable: !0
}
}), o.createObjectURL = function(c) {
return n.createObjectURL.apply(n, arguments);
}, o.revokeObjectURL = function(c) {
return n.revokeObjectURL.apply(n, arguments);
}, i.URL = o;
};
if (e() || t(), i.location !== void 0 && !("origin" in i.location)) {
var r = function() {
return i.location.protocol + "//" + i.location.hostname + (i.location.port ? ":" + i.location.port : "");
};
try {
Object.defineProperty(i.location, "origin", {
get: r,
enumerable: !0
});
} catch {
setInterval(function() {
i.location.origin = r();
}, 100);
}
}
}(
typeof Bn < "u" ? Bn : typeof window < "u" ? window : typeof self < "u" ? self : Bn
)), AR;
}
/**
* @license
* Copyright 2010-2021 Three.js Authors
* SPDX-License-Identifier: MIT
*/
const kp = "130", LR = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 }, RR = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 }, Ny = 0, vd = 1, By = 2, OR = 3, PR = 0, Fp = 1, ky = 2, wa = 3, Xn = 0, Yt = 1, Zn = 2, zp = 1, IR = 2, an = 0, Sa = 1, yd = 2, bd = 3, xd = 4, Fy = 5, bo = 100, zy = 101, Uy = 102, wd = 103, _d = 104, Vy = 200, Hy = 201, jy = 202, Gy = 203, Up = 204, Vp = 205, Wy = 206, $y = 207, qy = 208, Xy = 209, Zy = 210, Yy = 0, Jy = 1, Ky = 2, Kc = 3, Qy = 4, eb = 5, tb = 6, ib = 7, vl = 0, rb = 1, nb = 2, Un = 0, ob = 1, ab = 2, sb = 3, lb = 4, cb = 5, Su = 300, yl = 301, bl = 302, Qc = 303, eu = 304, ls = 306, xl = 307, Yn = 1e3, di = 1001, Na = 1002, Jt = 1003, Ks = 1004, DR = 1004, Qs = 1005, NR = 1005, Wt = 1006, Tu = 1007, BR = 1007, bn = 1008, kR = 1008, Po = 1009, ub = 1010, hb = 1011, el = 1012, db = 1013, Us = 1014, tn = 1015, Eo = 1016, pb = 1017, fb = 1018, mb = 1019, Ta = 1020, gb = 1021, sn = 1022, Xi = 1023, vb = 1024, yb = 1025, bb = Xi, Ao = 1026, Ba = 1027, xb = 1028, wb = 1029, _b = 1030, Mb = 1031, Sb = 1032, Tb = 1033, Md = 33776, Sd = 33777, Td = 33778, Ed = 33779, Ad = 35840, Cd = 35841, Ld = 35842, Rd = 35843, Eb = 36196, Od = 37492, Pd = 37496, Ab = 37808, Cb = 37809, Lb = 37810, Rb = 37811, Ob = 37812, Pb = 37813, Ib = 37814, Db = 37815, Nb = 37816, Bb = 37817, kb = 37818, Fb = 37819, zb = 37820, Ub = 37821, Vb = 36492, Hb = 37840, jb = 37841, Gb = 37842, Wb = 37843, $b = 37844, qb = 37845, Xb = 37846, Zb = 37847, Yb = 37848, Jb = 37849, Kb = 37850, Qb = 37851, ex = 37852, tx = 37853, ix = 2200, rx = 2201, nx = 2202, ka = 2300, Io = 2301, Uc = 2302, wo = 2400, _o = 2401, tl = 2402, Eu = 2500, Hp = 2501, ox = 0, ax = 1, jp = 2, Di = 3e3, Do = 3001, Au = 3007, Cu = 3002, sx = 3003, Gp = 3004, Wp = 3005, $p = 3006, lx = 3200, cx = 3201, to = 0, ux = 1, FR = 0, Vc = 7680, zR = 7681, UR = 7682, VR = 7683, HR = 34055, jR = 34056, GR = 5386, WR = 512, $R = 513, qR = 514, XR = 515, ZR = 516, YR = 517, JR = 518, hx = 519, Fa = 35044, za = 35048, KR = 35040, QR = 35045, eO = 35049, tO = 35041, iO = 35046, rO = 35050, nO = 35042, oO = "100", Id = "300 es";
class io {
addEventListener(e, t) {
this._listeners === void 0 && (this._listeners = {});
const r = this._listeners;
r[e] === void 0 && (r[e] = []), r[e].indexOf(t) === -1 && r[e].push(t);
}
hasEventListener(e, t) {
if (this._listeners === void 0) return !1;
const r = this._listeners;
return r[e] !== void 0 && r[e].indexOf(t) !== -1;
}
removeEventListener(e, t) {
if (this._listeners === void 0) return;
const r = this._listeners[e];
if (r !== void 0) {
const n = r.indexOf(t);
n !== -1 && r.splice(n, 1);
}
}
dispatchEvent(e) {
if (this._listeners === void 0) return;
const t = this._listeners[e.type];
if (t !== void 0) {
e.target = this;
const r = t.slice(0);
for (let n = 0, o = r.length; n < o; n++)
r[n].call(this, e);
e.target = null;
}
}
}
const gi = [];
for (let i = 0; i < 256; i++)
gi[i] = (i < 16 ? "0" : "") + i.toString(16);
let jl = 1234567;
const Co = Math.PI / 180, il = 180 / Math.PI;
function Zi() {
const i = Math.random() * 4294967295 | 0, e = Math.random() * 4294967295 | 0, t = Math.random() * 4294967295 | 0, r = Math.random() * 4294967295 | 0;
return (gi[i & 255] + gi[i >> 8 & 255] + gi[i >> 16 & 255] + gi[i >> 24 & 255] + "-" + gi[e & 255] + gi[e >> 8 & 255] + "-" + gi[e >> 16 & 15 | 64] + gi[e >> 24 & 255] + "-" + gi[t & 63 | 128] + gi[t >> 8 & 255] + "-" + gi[t >> 16 & 255] + gi[t >> 24 & 255] + gi[r & 255] + gi[r >> 8 & 255] + gi[r >> 16 & 255] + gi[r >> 24 & 255]).toUpperCase();
}
function bi(i, e, t) {
return Math.max(e, Math.min(t, i));
}
function qp(i, e) {
return (i % e + e) % e;
}
function aO(i, e, t, r, n) {
return r + (i - e) * (n - r) / (t - e);
}
function sO(i, e, t) {
return i !== e ? (t - i) / (e - i) : 0;
}
function Vs(i, e, t) {
return (1 - t) * i + t * e;
}
function lO(i, e, t, r) {
return Vs(i, e, 1 - Math.exp(-t * r));
}
function cO(i, e = 1) {
return e - Math.abs(qp(i, e * 2) - e);
}
function uO(i, e, t) {
return i <= e ? 0 : i >= t ? 1 : (i = (i - e) / (t - e), i * i * (3 - 2 * i));
}
function hO(i, e, t) {
return i <= e ? 0 : i >= t ? 1 : (i = (i - e) / (t - e), i * i * i * (i * (i * 6 - 15) + 10));
}
function dO(i, e) {
return i + Math.floor(Math.random() * (e - i + 1));
}
function pO(i, e) {
return i + Math.random() * (e - i);
}
function fO(i) {
return i * (0.5 - Math.random());
}
function mO(i) {
return i !== void 0 && (jl = i % 2147483647), jl = jl * 16807 % 2147483647, (jl - 1) / 2147483646;
}
function gO(i) {
return i * Co;
}
function vO(i) {
return i * il;
}
function Dd(i) {
return (i & i - 1) === 0 && i !== 0;
}
function dx(i) {
return Math.pow(2, Math.ceil(Math.log(i) / Math.LN2));
}
function px(i) {
return Math.pow(2, Math.floor(Math.log(i) / Math.LN2));
}
function yO(i, e, t, r, n) {
const o = Math.cos, a = Math.sin, s = o(t / 2), c = a(t / 2), l = o((e + r) / 2), h = a((e + r) / 2), u = o((e - r) / 2), p = a((e - r) / 2), m = o((r - e) / 2), g = a((r - e) / 2);
switch (n) {
case "XYX":
i.set(s * h, c * u, c * p, s * l);
break;
case "YZY":
i.set(c * p, s * h, c * u, s * l);
break;
case "ZXZ":
i.set(c * u, c * p, s * h, s * l);
break;
case "XZX":
i.set(s * h, c * g, c * m, s * l);
break;
case "YXY":
i.set(c * m, s * h, c * g, s * l);
break;
case "ZYZ":
i.set(c * g, c * m, s * h, s * l);
break;
default:
console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: " + n);
}
}
var Nd = /* @__PURE__ */ Object.freeze({
__proto__: null,
DEG2RAD: Co,
RAD2DEG: il,
generateUUID: Zi,
clamp: bi,
euclideanModulo: qp,
mapLinear: aO,
inverseLerp: sO,
lerp: Vs,
damp: lO,
pingpong: cO,
smoothstep: uO,
smootherstep: hO,
randInt: dO,
randFloat: pO,
randFloatSpread: fO,
seededRandom: mO,
degToRad: gO,
radToDeg: vO,
isPowerOfTwo: Dd,
ceilPowerOfTwo: dx,
floorPowerOfTwo: px,
setQuaternionFromProperEuler: yO
});
class Re {
constructor(e = 0, t = 0) {
this.x = e, this.y = t;
}
get width() {
return this.x;
}
set width(e) {
this.x = e;
}
get height() {
return this.y;
}
set height(e) {
this.y = e;
}
set(e, t) {
return this.x = e, this.y = t, 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, t) {
switch (e) {
case 0:
this.x = t;
break;
case 1:
this.y = t;
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, t) {
return t !== void 0 ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(e, t)) : (this.x += e.x, this.y += e.y, this);
}
addScalar(e) {
return this.x += e, this.y += e, this;
}
addVectors(e, t) {
return this.x = e.x + t.x, this.y = e.y + t.y, this;
}
addScaledVector(e, t) {
return this.x += e.x * t, this.y += e.y * t, this;
}
sub(e, t) {
return t !== void 0 ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(e, t)) : (this.x -= e.x, this.y -= e.y, this);
}
subScalar(e) {
return this.x -= e, this.y -= e, this;
}
subVectors(e, t) {
return this.x = e.x - t.x, this.y = e.y - t.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 t = this.x, r = this.y, n = e.elements;
return this.x = n[0] * t + n[3] * r + n[6], this.y = n[1] * t + n[4] * r + n[7], this;
}
min(e) {
return this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this;
}
max(e) {
return this.x = Math.max(this.x, e.x), this.y = Math.max(this.y, e.y), this;
}
clamp(e, t) {
return this.x = Math.max(e.x, Math.min(t.x, this.x)), this.y = Math.max(e.y, Math.min(t.y, this.y)), this;
}
clampScalar(e, t) {
return this.x = Math.max(e, Math.min(t, this.x)), this.y = Math.max(e, Math.min(t, this.y)), this;
}
clampLength(e, t) {
const r = this.length();
return this.divideScalar(r || 1).multiplyScalar(Math.max(e, Math.min(t, r)));
}
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 t = this.x - e.x, r = this.y - e.y;
return t * t + r * r;
}
manhattanDistanceTo(e) {
return Math.abs(this.x - e.x) + Math.abs(this.y - e.y);
}
setLength(e) {
return this.normalize().multiplyScalar(e);
}
lerp(e, t) {
return this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this;
}
lerpVectors(e, t, r) {
return this.x = e.x + (t.x - e.x) * r, this.y = e.y + (t.y - e.y) * r, this;
}
equals(e) {
return e.x === this.x && e.y === this.y;
}
fromArray(e, t = 0) {
return this.x = e[t], this.y = e[t + 1], this;
}
toArray(e = [], t = 0) {
return e[t] = this.x, e[t + 1] = this.y, e;
}
fromBufferAttribute(e, t, r) {
return r !== void 0 && console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."), this.x = e.getX(t), this.y = e.getY(t), this;
}
rotateAround(e, t) {
const r = Math.cos(t), n = Math.sin(t), o = this.x - e.x, a = this.y - e.y;
return this.x = o * r - a * n + e.x, this.y = o * n + a * r + e.y, this;
}
random() {
return this.x = Math.random(), this.y = Math.random(), this;
}
}
Re.prototype.isVector2 = !0;
class ai {
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, t, r, n, o, a, s, c, l) {
const h = this.elements;
return h[0] = e, h[1] = n, h[2] = s, h[3] = t, h[4] = o, h[5] = c, h[6] = r, h[7] = a, h[8] = l, this;
}
identity() {
return this.set(
1,
0,
0,
0,
1,
0,
0,
0,
1
), this;
}
copy(e) {
const t = this.elements, r = e.elements;
return t[0] = r[0], t[1] = r[1], t[2] = r[2], t[3] = r[3], t[4] = r[4], t[5] = r[5], t[6] = r[6], t[7] = r[7], t[8] = r[8], this;
}
extractBasis(e, t, r) {
return e.setFromMatrix3Column(this, 0), t.setFromMatrix3Column(this, 1), r.setFromMatrix3Column(this, 2), this;
}
setFromMatrix4(e) {
const t = e.elements;
return this.set(
t[0],
t[4],
t[8],
t[1],
t[5],
t[9],
t[2],
t[6],
t[10]
), this;
}
multiply(e) {
return this.multiplyMatrices(this, e);
}
premultiply(e) {
return this.multiplyMatrices(e, this);
}
multiplyMatrices(e, t) {
const r = e.elements, n = t.elements, o = this.elements, a = r[0], s = r[3], c = r[6], l = r[1], h = r[4], u = r[7], p = r[2], m = r[5], g = r[8], d = n[0], y = n[3], f = n[6], v = n[1], _ = n[4], M = n[7], T = n[2], w = n[5], b = n[8];
return o[0] = a * d + s * v + c * T, o[3] = a * y + s * _ + c * w, o[6] = a * f + s * M + c * b, o[1] = l * d + h * v + u * T, o[4] = l * y + h * _ + u * w, o[7] = l * f + h * M + u * b, o[2] = p * d + m * v + g * T, o[5] = p * y + m * _ + g * w, o[8] = p * f + m * M + g * b, this;
}
multiplyScalar(e) {
const t = this.elements;
return t[0] *= e, t[3] *= e, t[6] *= e, t[1] *= e, t[4] *= e, t[7] *= e, t[2] *= e, t[5] *= e, t[8] *= e, this;
}
determinant() {
const e = this.elements, t = e[0], r = e[1], n = e[2], o = e[3], a = e[4], s = e[5], c = e[6], l = e[7], h = e[8];
return t * a * h - t * s * l - r * o * h + r * s * c + n * o * l - n * a * c;
}
invert() {
const e = this.elements, t = e[0], r = e[1], n = e[2], o = e[3], a = e[4], s = e[5], c = e[6], l = e[7], h = e[8], u = h * a - s * l, p = s * c - h * o, m = l * o - a * c, g = t * u + r * p + n * m;
if (g === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
const d = 1 / g;
return e[0] = u * d, e[1] = (n * l - h * r) * d, e[2] = (s * r - n * a) * d, e[3] = p * d, e[4] = (h * t - n * c) * d, e[5] = (n * o - s * t) * d, e[6] = m * d, e[7] = (r * c - l * t) * d, e[8] = (a * t - r * o) * d, this;
}
transpose() {
let e;
const t = this.elements;
return e = t[1], t[1] = t[3], t[3] = e, e = t[2], t[2] = t[6], t[6] = e, e = t[5], t[5] = t[7], t[7] = e, this;
}
getNormalMatrix(e) {
return this.setFromMatrix4(e).invert().transpose();
}
transposeIntoArray(e) {
const t = this.elements;
return e[0] = t[0], e[1] = t[3], e[2] = t[6], e[3] = t[1], e[4] = t[4], e[5] = t[7], e[6] = t[2], e[7] = t[5], e[8] = t[8], this;
}
setUvTransform(e, t, r, n, o, a, s) {
const c = Math.cos(o), l = Math.sin(o);
return this.set(
r * c,
r * l,
-r * (c * a + l * s) + a + e,
-n * l,
n * c,
-n * (-l * a + c * s) + s + t,
0,
0,
1
), this;
}
scale(e, t) {
const r = this.elements;
return r[0] *= e, r[3] *= e, r[6] *= e, r[1] *= t, r[4] *= t, r[7] *= t, this;
}
rotate(e) {
const t = Math.cos(e), r = Math.sin(e), n = this.elements, o = n[0], a = n[3], s = n[6], c = n[1], l = n[4], h = n[7];
return n[0] = t * o + r * c, n[3] = t * a + r * l, n[6] = t * s + r * h, n[1] = -r * o + t * c, n[4] = -r * a + t * l, n[7] = -r * s + t * h, this;
}
translate(e, t) {
const r = this.elements;
return r[0] += e * r[2], r[3] += e * r[5], r[6] += e * r[8], r[1] += t * r[2], r[4] += t * r[5], r[7] += t * r[8], this;
}
equals(e) {
const t = this.elements, r = e.elements;
for (let n = 0; n < 9; n++)
if (t[n] !== r[n]) return !1;
return !0;
}
fromArray(e, t = 0) {
for (let r = 0; r < 9; r++)
this.elements[r] = e[r + t];
return this;
}
toArray(e = [], t = 0) {
const r = this.elements;
return e[t] = r[0], e[t + 1] = r[1], e[t + 2] = r[2], e[t + 3] = r[3], e[t + 4] = r[4], e[t + 5] = r[5], e[t + 6] = r[6], e[t + 7] = r[7], e[t + 8] = r[8], e;
}
clone() {
return new this.constructor().fromArray(this.elements);
}
}
ai.prototype.isMatrix3 = !0;
let Ko;
class Go {
static getDataURL(e) {
if (/^data:/i.test(e.src) || typeof HTMLCanvasElement > "u")
return e.src;
let t;
if (e instanceof HTMLCanvasElement)
t = e;
else {
Ko === void 0 && (Ko = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas")), Ko.width = e.width, Ko.height = e.height;
const r = Ko.getContext("2d");
e instanceof ImageData ? r.putImageData(e, 0, 0) : r.drawImage(e, 0, 0, e.width, e.height), t = Ko;
}
return t.width > 2048 || t.height > 2048 ? (console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons", e), t.toDataURL("image/jpeg", 0.6)) : t.toDataURL("image/png");
}
}
let bO = 0;
class ti extends io {
constructor(e = ti.DEFAULT_IMAGE, t = ti.DEFAULT_MAPPING, r = di, n = di, o = Wt, a = bn, s = Xi, c = Po, l = 1, h = Di) {
super(), Object.defineProperty(this, "id", { value: bO++ }), this.uuid = Zi(), this.name = "", this.image = e, this.mipmaps = [], this.mapping = t, this.wrapS = r, this.wrapT = n, this.magFilter = o, this.minFilter = a, this.anisotropy = l, this.format = s, this.internalFormat = null, this.type = c, this.offset = new Re(0, 0), this.repeat = new Re(1, 1), this.center = new Re(0, 0), this.rotation = 0, this.matrixAutoUpdate = !0, this.matrix = new ai(), this.generateMipmaps = !0, this.premultiplyAlpha = !1, this.flipY = !0, this.unpackAlignment = 4, this.encoding = h, 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 t = e === void 0 || typeof e == "string";
if (!t && e.textures[this.uuid] !== void 0)
return e.textures[this.uuid];
const r = {
metadata: {
version: 4.5,
type: "Texture",
generator: "Texture.toJSON"
},
uuid: this.uuid,
name: this.name,
mapping: this.mapping,
repeat: [this.repeat.x, this.repeat.y],
offset: [this.offset.x, this.offset.y],
center: [this.center.x, this.center.y],
rotation: this.rotation,
wrap: [this.wrapS, this.wrapT],
format: this.format,
type: this.type,
encoding: this.encoding,
minFilter: this.minFilter,
magFilter: this.magFilter,
anisotropy: this.anisotropy,
flipY: this.flipY,
premultiplyAlpha: this.premultiplyAlpha,
unpackAlignment: this.unpackAlignment
};
if (this.image !== void 0) {
const n = this.image;
if (n.uuid === void 0 && (n.uuid = Zi()), !t && e.images[n.uuid] === void 0) {
let o;
if (Array.isArray(n)) {
o = [];
for (let a = 0, s = n.length; a < s; a++)
n[a].isDataTexture ? o.push(ah(n[a].image)) : o.push(ah(n[a]));
} else
o = ah(n);
e.images[n.uuid] = {
uuid: n.uuid,
url: o
};
}
r.image = n.uuid;
}
return t || (e.textures[this.uuid] = r), r;
}
dispose() {
this.dispatchEvent({ type: "dispose" });
}
transformUv(e) {
if (this.mapping !== Su) return e;
if (e.applyMatrix3(this.matrix), e.x < 0 || e.x > 1)
switch (this.wrapS) {
case Yn:
e.x = e.x - Math.floor(e.x);
break;
case di:
e.x = e.x < 0 ? 0 : 1;
break;
case Na:
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 Yn:
e.y = e.y - Math.floor(e.y);
break;
case di:
e.y = e.y < 0 ? 0 : 1;
break;
case Na:
Math.abs(Math.floor(e.y) % 2) === 1 ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y);
break;
}
return this.flipY && (e.y = 1 - e.y), e;
}
set needsUpdate(e) {
e === !0 && this.version++;
}
}
ti.DEFAULT_IMAGE = void 0;
ti.DEFAULT_MAPPING = Su;
ti.prototype.isTexture = !0;
function ah(i) {
return typeof HTMLImageElement < "u" && i instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && i instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && i instanceof ImageBitmap ? Go.getDataURL(i) : i.data ? {
data: Array.prototype.slice.call(i.data),
width: i.width,
height: i.height,
type: i.data.constructor.name
} : (console.warn("THREE.Texture: Unable to serialize Texture."), {});
}
class St {
constructor(e = 0, t = 0, r = 0, n = 1) {
this.x = e, this.y = t, this.z = r, this.w = n;
}
get width() {
return this.z;
}
set width(e) {
this.z = e;
}
get height() {
return this.w;
}
set height(e) {
this.w = e;
}
set(e, t, r, n) {
return this.x = e, this.y = t, this.z = r, this.w = n, this;
}
setScalar(e) {
return this.x = e, this.y = e, this.z = e, this.w = e, this;
}
setX(e) {
return this.x = e, this;
}
setY(e) {
return this.y = e, this;
}
setZ(e) {
return this.z = e, this;
}
setW(e) {
return this.w = e, this;
}
setComponent(e, t) {
switch (e) {
case 0:
this.x = t;
break;
case 1:
this.y = t;
break;
case 2:
this.z = t;
break;
case 3:
this.w = t;
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, t) {
return t !== void 0 ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(e, t)) : (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, t) {
return this.x = e.x + t.x, this.y = e.y + t.y, this.z = e.z + t.z, this.w = e.w + t.w, this;
}
addScaledVector(e, t) {
return this.x += e.x * t, this.y += e.y * t, this.z += e.z * t, this.w += e.w * t, this;
}
sub(e, t) {
return t !== void 0 ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(e, t)) : (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, t) {
return this.x = e.x - t.x, this.y = e.y - t.y, this.z = e.z - t.z, this.w = e.w - t.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 t = this.x, r = this.y, n = this.z, o = this.w, a = e.elements;
return this.x = a[0] * t + a[4] * r + a[8] * n + a[12] * o, this.y = a[1] * t + a[5] * r + a[9] * n + a[13] * o, this.z = a[2] * t + a[6] * r + a[10] * n + a[14] * o, this.w = a[3] * t + a[7] * r + a[11] * n + a[15] * o, this;
}
divideScalar(e) {
return this.multiplyScalar(1 / e);
}
setAxisAngleFromQuaternion(e) {
this.w = 2 * Math.acos(e.w);
const t = Math.sqrt(1 - e.w * e.w);
return t < 1e-4 ? (this.x = 1, this.y = 0, this.z = 0) : (this.x = e.x / t, this.y = e.y / t, this.z = e.z / t), this;
}
setAxisAngleFromRotationMatrix(e) {
let t, r, n, o;
const a = e.elements, s = a[0], c = a[4], l = a[8], h = a[1], u = a[5], p = a[9], m = a[2], g = a[6], d = a[10];
if (Math.abs(c - h) < 0.01 && Math.abs(l - m) < 0.01 && Math.abs(p - g) < 0.01) {
if (Math.abs(c + h) < 0.1 && Math.abs(l + m) < 0.1 && Math.abs(p + g) < 0.1 && Math.abs(s + u + d - 3) < 0.1)
return this.set(1, 0, 0, 0), this;
t = Math.PI;
const f = (s + 1) / 2, v = (u + 1) / 2, _ = (d + 1) / 2, M = (c + h) / 4, T = (l + m) / 4, w = (p + g) / 4;
return f > v && f > _ ? f < 0.01 ? (r = 0, n = 0.707106781, o = 0.707106781) : (r = Math.sqrt(f), n = M / r, o = T / r) : v > _ ? v < 0.01 ? (r = 0.707106781, n = 0, o = 0.707106781) : (n = Math.sqrt(v), r = M / n, o = w / n) : _ < 0.01 ? (r = 0.707106781, n = 0.707106781, o = 0) : (o = Math.sqrt(_), r = T / o, n = w / o), this.set(r, n, o, t), this;
}
let y = Math.sqrt((g - p) * (g - p) + (l - m) * (l - m) + (h - c) * (h - c));
return Math.abs(y) < 1e-3 && (y = 1), this.x = (g - p) / y, this.y = (l - m) / y, this.z = (h - c) / y, this.w = Math.acos((s + u + d - 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, t) {
return this.x = Math.max(e.x, Math.min(t.x, this.x)), this.y = Math.max(e.y, Math.min(t.y, this.y)), this.z = Math.max(e.z, Math.min(t.z, this.z)), this.w = Math.max(e.w, Math.min(t.w, this.w)), this;
}
clampScalar(e, t) {
return this.x = Math.max(e, Math.min(t, this.x)), this.y = Math.max(e, Math.min(t, this.y)), this.z = Math.max(e, Math.min(t, this.z)), this.w = Math.max(e, Math.min(t, this.w)), this;
}
clampLength(e, t) {
const r = this.length();
return this.divideScalar(r || 1).multiplyScalar(Math.max(e, Math.min(t, r)));
}
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, t) {
return this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this.z += (e.z - this.z) * t, this.w += (e.w - this.w) * t, this;
}
lerpVectors(e, t, r) {
return this.x = e.x + (t.x - e.x) * r, this.y = e.y + (t.y - e.y) * r, this.z = e.z + (t.z - e.z) * r, this.w = e.w + (t.w - e.w) * r, this;
}
equals(e) {
return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w;
}
fromArray(e, t = 0) {
return this.x = e[t], this.y = e[t + 1], this.z = e[t + 2], this.w = e[t + 3], this;
}
toArray(e = [], t = 0) {
return e[t] = this.x, e[t + 1] = this.y, e[t + 2] = this.z, e[t + 3] = this.w, e;
}
fromBufferAttribute(e, t, r) {
return r !== void 0 && console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."), this.x = e.getX(t), this.y = e.getY(t), this.z = e.getZ(t), this.w = e.getW(t), this;
}
random() {
return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this.w = Math.random(), this;
}
}
St.prototype.isVector4 = !0;
class yr extends io {
constructor(e, t, r = {}) {
super(), this.width = e, this.height = t, this.depth = 1, this.scissor = new St(0, 0, e, t), this.scissorTest = !1, this.viewport = new St(0, 0, e, t), this.texture = new ti(void 0, r.mapping, r.wrapS, r.wrapT, r.magFilter, r.minFilter, r.format, r.type, r.anisotropy, r.encoding), this.texture.image = { width: e, height: t, depth: 1 }, this.texture.generateMipmaps = r.generateMipmaps !== void 0 ? r.generateMipmaps : !1, this.texture.minFilter = r.minFilter !== void 0 ? r.minFilter : Wt, this.depthBuffer = r.depthBuffer !== void 0 ? r.depthBuffer : !0, this.stencilBuffer = r.stencilBuffer !== void 0 ? r.stencilBuffer : !1, this.depthTexture = r.depthTexture !== void 0 ? r.depthTexture : null;
}
setTexture(e) {
e.image = {
width: this.width,
height: this.height,
depth: this.depth
}, this.texture = e;
}
setSize(e, t, r = 1) {
(this.width !== e || this.height !== t || this.depth !== r) && (this.width = e, this.height = t, this.depth = r, this.texture.image.width = e, this.texture.image.height = t, this.texture.image.depth = r, this.dispose()), this.viewport.set(0, 0, e, t), this.scissor.set(0, 0, e, t);
}
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" });
}
}
yr.prototype.isWebGLRenderTarget = !0;
class fx extends yr {
constructor(e, t, r) {
super(e, t);
const n = this.texture;
this.texture = [];
for (let o = 0; o < r; o++)
this.texture[o] = n.clone();
}
setSize(e, t, r = 1) {
if (this.width !== e || this.height !== t || this.depth !== r) {
this.width = e, this.height = t, this.depth = r;
for (let n = 0, o = this.texture.length; n < o; n++)
this.texture[n].image.width = e, this.texture[n].image.height = t, this.texture[n].image.depth = r;
this.dispose();
}
return this.viewport.set(0, 0, e, t), this.scissor.set(0, 0, e, t), 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 t = 0, r = e.texture.length; t < r; t++)
this.texture[t] = e.texture[t].clone();
return this;
}
}
fx.prototype.isWebGLMultipleRenderTargets = !0;
class Xp extends yr {
constructor(e, t, r) {
super(e, t, r), this.samples = 4;
}
copy(e) {
return super.copy.call(this, e), this.samples = e.samples, this;
}
}
Xp.prototype.isWebGLMultisampleRenderTarget = !0;
class wi {
constructor(e = 0, t = 0, r = 0, n = 1) {
this._x = e, this._y = t, this._z = r, this._w = n;
}
static slerp(e, t, r, n) {
return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."), r.slerpQuaternions(e, t, n);
}
static slerpFlat(e, t, r, n, o, a, s) {
let c = r[n + 0], l = r[n + 1], h = r[n + 2], u = r[n + 3];
const p = o[a + 0], m = o[a + 1], g = o[a + 2], d = o[a + 3];
if (s === 0) {
e[t + 0] = c, e[t + 1] = l, e[t + 2] = h, e[t + 3] = u;
return;
}
if (s === 1) {
e[t + 0] = p, e[t + 1] = m, e[t + 2] = g, e[t + 3] = d;
return;
}
if (u !== d || c !== p || l !== m || h !== g) {
let y = 1 - s;
const f = c * p + l * m + h * g + u * d, v = f >= 0 ? 1 : -1, _ = 1 - f * f;
if (_ > Number.EPSILON) {
const T = Math.sqrt(_), w = Math.atan2(T, f * v);
y = Math.sin(y * w) / T, s = Math.sin(s * w) / T;
}
const M = s * v;
if (c = c * y + p * M, l = l * y + m * M, h = h * y + g * M, u = u * y + d * M, y === 1 - s) {
const T = 1 / Math.sqrt(c * c + l * l + h * h + u * u);
c *= T, l *= T, h *= T, u *= T;
}
}
e[t] = c, e[t + 1] = l, e[t + 2] = h, e[t + 3] = u;
}
static multiplyQuaternionsFlat(e, t, r, n, o, a) {
const s = r[n], c = r[n + 1], l = r[n + 2], h = r[n + 3], u = o[a], p = o[a + 1], m = o[a + 2], g = o[a + 3];
return e[t] = s * g + h * u + c * m - l * p, e[t + 1] = c * g + h * p + l * u - s * m, e[t + 2] = l * g + h * m + s * p - c * u, e[t + 3] = h * g - s * u - c * p - l * m, 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, t, r, n) {
return this._x = e, this._y = t, this._z = r, this._w = n, this._onChangeCallback(), this;
}
clone() {
return new this.constructor(this._x, this._y, this._z, this._w);
}
copy(e) {
return this._x = e.x, this._y = e.y, this._z = e.z, this._w = e.w, this._onChangeCallback(), this;
}
setFromEuler(e, t) {
if (!(e && e.isEuler))
throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");
const r = e._x, n = e._y, o = e._z, a = e._order, s = Math.cos, c = Math.sin, l = s(r / 2), h = s(n / 2), u = s(o / 2), p = c(r / 2), m = c(n / 2), g = c(o / 2);
switch (a) {
case "XYZ":
this._x = p * h * u + l * m * g, this._y = l * m * u - p * h * g, this._z = l * h * g + p * m * u, this._w = l * h * u - p * m * g;
break;
case "YXZ":
this._x = p * h * u + l * m * g, this._y = l * m * u - p * h * g, this._z = l * h * g - p * m * u, this._w = l * h * u + p * m * g;
break;
case "ZXY":
this._x = p * h * u - l * m * g, this._y = l * m * u + p * h * g, this._z = l * h * g + p * m * u, this._w = l * h * u - p * m * g;
break;
case "ZYX":
this._x = p * h * u - l * m * g, this._y = l * m * u + p * h * g, this._z = l * h * g - p * m * u, this._w = l * h * u + p * m * g;
break;
case "YZX":
this._x = p * h * u + l * m * g, this._y = l * m * u + p * h * g, this._z = l * h * g - p * m * u, this._w = l * h * u - p * m * g;
break;
case "XZY":
this._x = p * h * u - l * m * g, this._y = l * m * u - p * h * g, this._z = l * h * g + p * m * u, this._w = l * h * u + p * m * g;
break;
default:
console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + a);
}
return t !== !1 && this._onChangeCallback(), this;
}
setFromAxisAngle(e, t) {
const r = t / 2, n = Math.sin(r);
return this._x = e.x * n, this._y = e.y * n, this._z = e.z * n, this._w = Math.cos(r), this._onChangeCallback(), this;
}
setFromRotationMatrix(e) {
const t = e.elements, r = t[0], n = t[4], o = t[8], a = t[1], s = t[5], c = t[9], l = t[2], h = t[6], u = t[10], p = r + s + u;
if (p > 0) {
const m = 0.5 / Math.sqrt(p + 1);
this._w = 0.25 / m, this._x = (h - c) * m, this._y = (o - l) * m, this._z = (a - n) * m;
} else if (r > s && r > u) {
const m = 2 * Math.sqrt(1 + r - s - u);
this._w = (h - c) / m, this._x = 0.25 * m, this._y = (n + a) / m, this._z = (o + l) / m;
} else if (s > u) {
const m = 2 * Math.sqrt(1 + s - r - u);
this._w = (o - l) / m, this._x = (n + a) / m, this._y = 0.25 * m, this._z = (c + h) / m;
} else {
const m = 2 * Math.sqrt(1 + u - r - s);
this._w = (a - n) / m, this._x = (o + l) / m, this._y = (c + h) / m, this._z = 0.25 * m;
}
return this._onChangeCallback(), this;
}
setFromUnitVectors(e, t) {
let r = e.dot(t) + 1;
return r < Number.EPSILON ? (r = 0, Math.abs(e.x) > Math.abs(e.z) ? (this._x = -e.y, this._y = e.x, this._z = 0, this._w = r) : (this._x = 0, this._y = -e.z, this._z = e.y, this._w = r)) : (this._x = e.y * t.z - e.z * t.y, this._y = e.z * t.x - e.x * t.z, this._z = e.x * t.y - e.y * t.x, this._w = r), this.normalize();
}
angleTo(e) {
return 2 * Math.acos(Math.abs(bi(this.dot(e), -1, 1)));
}
rotateTowards(e, t) {
const r = this.angleTo(e);
if (r === 0) return this;
const n = Math.min(1, t / r);
return this.slerp(e, n), this;
}
identity() {
return this.set(0, 0, 0, 1);
}
invert() {
return this.conjugate();
}
conjugate() {
return this._x *= -1, this._y *= -1, this._z *= -1, this._onChangeCallback(), this;
}
dot(e) {
return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w;
}
lengthSq() {
return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;
}
length() {
return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);
}
normalize() {
let e = this.length();
return e === 0 ? (this._x = 0, this._y = 0, this._z = 0, this._w = 1) : (e = 1 / e, this._x = this._x * e, this._y = this._y * e, this._z = this._z * e, this._w = this._w * e), this._onChangeCallback(), this;
}
multiply(e, t) {
return t !== void 0 ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."), this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e);
}
premultiply(e) {
return this.multiplyQuaternions(e, this);
}
multiplyQuaternions(e, t) {
const r = e._x, n = e._y, o = e._z, a = e._w, s = t._x, c = t._y, l = t._z, h = t._w;
return this._x = r * h + a * s + n * l - o * c, this._y = n * h + a * c + o * s - r * l, this._z = o * h + a * l + r * c - n * s, this._w = a * h - r * s - n * c - o * l, this._onChangeCallback(), this;
}
slerp(e, t) {
if (t === 0) return this;
if (t === 1) return this.copy(e);
const r = this._x, n = this._y, o = this._z, a = this._w;
let s = a * e._w + r * e._x + n * e._y + o * e._z;
if (s < 0 ? (this._w = -e._w, this._x = -e._x, this._y = -e._y, this._z = -e._z, s = -s) : this.copy(e), s >= 1)
return this._w = a, this._x = r, this._y = n, this._z = o, this;
const c = 1 - s * s;
if (c <= Number.EPSILON) {
const m = 1 - t;
return this._w = m * a + t * this._w, this._x = m * r + t * this._x, this._y = m * n + t * this._y, this._z = m * o + t * this._z, this.normalize(), this._onChangeCallback(), this;
}
const l = Math.sqrt(c), h = Math.atan2(l, s), u = Math.sin((1 - t) * h) / l, p = Math.sin(t * h) / l;
return this._w = a * u + this._w * p, this._x = r * u + this._x * p, this._y = n * u + this._y * p, this._z = o * u + this._z * p, this._onChangeCallback(), this;
}
slerpQuaternions(e, t, r) {
this.copy(e).slerp(t, r);
}
equals(e) {
return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w;
}
fromArray(e, t = 0) {
return this._x = e[t], this._y = e[t + 1], this._z = e[t + 2], this._w = e[t + 3], this._onChangeCallback(), this;
}
toArray(e = [], t = 0) {
return e[t] = this._x, e[t + 1] = this._y, e[t + 2] = this._z, e[t + 3] = this._w, e;
}
fromBufferAttribute(e, t) {
return this._x = e.getX(t), this._y = e.getY(t), this._z = e.getZ(t), this._w = e.getW(t), this;
}
_onChange(e) {
return this._onChangeCallback = e, this;
}
_onChangeCallback() {
}
}
wi.prototype.isQuaternion = !0;
class Z {
constructor(e = 0, t = 0, r = 0) {
this.x = e, this.y = t, this.z = r;
}
set(e, t, r) {
return r === void 0 && (r = this.z), this.x = e, this.y = t, this.z = r, 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, t) {
switch (e) {
case 0:
this.x = t;
break;
case 1:
this.y = t;
break;
case 2:
this.z = t;
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, t) {
return t !== void 0 ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(e, t)) : (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, t) {
return this.x = e.x + t.x, this.y = e.y + t.y, this.z = e.z + t.z, this;
}
addScaledVector(e, t) {
return this.x += e.x * t, this.y += e.y * t, this.z += e.z * t, this;
}
sub(e, t) {
return t !== void 0 ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(e, t)) : (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, t) {
return this.x = e.x - t.x, this.y = e.y - t.y, this.z = e.z - t.z, this;
}
multiply(e, t) {
return t !== void 0 ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."), this.multiplyVectors(e, t)) : (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, t) {
return this.x = e.x * t.x, this.y = e.y * t.y, this.z = e.z * t.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(dg.setFromEuler(e));
}
applyAxisAngle(e, t) {
return this.applyQuaternion(dg.setFromAxisAngle(e, t));
}
applyMatrix3(e) {
const t = this.x, r = this.y, n = this.z, o = e.elements;
return this.x = o[0] * t + o[3] * r + o[6] * n, this.y = o[1] * t + o[4] * r + o[7] * n, this.z = o[2] * t + o[5] * r + o[8] * n, this;
}
applyNormalMatrix(e) {
return this.applyMatrix3(e).normalize();
}
applyMatrix4(e) {
const t = this.x, r = this.y, n = this.z, o = e.elements, a = 1 / (o[3] * t + o[7] * r + o[11] * n + o[15]);
return this.x = (o[0] * t + o[4] * r + o[8] * n + o[12]) * a, this.y = (o[1] * t + o[5] * r + o[9] * n + o[13]) * a, this.z = (o[2] * t + o[6] * r + o[10] * n + o[14]) * a, this;
}
applyQuaternion(e) {
const t = this.x, r = this.y, n = this.z, o = e.x, a = e.y, s = e.z, c = e.w, l = c * t + a * n - s * r, h = c * r + s * t - o * n, u = c * n + o * r - a * t, p = -o * t - a * r - s * n;
return this.x = l * c + p * -o + h * -s - u * -a, this.y = h * c + p * -a + u * -o - l * -s, this.z = u * c + p * -s + l * -a - h * -o, this;
}
project(e) {
return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix);
}
unproject(e) {
return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld);
}
transformDirection(e) {
const t = this.x, r = this.y, n = this.z, o = e.elements;
return this.x = o[0] * t + o[4] * r + o[8] * n, this.y = o[1] * t + o[5] * r + o[9] * n, this.z = o[2] * t + o[6] * r + o[10] * n, this.normalize();
}
divide(e) {
return this.x /= e.x, this.y /= e.y, this.z /= e.z, this;
}
divideScalar(e) {
return this.multiplyScalar(1 / e);
}
min(e) {
return this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this.z = Math.min(this.z, e.z), this;
}
max(e) {
return this.x = Math.max(this.x, e.x), this.y = Math.max(this.y, e.y), this.z = Math.max(this.z, e.z), this;
}
clamp(e, t) {
return this.x = Math.max(e.x, Math.min(t.x, this.x)), this.y = Math.max(e.y, Math.min(t.y, this.y)), this.z = Math.max(e.z, Math.min(t.z, this.z)), this;
}
clampScalar(e, t) {
return this.x = Math.max(e, Math.min(t, this.x)), this.y = Math.max(e, Math.min(t, this.y)), this.z = Math.max(e, Math.min(t, this.z)), this;
}
clampLength(e, t) {
const r = this.length();
return this.divideScalar(r || 1).multiplyScalar(Math.max(e, Math.min(t, r)));
}
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, t) {
return this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this.z += (e.z - this.z) * t, this;
}
lerpVectors(e, t, r) {
return this.x = e.x + (t.x - e.x) * r, this.y = e.y + (t.y - e.y) * r, this.z = e.z + (t.z - e.z) * r, this;
}
cross(e, t) {
return t !== void 0 ? (console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."), this.crossVectors(e, t)) : this.crossVectors(this, e);
}
crossVectors(e, t) {
const r = e.x, n = e.y, o = e.z, a = t.x, s = t.y, c = t.z;
return this.x = n * c - o * s, this.y = o * a - r * c, this.z = r * s - n * a, this;
}
projectOnVector(e) {
const t = e.lengthSq();
if (t === 0) return this.set(0, 0, 0);
const r = e.dot(this) / t;
return this.copy(e).multiplyScalar(r);
}
projectOnPlane(e) {
return sh.copy(this).projectOnVector(e), this.sub(sh);
}
reflect(e) {
return this.sub(sh.copy(e).multiplyScalar(2 * this.dot(e)));
}
angleTo(e) {
const t = Math.sqrt(this.lengthSq() * e.lengthSq());
if (t === 0) return Math.PI / 2;
const r = this.dot(e) / t;
return Math.acos(bi(r, -1, 1));
}
distanceTo(e) {
return Math.sqrt(this.distanceToSquared(e));
}
distanceToSquared(e) {
const t = this.x - e.x, r = this.y - e.y, n = this.z - e.z;
return t * t + r * r + n * n;
}
manhattanDistanceTo(e) {
return Math.abs(this.x - e.x) + Math.abs(this.y - e.y) + Math.abs(this.z - e.z);
}
setFromSpherical(e) {
return this.setFromSphericalCoords(e.radius, e.phi, e.theta);
}
setFromSphericalCoords(e, t, r) {
const n = Math.sin(t) * e;
return this.x = n * Math.sin(r), this.y = Math.cos(t) * e, this.z = n * Math.cos(r), this;
}
setFromCylindrical(e) {
return this.setFromCylindricalCoords(e.radius, e.theta, e.y);
}
setFromCylindricalCoords(e, t, r) {
return this.x = e * Math.sin(t), this.y = r, this.z = e * Math.cos(t), this;
}
setFromMatrixPosition(e) {
const t = e.elements;
return this.x = t[12], this.y = t[13], this.z = t[14], this;
}
setFromMatrixScale(e) {
const t = this.setFromMatrixColumn(e, 0).length(), r = this.setFromMatrixColumn(e, 1).length(), n = this.setFromMatrixColumn(e, 2).length();
return this.x = t, this.y = r, this.z = n, this;
}
setFromMatrixColumn(e, t) {
return this.fromArray(e.elements, t * 4);
}
setFromMatrix3Column(e, t) {
return this.fromArray(e.elements, t * 3);
}
equals(e) {
return e.x === this.x && e.y === this.y && e.z === this.z;
}
fromArray(e, t = 0) {
return this.x = e[t], this.y = e[t + 1], this.z = e[t + 2], this;
}
toArray(e = [], t = 0) {
return e[t] = this.x, e[t + 1] = this.y, e[t + 2] = this.z, e;
}
fromBufferAttribute(e, t, r) {
return r !== void 0 && console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."), this.x = e.getX(t), this.y = e.getY(t), this.z = e.getZ(t), this;
}
random() {
return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this;
}
}
Z.prototype.isVector3 = !0;
const sh = /* @__PURE__ */ new Z(), dg = /* @__PURE__ */ new wi();
class ji {
constructor(e = new Z(1 / 0, 1 / 0, 1 / 0), t = new Z(-1 / 0, -1 / 0, -1 / 0)) {
this.min = e, this.max = t;
}
set(e, t) {
return this.min.copy(e), this.max.copy(t), this;
}
setFromArray(e) {
let t = 1 / 0, r = 1 / 0, n = 1 / 0, o = -1 / 0, a = -1 / 0, s = -1 / 0;
for (let c = 0, l = e.length; c < l; c += 3) {
const h = e[c], u = e[c + 1], p = e[c + 2];
h < t && (t = h), u < r && (r = u), p < n && (n = p), h > o && (o = h), u > a && (a = u), p > s && (s = p);
}
return this.min.set(t, r, n), this.max.set(o, a, s), this;
}
setFromBufferAttribute(e) {
let t = 1 / 0, r = 1 / 0, n = 1 / 0, o = -1 / 0, a = -1 / 0, s = -1 / 0;
for (let c = 0, l = e.count; c < l; c++) {
const h = e.getX(c), u = e.getY(c), p = e.getZ(c);
h < t && (t = h), u < r && (r = u), p < n && (n = p), h > o && (o = h), u > a && (a = u), p > s && (s = p);
}
return this.min.set(t, r, n), this.max.set(o, a, s), this;
}
setFromPoints(e) {
this.makeEmpty();
for (let t = 0, r = e.length; t < r; t++)
this.expandByPoint(e[t]);
return this;
}
setFromCenterAndSize(e, t) {
const r = bs.copy(t).multiplyScalar(0.5);
return this.min.copy(e).sub(r), this.max.copy(e).add(r), this;
}
setFromObject(e) {
return this.makeEmpty(), this.expandByObject(e);
}
clone() {
return new this.constructor().copy(this);
}
copy(e) {
return this.min.copy(e.min), this.max.copy(e.max), this;
}
makeEmpty() {
return this.min.x = this.min.y = this.min.z = 1 / 0, this.max.x = this.max.y = this.max.z = -1 / 0, this;
}
isEmpty() {
return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z;
}
getCenter(e) {
return this.isEmpty() ? e.set(0, 0, 0) : e.addVectors(this.min, this.max).multiplyScalar(0.5);
}
getSize(e) {
return this.isEmpty() ? e.set(0, 0, 0) : e.subVectors(this.max, this.min);
}
expandByPoint(e) {
return this.min.min(e), this.max.max(e), this;
}
expandByVector(e) {
return this.min.sub(e), this.max.add(e), this;
}
expandByScalar(e) {
return this.min.addScalar(-e), this.max.addScalar(e), this;
}
expandByObject(e) {
e.updateWorldMatrix(!1, !1);
const t = e.geometry;
t !== void 0 && (t.boundingBox === null && t.computeBoundingBox(), lh.copy(t.boundingBox), lh.applyMatrix4(e.matrixWorld), this.union(lh));
const r = e.children;
for (let n = 0, o = r.length; n < o; n++)
this.expandByObject(r[n]);
return this;
}
containsPoint(e) {
return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y || e.z < this.min.z || e.z > this.max.z);
}
containsBox(e) {
return this.min.x <= e.min.x && e.max.x <= this.max.x && this.min.y <= e.min.y && e.max.y <= this.max.y && this.min.z <= e.min.z && e.max.z <= this.max.z;
}
getParameter(e, t) {
return t.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, bs), bs.distanceToSquared(e.center) <= e.radius * e.radius;
}
intersectsPlane(e) {
let t, r;
return e.normal.x > 0 ? (t = e.normal.x * this.min.x, r = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x, r = e.normal.x * this.min.x), e.normal.y > 0 ? (t += e.normal.y * this.min.y, r += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y, r += e.normal.y * this.min.y), e.normal.z > 0 ? (t += e.normal.z * this.min.z, r += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z, r += e.normal.z * this.min.z), t <= -e.constant && r >= -e.constant;
}
intersectsTriangle(e) {
if (this.isEmpty())
return !1;
this.getCenter(xs), Gl.subVectors(this.max, xs), Qo.subVectors(e.a, xs), ea.subVectors(e.b, xs), ta.subVectors(e.c, xs), Mn.subVectors(ea, Qo), Sn.subVectors(ta, ea), co.subVectors(Qo, ta);
let t = [
0,
-Mn.z,
Mn.y,
0,
-Sn.z,
Sn.y,
0,
-co.z,
co.y,
Mn.z,
0,
-Mn.x,
Sn.z,
0,
-Sn.x,
co.z,
0,
-co.x,
-Mn.y,
Mn.x,
0,
-Sn.y,
Sn.x,
0,
-co.y,
co.x,
0
];
return !ch(t, Qo, ea, ta, Gl) || (t = [1, 0, 0, 0, 1, 0, 0, 0, 1], !ch(t, Qo, ea, ta, Gl)) ? !1 : (Wl.crossVectors(Mn, Sn), t = [Wl.x, Wl.y, Wl.z], ch(t, Qo, ea, ta, Gl));
}
clampPoint(e, t) {
return t.copy(e).clamp(this.min, this.max);
}
distanceToPoint(e) {
return bs.copy(e).clamp(this.min, this.max).sub(e).length();
}
getBoundingSphere(e) {
return this.getCenter(e.center), e.radius = this.getSize(bs).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 : (Wr[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e), Wr[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e), Wr[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e), Wr[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e), Wr[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e), Wr[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e), Wr[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e), Wr[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e), this.setFromPoints(Wr), 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);
}
}
ji.prototype.isBox3 = !0;
const Wr = [
/* @__PURE__ */ new Z(),
/* @__PURE__ */ new Z(),
/* @__PURE__ */ new Z(),
/* @__PURE__ */ new Z(),
/* @__PURE__ */ new Z(),
/* @__PURE__ */ new Z(),
/* @__PURE__ */ new Z(),
/* @__PURE__ */ new Z()
], bs = /* @__PURE__ */ new Z(), lh = /* @__PURE__ */ new ji(), Qo = /* @__PURE__ */ new Z(), ea = /* @__PURE__ */ new Z(), ta = /* @__PURE__ */ new Z(), Mn = /* @__PURE__ */ new Z(), Sn = /* @__PURE__ */ new Z(), co = /* @__PURE__ */ new Z(), xs = /* @__PURE__ */ new Z(), Gl = /* @__PURE__ */ new Z(), Wl = /* @__PURE__ */ new Z(), uo = /* @__PURE__ */ new Z();
function ch(i, e, t, r, n) {
for (let o = 0, a = i.length - 3; o <= a; o += 3) {
uo.fromArray(i, o);
const s = n.x * Math.abs(uo.x) + n.y * Math.abs(uo.y) + n.z * Math.abs(uo.z), c = e.dot(uo), l = t.dot(uo), h = r.dot(uo);
if (Math.max(-Math.max(c, l, h), Math.min(c, l, h)) > s)
return !1;
}
return !0;
}
const xO = /* @__PURE__ */ new ji(), pg = /* @__PURE__ */ new Z(), uh = /* @__PURE__ */ new Z(), hh = /* @__PURE__ */ new Z();
class xn {
constructor(e = new Z(), t = -1) {
this.center = e, this.radius = t;
}
set(e, t) {
return this.center.copy(e), this.radius = t, this;
}
setFromPoints(e, t) {
const r = this.center;
t !== void 0 ? r.copy(t) : xO.setFromPoints(e).getCenter(r);
let n = 0;
for (let o = 0, a = e.length; o < a; o++)
n = Math.max(n, r.distanceToSquared(e[o]));
return this.radius = Math.sqrt(n), this;
}
copy(e) {
return this.center.copy(e.center), this.radius = e.radius, this;
}
isEmpty() {
return this.radius < 0;
}
makeEmpty() {
return this.center.set(0, 0, 0), this.radius = -1, this;
}
containsPoint(e) {
return e.distanceToSquared(this.center) <= this.radius * this.radius;
}
distanceToPoint(e) {
return e.distanceTo(this.center) - this.radius;
}
intersectsSphere(e) {
const t = this.radius + e.radius;
return e.center.distanceToSquared(this.center) <= t * t;
}
intersectsBox(e) {
return e.intersectsSphere(this);
}
intersectsPlane(e) {
return Math.abs(e.distanceToPoint(this.center)) <= this.radius;
}
clampPoint(e, t) {
const r = this.center.distanceToSquared(e);
return t.copy(e), r > this.radius * this.radius && (t.sub(this.center).normalize(), t.multiplyScalar(this.radius).add(this.center)), t;
}
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) {
hh.subVectors(e, this.center);
const t = hh.lengthSq();
if (t > this.radius * this.radius) {
const r = Math.sqrt(t), n = (r - this.radius) * 0.5;
this.center.add(hh.multiplyScalar(n / r)), this.radius += n;
}
return this;
}
union(e) {
return uh.subVectors(e.center, this.center).normalize().multiplyScalar(e.radius), this.expandByPoint(pg.copy(e.center).add(uh)), this.expandByPoint(pg.copy(e.center).sub(uh)), this;
}
equals(e) {
return e.center.equals(this.center) && e.radius === this.radius;
}
clone() {
return new this.constructor().copy(this);
}
}
const $r = /* @__PURE__ */ new Z(), dh = /* @__PURE__ */ new Z(), $l = /* @__PURE__ */ new Z(), Tn = /* @__PURE__ */ new Z(), ph = /* @__PURE__ */ new Z(), ql = /* @__PURE__ */ new Z(), fh = /* @__PURE__ */ new Z();
class ro {
constructor(e = new Z(), t = new Z(0, 0, -1)) {
this.origin = e, this.direction = t;
}
set(e, t) {
return this.origin.copy(e), this.direction.copy(t), this;
}
copy(e) {
return this.origin.copy(e.origin), this.direction.copy(e.direction), this;
}
at(e, t) {
return t.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, $r)), this;
}
closestPointToPoint(e, t) {
t.subVectors(e, this.origin);
const r = t.dot(this.direction);
return r < 0 ? t.copy(this.origin) : t.copy(this.direction).multiplyScalar(r).add(this.origin);
}
distanceToPoint(e) {
return Math.sqrt(this.distanceSqToPoint(e));
}
distanceSqToPoint(e) {
const t = $r.subVectors(e, this.origin).dot(this.direction);
return t < 0 ? this.origin.distanceToSquared(e) : ($r.copy(this.direction).multiplyScalar(t).add(this.origin), $r.distanceToSquared(e));
}
distanceSqToSegment(e, t, r, n) {
dh.copy(e).add(t).multiplyScalar(0.5), $l.copy(t).sub(e).normalize(), Tn.copy(this.origin).sub(dh);
const o = e.distanceTo(t) * 0.5, a = -this.direction.dot($l), s = Tn.dot(this.direction), c = -Tn.dot($l), l = Tn.lengthSq(), h = Math.abs(1 - a * a);
let u, p, m, g;
if (h > 0)
if (u = a * c - s, p = a * s - c, g = o * h, u >= 0)
if (p >= -g)
if (p <= g) {
const d = 1 / h;
u *= d, p *= d, m = u * (u + a * p + 2 * s) + p * (a * u + p + 2 * c) + l;
} else
p = o, u = Math.max(0, -(a * p + s)), m = -u * u + p * (p + 2 * c) + l;
else
p = -o, u = Math.max(0, -(a * p + s)), m = -u * u + p * (p + 2 * c) + l;
else
p <= -g ? (u = Math.max(0, -(-a * o + s)), p = u > 0 ? -o : Math.min(Math.max(-o, -c), o), m = -u * u + p * (p + 2 * c) + l) : p <= g ? (u = 0, p = Math.min(Math.max(-o, -c), o), m = p * (p + 2 * c) + l) : (u = Math.max(0, -(a * o + s)), p = u > 0 ? o : Math.min(Math.max(-o, -c), o), m = -u * u + p * (p + 2 * c) + l);
else
p = a > 0 ? -o : o, u = Math.max(0, -(a * p + s)), m = -u * u + p * (p + 2 * c) + l;
return r && r.copy(this.direction).multiplyScalar(u).add(this.origin), n && n.copy($l).multiplyScalar(p).add(dh), m;
}
intersectSphere(e, t) {
$r.subVectors(e.center, this.origin);
const r = $r.dot(this.direction), n = $r.dot($r) - r * r, o = e.radius * e.radius;
if (n > o) return null;
const a = Math.sqrt(o - n), s = r - a, c = r + a;
return s < 0 && c < 0 ? null : s < 0 ? this.at(c, t) : this.at(s, t);
}
intersectsSphere(e) {
return this.distanceSqToPoint(e.center) <= e.radius * e.radius;
}
distanceToPlane(e) {
const t = e.normal.dot(this.direction);
if (t === 0)
return e.distanceToPoint(this.origin) === 0 ? 0 : null;
const r = -(this.origin.dot(e.normal) + e.constant) / t;
return r >= 0 ? r : null;
}
intersectPlane(e, t) {
const r = this.distanceToPlane(e);
return r === null ? null : this.at(r, t);
}
intersectsPlane(e) {
const t = e.distanceToPoint(this.origin);
return t === 0 || e.normal.dot(this.direction) * t < 0;
}
intersectBox(e, t) {
let r, n, o, a, s, c;
const l = 1 / this.direction.x, h = 1 / this.direction.y, u = 1 / this.direction.z, p = this.origin;
return l >= 0 ? (r = (e.min.x - p.x) * l, n = (e.max.x - p.x) * l) : (r = (e.max.x - p.x) * l, n = (e.min.x - p.x) * l), h >= 0 ? (o = (e.min.y - p.y) * h, a = (e.max.y - p.y) * h) : (o = (e.max.y - p.y) * h, a = (e.min.y - p.y) * h), r > a || o > n || ((o > r || r !== r) && (r = o), (a < n || n !== n) && (n = a), u >= 0 ? (s = (e.min.z - p.z) * u, c = (e.max.z - p.z) * u) : (s = (e.max.z - p.z) * u, c = (e.min.z - p.z) * u), r > c || s > n) || ((s > r || r !== r) && (r = s), (c < n || n !== n) && (n = c), n < 0) ? null : this.at(r >= 0 ? r : n, t);
}
intersectsBox(e) {
return this.intersectBox(e, $r) !== null;
}
intersectTriangle(e, t, r, n, o) {
ph.subVectors(t, e), ql.subVectors(r, e), fh.crossVectors(ph, ql);
let a = this.direction.dot(fh), s;
if (a > 0) {
if (n) return null;
s = 1;
} else if (a < 0)
s = -1, a = -a;
else
return null;
Tn.subVectors(this.origin, e);
const c = s * this.direction.dot(ql.crossVectors(Tn, ql));
if (c < 0)
return null;
const l = s * this.direction.dot(ph.cross(Tn));
if (l < 0 || c + l > a)
return null;
const h = -s * Tn.dot(fh);
return h < 0 ? null : this.at(h / a, o);
}
applyMatrix4(e) {
return this.origin.applyMatrix4(e), this.direction.transformDirection(e), this;
}
equals(e) {
return e.origin.equals(this.origin) && e.direction.equals(this.direction);
}
clone() {
return new this.constructor().copy(this);
}
}
class $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, t, r, n, o, a, s, c, l, h, u, p, m, g, d, y) {
const f = this.elements;
return f[0] = e, f[4] = t, f[8] = r, f[12] = n, f[1] = o, f[5] = a, f[9] = s, f[13] = c, f[2] = l, f[6] = h, f[10] = u, f[14] = p, f[3] = m, f[7] = g, f[11] = d, f[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 t = this.elements, r = e.elements;
return t[0] = r[0], t[1] = r[1], t[2] = r[2], t[3] = r[3], t[4] = r[4], t[5] = r[5], t[6] = r[6], t[7] = r[7], t[8] = r[8], t[9] = r[9], t[10] = r[10], t[11] = r[11], t[12] = r[12], t[13] = r[13], t[14] = r[14], t[15] = r[15], this;
}
copyPosition(e) {
const t = this.elements, r = e.elements;
return t[12] = r[12], t[13] = r[13], t[14] = r[14], this;
}
setFromMatrix3(e) {
const t = e.elements;
return this.set(
t[0],
t[3],
t[6],
0,
t[1],
t[4],
t[7],
0,
t[2],
t[5],
t[8],
0,
0,
0,
0,
1
), this;
}
extractBasis(e, t, r) {
return e.setFromMatrixColumn(this, 0), t.setFromMatrixColumn(this, 1), r.setFromMatrixColumn(this, 2), this;
}
makeBasis(e, t, r) {
return this.set(
e.x,
t.x,
r.x,
0,
e.y,
t.y,
r.y,
0,
e.z,
t.z,
r.z,
0,
0,
0,
0,
1
), this;
}
extractRotation(e) {
const t = this.elements, r = e.elements, n = 1 / ia.setFromMatrixColumn(e, 0).length(), o = 1 / ia.setFromMatrixColumn(e, 1).length(), a = 1 / ia.setFromMatrixColumn(e, 2).length();
return t[0] = r[0] * n, t[1] = r[1] * n, t[2] = r[2] * n, t[3] = 0, t[4] = r[4] * o, t[5] = r[5] * o, t[6] = r[6] * o, t[7] = 0, t[8] = r[8] * a, t[9] = r[9] * a, t[10] = r[10] * a, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[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 t = this.elements, r = e.x, n = e.y, o = e.z, a = Math.cos(r), s = Math.sin(r), c = Math.cos(n), l = Math.sin(n), h = Math.cos(o), u = Math.sin(o);
if (e.order === "XYZ") {
const p = a * h, m = a * u, g = s * h, d = s * u;
t[0] = c * h, t[4] = -c * u, t[8] = l, t[1] = m + g * l, t[5] = p - d * l, t[9] = -s * c, t[2] = d - p * l, t[6] = g + m * l, t[10] = a * c;
} else if (e.order === "YXZ") {
const p = c * h, m = c * u, g = l * h, d = l * u;
t[0] = p + d * s, t[4] = g * s - m, t[8] = a * l, t[1] = a * u, t[5] = a * h, t[9] = -s, t[2] = m * s - g, t[6] = d + p * s, t[10] = a * c;
} else if (e.order === "ZXY") {
const p = c * h, m = c * u, g = l * h, d = l * u;
t[0] = p - d * s, t[4] = -a * u, t[8] = g + m * s, t[1] = m + g * s, t[5] = a * h, t[9] = d - p * s, t[2] = -a * l, t[6] = s, t[10] = a * c;
} else if (e.order === "ZYX") {
const p = a * h, m = a * u, g = s * h, d = s * u;
t[0] = c * h, t[4] = g * l - m, t[8] = p * l + d, t[1] = c * u, t[5] = d * l + p, t[9] = m * l - g, t[2] = -l, t[6] = s * c, t[10] = a * c;
} else if (e.order === "YZX") {
const p = a * c, m = a * l, g = s * c, d = s * l;
t[0] = c * h, t[4] = d - p * u, t[8] = g * u + m, t[1] = u, t[5] = a * h, t[9] = -s * h, t[2] = -l * h, t[6] = m * u + g, t[10] = p - d * u;
} else if (e.order === "XZY") {
const p = a * c, m = a * l, g = s * c, d = s * l;
t[0] = c * h, t[4] = -u, t[8] = l * h, t[1] = p * u + d, t[5] = a * h, t[9] = m * u - g, t[2] = g * u - m, t[6] = s * h, t[10] = d * u + p;
}
return t[3] = 0, t[7] = 0, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, this;
}
makeRotationFromQuaternion(e) {
return this.compose(wO, e, _O);
}
lookAt(e, t, r) {
const n = this.elements;
return Gi.subVectors(e, t), Gi.lengthSq() === 0 && (Gi.z = 1), Gi.normalize(), En.crossVectors(r, Gi), En.lengthSq() === 0 && (Math.abs(r.z) === 1 ? Gi.x += 1e-4 : Gi.z += 1e-4, Gi.normalize(), En.crossVectors(r, Gi)), En.normalize(), Xl.crossVectors(Gi, En), n[0] = En.x, n[4] = Xl.x, n[8] = Gi.x, n[1] = En.y, n[5] = Xl.y, n[9] = Gi.y, n[2] = En.z, n[6] = Xl.z, n[10] = Gi.z, this;
}
multiply(e, t) {
return t !== void 0 ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."), this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e);
}
premultiply(e) {
return this.multiplyMatrices(e, this);
}
multiplyMatrices(e, t) {
const r = e.elements, n = t.elements, o = this.elements, a = r[0], s = r[4], c = r[8], l = r[12], h = r[1], u = r[5], p = r[9], m = r[13], g = r[2], d = r[6], y = r[10], f = r[14], v = r[3], _ = r[7], M = r[11], T = r[15], w = n[0], b = n[4], E = n[8], S = n[12], C = n[1], R = n[5], L = n[9], A = n[13], P = n[2], O = n[6], x = n[10], I = n[14], N = n[3], D = n[7], k = n[11], F = n[15];
return o[0] = a * w + s * C + c * P + l * N, o[4] = a * b + s * R + c * O + l * D, o[8] = a * E + s * L + c * x + l * k, o[12] = a * S + s * A + c * I + l * F, o[1] = h * w + u * C + p * P + m * N, o[5] = h * b + u * R + p * O + m * D, o[9] = h * E + u * L + p * x + m * k, o[13] = h * S + u * A + p * I + m * F, o[2] = g * w + d * C + y * P + f * N, o[6] = g * b + d * R + y * O + f * D, o[10] = g * E + d * L + y * x + f * k, o[14] = g * S + d * A + y * I + f * F, o[3] = v * w + _ * C + M * P + T * N, o[7] = v * b + _ * R + M * O + T * D, o[11] = v * E + _ * L + M * x + T * k, o[15] = v * S + _ * A + M * I + T * F, this;
}
multiplyScalar(e) {
const t = this.elements;
return t[0] *= e, t[4] *= e, t[8] *= e, t[12] *= e, t[1] *= e, t[5] *= e, t[9] *= e, t[13] *= e, t[2] *= e, t[6] *= e, t[10] *= e, t[14] *= e, t[3] *= e, t[7] *= e, t[11] *= e, t[15] *= e, this;
}
determinant() {
const e = this.elements, t = e[0], r = e[4], n = e[8], o = e[12], a = e[1], s = e[5], c = e[9], l = e[13], h = e[2], u = e[6], p = e[10], m = e[14], g = e[3], d = e[7], y = e[11], f = e[15];
return g * (+o * c * u - n * l * u - o * s * p + r * l * p + n * s * m - r * c * m) + d * (+t * c * m - t * l * p + o * a * p - n * a * m + n * l * h - o * c * h) + y * (+t * l * u - t * s * m - o * a * u + r * a * m + o * s * h - r * l * h) + f * (-n * s * h - t * c * u + t * s * p + n * a * u - r * a * p + r * c * h);
}
transpose() {
const e = this.elements;
let t;
return t = e[1], e[1] = e[4], e[4] = t, t = e[2], e[2] = e[8], e[8] = t, t = e[6], e[6] = e[9], e[9] = t, t = e[3], e[3] = e[12], e[12] = t, t = e[7], e[7] = e[13], e[13] = t, t = e[11], e[11] = e[14], e[14] = t, this;
}
setPosition(e, t, r) {
const n = this.elements;
return e.isVector3 ? (n[12] = e.x, n[13] = e.y, n[14] = e.z) : (n[12] = e, n[13] = t, n[14] = r), this;
}
invert() {
const e = this.elements, t = e[0], r = e[1], n = e[2], o = e[3], a = e[4], s = e[5], c = e[6], l = e[7], h = e[8], u = e[9], p = e[10], m = e[11], g = e[12], d = e[13], y = e[14], f = e[15], v = u * y * l - d * p * l + d * c * m - s * y * m - u * c * f + s * p * f, _ = g * p * l - h * y * l - g * c * m + a * y * m + h * c * f - a * p * f, M = h * d * l - g * u * l + g * s * m - a * d * m - h * s * f + a * u * f, T = g * u * c - h * d * c - g * s * p + a * d * p + h * s * y - a * u * y, w = t * v + r * _ + n * M + o * T;
if (w === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
const b = 1 / w;
return e[0] = v * b, e[1] = (d * p * o - u * y * o - d * n * m + r * y * m + u * n * f - r * p * f) * b, e[2] = (s * y * o - d * c * o + d * n * l - r * y * l - s * n * f + r * c * f) * b, e[3] = (u * c * o - s * p * o - u * n * l + r * p * l + s * n * m - r * c * m) * b, e[4] = _ * b, e[5] = (h * y * o - g * p * o + g * n * m - t * y * m - h * n * f + t * p * f) * b, e[6] = (g * c * o - a * y * o - g * n * l + t * y * l + a * n * f - t * c * f) * b, e[7] = (a * p * o - h * c * o + h * n * l - t * p * l - a * n * m + t * c * m) * b, e[8] = M * b, e[9] = (g * u * o - h * d * o - g * r * m + t * d * m + h * r * f - t * u * f) * b, e[10] = (a * d * o - g * s * o + g * r * l - t * d * l - a * r * f + t * s * f) * b, e[11] = (h * s * o - a * u * o - h * r * l + t * u * l + a * r * m - t * s * m) * b, e[12] = T * b, e[13] = (h * d * n - g * u * n + g * r * p - t * d * p - h * r * y + t * u * y) * b, e[14] = (g * s * n - a * d * n - g * r * c + t * d * c + a * r * y - t * s * y) * b, e[15] = (a * u * n - h * s * n + h * r * c - t * u * c - a * r * p + t * s * p) * b, this;
}
scale(e) {
const t = this.elements, r = e.x, n = e.y, o = e.z;
return t[0] *= r, t[4] *= n, t[8] *= o, t[1] *= r, t[5] *= n, t[9] *= o, t[2] *= r, t[6] *= n, t[10] *= o, t[3] *= r, t[7] *= n, t[11] *= o, this;
}
getMaxScaleOnAxis() {
const e = this.elements, t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2], r = e[4] * e[4] + e[5] * e[5] + e[6] * e[6], n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
return Math.sqrt(Math.max(t, r, n));
}
makeTranslation(e, t, r) {
return this.set(
1,
0,
0,
e,
0,
1,
0,
t,
0,
0,
1,
r,
0,
0,
0,
1
), this;
}
makeRotationX(e) {
const t = Math.cos(e), r = Math.sin(e);
return this.set(
1,
0,
0,
0,
0,
t,
-r,
0,
0,
r,
t,
0,
0,
0,
0,
1
), this;
}
makeRotationY(e) {
const t = Math.cos(e), r = Math.sin(e);
return this.set(
t,
0,
r,
0,
0,
1,
0,
0,
-r,
0,
t,
0,
0,
0,
0,
1
), this;
}
makeRotationZ(e) {
const t = Math.cos(e), r = Math.sin(e);
return this.set(
t,
-r,
0,
0,
r,
t,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1
), this;
}
makeRotationAxis(e, t) {
const r = Math.cos(t), n = Math.sin(t), o = 1 - r, a = e.x, s = e.y, c = e.z, l = o * a, h = o * s;
return this.set(
l * a + r,
l * s - n * c,
l * c + n * s,
0,
l * s + n * c,
h * s + r,
h * c - n * a,
0,
l * c - n * s,
h * c + n * a,
o * c * c + r,
0,
0,
0,
0,
1
), this;
}
makeScale(e, t, r) {
return this.set(
e,
0,
0,
0,
0,
t,
0,
0,
0,
0,
r,
0,
0,
0,
0,
1
), this;
}
makeShear(e, t, r, n, o, a) {
return this.set(
1,
r,
o,
0,
e,
1,
a,
0,
t,
n,
1,
0,
0,
0,
0,
1
), this;
}
compose(e, t, r) {
const n = this.elements, o = t._x, a = t._y, s = t._z, c = t._w, l = o + o, h = a + a, u = s + s, p = o * l, m = o * h, g = o * u, d = a * h, y = a * u, f = s * u, v = c * l, _ = c * h, M = c * u, T = r.x, w = r.y, b = r.z;
return n[0] = (1 - (d + f)) * T, n[1] = (m + M) * T, n[2] = (g - _) * T, n[3] = 0, n[4] = (m - M) * w, n[5] = (1 - (p + f)) * w, n[6] = (y + v) * w, n[7] = 0, n[8] = (g + _) * b, n[9] = (y - v) * b, n[10] = (1 - (p + d)) * b, n[11] = 0, n[12] = e.x, n[13] = e.y, n[14] = e.z, n[15] = 1, this;
}
decompose(e, t, r) {
const n = this.elements;
let o = ia.set(n[0], n[1], n[2]).length();
const a = ia.set(n[4], n[5], n[6]).length(), s = ia.set(n[8], n[9], n[10]).length();
this.determinant() < 0 && (o = -o), e.x = n[12], e.y = n[13], e.z = n[14], ur.copy(this);
const c = 1 / o, l = 1 / a, h = 1 / s;
return ur.elements[0] *= c, ur.elements[1] *= c, ur.elements[2] *= c, ur.elements[4] *= l, ur.elements[5] *= l, ur.elements[6] *= l, ur.elements[8] *= h, ur.elements[9] *= h, ur.elements[10] *= h, t.setFromRotationMatrix(ur), r.x = o, r.y = a, r.z = s, this;
}
makePerspective(e, t, r, n, o, a) {
a === void 0 && console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");
const s = this.elements, c = 2 * o / (t - e), l = 2 * o / (r - n), h = (t + e) / (t - e), u = (r + n) / (r - n), p = -(a + o) / (a - o), m = -2 * a * o / (a - o);
return s[0] = c, s[4] = 0, s[8] = h, s[12] = 0, s[1] = 0, s[5] = l, s[9] = u, s[13] = 0, s[2] = 0, s[6] = 0, s[10] = p, s[14] = m, s[3] = 0, s[7] = 0, s[11] = -1, s[15] = 0, this;
}
makeOrthographic(e, t, r, n, o, a) {
const s = this.elements, c = 1 / (t - e), l = 1 / (r - n), h = 1 / (a - o), u = (t + e) * c, p = (r + n) * l, m = (a + o) * h;
return s[0] = 2 * c, s[4] = 0, s[8] = 0, s[12] = -u, s[1] = 0, s[5] = 2 * l, s[9] = 0, s[13] = -p, s[2] = 0, s[6] = 0, s[10] = -2 * h, s[14] = -m, s[3] = 0, s[7] = 0, s[11] = 0, s[15] = 1, this;
}
equals(e) {
const t = this.elements, r = e.elements;
for (let n = 0; n < 16; n++)
if (t[n] !== r[n]) return !1;
return !0;
}
fromArray(e, t = 0) {
for (let r = 0; r < 16; r++)
this.elements[r] = e[r + t];
return this;
}
toArray(e = [], t = 0) {
const r = this.elements;
return e[t] = r[0], e[t + 1] = r[1], e[t + 2] = r[2], e[t + 3] = r[3], e[t + 4] = r[4], e[t + 5] = r[5], e[t + 6] = r[6], e[t + 7] = r[7], e[t + 8] = r[8], e[t + 9] = r[9], e[t + 10] = r[10], e[t + 11] = r[11], e[t + 12] = r[12], e[t + 13] = r[13], e[t + 14] = r[14], e[t + 15] = r[15], e;
}
}
$e.prototype.isMatrix4 = !0;
const ia = /* @__PURE__ */ new Z(), ur = /* @__PURE__ */ new $e(), wO = /* @__PURE__ */ new Z(0, 0, 0), _O = /* @__PURE__ */ new Z(1, 1, 1), En = /* @__PURE__ */ new Z(), Xl = /* @__PURE__ */ new Z(), Gi = /* @__PURE__ */ new Z(), fg = /* @__PURE__ */ new $e(), mg = /* @__PURE__ */ new wi();
class Wo {
constructor(e = 0, t = 0, r = 0, n = Wo.DefaultOrder) {
this._x = e, this._y = t, this._z = r, this._order = n;
}
get x() {
return this._x;
}
set x(e) {
this._x = e, this._onChangeCallback();
}
get y() {
return this._y;
}
set y(e) {
this._y = e, this._onChangeCallback();
}
get z() {
return this._z;
}
set z(e) {
this._z = e, this._onChangeCallback();
}
get order() {
return this._order;
}
set order(e) {
this._order = e, this._onChangeCallback();
}
set(e, t, r, n = this._order) {
return this._x = e, this._y = t, this._z = r, this._order = n, this._onChangeCallback(), this;
}
clone() {
return new this.constructor(this._x, this._y, this._z, this._order);
}
copy(e) {
return this._x = e._x, this._y = e._y, this._z = e._z, this._order = e._order, this._onChangeCallback(), this;
}
setFromRotationMatrix(e, t = this._order, r = !0) {
const n = e.elements, o = n[0], a = n[4], s = n[8], c = n[1], l = n[5], h = n[9], u = n[2], p = n[6], m = n[10];
switch (t) {
case "XYZ":
this._y = Math.asin(bi(s, -1, 1)), Math.abs(s) < 0.9999999 ? (this._x = Math.atan2(-h, m), this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(p, l), this._z = 0);
break;
case "YXZ":
this._x = Math.asin(-bi(h, -1, 1)), Math.abs(h) < 0.9999999 ? (this._y = Math.atan2(s, m), this._z = Math.atan2(c, l)) : (this._y = Math.atan2(-u, o), this._z = 0);
break;
case "ZXY":
this._x = Math.asin(bi(p, -1, 1)), Math.abs(p) < 0.9999999 ? (this._y = Math.atan2(-u, m), this._z = Math.atan2(-a, l)) : (this._y = 0, this._z = Math.atan2(c, o));
break;
case "ZYX":
this._y = Math.asin(-bi(u, -1, 1)), Math.abs(u) < 0.9999999 ? (this._x = Math.atan2(p, m), this._z = Math.atan2(c, o)) : (this._x = 0, this._z = Math.atan2(-a, l));
break;
case "YZX":
this._z = Math.asin(bi(c, -1, 1)), Math.abs(c) < 0.9999999 ? (this._x = Math.atan2(-h, l), this._y = Math.atan2(-u, o)) : (this._x = 0, this._y = Math.atan2(s, m));
break;
case "XZY":
this._z = Math.asin(-bi(a, -1, 1)), Math.abs(a) < 0.9999999 ? (this._x = Math.atan2(p, l), this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, m), this._y = 0);
break;
default:
console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: " + t);
}
return this._order = t, r === !0 && this._onChangeCallback(), this;
}
setFromQuaternion(e, t, r) {
return fg.makeRotationFromQuaternion(e), this.setFromRotationMatrix(fg, t, r);
}
setFromVector3(e, t = this._order) {
return this.set(e.x, e.y, e.z, t);
}
reorder(e) {
return mg.setFromEuler(this), this.setFromQuaternion(mg, 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 = [], t = 0) {
return e[t] = this._x, e[t + 1] = this._y, e[t + 2] = this._z, e[t + 3] = this._order, e;
}
toVector3(e) {
return e ? e.set(this._x, this._y, this._z) : new Z(this._x, this._y, this._z);
}
_onChange(e) {
return this._onChangeCallback = e, this;
}
_onChangeCallback() {
}
}
Wo.prototype.isEuler = !0;
Wo.DefaultOrder = "XYZ";
Wo.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"];
class Zp {
constructor() {
this.mask = 1;
}
set(e) {
this.mask = 1 << e | 0;
}
enable(e) {
this.mask |= 1 << e | 0;
}
enableAll() {
this.mask = -1;
}
toggle(e) {
this.mask ^= 1 << e | 0;
}
disable(e) {
this.mask &= ~(1 << e | 0);
}
disableAll() {
this.mask = 0;
}
test(e) {
return (this.mask & e.mask) !== 0;
}
}
let MO = 0;
const gg = /* @__PURE__ */ new Z(), ra = /* @__PURE__ */ new wi(), qr = /* @__PURE__ */ new $e(), Zl = /* @__PURE__ */ new Z(), ws = /* @__PURE__ */ new Z(), SO = /* @__PURE__ */ new Z(), TO = /* @__PURE__ */ new wi(), vg = /* @__PURE__ */ new Z(1, 0, 0), yg = /* @__PURE__ */ new Z(0, 1, 0), bg = /* @__PURE__ */ new Z(0, 0, 1), EO = { type: "added" }, xg = { type: "removed" };
class ot extends io {
constructor() {
super(), Object.defineProperty(this, "id", { value: MO++ }), this.uuid = Zi(), this.name = "", this.type = "Object3D", this.parent = null, this.children = [], this.up = ot.DefaultUp.clone();
const e = new Z(), t = new Wo(), r = new wi(), n = new Z(1, 1, 1);
function o() {
r.setFromEuler(t, !1);
}
function a() {
t.setFromQuaternion(r, void 0, !1);
}
t._onChange(o), r._onChange(a), Object.defineProperties(this, {
position: {
configurable: !0,
enumerable: !0,
value: e
},
rotation: {
configurable: !0,
enumerable: !0,
value: t
},
quaternion: {
configurable: !0,
enumerable: !0,
value: r
},
scale: {
configurable: !0,
enumerable: !0,
value: n
},
modelViewMatrix: {
value: new $e()
},
normalMatrix: {
value: new ai()
}
}), this.matrix = new $e(), this.matrixWorld = new $e(), this.matrixAutoUpdate = ot.DefaultMatrixAutoUpdate, this.matrixWorldNeedsUpdate = !1, this.layers = new Zp(), this.visible = !0, this.castShadow = !1, this.receiveShadow = !1, this.frustumCulled = !0, this.renderOrder = 0, this.animations = [], this.userData = {};
}
onBeforeRender() {
}
onAfterRender() {
}
applyMatrix4(e) {
this.matrixAutoUpdate && this.updateMatrix(), this.matrix.premultiply(e), this.matrix.decompose(this.position, this.quaternion, this.scale);
}
applyQuaternion(e) {
return this.quaternion.premultiply(e), this;
}
setRotationFromAxisAngle(e, t) {
this.quaternion.setFromAxisAngle(e, t);
}
setRotationFromEuler(e) {
this.quaternion.setFromEuler(e, !0);
}
setRotationFromMatrix(e) {
this.quaternion.setFromRotationMatrix(e);
}
setRotationFromQuaternion(e) {
this.quaternion.copy(e);
}
rotateOnAxis(e, t) {
return ra.setFromAxisAngle(e, t), this.quaternion.multiply(ra), this;
}
rotateOnWorldAxis(e, t) {
return ra.setFromAxisAngle(e, t), this.quaternion.premultiply(ra), this;
}
rotateX(e) {
return this.rotateOnAxis(vg, e);
}
rotateY(e) {
return this.rotateOnAxis(yg, e);
}
rotateZ(e) {
return this.rotateOnAxis(bg, e);
}
translateOnAxis(e, t) {
return gg.copy(e).applyQuaternion(this.quaternion), this.position.add(gg.multiplyScalar(t)), this;
}
translateX(e) {
return this.translateOnAxis(vg, e);
}
translateY(e) {
return this.translateOnAxis(yg, e);
}
translateZ(e) {
return this.translateOnAxis(bg, e);
}
localToWorld(e) {
return e.applyMatrix4(this.matrixWorld);
}
worldToLocal(e) {
return e.applyMatrix4(qr.copy(this.matrixWorld).invert());
}
lookAt(e, t, r) {
e.isVector3 ? Zl.copy(e) : Zl.set(e, t, r);
const n = this.parent;
this.updateWorldMatrix(!0, !1), ws.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? qr.lookAt(ws, Zl, this.up) : qr.lookAt(Zl, ws, this.up), this.quaternion.setFromRotationMatrix(qr), n && (qr.extractRotation(n.matrixWorld), ra.setFromRotationMatrix(qr), this.quaternion.premultiply(ra.invert()));
}
add(e) {
if (arguments.length > 1) {
for (let t = 0; t < arguments.length; t++)
this.add(arguments[t]);
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(EO)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e), this);
}
remove(e) {
if (arguments.length > 1) {
for (let r = 0; r < arguments.length; r++)
this.remove(arguments[r]);
return this;
}
const t = this.children.indexOf(e);
return t !== -1 && (e.parent = null, this.children.splice(t, 1), e.dispatchEvent(xg)), this;
}
removeFromParent() {
const e = this.parent;
return e !== null && e.remove(this), this;
}
clear() {
for (let e = 0; e < this.children.length; e++) {
const t = this.children[e];
t.parent = null, t.dispatchEvent(xg);
}
return this.children.length = 0, this;
}
attach(e) {
return this.updateWorldMatrix(!0, !1), qr.copy(this.matrixWorld).invert(), e.parent !== null && (e.parent.updateWorldMatrix(!0, !1), qr.multiply(e.parent.matrixWorld)), e.applyMatrix4(qr), this.add(e), e.updateWorldMatrix(!1, !0), this;
}
getObjectById(e) {
return this.getObjectByProperty("id", e);
}
getObjectByName(e) {
return this.getObjectByProperty("name", e);
}
getObjectByProperty(e, t) {
if (this[e] === t) return this;
for (let r = 0, n = this.children.length; r < n; r++) {
const o = this.children[r].getObjectByProperty(e, t);
if (o !== void 0)
return o;
}
}
getWorldPosition(e) {
return this.updateWorldMatrix(!0, !1), e.setFromMatrixPosition(this.matrixWorld);
}
getWorldQuaternion(e) {
return this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(ws, e, SO), e;
}
getWorldScale(e) {
return this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(ws, TO, e), e;
}
getWorldDirection(e) {
this.updateWorldMatrix(!0, !1);
const t = this.matrixWorld.elements;
return e.set(t[8], t[9], t[10]).normalize();
}
raycast() {
}
traverse(e) {
e(this);
const t = this.children;
for (let r = 0, n = t.length; r < n; r++)
t[r].traverse(e);
}
traverseVisible(e) {
if (this.visible === !1) return;
e(this);
const t = this.children;
for (let r = 0, n = t.length; r < n; r++)
t[r].traverseVisible(e);
}
traverseAncestors(e) {
const t = this.parent;
t !== null && (e(t), t.traverseAncestors(e));
}
updateMatrix() {
this.matrix.compose(this.position, this.quaternion, this.scale), this.matrixWorldNeedsUpdate = !0;
}
updateMatrixWorld(e) {
this.matrixAutoUpdate && this.updateMatrix(), (this.matrixWorldNeedsUpdate || e) && (this.parent === null ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix), this.matrixWorldNeedsUpdate = !1, e = !0);
const t = this.children;
for (let r = 0, n = t.length; r < n; r++)
t[r].updateMatrixWorld(e);
}
updateWorldMatrix(e, t) {
const r = this.parent;
if (e === !0 && r !== null && r.updateWorldMatrix(!0, !1), this.matrixAutoUpdate && this.updateMatrix(), this.parent === null ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix), t === !0) {
const n = this.children;
for (let o = 0, a = n.length; o < a; o++)
n[o].updateWorldMatrix(!1, !0);
}
}
toJSON(e) {
const t = e === void 0 || typeof e == "string", r = {};
t && (e = {
geometries: {},
materials: {},
textures: {},
images: {},
shapes: {},
skeletons: {},
animations: {}
}, r.metadata = {
version: 4.5,
type: "Object",
generator: "Object3D.toJSON"
});
const n = {};
n.uuid = this.uuid, n.type = this.type, this.name !== "" && (n.name = this.name), this.castShadow === !0 && (n.castShadow = !0), this.receiveShadow === !0 && (n.receiveShadow = !0), this.visible === !1 && (n.visible = !1), this.frustumCulled === !1 && (n.frustumCulled = !1), this.renderOrder !== 0 && (n.renderOrder = this.renderOrder), JSON.stringify(this.userData) !== "{}" && (n.userData = this.userData), n.layers = this.layers.mask, n.matrix = this.matrix.toArray(), this.matrixAutoUpdate === !1 && (n.matrixAutoUpdate = !1), this.isInstancedMesh && (n.type = "InstancedMesh", n.count = this.count, n.instanceMatrix = this.instanceMatrix.toJSON(), this.instanceColor !== null && (n.instanceColor = this.instanceColor.toJSON()));
function o(s, c) {
return s[c.uuid] === void 0 && (s[c.uuid] = c.toJSON(e)), c.uuid;
}
if (this.isScene)
this.background && (this.background.isColor ? n.background = this.background.toJSON() : this.background.isTexture && (n.background = this.background.toJSON(e).uuid)), this.environment && this.environment.isTexture && (n.environment = this.environment.toJSON(e).uuid);
else if (this.isMesh || this.isLine || this.isPoints) {
n.geometry = o(e.geometries, this.geometry);
const s = this.geometry.parameters;
if (s !== void 0 && s.shapes !== void 0) {
const c = s.shapes;
if (Array.isArray(c))
for (let l = 0, h = c.length; l < h; l++) {
const u = c[l];
o(e.shapes, u);
}
else
o(e.shapes, c);
}
}
if (this.isSkinnedMesh && (n.bindMode = this.bindMode, n.bindMatrix = this.bindMatrix.toArray(), this.skeleton !== void 0 && (o(e.skeletons, this.skeleton), n.skeleton = this.skeleton.uuid)), this.material !== void 0)
if (Array.isArray(this.material)) {
const s = [];
for (let c = 0, l = this.material.length; c < l; c++)
s.push(o(e.materials, this.material[c]));
n.material = s;
} else
n.material = o(e.materials, this.material);
if (this.children.length > 0) {
n.children = [];
for (let s = 0; s < this.children.length; s++)
n.children.push(this.children[s].toJSON(e).object);
}
if (this.animations.length > 0) {
n.animations = [];
for (let s = 0; s < this.animations.length; s++) {
const c = this.animations[s];
n.animations.push(o(e.animations, c));
}
}
if (t) {
const s = a(e.geometries), c = a(e.materials), l = a(e.textures), h = a(e.images), u = a(e.shapes), p = a(e.skeletons), m = a(e.animations);
s.length > 0 && (r.geometries = s), c.length > 0 && (r.materials = c), l.length > 0 && (r.textures = l), h.length > 0 && (r.images = h), u.length > 0 && (r.shapes = u), p.length > 0 && (r.skeletons = p), m.length > 0 && (r.animations = m);
}
return r.object = n, r;
function a(s) {
const c = [];
for (const l in s) {
const h = s[l];
delete h.metadata, c.push(h);
}
return c;
}
}
clone(e) {
return new this.constructor().copy(this, e);
}
copy(e, t = !0) {
if (this.name = e.name, this.up.copy(e.up), this.position.copy(e.position), this.rotation.order = e.rotation.order, this.quaternion.copy(e.quaternion), this.scale.copy(e.scale), this.matrix.copy(e.matrix), this.matrixWorld.copy(e.matrixWorld), this.matrixAutoUpdate = e.matrixAutoUpdate, this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate, this.layers.mask = e.layers.mask, this.visible = e.visible, this.castShadow = e.castShadow, this.receiveShadow = e.receiveShadow, this.frustumCulled = e.frustumCulled, this.renderOrder = e.renderOrder, this.userData = JSON.parse(JSON.stringify(e.userData)), t === !0)
for (let r = 0; r < e.children.length; r++) {
const n = e.children[r];
this.add(n.clone());
}
return this;
}
}
ot.DefaultUp = new Z(0, 1, 0);
ot.DefaultMatrixAutoUpdate = !0;
ot.prototype.isObject3D = !0;
const hr = /* @__PURE__ */ new Z(), Xr = /* @__PURE__ */ new Z(), mh = /* @__PURE__ */ new Z(), Zr = /* @__PURE__ */ new Z(), na = /* @__PURE__ */ new Z(), oa = /* @__PURE__ */ new Z(), wg = /* @__PURE__ */ new Z(), gh = /* @__PURE__ */ new Z(), vh = /* @__PURE__ */ new Z(), yh = /* @__PURE__ */ new Z();
class Kt {
constructor(e = new Z(), t = new Z(), r = new Z()) {
this.a = e, this.b = t, this.c = r;
}
static getNormal(e, t, r, n) {
n.subVectors(r, t), hr.subVectors(e, t), n.cross(hr);
const o = n.lengthSq();
return o > 0 ? n.multiplyScalar(1 / Math.sqrt(o)) : n.set(0, 0, 0);
}
// static/instance method to calculate barycentric coordinates
// based on: http://www.blackpawn.com/texts/pointinpoly/default.html
static getBarycoord(e, t, r, n, o) {
hr.subVectors(n, t), Xr.subVectors(r, t), mh.subVectors(e, t);
const a = hr.dot(hr), s = hr.dot(Xr), c = hr.dot(mh), l = Xr.dot(Xr), h = Xr.dot(mh), u = a * l - s * s;
if (u === 0)
return o.set(-2, -1, -1);
const p = 1 / u, m = (l * c - s * h) * p, g = (a * h - s * c) * p;
return o.set(1 - m - g, g, m);
}
static containsPoint(e, t, r, n) {
return this.getBarycoord(e, t, r, n, Zr), Zr.x >= 0 && Zr.y >= 0 && Zr.x + Zr.y <= 1;
}
static getUV(e, t, r, n, o, a, s, c) {
return this.getBarycoord(e, t, r, n, Zr), c.set(0, 0), c.addScaledVector(o, Zr.x), c.addScaledVector(a, Zr.y), c.addScaledVector(s, Zr.z), c;
}
static isFrontFacing(e, t, r, n) {
return hr.subVectors(r, t), Xr.subVectors(e, t), hr.cross(Xr).dot(n) < 0;
}
set(e, t, r) {
return this.a.copy(e), this.b.copy(t), this.c.copy(r), this;
}
setFromPointsAndIndices(e, t, r, n) {
return this.a.copy(e[t]), this.b.copy(e[r]), this.c.copy(e[n]), this;
}
clone() {
return new this.constructor().copy(this);
}
copy(e) {
return this.a.copy(e.a), this.b.copy(e.b), this.c.copy(e.c), this;
}
getArea() {
return hr.subVectors(this.c, this.b), Xr.subVectors(this.a, this.b), hr.cross(Xr).length() * 0.5;
}
getMidpoint(e) {
return e.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3);
}
getNormal(e) {
return Kt.getNormal(this.a, this.b, this.c, e);
}
getPlane(e) {
return e.setFromCoplanarPoints(this.a, this.b, this.c);
}
getBarycoord(e, t) {
return Kt.getBarycoord(e, this.a, this.b, this.c, t);
}
getUV(e, t, r, n, o) {
return Kt.getUV(e, this.a, this.b, this.c, t, r, n, o);
}
containsPoint(e) {
return Kt.containsPoint(e, this.a, this.b, this.c);
}
isFrontFacing(e) {
return Kt.isFrontFacing(this.a, this.b, this.c, e);
}
intersectsBox(e) {
return e.intersectsTriangle(this);
}
closestPointToPoint(e, t) {
const r = this.a, n = this.b, o = this.c;
let a, s;
na.subVectors(n, r), oa.subVectors(o, r), gh.subVectors(e, r);
const c = na.dot(gh), l = oa.dot(gh);
if (c <= 0 && l <= 0)
return t.copy(r);
vh.subVectors(e, n);
const h = na.dot(vh), u = oa.dot(vh);
if (h >= 0 && u <= h)
return t.copy(n);
const p = c * u - h * l;
if (p <= 0 && c >= 0 && h <= 0)
return a = c / (c - h), t.copy(r).addScaledVector(na, a);
yh.subVectors(e, o);
const m = na.dot(yh), g = oa.dot(yh);
if (g >= 0 && m <= g)
return t.copy(o);
const d = m * l - c * g;
if (d <= 0 && l >= 0 && g <= 0)
return s = l / (l - g), t.copy(r).addScaledVector(oa, s);
const y = h * g - m * u;
if (y <= 0 && u - h >= 0 && m - g >= 0)
return wg.subVectors(o, n), s = (u - h) / (u - h + (m - g)), t.copy(n).addScaledVector(wg, s);
const f = 1 / (y + d + p);
return a = d * f, s = p * f, t.copy(r).addScaledVector(na, a).addScaledVector(oa, s);
}
equals(e) {
return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c);
}
}
let AO = 0;
class ri extends io {
constructor() {
super(), Object.defineProperty(this, "id", { value: AO++ }), this.uuid = Zi(), this.name = "", this.type = "Material", this.fog = !0, this.blending = Sa, this.side = Xn, this.vertexColors = !1, this.opacity = 1, this.transparent = !1, this.blendSrc = Up, this.blendDst = Vp, this.blendEquation = bo, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.depthFunc = Kc, this.depthTest = !0, this.depthWrite = !0, this.stencilWriteMask = 255, this.stencilFunc = hx, this.stencilRef = 0, this.stencilFuncMask = 255, this.stencilFail = Vc, this.stencilZFail = Vc, this.stencilZPass = Vc, this.stencilWrite = !1, this.clippingPlanes = null, this.clipIntersection = !1, this.clipShadows = !1, this.shadowSide = null, this.colorWrite = !0, this.precision = null, this.polygonOffset = !1, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.dithering = !1, this.alphaTest = 0, this.alphaToCoverage = !1, this.premultipliedAlpha = !1, this.visible = !0, this.toneMapped = !0, this.userData = {}, this.version = 0;
}
onBuild() {
}
onBeforeCompile() {
}
customProgramCacheKey() {
return this.onBeforeCompile.toString();
}
setValues(e) {
if (e !== void 0)
for (const t in e) {
const r = e[t];
if (r === void 0) {
console.warn("THREE.Material: '" + t + "' parameter is undefined.");
continue;
}
if (t === "shading") {
console.warn("THREE." + this.type + ": .shading has been removed. Use the boolean .flatShading instead."), this.flatShading = r === zp;
continue;
}
const n = this[t];
if (n === void 0) {
console.warn("THREE." + this.type + ": '" + t + "' is not a property of this material.");
continue;
}
n && n.isColor ? n.set(r) : n && n.isVector3 && r && r.isVector3 ? n.copy(r) : this[t] = r;
}
}
toJSON(e) {
const t = e === void 0 || typeof e == "string";
t && (e = {
textures: {},
images: {}
});
const r = {
metadata: {
version: 4.5,
type: "Material",
generator: "Material.toJSON"
}
};
r.uuid = this.uuid, r.type = this.type, this.name !== "" && (r.name = this.name), this.color && this.color.isColor && (r.color = this.color.getHex()), this.roughness !== void 0 && (r.roughness = this.roughness), this.metalness !== void 0 && (r.metalness = this.metalness), this.sheen && this.sheen.isColor && (r.sheen = this.sheen.getHex()), this.emissive && this.emissive.isColor && (r.emissive = this.emissive.getHex()), this.emissiveIntensity && this.emissiveIntensity !== 1 && (r.emissiveIntensity = this.emissiveIntensity), this.specular && this.specular.isColor && (r.specular = this.specular.getHex()), this.shininess !== void 0 && (r.shininess = this.shininess), this.clearcoat !== void 0 && (r.clearcoat = this.clearcoat), this.clearcoatRoughness !== void 0 && (r.clearcoatRoughness = this.clearcoatRoughness), this.clearcoatMap && this.clearcoatMap.isTexture && (r.clearcoatMap = this.clearcoatMap.toJSON(e).uuid), this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture && (r.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(e).uuid), this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture && (r.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(e).uuid, r.clearcoatNormalScale = this.clearcoatNormalScale.toArray()), this.map && this.map.isTexture && (r.map = this.map.toJSON(e).uuid), this.matcap && this.matcap.isTexture && (r.matcap = this.matcap.toJSON(e).uuid), this.alphaMap && this.alphaMap.isTexture && (r.alphaMap = this.alphaMap.toJSON(e).uuid), this.lightMap && this.lightMap.isTexture && (r.lightMap = this.lightMap.toJSON(e).uuid, r.lightMapIntensity = this.lightMapIntensity), this.aoMap && this.aoMap.isTexture && (r.aoMap = this.aoMap.toJSON(e).uuid, r.aoMapIntensity = this.aoMapIntensity), this.bumpMap && this.bumpMap.isTexture && (r.bumpMap = this.bumpMap.toJSON(e).uuid, r.bumpScale = this.bumpScale), this.normalMap && this.normalMap.isTexture && (r.normalMap = this.normalMap.toJSON(e).uuid, r.normalMapType = this.normalMapType, r.normalScale = this.normalScale.toArray()), this.displacementMap && this.displacementMap.isTexture && (r.displacementMap = this.displacementMap.toJSON(e).uuid, r.displacementScale = this.displacementScale, r.displacementBias = this.displacementBias), this.roughnessMap && this.roughnessMap.isTexture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid), this.metalnessMap && this.metalnessMap.isTexture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid), this.emissiveMap && this.emissiveMap.isTexture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid), this.specularMap && this.specularMap.isTexture && (r.specularMap = this.specularMap.toJSON(e).uuid), this.envMap && this.envMap.isTexture && (r.envMap = this.envMap.toJSON(e).uuid, this.combine !== void 0 && (r.combine = this.combine)), this.envMapIntensity !== void 0 && (r.envMapIntensity = this.envMapIntensity), this.reflectivity !== void 0 && (r.reflectivity = this.reflectivity), this.refractionRatio !== void 0 && (r.refractionRatio = this.refractionRatio), this.gradientMap && this.gradientMap.isTexture && (r.gradientMap = this.gradientMap.toJSON(e).uuid), this.transmission !== void 0 && (r.transmission = this.transmission), this.transmissionMap && this.transmissionMap.isTexture && (r.transmissionMap = this.transmissionMap.toJSON(e).uuid), this.thickness !== void 0 && (r.thickness = this.thickness), this.thicknessMap && this.thicknessMap.isTexture && (r.thicknessMap = this.thicknessMap.toJSON(e).uuid), this.attenuationDistance !== void 0 && (r.attenuationDistance = this.attenuationDistance), this.attenuationColor !== void 0 && (r.attenuationColor = this.attenuationColor.getHex()), this.size !== void 0 && (r.size = this.size), this.shadowSide !== null && (r.shadowSide = this.shadowSide), this.sizeAttenuation !== void 0 && (r.sizeAttenuation = this.sizeAttenuation), this.blending !== Sa && (r.blending = this.blending), this.side !== Xn && (r.side = this.side), this.vertexColors && (r.vertexColors = !0), this.opacity < 1 && (r.opacity = this.opacity), this.transparent === !0 && (r.transparent = this.transparent), r.depthFunc = this.depthFunc, r.depthTest = this.depthTest, r.depthWrite = this.depthWrite, r.colorWrite = this.colorWrite, r.stencilWrite = this.stencilWrite, r.stencilWriteMask = this.stencilWriteMask, r.stencilFunc = this.stencilFunc, r.stencilRef = this.stencilRef, r.stencilFuncMask = this.stencilFuncMask, r.stencilFail = this.stencilFail, r.stencilZFail = this.stencilZFail, r.stencilZPass = this.stencilZPass, this.rotation && this.rotation !== 0 && (r.rotation = this.rotation), this.polygonOffset === !0 && (r.polygonOffset = !0), this.polygonOffsetFactor !== 0 && (r.polygonOffsetFactor = this.polygonOffsetFactor), this.polygonOffsetUnits !== 0 && (r.polygonOffsetUnits = this.polygonOffsetUnits), this.linewidth && this.linewidth !== 1 && (r.linewidth = this.linewidth), this.dashSize !== void 0 && (r.dashSize = this.dashSize), this.gapSize !== void 0 && (r.gapSize = this.gapSize), this.scale !== void 0 && (r.scale = this.scale), this.dithering === !0 && (r.dithering = !0), this.alphaTest > 0 && (r.alphaTest = this.alphaTest), this.alphaToCoverage === !0 && (r.alphaToCoverage = this.alphaToCoverage), this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha), this.wireframe === !0 && (r.wireframe = this.wireframe), this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth), this.wireframeLinecap !== "round" && (r.wireframeLinecap = this.wireframeLinecap), this.wireframeLinejoin !== "round" && (r.wireframeLinejoin = this.wireframeLinejoin), this.morphTargets === !0 && (r.morphTargets = !0), this.morphNormals === !0 && (r.morphNormals = !0), this.flatShading === !0 && (r.flatShading = this.flatShading), this.visible === !1 && (r.visible = !1), this.toneMapped === !1 && (r.toneMapped = !1), JSON.stringify(this.userData) !== "{}" && (r.userData = this.userData);
function n(o) {
const a = [];
for (const s in o) {
const c = o[s];
delete c.metadata, a.push(c);
}
return a;
}
if (t) {
const o = n(e.textures), a = n(e.images);
o.length > 0 && (r.textures = o), a.length > 0 && (r.images = a);
}
return r;
}
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 t = e.clippingPlanes;
let r = null;
if (t !== null) {
const n = t.length;
r = new Array(n);
for (let o = 0; o !== n; ++o)
r[o] = t[o].clone();
}
return this.clippingPlanes = r, this.clipIntersection = e.clipIntersection, this.clipShadows = e.clipShadows, this.shadowSide = e.shadowSide, this.colorWrite = e.colorWrite, this.precision = e.precision, this.polygonOffset = e.polygonOffset, this.polygonOffsetFactor = e.polygonOffsetFactor, this.polygonOffsetUnits = e.polygonOffsetUnits, this.dithering = e.dithering, this.alphaTest = e.alphaTest, this.alphaToCoverage = e.alphaToCoverage, this.premultipliedAlpha = e.premultipliedAlpha, this.visible = e.visible, this.toneMapped = e.toneMapped, this.userData = JSON.parse(JSON.stringify(e.userData)), this;
}
dispose() {
this.dispatchEvent({ type: "dispose" });
}
set needsUpdate(e) {
e === !0 && this.version++;
}
}
ri.prototype.isMaterial = !0;
const mx = {
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
}, dr = { h: 0, s: 0, l: 0 }, Yl = { h: 0, s: 0, l: 0 };
function bh(i, e, t) {
return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? i + (e - i) * 6 * t : t < 1 / 2 ? e : t < 2 / 3 ? i + (e - i) * 6 * (2 / 3 - t) : i;
}
function xh(i) {
return i < 0.04045 ? i * 0.0773993808 : Math.pow(i * 0.9478672986 + 0.0521327014, 2.4);
}
function wh(i) {
return i < 31308e-7 ? i * 12.92 : 1.055 * Math.pow(i, 0.41666) - 0.055;
}
class Be {
constructor(e, t, r) {
return t === void 0 && r === void 0 ? this.set(e) : this.setRGB(e, t, r);
}
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, t, r) {
return this.r = e, this.g = t, this.b = r, this;
}
setHSL(e, t, r) {
if (e = qp(e, 1), t = bi(t, 0, 1), r = bi(r, 0, 1), t === 0)
this.r = this.g = this.b = r;
else {
const n = r <= 0.5 ? r * (1 + t) : r + t - r * t, o = 2 * r - n;
this.r = bh(o, n, e + 1 / 3), this.g = bh(o, n, e), this.b = bh(o, n, e - 1 / 3);
}
return this;
}
setStyle(e) {
function t(n) {
n !== void 0 && parseFloat(n) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.");
}
let r;
if (r = /^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)) {
let n;
const o = r[1], a = r[2];
switch (o) {
case "rgb":
case "rgba":
if (n = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))
return this.r = Math.min(255, parseInt(n[1], 10)) / 255, this.g = Math.min(255, parseInt(n[2], 10)) / 255, this.b = Math.min(255, parseInt(n[3], 10)) / 255, t(n[4]), this;
if (n = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))
return this.r = Math.min(100, parseInt(n[1], 10)) / 100, this.g = Math.min(100, parseInt(n[2], 10)) / 100, this.b = Math.min(100, parseInt(n[3], 10)) / 100, t(n[4]), this;
break;
case "hsl":
case "hsla":
if (n = /^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)) {
const s = parseFloat(n[1]) / 360, c = parseInt(n[2], 10) / 100, l = parseInt(n[3], 10) / 100;
return t(n[4]), this.setHSL(s, c, l);
}
break;
}
} else if (r = /^\#([A-Fa-f\d]+)$/.exec(e)) {
const n = r[1], o = n.length;
if (o === 3)
return this.r = parseInt(n.charAt(0) + n.charAt(0), 16) / 255, this.g = parseInt(n.charAt(1) + n.charAt(1), 16) / 255, this.b = parseInt(n.charAt(2) + n.charAt(2), 16) / 255, this;
if (o === 6)
return this.r = parseInt(n.charAt(0) + n.charAt(1), 16) / 255, this.g = parseInt(n.charAt(2) + n.charAt(3), 16) / 255, this.b = parseInt(n.charAt(4) + n.charAt(5), 16) / 255, this;
}
return e && e.length > 0 ? this.setColorName(e) : this;
}
setColorName(e) {
const t = mx[e.toLowerCase()];
return t !== void 0 ? this.setHex(t) : 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, t = 2) {
return this.r = Math.pow(e.r, t), this.g = Math.pow(e.g, t), this.b = Math.pow(e.b, t), this;
}
copyLinearToGamma(e, t = 2) {
const r = t > 0 ? 1 / t : 1;
return this.r = Math.pow(e.r, r), this.g = Math.pow(e.g, r), this.b = Math.pow(e.b, r), this;
}
convertGammaToLinear(e) {
return this.copyGammaToLinear(this, e), this;
}
convertLinearToGamma(e) {
return this.copyLinearToGamma(this, e), this;
}
copySRGBToLinear(e) {
return this.r = xh(e.r), this.g = xh(e.g), this.b = xh(e.b), this;
}
copyLinearToSRGB(e) {
return this.r = wh(e.r), this.g = wh(e.g), this.b = wh(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 t = this.r, r = this.g, n = this.b, o = Math.max(t, r, n), a = Math.min(t, r, n);
let s, c;
const l = (a + o) / 2;
if (a === o)
s = 0, c = 0;
else {
const h = o - a;
switch (c = l <= 0.5 ? h / (o + a) : h / (2 - o - a), o) {
case t:
s = (r - n) / h + (r < n ? 6 : 0);
break;
case r:
s = (n - t) / h + 2;
break;
case n:
s = (t - r) / h + 4;
break;
}
s /= 6;
}
return e.h = s, e.s = c, e.l = l, e;
}
getStyle() {
return "rgb(" + (this.r * 255 | 0) + "," + (this.g * 255 | 0) + "," + (this.b * 255 | 0) + ")";
}
offsetHSL(e, t, r) {
return this.getHSL(dr), dr.h += e, dr.s += t, dr.l += r, this.setHSL(dr.h, dr.s, dr.l), this;
}
add(e) {
return this.r += e.r, this.g += e.g, this.b += e.b, this;
}
addColors(e, t) {
return this.r = e.r + t.r, this.g = e.g + t.g, this.b = e.b + t.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, t) {
return this.r += (e.r - this.r) * t, this.g += (e.g - this.g) * t, this.b += (e.b - this.b) * t, this;
}
lerpColors(e, t, r) {
return this.r = e.r + (t.r - e.r) * r, this.g = e.g + (t.g - e.g) * r, this.b = e.b + (t.b - e.b) * r, this;
}
lerpHSL(e, t) {
this.getHSL(dr), e.getHSL(Yl);
const r = Vs(dr.h, Yl.h, t), n = Vs(dr.s, Yl.s, t), o = Vs(dr.l, Yl.l, t);
return this.setHSL(r, n, o), this;
}
equals(e) {
return e.r === this.r && e.g === this.g && e.b === this.b;
}
fromArray(e, t = 0) {
return this.r = e[t], this.g = e[t + 1], this.b = e[t + 2], this;
}
toArray(e = [], t = 0) {
return e[t] = this.r, e[t + 1] = this.g, e[t + 2] = this.b, e;
}
fromBufferAttribute(e, t) {
return this.r = e.getX(t), this.g = e.getY(t), this.b = e.getZ(t), e.normalized === !0 && (this.r /= 255, this.g /= 255, this.b /= 255), this;
}
toJSON() {
return this.getHex();
}
}
Be.NAMES = mx;
Be.prototype.isColor = !0;
Be.prototype.r = 1;
Be.prototype.g = 1;
Be.prototype.b = 1;
class Ui extends ri {
constructor(e) {
super(), this.type = "MeshBasicMaterial", this.color = new Be(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 = vl, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.morphTargets = !1, this.setValues(e);
}
copy(e) {
return super.copy(e), this.color.copy(e.color), this.map = e.map, this.lightMap = e.lightMap, this.lightMapIntensity = e.lightMapIntensity, this.aoMap = e.aoMap, this.aoMapIntensity = e.aoMapIntensity, this.specularMap = e.specularMap, this.alphaMap = e.alphaMap, this.envMap = e.envMap, this.combine = e.combine, this.reflectivity = e.reflectivity, this.refractionRatio = e.refractionRatio, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.morphTargets = e.morphTargets, this;
}
}
Ui.prototype.isMeshBasicMaterial = !0;
const At = /* @__PURE__ */ new Z(), Jl = /* @__PURE__ */ new Re();
class tt {
constructor(e, t, r) {
if (Array.isArray(e))
throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");
this.name = "", this.array = e, this.itemSize = t, this.count = e !== void 0 ? e.length / t : 0, this.normalized = r === !0, this.usage = Fa, this.updateRange = { offset: 0, count: -1 }, this.version = 0;
}
onUploadCallback() {
}
set needsUpdate(e) {
e === !0 && this.version++;
}
setUsage(e) {
return this.usage = e, this;
}
copy(e) {
return this.name = e.name, this.array = new e.array.constructor(e.array), this.itemSize = e.itemSize, this.count = e.count, this.normalized = e.normalized, this.usage = e.usage, this;
}
copyAt(e, t, r) {
e *= this.itemSize, r *= t.itemSize;
for (let n = 0, o = this.itemSize; n < o; n++)
this.array[e + n] = t.array[r + n];
return this;
}
copyArray(e) {
return this.array.set(e), this;
}
copyColorsArray(e) {
const t = this.array;
let r = 0;
for (let n = 0, o = e.length; n < o; n++) {
let a = e[n];
a === void 0 && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n), a = new Be()), t[r++] = a.r, t[r++] = a.g, t[r++] = a.b;
}
return this;
}
copyVector2sArray(e) {
const t = this.array;
let r = 0;
for (let n = 0, o = e.length; n < o; n++) {
let a = e[n];
a === void 0 && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n), a = new Re()), t[r++] = a.x, t[r++] = a.y;
}
return this;
}
copyVector3sArray(e) {
const t = this.array;
let r = 0;
for (let n = 0, o = e.length; n < o; n++) {
let a = e[n];
a === void 0 && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n), a = new Z()), t[r++] = a.x, t[r++] = a.y, t[r++] = a.z;
}
return this;
}
copyVector4sArray(e) {
const t = this.array;
let r = 0;
for (let n = 0, o = e.length; n < o; n++) {
let a = e[n];
a === void 0 && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n), a = new St()), t[r++] = a.x, t[r++] = a.y, t[r++] = a.z, t[r++] = a.w;
}
return this;
}
applyMatrix3(e) {
if (this.itemSize === 2)
for (let t = 0, r = this.count; t < r; t++)
Jl.fromBufferAttribute(this, t), Jl.applyMatrix3(e), this.setXY(t, Jl.x, Jl.y);
else if (this.itemSize === 3)
for (let t = 0, r = this.count; t < r; t++)
At.fromBufferAttribute(this, t), At.applyMatrix3(e), this.setXYZ(t, At.x, At.y, At.z);
return this;
}
applyMatrix4(e) {
for (let t = 0, r = this.count; t < r; t++)
At.x = this.getX(t), At.y = this.getY(t), At.z = this.getZ(t), At.applyMatrix4(e), this.setXYZ(t, At.x, At.y, At.z);
return this;
}
applyNormalMatrix(e) {
for (let t = 0, r = this.count; t < r; t++)
At.x = this.getX(t), At.y = this.getY(t), At.z = this.getZ(t), At.applyNormalMatrix(e), this.setXYZ(t, At.x, At.y, At.z);
return this;
}
transformDirection(e) {
for (let t = 0, r = this.count; t < r; t++)
At.x = this.getX(t), At.y = this.getY(t), At.z = this.getZ(t), At.transformDirection(e), this.setXYZ(t, At.x, At.y, At.z);
return this;
}
set(e, t = 0) {
return this.array.set(e, t), this;
}
getX(e) {
return this.array[e * this.itemSize];
}
setX(e, t) {
return this.array[e * this.itemSize] = t, this;
}
getY(e) {
return this.array[e * this.itemSize + 1];
}
setY(e, t) {
return this.array[e * this.itemSize + 1] = t, this;
}
getZ(e) {
return this.array[e * this.itemSize + 2];
}
setZ(e, t) {
return this.array[e * this.itemSize + 2] = t, this;
}
getW(e) {
return this.array[e * this.itemSize + 3];
}
setW(e, t) {
return this.array[e * this.itemSize + 3] = t, this;
}
setXY(e, t, r) {
return e *= this.itemSize, this.array[e + 0] = t, this.array[e + 1] = r, this;
}
setXYZ(e, t, r, n) {
return e *= this.itemSize, this.array[e + 0] = t, this.array[e + 1] = r, this.array[e + 2] = n, this;
}
setXYZW(e, t, r, n, o) {
return e *= this.itemSize, this.array[e + 0] = t, this.array[e + 1] = r, this.array[e + 2] = n, this.array[e + 3] = o, 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 !== Fa && (e.usage = this.usage), (this.updateRange.offset !== 0 || this.updateRange.count !== -1) && (e.updateRange = this.updateRange), e;
}
}
tt.prototype.isBufferAttribute = !0;
class gx extends tt {
constructor(e, t, r) {
super(new Int8Array(e), t, r);
}
}
class vx extends tt {
constructor(e, t, r) {
super(new Uint8Array(e), t, r);
}
}
class yx extends tt {
constructor(e, t, r) {
super(new Uint8ClampedArray(e), t, r);
}
}
class bx extends tt {
constructor(e, t, r) {
super(new Int16Array(e), t, r);
}
}
class Lu extends tt {
constructor(e, t, r) {
super(new Uint16Array(e), t, r);
}
}
class xx extends tt {
constructor(e, t, r) {
super(new Int32Array(e), t, r);
}
}
class Ru extends tt {
constructor(e, t, r) {
super(new Uint32Array(e), t, r);
}
}
class wx extends tt {
constructor(e, t, r) {
super(new Uint16Array(e), t, r);
}
}
wx.prototype.isFloat16BufferAttribute = !0;
class je extends tt {
constructor(e, t, r) {
super(new Float32Array(e), t, r);
}
}
class _x extends tt {
constructor(e, t, r) {
super(new Float64Array(e), t, r);
}
}
function Mx(i) {
if (i.length === 0) return -1 / 0;
let e = i[0];
for (let t = 1, r = i.length; t < r; ++t)
i[t] > e && (e = i[t]);
return e;
}
const CO = {
Int8Array,
Uint8Array,
Uint8ClampedArray,
Int16Array,
Uint16Array,
Int32Array,
Uint32Array,
Float32Array,
Float64Array
};
function _a(i, e) {
return new CO[i](e);
}
let LO = 0;
const er = /* @__PURE__ */ new $e(), _h = /* @__PURE__ */ new ot(), aa = /* @__PURE__ */ new Z(), Wi = /* @__PURE__ */ new ji(), _s = /* @__PURE__ */ new ji(), ci = /* @__PURE__ */ new Z();
class Ye extends io {
constructor() {
super(), Object.defineProperty(this, "id", { value: LO++ }), this.uuid = Zi(), this.name = "", this.type = "BufferGeometry", this.index = null, this.attributes = {}, this.morphAttributes = {}, this.morphTargetsRelative = !1, this.groups = [], this.boundingBox = null, this.boundingSphere = null, this.drawRange = { start: 0, count: 1 / 0 }, this.userData = {};
}
getIndex() {
return this.index;
}
setIndex(e) {
return Array.isArray(e) ? this.index = new (Mx(e) > 65535 ? Ru : Lu)(e, 1) : this.index = e, this;
}
getAttribute(e) {
return this.attributes[e];
}
setAttribute(e, t) {
return this.attributes[e] = t, this;
}
deleteAttribute(e) {
return delete this.attributes[e], this;
}
hasAttribute(e) {
return this.attributes[e] !== void 0;
}
addGroup(e, t, r = 0) {
this.groups.push({
start: e,
count: t,
materialIndex: r
});
}
clearGroups() {
this.groups = [];
}
setDrawRange(e, t) {
this.drawRange.start = e, this.drawRange.count = t;
}
applyMatrix4(e) {
const t = this.attributes.position;
t !== void 0 && (t.applyMatrix4(e), t.needsUpdate = !0);
const r = this.attributes.normal;
if (r !== void 0) {
const o = new ai().getNormalMatrix(e);
r.applyNormalMatrix(o), r.needsUpdate = !0;
}
const n = this.attributes.tangent;
return n !== void 0 && (n.transformDirection(e), n.needsUpdate = !0), this.boundingBox !== null && this.computeBoundingBox(), this.boundingSphere !== null && this.computeBoundingSphere(), this;
}
applyQuaternion(e) {
return er.makeRotationFromQuaternion(e), this.applyMatrix4(er), this;
}
rotateX(e) {
return er.makeRotationX(e), this.applyMatrix4(er), this;
}
rotateY(e) {
return er.makeRotationY(e), this.applyMatrix4(er), this;
}
rotateZ(e) {
return er.makeRotationZ(e), this.applyMatrix4(er), this;
}
translate(e, t, r) {
return er.makeTranslation(e, t, r), this.applyMatrix4(er), this;
}
scale(e, t, r) {
return er.makeScale(e, t, r), this.applyMatrix4(er), this;
}
lookAt(e) {
return _h.lookAt(e), _h.updateMatrix(), this.applyMatrix4(_h.matrix), this;
}
center() {
return this.computeBoundingBox(), this.boundingBox.getCenter(aa).negate(), this.translate(aa.x, aa.y, aa.z), this;
}
setFromPoints(e) {
const t = [];
for (let r = 0, n = e.length; r < n; r++) {
const o = e[r];
t.push(o.x, o.y, o.z || 0);
}
return this.setAttribute("position", new je(t, 3)), this;
}
computeBoundingBox() {
this.boundingBox === null && (this.boundingBox = new ji());
const e = this.attributes.position, t = 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 Z(-1 / 0, -1 / 0, -1 / 0),
new Z(1 / 0, 1 / 0, 1 / 0)
);
return;
}
if (e !== void 0) {
if (this.boundingBox.setFromBufferAttribute(e), t)
for (let r = 0, n = t.length; r < n; r++) {
const o = t[r];
Wi.setFromBufferAttribute(o), this.morphTargetsRelative ? (ci.addVectors(this.boundingBox.min, Wi.min), this.boundingBox.expandByPoint(ci), ci.addVectors(this.boundingBox.max, Wi.max), this.boundingBox.expandByPoint(ci)) : (this.boundingBox.expandByPoint(Wi.min), this.boundingBox.expandByPoint(Wi.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 xn());
const e = this.attributes.position, t = 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 Z(), 1 / 0);
return;
}
if (e) {
const r = this.boundingSphere.center;
if (Wi.setFromBufferAttribute(e), t)
for (let o = 0, a = t.length; o < a; o++) {
const s = t[o];
_s.setFromBufferAttribute(s), this.morphTargetsRelative ? (ci.addVectors(Wi.min, _s.min), Wi.expandByPoint(ci), ci.addVectors(Wi.max, _s.max), Wi.expandByPoint(ci)) : (Wi.expandByPoint(_s.min), Wi.expandByPoint(_s.max));
}
Wi.getCenter(r);
let n = 0;
for (let o = 0, a = e.count; o < a; o++)
ci.fromBufferAttribute(e, o), n = Math.max(n, r.distanceToSquared(ci));
if (t)
for (let o = 0, a = t.length; o < a; o++) {
const s = t[o], c = this.morphTargetsRelative;
for (let l = 0, h = s.count; l < h; l++)
ci.fromBufferAttribute(s, l), c && (aa.fromBufferAttribute(e, l), ci.add(aa)), n = Math.max(n, r.distanceToSquared(ci));
}
this.boundingSphere.radius = Math.sqrt(n), isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this);
}
}
computeFaceNormals() {
}
computeTangents() {
const e = this.index, t = this.attributes;
if (e === null || t.position === void 0 || t.normal === void 0 || t.uv === void 0) {
console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");
return;
}
const r = e.array, n = t.position.array, o = t.normal.array, a = t.uv.array, s = n.length / 3;
t.tangent === void 0 && this.setAttribute("tangent", new tt(new Float32Array(4 * s), 4));
const c = t.tangent.array, l = [], h = [];
for (let C = 0; C < s; C++)
l[C] = new Z(), h[C] = new Z();
const u = new Z(), p = new Z(), m = new Z(), g = new Re(), d = new Re(), y = new Re(), f = new Z(), v = new Z();
function _(C, R, L) {
u.fromArray(n, C * 3), p.fromArray(n, R * 3), m.fromArray(n, L * 3), g.fromArray(a, C * 2), d.fromArray(a, R * 2), y.fromArray(a, L * 2), p.sub(u), m.sub(u), d.sub(g), y.sub(g);
const A = 1 / (d.x * y.y - y.x * d.y);
isFinite(A) && (f.copy(p).multiplyScalar(y.y).addScaledVector(m, -d.y).multiplyScalar(A), v.copy(m).multiplyScalar(d.x).addScaledVector(p, -y.x).multiplyScalar(A), l[C].add(f), l[R].add(f), l[L].add(f), h[C].add(v), h[R].add(v), h[L].add(v));
}
let M = this.groups;
M.length === 0 && (M = [{
start: 0,
count: r.length
}]);
for (let C = 0, R = M.length; C < R; ++C) {
const L = M[C], A = L.start, P = L.count;
for (let O = A, x = A + P; O < x; O += 3)
_(
r[O + 0],
r[O + 1],
r[O + 2]
);
}
const T = new Z(), w = new Z(), b = new Z(), E = new Z();
function S(C) {
b.fromArray(o, C * 3), E.copy(b);
const R = l[C];
T.copy(R), T.sub(b.multiplyScalar(b.dot(R))).normalize(), w.crossVectors(E, R);
const L = w.dot(h[C]) < 0 ? -1 : 1;
c[C * 4] = T.x, c[C * 4 + 1] = T.y, c[C * 4 + 2] = T.z, c[C * 4 + 3] = L;
}
for (let C = 0, R = M.length; C < R; ++C) {
const L = M[C], A = L.start, P = L.count;
for (let O = A, x = A + P; O < x; O += 3)
S(r[O + 0]), S(r[O + 1]), S(r[O + 2]);
}
}
computeVertexNormals() {
const e = this.index, t = this.getAttribute("position");
if (t !== void 0) {
let r = this.getAttribute("normal");
if (r === void 0)
r = new tt(new Float32Array(t.count * 3), 3), this.setAttribute("normal", r);
else
for (let p = 0, m = r.count; p < m; p++)
r.setXYZ(p, 0, 0, 0);
const n = new Z(), o = new Z(), a = new Z(), s = new Z(), c = new Z(), l = new Z(), h = new Z(), u = new Z();
if (e)
for (let p = 0, m = e.count; p < m; p += 3) {
const g = e.getX(p + 0), d = e.getX(p + 1), y = e.getX(p + 2);
n.fromBufferAttribute(t, g), o.fromBufferAttribute(t, d), a.fromBufferAttribute(t, y), h.subVectors(a, o), u.subVectors(n, o), h.cross(u), s.fromBufferAttribute(r, g), c.fromBufferAttribute(r, d), l.fromBufferAttribute(r, y), s.add(h), c.add(h), l.add(h), r.setXYZ(g, s.x, s.y, s.z), r.setXYZ(d, c.x, c.y, c.z), r.setXYZ(y, l.x, l.y, l.z);
}
else
for (let p = 0, m = t.count; p < m; p += 3)
n.fromBufferAttribute(t, p + 0), o.fromBufferAttribute(t, p + 1), a.fromBufferAttribute(t, p + 2), h.subVectors(a, o), u.subVectors(n, o), h.cross(u), r.setXYZ(p + 0, h.x, h.y, h.z), r.setXYZ(p + 1, h.x, h.y, h.z), r.setXYZ(p + 2, h.x, h.y, h.z);
this.normalizeNormals(), r.needsUpdate = !0;
}
}
merge(e, t) {
if (!(e && e.isBufferGeometry)) {
console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e);
return;
}
t === void 0 && (t = 0, console.warn(
"THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."
));
const r = this.attributes;
for (const n in r) {
if (e.attributes[n] === void 0) continue;
const o = r[n].array, a = e.attributes[n], s = a.array, c = a.itemSize * t, l = Math.min(s.length, o.length - c);
for (let h = 0, u = c; h < l; h++, u++)
o[u] = s[h];
}
return this;
}
normalizeNormals() {
const e = this.attributes.normal;
for (let t = 0, r = e.count; t < r; t++)
ci.fromBufferAttribute(e, t), ci.normalize(), e.setXYZ(t, ci.x, ci.y, ci.z);
}
toNonIndexed() {
function e(s, c) {
const l = s.array, h = s.itemSize, u = s.normalized, p = new l.constructor(c.length * h);
let m = 0, g = 0;
for (let d = 0, y = c.length; d < y; d++) {
s.isInterleavedBufferAttribute ? m = c[d] * s.data.stride + s.offset : m = c[d] * h;
for (let f = 0; f < h; f++)
p[g++] = l[m++];
}
return new tt(p, h, u);
}
if (this.index === null)
return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."), this;
const t = new Ye(), r = this.index.array, n = this.attributes;
for (const s in n) {
const c = n[s], l = e(c, r);
t.setAttribute(s, l);
}
const o = this.morphAttributes;
for (const s in o) {
const c = [], l = o[s];
for (let h = 0, u = l.length; h < u; h++) {
const p = l[h], m = e(p, r);
c.push(m);
}
t.morphAttributes[s] = c;
}
t.morphTargetsRelative = this.morphTargetsRelative;
const a = this.groups;
for (let s = 0, c = a.length; s < c; s++) {
const l = a[s];
t.addGroup(l.start, l.count, l.materialIndex);
}
return t;
}
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 t = this.index;
t !== null && (e.data.index = {
type: t.array.constructor.name,
array: Array.prototype.slice.call(t.array)
});
const r = this.attributes;
for (const c in r) {
const l = r[c];
e.data.attributes[c] = l.toJSON(e.data);
}
const n = {};
let o = !1;
for (const c in this.morphAttributes) {
const l = this.morphAttributes[c], h = [];
for (let u = 0, p = l.length; u < p; u++) {
const m = l[u];
h.push(m.toJSON(e.data));
}
h.length > 0 && (n[c] = h, o = !0);
}
o && (e.data.morphAttributes = n, e.data.morphTargetsRelative = this.morphTargetsRelative);
const a = this.groups;
a.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(a)));
const s = this.boundingSphere;
return s !== null && (e.data.boundingSphere = {
center: s.center.toArray(),
radius: s.radius
}), e;
}
clone() {
return new Ye().copy(this);
}
copy(e) {
this.index = null, this.attributes = {}, this.morphAttributes = {}, this.groups = [], this.boundingBox = null, this.boundingSphere = null;
const t = {};
this.name = e.name;
const r = e.index;
r !== null && this.setIndex(r.clone(t));
const n = e.attributes;
for (const l in n) {
const h = n[l];
this.setAttribute(l, h.clone(t));
}
const o = e.morphAttributes;
for (const l in o) {
const h = [], u = o[l];
for (let p = 0, m = u.length; p < m; p++)
h.push(u[p].clone(t));
this.morphAttributes[l] = h;
}
this.morphTargetsRelative = e.morphTargetsRelative;
const a = e.groups;
for (let l = 0, h = a.length; l < h; l++) {
const u = a[l];
this.addGroup(u.start, u.count, u.materialIndex);
}
const s = e.boundingBox;
s !== null && (this.boundingBox = s.clone());
const c = e.boundingSphere;
return c !== null && (this.boundingSphere = c.clone()), this.drawRange.start = e.drawRange.start, this.drawRange.count = e.drawRange.count, this.userData = e.userData, this;
}
dispose() {
this.dispatchEvent({ type: "dispose" });
}
}
Ye.prototype.isBufferGeometry = !0;
const _g = /* @__PURE__ */ new $e(), sa = /* @__PURE__ */ new ro(), Mh = /* @__PURE__ */ new xn(), An = /* @__PURE__ */ new Z(), Cn = /* @__PURE__ */ new Z(), Ln = /* @__PURE__ */ new Z(), Sh = /* @__PURE__ */ new Z(), Th = /* @__PURE__ */ new Z(), Eh = /* @__PURE__ */ new Z(), Kl = /* @__PURE__ */ new Z(), Ql = /* @__PURE__ */ new Z(), ec = /* @__PURE__ */ new Z(), tc = /* @__PURE__ */ new Re(), ic = /* @__PURE__ */ new Re(), rc = /* @__PURE__ */ new Re(), Ah = /* @__PURE__ */ new Z(), nc = /* @__PURE__ */ new Z();
class ei extends ot {
constructor(e = new Ye(), t = new Ui()) {
super(), this.type = "Mesh", this.geometry = e, this.material = t, 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 t = e.morphAttributes, r = Object.keys(t);
if (r.length > 0) {
const n = t[r[0]];
if (n !== void 0) {
this.morphTargetInfluences = [], this.morphTargetDictionary = {};
for (let o = 0, a = n.length; o < a; o++) {
const s = n[o].name || String(o);
this.morphTargetInfluences.push(0), this.morphTargetDictionary[s] = o;
}
}
}
} else {
const t = e.morphTargets;
t !== void 0 && t.length > 0 && console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");
}
}
raycast(e, t) {
const r = this.geometry, n = this.material, o = this.matrixWorld;
if (n === void 0 || (r.boundingSphere === null && r.computeBoundingSphere(), Mh.copy(r.boundingSphere), Mh.applyMatrix4(o), e.ray.intersectsSphere(Mh) === !1) || (_g.copy(o).invert(), sa.copy(e.ray).applyMatrix4(_g), r.boundingBox !== null && sa.intersectsBox(r.boundingBox) === !1))
return;
let a;
if (r.isBufferGeometry) {
const s = r.index, c = r.attributes.position, l = r.morphAttributes.position, h = r.morphTargetsRelative, u = r.attributes.uv, p = r.attributes.uv2, m = r.groups, g = r.drawRange;
if (s !== null)
if (Array.isArray(n))
for (let d = 0, y = m.length; d < y; d++) {
const f = m[d], v = n[f.materialIndex], _ = Math.max(f.start, g.start), M = Math.min(f.start + f.count, g.start + g.count);
for (let T = _, w = M; T < w; T += 3) {
const b = s.getX(T), E = s.getX(T + 1), S = s.getX(T + 2);
a = oc(this, v, e, sa, c, l, h, u, p, b, E, S), a && (a.faceIndex = Math.floor(T / 3), a.face.materialIndex = f.materialIndex, t.push(a));
}
}
else {
const d = Math.max(0, g.start), y = Math.min(s.count, g.start + g.count);
for (let f = d, v = y; f < v; f += 3) {
const _ = s.getX(f), M = s.getX(f + 1), T = s.getX(f + 2);
a = oc(this, n, e, sa, c, l, h, u, p, _, M, T), a && (a.faceIndex = Math.floor(f / 3), t.push(a));
}
}
else if (c !== void 0)
if (Array.isArray(n))
for (let d = 0, y = m.length; d < y; d++) {
const f = m[d], v = n[f.materialIndex], _ = Math.max(f.start, g.start), M = Math.min(f.start + f.count, g.start + g.count);
for (let T = _, w = M; T < w; T += 3) {
const b = T, E = T + 1, S = T + 2;
a = oc(this, v, e, sa, c, l, h, u, p, b, E, S), a && (a.faceIndex = Math.floor(T / 3), a.face.materialIndex = f.materialIndex, t.push(a));
}
}
else {
const d = Math.max(0, g.start), y = Math.min(c.count, g.start + g.count);
for (let f = d, v = y; f < v; f += 3) {
const _ = f, M = f + 1, T = f + 2;
a = oc(this, n, e, sa, c, l, h, u, p, _, M, T), a && (a.faceIndex = Math.floor(f / 3), t.push(a));
}
}
} else r.isGeometry && console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");
}
}
ei.prototype.isMesh = !0;
function RO(i, e, t, r, n, o, a, s) {
let c;
if (e.side === Yt ? c = r.intersectTriangle(a, o, n, !0, s) : c = r.intersectTriangle(n, o, a, e.side !== Zn, s), c === null) return null;
nc.copy(s), nc.applyMatrix4(i.matrixWorld);
const l = t.ray.origin.distanceTo(nc);
return l < t.near || l > t.far ? null : {
distance: l,
point: nc.clone(),
object: i
};
}
function oc(i, e, t, r, n, o, a, s, c, l, h, u) {
An.fromBufferAttribute(n, l), Cn.fromBufferAttribute(n, h), Ln.fromBufferAttribute(n, u);
const p = i.morphTargetInfluences;
if (e.morphTargets && o && p) {
Kl.set(0, 0, 0), Ql.set(0, 0, 0), ec.set(0, 0, 0);
for (let g = 0, d = o.length; g < d; g++) {
const y = p[g], f = o[g];
y !== 0 && (Sh.fromBufferAttribute(f, l), Th.fromBufferAttribute(f, h), Eh.fromBufferAttribute(f, u), a ? (Kl.addScaledVector(Sh, y), Ql.addScaledVector(Th, y), ec.addScaledVector(Eh, y)) : (Kl.addScaledVector(Sh.sub(An), y), Ql.addScaledVector(Th.sub(Cn), y), ec.addScaledVector(Eh.sub(Ln), y)));
}
An.add(Kl), Cn.add(Ql), Ln.add(ec);
}
i.isSkinnedMesh && (i.boneTransform(l, An), i.boneTransform(h, Cn), i.boneTransform(u, Ln));
const m = RO(i, e, t, r, An, Cn, Ln, Ah);
if (m) {
s && (tc.fromBufferAttribute(s, l), ic.fromBufferAttribute(s, h), rc.fromBufferAttribute(s, u), m.uv = Kt.getUV(Ah, An, Cn, Ln, tc, ic, rc, new Re())), c && (tc.fromBufferAttribute(c, l), ic.fromBufferAttribute(c, h), rc.fromBufferAttribute(c, u), m.uv2 = Kt.getUV(Ah, An, Cn, Ln, tc, ic, rc, new Re()));
const g = {
a: l,
b: h,
c: u,
normal: new Z(),
materialIndex: 0
};
Kt.getNormal(An, Cn, Ln, g.normal), m.face = g;
}
return m;
}
class hn extends Ye {
constructor(e = 1, t = 1, r = 1, n = 1, o = 1, a = 1) {
super(), this.type = "BoxGeometry", this.parameters = {
width: e,
height: t,
depth: r,
widthSegments: n,
heightSegments: o,
depthSegments: a
};
const s = this;
n = Math.floor(n), o = Math.floor(o), a = Math.floor(a);
const c = [], l = [], h = [], u = [];
let p = 0, m = 0;
g("z", "y", "x", -1, -1, r, t, e, a, o, 0), g("z", "y", "x", 1, -1, r, t, -e, a, o, 1), g("x", "z", "y", 1, 1, e, r, t, n, a, 2), g("x", "z", "y", 1, -1, e, r, -t, n, a, 3), g("x", "y", "z", 1, -1, e, t, r, n, o, 4), g("x", "y", "z", -1, -1, e, t, -r, n, o, 5), this.setIndex(c), this.setAttribute("position", new je(l, 3)), this.setAttribute("normal", new je(h, 3)), this.setAttribute("uv", new je(u, 2));
function g(d, y, f, v, _, M, T, w, b, E, S) {
const C = M / b, R = T / E, L = M / 2, A = T / 2, P = w / 2, O = b + 1, x = E + 1;
let I = 0, N = 0;
const D = new Z();
for (let k = 0; k < x; k++) {
const F = k * R - A;
for (let W = 0; W < O; W++) {
const K = W * C - L;
D[d] = K * v, D[y] = F * _, D[f] = P, l.push(D.x, D.y, D.z), D[d] = 0, D[y] = 0, D[f] = w > 0 ? 1 : -1, h.push(D.x, D.y, D.z), u.push(W / b), u.push(1 - k / E), I += 1;
}
}
for (let k = 0; k < E; k++)
for (let F = 0; F < b; F++) {
const W = p + F + O * k, K = p + F + O * (k + 1), ne = p + (F + 1) + O * (k + 1), q = p + (F + 1) + O * k;
c.push(W, K, q), c.push(K, ne, q), N += 6;
}
s.addGroup(m, N, S), m += N, p += I;
}
}
static fromJSON(e) {
return new hn(e.width, e.height, e.depth, e.widthSegments, e.heightSegments, e.depthSegments);
}
}
function Ua(i) {
const e = {};
for (const t in i) {
e[t] = {};
for (const r in i[t]) {
const n = i[t][r];
n && (n.isColor || n.isMatrix3 || n.isMatrix4 || n.isVector2 || n.isVector3 || n.isVector4 || n.isTexture || n.isQuaternion) ? e[t][r] = n.clone() : Array.isArray(n) ? e[t][r] = n.slice() : e[t][r] = n;
}
}
return e;
}
function Ti(i) {
const e = {};
for (let t = 0; t < i.length; t++) {
const r = Ua(i[t]);
for (const n in r)
e[n] = r[n];
}
return e;
}
const Sx = { clone: Ua, merge: Ti };
var OO = `void main() {
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`, PO = `void main() {
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
}`;
class dn extends ri {
constructor(e) {
super(), this.type = "ShaderMaterial", this.defines = {}, this.uniforms = {}, this.vertexShader = OO, this.fragmentShader = PO, this.linewidth = 1, this.wireframe = !1, this.wireframeLinewidth = 1, this.fog = !1, this.lights = !1, this.clipping = !1, this.morphTargets = !1, this.morphNormals = !1, this.extensions = {
derivatives: !1,
// set to use derivatives
fragDepth: !1,
// set to use fragment depth values
drawBuffers: !1,
// set to use draw buffers
shaderTextureLOD: !1
// set to use shader texture LOD
}, this.defaultAttributeValues = {
color: [1, 1, 1],
uv: [0, 0],
uv2: [0, 0]
}, this.index0AttributeName = void 0, this.uniformsNeedUpdate = !1, this.glslVersion = null, e !== void 0 && (e.attributes !== void 0 && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."), this.setValues(e));
}
copy(e) {
return super.copy(e), this.fragmentShader = e.fragmentShader, this.vertexShader = e.vertexShader, this.uniforms = Ua(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 t = super.toJSON(e);
t.glslVersion = this.glslVersion, t.uniforms = {};
for (const n in this.uniforms) {
const o = this.uniforms[n].value;
o && o.isTexture ? t.uniforms[n] = {
type: "t",
value: o.toJSON(e).uuid
} : o && o.isColor ? t.uniforms[n] = {
type: "c",
value: o.getHex()
} : o && o.isVector2 ? t.uniforms[n] = {
type: "v2",
value: o.toArray()
} : o && o.isVector3 ? t.uniforms[n] = {
type: "v3",
value: o.toArray()
} : o && o.isVector4 ? t.uniforms[n] = {
type: "v4",
value: o.toArray()
} : o && o.isMatrix3 ? t.uniforms[n] = {
type: "m3",
value: o.toArray()
} : o && o.isMatrix4 ? t.uniforms[n] = {
type: "m4",
value: o.toArray()
} : t.uniforms[n] = {
value: o
};
}
Object.keys(this.defines).length > 0 && (t.defines = this.defines), t.vertexShader = this.vertexShader, t.fragmentShader = this.fragmentShader;
const r = {};
for (const n in this.extensions)
this.extensions[n] === !0 && (r[n] = !0);
return Object.keys(r).length > 0 && (t.extensions = r), t;
}
}
dn.prototype.isShaderMaterial = !0;
class wl extends ot {
constructor() {
super(), this.type = "Camera", this.matrixWorldInverse = new $e(), this.projectionMatrix = new $e(), this.projectionMatrixInverse = new $e();
}
copy(e, t) {
return super.copy(e, t), this.matrixWorldInverse.copy(e.matrixWorldInverse), this.projectionMatrix.copy(e.projectionMatrix), this.projectionMatrixInverse.copy(e.projectionMatrixInverse), this;
}
getWorldDirection(e) {
this.updateWorldMatrix(!0, !1);
const t = this.matrixWorld.elements;
return e.set(-t[8], -t[9], -t[10]).normalize();
}
updateMatrixWorld(e) {
super.updateMatrixWorld(e), this.matrixWorldInverse.copy(this.matrixWorld).invert();
}
updateWorldMatrix(e, t) {
super.updateWorldMatrix(e, t), this.matrixWorldInverse.copy(this.matrixWorld).invert();
}
clone() {
return new this.constructor().copy(this);
}
}
wl.prototype.isCamera = !0;
class oi extends wl {
constructor(e = 50, t = 1, r = 0.1, n = 2e3) {
super(), this.type = "PerspectiveCamera", this.fov = e, this.zoom = 1, this.near = r, this.far = n, this.focus = 10, this.aspect = t, this.view = null, this.filmGauge = 35, this.filmOffset = 0, this.updateProjectionMatrix();
}
copy(e, t) {
return super.copy(e, t), 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 t = 0.5 * this.getFilmHeight() / e;
this.fov = il * 2 * Math.atan(t), this.updateProjectionMatrix();
}
/**
* Calculates the focal length from the current .fov and .filmGauge.
*/
getFocalLength() {
const e = Math.tan(Co * 0.5 * this.fov);
return 0.5 * this.getFilmHeight() / e;
}
getEffectiveFOV() {
return il * 2 * Math.atan(
Math.tan(Co * 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, t, r, n, o, a) {
this.aspect = e / t, this.view === null && (this.view = {
enabled: !0,
fullWidth: 1,
fullHeight: 1,
offsetX: 0,
offsetY: 0,
width: 1,
height: 1
}), this.view.enabled = !0, this.view.fullWidth = e, this.view.fullHeight = t, this.view.offsetX = r, this.view.offsetY = n, this.view.width = o, this.view.height = a, this.updateProjectionMatrix();
}
clearViewOffset() {
this.view !== null && (this.view.enabled = !1), this.updateProjectionMatrix();
}
updateProjectionMatrix() {
const e = this.near;
let t = e * Math.tan(Co * 0.5 * this.fov) / this.zoom, r = 2 * t, n = this.aspect * r, o = -0.5 * n;
const a = this.view;
if (this.view !== null && this.view.enabled) {
const c = a.fullWidth, l = a.fullHeight;
o += a.offsetX * n / c, t -= a.offsetY * r / l, n *= a.width / c, r *= a.height / l;
}
const s = this.filmOffset;
s !== 0 && (o += e * s / this.getFilmWidth()), this.projectionMatrix.makePerspective(o, o + n, t, t - r, e, this.far), this.projectionMatrixInverse.copy(this.projectionMatrix).invert();
}
toJSON(e) {
const t = super.toJSON(e);
return t.object.fov = this.fov, t.object.zoom = this.zoom, t.object.near = this.near, t.object.far = this.far, t.object.focus = this.focus, t.object.aspect = this.aspect, this.view !== null && (t.object.view = Object.assign({}, this.view)), t.object.filmGauge = this.filmGauge, t.object.filmOffset = this.filmOffset, t;
}
}
oi.prototype.isPerspectiveCamera = !0;
const la = 90, ca = 1;
class Ou extends ot {
constructor(e, t, r) {
if (super(), this.type = "CubeCamera", r.isWebGLCubeRenderTarget !== !0) {
console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");
return;
}
this.renderTarget = r;
const n = new oi(la, ca, e, t);
n.layers = this.layers, n.up.set(0, -1, 0), n.lookAt(new Z(1, 0, 0)), this.add(n);
const o = new oi(la, ca, e, t);
o.layers = this.layers, o.up.set(0, -1, 0), o.lookAt(new Z(-1, 0, 0)), this.add(o);
const a = new oi(la, ca, e, t);
a.layers = this.layers, a.up.set(0, 0, 1), a.lookAt(new Z(0, 1, 0)), this.add(a);
const s = new oi(la, ca, e, t);
s.layers = this.layers, s.up.set(0, 0, -1), s.lookAt(new Z(0, -1, 0)), this.add(s);
const c = new oi(la, ca, e, t);
c.layers = this.layers, c.up.set(0, -1, 0), c.lookAt(new Z(0, 0, 1)), this.add(c);
const l = new oi(la, ca, e, t);
l.layers = this.layers, l.up.set(0, -1, 0), l.lookAt(new Z(0, 0, -1)), this.add(l);
}
update(e, t) {
this.parent === null && this.updateMatrixWorld();
const r = this.renderTarget, [n, o, a, s, c, l] = this.children, h = e.xr.enabled, u = e.getRenderTarget();
e.xr.enabled = !1;
const p = r.texture.generateMipmaps;
r.texture.generateMipmaps = !1, e.setRenderTarget(r, 0), e.render(t, n), e.setRenderTarget(r, 1), e.render(t, o), e.setRenderTarget(r, 2), e.render(t, a), e.setRenderTarget(r, 3), e.render(t, s), e.setRenderTarget(r, 4), e.render(t, c), r.texture.generateMipmaps = p, e.setRenderTarget(r, 5), e.render(t, l), e.setRenderTarget(u), e.xr.enabled = h;
}
}
class cs extends ti {
constructor(e, t, r, n, o, a, s, c, l, h) {
e = e !== void 0 ? e : [], t = t !== void 0 ? t : yl, s = s !== void 0 ? s : sn, super(e, t, r, n, o, a, s, c, l, h), this._needsFlipEnvMap = !0, this.flipY = !1;
}
get images() {
return this.image;
}
set images(e) {
this.image = e;
}
}
cs.prototype.isCubeTexture = !0;
class Pu extends yr {
constructor(e, t, r) {
Number.isInteger(t) && (console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"), t = r), super(e, e, t), t = t || {}, this.texture = new cs(void 0, t.mapping, t.wrapS, t.wrapT, t.magFilter, t.minFilter, t.format, t.type, t.anisotropy, t.encoding), this.texture.generateMipmaps = t.generateMipmaps !== void 0 ? t.generateMipmaps : !1, this.texture.minFilter = t.minFilter !== void 0 ? t.minFilter : Wt, this.texture._needsFlipEnvMap = !1;
}
fromEquirectangularTexture(e, t) {
this.texture.type = t.type, this.texture.format = Xi, this.texture.encoding = t.encoding, this.texture.generateMipmaps = t.generateMipmaps, this.texture.minFilter = t.minFilter, this.texture.magFilter = t.magFilter;
const r = {
uniforms: {
tEquirect: { value: null }
},
vertexShader: (
/* glsl */
`
varying vec3 vWorldDirection;
vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
}
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include
#include
}
`
),
fragmentShader: (
/* glsl */
`
uniform sampler2D tEquirect;
varying vec3 vWorldDirection;
#include
void main() {
vec3 direction = normalize( vWorldDirection );
vec2 sampleUV = equirectUv( direction );
gl_FragColor = texture2D( tEquirect, sampleUV );
}
`
)
}, n = new hn(5, 5, 5), o = new dn({
name: "CubemapFromEquirect",
uniforms: Ua(r.uniforms),
vertexShader: r.vertexShader,
fragmentShader: r.fragmentShader,
side: Yt,
blending: an
});
o.uniforms.tEquirect.value = t;
const a = new ei(n, o), s = t.minFilter;
return t.minFilter === bn && (t.minFilter = Wt), new Ou(1, 10, this).update(e, a), t.minFilter = s, a.geometry.dispose(), a.material.dispose(), this;
}
clear(e, t, r, n) {
const o = e.getRenderTarget();
for (let a = 0; a < 6; a++)
e.setRenderTarget(this, a), e.clear(t, r, n);
e.setRenderTarget(o);
}
}
Pu.prototype.isWebGLCubeRenderTarget = !0;
const Ch = /* @__PURE__ */ new Z(), IO = /* @__PURE__ */ new Z(), DO = /* @__PURE__ */ new ai();
class Cr {
constructor(e = new Z(1, 0, 0), t = 0) {
this.normal = e, this.constant = t;
}
set(e, t) {
return this.normal.copy(e), this.constant = t, this;
}
setComponents(e, t, r, n) {
return this.normal.set(e, t, r), this.constant = n, this;
}
setFromNormalAndCoplanarPoint(e, t) {
return this.normal.copy(e), this.constant = -t.dot(this.normal), this;
}
setFromCoplanarPoints(e, t, r) {
const n = Ch.subVectors(r, t).cross(IO.subVectors(e, t)).normalize();
return this.setFromNormalAndCoplanarPoint(n, e), this;
}
copy(e) {
return this.normal.copy(e.normal), this.constant = e.constant, this;
}
normalize() {
const e = 1 / this.normal.length();
return this.normal.multiplyScalar(e), this.constant *= e, this;
}
negate() {
return this.constant *= -1, this.normal.negate(), this;
}
distanceToPoint(e) {
return this.normal.dot(e) + this.constant;
}
distanceToSphere(e) {
return this.distanceToPoint(e.center) - e.radius;
}
projectPoint(e, t) {
return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e);
}
intersectLine(e, t) {
const r = e.delta(Ch), n = this.normal.dot(r);
if (n === 0)
return this.distanceToPoint(e.start) === 0 ? t.copy(e.start) : null;
const o = -(e.start.dot(this.normal) + this.constant) / n;
return o < 0 || o > 1 ? null : t.copy(r).multiplyScalar(o).add(e.start);
}
intersectsLine(e) {
const t = this.distanceToPoint(e.start), r = this.distanceToPoint(e.end);
return t < 0 && r > 0 || r < 0 && t > 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, t) {
const r = t || DO.getNormalMatrix(e), n = this.coplanarPoint(Ch).applyMatrix4(e), o = this.normal.applyMatrix3(r).normalize();
return this.constant = -n.dot(o), 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);
}
}
Cr.prototype.isPlane = !0;
const ua = /* @__PURE__ */ new xn(), ac = /* @__PURE__ */ new Z();
class _l {
constructor(e = new Cr(), t = new Cr(), r = new Cr(), n = new Cr(), o = new Cr(), a = new Cr()) {
this.planes = [e, t, r, n, o, a];
}
set(e, t, r, n, o, a) {
const s = this.planes;
return s[0].copy(e), s[1].copy(t), s[2].copy(r), s[3].copy(n), s[4].copy(o), s[5].copy(a), this;
}
copy(e) {
const t = this.planes;
for (let r = 0; r < 6; r++)
t[r].copy(e.planes[r]);
return this;
}
setFromProjectionMatrix(e) {
const t = this.planes, r = e.elements, n = r[0], o = r[1], a = r[2], s = r[3], c = r[4], l = r[5], h = r[6], u = r[7], p = r[8], m = r[9], g = r[10], d = r[11], y = r[12], f = r[13], v = r[14], _ = r[15];
return t[0].setComponents(s - n, u - c, d - p, _ - y).normalize(), t[1].setComponents(s + n, u + c, d + p, _ + y).normalize(), t[2].setComponents(s + o, u + l, d + m, _ + f).normalize(), t[3].setComponents(s - o, u - l, d - m, _ - f).normalize(), t[4].setComponents(s - a, u - h, d - g, _ - v).normalize(), t[5].setComponents(s + a, u + h, d + g, _ + v).normalize(), this;
}
intersectsObject(e) {
const t = e.geometry;
return t.boundingSphere === null && t.computeBoundingSphere(), ua.copy(t.boundingSphere).applyMatrix4(e.matrixWorld), this.intersectsSphere(ua);
}
intersectsSprite(e) {
return ua.center.set(0, 0, 0), ua.radius = 0.7071067811865476, ua.applyMatrix4(e.matrixWorld), this.intersectsSphere(ua);
}
intersectsSphere(e) {
const t = this.planes, r = e.center, n = -e.radius;
for (let o = 0; o < 6; o++)
if (t[o].distanceToPoint(r) < n)
return !1;
return !0;
}
intersectsBox(e) {
const t = this.planes;
for (let r = 0; r < 6; r++) {
const n = t[r];
if (ac.x = n.normal.x > 0 ? e.max.x : e.min.x, ac.y = n.normal.y > 0 ? e.max.y : e.min.y, ac.z = n.normal.z > 0 ? e.max.z : e.min.z, n.distanceToPoint(ac) < 0)
return !1;
}
return !0;
}
containsPoint(e) {
const t = this.planes;
for (let r = 0; r < 6; r++)
if (t[r].distanceToPoint(e) < 0)
return !1;
return !0;
}
clone() {
return new this.constructor().copy(this);
}
}
function Tx() {
let i = null, e = !1, t = null, r = null;
function n(o, a) {
t(o, a), r = i.requestAnimationFrame(n);
}
return {
start: function() {
e !== !0 && t !== null && (r = i.requestAnimationFrame(n), e = !0);
},
stop: function() {
i.cancelAnimationFrame(r), e = !1;
},
setAnimationLoop: function(o) {
t = o;
},
setContext: function(o) {
i = o;
}
};
}
function NO(i, e) {
const t = e.isWebGL2, r = /* @__PURE__ */ new WeakMap();
function n(l, h) {
const u = l.array, p = l.usage, m = i.createBuffer();
i.bindBuffer(h, m), i.bufferData(h, u, p), l.onUploadCallback();
let g = 5126;
return u instanceof Float32Array ? g = 5126 : u instanceof Float64Array ? console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array.") : u instanceof Uint16Array ? l.isFloat16BufferAttribute ? t ? g = 5131 : console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.") : g = 5123 : u instanceof Int16Array ? g = 5122 : u instanceof Uint32Array ? g = 5125 : u instanceof Int32Array ? g = 5124 : u instanceof Int8Array ? g = 5120 : (u instanceof Uint8Array || u instanceof Uint8ClampedArray) && (g = 5121), {
buffer: m,
type: g,
bytesPerElement: u.BYTES_PER_ELEMENT,
version: l.version
};
}
function o(l, h, u) {
const p = h.array, m = h.updateRange;
i.bindBuffer(u, l), m.count === -1 ? i.bufferSubData(u, 0, p) : (t ? i.bufferSubData(
u,
m.offset * p.BYTES_PER_ELEMENT,
p,
m.offset,
m.count
) : i.bufferSubData(
u,
m.offset * p.BYTES_PER_ELEMENT,
p.subarray(m.offset, m.offset + m.count)
), m.count = -1);
}
function a(l) {
return l.isInterleavedBufferAttribute && (l = l.data), r.get(l);
}
function s(l) {
l.isInterleavedBufferAttribute && (l = l.data);
const h = r.get(l);
h && (i.deleteBuffer(h.buffer), r.delete(l));
}
function c(l, h) {
if (l.isGLBufferAttribute) {
const p = r.get(l);
(!p || p.version < l.version) && r.set(l, {
buffer: l.buffer,
type: l.type,
bytesPerElement: l.elementSize,
version: l.version
});
return;
}
l.isInterleavedBufferAttribute && (l = l.data);
const u = r.get(l);
u === void 0 ? r.set(l, n(l, h)) : u.version < l.version && (o(u.buffer, l, h), u.version = l.version);
}
return {
get: a,
remove: s,
update: c
};
}
class No extends Ye {
constructor(e = 1, t = 1, r = 1, n = 1) {
super(), this.type = "PlaneGeometry", this.parameters = {
width: e,
height: t,
widthSegments: r,
heightSegments: n
};
const o = e / 2, a = t / 2, s = Math.floor(r), c = Math.floor(n), l = s + 1, h = c + 1, u = e / s, p = t / c, m = [], g = [], d = [], y = [];
for (let f = 0; f < h; f++) {
const v = f * p - a;
for (let _ = 0; _ < l; _++) {
const M = _ * u - o;
g.push(M, -v, 0), d.push(0, 0, 1), y.push(_ / s), y.push(1 - f / c);
}
}
for (let f = 0; f < c; f++)
for (let v = 0; v < s; v++) {
const _ = v + l * f, M = v + l * (f + 1), T = v + 1 + l * (f + 1), w = v + 1 + l * f;
m.push(_, M, w), m.push(M, T, w);
}
this.setIndex(m), this.setAttribute("position", new je(g, 3)), this.setAttribute("normal", new je(d, 3)), this.setAttribute("uv", new je(y, 2));
}
static fromJSON(e) {
return new No(e.width, e.height, e.widthSegments, e.heightSegments);
}
}
var BO = `#ifdef USE_ALPHAMAP
diffuseColor.a *= texture2D( alphaMap, vUv ).g;
#endif`, kO = `#ifdef USE_ALPHAMAP
uniform sampler2D alphaMap;
#endif`, FO = `#ifdef ALPHATEST
if ( diffuseColor.a < ALPHATEST ) discard;
#endif`, zO = `#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`, UO = `#ifdef USE_AOMAP
uniform sampler2D aoMap;
uniform float aoMapIntensity;
#endif`, VO = "vec3 transformed = vec3( position );", HO = `vec3 objectNormal = vec3( normal );
#ifdef USE_TANGENT
vec3 objectTangent = vec3( tangent.xyz );
#endif`, jO = `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`, GO = `#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`, WO = `#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`, $O = `#if NUM_CLIPPING_PLANES > 0
varying vec3 vClipPosition;
uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
#endif`, qO = `#if NUM_CLIPPING_PLANES > 0
varying vec3 vClipPosition;
#endif`, XO = `#if NUM_CLIPPING_PLANES > 0
vClipPosition = - mvPosition.xyz;
#endif`, ZO = `#if defined( USE_COLOR_ALPHA )
diffuseColor *= vColor;
#elif defined( USE_COLOR )
diffuseColor.rgb *= vColor;
#endif`, YO = `#if defined( USE_COLOR_ALPHA )
varying vec4 vColor;
#elif defined( USE_COLOR )
varying vec3 vColor;
#endif`, JO = `#if defined( USE_COLOR_ALPHA )
varying vec4 vColor;
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
varying vec3 vColor;
#endif`, KO = `#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`, QO = `#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 );
}`, eP = `#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`, tP = `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`, iP = `#ifdef USE_DISPLACEMENTMAP
uniform sampler2D displacementMap;
uniform float displacementScale;
uniform float displacementBias;
#endif`, rP = `#ifdef USE_DISPLACEMENTMAP
transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );
#endif`, nP = `#ifdef USE_EMISSIVEMAP
vec4 emissiveColor = texture2D( emissiveMap, vUv );
emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;
totalEmissiveRadiance *= emissiveColor.rgb;
#endif`, oP = `#ifdef USE_EMISSIVEMAP
uniform sampler2D emissiveMap;
#endif`, aP = "gl_FragColor = linearToOutputTexel( gl_FragColor );", sP = `
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 );
}`, lP = `#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`, cP = `#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`, uP = `#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`, hP = `#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`, dP = `#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`, pP = `#ifdef USE_FOG
fogDepth = - mvPosition.z;
#endif`, fP = `#ifdef USE_FOG
varying float fogDepth;
#endif`, mP = `#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`, gP = `#ifdef USE_FOG
uniform vec3 fogColor;
varying float fogDepth;
#ifdef FOG_EXP2
uniform float fogDensity;
#else
uniform float fogNear;
uniform float fogFar;
#endif
#endif`, vP = `#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
}`, yP = `#ifdef USE_LIGHTMAP
vec4 lightMapTexel= texture2D( lightMap, vUv2 );
reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;
#endif`, bP = `#ifdef USE_LIGHTMAP
uniform sampler2D lightMap;
uniform float lightMapIntensity;
#endif`, xP = `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`, wP = `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`, _P = `#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`, MP = `ToonMaterial material;
material.diffuseColor = diffuseColor.rgb;`, SP = `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)`, TP = `BlinnPhongMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularColor = specular;
material.specularShininess = shininess;
material.specularStrength = specularStrength;`, EP = `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)`, AP = `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`, CP = `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 );
}`, LP = `
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`, RP = `#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`, OP = `#if defined( RE_IndirectDiffuse )
RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );
#endif
#if defined( RE_IndirectSpecular )
RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );
#endif`, PP = `#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
#endif`, IP = `#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
uniform float logDepthBufFC;
varying float vFragDepth;
varying float vIsPerspective;
#endif`, DP = `#ifdef USE_LOGDEPTHBUF
#ifdef USE_LOGDEPTHBUF_EXT
varying float vFragDepth;
varying float vIsPerspective;
#else
uniform float logDepthBufFC;
#endif
#endif`, NP = `#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`, BP = `#ifdef USE_MAP
vec4 texelColor = texture2D( map, vUv );
texelColor = mapTexelToLinear( texelColor );
diffuseColor *= texelColor;
#endif`, kP = `#ifdef USE_MAP
uniform sampler2D map;
#endif`, FP = `#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`, zP = `#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`, UP = `float metalnessFactor = metalness;
#ifdef USE_METALNESSMAP
vec4 texelMetalness = texture2D( metalnessMap, vUv );
metalnessFactor *= texelMetalness.b;
#endif`, VP = `#ifdef USE_METALNESSMAP
uniform sampler2D metalnessMap;
#endif`, HP = `#ifdef USE_MORPHNORMALS
objectNormal *= morphTargetBaseInfluence;
objectNormal += morphNormal0 * morphTargetInfluences[ 0 ];
objectNormal += morphNormal1 * morphTargetInfluences[ 1 ];
objectNormal += morphNormal2 * morphTargetInfluences[ 2 ];
objectNormal += morphNormal3 * morphTargetInfluences[ 3 ];
#endif`, jP = `#ifdef USE_MORPHTARGETS
uniform float morphTargetBaseInfluence;
#ifndef USE_MORPHNORMALS
uniform float morphTargetInfluences[ 8 ];
#else
uniform float morphTargetInfluences[ 4 ];
#endif
#endif`, GP = `#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`, WP = `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;`, $P = `#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`, qP = `#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`, XP = `#ifdef CLEARCOAT
vec3 clearcoatNormal = geometryNormal;
#endif`, ZP = `#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`, YP = `#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`, JP = `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 );
}`, KP = `#ifdef PREMULTIPLIED_ALPHA
gl_FragColor.rgb *= gl_FragColor.a;
#endif`, QP = `vec4 mvPosition = vec4( transformed, 1.0 );
#ifdef USE_INSTANCING
mvPosition = instanceMatrix * mvPosition;
#endif
mvPosition = modelViewMatrix * mvPosition;
gl_Position = projectionMatrix * mvPosition;`, eI = `#ifdef DITHERING
gl_FragColor.rgb = dithering( gl_FragColor.rgb );
#endif`, tI = `#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`, iI = `float roughnessFactor = roughness;
#ifdef USE_ROUGHNESSMAP
vec4 texelRoughness = texture2D( roughnessMap, vUv );
roughnessFactor *= texelRoughness.g;
#endif`, rI = `#ifdef USE_ROUGHNESSMAP
uniform sampler2D roughnessMap;
#endif`, nI = `#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`, oI = `#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`, aI = `#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`, sI = `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;
}`, lI = `#ifdef USE_SKINNING
mat4 boneMatX = getBoneMatrix( skinIndex.x );
mat4 boneMatY = getBoneMatrix( skinIndex.y );
mat4 boneMatZ = getBoneMatrix( skinIndex.z );
mat4 boneMatW = getBoneMatrix( skinIndex.w );
#endif`, cI = `#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`, uI = `#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`, hI = `#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`, dI = `float specularStrength;
#ifdef USE_SPECULARMAP
vec4 texelSpecular = texture2D( specularMap, vUv );
specularStrength = texelSpecular.r;
#else
specularStrength = 1.0;
#endif`, pI = `#ifdef USE_SPECULARMAP
uniform sampler2D specularMap;
#endif`, fI = `#if defined( TONE_MAPPING )
gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
#endif`, mI = `#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; }`, gI = `#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`, vI = `#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`, yI = `#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )
varying vec2 vUv;
#endif`, bI = `#ifdef USE_UV
#ifdef UVS_VERTEX_ONLY
vec2 vUv;
#else
varying vec2 vUv;
#endif
uniform mat3 uvTransform;
#endif`, xI = `#ifdef USE_UV
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
#endif`, wI = `#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
varying vec2 vUv2;
#endif`, _I = `#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
attribute vec2 uv2;
varying vec2 vUv2;
uniform mat3 uv2Transform;
#endif`, MI = `#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;
#endif`, SI = `#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`, TI = `uniform sampler2D t2D;
varying vec2 vUv;
void main() {
vec4 texColor = texture2D( t2D, vUv );
gl_FragColor = mapTexelToLinear( texColor );
#include
#include
}`, EI = `varying vec2 vUv;
uniform mat3 uvTransform;
void main() {
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
gl_Position = vec4( position.xy, 1.0, 1.0 );
}`, AI = `#include
uniform float opacity;
varying vec3 vWorldDirection;
#include
void main() {
vec3 vReflect = vWorldDirection;
#include
gl_FragColor = envColor;
gl_FragColor.a *= opacity;
#include
#include
}`, CI = `varying vec3 vWorldDirection;
#include
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include
#include
gl_Position.z = gl_Position.w;
}`, LI = `#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
}`, RI = `#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;
}`, OI = `#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 );
}`, PI = `#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;
}`, II = `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
}`, DI = `varying vec3 vWorldDirection;
#include
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include
#include
}`, NI = `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
}`, BI = `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
}`, kI = `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
}`, FI = `#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
}`, zI = `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
}`, UI = `#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
}`, VI = `#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
}`, HI = `#define MATCAP
varying vec3 vViewPosition;
#ifndef FLAT_SHADED
varying vec3 vNormal;
#endif
#include