@avilang/practical-ui
Version:
Practical UI components created based on vue3
1,798 lines (1,797 loc) • 982 kB
JavaScript
import { ref as L, readonly as Vn, watch as Me, computed as E, getCurrentInstance as Ao, onMounted as $t, onBeforeUnmount as Bt, onBeforeMount as pr, reactive as Eo, inject as pe, onActivated as Td, onDeactivated as Ka, createTextVNode as jt, Fragment as je, Comment as qa, defineComponent as J, provide as ze, withDirectives as rn, toRef as ie, h as f, Teleport as yi, nextTick as ht, renderSlot as Zt, mergeProps as Pt, isVNode as _f, shallowRef as Od, watchEffect as rt, Transition as It, TransitionGroup as Vf, vShow as Un, cloneVNode as Md, Text as Uf, markRaw as Hl, onUnmounted as Id, normalizeClass as zt, createApp as Kf, unref as re, openBlock as Be, createBlock as et, withCtx as We, createVNode as Yt, onScopeDispose as Ci, mergeModels as At, useAttrs as Bn, useModel as fn, useTemplateRef as ar, withKeys as qf, createSlots as mr, normalizeProps as Gf, guardReactiveProps as Xf, normalizeStyle as Ut, useSlots as Ga, createCommentVNode as yt, createElementBlock as dt, createElementVNode as Hn, toDisplayString as cn, resolveDynamicComponent as jn, renderList as ho, withModifiers as Yf, toValue as Zf } from "vue";
function Jf(e) {
let t = ".", r = "__", o = "--", i;
if (e) {
let h = e.blockPrefix;
h && (t = h), h = e.elementPrefix, h && (r = h), h = e.modifierPrefix, h && (o = h);
}
const a = {
install(h) {
i = h.c;
const p = h.context;
p.bem = {}, p.bem.b = null, p.bem.els = null;
}
};
function s(h) {
let p, x;
return {
before(b) {
p = b.bem.b, x = b.bem.els, b.bem.els = null;
},
after(b) {
b.bem.b = p, b.bem.els = x;
},
$({ context: b, props: y }) {
return h = typeof h == "string" ? h : h({ context: b, props: y }), b.bem.b = h, `${(y == null ? void 0 : y.bPrefix) || t}${b.bem.b}`;
}
};
}
function l(h) {
let p;
return {
before(x) {
p = x.bem.els;
},
after(x) {
x.bem.els = p;
},
$({ context: x, props: b }) {
return h = typeof h == "string" ? h : h({ context: x, props: b }), x.bem.els = h.split(",").map((y) => y.trim()), x.bem.els.map((y) => `${(b == null ? void 0 : b.bPrefix) || t}${x.bem.b}${r}${y}`).join(", ");
}
};
}
function d(h) {
return {
$({ context: p, props: x }) {
h = typeof h == "string" ? h : h({ context: p, props: x });
const b = h.split(",").map((C) => C.trim());
function y(C) {
return b.map((P) => `&${(x == null ? void 0 : x.bPrefix) || t}${p.bem.b}${C !== void 0 ? `${r}${C}` : ""}${o}${P}`).join(", ");
}
const B = p.bem.els;
if (B !== null) {
if (process.env.NODE_ENV !== "production" && B.length >= 2)
throw Error(`[css-render/plugin-bem]: m(${h}) is invalid, using modifier inside multiple elements is not allowed`);
return y(B[0]);
} else
return y();
}
};
}
function u(h) {
return {
$({ context: p, props: x }) {
h = typeof h == "string" ? h : h({ context: p, props: x });
const b = p.bem.els;
if (process.env.NODE_ENV !== "production" && b !== null && b.length >= 2)
throw Error(`[css-render/plugin-bem]: notM(${h}) is invalid, using modifier inside multiple elements is not allowed`);
return `&:not(${(x == null ? void 0 : x.bPrefix) || t}${p.bem.b}${b !== null && b.length > 0 ? `${r}${b[0]}` : ""}${o}${h})`;
}
};
}
return Object.assign(a, {
cB: (...h) => i(s(h[0]), h[1], h[2]),
cE: (...h) => i(l(h[0]), h[1], h[2]),
cM: (...h) => i(d(h[0]), h[1], h[2]),
cNotM: (...h) => i(u(h[0]), h[1], h[2])
}), a;
}
function Qf(e) {
let t = 0;
for (let r = 0; r < e.length; ++r)
e[r] === "&" && ++t;
return t;
}
const Ld = /\s*,(?![^(]*\))\s*/g, eh = /\s+/g;
function th(e, t) {
const r = [];
return t.split(Ld).forEach((o) => {
let i = Qf(o);
if (i) {
if (i === 1) {
e.forEach((s) => {
r.push(o.replace("&", s));
});
return;
}
} else {
e.forEach((s) => {
r.push(
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
(s && s + " ") + o
);
});
return;
}
let a = [
o
];
for (; i--; ) {
const s = [];
a.forEach((l) => {
e.forEach((d) => {
s.push(l.replace("&", d));
});
}), a = s;
}
a.forEach((s) => r.push(s));
}), r;
}
function nh(e, t) {
const r = [];
return t.split(Ld).forEach((o) => {
e.forEach((i) => {
r.push((i && i + " ") + o);
});
}), r;
}
function rh(e) {
let t = [""];
return e.forEach((r) => {
r = r && r.trim(), // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
r && (r.includes("&") ? t = th(t, r) : t = nh(t, r));
}), t.join(", ").replace(eh, " ");
}
function jl(e) {
if (!e)
return;
const t = e.parentElement;
t && t.removeChild(e);
}
function wi(e, t) {
return (t ?? document.head).querySelector(`style[cssr-id="${e}"]`);
}
function oh(e) {
const t = document.createElement("style");
return t.setAttribute("cssr-id", e), t;
}
function Ho(e) {
return e ? /^\s*@(s|m)/.test(e) : !1;
}
const ih = /[A-Z]/g;
function Nd(e) {
return e.replace(ih, (t) => "-" + t.toLowerCase());
}
function ah(e, t = " ") {
return typeof e == "object" && e !== null ? ` {
` + Object.entries(e).map((r) => t + ` ${Nd(r[0])}: ${r[1]};`).join(`
`) + `
` + t + "}" : `: ${e};`;
}
function lh(e, t, r) {
return typeof e == "function" ? e({
context: t.context,
props: r
}) : e;
}
function Wl(e, t, r, o) {
if (!t)
return "";
const i = lh(t, r, o);
if (!i)
return "";
if (typeof i == "string")
return `${e} {
${i}
}`;
const a = Object.keys(i);
if (a.length === 0)
return r.config.keepEmptyBlock ? e + ` {
}` : "";
const s = e ? [
e + " {"
] : [];
return a.forEach((l) => {
const d = i[l];
if (l === "raw") {
s.push(`
` + d + `
`);
return;
}
l = Nd(l), d != null && s.push(` ${l}${ah(d)}`);
}), e && s.push("}"), s.join(`
`);
}
function pa(e, t, r) {
e && e.forEach((o) => {
if (Array.isArray(o))
pa(o, t, r);
else if (typeof o == "function") {
const i = o(t);
Array.isArray(i) ? pa(i, t, r) : i && r(i);
} else o && r(o);
});
}
function Hd(e, t, r, o, i) {
const a = e.$;
let s = "";
if (!a || typeof a == "string")
Ho(a) ? s = a : t.push(a);
else if (typeof a == "function") {
const u = a({
context: o.context,
props: i
});
Ho(u) ? s = u : t.push(u);
} else if (a.before && a.before(o.context), !a.$ || typeof a.$ == "string")
Ho(a.$) ? s = a.$ : t.push(a.$);
else if (a.$) {
const u = a.$({
context: o.context,
props: i
});
Ho(u) ? s = u : t.push(u);
}
const l = rh(t), d = Wl(l, e.props, o, i);
s ? r.push(`${s} {`) : d.length && r.push(d), e.children && pa(e.children, {
context: o.context,
props: i
}, (u) => {
if (typeof u == "string") {
const c = Wl(l, { raw: u }, o, i);
r.push(c);
} else
Hd(u, t, r, o, i);
}), t.pop(), s && r.push("}"), a && a.after && a.after(o.context);
}
function sh(e, t, r) {
const o = [];
return Hd(e, [], o, t, r), o.join(`
`);
}
function Co(e) {
for (var t = 0, r, o = 0, i = e.length; i >= 4; ++o, i -= 4)
r = e.charCodeAt(o) & 255 | (e.charCodeAt(++o) & 255) << 8 | (e.charCodeAt(++o) & 255) << 16 | (e.charCodeAt(++o) & 255) << 24, r = /* Math.imul(k, m): */
(r & 65535) * 1540483477 + ((r >>> 16) * 59797 << 16), r ^= /* k >>> r: */
r >>> 24, t = /* Math.imul(k, m): */
(r & 65535) * 1540483477 + ((r >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */
(t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16);
switch (i) {
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 dh(e, t, r, o) {
const { els: i } = t;
if (r === void 0)
i.forEach(jl), t.els = [];
else {
const a = wi(r, o);
a && i.includes(a) && (jl(a), t.els = i.filter((s) => s !== a));
}
}
function _l(e, t) {
e.push(t);
}
function uh(e, t, r, o, i, a, s, l, d) {
let u;
if (r === void 0 && (u = t.render(o), r = Co(u)), d) {
d.adapter(r, u ?? t.render(o));
return;
}
l === void 0 && (l = document.head);
const c = wi(r, l);
if (c !== null && !a)
return c;
const v = c ?? oh(r);
if (u === void 0 && (u = t.render(o)), v.textContent = u, c !== null)
return c;
if (s) {
const g = l.querySelector(`meta[name="${s}"]`);
if (g)
return l.insertBefore(v, g), _l(t.els, v), v;
}
return i ? l.insertBefore(v, l.querySelector("style, link")) : l.appendChild(v), _l(t.els, v), v;
}
function ch(e) {
return sh(this, this.instance, e);
}
function fh(e = {}) {
const { id: t, ssr: r, props: o, head: i = !1, force: a = !1, anchorMetaName: s, parent: l } = e;
return uh(this.instance, this, t, o, i, a, s, l, r);
}
function hh(e = {}) {
const { id: t, parent: r } = e;
dh(this.instance, this, t, r);
}
const jo = function(e, t, r, o) {
return {
instance: e,
$: t,
props: r,
children: o,
els: [],
render: ch,
mount: fh,
unmount: hh
};
}, vh = function(e, t, r, o) {
return Array.isArray(t) ? jo(e, { $: null }, null, t) : Array.isArray(r) ? jo(e, t, null, r) : Array.isArray(o) ? jo(e, t, r, o) : jo(e, t, r, null);
};
function jd(e = {}) {
const t = {
c: (...r) => vh(t, ...r),
use: (r, ...o) => r.install(t, ...o),
find: wi,
context: {},
config: e
};
return t;
}
function gh(e, t) {
if (e === void 0)
return !1;
if (t) {
const { context: { ids: r } } = t;
return r.has(e);
}
return wi(e) !== null;
}
const ph = "n", wo = `.${ph}-`, mh = "__", bh = "--", Wd = jd(), _d = Jf({
blockPrefix: wo,
elementPrefix: mh,
modifierPrefix: bh
});
Wd.use(_d);
const {
c: D,
find: HB
} = Wd, {
cB: z,
cE: T,
cM: I,
cNotM: Ue
} = _d;
function Si(e) {
return D(({
props: {
bPrefix: t
}
}) => `${t || wo}modal, ${t || wo}drawer`, [e]);
}
function Xa(e) {
return D(({
props: {
bPrefix: t
}
}) => `${t || wo}popover`, [e]);
}
function Vd(e) {
return D(({
props: {
bPrefix: t
}
}) => `&${t || wo}modal`, e);
}
const xh = (...e) => D(">", [z(...e)]);
function Z(e, t) {
return e + (t === "default" ? "" : t.replace(/^[a-z]/, (r) => r.toUpperCase()));
}
let li = [];
const Ud = /* @__PURE__ */ new WeakMap();
function yh() {
li.forEach((e) => e(...Ud.get(e))), li = [];
}
function si(e, ...t) {
Ud.set(e, t), !li.includes(e) && li.push(e) === 1 && requestAnimationFrame(yh);
}
function Jt(e, t) {
let { target: r } = e;
for (; r; ) {
if (r.dataset && r.dataset[t] !== void 0)
return !0;
r = r.parentElement;
}
return !1;
}
function Hr(e) {
return e.composedPath()[0] || null;
}
function Mt(e) {
return typeof e == "string" ? e.endsWith("px") ? Number(e.slice(0, e.length - 2)) : Number(e) : e;
}
function wt(e) {
if (e != null)
return typeof e == "number" ? `${e}px` : e.endsWith("px") ? e : `${e}px`;
}
function Vt(e, t) {
const r = e.trim().split(/\s+/g), o = {
top: r[0]
};
switch (r.length) {
case 1:
o.right = r[0], o.bottom = r[0], o.left = r[0];
break;
case 2:
o.right = r[1], o.left = r[1], o.bottom = r[0];
break;
case 3:
o.right = r[1], o.bottom = r[2], o.left = r[1];
break;
case 4:
o.right = r[1], o.bottom = r[2], o.left = r[3];
break;
default:
throw new Error("[seemly/getMargin]:" + e + " is not a valid value.");
}
return t === void 0 ? o : o[t];
}
const Vl = {
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"
}, Kr = "^\\s*", qr = "\\s*$", nr = "\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*", rr = "([0-9A-Fa-f])", or = "([0-9A-Fa-f]{2})", Ch = new RegExp(`${Kr}rgb\\s*\\(${nr},${nr},${nr}\\)${qr}`), wh = new RegExp(`${Kr}rgba\\s*\\(${nr},${nr},${nr},${nr}\\)${qr}`), Sh = new RegExp(`${Kr}#${rr}${rr}${rr}${qr}`), Bh = new RegExp(`${Kr}#${or}${or}${or}${qr}`), kh = new RegExp(`${Kr}#${rr}${rr}${rr}${rr}${qr}`), Rh = new RegExp(`${Kr}#${or}${or}${or}${or}${qr}`);
function Xt(e) {
return parseInt(e, 16);
}
function dr(e) {
try {
let t;
if (t = Bh.exec(e))
return [Xt(t[1]), Xt(t[2]), Xt(t[3]), 1];
if (t = Ch.exec(e))
return [Ht(t[1]), Ht(t[5]), Ht(t[9]), 1];
if (t = wh.exec(e))
return [
Ht(t[1]),
Ht(t[5]),
Ht(t[9]),
vo(t[13])
];
if (t = Sh.exec(e))
return [
Xt(t[1] + t[1]),
Xt(t[2] + t[2]),
Xt(t[3] + t[3]),
1
];
if (t = Rh.exec(e))
return [
Xt(t[1]),
Xt(t[2]),
Xt(t[3]),
vo(Xt(t[4]) / 255)
];
if (t = kh.exec(e))
return [
Xt(t[1] + t[1]),
Xt(t[2] + t[2]),
Xt(t[3] + t[3]),
vo(Xt(t[4] + t[4]) / 255)
];
if (e in Vl)
return dr(Vl[e]);
throw new Error(`[seemly/rgba]: Invalid color value ${e}.`);
} catch (t) {
throw t;
}
}
function Ph(e) {
return e > 1 ? 1 : e < 0 ? 0 : e;
}
function ma(e, t, r, o) {
return `rgba(${Ht(e)}, ${Ht(t)}, ${Ht(r)}, ${Ph(o)})`;
}
function Gi(e, t, r, o, i) {
return Ht((e * t * (1 - o) + r * o) / i);
}
function Je(e, t) {
Array.isArray(e) || (e = dr(e)), Array.isArray(t) || (t = dr(t));
const r = e[3], o = t[3], i = vo(r + o - r * o);
return ma(Gi(e[0], r, t[0], o, i), Gi(e[1], r, t[1], o, i), Gi(e[2], r, t[2], o, i), i);
}
function De(e, t) {
const [r, o, i, a = 1] = Array.isArray(e) ? e : dr(e);
return t.alpha ? ma(r, o, i, t.alpha) : ma(r, o, i, a);
}
function Wo(e, t) {
const [r, o, i, a = 1] = Array.isArray(e) ? e : dr(e), { lightness: s = 1, alpha: l = 1 } = t;
return Fh([r * s, o * s, i * s, a * l]);
}
function vo(e) {
const t = Math.round(Number(e) * 100) / 100;
return t > 1 ? 1 : t < 0 ? 0 : t;
}
function Ht(e) {
const t = Math.round(Number(e));
return t > 255 ? 255 : t < 0 ? 0 : t;
}
function Fh(e) {
const [t, r, o] = e;
return 3 in e ? `rgba(${Ht(t)}, ${Ht(r)}, ${Ht(o)}, ${vo(e[3])})` : `rgba(${Ht(t)}, ${Ht(r)}, ${Ht(o)}, 1)`;
}
function wn(e = 8) {
return Math.random().toString(16).slice(2, 2 + e);
}
function $h(e, t) {
const r = [];
for (let o = 0; o < e; ++o)
r.push(t);
return r;
}
function oi(e) {
return e.composedPath()[0];
}
const zh = {
mousemoveoutside: /* @__PURE__ */ new WeakMap(),
clickoutside: /* @__PURE__ */ new WeakMap()
};
function Ah(e, t, r) {
if (e === "mousemoveoutside") {
const o = (i) => {
t.contains(oi(i)) || r(i);
};
return {
mousemove: o,
touchstart: o
};
} else if (e === "clickoutside") {
let o = !1;
const i = (s) => {
o = !t.contains(oi(s));
}, a = (s) => {
o && (t.contains(oi(s)) || r(s));
};
return {
mousedown: i,
mouseup: a,
touchstart: i,
touchend: a
};
}
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 Kd(e, t, r) {
const o = zh[e];
let i = o.get(t);
i === void 0 && o.set(t, i = /* @__PURE__ */ new WeakMap());
let a = i.get(r);
return a === void 0 && i.set(r, a = Ah(e, t, r)), a;
}
function Eh(e, t, r, o) {
if (e === "mousemoveoutside" || e === "clickoutside") {
const i = Kd(e, t, r);
return Object.keys(i).forEach((a) => {
qe(a, document, i[a], o);
}), !0;
}
return !1;
}
function Dh(e, t, r, o) {
if (e === "mousemoveoutside" || e === "clickoutside") {
const i = Kd(e, t, r);
return Object.keys(i).forEach((a) => {
Ve(a, document, i[a], o);
}), !0;
}
return !1;
}
function Th() {
if (typeof window > "u")
return {
on: () => {
},
off: () => {
}
};
const e = /* @__PURE__ */ new WeakMap(), t = /* @__PURE__ */ new WeakMap();
function r() {
e.set(this, !0);
}
function o() {
e.set(this, !0), t.set(this, !0);
}
function i(S, w, R) {
const F = S[w];
return S[w] = function() {
return R.apply(S, arguments), F.apply(S, arguments);
}, S;
}
function a(S, w) {
S[w] = Event.prototype[w];
}
const s = /* @__PURE__ */ new WeakMap(), l = Object.getOwnPropertyDescriptor(Event.prototype, "currentTarget");
function d() {
var S;
return (S = s.get(this)) !== null && S !== void 0 ? S : null;
}
function u(S, w) {
l !== void 0 && Object.defineProperty(S, "currentTarget", {
configurable: !0,
enumerable: !0,
get: w ?? l.get
});
}
const c = {
bubble: {},
capture: {}
}, v = {};
function g() {
const S = function(w) {
const { type: R, eventPhase: F, bubbles: N } = w, $ = oi(w);
if (F === 2)
return;
const n = F === 1 ? "capture" : "bubble";
let O = $;
const M = [];
for (; O === null && (O = window), M.push(O), O !== window; )
O = O.parentNode || null;
const W = c.capture[R], H = c.bubble[R];
if (i(w, "stopPropagation", r), i(w, "stopImmediatePropagation", o), u(w, d), n === "capture") {
if (W === void 0)
return;
for (let U = M.length - 1; U >= 0 && !e.has(w); --U) {
const ee = M[U], Y = W.get(ee);
if (Y !== void 0) {
s.set(w, ee);
for (const K of Y) {
if (t.has(w))
break;
K(w);
}
}
if (U === 0 && !N && H !== void 0) {
const K = H.get(ee);
if (K !== void 0)
for (const j of K) {
if (t.has(w))
break;
j(w);
}
}
}
} else if (n === "bubble") {
if (H === void 0)
return;
for (let U = 0; U < M.length && !e.has(w); ++U) {
const ee = M[U], Y = H.get(ee);
if (Y !== void 0) {
s.set(w, ee);
for (const K of Y) {
if (t.has(w))
break;
K(w);
}
}
}
}
a(w, "stopPropagation"), a(w, "stopImmediatePropagation"), u(w);
};
return S.displayName = "evtdUnifiedHandler", S;
}
function m() {
const S = function(w) {
const { type: R, eventPhase: F } = w;
if (F !== 2)
return;
const N = v[R];
N !== void 0 && N.forEach(($) => $(w));
};
return S.displayName = "evtdUnifiedWindowEventHandler", S;
}
const h = g(), p = m();
function x(S, w) {
const R = c[S];
return R[w] === void 0 && (R[w] = /* @__PURE__ */ new Map(), window.addEventListener(w, h, S === "capture")), R[w];
}
function b(S) {
return v[S] === void 0 && (v[S] = /* @__PURE__ */ new Set(), window.addEventListener(S, p)), v[S];
}
function y(S, w) {
let R = S.get(w);
return R === void 0 && S.set(w, R = /* @__PURE__ */ new Set()), R;
}
function B(S, w, R, F) {
const N = c[w][R];
if (N !== void 0) {
const $ = N.get(S);
if ($ !== void 0 && $.has(F))
return !0;
}
return !1;
}
function C(S, w) {
const R = v[S];
return !!(R !== void 0 && R.has(w));
}
function P(S, w, R, F) {
let N;
if (typeof F == "object" && F.once === !0 ? N = (W) => {
k(S, w, N, F), R(W);
} : N = R, Eh(S, w, N, F))
return;
const n = F === !0 || typeof F == "object" && F.capture === !0 ? "capture" : "bubble", O = x(n, S), M = y(O, w);
if (M.has(N) || M.add(N), w === window) {
const W = b(S);
W.has(N) || W.add(N);
}
}
function k(S, w, R, F) {
if (Dh(S, w, R, F))
return;
const $ = F === !0 || typeof F == "object" && F.capture === !0, n = $ ? "capture" : "bubble", O = x(n, S), M = y(O, w);
if (w === window && !B(w, $ ? "bubble" : "capture", S, R) && C(S, R)) {
const H = v[S];
H.delete(R), H.size === 0 && (window.removeEventListener(S, p), v[S] = void 0);
}
M.has(R) && M.delete(R), M.size === 0 && O.delete(w), O.size === 0 && (window.removeEventListener(S, h, n === "capture"), c[n][S] = void 0);
}
return {
on: P,
off: k
};
}
const { on: qe, off: Ve } = Th();
function qd(e) {
const t = L(!!e.value);
if (t.value)
return Vn(t);
const r = Me(e, (o) => {
o && (t.value = !0, r());
});
return Vn(t);
}
function Ge(e) {
const t = E(e), r = L(t.value);
return Me(t, (o) => {
r.value = o;
}), typeof e == "function" ? r : {
__v_isRef: !0,
get value() {
return r.value;
},
set value(o) {
e.set(o);
}
};
}
function Ya() {
return Ao() !== null;
}
const Za = typeof window < "u";
let Or, go;
const Oh = () => {
var e, t;
Or = Za ? (t = (e = document) === null || e === void 0 ? void 0 : e.fonts) === null || t === void 0 ? void 0 : t.ready : void 0, go = !1, Or !== void 0 ? Or.then(() => {
go = !0;
}) : go = !0;
};
Oh();
function Mh(e) {
if (go)
return;
let t = !1;
$t(() => {
go || Or == null || Or.then(() => {
t || e();
});
}), Bt(() => {
t = !0;
});
}
const so = L(null);
function Ul(e) {
if (e.clientX > 0 || e.clientY > 0)
so.value = {
x: e.clientX,
y: e.clientY
};
else {
const { target: t } = e;
if (t instanceof Element) {
const { left: r, top: o, width: i, height: a } = t.getBoundingClientRect();
r > 0 || o > 0 ? so.value = {
x: r + i / 2,
y: o + a / 2
} : so.value = { x: 0, y: 0 };
} else
so.value = null;
}
}
let _o = 0, Kl = !0;
function Ja() {
if (!Za)
return Vn(L(null));
_o === 0 && qe("click", document, Ul, !0);
const e = () => {
_o += 1;
};
return Kl && (Kl = Ya()) ? (pr(e), Bt(() => {
_o -= 1, _o === 0 && Ve("click", document, Ul, !0);
})) : e(), Vn(so);
}
const Ih = L(void 0);
let Vo = 0;
function ql() {
Ih.value = Date.now();
}
let Gl = !0;
function Qa(e) {
if (!Za)
return Vn(L(!1));
const t = L(!1);
let r = null;
function o() {
r !== null && window.clearTimeout(r);
}
function i() {
o(), t.value = !0, r = window.setTimeout(() => {
t.value = !1;
}, e);
}
Vo === 0 && qe("click", window, ql, !0);
const a = () => {
Vo += 1, qe("click", window, i, !0);
};
return Gl && (Gl = Ya()) ? (pr(a), Bt(() => {
Vo -= 1, Vo === 0 && Ve("click", window, ql, !0), Ve("click", window, i, !0), o();
})) : a(), Vn(t);
}
function Et(e, t) {
return Me(e, (r) => {
r !== void 0 && (t.value = r);
}), E(() => e.value === void 0 ? t.value : e.value);
}
function br() {
const e = L(!1);
return $t(() => {
e.value = !0;
}), Vn(e);
}
function el(e, t) {
return E(() => {
for (const r of t)
if (e[r] !== void 0)
return e[r];
return e[t[t.length - 1]];
});
}
const Lh = (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 Nh() {
return Lh;
}
function Hh(e = {}, t) {
const r = Eo({
ctrl: !1,
command: !1,
win: !1,
shift: !1,
tab: !1
}), { keydown: o, keyup: i } = e, a = (d) => {
switch (d.key) {
case "Control":
r.ctrl = !0;
break;
case "Meta":
r.command = !0, r.win = !0;
break;
case "Shift":
r.shift = !0;
break;
case "Tab":
r.tab = !0;
break;
}
o !== void 0 && Object.keys(o).forEach((u) => {
if (u !== d.key)
return;
const c = o[u];
if (typeof c == "function")
c(d);
else {
const { stop: v = !1, prevent: g = !1 } = c;
v && d.stopPropagation(), g && d.preventDefault(), c.handler(d);
}
});
}, s = (d) => {
switch (d.key) {
case "Control":
r.ctrl = !1;
break;
case "Meta":
r.command = !1, r.win = !1;
break;
case "Shift":
r.shift = !1;
break;
case "Tab":
r.tab = !1;
break;
}
i !== void 0 && Object.keys(i).forEach((u) => {
if (u !== d.key)
return;
const c = i[u];
if (typeof c == "function")
c(d);
else {
const { stop: v = !1, prevent: g = !1 } = c;
v && d.stopPropagation(), g && d.preventDefault(), c.handler(d);
}
});
}, l = () => {
(t === void 0 || t.value) && (qe("keydown", document, a), qe("keyup", document, s)), t !== void 0 && Me(t, (d) => {
d ? (qe("keydown", document, a), qe("keyup", document, s)) : (Ve("keydown", document, a), Ve("keyup", document, s));
});
};
return Ya() ? (pr(l), Bt(() => {
(t === void 0 || t.value) && (Ve("keydown", document, a), Ve("keyup", document, s));
})) : l(), Vn(r);
}
const tl = "n-internal-select-menu", Gd = "n-internal-select-menu-body", Do = "n-drawer-body", nl = "n-drawer", To = "n-modal-body", jh = "n-modal-provider", Xd = "n-modal", Gr = "n-popover-body", Yd = "__disabled__";
function Sn(e) {
const t = pe(To, null), r = pe(Do, null), o = pe(Gr, null), i = pe(Gd, null), a = L();
if (typeof document < "u") {
a.value = document.fullscreenElement;
const s = () => {
a.value = document.fullscreenElement;
};
$t(() => {
qe("fullscreenchange", document, s);
}), Bt(() => {
Ve("fullscreenchange", document, s);
});
}
return Ge(() => {
var s;
const {
to: l
} = e;
return l !== void 0 ? l === !1 ? Yd : l === !0 ? a.value || "body" : l : t != null && t.value ? (s = t.value.$el) !== null && s !== void 0 ? s : t.value : r != null && r.value ? r.value : o != null && o.value ? o.value : i != null && i.value ? i.value : l ?? (a.value || "body");
});
}
Sn.tdkey = Yd;
Sn.propTo = {
type: [String, Object, Boolean],
default: void 0
};
function Wh(e, t, r) {
var o;
const i = pe(e, null);
if (i === null) return;
const a = (o = Ao()) === null || o === void 0 ? void 0 : o.proxy;
Me(r, s), s(r.value), Bt(() => {
s(void 0, r.value);
});
function s(u, c) {
if (!i) return;
const v = i[t];
c !== void 0 && l(v, c), u !== void 0 && d(v, u);
}
function l(u, c) {
u[c] || (u[c] = []), u[c].splice(u[c].findIndex((v) => v === a), 1);
}
function d(u, c) {
u[c] || (u[c] = []), ~u[c].findIndex((v) => v === a) || u[c].push(a);
}
}
function _h(e, t, r) {
const o = L(e.value);
let i = null;
return Me(e, (a) => {
i !== null && window.clearTimeout(i), a === !0 ? r && !r.value ? o.value = !0 : i = window.setTimeout(() => {
o.value = !0;
}, t) : o.value = !1;
}), o;
}
const Xr = typeof document < "u" && typeof window < "u", rl = L(!1);
function Xl() {
rl.value = !0;
}
function Yl() {
rl.value = !1;
}
let oo = 0;
function Zd() {
return Xr && (pr(() => {
oo || (window.addEventListener("compositionstart", Xl), window.addEventListener("compositionend", Yl)), oo++;
}), Bt(() => {
oo <= 1 ? (window.removeEventListener("compositionstart", Xl), window.removeEventListener("compositionend", Yl), oo = 0) : oo--;
})), rl;
}
let zr = 0, Zl = "", Jl = "", Ql = "", es = "";
const ts = L("0px");
function Jd(e) {
if (typeof document > "u") return;
const t = document.documentElement;
let r, o = !1;
const i = () => {
t.style.marginRight = Zl, t.style.overflow = Jl, t.style.overflowX = Ql, t.style.overflowY = es, ts.value = "0px";
};
$t(() => {
r = Me(e, (a) => {
if (a) {
if (!zr) {
const s = window.innerWidth - t.offsetWidth;
s > 0 && (Zl = t.style.marginRight, t.style.marginRight = `${s}px`, ts.value = `${s}px`), Jl = t.style.overflow, Ql = t.style.overflowX, es = t.style.overflowY, t.style.overflow = "hidden", t.style.overflowX = "hidden", t.style.overflowY = "hidden";
}
o = !0, zr++;
} else
zr--, zr || i(), o = !1;
}, {
immediate: !0
});
}), Bt(() => {
r == null || r(), o && (zr--, zr || i(), o = !1);
});
}
function Vh(e) {
const t = {
isDeactivated: !1
};
let r = !1;
return Td(() => {
if (t.isDeactivated = !1, !r) {
r = !0;
return;
}
e();
}), Ka(() => {
t.isDeactivated = !0, r || (r = !0);
}), t;
}
function ba(e, t, r = "default") {
const o = t[r];
if (o === void 0)
throw new Error(`[vueuc/${e}]: slot[${r}] is empty.`);
return o();
}
function xa(e, t = !0, r = []) {
return e.forEach((o) => {
if (o !== null) {
if (typeof o != "object") {
(typeof o == "string" || typeof o == "number") && r.push(jt(String(o)));
return;
}
if (Array.isArray(o)) {
xa(o, t, r);
return;
}
if (o.type === je) {
if (o.children === null)
return;
Array.isArray(o.children) && xa(o.children, t, r);
} else o.type !== qa && r.push(o);
}
}), r;
}
function ns(e, t, r = "default") {
const o = t[r];
if (o === void 0)
throw new Error(`[vueuc/${e}]: slot[${r}] is empty.`);
const i = xa(o());
if (i.length === 1)
return i[0];
throw new Error(`[vueuc/${e}]: slot[${r}] should have exactly one child.`);
}
let Ln = null;
function Qd() {
if (Ln === null && (Ln = document.getElementById("v-binder-view-measurer"), Ln === null)) {
Ln = document.createElement("div"), Ln.id = "v-binder-view-measurer";
const { style: e } = Ln;
e.position = "fixed", e.left = "0", e.right = "0", e.top = "0", e.bottom = "0", e.pointerEvents = "none", e.visibility = "hidden", document.body.appendChild(Ln);
}
return Ln.getBoundingClientRect();
}
function Uh(e, t) {
const r = Qd();
return {
top: t,
left: e,
height: 0,
width: 0,
right: r.width - e,
bottom: r.height - t
};
}
function Xi(e) {
const t = e.getBoundingClientRect(), r = Qd();
return {
left: t.left - r.left,
top: t.top - r.top,
bottom: r.height + r.top - t.bottom,
right: r.width + r.left - t.right,
width: t.width,
height: t.height
};
}
function Kh(e) {
return e.nodeType === 9 ? null : e.parentNode;
}
function eu(e) {
if (e === null)
return null;
const t = Kh(e);
if (t === null)
return null;
if (t.nodeType === 9)
return document;
if (t.nodeType === 1) {
const { overflow: r, overflowX: o, overflowY: i } = getComputedStyle(t);
if (/(auto|scroll|overlay)/.test(r + i + o))
return t;
}
return eu(t);
}
const ol = J({
name: "Binder",
props: {
syncTargetWithParent: Boolean,
syncTarget: {
type: Boolean,
default: !0
}
},
setup(e) {
var t;
ze("VBinder", (t = Ao()) === null || t === void 0 ? void 0 : t.proxy);
const r = pe("VBinder", null), o = L(null), i = (b) => {
o.value = b, r && e.syncTargetWithParent && r.setTargetRef(b);
};
let a = [];
const s = () => {
let b = o.value;
for (; b = eu(b), b !== null; )
a.push(b);
for (const y of a)
qe("scroll", y, v, !0);
}, l = () => {
for (const b of a)
Ve("scroll", b, v, !0);
a = [];
}, d = /* @__PURE__ */ new Set(), u = (b) => {
d.size === 0 && s(), d.has(b) || d.add(b);
}, c = (b) => {
d.has(b) && d.delete(b), d.size === 0 && l();
}, v = () => {
si(g);
}, g = () => {
d.forEach((b) => b());
}, m = /* @__PURE__ */ new Set(), h = (b) => {
m.size === 0 && qe("resize", window, x), m.has(b) || m.add(b);
}, p = (b) => {
m.has(b) && m.delete(b), m.size === 0 && Ve("resize", window, x);
}, x = () => {
m.forEach((b) => b());
};
return Bt(() => {
Ve("resize", window, x), l();
}), {
targetRef: o,
setTargetRef: i,
addScrollListener: u,
removeScrollListener: c,
addResizeListener: h,
removeResizeListener: p
};
},
render() {
return ba("binder", this.$slots);
}
}), il = J({
name: "Target",
setup() {
const { setTargetRef: e, syncTarget: t } = pe("VBinder");
return {
syncTarget: t,
setTargetDirective: {
mounted: e,
updated: e
}
};
},
render() {
const { syncTarget: e, setTargetDirective: t } = this;
return e ? rn(ns("follower", this.$slots), [
[t]
]) : ns("follower", this.$slots);
}
}), Ar = "@@mmoContext", qh = {
mounted(e, { value: t }) {
e[Ar] = {
handler: void 0
}, typeof t == "function" && (e[Ar].handler = t, qe("mousemoveoutside", e, t));
},
updated(e, { value: t }) {
const r = e[Ar];
typeof t == "function" ? r.handler ? r.handler !== t && (Ve("mousemoveoutside", e, r.handler), r.handler = t, qe("mousemoveoutside", e, t)) : (e[Ar].handler = t, qe("mousemoveoutside", e, t)) : r.handler && (Ve("mousemoveoutside", e, r.handler), r.handler = void 0);
},
unmounted(e) {
const { handler: t } = e[Ar];
t && Ve("mousemoveoutside", e, t), e[Ar].handler = void 0;
}
}, Er = "@@coContext", jr = {
mounted(e, { value: t, modifiers: r }) {
e[Er] = {
handler: void 0
}, typeof t == "function" && (e[Er].handler = t, qe("clickoutside", e, t, {
capture: r.capture
}));
},
updated(e, { value: t, modifiers: r }) {
const o = e[Er];
typeof t == "function" ? o.handler ? o.handler !== t && (Ve("clickoutside", e, o.handler, {
capture: r.capture
}), o.handler = t, qe("clickoutside", e, t, {
capture: r.capture
})) : (e[Er].handler = t, qe("clickoutside", e, t, {
capture: r.capture
})) : o.handler && (Ve("clickoutside", e, o.handler, {
capture: r.capture
}), o.handler = void 0);
},
unmounted(e, { modifiers: t }) {
const { handler: r } = e[Er];
r && Ve("clickoutside", e, r, {
capture: t.capture
}), e[Er].handler = void 0;
}
};
function Gh(e, t) {
console.error(`[vdirs/${e}]: ${t}`);
}
class Xh {
constructor() {
this.elementZIndex = /* @__PURE__ */ new Map(), this.nextZIndex = 2e3;
}
get elementCount() {
return this.elementZIndex.size;
}
ensureZIndex(t, r) {
const { elementZIndex: o } = this;
if (r !== void 0) {
t.style.zIndex = `${r}`, o.delete(t);
return;
}
const { nextZIndex: i } = this;
o.has(t) && o.get(t) + 1 === this.nextZIndex || (t.style.zIndex = `${i}`, o.set(t, i), this.nextZIndex = i + 1, this.squashState());
}
unregister(t, r) {
const { elementZIndex: o } = this;
o.has(t) ? o.delete(t) : r === void 0 && Gh("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((r, o) => r[1] - o[1]), this.nextZIndex = 2e3, t.forEach((r) => {
const o = r[0], i = this.nextZIndex++;
`${i}` !== o.style.zIndex && (o.style.zIndex = `${i}`);
});
}
}
const Yi = new Xh(), Dr = "@@ziContext", Bi = {
mounted(e, t) {
const { value: r = {} } = t, { zIndex: o, enabled: i } = r;
e[Dr] = {
enabled: !!i,
initialized: !1
}, i && (Yi.ensureZIndex(e, o), e[Dr].initialized = !0);
},
updated(e, t) {
const { value: r = {} } = t, { zIndex: o, enabled: i } = r, a = e[Dr].enabled;
i && !a && (Yi.ensureZIndex(e, o), e[Dr].initialized = !0), e[Dr].enabled = !!i;
},
unmounted(e, t) {
if (!e[Dr].initialized)
return;
const { value: r = {} } = t, { zIndex: o } = r;
Yi.unregister(e, o);
}
}, Yh = "@css-render/vue3-ssr";
function Zh(e, t) {
return `<style cssr-id="${e}">
${t}
</style>`;
}
function Jh(e, t, r) {
const { styles: o, ids: i } = r;
i.has(e) || o !== null && (i.add(e), o.push(Zh(e, t)));
}
const Qh = typeof document < "u";
function xr() {
if (Qh)
return;
const e = pe(Yh, null);
if (e !== null)
return {
adapter: (t, r) => Jh(t, r, e),
context: e
};
}
function rs(e, t) {
console.error(`[vueuc/${e}]: ${t}`);
}
const { c: _n } = jd(), al = "vueuc-style";
function os(e) {
return e & -e;
}
class tu {
/**
* @param l length of the array
* @param min min value of the array
*/
constructor(t, r) {
this.l = t, this.min = r;
const o = new Array(t + 1);
for (let i = 0; i < t + 1; ++i)
o[i] = 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, r) {
if (r === 0)
return;
const { l: o, ft: i } = this;
for (t += 1; t <= o; )
i[t] += r, t += os(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: r, min: o, l: i } = this;
if (t > i)
throw new Error("[FinweckTree.sum]: `i` is larger than length.");
let a = t * o;
for (; t > 0; )
a += r[t], t -= os(t);
return a;
}
/**
* 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 r = 0, o = this.l;
for (; o > r; ) {
const i = Math.floor((r + o) / 2), a = this.sum(i);
if (a > t) {
o = i;
continue;
} else if (a < t) {
if (r === i)
return this.sum(r + 1) <= t ? r + 1 : i;
r = i;
} else
return i;
}
return r;
}
}
function is(e) {
return typeof e == "string" ? document.querySelector(e) : e() || null;
}
const ll = J({
name: "LazyTeleport",
props: {
to: {
type: [String, Object],
default: void 0
},
disabled: Boolean,
show: {
type: Boolean,
required: !0
}
},
setup(e) {
return {
showTeleport: qd(ie(e, "show")),
mergedTo: E(() => {
const { to: t } = e;
return t ?? "body";
})
};
},
render() {
return this.showTeleport ? this.disabled ? ba("lazy-teleport", this.$slots) : f(yi, {
disabled: this.disabled,
to: this.mergedTo
}, ba("lazy-teleport", this.$slots)) : null;
}
}), Uo = {
top: "bottom",
bottom: "top",
left: "right",
right: "left"
}, as = {
start: "end",
center: "center",
end: "start"
}, Zi = {
top: "height",
bottom: "height",
left: "width",
right: "width"
}, e0 = {
"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"
}, t0 = {
"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"
}, n0 = {
"bottom-start": "right",
"bottom-end": "left",
"top-start": "right",
"top-end": "left",
"right-start": "bottom",
"right-end": "top",
"left-start": "bottom",
"left-end": "top"
}, ls = {
top: !0,
// top++
bottom: !1,
// top--
left: !0,
// left++
right: !1
// left--
}, ss = {
top: "end",
bottom: "start",
left: "end",
right: "start"
};
function r0(e, t, r, o, i, a) {
if (!i || a)
return { placement: e, top: 0, left: 0 };
const [s, l] = e.split("-");
let d = l ?? "center", u = {
top: 0,
left: 0
};
const c = (m, h, p) => {
let x = 0, b = 0;
const y = r[m] - t[h] - t[m];
return y > 0 && o && (p ? b = ls[h] ? y : -y : x = ls[h] ? y : -y), {
left: x,
top: b
};
}, v = s === "left" || s === "right";
if (d !== "center") {
const m = n0[e], h = Uo[m], p = Zi[m];
if (r[p] > t[p]) {
if (
// current space is not enough
// ----------[ target ]---------|
// -------[ follower ]
t[m] + t[p] < r[p]
) {
const x = (r[p] - t[p]) / 2;
t[m] < x || t[h] < x ? t[m] < t[h] ? (d = as[l], u = c(p, h, v)) : u = c(p, m, v) : d = "center";
}
} else r[p] < t[p] && t[h] < 0 && // opposite align has larger space
// ------------[ target ]
// ----------------[follower]
t[m] > t[h] && (d = as[l]);
} else {
const m = s === "bottom" || s === "top" ? "left" : "top", h = Uo[m], p = Zi[m], x = (r[p] - t[p]) / 2;
// center is not enough
// ----------- [ target ]--|
// -------[ follower ]
(t[m] < x || t[h] < x) && (t[m] > t[h] ? (d = ss[m], u = c(p, m, v)) : (d = ss[h], u = c(p, h, v)));
}
let g = s;
return (
// space is not enough
t[s] < r[Zi[s]] && // opposite position's space is larger
t[s] < t[Uo[s]] && (g = Uo[s]), {
placement: d !== "center" ? `${g}-${d}` : g,
left: u.left,
top: u.top
}
);
}
function o0(e, t) {
return t ? t0[e] : e0[e];
}
function i0(e, t, r, o, i, a) {
if (a)
switch (e) {
case "bottom-start":
return {
top: `${Math.round(r.top - t.top + r.height)}px`,
left: `${Math.round(r.left - t.left)}px`,
transform: "translateY(-100%)"
};
case "bottom-end":
return {
top: `${Math.round(r.top - t.top + r.height)}px`,
left: `${Math.round(r.left - t.left + r.width)}px`,
transform: "translateX(-100%) translateY(-100%)"
};
case "top-start":
return {
top: `${Math.round(r.top - t.top)}px`,
left: `${Math.round(r.left - t.left)}px`,
transform: ""
};
case "top-end":
return {
top: `${Math.round(r.top - t.top)}px`,
left: `${Math.round(r.left - t.left + r.width)}px`,
transform: "translateX(-100%)"
};
case "right-start":
return {
top: `${Math.round(r.top - t.top)}px`,
left: `${Math.round(r.left - t.left + r.width)}px`,
transform: "translateX(-100%)"
};
case "right-end":
return {
top: `${Math.round(r.top - t.top + r.height)}px`,
left: `${Math.round(r.left - t.left + r.width)}px`,
transform: "translateX(-100%) translateY(-100%)"
};
case "left-start":
return {
top: `${Math.round(r.top - t.top)}px`,
left: `${Math.round(r.left - t.left)}px`,
transform: ""
};
case "left-end":
return {
top: `${Math.round(r.top - t.top + r.height)}px`,
left: `${Math.round(r.left - t.left)}px`,
transform: "translateY(-100%)"
};
case "top":
return {
top: `${Math.round(r.top - t.top)}px`,
left: `${Math.round(r.left - t.left + r.width / 2)}px`,
transform: "translateX(-50%)"
};
case "right":
return {
top: `${Math.round(r.top - t.top + r.height / 2)}px`,
left: `${Math.round(r.left - t.left + r.width)}px`,
transform: "translateX(-100%) translateY(-50%)"
};
case "left":
return {
top: `${Math.round(r.top - t.top + r.height / 2)}px`,
left: `${Math.round(r.left - t.left)}px`,
transform: "translateY(-50%)"
};
case "bottom":
default:
return {
top: `${Math.round(r.top - t.top + r.height)}px`,
left: `${Math.round(r.left - t.left + r.width / 2)}px`,
transform: "translateX(-50%) translateY(-100%)"
};
}
switch (e) {
case "bottom-start":
return {
top: `${Math.round(r.top - t.top + r.height + o)}px`,
left: `${Math.round(r.left - t.left + i)}px`,
transform: ""
};
case "bottom-end":
return {
top: `${Math.round(r.top - t.top + r.height + o)}px`,
left: `${Math.round(r.left - t.left + r.width + i)}px`,
transform: "translateX(-100%)"
};
case "top-start":
return {
top: `${Math.round(r.top - t.top + o)}px`,
left: `${Math.round(r.left - t.left + i)}px`,
transform: "translateY(-100%)"
};
case "top-end":
return {
top: `${Math.round(r.top - t.top + o)}px`,
left: `${Math.round(r.left - t.left + r.width + i)}px`,
transform: "translateX(-100%) translateY(-100%)"
};
case "right-start":
return {
top: `${Math.round(r.top - t.top + o)}px`,
left: `${Math.round(r.left - t.left + r.width + i)}px`,
transform: ""
};
case "right-end":
return {
top: `${Math.round(r.top - t.top + r.height + o)}px`,
left: `${Math.round(r.left - t.left + r.width + i)}px`,
transform: "translateY(-100%)"
};
case "left-start":
return {
top: `${Math.round(r.top - t.top + o)}px`,
left: `${Math.round(r.left - t.left + i)}px`,
transform: "translateX(-100%)"
};
case "left-end":
return {
top: `${Math.round(r.top - t.top + r.height + o)}px`,
left: `${Math.round(r.left - t.left + i)}px`,
transform: "translateX(-100%) translateY(-100%)"
};
case "top":
return {
top: `${Math.round(r.top - t.top + o)}px`,
left: `${Math.round(r.left - t.left + r.width / 2 + i)}px`,
transform: "translateY(-100%) translateX(-50%)"
};
case "right":
return {
top: `${Math.round(r.top - t.top + r.height / 2 + o)}px`,
left: `${Math.round(r.left - t.left + r.width + i)}px`,
transform: "translateY(-50%)"
};
case "left":
return {
top: `${Math.round(r.top - t.top + r.height / 2 + o)}px`,
left: `${Math.round(r.left - t.left + i)}px`,
transform: "translateY(-50%) translateX(-100%)"
};
case "bottom":
default:
return {
top: `${Math.round(r.top - t.top + r.height + o)}px`,
left: `${Math.round(r.left - t.left + r.width / 2 + i)}px`,
transform: "translateX(-50%)"
};
}
}
const a0 = _n([
_n(".v-binder-follower-container", {
position: "absolute",
left: "0",
right: "0",
top: "0",
height: "0",
pointerEvents: "none",
zIndex: "auto"
}),
_n(".v-binder-follower-content", {
position: "absolute",
zIndex: "auto"
}, [
_n("> *", {
pointerEvents: "all"
})
])
]), sl = J({
name: "Follower",
inheritAttrs: !1,
props: {
show: Boolean,
enabled: {
type: Boolean,
default: void 0
},
placement: {
type: String,
default: "bottom"
},
syncTrigger: {
type: Array,
default: ["resize", "scroll"]
},
to: [String, Object],
flip: {
type: Boolean,
default: !0
},
internalShift: Boolean,
x: Number,
y: Number,
width: String,
minWidth: String,
containerClass: String,
teleportDisabled: Boolean,
zindexable: {
type: Boolean,
default: !0
},
zIndex: Number,
overlap: Boolean
},
setup(e) {
const t = pe("VBinder"), r = Ge(() => e.enabled !== void 0 ? e.enabled : e.show), o = L(null), i = L(null), a = () => {
const { syncTrigger: g } = e;
g.includes("scroll") && t.addScrollListener(d), g.includes("resize") && t.addResizeListener(d);
}, s = () => {
t.removeScrollListener(d), t.removeResizeListener(d);
};
$t(() => {
r.value && (d(), a());
});
const l = xr();
a0.mount({
id: "vueuc/binder",
head: !0,
anchorMetaName: al,
ssr: l
}), Bt(() => {
s();
}), Mh(() => {
r.value && d();
});
const d = () => {
if (!r.value)
return;
const g = o.value;
if (g === null)
return;
const m = t.targetRef, { x: h, y: p, overlap: x } = e, b = h !== void 0 && p !== void 0 ? Uh(h, p) : Xi(m);
g.style.setProperty("--v-target-width", `${Math.round(b.width)}px`), g.style.setProperty("--v-target-height", `${Math.round(b.height)}px`);
const { width: y, minWidth: B, placement: C, internalShift: P, flip: k } = e;
g.setAttribute("v-placement", C), x ? g.setAttribute("v-overlap", "") : g.removeAttribute("v-overlap");
const { style: S } = g;
y === "target" ? S.width = `${b.width}px` : y !== void 0 ? S.width = y : S.width = "", B === "target" ? S.minWidth = `${b.width}px` : B !== void 0 ? S.minWidth = B : S.minWidth = "";
const w = Xi(g), R = Xi(i.value), { left: F, top: N, placement: $ } = r0(C, b, w, P, k, x), n = o0($, x), { left: O, top: M, transform: W } = i0($, R, b, N, F, x);
g.setAttribute("v-placement", $), g.style.setProperty("--v-offset-left", `${Math.round(F)}px`), g.style.setProperty("--v-offset-top", `${Math.round(N)}px`), g.style.transfor