noist-beui
Version:
Vue 3 전용 UI 라이브러리
1,932 lines • 89.2 kB
JavaScript
import { createElementBlock as r, openBlock as u, normalizeClass as h, renderSlot as P, createCommentVNode as $, createTextVNode as oe, toDisplayString as V, Fragment as O, mergeModels as E, useModel as K, renderList as H, createBlock as ye, mergeProps as Tt, ref as S, computed as L, withDirectives as le, vModelDynamic as lt, vModelText as Ie, onMounted as ue, withModifiers as Fe, createElementVNode as y, vModelCheckbox as He, unref as ie, vModelRadio as Vt, watch as ne, nextTick as Lt, normalizeStyle as W, shallowRef as Rt, getCurrentScope as Mt, onScopeDispose as Ot, shallowReadonly as ve, reactive as At, onUnmounted as at, Teleport as ot, createVNode as De, Transition as it, withCtx as Pe, resolveComponent as Be } from "vue";
const Dt = ["href", "target"], st = {
__name: "BeButton",
props: {
contentText: {
type: String,
default: ""
},
brand: {
type: String
},
status: {
type: String
},
color: {
type: String
},
text: {
type: Boolean
},
border: {
type: Boolean
},
disabled: {
type: Boolean
},
fluid: {
type: Boolean
},
round: {
type: Boolean
},
compact: {
type: Boolean
},
outline: {
type: Boolean
},
icon: {
type: Boolean
},
withIcon: {
type: String,
default: null
},
iconPos: {
type: String
},
badge: {
type: String
},
badgeOption: {
type: String
},
link: {
type: String,
default: null
},
linkTarget: {
type: String,
default: null
}
},
emits: ["onClick"],
setup(e, { emit: n }) {
const t = n, l = (a) => {
t("onClick", a);
};
return (a, o) => (u(), r("button", {
class: h(["be-button", [
e.brand,
e.status,
e.color,
{ text: e.text },
{ link: e.link },
{ border: e.border },
{ disabled: e.disabled },
{ fluid: e.fluid },
{ round: e.round },
{ compact: e.compact },
{ outline: e.outline },
{ icon: e.icon },
{ badge: e.badge }
]]),
onClick: l
}, [
P(a.$slots, "default", {}, () => [
e.withIcon && (e.iconPos === "left" || e.iconPos === "both") ? (u(), r("i", {
key: 0,
class: h(["icon", [e.iconPos, e.withIcon]])
}, null, 2)) : $("", !0),
e.icon ? (u(), r("i", {
key: 1,
class: h(["icon", e.icon])
}, null, 2)) : $("", !0),
oe(" " + V(e.contentText) + " ", 1),
e.withIcon && (e.iconPos === "right" || e.iconPos === "both") ? (u(), r(O, { key: 2 }, [], 64)) : $("", !0),
e.badge ? (u(), r("div", {
key: 3,
class: h(["in-badge", e.badgeOption])
}, V(e.badge), 3)) : $("", !0)
]),
e.link ? (u(), r("a", {
key: 0,
href: e.link,
target: e.linkTarget || "_self"
}, null, 8, Dt)) : $("", !0)
], 2));
}
}, Pt = { class: "be-buttons" }, Et = {
__name: "BeButtons",
props: /* @__PURE__ */ E({
buttons: {
type: Array,
required: !0
},
round: {
type: Boolean,
default: !1
},
border: {
type: Boolean,
default: !1
}
}, {
modelValue: {},
modelModifiers: {}
}),
emits: ["update:modelValue"],
setup(e) {
const n = K(e, "modelValue"), t = (l) => {
n.value = l;
};
return (l, a) => (u(), r("div", Pt, [
P(l.$slots, "default", {}, () => [
(u(!0), r(O, null, H(e.buttons, (o, i) => (u(), ye(st, Tt({
key: `btn-${i}`,
ref_for: !0
}, o.option, {
onClick: () => t(i),
class: { selected: n.value === i }
}), null, 16, ["onClick", "class"]))), 128))
])
]));
}
}, Nt = ["data-unit"], It = ["type", "placeholder", "disabled", "readonly"], Ft = ["placeholder"], Ht = {
__name: "BeInput",
props: /* @__PURE__ */ E({
type: {
type: String,
default: "input",
validator(e) {
return ["input", "textarea"].includes(e);
}
},
inputType: {
type: String,
default: "text"
},
align: {
type: String,
default: "left",
validator(e) {
return ["left", "center", "right"].includes(e);
}
},
status: {
type: String,
default: null,
validator(e) {
return ["success", "error", "attention", "info", "importance"].includes(
e
);
}
},
placeholder: {
type: String,
default: "입력하세요"
},
readonly: {
type: Boolean,
default: !1
},
round: {
type: Boolean,
default: !1
},
underline: {
type: Boolean,
default: !1
},
transparent: {
type: Boolean,
default: !1
},
compact: {
type: Boolean,
default: !1
},
fluid: {
type: Boolean,
default: !1
},
iconLeft: {
type: String,
default: null
},
iconRight: {
type: String,
default: null
},
clear: {
type: Boolean,
default: !1
},
badge: {
type: String,
default: null
},
badgeOption: {
type: String,
default: null
},
edit: {
type: Boolean,
default: !1
},
editMode: {
type: Boolean,
default: !1
},
unit: {
type: String,
default: null
},
disabled: {
type: Boolean,
default: !1
}
}, {
modelValue: {},
modelModifiers: {}
}),
emits: /* @__PURE__ */ E(["focus"], ["update:modelValue"]),
setup(e, { emit: n }) {
const t = e, l = K(e, "modelValue"), a = n, o = S(!1), i = S(null), s = L(() => t.iconLeft && (t.iconRight || t.clear) ? "both" : t.iconLeft ? "left" : t.iconRight || t.clear ? "right" : null), d = () => {
o.value || (o.value = !0, console.log("fucus", o.value), a("focus", o.value));
}, c = () => {
o.value = !1, a("focus", o.value);
};
return (v, f) => (u(), r("div", {
class: h(["be-input", [
e.status,
{ readonly: e.readonly },
{ underline: e.underline },
{ round: e.round },
{ transparent: e.transparent },
{ compact: e.compact },
{ fluid: e.fluid },
{ edit: e.edit },
{ editable: e.editMode },
{ icon: e.iconLeft || e.iconRight || e.clear },
s.value,
{ badge: e.badge },
{ unit: e.unit },
{ disabled: e.disabled }
]]),
"data-unit": e.unit
}, [
P(v.$slots, "default", {}, () => [
e.iconLeft ? (u(), r("i", {
key: 0,
class: h(`icon xi-${e.iconLeft}`)
}, null, 2)) : $("", !0),
e.type === "input" ? le((u(), r("input", {
key: 1,
type: e.inputType,
"onUpdate:modelValue": f[0] || (f[0] = (g) => l.value = g),
placeholder: e.placeholder,
class: h([`aline-${e.align}`]),
ref_key: "input",
ref: i,
disabled: e.disabled,
readonly: e.readonly,
onClick: f[1] || (f[1] = (g) => d()),
onBlur: f[2] || (f[2] = (g) => c())
}, null, 42, It)), [
[lt, l.value]
]) : le((u(), r("textarea", {
key: 2,
"onUpdate:modelValue": f[3] || (f[3] = (g) => l.value = g),
rows: "3",
placeholder: e.placeholder
}, null, 8, Ft)), [
[Ie, l.value]
]),
e.clear ? (u(), r("i", {
key: 3,
class: h(["icon clear-btn xi-close", { disabled: l.value === "" }]),
onClick: f[4] || (f[4] = (g) => l.value = "")
}, null, 2)) : e.iconRight && !e.clear ? (u(), r("i", {
key: 4,
class: h(`icon xi-${e.iconRight}`)
}, null, 2)) : e.badge ? (u(), r("span", {
key: 5,
class: h(["be-badge", e.badgeOption])
}, V(e.badge), 3)) : $("", !0)
])
], 10, Nt));
}
}, zt = {
__name: "BeInputNumber",
props: /* @__PURE__ */ E({
status: {
type: String,
default: null,
validator(e) {
return ["success", "error", "attention", "info", "importance"].includes(
e
);
}
},
placeholder: {
type: String,
default: ""
},
readonly: {
type: Boolean,
default: !1
},
compact: {
type: Boolean,
default: !1
},
fluid: {
type: Boolean,
default: !1
},
round: {
type: Boolean,
default: !1
},
iconLeft: {
type: String,
default: null
},
iconRight: {
type: String,
default: null
},
step: {
type: Number,
default: 1
},
controller: {
type: String,
default: "between"
},
min: {
type: Number
},
max: {
type: Number
},
incIcon: {
type: String,
default: "xi-plus"
},
decIcon: {
type: String,
default: "xi-minus"
},
disabled: {
type: Boolean,
default: !1
}
}, {
modelValue: {},
modelModifiers: {}
}),
emits: /* @__PURE__ */ E(["focus"], ["update:modelValue"]),
setup(e, { emit: n }) {
const t = e, l = K(e, "modelValue"), a = n, o = S(!1), i = S(null);
ue(() => {
l.value < t.min && (l.value = t.min), l.value > t.max && (l.value = t.max);
});
const s = () => {
o.value || (o.value = !0, console.log("fucus", o.value), a("focus", o.value));
}, d = () => {
o.value = !1, a("focus", o.value);
}, c = () => {
l.value + t.step > t.max || (l.value += t.step);
}, v = () => {
l.value - t.step < t.min || (l.value -= t.step);
}, f = (g) => {
t.disabled || (g.keyCode === 38 && c(), g.keyCode === 40 && v());
};
return (g, m) => (u(), r("div", {
class: h(["be-input button number", [e.status, { readonly: e.readonly, compact: e.compact, fluid: e.fluid, disabled: e.disabled, round: e.round }, e.controller]]),
tabindex: "-1",
onKeydown: Fe(f, ["prevent"])
}, [
P(g.$slots, "default", {}, () => [
le(y("input", {
type: "number",
"onUpdate:modelValue": m[0] || (m[0] = (p) => l.value = p),
ref_key: "input",
ref: i,
onClick: m[1] || (m[1] = (p) => s()),
onBlur: m[2] || (m[2] = (p) => d())
}, null, 544), [
[Ie, l.value]
])
]),
y("button", {
class: h(["be-button icon dec", { disabled: e.disabled }]),
onClick: v
}, [
y("i", {
class: h(["icon", e.decIcon])
}, null, 2)
], 2),
y("button", {
class: h(["be-button icon inc", { disabled: e.disabled }]),
onClick: c
}, [
y("i", {
class: h(["icon", e.incIcon])
}, null, 2)
], 2)
], 34));
}
}, Wt = ["name"], Ut = {
__name: "BeCheckBox",
props: /* @__PURE__ */ E({
type: {
type: String,
default: "checkbox",
varidator: (e) => ["checkbox", "radio"].includes(e)
},
name: {
type: String
},
labelText: {
type: String,
default: null
},
indeter: {
type: Boolean,
default: !1
}
}, {
modelValue: {},
modelModifiers: {}
}),
emits: ["update:modelValue"],
setup(e) {
const n = K(e, "modelValue");
return (t, l) => (u(), r("div", {
class: h(["be-checkbox", [e.type, { checked: n.value }, { indeter: e.indeter }]]),
onClick: l[1] || (l[1] = (a) => n.value = !n.value)
}, [
le(y("input", {
type: "checkbox",
name: e.name,
"onUpdate:modelValue": l[0] || (l[0] = (a) => n.value = a)
}, null, 8, Wt), [
[He, n.value]
]),
y("label", null, V(e.labelText), 1)
], 2));
}
}, ze = (e, n) => {
const t = e.__vccOpts || e;
for (const [l, a] of n)
t[l] = a;
return t;
}, jt = { class: "be-checkout-group" }, Kt = ["id", "onUpdate:modelValue"], qt = ["for"], Yt = {
__name: "BeCheckBoxGroup",
props: /* @__PURE__ */ E({
checkList: {
type: Array,
required: !0
}
}, {
result: {},
resultModifiers: {}
}),
emits: /* @__PURE__ */ E(["result"], ["update:result"]),
setup(e, { emit: n }) {
const t = e, l = Math.random().toString(36), a = n, o = K(e, "result"), i = S(new Array(t.checkList.length).fill(!1));
ue(() => {
o.value.forEach((d) => {
const c = t.checkList.findIndex((v) => v === d);
i.value[c] = !0;
});
});
const s = () => {
o.value = t.checkList.filter((d, c) => i.value[c]), a("result", o.value);
};
return (d, c) => (u(), r("div", jt, [
(u(!0), r(O, null, H(e.checkList, (v, f) => (u(), r("div", {
key: v,
class: h(["be-checkbox", { checked: i.value[f] }])
}, [
le(y("input", {
type: "checkbox",
id: `${v}-${ie(l)}`,
"onUpdate:modelValue": (g) => i.value[f] = g,
onChange: s
}, null, 40, Kt), [
[He, i.value[f]]
]),
y("label", {
for: `${v}-${ie(l)}`
}, V(v), 9, qt)
], 2))), 128))
]));
}
}, Xt = /* @__PURE__ */ ze(Yt, [["__scopeId", "data-v-8fd17f01"]]), Jt = { class: "be-radio" }, Gt = ["id", "value"], Qt = ["for"], Zt = {
__name: "BeRadio",
props: /* @__PURE__ */ E({
optionList: {
type: Array,
required: !0
},
selected: {
type: String,
default: ""
}
}, {
result: {},
resultModifiers: {}
}),
emits: /* @__PURE__ */ E(["result"], ["update:result"]),
setup(e, { emit: n }) {
const t = Math.random().toString(36), l = n, a = K(e, "result"), o = () => {
l("result", a.value);
};
return (i, s) => (u(), r("div", Jt, [
(u(!0), r(O, null, H(e.optionList, (d) => (u(), r("div", {
key: d,
class: h(["be-checkbox radio", { checked: d === a.value }])
}, [
le(y("input", {
type: "radio",
id: `${d}-${ie(t)}`,
"onUpdate:modelValue": s[0] || (s[0] = (c) => a.value = c),
value: d,
onChange: o
}, null, 40, Gt), [
[Vt, a.value]
]),
y("label", {
for: `${d}-${ie(t)}`
}, V(d), 9, Qt)
], 2))), 128))
]));
}
}, _t = /* @__PURE__ */ ze(Zt, [["__scopeId", "data-v-80d7204f"]]), en = ["onClick"], tn = {
key: 0,
class: "item-img"
}, nn = ["src"], ln = { class: "item-title" }, an = {
key: 0,
class: "sub-title"
}, on = {
key: 2,
class: "btn-set"
}, sn = { class: "be-button round icon" }, un = ["Class"], cn = {
__name: "BeList",
props: /* @__PURE__ */ E({
options: {
type: Array,
default: () => []
},
selection: {
type: Boolean,
default: !1
},
selectedType: {
type: String,
default: "bg"
},
icon: {
type: Boolean,
default: !1
},
image: {
type: Boolean,
default: !1
},
border: {
type: Boolean,
default: !1
}
}, {
modelValue: {},
modelModifiers: {}
}),
emits: ["update:modelValue"],
setup(e) {
const n = K(e, "modelValue");
return (t, l) => (u(), r("div", {
class: h(["be-list", [{ selection: e.selection }, { border: e.border }, e.selectedType]])
}, [
(u(!0), r(O, null, H(e.options, (a) => (u(), r("div", {
class: h(["item", { selected: n.value && n.value.option === a.option }]),
key: a.option,
onClick: (o) => n.value = a
}, [
e.image ? (u(), r("div", tn, [
y("img", {
src: a.image
}, null, 8, nn)
])) : e.icon ? (u(), r("i", {
key: 1,
class: h(["list-icon icon", a.icon])
}, null, 2)) : $("", !0),
y("div", ln, [
oe(V(a.option) + " ", 1),
a.sub ? (u(), r("div", an, V(a.sub), 1)) : $("", !0)
]),
t.button ? (u(), r("div", on, [
y("div", sn, [
y("i", {
Class: a.icon
}, null, 8, un)
])
])) : $("", !0)
], 10, en))), 128))
], 2));
}
}, rn = { class: "title" }, dn = { class: "contents" }, fn = {
__name: "BeMessage",
props: {
title: {
type: String
},
contents: {
type: String
},
icon: {
type: String
},
status: {
type: String,
default: null,
varidator: (e) => ["success", "error", "info", "attention", "importance"].includes(
e
)
},
selected: {
type: Boolean,
default: !1
},
disabled: {
type: Boolean,
default: !1
}
},
setup(e) {
const n = {
success: "xi-check-circle",
info: "xi-info",
error: "xi-emoticon-devil",
attention: "xi-warning",
importance: "xi-star"
}, t = e, l = L(() => t.status ? n[t.status] : t.icon);
return (a, o) => (u(), r("div", {
class: h(["be-message", [{ icon: e.icon }, e.status, { selected: e.selected, disabled: e.disabled }]])
}, [
e.icon ? (u(), r("i", {
key: 0,
class: h(["icon", l.value])
}, null, 2)) : $("", !0),
P(a.$slots, "default", {}, () => [
y("div", rn, V(e.title), 1),
y("div", dn, V(e.contents), 1)
])
], 2));
}
}, vn = { class: "pagination-page-wrapper" }, mn = ["onClick"], yn = {
key: 1,
class: "pagination-info"
}, gn = { class: "pagination-nav current" }, hn = {
class: "pagination-nav",
last: ""
}, bn = {
__name: "BePagination",
props: /* @__PURE__ */ E({
type: {
type: String,
default: "number",
varidator: (e) => ["number", "page"].includes(e)
},
round: {
type: Boolean,
default: !1
},
compact: {
type: Boolean,
default: !1
},
border: {
type: Boolean,
default: !1
},
align: {
type: String,
default: "left"
},
limits: {
type: Number,
default: 5
},
currentPage: {
type: Number,
default: 1
},
pageLength: {
type: Number,
default: 1
},
itemClass: {
type: String
},
ellipsis: {
type: Boolean,
default: !1
},
color: {
type: String
},
firstText: {
type: String,
default: "F"
},
lastText: {
type: String,
default: "L"
},
activeType: {
type: String,
default: "button"
// text
}
}, {
modelValue: {},
modelModifiers: {}
}),
emits: /* @__PURE__ */ E(["change"], ["update:modelValue"]),
setup(e, { emit: n }) {
const t = e, l = S(null), a = K(e, "modelValue"), o = n, i = S(1), s = L(() => {
if (m.value)
return new Array(t.pageLength).fill(1).map((k, B) => k + B);
if (t.ellipsis) {
let k = 2, B = Math.floor(t.limits / 2);
return c.value && (k = a.value - B), !v.value && c.value && (k = i.value - t.limits), new Array(t.limits).fill(0).map((T, z) => k + z);
} else {
let k = Math.min(d.value, t.pageLength - t.limits + 1);
return new Array(t.limits).fill(k).map((B, T) => B + T);
}
}), d = L(() => Math.max(a.value - Math.ceil(t.limits * 0.5) + 1, 1)), c = L(() => a.value > Math.floor(t.limits / 2) + 2 && t.limits < i.value), v = L(() => a.value <= i.value - t.limits && t.limits < i.value), f = L(() => a.value + 1 > i.value), g = L(() => a.value - 1 <= 0), m = L(() => t.pageLength <= t.limits || !t.limits);
ne(t, () => {
i.value = t.pageLength;
}), ue(async () => {
await Lt(), l.value.focus(), i.value = t.pageLength;
});
const p = (k) => {
k > i.value || k <= 0 || (a.value = k, o("change", k));
}, b = () => {
g.value || p(a.value - 1);
}, x = () => {
f.value || p(a.value + 1);
}, w = () => {
let k = a.value - t.limits <= 0 ? a.value - 1 : a.value - t.limits;
p(k);
}, C = () => {
let k = a.value + t.limits > i.value ? a.value + 1 : a.value + t.limits;
p(k);
};
return (k, B) => (u(), r("div", {
class: h(["be-pagination", [e.type, e.activeType, { round: e.round }, { compact: e.compact }, `align-${e.align}`, e.color]]),
ref_key: "pageEl",
ref: l
}, [
!e.ellipsis && !m.value ? (u(), r("div", {
key: 0,
class: h(["pagination-nav first", [e.itemClass, { disabled: g.value }]]),
onClick: B[0] || (B[0] = (T) => p(1))
}, [
e.firstText.indexOf("xi-") > -1 ? (u(), r("i", {
key: 0,
class: h(e.firstText)
}, null, 2)) : (u(), r(O, { key: 1 }, [
oe(V(e.firstText), 1)
], 64))
], 2)) : $("", !0),
y("div", {
class: h(["pagination-nav prev", [e.itemClass, { disabled: g.value }]]),
onClick: b
}, B[4] || (B[4] = [
y("i", { class: "xi-angle-left" }, null, -1)
]), 2),
e.ellipsis ? (u(), r(O, { key: 1 }, [
y("div", {
class: h(["pagination-num", [e.itemClass, { active: a.value === 1 }]]),
onClick: B[1] || (B[1] = (T) => p(1))
}, " 1 ", 2),
c.value ? (u(), r("div", {
key: 0,
class: h(["pagination-num", [e.itemClass]]),
onClick: w
}, B[5] || (B[5] = [
y("i", { class: "xi-ellipsis-h" }, null, -1)
]), 2)) : $("", !0)
], 64)) : $("", !0),
y("div", vn, [
e.type === "number" ? (u(!0), r(O, { key: 0 }, H(s.value, (T) => (u(), r("div", {
class: h(["pagination-num", [e.itemClass, { active: T === a.value }]]),
key: T,
onClick: (z) => p(T)
}, V(T), 11, mn))), 128)) : (u(), r("div", yn, [
y("div", gn, V(a.value), 1),
B[6] || (B[6] = y("span", { class: "slash" }, "/", -1)),
y("div", hn, V(i.value), 1)
]))
]),
e.ellipsis && t.limits < t.pageLength ? (u(), r(O, { key: 2 }, [
v.value ? (u(), r("div", {
key: 0,
class: h(["pagination-nav", [e.itemClass]]),
onClick: C
}, B[7] || (B[7] = [
y("i", { class: "xi-ellipsis-h" }, null, -1)
]), 2)) : $("", !0),
y("div", {
class: h(["pagination-num", [e.itemClass, { active: i.value === a.value }]]),
onClick: B[2] || (B[2] = (T) => p(i.value))
}, V(i.value), 3)
], 64)) : $("", !0),
y("div", {
class: h(["pagination-nav next", [e.itemClass, { disabled: f.value }]]),
onClick: x
}, B[8] || (B[8] = [
y("i", { class: "xi-angle-right" }, null, -1)
]), 2),
!e.ellipsis && !m.value ? (u(), r("div", {
key: 3,
class: h(["pagination-nav last", [e.itemClass, { disabled: f.value }]]),
onClick: B[3] || (B[3] = (T) => p(i.value))
}, [
e.lastText.indexOf("xi-") > -1 ? (u(), r("i", {
key: 0,
class: h(e.lastText)
}, null, 2)) : (u(), r(O, { key: 1 }, [
oe(V(e.lastText), 1)
], 64))
], 2)) : $("", !0)
], 2));
}
}, pn = { class: "title" }, xn = { key: 0 }, wn = { class: "content-wrapper" }, kn = {
__name: "BePanel",
props: {
title: {
type: String
},
contents: {
type: String
},
border: {
type: Boolean,
default: !1
},
toggleIcon: {
type: String,
default: null
},
iconPos: {
type: String,
default: "left"
},
open: {
type: Boolean,
default: !1
},
collapse: {
type: Boolean,
default: !1
},
maxHeight: {
type: Number,
default: 200
}
},
emits: ["show"],
setup(e, { emit: n }) {
const t = e, l = n, a = S(t.open), o = L(() => !t.toggleIcon && t.collapse ? "" : `icon ${t.iconPos}`), i = L(() => t.collapse ? {
"--max-height": `${t.maxHeight}px`
} : {}), s = () => {
t.collapse && (a.value = !a.value, l("show", a.value));
};
return (d, c) => (u(), r("div", {
class: h(["be-panel", [{ border: e.border, collapse: e.collapse }, o.value, { open: a.value }]])
}, [
y("div", {
class: "panel-header",
onClick: s
}, [
y("div", pn, V(e.title), 1),
e.collapse && e.toggleIcon ? (u(), r("span", xn, [
y("i", {
class: h(["icon", `${e.toggleIcon}`])
}, null, 2)
])) : $("", !0)
]),
y("div", {
class: "panel-content",
style: W(i.value)
}, [
y("div", wn, [
P(d.$slots, "contents", {}, () => [
oe(V(e.contents), 1)
])
])
], 4)
], 2));
}
}, Bn = ["type", "name", "id", "value"], Sn = ["for"], $n = {
__name: "BeRadios",
props: /* @__PURE__ */ E({
type: {
type: String,
default: "checkbox",
varidator: (e) => ["checkbox", "radio"].includes(e)
},
id: {
type: String
},
name: {
type: String
},
labelText: {
type: String,
default: ""
}
}, {
modelValue: {},
modelModifiers: {}
}),
emits: ["update:modelValue"],
setup(e) {
const n = e, t = K(e, "modelValue"), l = L(() => n.type === "radio" ? t.value === n.id : t.value);
return (a, o) => (u(), r("div", {
class: h(["be-checkbox", [e.type, { checked: l.value }]])
}, [
le(y("input", {
type: e.type,
name: e.name,
id: e.id,
"onUpdate:modelValue": o[0] || (o[0] = (i) => t.value = i),
value: e.id
}, null, 8, Bn), [
[lt, t.value]
]),
y("label", { for: e.id }, [
P(a.$slots, "default", {}, () => [
oe(V(e.labelText), 1)
])
], 8, Sn)
], 2));
}
}, Cn = ["onMouseenter", "onMousemove", "onClick"], Tn = {
__name: "BeRate",
props: {
rateLength: {
type: Number,
default: 5
},
useHalf: {
type: Boolean,
default: !1
},
icon: {
type: String,
default: "xi-star"
},
resultValue: {
type: Number,
default: 0
},
size: {
type: String,
default: null
},
readonly: {
type: Boolean,
default: !1
},
color: {
type: String,
default: null
},
border: {
type: Boolean,
default: !0
},
disabled: {
type: Boolean,
default: !1
},
clearable: {
type: Boolean,
default: !0
}
},
emits: ["select"],
setup(e, { emit: n }) {
const t = e, l = n, a = S(0), o = S(0), i = S(!1), s = S(0), d = L(() => {
const m = a.value * 10 % 10 * 10;
return m === 0 ? {} : {
width: `${m}%`,
overflow: "hidden"
};
});
ne(
() => t.resultValue,
() => {
a.value = t.resultValue, o.value = t.resultValue;
},
{ immediate: !0 }
), ue(() => {
s.value = a.value * 10 % 10 * 10;
});
const c = (m) => {
if (t.useHalf) {
const p = event.target.getBoundingClientRect();
i.value = p.left + p.width / 2 - event.pageX > 0;
}
a.value = m;
}, v = (m) => {
t.useHalf && c(m);
}, f = () => {
a.value = o.value || 0;
}, g = (m) => {
t.clearable && (o.value = Math.ceil(o.value) === m ? 0 : o.value), o.value = o.value === m ? 0 : m, t.useHalf && (o.value = i.value ? m - 0.5 : m), l("select", o.value);
};
return (m, p) => (u(), r("div", {
class: h(["be-rate", [e.size, e.color, { readonly: e.readonly, disabled: e.disabled, border: e.border }]])
}, [
(u(!0), r(O, null, H(e.rateLength, (b) => (u(), r("span", {
key: b,
class: h(["rate-item", [
{ check: Math.ceil(a.value) >= b },
{ half: Math.ceil(a.value) === b && i.value }
]]),
onMouseenter: (x) => c(b),
onMouseleave: f,
onMousemove: (x) => v(b),
onClick: (x) => g(b)
}, [
y("i", {
class: h(["icon", `${e.icon}-o`])
}, null, 2),
y("i", {
class: h(["icon", e.icon]),
style: W(Math.ceil(a.value) === b ? d.value : null)
}, null, 6)
], 42, Cn))), 128))
], 2));
}
}, Se = Math.min, ce = Math.max, $e = Math.round, ke = Math.floor, G = (e) => ({
x: e,
y: e
}), Vn = {
left: "right",
right: "left",
bottom: "top",
top: "bottom"
}, Ln = {
start: "end",
end: "start"
};
function Ye(e, n, t) {
return ce(e, Se(n, t));
}
function Ve(e, n) {
return typeof e == "function" ? e(n) : e;
}
function re(e) {
return e.split("-")[0];
}
function Le(e) {
return e.split("-")[1];
}
function ut(e) {
return e === "x" ? "y" : "x";
}
function ct(e) {
return e === "y" ? "height" : "width";
}
const Rn = /* @__PURE__ */ new Set(["top", "bottom"]);
function ae(e) {
return Rn.has(re(e)) ? "y" : "x";
}
function rt(e) {
return ut(ae(e));
}
function Mn(e, n, t) {
t === void 0 && (t = !1);
const l = Le(e), a = rt(e), o = ct(a);
let i = a === "x" ? l === (t ? "end" : "start") ? "right" : "left" : l === "start" ? "bottom" : "top";
return n.reference[o] > n.floating[o] && (i = Ce(i)), [i, Ce(i)];
}
function On(e) {
const n = Ce(e);
return [Ee(e), n, Ee(n)];
}
function Ee(e) {
return e.replace(/start|end/g, (n) => Ln[n]);
}
const Xe = ["left", "right"], Je = ["right", "left"], An = ["top", "bottom"], Dn = ["bottom", "top"];
function Pn(e, n, t) {
switch (e) {
case "top":
case "bottom":
return t ? n ? Je : Xe : n ? Xe : Je;
case "left":
case "right":
return n ? An : Dn;
default:
return [];
}
}
function En(e, n, t, l) {
const a = Le(e);
let o = Pn(re(e), t === "start", l);
return a && (o = o.map((i) => i + "-" + a), n && (o = o.concat(o.map(Ee)))), o;
}
function Ce(e) {
return e.replace(/left|right|bottom|top/g, (n) => Vn[n]);
}
function Nn(e) {
return {
top: 0,
right: 0,
bottom: 0,
left: 0,
...e
};
}
function In(e) {
return typeof e != "number" ? Nn(e) : {
top: e,
right: e,
bottom: e,
left: e
};
}
function Te(e) {
const {
x: n,
y: t,
width: l,
height: a
} = e;
return {
width: l,
height: a,
top: t,
left: n,
right: n + l,
bottom: t + a,
x: n,
y: t
};
}
function Ge(e, n, t) {
let {
reference: l,
floating: a
} = e;
const o = ae(n), i = rt(n), s = ct(i), d = re(n), c = o === "y", v = l.x + l.width / 2 - a.width / 2, f = l.y + l.height / 2 - a.height / 2, g = l[s] / 2 - a[s] / 2;
let m;
switch (d) {
case "top":
m = {
x: v,
y: l.y - a.height
};
break;
case "bottom":
m = {
x: v,
y: l.y + l.height
};
break;
case "right":
m = {
x: l.x + l.width,
y: f
};
break;
case "left":
m = {
x: l.x - a.width,
y: f
};
break;
default:
m = {
x: l.x,
y: l.y
};
}
switch (Le(n)) {
case "start":
m[i] -= g * (t && c ? -1 : 1);
break;
case "end":
m[i] += g * (t && c ? -1 : 1);
break;
}
return m;
}
const Fn = async (e, n, t) => {
const {
placement: l = "bottom",
strategy: a = "absolute",
middleware: o = [],
platform: i
} = t, s = o.filter(Boolean), d = await (i.isRTL == null ? void 0 : i.isRTL(n));
let c = await i.getElementRects({
reference: e,
floating: n,
strategy: a
}), {
x: v,
y: f
} = Ge(c, l, d), g = l, m = {}, p = 0;
for (let b = 0; b < s.length; b++) {
const {
name: x,
fn: w
} = s[b], {
x: C,
y: k,
data: B,
reset: T
} = await w({
x: v,
y: f,
initialPlacement: l,
placement: g,
strategy: a,
middlewareData: m,
rects: c,
platform: i,
elements: {
reference: e,
floating: n
}
});
v = C ?? v, f = k ?? f, m = {
...m,
[x]: {
...m[x],
...B
}
}, T && p <= 50 && (p++, typeof T == "object" && (T.placement && (g = T.placement), T.rects && (c = T.rects === !0 ? await i.getElementRects({
reference: e,
floating: n,
strategy: a
}) : T.rects), {
x: v,
y: f
} = Ge(c, g, d)), b = -1);
}
return {
x: v,
y: f,
placement: g,
strategy: a,
middlewareData: m
};
};
async function dt(e, n) {
var t;
n === void 0 && (n = {});
const {
x: l,
y: a,
platform: o,
rects: i,
elements: s,
strategy: d
} = e, {
boundary: c = "clippingAncestors",
rootBoundary: v = "viewport",
elementContext: f = "floating",
altBoundary: g = !1,
padding: m = 0
} = Ve(n, e), p = In(m), x = s[g ? f === "floating" ? "reference" : "floating" : f], w = Te(await o.getClippingRect({
element: (t = await (o.isElement == null ? void 0 : o.isElement(x))) == null || t ? x : x.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(s.floating)),
boundary: c,
rootBoundary: v,
strategy: d
})), C = f === "floating" ? {
x: l,
y: a,
width: i.floating.width,
height: i.floating.height
} : i.reference, k = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(s.floating)), B = await (o.isElement == null ? void 0 : o.isElement(k)) ? await (o.getScale == null ? void 0 : o.getScale(k)) || {
x: 1,
y: 1
} : {
x: 1,
y: 1
}, T = Te(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
elements: s,
rect: C,
offsetParent: k,
strategy: d
}) : C);
return {
top: (w.top - T.top + p.top) / B.y,
bottom: (T.bottom - w.bottom + p.bottom) / B.y,
left: (w.left - T.left + p.left) / B.x,
right: (T.right - w.right + p.right) / B.x
};
}
const Hn = function(e) {
return e === void 0 && (e = {}), {
name: "flip",
options: e,
async fn(n) {
var t, l;
const {
placement: a,
middlewareData: o,
rects: i,
initialPlacement: s,
platform: d,
elements: c
} = n, {
mainAxis: v = !0,
crossAxis: f = !0,
fallbackPlacements: g,
fallbackStrategy: m = "bestFit",
fallbackAxisSideDirection: p = "none",
flipAlignment: b = !0,
...x
} = Ve(e, n);
if ((t = o.arrow) != null && t.alignmentOffset)
return {};
const w = re(a), C = ae(s), k = re(s) === s, B = await (d.isRTL == null ? void 0 : d.isRTL(c.floating)), T = g || (k || !b ? [Ce(s)] : On(s)), z = p !== "none";
!g && z && T.push(...En(s, b, p, B));
const R = [s, ...T], N = await dt(n, x), q = [];
let J = ((l = o.flip) == null ? void 0 : l.overflows) || [];
if (v && q.push(N[w]), f) {
const ee = Mn(a, i, B);
q.push(N[ee[0]], N[ee[1]]);
}
if (J = [...J, {
placement: a,
overflows: q
}], !q.every((ee) => ee <= 0)) {
var A, I;
const ee = (((A = o.flip) == null ? void 0 : A.index) || 0) + 1, M = R[ee];
if (M && (!(f === "alignment" ? C !== ae(M) : !1) || // We leave the current main axis only if every placement on that axis
// overflows the main axis.
J.every((U) => U.overflows[0] > 0 && ae(U.placement) === C)))
return {
data: {
index: ee,
overflows: J
},
reset: {
placement: M
}
};
let F = (I = J.filter((D) => D.overflows[0] <= 0).sort((D, U) => D.overflows[1] - U.overflows[1])[0]) == null ? void 0 : I.placement;
if (!F)
switch (m) {
case "bestFit": {
var _;
const D = (_ = J.filter((U) => {
if (z) {
const te = ae(U.placement);
return te === C || // Create a bias to the `y` side axis due to horizontal
// reading directions favoring greater width.
te === "y";
}
return !0;
}).map((U) => [U.placement, U.overflows.filter((te) => te > 0).reduce((te, Ct) => te + Ct, 0)]).sort((U, te) => U[1] - te[1])[0]) == null ? void 0 : _[0];
D && (F = D);
break;
}
case "initialPlacement":
F = s;
break;
}
if (a !== F)
return {
reset: {
placement: F
}
};
}
return {};
}
};
}, zn = /* @__PURE__ */ new Set(["left", "top"]);
async function Wn(e, n) {
const {
placement: t,
platform: l,
elements: a
} = e, o = await (l.isRTL == null ? void 0 : l.isRTL(a.floating)), i = re(t), s = Le(t), d = ae(t) === "y", c = zn.has(i) ? -1 : 1, v = o && d ? -1 : 1, f = Ve(n, e);
let {
mainAxis: g,
crossAxis: m,
alignmentAxis: p
} = typeof f == "number" ? {
mainAxis: f,
crossAxis: 0,
alignmentAxis: null
} : {
mainAxis: f.mainAxis || 0,
crossAxis: f.crossAxis || 0,
alignmentAxis: f.alignmentAxis
};
return s && typeof p == "number" && (m = s === "end" ? p * -1 : p), d ? {
x: m * v,
y: g * c
} : {
x: g * c,
y: m * v
};
}
const Un = function(e) {
return e === void 0 && (e = 0), {
name: "offset",
options: e,
async fn(n) {
var t, l;
const {
x: a,
y: o,
placement: i,
middlewareData: s
} = n, d = await Wn(n, e);
return i === ((t = s.offset) == null ? void 0 : t.placement) && (l = s.arrow) != null && l.alignmentOffset ? {} : {
x: a + d.x,
y: o + d.y,
data: {
...d,
placement: i
}
};
}
};
}, jn = function(e) {
return e === void 0 && (e = {}), {
name: "shift",
options: e,
async fn(n) {
const {
x: t,
y: l,
placement: a
} = n, {
mainAxis: o = !0,
crossAxis: i = !1,
limiter: s = {
fn: (x) => {
let {
x: w,
y: C
} = x;
return {
x: w,
y: C
};
}
},
...d
} = Ve(e, n), c = {
x: t,
y: l
}, v = await dt(n, d), f = ae(re(a)), g = ut(f);
let m = c[g], p = c[f];
if (o) {
const x = g === "y" ? "top" : "left", w = g === "y" ? "bottom" : "right", C = m + v[x], k = m - v[w];
m = Ye(C, m, k);
}
if (i) {
const x = f === "y" ? "top" : "left", w = f === "y" ? "bottom" : "right", C = p + v[x], k = p - v[w];
p = Ye(C, p, k);
}
const b = s.fn({
...n,
[g]: m,
[f]: p
});
return {
...b,
data: {
x: b.x - t,
y: b.y - l,
enabled: {
[g]: o,
[f]: i
}
}
};
}
};
};
function Re() {
return typeof window < "u";
}
function fe(e) {
return We(e) ? (e.nodeName || "").toLowerCase() : "#document";
}
function j(e) {
var n;
return (e == null || (n = e.ownerDocument) == null ? void 0 : n.defaultView) || window;
}
function Z(e) {
var n;
return (n = (We(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : n.documentElement;
}
function We(e) {
return Re() ? e instanceof Node || e instanceof j(e).Node : !1;
}
function Y(e) {
return Re() ? e instanceof Element || e instanceof j(e).Element : !1;
}
function Q(e) {
return Re() ? e instanceof HTMLElement || e instanceof j(e).HTMLElement : !1;
}
function Qe(e) {
return !Re() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof j(e).ShadowRoot;
}
const Kn = /* @__PURE__ */ new Set(["inline", "contents"]);
function we(e) {
const {
overflow: n,
overflowX: t,
overflowY: l,
display: a
} = X(e);
return /auto|scroll|overlay|hidden|clip/.test(n + l + t) && !Kn.has(a);
}
const qn = /* @__PURE__ */ new Set(["table", "td", "th"]);
function Yn(e) {
return qn.has(fe(e));
}
const Xn = [":popover-open", ":modal"];
function Me(e) {
return Xn.some((n) => {
try {
return e.matches(n);
} catch {
return !1;
}
});
}
const Jn = ["transform", "translate", "scale", "rotate", "perspective"], Gn = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Qn = ["paint", "layout", "strict", "content"];
function Ue(e) {
const n = je(), t = Y(e) ? X(e) : e;
return Jn.some((l) => t[l] ? t[l] !== "none" : !1) || (t.containerType ? t.containerType !== "normal" : !1) || !n && (t.backdropFilter ? t.backdropFilter !== "none" : !1) || !n && (t.filter ? t.filter !== "none" : !1) || Gn.some((l) => (t.willChange || "").includes(l)) || Qn.some((l) => (t.contain || "").includes(l));
}
function Zn(e) {
let n = se(e);
for (; Q(n) && !ge(n); ) {
if (Ue(n))
return n;
if (Me(n))
return null;
n = se(n);
}
return null;
}
function je() {
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
}
const _n = /* @__PURE__ */ new Set(["html", "body", "#document"]);
function ge(e) {
return _n.has(fe(e));
}
function X(e) {
return j(e).getComputedStyle(e);
}
function Oe(e) {
return Y(e) ? {
scrollLeft: e.scrollLeft,
scrollTop: e.scrollTop
} : {
scrollLeft: e.scrollX,
scrollTop: e.scrollY
};
}
function se(e) {
if (fe(e) === "html")
return e;
const n = (
// Step into the shadow DOM of the parent of a slotted node.
e.assignedSlot || // DOM Element detected.
e.parentNode || // ShadowRoot detected.
Qe(e) && e.host || // Fallback.
Z(e)
);
return Qe(n) ? n.host : n;
}
function ft(e) {
const n = se(e);
return ge(n) ? e.ownerDocument ? e.ownerDocument.body : e.body : Q(n) && we(n) ? n : ft(n);
}
function xe(e, n, t) {
var l;
n === void 0 && (n = []), t === void 0 && (t = !0);
const a = ft(e), o = a === ((l = e.ownerDocument) == null ? void 0 : l.body), i = j(a);
if (o) {
const s = Ne(i);
return n.concat(i, i.visualViewport || [], we(a) ? a : [], s && t ? xe(s) : []);
}
return n.concat(a, xe(a, [], t));
}
function Ne(e) {
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
}
function vt(e) {
const n = X(e);
let t = parseFloat(n.width) || 0, l = parseFloat(n.height) || 0;
const a = Q(e), o = a ? e.offsetWidth : t, i = a ? e.offsetHeight : l, s = $e(t) !== o || $e(l) !== i;
return s && (t = o, l = i), {
width: t,
height: l,
$: s
};
}
function Ke(e) {
return Y(e) ? e : e.contextElement;
}
function me(e) {
const n = Ke(e);
if (!Q(n))
return G(1);
const t = n.getBoundingClientRect(), {
width: l,
height: a,
$: o
} = vt(n);
let i = (o ? $e(t.width) : t.width) / l, s = (o ? $e(t.height) : t.height) / a;
return (!i || !Number.isFinite(i)) && (i = 1), (!s || !Number.isFinite(s)) && (s = 1), {
x: i,
y: s
};
}
const el = /* @__PURE__ */ G(0);
function mt(e) {
const n = j(e);
return !je() || !n.visualViewport ? el : {
x: n.visualViewport.offsetLeft,
y: n.visualViewport.offsetTop
};
}
function tl(e, n, t) {
return n === void 0 && (n = !1), !t || n && t !== j(e) ? !1 : n;
}
function de(e, n, t, l) {
n === void 0 && (n = !1), t === void 0 && (t = !1);
const a = e.getBoundingClientRect(), o = Ke(e);
let i = G(1);
n && (l ? Y(l) && (i = me(l)) : i = me(e));
const s = tl(o, t, l) ? mt(o) : G(0);
let d = (a.left + s.x) / i.x, c = (a.top + s.y) / i.y, v = a.width / i.x, f = a.height / i.y;
if (o) {
const g = j(o), m = l && Y(l) ? j(l) : l;
let p = g, b = Ne(p);
for (; b && l && m !== p; ) {
const x = me(b), w = b.getBoundingClientRect(), C = X(b), k = w.left + (b.clientLeft + parseFloat(C.paddingLeft)) * x.x, B = w.top + (b.clientTop + parseFloat(C.paddingTop)) * x.y;
d *= x.x, c *= x.y, v *= x.x, f *= x.y, d += k, c += B, p = j(b), b = Ne(p);
}
}
return Te({
width: v,
height: f,
x: d,
y: c
});
}
function qe(e, n) {
const t = Oe(e).scrollLeft;
return n ? n.left + t : de(Z(e)).left + t;
}
function yt(e, n, t) {
t === void 0 && (t = !1);
const l = e.getBoundingClientRect(), a = l.left + n.scrollLeft - (t ? 0 : (
// RTL <body> scrollbar.
qe(e, l)
)), o = l.top + n.scrollTop;
return {
x: a,
y: o
};
}
function nl(e) {
let {
elements: n,
rect: t,
offsetParent: l,
strategy: a
} = e;
const o = a === "fixed", i = Z(l), s = n ? Me(n.floating) : !1;
if (l === i || s && o)
return t;
let d = {
scrollLeft: 0,
scrollTop: 0
}, c = G(1);
const v = G(0), f = Q(l);
if ((f || !f && !o) && ((fe(l) !== "body" || we(i)) && (d = Oe(l)), Q(l))) {
const m = de(l);
c = me(l), v.x = m.x + l.clientLeft, v.y = m.y + l.clientTop;
}
const g = i && !f && !o ? yt(i, d, !0) : G(0);
return {
width: t.width * c.x,
height: t.height * c.y,
x: t.x * c.x - d.scrollLeft * c.x + v.x + g.x,
y: t.y * c.y - d.scrollTop * c.y + v.y + g.y
};
}
function ll(e) {
return Array.from(e.getClientRects());
}
function al(e) {
const n = Z(e), t = Oe(e), l = e.ownerDocument.body, a = ce(n.scrollWidth, n.clientWidth, l.scrollWidth, l.clientWidth), o = ce(n.scrollHeight, n.clientHeight, l.scrollHeight, l.clientHeight);
let i = -t.scrollLeft + qe(e);
const s = -t.scrollTop;
return X(l).direction === "rtl" && (i += ce(n.clientWidth, l.clientWidth) - a), {
width: a,
height: o,
x: i,
y: s
};
}
function ol(e, n) {
const t = j(e), l = Z(e), a = t.visualViewport;
let o = l.clientWidth, i = l.clientHeight, s = 0, d = 0;
if (a) {
o = a.width, i = a.height;
const c = je();
(!c || c && n === "fixed") && (s = a.offsetLeft, d = a.offsetTop);
}
return {
width: o,
height: i,
x: s,
y: d
};
}
const il = /* @__PURE__ */ new Set(["absolute", "fixed"]);
function sl(e, n) {
const t = de(e, !0, n === "fixed"), l = t.top + e.clientTop, a = t.left + e.clientLeft, o = Q(e) ? me(e) : G(1), i = e.clientWidth * o.x, s = e.clientHeight * o.y, d = a * o.x, c = l * o.y;
return {
width: i,
height: s,
x: d,
y: c
};
}
function Ze(e, n, t) {
let l;
if (n === "viewport")
l = ol(e, t);
else if (n === "document")
l = al(Z(e));
else if (Y(n))
l = sl(n, t);
else {
const a = mt(e);
l = {
x: n.x - a.x,
y: n.y - a.y,
width: n.width,
height: n.height
};
}
return Te(l);
}
function gt(e, n) {
const t = se(e);
return t === n || !Y(t) || ge(t) ? !1 : X(t).position === "fixed" || gt(t, n);
}
function ul(e, n) {
const t = n.get(e);
if (t)
return t;
let l = xe(e, [], !1).filter((s) => Y(s) && fe(s) !== "body"), a = null;
const o = X(e).position === "fixed";
let i = o ? se(e) : e;
for (; Y(i) && !ge(i); ) {
const s = X(i), d = Ue(i);
!d && s.position === "fixed" && (a = null), (o ? !d && !a : !d && s.position === "static" && !!a && il.has(a.position) || we(i) && !d && gt(e, i)) ? l = l.filter((v) => v !== i) : a = s, i = se(i);
}
return n.set(e, l), l;
}
function cl(e) {
let {
element: n,
boundary: t,
rootBoundary: l,
strategy: a
} = e;
const i = [...t === "clippingAncestors" ? Me(n) ? [] : ul(n, this._c) : [].concat(t), l], s = i[0], d = i.reduce((c, v) => {
const f = Ze(n, v, a);
return c.top = ce(f.top, c.top), c.right = Se(f.right, c.right), c.bottom = Se(f.bottom, c.bottom), c.left = ce(f.left, c.left), c;
}, Ze(n, s, a));
return {
width: d.right - d.left,
height: d.bottom - d.top,
x: d.left,
y: d.top
};
}
function rl(e) {
const {
width: n,
height: t
} = vt(e);
return {
width: n,
height: t
};
}
function dl(e, n, t) {
const l = Q(n), a = Z(n), o = t === "fixed", i = de(e, !0, o, n);
let s = {
scrollLeft: 0,
scrollTop: 0
};
const d = G(0);
function c() {
d.x = qe(a);
}
if (l || !l && !o)
if ((fe(n) !== "body" || we(a)) && (s = Oe(n)), l) {
const m = de(n, !0, o, n);
d.x = m.x + n.clientLeft, d.y = m.y + n.clientTop;
} else a && c();
o && !l && a && c();
const v = a && !l && !o ? yt(a, s) : G(0), f = i.left + s.scrollLeft - d.x - v.x, g = i.top + s.scrollTop - d.y - v.y;
return {
x: f,
y: g,
width: i.width,
height: i.height
};
}
function Ae(e) {
return X(e).position === "static";
}
function _e(e, n) {
if (!Q(e) || X(e).position === "fixed")
return null;
if (n)
return n(e);
let t = e.offsetParent;
return Z(e) === t && (t = t.ownerDocument.body), t;
}
function ht(e, n) {
const t = j(e);
if (Me(e))
return t;
if (!Q(e)) {
let a = se(e);
for (; a && !ge(a); ) {
if (Y(a) && !Ae(a))
return a;
a = se(a);
}
return t;
}
let l = _e(e, n);
for (; l && Yn(l) && Ae(l); )
l = _e(l, n);
return l && ge(l) && Ae(l) && !Ue(l) ? t : l || Zn(e) || t;
}
const fl = async function(e) {
const n = this.getOffsetParent || ht, t = this.getDimensions, l = await t(e.floating);
return {
reference: dl(e.reference, await n(e.floating), e.strategy),
floating: {
x: 0,
y: 0,
width: l.width,
height: l.height
}
};
};
function vl(e) {
return X(e).direction === "rtl";
}
const ml = {
convertOffsetParentRelativeRectToViewportRelativeRect: nl,
getDocumentElement: Z,
getClippingRect: cl,
getOffsetParent: ht,
getElementRects: fl,
getClientRects: ll,
getDimensions: rl,
getScale: me,
isElement: Y,
isRTL: vl
};
function bt(e, n) {
return e.x === n.x && e.y === n.y && e.width === n.width && e.height === n.height;
}
function yl(e, n) {
let t = null, l;
const a = Z(e);
function o() {
var s;
clearTimeout(l), (s = t) == null || s.disconnect(), t = null;
}
function i(s, d) {
s === void 0 && (s = !1), d === void 0 && (d = 1), o();
co