UNPKG

qcinfo-ui

Version:

An Amazing Vue3 UI Components Library.

1,762 lines (1,761 loc) 404 kB
import { createTextVNode as Ze, Fragment as Je, Comment as Ur, isVNode as Ds, defineComponent as ee, ref as O, readonly as Xt, watch as Ee, computed as F, getCurrentInstance as Gr, onMounted as Ye, onBeforeUnmount as Le, onBeforeMount as bn, inject as ge, provide as Ge, withDirectives as yt, toRef as ie, h as v, Teleport as Ns, nextTick as $t, renderSlot as gt, onActivated as Gl, onDeactivated as Yl, mergeProps as qn, watchEffect as et, Transition as at, TransitionGroup as ql, vShow as zo, cloneVNode as Xl, Text as Ws, isReactive as js, reactive as Sr, openBlock as $e, createElementBlock as Me, createVNode as Bn, unref as St, normalizeStyle as ft, createElementVNode as Ve, toDisplayString as lt, createCommentVNode as Wt, normalizeClass as Zl, renderList as Mo, withCtx as Vt, pushScopeId as Vs, popScopeId as Ks, createBlock as Ql, useAttrs as Us } from "vue"; import { useQRCode as Gs } from "@vueuse/integrations/useQRCode"; function B0(e = Date.now(), t = "YYYY-MM-DD HH:mm:ss") { if (typeof e == "number" || typeof e == "string") var n = new Date(e); else var n = e; function o(i) { return i < 10 ? "0" + i : String(i); } var r = t; if (r.includes("SSS")) { const i = n.getMilliseconds(); r = r.replace("SSS", "0".repeat(3 - String(i).length) + i); } if (r.includes("YY")) { const i = n.getFullYear(); r = r.includes("YYYY") ? r.replace("YYYY", String(i)) : r.replace("YY", String(i).slice(2, 4)); } if (r.includes("M")) { const i = n.getMonth() + 1; r = r.includes("MM") ? r.replace("MM", o(i)) : r.replace("M", String(i)); } if (r.includes("D")) { const i = n.getDate(); r = r.includes("DD") ? r.replace("DD", o(i)) : r.replace("D", String(i)); } if (r.includes("H")) { const i = n.getHours(); r = r.includes("HH") ? r.replace("HH", o(i)) : r.replace("H", String(i)); } if (r.includes("m")) { var l = n.getMinutes(); r = r.includes("mm") ? r.replace("mm", o(l)) : r.replace("m", String(l)); } if (r.includes("s")) { var a = n.getSeconds(); r = r.includes("ss") ? r.replace("ss", o(a)) : r.replace("s", String(a)); } return r; } const Ro = typeof window < "u" ? window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame : () => { }, Ys = typeof window < "u" ? window.cancelAnimationFrame || window.mozCancelAnimationFrame : () => { }; function jo(e, t = 0, n = !1) { const o = typeof window < "u" ? window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame : () => { }; var r = null; function l(i) { r || (r = i), i - r >= t ? (e(), n && (r = null, a.id = o(l))) : a.id = o(l); } const a = { // 引用类型保存,方便获取 requestAnimationFrame()方法返回的 ID. id: o(l) }; return a; } function Yr(e) { const t = typeof window < "u" ? window.cancelAnimationFrame || window.mozCancelAnimationFrame : () => { }; e && e.id && t(e.id); } function F0(e, t = 300) { var n = !0; return function() { return n && (n = !1, jo(() => { e(), n = !0; }, t)), !1; }; } function I0(e, t = 300) { let n = null; return function() { n && Yr(n), n = jo(e, t); }; } function A0(e, t) { const n = String(e).split(".")[1], o = String(t).split(".")[1]; let r = Math.max((n == null ? void 0 : n.length) || 0, (o == null ? void 0 : o.length) || 0), l = e.toFixed(r), a = t.toFixed(r); return (+l.replace(".", "") + +a.replace(".", "")) / Math.pow(10, r); } function L0(e, t) { var n = ""; if (t) n = t; else { const r = e.split("?")[0].split("/"); n = r[r.length - 1]; } var o = new XMLHttpRequest(); o.open("GET", e, !0), o.responseType = "blob", o.onload = function() { if (o.status === 200) { const r = o.response, l = document.createElement("a"), a = document.querySelector("body"); l.href = window.URL.createObjectURL(r), l.download = n, l.style.display = "none", a == null || a.appendChild(l), l.click(), a == null || a.removeChild(l), window.URL.revokeObjectURL(l.href); } }, o.send(); } function H0(e, t = 2, n = ",") { function o(i) { const s = i.length; return s <= 3 ? i : o(i.slice(0, s - 3)) + n + i.slice(s - 3, s); } const r = String(e); if (isFinite(parseFloat(r))) { if (parseFloat(r) === 0) return parseFloat(r).toFixed(t); var l = "", a = r.indexOf("."); if (a === -1) t === 0 ? l = o(r) : l = o(r) + "." + "0".repeat(t); else { const i = String((Math.round(parseFloat(r) * Math.pow(10, t)) / Math.pow(10, t)).toFixed(t)), s = i.slice(a, a + t + 1); l = o(i.slice(0, a)) + s; } return l; } else return "--"; } const zt = function(e, t) { var n; return e.currentStyle ? e.currentStyle[t] : (n = document.defaultView) == null ? void 0 : n.getComputedStyle(e, null)[t]; }, Ke = { left: 0, top: 0, currentX: 0, currentY: 0, flag: !1 }, qs = function(e, t, n) { const o = document.body.clientWidth, r = document.documentElement.clientHeight, l = t.offsetWidth, a = t.offsetHeight, i = t.offsetLeft, s = t.offsetTop, c = o - i - l, f = r - s - a; zt(t, "left") !== "auto" && (Ke.left = zt(t, "left")), zt(t, "top") !== "auto" && (Ke.top = zt(t, "top")), e.onmousedown = function(d) { Ke.flag = !0, d || (d = window.event, e.onselectstart = function() { return !1; }); const g = d; Ke.currentX = g.clientX, Ke.currentY = g.clientY; }, document.onmouseup = function() { Ke.flag = !1, zt(t, "left") !== "auto" && (Ke.left = zt(t, "left")), zt(t, "top") !== "auto" && (Ke.top = zt(t, "top")); }, document.onmousemove = function(d) { const g = d || window.event; if (Ke.flag) { const p = g.clientX, u = g.clientY, y = p - Ke.currentX, m = u - Ke.currentY; let h = parseInt(Ke.left) + y, x = parseInt(Ke.top) + m; return -h > i ? h = -i : h > c && (h = c), -x > s ? x = -s : x > f && (x = f), t.style.left = h + "px", t.style.top = x + "px", typeof n == "function" && n((parseInt(Ke.left) || 0) + y, (parseInt(Ke.top) || 0) + m), d.preventDefault && d.preventDefault(), !1; } }; }; let _o = []; const Jl = /* @__PURE__ */ new WeakMap(); function Xs() { _o.forEach((e) => e(...Jl.get(e))), _o = []; } function ea(e, ...t) { Jl.set(e, t), !_o.includes(e) && _o.push(e) === 1 && requestAnimationFrame(Xs); } function Dn(e, t) { let { target: n } = e; for (; n; ) { if (n.dataset && n.dataset[t] !== void 0) return !0; n = n.parentElement; } return !1; } function gn(e) { return e.composedPath()[0] || null; } function _t(e) { return typeof e == "string" ? e.endsWith("px") ? Number(e.slice(0, e.length - 2)) : Number(e) : e; } function no(e) { if (e != null) return typeof e == "number" ? `${e}px` : e.endsWith("px") ? e : `${e}px`; } function mo(e, t) { const n = e.trim().split(/\s+/g), o = { top: n[0] }; switch (n.length) { case 1: o.right = n[0], o.bottom = n[0], o.left = n[0]; break; case 2: o.right = n[1], o.left = n[1], o.bottom = n[0]; break; case 3: o.right = n[1], o.bottom = n[2], o.left = n[1]; break; case 4: o.right = n[1], o.bottom = n[2], o.left = n[3]; break; default: throw new Error("[seemly/getMargin]:" + e + " is not a valid value."); } return t === void 0 ? o : o[t]; } const zi = { black: "#000", silver: "#C0C0C0", gray: "#808080", white: "#FFF", maroon: "#800000", red: "#F00", purple: "#800080", fuchsia: "#F0F", green: "#008000", lime: "#0F0", olive: "#808000", yellow: "#FF0", navy: "#000080", blue: "#00F", teal: "#008080", aqua: "#0FF", transparent: "#0000" }, mn = "^\\s*", yn = "\\s*$", Kt = "\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*", Ut = "([0-9A-Fa-f])", Gt = "([0-9A-Fa-f]{2})", Zs = new RegExp(`${mn}rgb\\s*\\(${Kt},${Kt},${Kt}\\)${yn}`), Qs = new RegExp(`${mn}rgba\\s*\\(${Kt},${Kt},${Kt},${Kt}\\)${yn}`), Js = new RegExp(`${mn}#${Ut}${Ut}${Ut}${yn}`), ec = new RegExp(`${mn}#${Gt}${Gt}${Gt}${yn}`), tc = new RegExp(`${mn}#${Ut}${Ut}${Ut}${Ut}${yn}`), nc = new RegExp(`${mn}#${Gt}${Gt}${Gt}${Gt}${yn}`); function qe(e) { return parseInt(e, 16); } function Zt(e) { try { let t; if (t = ec.exec(e)) return [qe(t[1]), qe(t[2]), qe(t[3]), 1]; if (t = Zs.exec(e)) return [We(t[1]), We(t[5]), We(t[9]), 1]; if (t = Qs.exec(e)) return [ We(t[1]), We(t[5]), We(t[9]), Fn(t[13]) ]; if (t = Js.exec(e)) return [ qe(t[1] + t[1]), qe(t[2] + t[2]), qe(t[3] + t[3]), 1 ]; if (t = nc.exec(e)) return [ qe(t[1]), qe(t[2]), qe(t[3]), Fn(qe(t[4]) / 255) ]; if (t = tc.exec(e)) return [ qe(t[1] + t[1]), qe(t[2] + t[2]), qe(t[3] + t[3]), Fn(qe(t[4] + t[4]) / 255) ]; if (e in zi) return Zt(zi[e]); throw new Error(`[seemly/rgba]: Invalid color value ${e}.`); } catch (t) { throw t; } } function oc(e) { return e > 1 ? 1 : e < 0 ? 0 : e; } function $r(e, t, n, o) { return `rgba(${We(e)}, ${We(t)}, ${We(n)}, ${oc(o)})`; } function rr(e, t, n, o, r) { return We((e * t * (1 - o) + n * o) / r); } function qr(e, t) { Array.isArray(e) || (e = Zt(e)), Array.isArray(t) || (t = Zt(t)); const n = e[3], o = t[3], r = Fn(n + o - n * o); return $r(rr(e[0], n, t[0], o, r), rr(e[1], n, t[1], o, r), rr(e[2], n, t[2], o, r), r); } function ce(e, t) { const [n, o, r, l = 1] = Array.isArray(e) ? e : Zt(e); return t.alpha ? $r(n, o, r, t.alpha) : $r(n, o, r, l); } function oo(e, t) { const [n, o, r, l = 1] = Array.isArray(e) ? e : Zt(e), { lightness: a = 1, alpha: i = 1 } = t; return rc([n * a, o * a, r * a, l * i]); } function Fn(e) { const t = Math.round(Number(e) * 100) / 100; return t > 1 ? 1 : t < 0 ? 0 : t; } function We(e) { const t = Math.round(Number(e)); return t > 255 ? 255 : t < 0 ? 0 : t; } function rc(e) { const [t, n, o] = e; return 3 in e ? `rgba(${We(t)}, ${We(n)}, ${We(o)}, ${Fn(e[3])})` : `rgba(${We(t)}, ${We(n)}, ${We(o)}, 1)`; } function ta(e = 8) { return Math.random().toString(16).slice(2, 2 + e); } function Oo(e, t = [], n) { const o = {}; return t.forEach((r) => { o[r] = e[r]; }), Object.assign(o, n); } function kr(e, t = !0, n = []) { return e.forEach((o) => { if (o !== null) { if (typeof o != "object") { (typeof o == "string" || typeof o == "number") && n.push(Ze(String(o))); return; } if (Array.isArray(o)) { kr(o, t, n); return; } if (o.type === Je) { if (o.children === null) return; Array.isArray(o.children) && kr(o.children, t, n); } else o.type !== Ur && n.push(o); } }), n; } function ve(e, ...t) { if (Array.isArray(e)) e.forEach((n) => ve(n, ...t)); else return e(...t); } function Xr(e) { return Object.keys(e); } const it = (e, ...t) => typeof e == "function" ? e(...t) : typeof e == "string" ? Ze(e) : typeof e == "number" ? Ze(String(e)) : null, Mi = /* @__PURE__ */ new Set(); function Ue(e, t) { const n = `[naive/${e}]: ${t}`; Mi.has(n) || (Mi.add(n), console.error(n)); } function Tr(e, t) { console.error(`[naive/${e}]: ${t}`); } function na(e, t) { throw new Error(`[naive/${e}]: ${t}`); } function ic(e) { switch (typeof e) { case "string": return e || void 0; case "number": return String(e); default: return; } } function Pr(e, t = "default", n = void 0) { const o = e[t]; if (!o) return Tr("getFirstSlotVNode", `slot[${t}] is empty`), null; const r = kr(o(n)); return r.length === 1 ? r[0] : (Tr("getFirstSlotVNode", `slot[${t}] should have exactly one child`), null); } function Vo(e) { return e.some((t) => Ds(t) ? !(t.type === Ur || t.type === Je && !Vo(t.children)) : !0) ? e : null; } function Qt(e, t) { return e && Vo(e()) || t(); } function Ae(e, t) { const n = e && Vo(e()); return t(n || null); } function zr(e) { return !(e && Vo(e())); } function ir(e) { const t = e.filter((n) => n !== void 0); if (t.length !== 0) return t.length === 1 ? t[0] : (n) => { e.forEach((o) => { o && o(n); }); }; } const Mr = ee({ render() { var e, t; return (t = (e = this.$slots).default) === null || t === void 0 ? void 0 : t.call(e); } }), lc = /^(\d|\.)+$/, Ri = /(\d|\.)+/; function lr(e, { c: t = 1, offset: n = 0, attachPx: o = !0 } = {}) { if (typeof e == "number") { const r = (e + n) * t; return r === 0 ? "0" : `${r}px`; } else if (typeof e == "string") if (lc.test(e)) { const r = (Number(e) + n) * t; return o ? r === 0 ? "0" : `${r}px` : `${r}`; } else { const r = Ri.exec(e); return r ? e.replace(Ri, String((Number(r[0]) + n) * t)) : e; } return e; } function Eo(e) { return e.replace(/#|\(|\)|,|\s/g, "_"); } function ac(e) { let t = 0; for (let n = 0; n < e.length; ++n) e[n] === "&" && ++t; return t; } const oa = /\s*,(?![^(]*\))\s*/g, sc = /\s+/g; function cc(e, t) { const n = []; return t.split(oa).forEach((o) => { let r = ac(o); if (r) { if (r === 1) { e.forEach((a) => { n.push(o.replace("&", a)); }); return; } } else { e.forEach((a) => { n.push( // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions (a && a + " ") + o ); }); return; } let l = [ o ]; for (; r--; ) { const a = []; l.forEach((i) => { e.forEach((s) => { a.push(i.replace("&", s)); }); }), l = a; } l.forEach((a) => n.push(a)); }), n; } function dc(e, t) { const n = []; return t.split(oa).forEach((o) => { e.forEach((r) => { n.push((r && r + " ") + o); }); }), n; } function uc(e) { let t = [""]; return e.forEach((n) => { n = n && n.trim(), // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions n && (n.includes("&") ? t = cc(t, n) : t = dc(t, n)); }), t.join(", ").replace(sc, " "); } function _i(e) { if (!e) return; const t = e.parentElement; t && t.removeChild(e); } function Ko(e) { return document.querySelector(`style[cssr-id="${e}"]`); } function fc(e) { const t = document.createElement("style"); return t.setAttribute("cssr-id", e), t; } function ro(e) { return e ? /^\s*@(s|m)/.test(e) : !1; } const hc = /[A-Z]/g; function ra(e) { return e.replace(hc, (t) => "-" + t.toLowerCase()); } function vc(e, t = " ") { return typeof e == "object" && e !== null ? ` { ` + Object.entries(e).map((n) => t + ` ${ra(n[0])}: ${n[1]};`).join(` `) + ` ` + t + "}" : `: ${e};`; } function pc(e, t, n) { return typeof e == "function" ? e({ context: t.context, props: n }) : e; } function Oi(e, t, n, o) { if (!t) return ""; const r = pc(t, n, o); if (!r) return ""; if (typeof r == "string") return `${e} { ${r} }`; const l = Object.keys(r); if (l.length === 0) return n.config.keepEmptyBlock ? e + ` { }` : ""; const a = e ? [ e + " {" ] : []; return l.forEach((i) => { const s = r[i]; if (i === "raw") { a.push(` ` + s + ` `); return; } i = ra(i), s != null && a.push(` ${i}${vc(s)}`); }), e && a.push("}"), a.join(` `); } function Rr(e, t, n) { e && e.forEach((o) => { if (Array.isArray(o)) Rr(o, t, n); else if (typeof o == "function") { const r = o(t); Array.isArray(r) ? Rr(r, t, n) : r && n(r); } else o && n(o); }); } function ia(e, t, n, o, r, l) { const a = e.$; let i = ""; if (!a || typeof a == "string") ro(a) ? i = a : t.push(a); else if (typeof a == "function") { const f = a({ context: o.context, props: r }); ro(f) ? i = f : t.push(f); } else if (a.before && a.before(o.context), !a.$ || typeof a.$ == "string") ro(a.$) ? i = a.$ : t.push(a.$); else if (a.$) { const f = a.$({ context: o.context, props: r }); ro(f) ? i = f : t.push(f); } const s = uc(t), c = Oi(s, e.props, o, r); i ? (n.push(`${i} {`), l && c && l.insertRule(`${i} { ${c} } `)) : (l && c && l.insertRule(c), !l && c.length && n.push(c)), e.children && Rr(e.children, { context: o.context, props: r }, (f) => { if (typeof f == "string") { const d = Oi(s, { raw: f }, o, r); l ? l.insertRule(d) : n.push(d); } else ia(f, t, n, o, r, l); }), t.pop(), i && n.push("}"), a && a.after && a.after(o.context); } function la(e, t, n, o = !1) { const r = []; return ia(e, [], r, t, n, o ? e.instance.__styleSheet : void 0), o ? "" : r.join(` `); } function _r(e) { for (var t = 0, n, o = 0, r = e.length; r >= 4; ++o, r -= 4) n = e.charCodeAt(o) & 255 | (e.charCodeAt(++o) & 255) << 8 | (e.charCodeAt(++o) & 255) << 16 | (e.charCodeAt(++o) & 255) << 24, n = /* Math.imul(k, m): */ (n & 65535) * 1540483477 + ((n >>> 16) * 59797 << 16), n ^= /* k >>> r: */ n >>> 24, t = /* Math.imul(k, m): */ (n & 65535) * 1540483477 + ((n >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */ (t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16); switch (r) { case 3: t ^= (e.charCodeAt(o + 2) & 255) << 16; case 2: t ^= (e.charCodeAt(o + 1) & 255) << 8; case 1: t ^= e.charCodeAt(o) & 255, t = /* Math.imul(h, m): */ (t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16); } return t ^= t >>> 13, t = /* Math.imul(h, m): */ (t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16), ((t ^ t >>> 15) >>> 0).toString(36); } typeof window < "u" && (window.__cssrContext = {}); function gc(e, t, n) { const { els: o } = t; if (n === void 0) o.forEach(_i), t.els = []; else { const r = Ko(n); r && o.includes(r) && (_i(r), t.els = o.filter((l) => l !== r)); } } function Ei(e, t) { e.push(t); } function bc(e, t, n, o, r, l, a, i, s) { if (l && !s) { if (n === void 0) { console.error("[css-render/mount]: `id` is required in `silent` mode."); return; } const g = window.__cssrContext; g[n] || (g[n] = !0, la(t, e, o, l)); return; } let c; if (n === void 0 && (c = t.render(o), n = _r(c)), s) { s.adapter(n, c ?? t.render(o)); return; } const f = Ko(n); if (f !== null && !a) return f; const d = f ?? fc(n); if (c === void 0 && (c = t.render(o)), d.textContent = c, f !== null) return f; if (i) { const g = document.head.querySelector(`meta[name="${i}"]`); if (g) return document.head.insertBefore(d, g), Ei(t.els, d), d; } return r ? document.head.insertBefore(d, document.head.querySelector("style, link")) : document.head.appendChild(d), Ei(t.els, d), d; } function mc(e) { return la(this, this.instance, e); } function yc(e = {}) { const { id: t, ssr: n, props: o, head: r = !1, silent: l = !1, force: a = !1, anchorMetaName: i } = e; return bc(this.instance, this, t, o, r, l, a, i, n); } function xc(e = {}) { const { id: t } = e; gc(this.instance, this, t); } const io = function(e, t, n, o) { return { instance: e, $: t, props: n, children: o, els: [], render: mc, mount: yc, unmount: xc }; }, wc = function(e, t, n, o) { return Array.isArray(t) ? io(e, { $: null }, null, t) : Array.isArray(n) ? io(e, t, null, n) : Array.isArray(o) ? io(e, t, n, o) : io(e, t, n, null); }; function aa(e = {}) { let t = null; const n = { c: (...o) => wc(n, ...o), use: (o, ...r) => o.install(n, ...r), find: Ko, context: {}, config: e, get __styleSheet() { if (!t) { const o = document.createElement("style"); return document.head.appendChild(o), t = document.styleSheets[document.styleSheets.length - 1], t; } return t; } }; return n; } function Cc(e, t) { if (e === void 0) return !1; if (t) { const { context: { ids: n } } = t; return n.has(e); } return Ko(e) !== null; } function Sc(e) { let t = ".", n = "__", o = "--", r; if (e) { let u = e.blockPrefix; u && (t = u), u = e.elementPrefix, u && (n = u), u = e.modifierPrefix, u && (o = u); } const l = { install(u) { r = u.c; const y = u.context; y.bem = {}, y.bem.b = null, y.bem.els = null; } }; function a(u) { let y, m; return { before(h) { y = h.bem.b, m = h.bem.els, h.bem.els = null; }, after(h) { h.bem.b = y, h.bem.els = m; }, $({ context: h, props: x }) { return u = typeof u == "string" ? u : u({ context: h, props: x }), h.bem.b = u, `${(x == null ? void 0 : x.bPrefix) || t}${h.bem.b}`; } }; } function i(u) { let y; return { before(m) { y = m.bem.els; }, after(m) { m.bem.els = y; }, $({ context: m, props: h }) { return u = typeof u == "string" ? u : u({ context: m, props: h }), m.bem.els = u.split(",").map((x) => x.trim()), m.bem.els.map((x) => `${(h == null ? void 0 : h.bPrefix) || t}${m.bem.b}${n}${x}`).join(", "); } }; } function s(u) { return { $({ context: y, props: m }) { u = typeof u == "string" ? u : u({ context: y, props: m }); const h = u.split(",").map((w) => w.trim()); function x(w) { return h.map((C) => `&${(m == null ? void 0 : m.bPrefix) || t}${y.bem.b}${w !== void 0 ? `${n}${w}` : ""}${o}${C}`).join(", "); } const R = y.bem.els; if (R !== null) { if (process.env.NODE_ENV !== "production" && R.length >= 2) throw Error(`[css-render/plugin-bem]: m(${u}) is invalid, using modifier inside multiple elements is not allowed`); return x(R[0]); } else return x(); } }; } function c(u) { return { $({ context: y, props: m }) { u = typeof u == "string" ? u : u({ context: y, props: m }); const h = y.bem.els; if (process.env.NODE_ENV !== "production" && h !== null && h.length >= 2) throw Error(`[css-render/plugin-bem]: notM(${u}) is invalid, using modifier inside multiple elements is not allowed`); return `&:not(${(m == null ? void 0 : m.bPrefix) || t}${y.bem.b}${h !== null && h.length > 0 ? `${n}${h[0]}` : ""}${o}${u})`; } }; } return Object.assign(l, { cB: (...u) => r(a(u[0]), u[1], u[2]), cE: (...u) => r(i(u[0]), u[1], u[2]), cM: (...u) => r(s(u[0]), u[1], u[2]), cNotM: (...u) => r(c(u[0]), u[1], u[2]) }), l; } function Y(e, t) { return e + (t === "default" ? "" : t.replace(/^[a-z]/, (n) => n.toUpperCase())); } Y("abc", "def"); const $c = "n", Nn = `.${$c}-`, kc = "__", Tc = "--", sa = aa(), ca = Sc({ blockPrefix: Nn, elementPrefix: kc, modifierPrefix: Tc }); sa.use(ca); const { c: E, find: D0 } = sa, { cB: A, cE: B, cM: U, cNotM: Qe } = ca; function Zr(e) { return E(({ props: { bPrefix: t } }) => `${t || Nn}modal, ${t || Nn}drawer`, [e]); } function da(e) { return E(({ props: { bPrefix: t } }) => `${t || Nn}popover`, [e]); } function ua(e) { return E(({ props: { bPrefix: t } }) => `&${t || Nn}modal`, e); } const Pc = (...e) => E(">", [A(...e)]); let ar; function zc() { return ar === void 0 && (ar = navigator.userAgent.includes("Node.js") || navigator.userAgent.includes("jsdom")), ar; } const Xn = typeof document < "u" && typeof window < "u", fa = /* @__PURE__ */ new WeakSet(); function Mc(e) { fa.add(e); } function Rc(e) { return !fa.has(e); } function _c(e) { const t = O(!!e.value); if (t.value) return Xt(t); const n = Ee(e, (o) => { o && (t.value = !0, n()); }); return Xt(t); } function je(e) { const t = F(e), n = O(t.value); return Ee(t, (o) => { n.value = o; }), typeof e == "function" ? n : { __v_isRef: !0, get value() { return n.value; }, set value(o) { e.set(o); } }; } function ha() { return Gr() !== null; } const Qr = typeof window < "u"; let vn, In; const Oc = () => { var e, t; vn = Qr ? (t = (e = document) === null || e === void 0 ? void 0 : e.fonts) === null || t === void 0 ? void 0 : t.ready : void 0, In = !1, vn !== void 0 ? vn.then(() => { In = !0; }) : In = !0; }; Oc(); function Ec(e) { if (In) return; let t = !1; Ye(() => { In || vn == null || vn.then(() => { t || e(); }); }), Le(() => { t = !0; }); } function yo(e) { return e.composedPath()[0]; } const Bc = { mousemoveoutside: /* @__PURE__ */ new WeakMap(), clickoutside: /* @__PURE__ */ new WeakMap() }; function Fc(e, t, n) { if (e === "mousemoveoutside") { const o = (r) => { t.contains(yo(r)) || n(r); }; return { mousemove: o, touchstart: o }; } else if (e === "clickoutside") { let o = !1; const r = (a) => { o = !t.contains(yo(a)); }, l = (a) => { o && (t.contains(yo(a)) || n(a)); }; return { mousedown: r, mouseup: l, touchstart: r, touchend: l }; } return console.error( // eslint-disable-next-line @typescript-eslint/restrict-template-expressions `[evtd/create-trap-handler]: name \`${e}\` is invalid. This could be a bug of evtd.` ), {}; } function va(e, t, n) { const o = Bc[e]; let r = o.get(t); r === void 0 && o.set(t, r = /* @__PURE__ */ new WeakMap()); let l = r.get(n); return l === void 0 && r.set(n, l = Fc(e, t, n)), l; } function Ic(e, t, n, o) { if (e === "mousemoveoutside" || e === "clickoutside") { const r = va(e, t, n); return Object.keys(r).forEach((l) => { Be(l, document, r[l], o); }), !0; } return !1; } function Ac(e, t, n, o) { if (e === "mousemoveoutside" || e === "clickoutside") { const r = va(e, t, n); return Object.keys(r).forEach((l) => { Pe(l, document, r[l], o); }), !0; } return !1; } function Lc() { if (typeof window > "u") return { on: () => { }, off: () => { } }; const e = /* @__PURE__ */ new WeakMap(), t = /* @__PURE__ */ new WeakMap(); function n() { e.set(this, !0); } function o() { e.set(this, !0), t.set(this, !0); } function r(b, $, M) { const k = b[$]; return b[$] = function() { return M.apply(b, arguments), k.apply(b, arguments); }, b; } function l(b, $) { b[$] = Event.prototype[$]; } const a = /* @__PURE__ */ new WeakMap(), i = Object.getOwnPropertyDescriptor(Event.prototype, "currentTarget"); function s() { var b; return (b = a.get(this)) !== null && b !== void 0 ? b : null; } function c(b, $) { i !== void 0 && Object.defineProperty(b, "currentTarget", { configurable: !0, enumerable: !0, get: $ ?? i.get }); } const f = { bubble: {}, capture: {} }, d = {}; function g() { const b = function($) { const { type: M, eventPhase: k, bubbles: P } = $, z = yo($); if (k === 2) return; const N = k === 1 ? "capture" : "bubble"; let I = z; const W = []; for (; I === null && (I = window), W.push(I), I !== window; ) I = I.parentNode || null; const K = f.capture[M], V = f.bubble[M]; if (r($, "stopPropagation", n), r($, "stopImmediatePropagation", o), c($, s), N === "capture") { if (K === void 0) return; for (let Z = W.length - 1; Z >= 0 && !e.has($); --Z) { const _ = W[Z], D = K.get(_); if (D !== void 0) { a.set($, _); for (const X of D) { if (t.has($)) break; X($); } } if (Z === 0 && !P && V !== void 0) { const X = V.get(_); if (X !== void 0) for (const le of X) { if (t.has($)) break; le($); } } } } else if (N === "bubble") { if (V === void 0) return; for (let Z = 0; Z < W.length && !e.has($); ++Z) { const _ = W[Z], D = V.get(_); if (D !== void 0) { a.set($, _); for (const X of D) { if (t.has($)) break; X($); } } } } l($, "stopPropagation"), l($, "stopImmediatePropagation"), c($); }; return b.displayName = "evtdUnifiedHandler", b; } function p() { const b = function($) { const { type: M, eventPhase: k } = $; if (k !== 2) return; const P = d[M]; P !== void 0 && P.forEach((z) => z($)); }; return b.displayName = "evtdUnifiedWindowEventHandler", b; } const u = g(), y = p(); function m(b, $) { const M = f[b]; return M[$] === void 0 && (M[$] = /* @__PURE__ */ new Map(), window.addEventListener($, u, b === "capture")), M[$]; } function h(b) { return d[b] === void 0 && (d[b] = /* @__PURE__ */ new Set(), window.addEventListener(b, y)), d[b]; } function x(b, $) { let M = b.get($); return M === void 0 && b.set($, M = /* @__PURE__ */ new Set()), M; } function R(b, $, M, k) { const P = f[$][M]; if (P !== void 0) { const z = P.get(b); if (z !== void 0 && z.has(k)) return !0; } return !1; } function w(b, $) { const M = d[b]; return !!(M !== void 0 && M.has($)); } function C(b, $, M, k) { let P; if (typeof k == "object" && k.once === !0 ? P = (K) => { S(b, $, P, k), M(K); } : P = M, Ic(b, $, P, k)) return; const N = k === !0 || typeof k == "object" && k.capture === !0 ? "capture" : "bubble", I = m(N, b), W = x(I, $); if (W.has(P) || W.add(P), $ === window) { const K = h(b); K.has(P) || K.add(P); } } function S(b, $, M, k) { if (Ac(b, $, M, k)) return; const z = k === !0 || typeof k == "object" && k.capture === !0, N = z ? "capture" : "bubble", I = m(N, b), W = x(I, $); if ($ === window && !R($, z ? "bubble" : "capture", b, M) && w(b, M)) { const V = d[b]; V.delete(M), V.size === 0 && (window.removeEventListener(b, y), d[b] = void 0); } W.has(M) && W.delete(M), W.size === 0 && I.delete($), I.size === 0 && (window.removeEventListener(b, u, N === "capture"), f[N][b] = void 0); } return { on: C, off: S }; } const { on: Be, off: Pe } = Lc(), En = O(null); function Bi(e) { if (e.clientX > 0 || e.clientY > 0) En.value = { x: e.clientX, y: e.clientY }; else { const { target: t } = e; if (t instanceof Element) { const { left: n, top: o, width: r, height: l } = t.getBoundingClientRect(); n > 0 || o > 0 ? En.value = { x: n + r / 2, y: o + l / 2 } : En.value = { x: 0, y: 0 }; } else En.value = null; } } let lo = 0, Fi = !0; function Hc() { if (!Qr) return Xt(O(null)); lo === 0 && Be("click", document, Bi, !0); const e = () => { lo += 1; }; return Fi && (Fi = ha()) ? (bn(e), Le(() => { lo -= 1, lo === 0 && Pe("click", document, Bi, !0); })) : e(), Xt(En); } const Dc = O(void 0); let ao = 0; function Ii() { Dc.value = Date.now(); } let Ai = !0; function Nc(e) { if (!Qr) return Xt(O(!1)); const t = O(!1); let n = null; function o() { n !== null && window.clearTimeout(n); } function r() { o(), t.value = !0, n = window.setTimeout(() => { t.value = !1; }, e); } ao === 0 && Be("click", window, Ii, !0); const l = () => { ao += 1, Be("click", window, r, !0); }; return Ai && (Ai = ha()) ? (bn(l), Le(() => { ao -= 1, ao === 0 && Pe("click", window, Ii, !0), Pe("click", window, r, !0), o(); })) : l(), Xt(t); } function Wn(e, t) { return Ee(e, (n) => { n !== void 0 && (t.value = n); }), F(() => e.value === void 0 ? t.value : e.value); } function Zn() { const e = O(!1); return Ye(() => { e.value = !0; }), Xt(e); } function Wc(e, t) { return F(() => { for (const n of t) if (e[n] !== void 0) return e[n]; return e[t[t.length - 1]]; }); } const jc = (typeof window > "u" ? !1 : /iPad|iPhone|iPod/.test(navigator.platform) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1) && // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions !window.MSStream; function Vc() { return jc; } const Jr = "n-internal-select-menu", pa = "n-internal-select-menu-body", ei = "n-modal-body", ga = "n-modal", ti = "n-drawer-body", ni = "n-popover-body", ba = "__disabled__"; function bt(e) { const t = ge(ei, null), n = ge(ti, null), o = ge(ni, null), r = ge(pa, null), l = O(); if (typeof document < "u") { l.value = document.fullscreenElement; const a = () => { l.value = document.fullscreenElement; }; Ye(() => { Be("fullscreenchange", document, a); }), Le(() => { Pe("fullscreenchange", document, a); }); } return je(() => { var a; const { to: i } = e; return i !== void 0 ? i === !1 ? ba : i === !0 ? l.value || "body" : i : t != null && t.value ? (a = t.value.$el) !== null && a !== void 0 ? a : t.value : n != null && n.value ? n.value : o != null && o.value ? o.value : r != null && r.value ? r.value : i ?? (l.value || "body"); }); } bt.tdkey = ba; bt.propTo = { type: [String, Object, Boolean], default: void 0 }; function Or(e, t, n = "default") { const o = t[n]; if (o === void 0) throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`); return o(); } function Er(e, t = !0, n = []) { return e.forEach((o) => { if (o !== null) { if (typeof o != "object") { (typeof o == "string" || typeof o == "number") && n.push(Ze(String(o))); return; } if (Array.isArray(o)) { Er(o, t, n); return; } if (o.type === Je) { if (o.children === null) return; Array.isArray(o.children) && Er(o.children, t, n); } else o.type !== Ur && n.push(o); } }), n; } function Li(e, t, n = "default") { const o = t[n]; if (o === void 0) throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`); const r = Er(o()); if (r.length === 1) return r[0]; throw new Error(`[vueuc/${e}]: slot[${n}] should have exactly one child.`); } let Mt = null; function ma() { if (Mt === null && (Mt = document.getElementById("v-binder-view-measurer"), Mt === null)) { Mt = document.createElement("div"), Mt.id = "v-binder-view-measurer"; const { style: e } = Mt; e.position = "fixed", e.left = "0", e.right = "0", e.top = "0", e.bottom = "0", e.pointerEvents = "none", e.visibility = "hidden", document.body.appendChild(Mt); } return Mt.getBoundingClientRect(); } function Kc(e, t) { const n = ma(); return { top: t, left: e, height: 0, width: 0, right: n.width - e, bottom: n.height - t }; } function sr(e) { const t = e.getBoundingClientRect(), n = ma(); return { left: t.left - n.left, top: t.top - n.top, bottom: n.height + n.top - t.bottom, right: n.width + n.left - t.right, width: t.width, height: t.height }; } function Uc(e) { return e.nodeType === 9 ? null : e.parentNode; } function ya(e) { if (e === null) return null; const t = Uc(e); if (t === null) return null; if (t.nodeType === 9) return document; if (t.nodeType === 1) { const { overflow: n, overflowX: o, overflowY: r } = getComputedStyle(t); if (/(auto|scroll|overlay)/.test(n + r + o)) return t; } return ya(t); } const Gc = ee({ name: "Binder", props: { syncTargetWithParent: Boolean, syncTarget: { type: Boolean, default: !0 } }, setup(e) { var t; Ge("VBinder", (t = Gr()) === null || t === void 0 ? void 0 : t.proxy); const n = ge("VBinder", null), o = O(null), r = (h) => { o.value = h, n && e.syncTargetWithParent && n.setTargetRef(h); }; let l = []; const a = () => { let h = o.value; for (; h = ya(h), h !== null; ) l.push(h); for (const x of l) Be("scroll", x, d, !0); }, i = () => { for (const h of l) Pe("scroll", h, d, !0); l = []; }, s = /* @__PURE__ */ new Set(), c = (h) => { s.size === 0 && a(), s.has(h) || s.add(h); }, f = (h) => { s.has(h) && s.delete(h), s.size === 0 && i(); }, d = () => { ea(g); }, g = () => { s.forEach((h) => h()); }, p = /* @__PURE__ */ new Set(), u = (h) => { p.size === 0 && Be("resize", window, m), p.has(h) || p.add(h); }, y = (h) => { p.has(h) && p.delete(h), p.size === 0 && Pe("resize", window, m); }, m = () => { p.forEach((h) => h()); }; return Le(() => { Pe("resize", window, m), i(); }), { targetRef: o, setTargetRef: r, addScrollListener: c, removeScrollListener: f, addResizeListener: u, removeResizeListener: y }; }, render() { return Or("binder", this.$slots); } }), xa = Gc, wa = ee({ name: "Target", setup() { const { setTargetRef: e, syncTarget: t } = ge("VBinder"); return { syncTarget: t, setTargetDirective: { mounted: e, updated: e } }; }, render() { const { syncTarget: e, setTargetDirective: t } = this; return e ? yt(Li("follower", this.$slots), [ [t] ]) : Li("follower", this.$slots); } }), dn = "@@mmoContext", Yc = { mounted(e, { value: t }) { e[dn] = { handler: void 0 }, typeof t == "function" && (e[dn].handler = t, Be("mousemoveoutside", e, t)); }, updated(e, { value: t }) { const n = e[dn]; typeof t == "function" ? n.handler ? n.handler !== t && (Pe("mousemoveoutside", e, n.handler), n.handler = t, Be("mousemoveoutside", e, t)) : (e[dn].handler = t, Be("mousemoveoutside", e, t)) : n.handler && (Pe("mousemoveoutside", e, n.handler), n.handler = void 0); }, unmounted(e) { const { handler: t } = e[dn]; t && Pe("mousemoveoutside", e, t), e[dn].handler = void 0; } }, qc = Yc, un = "@@coContext", Xc = { mounted(e, { value: t, modifiers: n }) { e[un] = { handler: void 0 }, typeof t == "function" && (e[un].handler = t, Be("clickoutside", e, t, { capture: n.capture })); }, updated(e, { value: t, modifiers: n }) { const o = e[un]; typeof t == "function" ? o.handler ? o.handler !== t && (Pe("clickoutside", e, o.handler, { capture: n.capture }), o.handler = t, Be("clickoutside", e, t, { capture: n.capture })) : (e[un].handler = t, Be("clickoutside", e, t, { capture: n.capture })) : o.handler && (Pe("clickoutside", e, o.handler, { capture: n.capture }), o.handler = void 0); }, unmounted(e, { modifiers: t }) { const { handler: n } = e[un]; n && Pe("clickoutside", e, n, { capture: t.capture }), e[un].handler = void 0; } }, jn = Xc; function Zc(e, t) { console.error(`[vdirs/${e}]: ${t}`); } class Qc { constructor() { this.elementZIndex = /* @__PURE__ */ new Map(), this.nextZIndex = 2e3; } get elementCount() { return this.elementZIndex.size; } ensureZIndex(t, n) { const { elementZIndex: o } = this; if (n !== void 0) { t.style.zIndex = `${n}`, o.delete(t); return; } const { nextZIndex: r } = this; o.has(t) && o.get(t) + 1 === this.nextZIndex || (t.style.zIndex = `${r}`, o.set(t, r), this.nextZIndex = r + 1, this.squashState()); } unregister(t, n) { const { elementZIndex: o } = this; o.has(t) ? o.delete(t) : n === void 0 && Zc("z-index-manager/unregister-element", "Element not found when unregistering."), this.squashState(); } squashState() { const { elementCount: t } = this; t || (this.nextZIndex = 2e3), this.nextZIndex - t > 2500 && this.rearrange(); } rearrange() { const t = Array.from(this.elementZIndex.entries()); t.sort((n, o) => n[1] - o[1]), this.nextZIndex = 2e3, t.forEach((n) => { const o = n[0], r = this.nextZIndex++; `${r}` !== o.style.zIndex && (o.style.zIndex = `${r}`); }); } } const cr = new Qc(), fn = "@@ziContext", Jc = { mounted(e, t) { const { value: n = {} } = t, { zIndex: o, enabled: r } = n; e[fn] = { enabled: !!r, initialized: !1 }, r && (cr.ensureZIndex(e, o), e[fn].initialized = !0); }, updated(e, t) { const { value: n = {} } = t, { zIndex: o, enabled: r } = n, l = e[fn].enabled; r && !l && (cr.ensureZIndex(e, o), e[fn].initialized = !0), e[fn].enabled = !!r; }, unmounted(e, t) { if (!e[fn].initialized) return; const { value: n = {} } = t, { zIndex: o } = n; cr.unregister(e, o); } }, oi = Jc, Ca = Symbol("@css-render/vue3-ssr"); function ed(e, t) { return `<style cssr-id="${e}"> ${t} </style>`; } function td(e, t) { const n = ge(Ca, null); if (n === null) { console.error("[css-render/vue3-ssr]: no ssr context found."); return; } const { styles: o, ids: r } = n; r.has(e) || o !== null && (r.add(e), o.push(ed(e, t))); } const nd = typeof document < "u"; function en() { if (nd) return; const e = ge(Ca, null); if (e !== null) return { adapter: td, context: e }; } function Hi(e, t) { console.error(`[vueuc/${e}]: ${t}`); } const { c: Ot } = aa(), ri = "vueuc-style"; function Di(e) { return e & -e; } class od { /** * @param l length of the array * @param min min value of the array */ constructor(t, n) { this.l = t, this.min = n; const o = new Array(t + 1); for (let r = 0; r < t + 1; ++r) o[r] = 0; this.ft = o; } /** * Add arr[i] by n, start from 0 * @param i the index of the element to be added * @param n the value to be added */ add(t, n) { if (n === 0) return; const { l: o, ft: r } = this; for (t += 1; t <= o; ) r[t] += n, t += Di(t); } /** * Get the value of index i * @param i index * @returns value of the index */ get(t) { return this.sum(t + 1) - this.sum(t); } /** * Get the sum of first i elements * @param i count of head elements to be added * @returns the sum of first i elements */ sum(t) { if (t === void 0 && (t = this.l), t <= 0) return 0; const { ft: n, min: o, l: r } = this; if (t > r) throw new Error("[FinweckTree.sum]: `i` is larger than length."); let l = t * o; for (; t > 0; ) l += n[t], t -= Di(t); return l; } /** * Get the largest count of head elements whose sum are <= threshold * @param threshold * @returns the largest count of head elements whose sum are <= threshold */ getBound(t) { let n = 0, o = this.l; for (; o > n; ) { const r = Math.floor((n + o) / 2), l = this.sum(r); if (l > t) { o = r; continue; } else if (l < t) { if (n === r) return this.sum(n + 1) <= t ? n + 1 : r; n = r; } else return r; } return n; } } function Ni(e) { return typeof e == "string" ? document.querySelector(e) : e(); } const Sa = ee({ name: "LazyTeleport", props: { to: { type: [String, Object], default: void 0 }, disabled: Boolean, show: { type: Boolean, required: !0 } }, setup(e) { return { showTeleport: _c(ie(e, "show")), mergedTo: F(() => { const { to: t } = e; return t ?? "body"; }) }; }, render() { return this.showTeleport ? this.disabled ? Or("lazy-teleport", this.$slots) : v(Ns, { disabled: this.disabled, to: this.mergedTo }, Or("lazy-teleport", this.$slots)) : null; } }), so = { top: "bottom", bottom: "top", left: "right", right: "left" }, Wi = { start: "end", center: "center", end: "start" }, dr = { top: "height", bottom: "height", left: "width", right: "width" }, rd = { "bottom-start": "top left", bottom: "top center", "bottom-end": "top right", "top-start": "bottom left", top: "bottom center", "top-end": "bottom right", "right-start": "top left", right: "center left", "right-end": "bottom left", "left-start": "top right", left: "center right", "left-end": "bottom right" }, id = { "bottom-start": "bottom left", bottom: "bottom center", "bottom-end": "bottom right", "top-start": "top left", top: "top center", "top-end": "top right", "right-start": "top right", right: "center right", "right-end": "bottom right", "left-start": "top left", left: "center left", "left-end": "bottom left" }, ld = { "bottom-start": "right", "bottom-end": "left", "top-start": "right", "top-end": "left", "right-start": "bottom", "right-end": "top", "left-start": "bottom", "left-end": "top" }, ji = { top: !0, bottom: !1, left: !0, right: !1 // left-- }, Vi = { top: "end", bottom: "start", left: "end", right: "start" }; function ad(e, t, n, o, r, l) { if (!r || l) return { placement: e, top: 0, left: 0 }; const [a, i] = e.split("-"); let s = i ?? "center", c = { top: 0, left: 0 }; const f = (p, u, y) => { let m = 0, h = 0; const x = n[p] - t[u] - t[p]; return x > 0 && o && (y ? h = ji[u] ? x : -x : m = ji[u] ? x : -x), { left: m, top: h }; }, d = a === "left" || a === "right"; if (s !== "center") { const p = ld[e], u = so[p], y = dr[p]; if (n[y] > t[y]) { if ( // current space is not enough // ----------[ target ]---------| // -------[ follower ] t[p] + t[y] < n[y] ) { const m = (n[y] - t[y]) / 2; t[p] < m || t[u] < m ? t[p] < t[u] ? (s = Wi[i], c = f(y, u, d)) : c = f(y, p, d) : s = "center"; } } else n[y] < t[y] && t[u] < 0 && // opposite align has larger space // ------------[ target ] // ----------------[follower] t[p] > t[u] && (s = Wi[i]); } else { const p = a === "bottom" || a === "top" ? "left" : "top", u = so[p], y = dr[p], m = (n[y] - t[y]) / 2; // center is not enough // ----------- [ target ]--| // -------[ follower ] (t[p] < m || t[u] < m) && (t[p] > t[u] ? (s = Vi[p], c = f(y, p, d)) : (s = Vi[u], c = f(y, u, d))); } let g = a; return ( // space is not enough t[a] < n[dr[a]] && // opposite position's space is larger t[a] < t[so[a]] && (g = so[a]), { placement: s !== "center" ? `${g}-${s}` : g, left: c.left, top: c.top } ); } function sd(e, t) { return t ? id[e] : rd[e]; } function cd(e, t, n, o, r, l) { if (l) switch (e) { case "bottom-start": return { top: `${Math.round(n.top - t.top + n.height)}px`, left: `${Math.round(n.left - t.left)}px`, transform: "translateY(-100%)" }; case "bottom-end": return { top: `${Math.round(n.top - t.top + n.height)}px`, left: `${Math.round(n.left - t.left + n.width)}px`, transform: "translateX(-100%) translateY(-100%)" }; case "top-start": return { top: `${Math.round(n.top - t.top)}px`, left: `${Math.round(n.left - t.left)}px`, transform: "" }; case "top-end": return { top: `${Math.round(n.top - t.top)}px`, left: `${Math.round(n.left - t.left + n.width)}px`, transform: "translateX(-100%)" }; case "right-start": return { top: `${Math.round(n.top - t.top)}px`, left: `${Math.round(n.left - t.left + n.width)}px`, transform: "translateX(-100%)" }; case "right-end": return { top: `${Math.round(n.top - t.top + n.height)}px`, left: `${Math.round(n.left - t.left + n.width)}px`, transform: "translateX(-100%) translateY(-100%)" }; case "left-start": return { top: `${Math.round(n.top - t.top)}px`, left: `${Math.round(n.left - t.left)}px`, transform: "" }; case "left-end": return { top: `${Math.round(n.top - t.top + n.height)}px`, left: `${Math.round(n.left - t.left)}px`, transform: "translateY(-100%)" }; case "top": return { top: `${Math.round(n.top - t.top)}px`, left: `${Math.round(n.left - t.left + n.width / 2)}px`, transform: "translateX(-50%)" }; case "right": return { top: `${Math.round(n.top - t.top + n.height / 2)}px`, left: `${Math.round(n.left - t.left + n.width)}px`, transform: "translateX(-100%) translateY(-50%)" }; case "left": return { top: `${Math.round(n.top - t.top + n.height / 2)}px`, left: `${Math.round(n.left - t.left)}px`, transform: "translateY(-50%)" }; case "bottom": default: return { top: `${Math.round(n.top - t.top + n.height)}px`, left: `${Math.round(n.left - t.left + n.width / 2)}px`, transform: "translateX(-50%) translateY(-100%)" }; } switch (e) { case "bottom-start": return { top: `${Math.round(n.top - t.top + n.height + o)}px`, left: `${Math.round(n.left - t.left + r)}px`, transform: "" }; case "bottom-end": return { top: `${Math.round(n.top - t.top + n.height + o)}px`, left: `${Math.round(n.left - t.left + n.width + r)}px`, transform: "translateX(-100%)" }; case "top-start": return { top: `${Math.round(n.top - t.top + o)}px`, left: `${Math.round(n.left - t.left + r)}px`, transform: "translateY(-100%)" }; case "top-end": return { top: `${Math.round(n.top - t.top + o)}px`, left: `${Math.round