vrembem 4.0.0-next.30 → 4.0.0-next.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/dev/base.css +743 -894
- package/dev/base.css.map +1 -1
- package/dev/index.css +750 -903
- package/dev/index.css.map +1 -1
- package/dev/index.js +1104 -648
- package/dev/index.js.map +1 -1
- package/dev/index.umd.cjs +1104 -648
- package/dev/index.umd.cjs.map +1 -1
- package/dev/root.css +27 -19
- package/dev/root.css.map +1 -1
- package/dist/base.css +1 -1
- package/dist/base.css.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +1710 -1256
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +3 -3
- package/dist/index.umd.cjs.map +1 -1
- package/dist/root.css +1 -1
- package/dist/root.css.map +1 -1
- package/index.js +1 -6
- package/package.json +26 -26
- package/root.scss +0 -2
package/dist/index.js
CHANGED
|
@@ -1,350 +1,798 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Jt = (t) => {
|
|
2
2
|
throw TypeError(t);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
var Xt = (t, e, s) => e.has(t) || Jt("Cannot " + s);
|
|
5
|
+
var E = (t, e, s) => (Xt(t, e, "read from private field"), s ? s.call(t) : e.get(t)), U = (t, e, s) => e.has(t) ? Jt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), S = (t, e, s, n) => (Xt(t, e, "write to private field"), n ? n.call(t, s) : e.set(t, s), s);
|
|
6
|
+
const C = ":not([inert])", $ = ':not([tabindex^="-"])', mt = ":not(:disabled)", se = [
|
|
7
|
+
`a[href]${C}${$}`,
|
|
8
|
+
`area[href]${C}${$}`,
|
|
9
|
+
`input:not([type="hidden"]):not([type="radio"])${C}${$}${mt}`,
|
|
10
|
+
`input[type="radio"]${C}${$}${mt}`,
|
|
11
|
+
`select${C}${$}${mt}`,
|
|
12
|
+
`textarea${C}${$}${mt}`,
|
|
13
|
+
`button${C}${$}${mt}`,
|
|
14
|
+
`details${C} > summary:first-of-type${$}`,
|
|
15
|
+
`iframe${C}${$}`,
|
|
16
|
+
`audio[controls]${C}${$}`,
|
|
17
|
+
`video[controls]${C}${$}`,
|
|
18
|
+
`[contenteditable]${C}${$}`,
|
|
19
|
+
`[tabindex]${C}${$}`
|
|
20
|
+
];
|
|
21
|
+
function ie(t, e = "config") {
|
|
22
|
+
const n = (t.getAttribute(`data-${e}`) || "").replace(/'/g, '"');
|
|
23
|
+
return n ? JSON.parse(n) : {};
|
|
24
|
+
}
|
|
25
|
+
function Bt(t) {
|
|
26
|
+
return typeof t == "string" ? document.getElementById(t) : t instanceof HTMLElement ? t : null;
|
|
8
27
|
}
|
|
9
|
-
function
|
|
28
|
+
async function Q(t, e, ...s) {
|
|
29
|
+
e in t && typeof t[e] == "function" && await t[e](...s);
|
|
30
|
+
}
|
|
31
|
+
function oe(t, e, s) {
|
|
32
|
+
if (typeof e == "string") {
|
|
33
|
+
const i = document.querySelector(e);
|
|
34
|
+
if (!i)
|
|
35
|
+
throw new Error(`No teleport reference found for selector: ${e}`);
|
|
36
|
+
e = i;
|
|
37
|
+
} else if (!(e instanceof HTMLElement))
|
|
38
|
+
throw new Error(`Not a valid teleport reference: '${e}'`);
|
|
39
|
+
if (typeof e[s] != "function")
|
|
40
|
+
throw new Error(`Not a valid teleport method: '${s}'`);
|
|
41
|
+
let n = document.createComment(
|
|
42
|
+
"teleported #" + t.id
|
|
43
|
+
);
|
|
44
|
+
return t.before(n), e[s](t), () => {
|
|
45
|
+
n && (n.after(t), n.remove(), n = null);
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function re(t) {
|
|
49
|
+
return t.split("-").map(
|
|
50
|
+
(e, s) => s === 0 ? e : e.charAt(0).toUpperCase() + e.slice(1)
|
|
51
|
+
).join("");
|
|
52
|
+
}
|
|
53
|
+
function Ut(t) {
|
|
10
54
|
return t.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
11
55
|
}
|
|
12
|
-
function
|
|
56
|
+
function le(t) {
|
|
13
57
|
if (typeof t == "number")
|
|
14
58
|
return t;
|
|
15
59
|
const e = parseFloat(t);
|
|
16
60
|
if (!Number.isNaN(e)) {
|
|
17
|
-
const
|
|
18
|
-
return e * (
|
|
61
|
+
const s = t.includes("ms");
|
|
62
|
+
return e * (s ? 1 : 1e3);
|
|
19
63
|
}
|
|
20
64
|
throw new Error(`Could not convert value to milliseconds: ${t}`);
|
|
21
65
|
}
|
|
22
|
-
function
|
|
23
|
-
return
|
|
66
|
+
function wt(t, e, s, n, i = 0) {
|
|
67
|
+
return new Promise((r) => {
|
|
68
|
+
t.classList.remove(e), t.classList.add(s), setTimeout(() => {
|
|
69
|
+
t.classList.add(n), t.classList.remove(s), r(t);
|
|
70
|
+
}, le(i));
|
|
71
|
+
});
|
|
24
72
|
}
|
|
25
|
-
function
|
|
26
|
-
const
|
|
73
|
+
function ae(t, e = {}) {
|
|
74
|
+
const s = {
|
|
27
75
|
fallback: null,
|
|
28
76
|
element: document.body,
|
|
29
77
|
...e
|
|
30
78
|
};
|
|
31
|
-
if (t.
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
37
|
-
return
|
|
38
|
-
if (
|
|
39
|
-
return
|
|
79
|
+
if (!t.startsWith("--")) {
|
|
80
|
+
const i = kt();
|
|
81
|
+
i && (t = `${i}${t}`), t = `--${t}`;
|
|
82
|
+
}
|
|
83
|
+
const n = getComputedStyle(s.element).getPropertyValue(t).trim();
|
|
84
|
+
if (n)
|
|
85
|
+
return n;
|
|
86
|
+
if (s.fallback)
|
|
87
|
+
return s.fallback;
|
|
40
88
|
throw new Error(`CSS variable "${t}" was not found!`);
|
|
41
89
|
}
|
|
42
|
-
function
|
|
43
|
-
|
|
44
|
-
|
|
90
|
+
async function V(t, e, s) {
|
|
91
|
+
await Q(e, t, s), s && await Q(s, t);
|
|
92
|
+
for (const n of e.plugins)
|
|
93
|
+
await Q(n, t, { plugin: n, parent: e, entry: s });
|
|
94
|
+
await e.emit(t, s);
|
|
45
95
|
}
|
|
46
|
-
function
|
|
47
|
-
const e = getComputedStyle(t.el),
|
|
48
|
-
for (let
|
|
49
|
-
const
|
|
50
|
-
a && (
|
|
96
|
+
function ce(t) {
|
|
97
|
+
const e = getComputedStyle(t.el), s = {}, n = t.getSetting("customProps");
|
|
98
|
+
for (let i = 0; i < n.length; i++) {
|
|
99
|
+
const r = kt(), o = t.parent.module.toLowerCase(), l = Ut(n[i]), a = e.getPropertyValue(`--${r}${o}-${l}`).trim();
|
|
100
|
+
a && (s[l] = a);
|
|
51
101
|
}
|
|
52
|
-
return
|
|
102
|
+
return s;
|
|
53
103
|
}
|
|
54
|
-
function
|
|
55
|
-
return
|
|
104
|
+
function kt() {
|
|
105
|
+
return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
|
|
56
106
|
}
|
|
57
|
-
function
|
|
58
|
-
return e =
|
|
107
|
+
function He(t, e, s = "camel") {
|
|
108
|
+
return e = s === "camel" ? re(e) : Ut(e), t.split(".").concat(e).reduce((n, i) => n == null ? void 0 : n[i], this);
|
|
59
109
|
}
|
|
60
|
-
function
|
|
110
|
+
function fe(t, e = {}) {
|
|
61
111
|
const {
|
|
62
|
-
fallback:
|
|
63
|
-
props:
|
|
112
|
+
fallback: s,
|
|
113
|
+
props: n = ["dataConfig", "customProps", "settings", "parent.settings"]
|
|
64
114
|
} = e;
|
|
65
|
-
for (const
|
|
66
|
-
const
|
|
67
|
-
if (
|
|
68
|
-
return
|
|
69
|
-
}
|
|
70
|
-
if (
|
|
71
|
-
return
|
|
72
|
-
throw new Error(`${this.
|
|
73
|
-
}
|
|
74
|
-
async function C(t, ...e) {
|
|
75
|
-
t in this && typeof this[t] == "function" && await this[t](...e);
|
|
76
|
-
}
|
|
77
|
-
function St(t, e, i, s, n = 0) {
|
|
78
|
-
return new Promise((o) => {
|
|
79
|
-
t.classList.remove(e), t.classList.add(i), setTimeout(() => {
|
|
80
|
-
t.classList.add(s), t.classList.remove(i), o(t);
|
|
81
|
-
}, ae(n));
|
|
82
|
-
});
|
|
115
|
+
for (const i of n) {
|
|
116
|
+
const r = i !== "customProps" ? "camel" : "kebab", o = He.call(this, i, t, r);
|
|
117
|
+
if (o !== void 0)
|
|
118
|
+
return o;
|
|
119
|
+
}
|
|
120
|
+
if (s !== void 0)
|
|
121
|
+
return s;
|
|
122
|
+
throw new Error(`${this.parent.module} setting does not exist: ${t}`);
|
|
83
123
|
}
|
|
84
|
-
function
|
|
85
|
-
e && document.querySelectorAll(e).forEach((
|
|
86
|
-
t ?
|
|
124
|
+
function Ne(t, e) {
|
|
125
|
+
e && document.querySelectorAll(e).forEach((n) => {
|
|
126
|
+
t ? n.style.overflow = "hidden" : n.style.removeProperty("overflow");
|
|
87
127
|
});
|
|
88
128
|
}
|
|
89
|
-
function
|
|
90
|
-
e && document.querySelectorAll(e).forEach((
|
|
91
|
-
t ? (
|
|
129
|
+
function Be(t, e) {
|
|
130
|
+
e && document.querySelectorAll(e).forEach((n) => {
|
|
131
|
+
t ? (n.inert = !0, n.setAttribute("aria-hidden", "true")) : (n.inert = !1, n.removeAttribute("aria-hidden"));
|
|
92
132
|
});
|
|
93
133
|
}
|
|
94
|
-
function
|
|
95
|
-
|
|
134
|
+
function bt(t, e, s) {
|
|
135
|
+
Be(!!t, e), Ne(!!t, s);
|
|
136
|
+
}
|
|
137
|
+
const ue = {
|
|
138
|
+
on(t, e, ...s) {
|
|
139
|
+
this.events[t] || (this.events[t] = []), this.events[t].some(
|
|
140
|
+
(i) => i.listener === e
|
|
141
|
+
) || this.events[t].push({ listener: e, args: s });
|
|
142
|
+
},
|
|
143
|
+
off(t, e) {
|
|
144
|
+
this.events[t] && (this.events[t] = this.events[t].filter(
|
|
145
|
+
(s) => s.listener !== e
|
|
146
|
+
));
|
|
147
|
+
},
|
|
148
|
+
async emit(t, e) {
|
|
149
|
+
if (t = t.startsWith("on") ? t.slice(2, 3).toLowerCase() + t.slice(3) : t, !!this.events[t])
|
|
150
|
+
for (const { listener: s, args: n } of this.events[t])
|
|
151
|
+
await s(e, ...n);
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
class de extends Array {
|
|
155
|
+
constructor(e = null) {
|
|
156
|
+
super(), this.el = e, this.el && this.set();
|
|
157
|
+
}
|
|
158
|
+
get first() {
|
|
159
|
+
return this[0];
|
|
160
|
+
}
|
|
161
|
+
get last() {
|
|
162
|
+
return this[this.length - 1];
|
|
163
|
+
}
|
|
164
|
+
set(e = this.el) {
|
|
165
|
+
this.length = 0, this.push(...e.querySelectorAll(se.join(",")));
|
|
166
|
+
}
|
|
167
|
+
clear() {
|
|
168
|
+
this.length = 0;
|
|
169
|
+
}
|
|
96
170
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
$(this, P);
|
|
101
|
-
this.value = e, E(this, P, i), this.mql = null;
|
|
171
|
+
class he {
|
|
172
|
+
constructor(e = null) {
|
|
173
|
+
this.el = e, this.focusable = new de(), this.handleFocusTrap = Ue.bind(this);
|
|
102
174
|
}
|
|
103
|
-
|
|
104
|
-
|
|
175
|
+
on(e = this.el) {
|
|
176
|
+
this.focusable.set(e), this.focusable.length ? document.addEventListener("keydown", this.handleFocusTrap) : document.addEventListener("keydown", Gt);
|
|
105
177
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
this.mql && this.mql.removeEventListener("change", w(this, P)), E(this, P, e);
|
|
178
|
+
off() {
|
|
179
|
+
this.focusable.clear(), document.removeEventListener("keydown", this.handleFocusTrap), document.removeEventListener("keydown", Gt);
|
|
109
180
|
}
|
|
110
|
-
|
|
111
|
-
|
|
181
|
+
}
|
|
182
|
+
function Gt(t) {
|
|
183
|
+
(t.key === "Tab" || t.keyCode === 9) && t.preventDefault();
|
|
184
|
+
}
|
|
185
|
+
function Ue(t) {
|
|
186
|
+
if (t.key !== "Tab" && t.keyCode !== 9) return;
|
|
187
|
+
const { activeElement: e } = document, { el: s, focusable: n } = this, i = t.shiftKey, r = e === n.first || e === s, o = e === n.last || e === s;
|
|
188
|
+
(i && r || !i && o) && (t.preventDefault(), (i ? n.last : n.first).focus());
|
|
189
|
+
}
|
|
190
|
+
function Vt(t, e = !0) {
|
|
191
|
+
const s = localStorage.getItem(t), n = s ? JSON.parse(s) : {};
|
|
192
|
+
return {
|
|
193
|
+
get(i, r = void 0) {
|
|
194
|
+
return i ? i in n ? n[i] : r : n;
|
|
195
|
+
},
|
|
196
|
+
set(i, r) {
|
|
197
|
+
return r ? n[i] = r : delete n[i], e && localStorage.setItem(t, JSON.stringify(n)), n;
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
class ge extends Array {
|
|
202
|
+
constructor(e = {}) {
|
|
203
|
+
super(), this.presets = e;
|
|
204
|
+
}
|
|
205
|
+
applySettings(e) {
|
|
206
|
+
var r;
|
|
207
|
+
const s = (e == null ? void 0 : e.defaults) || {}, n = ((r = this.presets) == null ? void 0 : r[e.name]) || {}, i = (e == null ? void 0 : e.options) || {};
|
|
208
|
+
e.settings = { ...s, ...n, ...i };
|
|
209
|
+
}
|
|
210
|
+
validate(e) {
|
|
211
|
+
return !("name" in e) || typeof e.name != "string" ? (console.error("Plugin requires a name!"), !1) : !0;
|
|
212
|
+
}
|
|
213
|
+
get(e) {
|
|
214
|
+
return this.find((s) => s.name === e);
|
|
215
|
+
}
|
|
216
|
+
add(e) {
|
|
217
|
+
if (Array.isArray(e))
|
|
218
|
+
e.forEach((s) => this.add(s));
|
|
219
|
+
else if (this.applySettings(e), this.validate(e)) {
|
|
220
|
+
const s = this.findIndex((n) => n.name === e.name);
|
|
221
|
+
~s ? this[s] = e : this.push(e);
|
|
222
|
+
}
|
|
112
223
|
}
|
|
113
|
-
|
|
114
|
-
|
|
224
|
+
remove(e) {
|
|
225
|
+
const s = this.findIndex((n) => n.name === e);
|
|
226
|
+
~s && this.splice(s, 1);
|
|
115
227
|
}
|
|
116
228
|
}
|
|
117
|
-
|
|
118
|
-
class Rt {
|
|
229
|
+
class me extends Array {
|
|
119
230
|
constructor(e = {}) {
|
|
120
|
-
|
|
121
|
-
dataConfig: "config",
|
|
122
|
-
customProps: [],
|
|
123
|
-
teleport: null,
|
|
124
|
-
teleportMethod: "append"
|
|
125
|
-
}, e);
|
|
231
|
+
super(), this.settings = e;
|
|
126
232
|
}
|
|
127
|
-
get(
|
|
128
|
-
return this
|
|
233
|
+
get copy() {
|
|
234
|
+
return [...this];
|
|
129
235
|
}
|
|
130
|
-
|
|
131
|
-
|
|
236
|
+
get top() {
|
|
237
|
+
const e = this[this.length - 1];
|
|
238
|
+
return e || null;
|
|
132
239
|
}
|
|
133
|
-
|
|
134
|
-
|
|
240
|
+
updateIndex() {
|
|
241
|
+
this.forEach((e, s) => {
|
|
242
|
+
e.el.style.zIndex = null;
|
|
243
|
+
const n = getComputedStyle(e.el)["z-index"];
|
|
244
|
+
e.el.style.zIndex = parseInt(n) + s + 1;
|
|
245
|
+
});
|
|
135
246
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
const s = await this.createEntry(e, i);
|
|
139
|
-
return await s.mount(), await C.call(this, "beforeRegister", s), await C.call(s, "beforeRegister"), this.collection.push(s), await C.call(s, "afterRegister"), await C.call(this, "afterRegister", s), s;
|
|
247
|
+
onChange() {
|
|
248
|
+
this.updateIndex(), typeof this.settings.onChange == "function" && this.settings.onChange();
|
|
140
249
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
250
|
+
add(e) {
|
|
251
|
+
this.push(e), this.onChange();
|
|
252
|
+
}
|
|
253
|
+
remove(e) {
|
|
254
|
+
const s = this.findIndex((n) => n.id === e.id);
|
|
255
|
+
~s && (e.el.style.zIndex = null, this.splice(s, 1), this.onChange());
|
|
256
|
+
}
|
|
257
|
+
moveToTop(e) {
|
|
258
|
+
const s = this.findIndex((n) => n.id === e.id);
|
|
259
|
+
~s && (this.splice(s, 1), this.add(e));
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
const Ve = {
|
|
263
|
+
condition: !0
|
|
264
|
+
}, _e = {
|
|
265
|
+
primary: "hsl(152deg 60% 50%)",
|
|
266
|
+
secondary: "hsl(214deg 50% 50%)",
|
|
267
|
+
neutral: "hsl(214deg 20% 50%)",
|
|
268
|
+
important: "hsl(0deg 80% 50%)"
|
|
269
|
+
};
|
|
270
|
+
function We(t = {}) {
|
|
271
|
+
const e = {
|
|
272
|
+
name: "debug",
|
|
273
|
+
defaults: Ve,
|
|
274
|
+
options: t
|
|
275
|
+
};
|
|
276
|
+
function s(o, l = [], a = ["primary", "secondary"]) {
|
|
277
|
+
const c = a.map((d) => `color: ${_e[d]}`);
|
|
278
|
+
console.log(`%c📡 DEBUG: %c${o}`, ...c, ...l);
|
|
279
|
+
}
|
|
280
|
+
function n(o, ...l) {
|
|
281
|
+
return typeof o == "function" ? o(...l) : o;
|
|
282
|
+
}
|
|
283
|
+
const i = {
|
|
284
|
+
beforeMountRef: s.bind(null, "Event > beforeMount()"),
|
|
285
|
+
afterMountRef: s.bind(null, "Event > afterMount()"),
|
|
286
|
+
beforeUnmountRef: s.bind(
|
|
287
|
+
null,
|
|
288
|
+
"Event > beforeUnmount()",
|
|
289
|
+
[],
|
|
290
|
+
["important", "neutral"]
|
|
291
|
+
),
|
|
292
|
+
afterUnmountRef: s.bind(
|
|
293
|
+
null,
|
|
294
|
+
"Event > afterUnmount()",
|
|
295
|
+
[],
|
|
296
|
+
["important", "neutral"]
|
|
297
|
+
),
|
|
298
|
+
createEntryRef: (o, { parent: l, plugin: a }) => {
|
|
299
|
+
if (n(a.settings.condition, o)) {
|
|
300
|
+
const c = l.collection.length;
|
|
301
|
+
s(`Event > createEntry() > [${c}] #${o.id}`);
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
registerEntryRef: (o, { parent: l, plugin: a }) => {
|
|
305
|
+
if (n(a.settings.condition, o)) {
|
|
306
|
+
const c = l.collection.length;
|
|
307
|
+
s(`Event > registerEntry() > [${c}] #${o.id}`);
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
destroyEntryRef: (o, { parent: l, plugin: a }) => {
|
|
311
|
+
if (n(a.settings.condition, o)) {
|
|
312
|
+
const c = l.collection.length;
|
|
313
|
+
s(
|
|
314
|
+
`Event > destroyEntry() > [${c}] #${o.id}`,
|
|
315
|
+
[],
|
|
316
|
+
["important", "neutral"]
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
deregisterEntryRef: (o, { parent: l, plugin: a }) => {
|
|
321
|
+
if (n(a.settings.condition, o)) {
|
|
322
|
+
const c = l.collection.length;
|
|
323
|
+
s(
|
|
324
|
+
`Event > deregisterEntry() > [${c}] #${o.id}`,
|
|
325
|
+
[],
|
|
326
|
+
["important", "neutral"]
|
|
327
|
+
);
|
|
328
|
+
}
|
|
148
329
|
}
|
|
149
|
-
|
|
330
|
+
};
|
|
331
|
+
return { ...e, ...{
|
|
332
|
+
// Plugin setup/teardown methods
|
|
333
|
+
setup({ parent: o }) {
|
|
334
|
+
s("Plugin > setup()", arguments, ["secondary", "neutral"]), o.on("beforeMount", i.beforeMountRef), o.on("createEntry", i.createEntryRef, { parent: o, plugin: this }), o.on("registerEntry", i.registerEntryRef, {
|
|
335
|
+
parent: o,
|
|
336
|
+
plugin: this
|
|
337
|
+
}), o.on("afterMount", i.afterMountRef), o.on("beforeUnmount", i.beforeUnmountRef), o.on("destroyEntry", i.destroyEntryRef, { parent: o, plugin: this }), o.on("deregisterEntry", i.deregisterEntryRef, {
|
|
338
|
+
parent: o,
|
|
339
|
+
plugin: this
|
|
340
|
+
}), o.on("afterUnmount", i.afterUnmountRef);
|
|
341
|
+
},
|
|
342
|
+
teardown({ parent: o }) {
|
|
343
|
+
s("Plugin > teardown()", arguments, ["secondary", "neutral"]), o.off("beforeMount", i.beforeMountRef), o.off("createEntry", i.createEntryRef), o.off("registerEntry", i.registerEntryRef), o.off("afterMount", i.afterMountRef), o.off("beforeUnmount", i.beforeUnmountRef), o.off("destroyEntry", i.destroyEntryRef), o.off("deregisterEntry", i.deregisterEntryRef), o.off("afterUnmount", i.afterUnmountRef);
|
|
344
|
+
},
|
|
345
|
+
// Mount lifecycle hooks
|
|
346
|
+
beforeMount() {
|
|
347
|
+
s("Hook > beforeMount()", arguments);
|
|
348
|
+
},
|
|
349
|
+
onCreateEntry({ parent: o, entry: l }) {
|
|
350
|
+
if (n(this.settings.condition, l)) {
|
|
351
|
+
const a = o.collection.length;
|
|
352
|
+
s(`Hook > onCreateEntry() > [${a}] #${l.id}`, arguments);
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
onRegisterEntry({ parent: o, entry: l }) {
|
|
356
|
+
if (n(this.settings.condition, l)) {
|
|
357
|
+
const a = o.collection.length - 1;
|
|
358
|
+
s(`Hook > onRegisterEntry() > [${a}] #${l.id}`, arguments);
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
afterMount() {
|
|
362
|
+
s("Hook > afterMount()", arguments);
|
|
363
|
+
},
|
|
364
|
+
// Unmount lifecycle hooks
|
|
365
|
+
beforeUnmount() {
|
|
366
|
+
s("Hook > beforeUnmount()", arguments, ["important", "neutral"]);
|
|
367
|
+
},
|
|
368
|
+
onDestroyEntry({ parent: o, entry: l }) {
|
|
369
|
+
if (n(this.settings.condition, l)) {
|
|
370
|
+
const a = o.collection.length - 1;
|
|
371
|
+
s(`Hook > onDestroyEntry() > [${a}] #${l.id}`, arguments, [
|
|
372
|
+
"important",
|
|
373
|
+
"neutral"
|
|
374
|
+
]);
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
onDeregisterEntry({ parent: o, entry: l }) {
|
|
378
|
+
if (n(this.settings.condition, l)) {
|
|
379
|
+
const a = o.collection.length;
|
|
380
|
+
s(`Hook > onDeregisterEntry() > [${a}] #${l.id}`, arguments, [
|
|
381
|
+
"important",
|
|
382
|
+
"neutral"
|
|
383
|
+
]);
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
afterUnmount() {
|
|
387
|
+
s("Hook > afterUnmount()", arguments, ["important", "neutral"]);
|
|
388
|
+
}
|
|
389
|
+
} };
|
|
390
|
+
}
|
|
391
|
+
const ze = {
|
|
392
|
+
condition: !0
|
|
393
|
+
};
|
|
394
|
+
function Qe(t = {}) {
|
|
395
|
+
const e = {
|
|
396
|
+
name: "focusTrap",
|
|
397
|
+
defaults: ze,
|
|
398
|
+
options: t
|
|
399
|
+
}, s = {
|
|
400
|
+
setup({ parent: o }) {
|
|
401
|
+
o.on("opened", i, this), o.on("closed", r, this);
|
|
402
|
+
},
|
|
403
|
+
teardown({ parent: o }) {
|
|
404
|
+
o.off("opened", i), o.off("closed", r);
|
|
405
|
+
},
|
|
406
|
+
onCreateEntry({ entry: o }) {
|
|
407
|
+
o.focusTrap = new he();
|
|
408
|
+
}
|
|
409
|
+
};
|
|
410
|
+
function n(o, ...l) {
|
|
411
|
+
return typeof o == "function" ? o(...l) : o;
|
|
412
|
+
}
|
|
413
|
+
function i(o, l) {
|
|
414
|
+
var c;
|
|
415
|
+
const a = { plugin: l, parent: o.parent, entry: o };
|
|
416
|
+
n(l.settings.condition, a) && ((c = o.focusTrap) == null || c.on(o.dialog));
|
|
417
|
+
}
|
|
418
|
+
function r(o, l) {
|
|
419
|
+
var c;
|
|
420
|
+
const a = { plugin: l, parent: o.parent, entry: o };
|
|
421
|
+
n(l.settings.condition, a) && ((c = o.focusTrap) == null || c.off());
|
|
422
|
+
}
|
|
423
|
+
return { ...e, ...s };
|
|
424
|
+
}
|
|
425
|
+
const Ke = {
|
|
426
|
+
// The data attributes to get the breakpoint values from.
|
|
427
|
+
dataBreakpoint: "breakpoint",
|
|
428
|
+
// The data attributes to get the media query value from.
|
|
429
|
+
dataMediaQuery: "media-query",
|
|
430
|
+
// The string token to replace in the media query string.
|
|
431
|
+
token: "{{BP}}",
|
|
432
|
+
// Sets a global breakpoint. Can be overridden by setting a data attribute
|
|
433
|
+
// value. Notice: setting this option will enable a media query breakpoint on
|
|
434
|
+
// all entries.
|
|
435
|
+
breakpoint: null,
|
|
436
|
+
// The default media query string to use. Can be overridden by setting a data
|
|
437
|
+
// attribute value.
|
|
438
|
+
mediaQuery: "(min-width: {{BP}})",
|
|
439
|
+
// Maps entry ID or breakpoint key to breakpoint values. This is referenced
|
|
440
|
+
// when getting an entries breakpoint value.
|
|
441
|
+
breakpoints: {},
|
|
442
|
+
// Maps entry ID's to a media query strings. Media query may contain a token.
|
|
443
|
+
// This is referenced when getting an entries media query string.
|
|
444
|
+
mediaQueries: {},
|
|
445
|
+
// The function to run when the MediaQueryList triggers a "change" event.
|
|
446
|
+
// This is run once on initial mount.
|
|
447
|
+
onChange: () => {
|
|
150
448
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
449
|
+
};
|
|
450
|
+
function je(t = {}) {
|
|
451
|
+
const e = {
|
|
452
|
+
name: "mediaQuery",
|
|
453
|
+
defaults: Ke,
|
|
454
|
+
options: t
|
|
455
|
+
}, s = {
|
|
456
|
+
onCreateEntry({ entry: l }) {
|
|
457
|
+
r.call(this, l);
|
|
458
|
+
},
|
|
459
|
+
onDestroyEntry({ entry: l }) {
|
|
460
|
+
o(l);
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
function n(l) {
|
|
464
|
+
const a = l.el.getAttribute(`data-${this.settings.dataMediaQuery}`);
|
|
465
|
+
return !a && l.id in this.settings.mediaQueries ? this.settings.mediaQueries[l.id] : a;
|
|
466
|
+
}
|
|
467
|
+
function i(l) {
|
|
468
|
+
let a = l.el.getAttribute(`data-${this.settings.dataBreakpoint}`);
|
|
469
|
+
return !a && l.id in this.settings.breakpoints && (a = this.settings.breakpoints[l.id]), a && a in this.settings.breakpoints && (a = this.settings.breakpoints[a]), a && (a = getComputedStyle(document.body).getPropertyValue(`--${kt()}breakpoint-${a}`).trim() || a), a || this.settings.breakpoint;
|
|
470
|
+
}
|
|
471
|
+
function r(l) {
|
|
472
|
+
let a = n.call(this, l);
|
|
473
|
+
const c = i.call(this, l);
|
|
474
|
+
if (!c && !a) return;
|
|
475
|
+
c && !a && (a = this.settings.mediaQuery);
|
|
476
|
+
const d = a.replace(new RegExp(`${this.settings.token}`, "g"), c);
|
|
477
|
+
l.mql = window.matchMedia(d), l.mql.onchange = (f) => {
|
|
478
|
+
this.settings.onChange(f, l);
|
|
479
|
+
}, this.settings.onChange(l.mql, l);
|
|
480
|
+
}
|
|
481
|
+
function o(l) {
|
|
482
|
+
l.mql && (l.mql.onchange = null, l.mql = null);
|
|
483
|
+
}
|
|
484
|
+
return { ...e, ...s };
|
|
485
|
+
}
|
|
486
|
+
const Ye = {
|
|
487
|
+
// The property on entry objects to watch.
|
|
488
|
+
prop: "state",
|
|
489
|
+
// The default value or a function to compute the initial value.
|
|
490
|
+
value: null,
|
|
491
|
+
// The local storage key prefix.
|
|
492
|
+
keyPrefix: "VB:",
|
|
493
|
+
// The local storage key to use. If not provided, module name and prop value
|
|
494
|
+
// will be used e.g., "VB:ModalState".
|
|
495
|
+
key: null,
|
|
496
|
+
// Condition to determine whether or not to store the value in local storage.
|
|
497
|
+
condition: !1,
|
|
498
|
+
// The function to run whenever the value changes.
|
|
499
|
+
onChange() {
|
|
157
500
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
501
|
+
};
|
|
502
|
+
function Je(t = {}) {
|
|
503
|
+
const e = {
|
|
504
|
+
name: "propStore",
|
|
505
|
+
defaults: Ye,
|
|
506
|
+
options: t,
|
|
507
|
+
store: null
|
|
508
|
+
}, s = {
|
|
509
|
+
setup({ parent: l }) {
|
|
510
|
+
this.store = Vt(o.call(this, l.module));
|
|
511
|
+
},
|
|
512
|
+
async onCreateEntry({ entry: l }) {
|
|
513
|
+
await n.call(this, l);
|
|
514
|
+
},
|
|
515
|
+
onDestroyEntry({ entry: l }) {
|
|
516
|
+
r.call(this, l);
|
|
517
|
+
}
|
|
518
|
+
};
|
|
519
|
+
async function n(l) {
|
|
520
|
+
let a = l[this.settings.prop] || null;
|
|
521
|
+
const c = { plugin: this, parent: l.parent, entry: l };
|
|
522
|
+
Object.defineProperty(l, this.settings.prop, {
|
|
523
|
+
configurable: !0,
|
|
524
|
+
get() {
|
|
525
|
+
return a;
|
|
526
|
+
},
|
|
527
|
+
set: async (d) => {
|
|
528
|
+
if (a === d) return;
|
|
529
|
+
const f = a;
|
|
530
|
+
a = d, i(
|
|
531
|
+
this.settings.condition,
|
|
532
|
+
c,
|
|
533
|
+
d,
|
|
534
|
+
f
|
|
535
|
+
) && this.store.set(l.id, d), await this.settings.onChange(c, d, f);
|
|
536
|
+
}
|
|
537
|
+
}), Object.defineProperty(l, "store", {
|
|
538
|
+
configurable: !0,
|
|
539
|
+
get: () => this.store.get(l.id),
|
|
540
|
+
set: (d) => {
|
|
541
|
+
l[this.settings.prop] = d;
|
|
542
|
+
}
|
|
543
|
+
}), l[this.settings.prop] = await i(this.settings.value, c) || l[this.settings.prop];
|
|
544
|
+
}
|
|
545
|
+
function i(l, ...a) {
|
|
546
|
+
return typeof l == "function" ? l(...a) : l;
|
|
162
547
|
}
|
|
548
|
+
async function r(l) {
|
|
549
|
+
const a = l[this.settings.prop];
|
|
550
|
+
delete l[this.settings.prop], l[this.settings.prop] = a, this.store.set(l.id, null);
|
|
551
|
+
}
|
|
552
|
+
function o(l) {
|
|
553
|
+
const a = this.settings.prop.charAt(0).toUpperCase() + this.settings.prop.slice(1), c = this.settings.key || l + a;
|
|
554
|
+
return this.settings.keyPrefix + c;
|
|
555
|
+
}
|
|
556
|
+
return { ...e, ...s };
|
|
163
557
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
558
|
+
const Xe = {
|
|
559
|
+
where: null,
|
|
560
|
+
how: "append"
|
|
561
|
+
};
|
|
562
|
+
function Ge(t = {}) {
|
|
563
|
+
const e = {
|
|
564
|
+
name: "teleport",
|
|
565
|
+
defaults: Xe,
|
|
566
|
+
options: t
|
|
567
|
+
}, s = {
|
|
568
|
+
onCreateEntry({ plugin: r, entry: o }) {
|
|
569
|
+
n(r, o);
|
|
570
|
+
},
|
|
571
|
+
onDestroyEntry({ plugin: r, entry: o }) {
|
|
572
|
+
i(r, o);
|
|
573
|
+
}
|
|
574
|
+
};
|
|
575
|
+
function n(r, o) {
|
|
576
|
+
o.teleport = () => {
|
|
577
|
+
typeof o.teleportReturn == "function" && o.teleportReturn(), o.teleportReturn = oe(
|
|
578
|
+
o.el,
|
|
579
|
+
o.getSetting("teleport", { fallback: r.settings.where }),
|
|
580
|
+
o.getSetting("teleportMethod", { fallback: r.settings.how })
|
|
581
|
+
);
|
|
582
|
+
}, o.teleport(), o.parent.emit("teleport", { plugin: r, parent, entry: o });
|
|
583
|
+
}
|
|
584
|
+
function i(r, o) {
|
|
585
|
+
typeof o.teleportReturn == "function" && o.teleportReturn(), o.parent.emit("teleportReturn", { plugin: r, parent, entry: o });
|
|
586
|
+
}
|
|
587
|
+
return { ...e, ...s };
|
|
588
|
+
}
|
|
589
|
+
const qe = {
|
|
590
|
+
dataConfig: "config",
|
|
591
|
+
customProps: []
|
|
592
|
+
};
|
|
593
|
+
class xt {
|
|
594
|
+
constructor(e, s, n = {}) {
|
|
595
|
+
this.parent = e, this.id = (s == null ? void 0 : s.id) || s, this.el = Bt(s), this.settings = { ...n }, this.dataConfig = {}, this.customProps = {};
|
|
167
596
|
}
|
|
168
597
|
applySettings(e) {
|
|
169
598
|
return Object.assign(this.settings, e);
|
|
170
599
|
}
|
|
171
|
-
|
|
172
|
-
return
|
|
600
|
+
getSetting(e, s) {
|
|
601
|
+
return fe.call(this, e, s);
|
|
173
602
|
}
|
|
174
|
-
|
|
175
|
-
return Object.assign(
|
|
603
|
+
buildDataConfig() {
|
|
604
|
+
return Object.assign(
|
|
605
|
+
this.dataConfig,
|
|
606
|
+
ie(this.el, this.getSetting("dataConfig"))
|
|
607
|
+
);
|
|
176
608
|
}
|
|
177
|
-
|
|
178
|
-
return
|
|
609
|
+
buildCustomProps() {
|
|
610
|
+
return Object.assign(this.customProps, ce(this));
|
|
179
611
|
}
|
|
180
|
-
async
|
|
612
|
+
async init(e = {}) {
|
|
181
613
|
if (this.el === null)
|
|
182
|
-
throw new Error(
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
return this.returnRef ? (this.returnRef = Vt(this.el, this.returnRef), this.el) : (console.error("No return reference found:", this.el), !1);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
var nt, G, J;
|
|
196
|
-
class jt {
|
|
197
|
-
constructor(e = null, i = "[data-focus]") {
|
|
198
|
-
$(this, nt);
|
|
199
|
-
$(this, G);
|
|
200
|
-
$(this, J);
|
|
201
|
-
this.el = e, this.selectorFocus = i, E(this, G, Be.bind(this)), E(this, J, Ve.bind(this));
|
|
202
|
-
}
|
|
203
|
-
get focusable() {
|
|
204
|
-
return w(this, nt);
|
|
205
|
-
}
|
|
206
|
-
set focusable(e) {
|
|
207
|
-
E(this, nt, e), w(this, nt).length ? (document.removeEventListener("keydown", w(this, J)), document.addEventListener("keydown", w(this, G))) : (document.removeEventListener("keydown", w(this, G)), document.addEventListener("keydown", w(this, J)));
|
|
208
|
-
}
|
|
209
|
-
get focusableFirst() {
|
|
210
|
-
return this.focusable[0];
|
|
211
|
-
}
|
|
212
|
-
get focusableLast() {
|
|
213
|
-
return this.focusable[this.focusable.length - 1];
|
|
214
|
-
}
|
|
215
|
-
mount(e, i) {
|
|
216
|
-
e && (this.el = e), i && (this.selectorFocus = i), this.focusable = this.getFocusable(), this.focus();
|
|
217
|
-
}
|
|
218
|
-
unmount() {
|
|
219
|
-
this.el = null, this.focusable = [], document.removeEventListener("keydown", w(this, G)), document.removeEventListener("keydown", w(this, J));
|
|
220
|
-
}
|
|
221
|
-
focus(e = this.el, i = this.selectorFocus) {
|
|
222
|
-
(e.querySelector(i) || e).focus();
|
|
223
|
-
}
|
|
224
|
-
getFocusable(e = this.el) {
|
|
225
|
-
const i = [], s = document.activeElement, n = e.scrollTop, o = Ne.join(",");
|
|
226
|
-
return e.querySelectorAll(o).forEach((l) => {
|
|
227
|
-
l.focus(), document.activeElement === l && i.push(l);
|
|
228
|
-
}), e.scrollTop = n, s.focus(), i;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
nt = new WeakMap(), G = new WeakMap(), J = new WeakMap();
|
|
232
|
-
const L = ":not([inert])", O = ':not([tabindex^="-"])', yt = ":not(:disabled)", Ne = [
|
|
233
|
-
`a[href]${L}${O}`,
|
|
234
|
-
`area[href]${L}${O}`,
|
|
235
|
-
`input:not([type="hidden"]):not([type="radio"])${L}${O}${yt}`,
|
|
236
|
-
`input[type="radio"]${L}${O}${yt}`,
|
|
237
|
-
`select${L}${O}${yt}`,
|
|
238
|
-
`textarea${L}${O}${yt}`,
|
|
239
|
-
`button${L}${O}${yt}`,
|
|
240
|
-
`details${L} > summary:first-of-type${O}`,
|
|
241
|
-
`iframe${L}${O}`,
|
|
242
|
-
`audio[controls]${L}${O}`,
|
|
243
|
-
`video[controls]${L}${O}`,
|
|
244
|
-
`[contenteditable]${L}${O}`,
|
|
245
|
-
`[tabindex]${L}${O}`
|
|
246
|
-
];
|
|
247
|
-
function Be(t) {
|
|
248
|
-
(t.key === "Tab" || t.keyCode === 9) && (t.shiftKey ? (document.activeElement === this.focusableFirst || document.activeElement === this.el) && (t.preventDefault(), this.focusableLast.focus()) : (document.activeElement === this.focusableLast || document.activeElement === this.el) && (t.preventDefault(), this.focusableFirst.focus()));
|
|
249
|
-
}
|
|
250
|
-
function Ve(t) {
|
|
251
|
-
(t.key === "Tab" || t.keyCode === 9) && t.preventDefault();
|
|
614
|
+
throw new Error(
|
|
615
|
+
`${this.parent.module} element was not found with ID: "${this.id}"`
|
|
616
|
+
);
|
|
617
|
+
this.applySettings(e), this.buildDataConfig(), this.buildCustomProps();
|
|
618
|
+
}
|
|
619
|
+
async destroy() {
|
|
620
|
+
Object.getOwnPropertyNames(this).forEach((e) => {
|
|
621
|
+
e !== "id" && delete this[e];
|
|
622
|
+
});
|
|
623
|
+
}
|
|
252
624
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
625
|
+
class Ot {
|
|
626
|
+
constructor(e = {}) {
|
|
627
|
+
this.module = this.constructor.name, this.collection = [], this.entryClass = xt, this.settings = { ...qe, ...e }, this.plugins = new ge(this.settings.presets), this.events = {}, Object.assign(this, ue);
|
|
628
|
+
}
|
|
629
|
+
get(e, s = "id") {
|
|
630
|
+
return this.collection.find((n) => n[s] === e);
|
|
631
|
+
}
|
|
632
|
+
applySettings(e) {
|
|
633
|
+
return Object.assign(this.settings, e);
|
|
634
|
+
}
|
|
635
|
+
async createEntry(e, s) {
|
|
636
|
+
const n = new this.entryClass(this, e, s);
|
|
637
|
+
return await Q(n, "init"), await V("onCreateEntry", this, n), n;
|
|
638
|
+
}
|
|
639
|
+
async destroyEntry(e) {
|
|
640
|
+
return await V("onDestroyEntry", this, e), await Q(e, "destroy"), e;
|
|
641
|
+
}
|
|
642
|
+
async register(e, s = {}) {
|
|
643
|
+
const n = Bt(e);
|
|
644
|
+
if (n === null)
|
|
645
|
+
throw new Error(
|
|
646
|
+
`${this.module} element was not found with ID: "${(e == null ? void 0 : e.id) || e}"`
|
|
647
|
+
);
|
|
648
|
+
const i = this.collection.findIndex((r) => r.id === n.id);
|
|
649
|
+
if (~i) {
|
|
650
|
+
const r = this.collection[i];
|
|
651
|
+
return r.el = n, typeof r.init == "function" && await r.init(s), r;
|
|
652
|
+
} else {
|
|
653
|
+
const r = await this.createEntry(n, s);
|
|
654
|
+
return this.collection.push(r), await V("onRegisterEntry", this, r), r;
|
|
261
655
|
}
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
656
|
+
}
|
|
657
|
+
async deregister(e) {
|
|
658
|
+
const s = this.collection.findIndex((n) => n.id === e);
|
|
659
|
+
if (~s) {
|
|
660
|
+
const n = await this.destroyEntry(this.collection[s]);
|
|
661
|
+
return await V(
|
|
662
|
+
"onDeregisterEntry",
|
|
663
|
+
this,
|
|
664
|
+
this.collection[s]
|
|
665
|
+
), this.collection.splice(s, 1), n;
|
|
666
|
+
}
|
|
667
|
+
return null;
|
|
668
|
+
}
|
|
669
|
+
async mount(e = {}) {
|
|
670
|
+
var n;
|
|
671
|
+
this.applySettings(e);
|
|
672
|
+
for (const i of ((n = this.settings) == null ? void 0 : n.plugins) || [])
|
|
673
|
+
this.plugins.add(i);
|
|
674
|
+
for (const i of this.plugins)
|
|
675
|
+
await Q(i, "setup", { plugin: i, parent: this });
|
|
676
|
+
await V("beforeMount", this);
|
|
677
|
+
const s = document.querySelectorAll(this.settings.selector);
|
|
678
|
+
for (const i of s)
|
|
679
|
+
await this.register(i);
|
|
680
|
+
return await V("afterMount", this), this;
|
|
681
|
+
}
|
|
682
|
+
async unmount() {
|
|
683
|
+
for (await V("beforeUnmount", this); this.collection.length > 0; )
|
|
684
|
+
await this.deregister(this.collection[0].id);
|
|
685
|
+
await V("afterUnmount", this);
|
|
686
|
+
for (const e of this.plugins)
|
|
687
|
+
await Q(e, "teardown", { plugin: e, parent: this });
|
|
688
|
+
for (const e of [...this.plugins])
|
|
689
|
+
this.plugins.remove(e.name);
|
|
690
|
+
return this;
|
|
691
|
+
}
|
|
270
692
|
}
|
|
271
|
-
function
|
|
693
|
+
function Ze(t) {
|
|
272
694
|
const e = {
|
|
273
|
-
prefix:
|
|
695
|
+
prefix: ae("prefix-themes", { fallback: "vb-theme-" }),
|
|
274
696
|
themes: ["root", "light", "dark"],
|
|
275
697
|
storeKey: "VB:Profile"
|
|
276
698
|
};
|
|
277
|
-
for (const [
|
|
278
|
-
t && t[
|
|
279
|
-
const
|
|
699
|
+
for (const [r] of Object.entries(e))
|
|
700
|
+
t && t[r] && (e[r] = t[r]);
|
|
701
|
+
const s = {
|
|
280
702
|
onInit() {
|
|
281
703
|
},
|
|
282
704
|
onChange() {
|
|
283
705
|
}
|
|
284
706
|
};
|
|
285
|
-
for (const [
|
|
286
|
-
t && t[
|
|
287
|
-
const
|
|
288
|
-
// Store our settings in the API
|
|
707
|
+
for (const [r] of Object.entries(s))
|
|
708
|
+
t && t[r] && (s[r] = t[r]);
|
|
709
|
+
const n = Vt(e.storeKey), i = {
|
|
710
|
+
// Store our settings in the API
|
|
289
711
|
settings: e,
|
|
290
|
-
// Actions
|
|
291
|
-
add(
|
|
292
|
-
e.themes.push(
|
|
712
|
+
// Actions
|
|
713
|
+
add(r) {
|
|
714
|
+
e.themes.push(r);
|
|
293
715
|
},
|
|
294
|
-
remove(
|
|
295
|
-
const
|
|
296
|
-
~
|
|
716
|
+
remove(r) {
|
|
717
|
+
const o = e.themes.indexOf(r);
|
|
718
|
+
~o && e.themes.splice(o, 1);
|
|
297
719
|
},
|
|
298
|
-
callback(
|
|
299
|
-
|
|
720
|
+
callback(r) {
|
|
721
|
+
s[r].call(this);
|
|
300
722
|
},
|
|
301
|
-
// Getters
|
|
723
|
+
// Getters
|
|
302
724
|
get class() {
|
|
303
725
|
return `${e.prefix}${this.theme}`;
|
|
304
726
|
},
|
|
305
727
|
get classes() {
|
|
306
|
-
return e.themes.map((
|
|
728
|
+
return e.themes.map((r) => `${e.prefix}${r}`);
|
|
307
729
|
},
|
|
308
730
|
get themes() {
|
|
309
731
|
return e.themes;
|
|
310
732
|
},
|
|
311
|
-
// Setup the theme get and set methods
|
|
733
|
+
// Setup the theme get and set methods
|
|
312
734
|
get theme() {
|
|
313
|
-
return
|
|
735
|
+
return n.get("theme") || "root";
|
|
314
736
|
},
|
|
315
|
-
set theme(
|
|
316
|
-
e.themes.includes(
|
|
737
|
+
set theme(r) {
|
|
738
|
+
e.themes.includes(r) ? this.theme != r && (n.set("theme", r), document.documentElement.classList.remove(...this.classes), document.documentElement.classList.add(`${e.prefix}${r}`), this.callback("onChange")) : console.error(`Not a valid theme value: "${r}"`);
|
|
317
739
|
}
|
|
318
740
|
};
|
|
319
|
-
return
|
|
741
|
+
return i.callback("onInit"), i;
|
|
320
742
|
}
|
|
321
|
-
const
|
|
743
|
+
const fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
322
744
|
__proto__: null,
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
745
|
+
Collection: Ot,
|
|
746
|
+
CollectionEntry: xt,
|
|
747
|
+
FocusTrap: he,
|
|
748
|
+
FocusableArray: de,
|
|
749
|
+
PluginsArray: ge,
|
|
750
|
+
StackArray: me,
|
|
751
|
+
cssVar: ae,
|
|
752
|
+
debug: We,
|
|
753
|
+
dispatchLifecycleHook: V,
|
|
754
|
+
eventEmitter: ue,
|
|
755
|
+
focusTrap: Qe,
|
|
756
|
+
focusableSelectors: se,
|
|
757
|
+
getCustomProps: ce,
|
|
758
|
+
getDataConfig: ie,
|
|
759
|
+
getElement: Bt,
|
|
760
|
+
getPrefix: kt,
|
|
761
|
+
getSetting: fe,
|
|
762
|
+
localStore: Vt,
|
|
763
|
+
maybeRunMethod: Q,
|
|
764
|
+
mediaQuery: je,
|
|
765
|
+
propStore: Je,
|
|
766
|
+
setGlobalState: bt,
|
|
767
|
+
teleport: Ge,
|
|
768
|
+
teleportElement: oe,
|
|
769
|
+
themeStore: Ze,
|
|
770
|
+
toCamel: re,
|
|
771
|
+
toKebab: Ut,
|
|
772
|
+
toMilliseconds: le,
|
|
773
|
+
transition: wt
|
|
774
|
+
}, Symbol.toStringTag, { value: "Module" })), tn = {
|
|
775
|
+
focusTrap: {
|
|
776
|
+
condition: ({ entry: t }) => t.state === "closed" || t.state === "opened" && t.mode === "modal"
|
|
777
|
+
},
|
|
778
|
+
mediaQuery: {
|
|
779
|
+
onChange(t, e) {
|
|
780
|
+
e.mode = t.matches ? "inline" : "modal";
|
|
781
|
+
}
|
|
782
|
+
},
|
|
783
|
+
propStore: {
|
|
784
|
+
prop: "inlineState",
|
|
785
|
+
value: ({ entry: t }) => t.store,
|
|
786
|
+
condition: ({ entry: t }) => ["opened", "closed", "indeterminate"].includes(t.state),
|
|
787
|
+
onChange: ({ entry: t }) => t.applyState()
|
|
788
|
+
}
|
|
789
|
+
}, en = {
|
|
790
|
+
// Plugin presets
|
|
791
|
+
presets: tn,
|
|
343
792
|
// Data attributes
|
|
344
793
|
dataOpen: "drawer-open",
|
|
345
794
|
dataClose: "drawer-close",
|
|
346
795
|
dataToggle: "drawer-toggle",
|
|
347
|
-
dataBreakpoint: "drawer-breakpoint",
|
|
348
796
|
// Selectors
|
|
349
797
|
selector: ".drawer",
|
|
350
798
|
selectorDialog: ".drawer__dialog",
|
|
@@ -360,139 +808,125 @@ const qi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
360
808
|
// Classes
|
|
361
809
|
classModal: "drawer_modal",
|
|
362
810
|
// Feature toggles
|
|
363
|
-
customProps: [
|
|
364
|
-
"transition-duration"
|
|
365
|
-
],
|
|
811
|
+
customProps: ["transition-duration"],
|
|
366
812
|
breakpoints: null,
|
|
367
813
|
customEventPrefix: "drawer:",
|
|
368
|
-
store: !0,
|
|
369
|
-
storeKey: "VB:DrawerState",
|
|
370
814
|
setTabindex: !0,
|
|
371
|
-
teleport: null,
|
|
372
|
-
teleportMethod: "prepend",
|
|
373
815
|
transition: !0,
|
|
374
816
|
transitionDuration: 300
|
|
375
817
|
};
|
|
376
|
-
function
|
|
377
|
-
t.store === "opened" ? t.open(!1, !1) : t.store === "closed" ? t.close(!1, !1) : t.store === "indeterminate" ? t.state = "indeterminate" : t.el.classList.contains(t.getSetting("stateOpened")) ? t.open(!1, !1) : t.el.classList.contains(t.getSetting("stateClosed")) ? t.close(!1, !1) : t.state = "indeterminate";
|
|
378
|
-
}
|
|
379
|
-
async function We(t) {
|
|
380
|
-
t.store === "opened" ? await t.open(!1, !1) : t.store === "closed" ? await t.close(!1, !1) : t.store === "indeterminate" ? t.state != "indeterminate" && (t.state = "indeterminate") : (t.state != t.inlineState && (t.state = t.inlineState), t.inlineState === "opened" ? await t.open(!1, !1) : t.inlineState === "closed" && await t.close(!1, !1));
|
|
381
|
-
}
|
|
382
|
-
function Ue(t) {
|
|
383
|
-
const e = Pt(), i = t.getAttribute(`data-${this.settings.dataBreakpoint}`);
|
|
384
|
-
return this.settings.breakpoints && this.settings.breakpoints[i] ? this.settings.breakpoints[i] : getComputedStyle(document.body).getPropertyValue(`--${e}breakpoint-${i}`).trim() ? getComputedStyle(document.body).getPropertyValue(`--${e}breakpoint-${i}`).trim() : i;
|
|
385
|
-
}
|
|
386
|
-
function it(t) {
|
|
387
|
-
const e = typeof t == "string" ? this.get(t) : t;
|
|
388
|
-
if (e)
|
|
389
|
-
return e;
|
|
390
|
-
throw new Error(`Drawer not found in collection with id of "${t.id || t}".`);
|
|
391
|
-
}
|
|
392
|
-
function me(t) {
|
|
393
|
-
t.state === "opened" ? t.mode === "modal" ? this.focusTrap.mount(t.dialog, this.settings.selectorFocus) : this.focusTrap.focus(t.dialog, this.settings.selectorFocus) : (t.trigger && (t.trigger.focus(), t.trigger = null), this.focusTrap.unmount());
|
|
394
|
-
}
|
|
395
|
-
function Ke(t) {
|
|
818
|
+
function nn(t) {
|
|
396
819
|
switch (t.mode) {
|
|
397
820
|
case "inline":
|
|
398
|
-
return
|
|
821
|
+
return sn.call(this, t);
|
|
399
822
|
case "modal":
|
|
400
|
-
return
|
|
823
|
+
return on.call(this, t);
|
|
401
824
|
default:
|
|
402
825
|
throw new Error(`"${t.mode}" is not a valid drawer mode.`);
|
|
403
826
|
}
|
|
404
827
|
}
|
|
405
|
-
async function
|
|
406
|
-
return t.el.classList.remove(t.getSetting("classModal")), t.dialog.removeAttribute("aria-modal"),
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
828
|
+
async function sn(t) {
|
|
829
|
+
return t.el.classList.remove(t.getSetting("classModal")), t.dialog.removeAttribute("aria-modal"), bt(
|
|
830
|
+
!1,
|
|
831
|
+
t.getSetting("selectorInert"),
|
|
832
|
+
t.getSetting("selectorOverflow")
|
|
833
|
+
), t.applyState(), t.el.dispatchEvent(
|
|
834
|
+
new CustomEvent(t.getSetting("customEventPrefix") + "switchMode", {
|
|
835
|
+
detail: this,
|
|
836
|
+
bubbles: !0
|
|
837
|
+
})
|
|
838
|
+
), await t.parent.emit("switchMode", t), t;
|
|
839
|
+
}
|
|
840
|
+
async function on(t) {
|
|
841
|
+
return t.el.classList.add(t.getSetting("classModal")), t.dialog.setAttribute("aria-modal", "true"), await t.close(!1, !1), t.el.dispatchEvent(
|
|
842
|
+
new CustomEvent(t.getSetting("customEventPrefix") + "switchMode", {
|
|
843
|
+
detail: this,
|
|
844
|
+
bubbles: !0
|
|
845
|
+
})
|
|
846
|
+
), await t.parent.emit("switchMode", t), t;
|
|
847
|
+
}
|
|
848
|
+
var q;
|
|
849
|
+
class rn extends xt {
|
|
850
|
+
constructor(s, n, i = {}) {
|
|
851
|
+
super(s, n, i);
|
|
852
|
+
U(this, q);
|
|
853
|
+
this.dialog = null, this.trigger = null, this.state = null, this.inlineState = null, S(this, q, "indeterminate");
|
|
431
854
|
}
|
|
432
855
|
get mode() {
|
|
433
|
-
return
|
|
434
|
-
}
|
|
435
|
-
set mode(
|
|
436
|
-
E(this,
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
856
|
+
return E(this, q);
|
|
857
|
+
}
|
|
858
|
+
set mode(s) {
|
|
859
|
+
E(this, q) !== s && (S(this, q, s), nn.call(this.parent, this));
|
|
860
|
+
}
|
|
861
|
+
setState(s) {
|
|
862
|
+
this.state = s;
|
|
863
|
+
const n = ["opening", "closing"];
|
|
864
|
+
this.mode === "inline" && !n.includes(s) && (this.inlineState = s), s === "indeterminate" && (this.el.classList.remove(this.getSetting("stateOpened")), this.el.classList.remove(this.getSetting("stateOpening")), this.el.classList.remove(this.getSetting("stateClosed")), this.el.classList.remove(this.getSetting("stateClosing")));
|
|
865
|
+
}
|
|
866
|
+
async applyState() {
|
|
867
|
+
if (this.mode !== "modal") {
|
|
868
|
+
if (this.inlineState === "opened")
|
|
869
|
+
return await this.open(!1, !1);
|
|
870
|
+
if (this.inlineState === "closed")
|
|
871
|
+
return await this.close(!1, !1);
|
|
872
|
+
if (this.state === null) {
|
|
873
|
+
if (this.el.classList.contains(this.getSetting("stateOpened")))
|
|
874
|
+
return await this.open(!1, !1);
|
|
875
|
+
if (this.el.classList.contains(this.getSetting("stateClosed")))
|
|
876
|
+
return await this.close(!1, !1);
|
|
877
|
+
}
|
|
878
|
+
return this.setState("indeterminate");
|
|
879
|
+
}
|
|
443
880
|
}
|
|
444
|
-
async open(
|
|
445
|
-
return this.
|
|
881
|
+
async open(s, n) {
|
|
882
|
+
return this.parent.open(this, s, n);
|
|
446
883
|
}
|
|
447
|
-
async close(
|
|
448
|
-
return this.
|
|
884
|
+
async close(s, n) {
|
|
885
|
+
return this.parent.close(this, s, n);
|
|
449
886
|
}
|
|
450
|
-
async toggle(
|
|
451
|
-
return this.
|
|
887
|
+
async toggle(s, n) {
|
|
888
|
+
return this.parent.toggle(this, s, n);
|
|
452
889
|
}
|
|
453
890
|
async deregister() {
|
|
454
|
-
return this.
|
|
455
|
-
}
|
|
456
|
-
mountBreakpoint() {
|
|
457
|
-
const i = this.breakpoint, s = this.handleBreakpoint.bind(this);
|
|
458
|
-
w(this, lt).mount(i, s);
|
|
459
|
-
}
|
|
460
|
-
unmountBreakpoint() {
|
|
461
|
-
w(this, lt).unmount();
|
|
891
|
+
return this.parent.deregister(this.id);
|
|
462
892
|
}
|
|
463
|
-
|
|
464
|
-
const s =
|
|
465
|
-
this.
|
|
893
|
+
async onCreateEntry() {
|
|
894
|
+
const s = this.el.querySelector(this.getSetting("selectorDialog"));
|
|
895
|
+
this.dialog = s || this.el, this.getSetting("setTabindex") && this.dialog.setAttribute("tabindex", "-1"), await this.applyState(), this.inlineState = this.state, this.mode = this.el.classList.contains(this.getSetting("classModal")) ? "modal" : "inline";
|
|
466
896
|
}
|
|
467
|
-
async
|
|
468
|
-
|
|
469
|
-
this.dialog = i || this.el, this.getSetting("setTabindex") && this.dialog.setAttribute("tabindex", "-1"), ze(this), this.inlineState = this.state, this.mode = this.el.classList.contains(this.getSetting("classModal")) ? "modal" : "inline", this.breakpoint && this.mountBreakpoint();
|
|
470
|
-
}
|
|
471
|
-
async beforeUnmount(i = !0) {
|
|
472
|
-
i && this.state === "opened" && await this.close(!1), this.context.store.set(this.id), this.unmountBreakpoint();
|
|
897
|
+
async onDestroyEntry() {
|
|
898
|
+
this.mode === "modal" && this.state === "opened" && await this.close(!1);
|
|
473
899
|
}
|
|
474
900
|
}
|
|
475
|
-
|
|
476
|
-
|
|
901
|
+
q = new WeakMap();
|
|
902
|
+
function nt(t) {
|
|
903
|
+
const e = typeof t == "string" ? this.get(t) : t;
|
|
904
|
+
if (e)
|
|
905
|
+
return e;
|
|
906
|
+
throw new Error(
|
|
907
|
+
`Drawer not found in collection with id of "${t.id || t}".`
|
|
908
|
+
);
|
|
909
|
+
}
|
|
910
|
+
async function ln(t) {
|
|
477
911
|
const e = t.target.closest(`
|
|
478
912
|
[data-${this.settings.dataOpen}],
|
|
479
913
|
[data-${this.settings.dataToggle}],
|
|
480
914
|
[data-${this.settings.dataClose}]
|
|
481
915
|
`);
|
|
482
916
|
if (e) {
|
|
483
|
-
t.preventDefault(), e.matches(`[data-${this.settings.dataToggle}]`) && e.getAttribute(`data-${this.settings.dataToggle}`).trim().split(" ").forEach((
|
|
484
|
-
const
|
|
485
|
-
return
|
|
486
|
-
}), e.matches(`[data-${this.settings.dataOpen}]`) && e.getAttribute(`data-${this.settings.dataOpen}`).trim().split(" ").forEach((
|
|
487
|
-
const
|
|
488
|
-
return
|
|
489
|
-
}), e.matches(`[data-${this.settings.dataClose}]`) && e.getAttribute(`data-${this.settings.dataClose}`).trim().split(" ").forEach((
|
|
490
|
-
if (
|
|
491
|
-
const
|
|
492
|
-
return
|
|
917
|
+
t.preventDefault(), e.matches(`[data-${this.settings.dataToggle}]`) && e.getAttribute(`data-${this.settings.dataToggle}`).trim().split(" ").forEach((n) => {
|
|
918
|
+
const i = nt.call(this, n);
|
|
919
|
+
return i.trigger = e, i.toggle();
|
|
920
|
+
}), e.matches(`[data-${this.settings.dataOpen}]`) && e.getAttribute(`data-${this.settings.dataOpen}`).trim().split(" ").forEach((n) => {
|
|
921
|
+
const i = nt.call(this, n);
|
|
922
|
+
return i.trigger = e, i.open();
|
|
923
|
+
}), e.matches(`[data-${this.settings.dataClose}]`) && e.getAttribute(`data-${this.settings.dataClose}`).trim().split(" ").forEach((n) => {
|
|
924
|
+
if (n) {
|
|
925
|
+
const i = nt.call(this, n);
|
|
926
|
+
return i.trigger = e, i.close();
|
|
493
927
|
} else {
|
|
494
|
-
const
|
|
495
|
-
if (
|
|
928
|
+
const i = t.target.closest(this.settings.selector);
|
|
929
|
+
if (i) return this.close(i.id);
|
|
496
930
|
}
|
|
497
931
|
});
|
|
498
932
|
return;
|
|
@@ -500,75 +934,87 @@ async function Ge(t) {
|
|
|
500
934
|
if (this.activeModal && t.target.matches(this.settings.selectorScreen))
|
|
501
935
|
return this.close(this.activeModal.id);
|
|
502
936
|
}
|
|
503
|
-
function
|
|
937
|
+
function an(t) {
|
|
504
938
|
if (t.key === "Escape" && this.activeModal)
|
|
505
939
|
return this.close(this.activeModal.id);
|
|
506
940
|
}
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
941
|
+
function pe(t) {
|
|
942
|
+
t.state === "opened" ? (t.dialog.querySelector(this.settings.selectorFocus) || t.dialog).focus() : t.trigger && (t.trigger.focus(), t.trigger = null);
|
|
943
|
+
}
|
|
944
|
+
async function ye(t, e, s = !0) {
|
|
945
|
+
const n = nt.call(this, t);
|
|
946
|
+
return (n.state === "closed" || n.state === "indeterminate" || n.state === null) && (n.setState("opening"), e ?? n.getSetting("transition") ? await wt(
|
|
947
|
+
n.el,
|
|
948
|
+
n.getSetting("stateClosed"),
|
|
949
|
+
n.getSetting("stateOpening"),
|
|
950
|
+
n.getSetting("stateOpened"),
|
|
951
|
+
n.getSetting("transitionDuration")
|
|
952
|
+
) : (n.el.classList.add(n.getSetting("stateOpened")), n.el.classList.remove(n.getSetting("stateClosed"))), n.setState("opened"), n.mode === "modal" && bt(
|
|
953
|
+
!0,
|
|
954
|
+
n.getSetting("selectorInert"),
|
|
955
|
+
n.getSetting("selectorOverflow")
|
|
956
|
+
), s && pe.call(this, n), n.el.dispatchEvent(
|
|
957
|
+
new CustomEvent(n.getSetting("customEventPrefix") + "opened", {
|
|
958
|
+
detail: this,
|
|
959
|
+
bubbles: !0
|
|
960
|
+
})
|
|
961
|
+
), await n.parent.emit("opened", n)), n;
|
|
962
|
+
}
|
|
963
|
+
async function we(t, e, s = !0) {
|
|
964
|
+
const n = nt.call(this, t);
|
|
965
|
+
return (n.state === "opened" || n.state === "indeterminate" || n.state === null) && (n.setState("closing"), document.activeElement.blur(), e ?? n.getSetting("transition") ? await wt(
|
|
966
|
+
n.el,
|
|
967
|
+
n.getSetting("stateOpened"),
|
|
968
|
+
n.getSetting("stateClosing"),
|
|
969
|
+
n.getSetting("stateClosed"),
|
|
970
|
+
n.getSetting("transitionDuration")
|
|
971
|
+
) : (n.el.classList.add(n.getSetting("stateClosed")), n.el.classList.remove(n.getSetting("stateOpened"))), n.setState("closed"), n.mode === "modal" && bt(
|
|
972
|
+
!1,
|
|
973
|
+
n.getSetting("selectorInert"),
|
|
974
|
+
n.getSetting("selectorOverflow")
|
|
975
|
+
), s && pe.call(this, n), n.el.dispatchEvent(
|
|
976
|
+
new CustomEvent(n.getSetting("customEventPrefix") + "closed", {
|
|
977
|
+
detail: this,
|
|
978
|
+
bubbles: !0
|
|
979
|
+
})
|
|
980
|
+
), await n.parent.emit("closed", n)), n;
|
|
981
|
+
}
|
|
982
|
+
async function cn(t, e, s) {
|
|
983
|
+
const n = nt.call(this, t);
|
|
984
|
+
return n.state === "closed" ? ye.call(this, n, e, s) : we.call(this, n, e, s);
|
|
985
|
+
}
|
|
986
|
+
var it, ot;
|
|
987
|
+
class us extends Ot {
|
|
988
|
+
constructor(s) {
|
|
989
|
+
super({ ...en, ...s });
|
|
990
|
+
U(this, it);
|
|
991
|
+
U(this, ot);
|
|
992
|
+
this.module = "Drawer", this.entryClass = rn, S(this, it, ln.bind(this)), S(this, ot, an.bind(this));
|
|
544
993
|
}
|
|
545
994
|
get activeModal() {
|
|
546
|
-
return this.collection.find((
|
|
547
|
-
}
|
|
548
|
-
async createEntry(i, s) {
|
|
549
|
-
return new Ye(this, i, s);
|
|
995
|
+
return this.collection.find((s) => s.state === "opened" && s.mode === "modal");
|
|
550
996
|
}
|
|
551
|
-
async open(
|
|
552
|
-
return
|
|
997
|
+
async open(s, n, i) {
|
|
998
|
+
return ye.call(this, s, n, i);
|
|
553
999
|
}
|
|
554
|
-
async close(
|
|
555
|
-
return we.call(this,
|
|
1000
|
+
async close(s, n, i) {
|
|
1001
|
+
return we.call(this, s, n, i);
|
|
556
1002
|
}
|
|
557
|
-
async toggle(
|
|
558
|
-
return
|
|
1003
|
+
async toggle(s, n, i) {
|
|
1004
|
+
return cn.call(this, s, n, i);
|
|
559
1005
|
}
|
|
560
1006
|
async afterMount() {
|
|
561
|
-
document.addEventListener("click",
|
|
1007
|
+
document.addEventListener("click", E(this, it), !1), document.addEventListener("keydown", E(this, ot), !1);
|
|
562
1008
|
}
|
|
563
1009
|
async beforeUnmount() {
|
|
564
1010
|
this.trigger = null;
|
|
565
1011
|
}
|
|
566
1012
|
async afterUnmount() {
|
|
567
|
-
document.removeEventListener("click",
|
|
1013
|
+
document.removeEventListener("click", E(this, it), !1), document.removeEventListener("keydown", E(this, ot), !1);
|
|
568
1014
|
}
|
|
569
1015
|
}
|
|
570
|
-
|
|
571
|
-
const
|
|
1016
|
+
it = new WeakMap(), ot = new WeakMap();
|
|
1017
|
+
const fn = {
|
|
572
1018
|
// Data attributes
|
|
573
1019
|
dataOpen: "modal-open",
|
|
574
1020
|
dataClose: "modal-close",
|
|
@@ -587,56 +1033,51 @@ const Qe = {
|
|
|
587
1033
|
stateClosing: "is-closing",
|
|
588
1034
|
stateClosed: "is-closed",
|
|
589
1035
|
// Feature settings
|
|
590
|
-
customProps: [
|
|
591
|
-
"transition-duration"
|
|
592
|
-
],
|
|
1036
|
+
customProps: ["transition-duration"],
|
|
593
1037
|
customEventPrefix: "modal:",
|
|
594
1038
|
setTabindex: !0,
|
|
595
|
-
teleport: null,
|
|
596
|
-
teleportMethod: "append",
|
|
597
1039
|
transition: !0,
|
|
598
1040
|
transitionDuration: 300
|
|
599
1041
|
};
|
|
600
|
-
class
|
|
601
|
-
constructor(e,
|
|
602
|
-
super(e,
|
|
1042
|
+
class un extends xt {
|
|
1043
|
+
constructor(e, s, n = {}) {
|
|
1044
|
+
super(e, s, n), this.state = "closed", this.dialog = null;
|
|
603
1045
|
}
|
|
604
1046
|
get isRequired() {
|
|
605
1047
|
return this.dialog.matches(this.getSetting("selectorRequired"));
|
|
606
1048
|
}
|
|
607
|
-
async open(e,
|
|
608
|
-
return this.
|
|
1049
|
+
async open(e, s) {
|
|
1050
|
+
return this.parent.open(this, e, s);
|
|
609
1051
|
}
|
|
610
|
-
async close(e,
|
|
611
|
-
return this.
|
|
1052
|
+
async close(e, s) {
|
|
1053
|
+
return this.parent.close(this, e, s);
|
|
612
1054
|
}
|
|
613
|
-
async replace(e,
|
|
614
|
-
return this.
|
|
1055
|
+
async replace(e, s) {
|
|
1056
|
+
return this.parent.replace(this, e, s);
|
|
615
1057
|
}
|
|
616
1058
|
async deregister() {
|
|
617
|
-
return this.
|
|
1059
|
+
return this.parent.deregister(this.id);
|
|
618
1060
|
}
|
|
619
|
-
async
|
|
1061
|
+
async onCreateEntry() {
|
|
620
1062
|
const e = this.el.querySelector(this.getSetting("selectorDialog"));
|
|
621
1063
|
this.dialog = e || this.el, this.dialog.setAttribute("aria-modal", "true"), this.dialog.hasAttribute("role") || this.dialog.setAttribute("role", "dialog"), this.getSetting("setTabindex") && this.dialog.setAttribute("tabindex", "-1");
|
|
622
1064
|
}
|
|
623
|
-
async
|
|
1065
|
+
async onRegisterEntry() {
|
|
624
1066
|
this.el.classList.contains(this.getSetting("stateOpened")) ? await this.open(!1) : (this.el.classList.remove(this.getSetting("stateOpening")), this.el.classList.remove(this.getSetting("stateClosing")), this.el.classList.add(this.getSetting("stateClosed")));
|
|
625
1067
|
}
|
|
626
|
-
async
|
|
627
|
-
|
|
1068
|
+
async onDestroyEntry() {
|
|
1069
|
+
this.state === "opened" && await this.close(!1);
|
|
628
1070
|
}
|
|
629
1071
|
}
|
|
630
|
-
function
|
|
1072
|
+
function pt(t) {
|
|
631
1073
|
const e = typeof t == "string" ? this.get(t) : this.get(t.id);
|
|
632
1074
|
if (e)
|
|
633
1075
|
return e;
|
|
634
|
-
throw new Error(
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
this.active ? this.focusTrap.mount(this.active.dialog, this.settings.selectorFocus) : (this.trigger && (this.trigger.focus(), this.trigger = null), this.focusTrap.unmount());
|
|
1076
|
+
throw new Error(
|
|
1077
|
+
`Modal not found in collection with id of "${t.id || t}".`
|
|
1078
|
+
);
|
|
638
1079
|
}
|
|
639
|
-
async function
|
|
1080
|
+
async function dn(t) {
|
|
640
1081
|
const e = t.target.closest(`
|
|
641
1082
|
[data-${this.settings.dataOpen}],
|
|
642
1083
|
[data-${this.settings.dataReplace}],
|
|
@@ -644,136 +1085,115 @@ async function ti(t) {
|
|
|
644
1085
|
`);
|
|
645
1086
|
if (e) {
|
|
646
1087
|
if (t.preventDefault(), e.matches(`[data-${this.settings.dataOpen}]`)) {
|
|
647
|
-
const
|
|
648
|
-
return t.target.closest(this.settings.selector) || (this.trigger = e),
|
|
1088
|
+
const s = e.getAttribute(`data-${this.settings.dataOpen}`).trim(), n = pt.call(this, s);
|
|
1089
|
+
return t.target.closest(this.settings.selector) || (this.trigger = e), n.open();
|
|
649
1090
|
}
|
|
650
1091
|
if (e.matches(`[data-${this.settings.dataReplace}]`)) {
|
|
651
|
-
const
|
|
652
|
-
return t.target.closest(this.settings.selector) || (this.trigger = e),
|
|
1092
|
+
const s = e.getAttribute(`data-${this.settings.dataReplace}`).trim(), n = pt.call(this, s);
|
|
1093
|
+
return t.target.closest(this.settings.selector) || (this.trigger = e), n.replace();
|
|
653
1094
|
}
|
|
654
1095
|
if (e.matches(`[data-${this.settings.dataClose}]`)) {
|
|
655
|
-
const
|
|
656
|
-
return
|
|
1096
|
+
const s = e.getAttribute(`data-${this.settings.dataClose}`).trim();
|
|
1097
|
+
return s === "*" ? this.closeAll() : this.close(s);
|
|
657
1098
|
}
|
|
658
1099
|
}
|
|
659
1100
|
if (this.active && t.target.matches(this.settings.selectorScreen) && !this.active.isRequired)
|
|
660
1101
|
return this.close(this.active.id);
|
|
661
1102
|
}
|
|
662
|
-
function
|
|
1103
|
+
function hn(t) {
|
|
663
1104
|
if (t.key === "Escape" && this.active && !this.active.dialog.matches(this.settings.selectorRequired))
|
|
664
1105
|
return this.close();
|
|
665
1106
|
}
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
return
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
},
|
|
728
|
-
remove(i) {
|
|
729
|
-
const s = e.findIndex((n) => n.id === i.id);
|
|
730
|
-
s >= 0 && (i.el.style.zIndex = null, e.splice(s, 1), this.setGlobalState());
|
|
731
|
-
},
|
|
732
|
-
moveToTop(i) {
|
|
733
|
-
const s = e.findIndex((n) => n.id === i.id);
|
|
734
|
-
s >= 0 && (e.splice(s, 1), this.add(i));
|
|
735
|
-
}
|
|
736
|
-
};
|
|
737
|
-
}
|
|
738
|
-
var ft, ut;
|
|
739
|
-
class es extends Rt {
|
|
740
|
-
constructor(i) {
|
|
741
|
-
super({ ...Qe, ...i });
|
|
742
|
-
$(this, ft);
|
|
743
|
-
$(this, ut);
|
|
744
|
-
this.trigger = null, this.focusTrap = new jt(), E(this, ft, ti.bind(this)), E(this, ut, ei.bind(this)), this.stack = si(this.settings);
|
|
1107
|
+
function Lt() {
|
|
1108
|
+
this.active ? (this.active.dialog.querySelector(this.settings.selectorFocus) || this.active.dialog).focus() : this.trigger && (this.trigger.focus(), this.trigger = null);
|
|
1109
|
+
}
|
|
1110
|
+
async function be(t, e = void 0, s = !0) {
|
|
1111
|
+
const n = pt.call(this, t);
|
|
1112
|
+
return this.stack.moveToTop(n), n.state === "closed" && (n.state = "opening", this.stack.add(n), e ?? n.getSetting("transition") ? await wt(
|
|
1113
|
+
n.el,
|
|
1114
|
+
n.getSetting("stateClosed"),
|
|
1115
|
+
n.getSetting("stateOpening"),
|
|
1116
|
+
n.getSetting("stateOpened"),
|
|
1117
|
+
n.getSetting("transitionDuration")
|
|
1118
|
+
) : (n.el.classList.add(n.getSetting("stateOpened")), n.el.classList.remove(n.getSetting("stateClosed"))), n.state = "opened"), s && Lt.call(this), n.el.dispatchEvent(
|
|
1119
|
+
new CustomEvent(n.getSetting("customEventPrefix") + "opened", {
|
|
1120
|
+
detail: n,
|
|
1121
|
+
bubbles: !0
|
|
1122
|
+
})
|
|
1123
|
+
), await n.parent.emit("opened", n), n;
|
|
1124
|
+
}
|
|
1125
|
+
async function xe(t, e, s = !0) {
|
|
1126
|
+
const n = t ? pt.call(this, t) : this.active;
|
|
1127
|
+
return n && n.state === "opened" && (n.state = "closing", document.activeElement.blur(), e ?? n.getSetting("transition") ? await wt(
|
|
1128
|
+
n.el,
|
|
1129
|
+
n.getSetting("stateOpened"),
|
|
1130
|
+
n.getSetting("stateClosing"),
|
|
1131
|
+
n.getSetting("stateClosed"),
|
|
1132
|
+
n.getSetting("transitionDuration")
|
|
1133
|
+
) : (n.el.classList.add(n.getSetting("stateClosed")), n.el.classList.remove(n.getSetting("stateOpened"))), this.stack.remove(n), n.state = "closed", s && Lt.call(this), n.el.dispatchEvent(
|
|
1134
|
+
new CustomEvent(n.getSetting("customEventPrefix") + "closed", {
|
|
1135
|
+
detail: n,
|
|
1136
|
+
bubbles: !0
|
|
1137
|
+
})
|
|
1138
|
+
), await n.parent.emit("closed", n)), n;
|
|
1139
|
+
}
|
|
1140
|
+
async function It(t, e) {
|
|
1141
|
+
const s = [];
|
|
1142
|
+
return await Promise.all(
|
|
1143
|
+
this.stack.copy.map(async (n) => {
|
|
1144
|
+
t && t === n.id || (s.push(await xe.call(this, n, e, !1)), n.trigger = null);
|
|
1145
|
+
})
|
|
1146
|
+
), s;
|
|
1147
|
+
}
|
|
1148
|
+
async function gn(t, e, s = !0) {
|
|
1149
|
+
const n = pt.call(this, t);
|
|
1150
|
+
let i, r;
|
|
1151
|
+
return n.state === "opened" ? (i = n, r = await It.call(this, n.id, e)) : (r = It.call(this, !1, e), i = be.call(this, n, e, !1), await Promise.all([i, r])), s && Lt.call(this), { opened: i, closed: r };
|
|
1152
|
+
}
|
|
1153
|
+
var rt, lt;
|
|
1154
|
+
class ds extends Ot {
|
|
1155
|
+
constructor(s) {
|
|
1156
|
+
super({ ...fn, ...s });
|
|
1157
|
+
U(this, rt);
|
|
1158
|
+
U(this, lt);
|
|
1159
|
+
this.module = "Modal", this.entryClass = un, this.trigger = null, S(this, rt, dn.bind(this)), S(this, lt, hn.bind(this)), this.stack = new me({
|
|
1160
|
+
onChange: () => {
|
|
1161
|
+
bt(
|
|
1162
|
+
this.stack.top,
|
|
1163
|
+
this.settings.selectorInert,
|
|
1164
|
+
this.settings.selectorOverflow
|
|
1165
|
+
);
|
|
1166
|
+
}
|
|
1167
|
+
});
|
|
745
1168
|
}
|
|
746
1169
|
get active() {
|
|
747
1170
|
return this.stack.top;
|
|
748
1171
|
}
|
|
749
|
-
async
|
|
750
|
-
return
|
|
751
|
-
}
|
|
752
|
-
async open(i, s, n) {
|
|
753
|
-
return be.call(this, i, s, n);
|
|
1172
|
+
async open(s, n, i) {
|
|
1173
|
+
return be.call(this, s, n, i);
|
|
754
1174
|
}
|
|
755
|
-
async close(
|
|
756
|
-
return
|
|
1175
|
+
async close(s, n, i) {
|
|
1176
|
+
return xe.call(this, s, n, i);
|
|
757
1177
|
}
|
|
758
|
-
async replace(
|
|
759
|
-
return
|
|
1178
|
+
async replace(s, n, i) {
|
|
1179
|
+
return gn.call(this, s, n, i);
|
|
760
1180
|
}
|
|
761
|
-
async closeAll(
|
|
762
|
-
const
|
|
763
|
-
return
|
|
1181
|
+
async closeAll(s = !1, n, i = !0) {
|
|
1182
|
+
const r = await It.call(this, s, n);
|
|
1183
|
+
return i && Lt.call(this), r;
|
|
764
1184
|
}
|
|
765
1185
|
async afterMount() {
|
|
766
|
-
document.addEventListener("click",
|
|
1186
|
+
document.addEventListener("click", E(this, rt), !1), document.addEventListener("keydown", E(this, lt), !1);
|
|
767
1187
|
}
|
|
768
1188
|
async beforeUnmount() {
|
|
769
1189
|
this.trigger = null;
|
|
770
1190
|
}
|
|
771
1191
|
async afterUnmount() {
|
|
772
|
-
document.removeEventListener("click",
|
|
1192
|
+
document.removeEventListener("click", E(this, rt), !1), document.removeEventListener("keydown", E(this, lt), !1);
|
|
773
1193
|
}
|
|
774
1194
|
}
|
|
775
|
-
|
|
776
|
-
const
|
|
1195
|
+
rt = new WeakMap(), lt = new WeakMap();
|
|
1196
|
+
const mn = {
|
|
777
1197
|
// Selectors
|
|
778
1198
|
selector: ".popover",
|
|
779
1199
|
selectorTooltip: ".popover_tooltip",
|
|
@@ -790,62 +1210,60 @@ const ni = {
|
|
|
790
1210
|
"arrow-padding",
|
|
791
1211
|
"toggle-delay"
|
|
792
1212
|
],
|
|
1213
|
+
customEventPrefix: "popover:",
|
|
793
1214
|
placement: "bottom",
|
|
794
1215
|
event: "click",
|
|
795
1216
|
offset: 0,
|
|
796
1217
|
flipPadding: 0,
|
|
797
1218
|
shiftPadding: 0,
|
|
798
1219
|
arrowPadding: 0,
|
|
799
|
-
toggleDelay: 0
|
|
800
|
-
// Feature settings
|
|
801
|
-
teleport: null,
|
|
802
|
-
teleportMethod: "append"
|
|
1220
|
+
toggleDelay: 0
|
|
803
1221
|
};
|
|
804
|
-
function
|
|
1222
|
+
function qt(t, e, s) {
|
|
805
1223
|
Object.assign(t.style, {
|
|
806
1224
|
left: e != null ? `${e}px` : "",
|
|
807
|
-
top:
|
|
1225
|
+
top: s != null ? `${s}px` : ""
|
|
808
1226
|
});
|
|
809
1227
|
}
|
|
810
|
-
function
|
|
811
|
-
let
|
|
812
|
-
typeof
|
|
813
|
-
const
|
|
814
|
-
if (Number.isNaN(
|
|
815
|
-
throw new Error(`Provided delay value is not a number: "${
|
|
816
|
-
return
|
|
1228
|
+
function ve(t, e) {
|
|
1229
|
+
let s = t.getSetting("toggle-delay");
|
|
1230
|
+
typeof s == "string" && (s.indexOf(",") > -1 && (s = s.split(",")), s.indexOf(" ") > -1 && (s = s.split(" "))), Array.isArray(s) && (s = s[e]);
|
|
1231
|
+
const n = Number(s);
|
|
1232
|
+
if (Number.isNaN(n))
|
|
1233
|
+
throw new Error(`Provided delay value is not a number: "${s}"`);
|
|
1234
|
+
return n;
|
|
817
1235
|
}
|
|
818
|
-
function
|
|
1236
|
+
function Mt(t) {
|
|
819
1237
|
let e;
|
|
820
|
-
const
|
|
821
|
-
for (let
|
|
822
|
-
|
|
823
|
-
switch (
|
|
1238
|
+
const s = typeof t == "string" ? t.trim().split(" ") : [t];
|
|
1239
|
+
for (let n = 0; n < s.length; n++)
|
|
1240
|
+
s[n] = Number(s[n]);
|
|
1241
|
+
switch (s.length) {
|
|
824
1242
|
case 1:
|
|
825
|
-
e =
|
|
1243
|
+
e = s[0];
|
|
826
1244
|
break;
|
|
827
1245
|
case 2:
|
|
828
1246
|
e = {
|
|
829
|
-
top:
|
|
830
|
-
right:
|
|
831
|
-
bottom:
|
|
832
|
-
left:
|
|
1247
|
+
top: s[0],
|
|
1248
|
+
right: s[1],
|
|
1249
|
+
bottom: s[0],
|
|
1250
|
+
left: s[1]
|
|
833
1251
|
};
|
|
834
1252
|
break;
|
|
835
1253
|
case 3:
|
|
836
1254
|
e = {
|
|
837
|
-
top:
|
|
838
|
-
right:
|
|
839
|
-
bottom:
|
|
840
|
-
left:
|
|
1255
|
+
top: s[0],
|
|
1256
|
+
right: s[1],
|
|
1257
|
+
bottom: s[2],
|
|
1258
|
+
left: s[1]
|
|
841
1259
|
};
|
|
842
1260
|
break;
|
|
843
1261
|
case 4:
|
|
844
1262
|
e = {
|
|
845
|
-
top:
|
|
846
|
-
right:
|
|
847
|
-
bottom:
|
|
848
|
-
left:
|
|
1263
|
+
top: s[0],
|
|
1264
|
+
right: s[1],
|
|
1265
|
+
bottom: s[2],
|
|
1266
|
+
left: s[3]
|
|
849
1267
|
};
|
|
850
1268
|
break;
|
|
851
1269
|
default:
|
|
@@ -854,99 +1272,109 @@ function Nt(t) {
|
|
|
854
1272
|
}
|
|
855
1273
|
return e;
|
|
856
1274
|
}
|
|
857
|
-
function
|
|
1275
|
+
function pn(t) {
|
|
858
1276
|
return {
|
|
859
1277
|
offset: Number(t.getSetting("offset")),
|
|
860
1278
|
flip: {
|
|
861
|
-
padding:
|
|
1279
|
+
padding: Mt(t.getSetting("flip-padding"))
|
|
862
1280
|
},
|
|
863
1281
|
shift: {
|
|
864
|
-
padding:
|
|
1282
|
+
padding: Mt(t.getSetting("shift-padding"))
|
|
865
1283
|
},
|
|
866
1284
|
arrow: {
|
|
867
1285
|
element: t.getSetting("selectorArrow"),
|
|
868
|
-
padding:
|
|
1286
|
+
padding: Mt(t.getSetting("arrow-padding"))
|
|
869
1287
|
}
|
|
870
1288
|
};
|
|
871
1289
|
}
|
|
872
|
-
function
|
|
1290
|
+
function Ee(t) {
|
|
873
1291
|
const e = typeof t == "string" ? this.get(t) : this.get(t.id);
|
|
874
1292
|
if (e)
|
|
875
1293
|
return e;
|
|
876
1294
|
throw new Error(`Popover not found in collection with id of "${t}".`);
|
|
877
1295
|
}
|
|
878
1296
|
async function Se(t) {
|
|
879
|
-
const e = t ?
|
|
880
|
-
return e && e.state === "opened" && (e.el.inert = !0, e.el.classList.remove(this.settings.stateActive), e.isTooltip || e.trigger.setAttribute("aria-expanded", "false"), e.floatingCleanup(), e.state = "closed", e.trigger === this.trigger && (this.trigger = null)
|
|
881
|
-
|
|
882
|
-
|
|
1297
|
+
const e = t ? Ee.call(this, t) : await Ce.call(this);
|
|
1298
|
+
return e && e.state === "opened" && (e.el.inert = !0, e.el.classList.remove(this.settings.stateActive), e.isTooltip || e.trigger.setAttribute("aria-expanded", "false"), e.floatingCleanup(), e.state = "closed", e.trigger === this.trigger && (this.trigger = null), e.el.dispatchEvent(
|
|
1299
|
+
new CustomEvent(e.getSetting("customEventPrefix") + "closed", {
|
|
1300
|
+
detail: this,
|
|
1301
|
+
bubbles: !0
|
|
1302
|
+
})
|
|
1303
|
+
), await e.parent.emit("closed", e)), e;
|
|
1304
|
+
}
|
|
1305
|
+
async function Ce() {
|
|
883
1306
|
const t = [];
|
|
884
|
-
return await Promise.all(
|
|
885
|
-
|
|
886
|
-
|
|
1307
|
+
return await Promise.all(
|
|
1308
|
+
this.collection.map(async (e) => {
|
|
1309
|
+
e.state === "opened" && t.push(await Se.call(this, e));
|
|
1310
|
+
})
|
|
1311
|
+
), t;
|
|
887
1312
|
}
|
|
888
|
-
function
|
|
1313
|
+
function $e(t) {
|
|
889
1314
|
t.state == "opened" && setTimeout(() => {
|
|
890
1315
|
const e = t.el.matches(":hover") === t.el || t.trigger.matches(":hover") === t.trigger;
|
|
891
|
-
let
|
|
1316
|
+
let s = document.activeElement.closest(
|
|
892
1317
|
`#${t.id}, [aria-controls="${t.id}"], [aria-describedby="${t.id}"]`
|
|
893
1318
|
);
|
|
894
|
-
return
|
|
1319
|
+
return !e && !s && t.close(), t;
|
|
895
1320
|
}, 1);
|
|
896
1321
|
}
|
|
897
|
-
function
|
|
1322
|
+
function yn(t) {
|
|
898
1323
|
t.state === "opened" ? t.close() : (this.trigger = t.trigger, t.open());
|
|
899
1324
|
}
|
|
900
|
-
function
|
|
1325
|
+
function wn(t) {
|
|
901
1326
|
t.isTooltip && (t.toggleDelayId && clearTimeout(t.toggleDelayId), t.close());
|
|
902
1327
|
}
|
|
903
|
-
function
|
|
1328
|
+
function bn(t, e) {
|
|
904
1329
|
if (t.isHovered = e, e.type == "focus" && !t.trigger.matches(":focus-visible"))
|
|
905
1330
|
return;
|
|
906
1331
|
t.toggleDelayId && clearTimeout(t.toggleDelayId);
|
|
907
|
-
const
|
|
908
|
-
if (
|
|
909
|
-
const
|
|
1332
|
+
const s = t.trigger.getAttribute("aria-expanded");
|
|
1333
|
+
if (s && s == "true") return;
|
|
1334
|
+
const n = this.activeHover ? 0 : ve(t, 0);
|
|
910
1335
|
this.activeHover && this.activeHover.close(), t.toggleDelayId = setTimeout(() => {
|
|
911
1336
|
t.id && t.open();
|
|
912
|
-
},
|
|
1337
|
+
}, n);
|
|
913
1338
|
}
|
|
914
|
-
function
|
|
1339
|
+
function xn(t, e) {
|
|
915
1340
|
setTimeout(() => {
|
|
916
|
-
t.isHovered = e, !t.isHovered && (t.toggleDelayId && clearTimeout(t.toggleDelayId), t.toggleDelayId = setTimeout(
|
|
917
|
-
|
|
918
|
-
|
|
1341
|
+
t.isHovered = e, !t.isHovered && (t.toggleDelayId && clearTimeout(t.toggleDelayId), t.toggleDelayId = setTimeout(
|
|
1342
|
+
() => {
|
|
1343
|
+
$e.call(this, t);
|
|
1344
|
+
},
|
|
1345
|
+
ve(t, 1)
|
|
1346
|
+
));
|
|
919
1347
|
}, 1);
|
|
920
1348
|
}
|
|
921
|
-
function
|
|
1349
|
+
function vn(t) {
|
|
922
1350
|
switch (t.key) {
|
|
923
1351
|
case "Escape":
|
|
924
|
-
this.trigger && this.trigger.focus(),
|
|
1352
|
+
this.trigger && this.trigger.focus(), Ce.call(this);
|
|
925
1353
|
return;
|
|
926
1354
|
case "Tab":
|
|
927
1355
|
this.collection.forEach((e) => {
|
|
928
|
-
|
|
1356
|
+
$e.call(this, e);
|
|
929
1357
|
});
|
|
930
1358
|
return;
|
|
931
1359
|
default:
|
|
932
1360
|
return;
|
|
933
1361
|
}
|
|
934
1362
|
}
|
|
935
|
-
function
|
|
1363
|
+
function En(t) {
|
|
936
1364
|
const e = this;
|
|
937
|
-
document.addEventListener("click", function
|
|
938
|
-
|
|
1365
|
+
document.addEventListener("click", function s(n) {
|
|
1366
|
+
n.target.closest(
|
|
939
1367
|
`#${t.id}, [aria-controls="${t.id}"], [aria-describedby="${t.id}"]`
|
|
940
|
-
) ? t.el && !t.el.classList.contains(e.settings.stateActive) && this.removeEventListener("click",
|
|
1368
|
+
) ? t.el && !t.el.classList.contains(e.settings.stateActive) && this.removeEventListener("click", s) : (t.el && t.el.classList.contains(e.settings.stateActive) && t.close(), this.removeEventListener("click", s));
|
|
941
1369
|
});
|
|
942
1370
|
}
|
|
943
|
-
var
|
|
944
|
-
class
|
|
945
|
-
constructor(
|
|
946
|
-
super(
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
this.state = "closed", this.toggleDelayId = null, this.trigger = null,
|
|
1371
|
+
var L, z;
|
|
1372
|
+
class Sn extends xt {
|
|
1373
|
+
constructor(s, n, i = {}) {
|
|
1374
|
+
super(s, n, i);
|
|
1375
|
+
U(this, L);
|
|
1376
|
+
U(this, z);
|
|
1377
|
+
this.state = "closed", this.toggleDelayId = null, this.trigger = null, S(this, L, null), S(this, z, {
|
|
950
1378
|
el: !1,
|
|
951
1379
|
trigger: !1
|
|
952
1380
|
}), this.floatingCleanup = () => {
|
|
@@ -956,153 +1384,159 @@ class di extends Ct {
|
|
|
956
1384
|
return !!this.el.closest(this.getSetting("selectorTooltip")) || this.el.getAttribute("role") == "tooltip";
|
|
957
1385
|
}
|
|
958
1386
|
get isHovered() {
|
|
959
|
-
return
|
|
1387
|
+
return E(this, z).el || E(this, z).trigger;
|
|
960
1388
|
}
|
|
961
|
-
set isHovered(
|
|
962
|
-
const
|
|
963
|
-
if (
|
|
964
|
-
switch (
|
|
1389
|
+
set isHovered(s) {
|
|
1390
|
+
const n = s.type == "mouseenter" ? !0 : s.type == "mouseleave" ? !1 : void 0;
|
|
1391
|
+
if (n != null)
|
|
1392
|
+
switch (s.target) {
|
|
965
1393
|
case this.el:
|
|
966
|
-
|
|
1394
|
+
E(this, z).el = n;
|
|
967
1395
|
break;
|
|
968
1396
|
case this.trigger:
|
|
969
|
-
|
|
1397
|
+
E(this, z).trigger = n;
|
|
970
1398
|
break;
|
|
971
1399
|
}
|
|
972
1400
|
}
|
|
973
1401
|
async open() {
|
|
974
|
-
return this.
|
|
1402
|
+
return this.parent.open(this);
|
|
975
1403
|
}
|
|
976
1404
|
async close() {
|
|
977
|
-
return this.
|
|
1405
|
+
return this.parent.close(this);
|
|
978
1406
|
}
|
|
979
1407
|
async deregister() {
|
|
980
|
-
return this.
|
|
1408
|
+
return this.parent.deregister(this.id);
|
|
981
1409
|
}
|
|
982
1410
|
registerEventListeners() {
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
1411
|
+
E(this, L) || (this.getSetting("event") === "hover" ? (S(this, L, [
|
|
1412
|
+
{
|
|
1413
|
+
el: ["el", "trigger"],
|
|
1414
|
+
type: ["mouseenter", "focus"],
|
|
1415
|
+
listener: bn.bind(this.parent, this)
|
|
1416
|
+
},
|
|
1417
|
+
{
|
|
1418
|
+
el: ["el", "trigger"],
|
|
1419
|
+
type: ["mouseleave", "focusout"],
|
|
1420
|
+
listener: xn.bind(this.parent, this)
|
|
1421
|
+
},
|
|
1422
|
+
{
|
|
1423
|
+
el: ["trigger"],
|
|
1424
|
+
type: ["click"],
|
|
1425
|
+
listener: wn.bind(this.parent, this)
|
|
1426
|
+
}
|
|
1427
|
+
]), E(this, L).forEach((n) => {
|
|
1428
|
+
n.el.forEach((i) => {
|
|
1429
|
+
n.type.forEach((r) => {
|
|
1430
|
+
this[i].addEventListener(r, n.listener, !1);
|
|
999
1431
|
});
|
|
1000
1432
|
});
|
|
1001
|
-
})) : (
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1433
|
+
})) : (S(this, L, [
|
|
1434
|
+
{
|
|
1435
|
+
el: ["trigger"],
|
|
1436
|
+
type: ["click"],
|
|
1437
|
+
listener: yn.bind(this.parent, this)
|
|
1438
|
+
}
|
|
1439
|
+
]), E(this, L).forEach((n) => {
|
|
1440
|
+
n.el.forEach((i) => {
|
|
1441
|
+
n.type.forEach((r) => {
|
|
1442
|
+
this[i].addEventListener(r, n.listener, !1);
|
|
1009
1443
|
});
|
|
1010
1444
|
});
|
|
1011
1445
|
})));
|
|
1012
1446
|
}
|
|
1013
1447
|
deregisterEventListeners() {
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
this[
|
|
1448
|
+
E(this, L) && (E(this, L).forEach((s) => {
|
|
1449
|
+
s.el.forEach((n) => {
|
|
1450
|
+
s.type.forEach((i) => {
|
|
1451
|
+
this[n].removeEventListener(i, s.listener, !1);
|
|
1018
1452
|
});
|
|
1019
1453
|
});
|
|
1020
|
-
}),
|
|
1454
|
+
}), S(this, L, null));
|
|
1021
1455
|
}
|
|
1022
|
-
async
|
|
1456
|
+
async onCreateEntry() {
|
|
1023
1457
|
this.trigger = document.querySelector(
|
|
1024
1458
|
`[aria-controls="${this.id}"], [aria-describedby="${this.id}"]`
|
|
1025
1459
|
), this.isTooltip ? (this.settings.event = "hover", this.el.setAttribute("role", "tooltip")) : this.trigger.setAttribute("aria-expanded", "false"), this.registerEventListeners();
|
|
1026
1460
|
}
|
|
1027
|
-
async
|
|
1461
|
+
async onRegisterEntry() {
|
|
1028
1462
|
this.el.classList.contains(this.getSetting("stateActive")) ? await this.open() : this.el.inert = !0;
|
|
1029
1463
|
}
|
|
1030
|
-
async
|
|
1464
|
+
async onDestroyEntry() {
|
|
1031
1465
|
this.state === "opened" && await this.close(), this.floatingCleanup(), this.deregisterEventListeners();
|
|
1032
1466
|
}
|
|
1033
1467
|
}
|
|
1034
|
-
|
|
1035
|
-
const
|
|
1468
|
+
L = new WeakMap(), z = new WeakMap();
|
|
1469
|
+
const ct = Math.min, Z = Math.max, Ct = Math.round, St = Math.floor, I = (t) => ({
|
|
1036
1470
|
x: t,
|
|
1037
1471
|
y: t
|
|
1038
|
-
}),
|
|
1472
|
+
}), Cn = {
|
|
1039
1473
|
left: "right",
|
|
1040
1474
|
right: "left",
|
|
1041
1475
|
bottom: "top",
|
|
1042
1476
|
top: "bottom"
|
|
1043
|
-
},
|
|
1477
|
+
}, $n = {
|
|
1044
1478
|
start: "end",
|
|
1045
1479
|
end: "start"
|
|
1046
1480
|
};
|
|
1047
|
-
function
|
|
1048
|
-
return Z(t,
|
|
1481
|
+
function Ft(t, e, s) {
|
|
1482
|
+
return Z(t, ct(e, s));
|
|
1049
1483
|
}
|
|
1050
|
-
function
|
|
1484
|
+
function tt(t, e) {
|
|
1051
1485
|
return typeof t == "function" ? t(e) : t;
|
|
1052
1486
|
}
|
|
1053
|
-
function
|
|
1487
|
+
function j(t) {
|
|
1054
1488
|
return t.split("-")[0];
|
|
1055
1489
|
}
|
|
1056
|
-
function
|
|
1490
|
+
function vt(t) {
|
|
1057
1491
|
return t.split("-")[1];
|
|
1058
1492
|
}
|
|
1059
|
-
function
|
|
1493
|
+
function _t(t) {
|
|
1060
1494
|
return t === "x" ? "y" : "x";
|
|
1061
1495
|
}
|
|
1062
|
-
function
|
|
1496
|
+
function Wt(t) {
|
|
1063
1497
|
return t === "y" ? "height" : "width";
|
|
1064
1498
|
}
|
|
1065
|
-
function
|
|
1066
|
-
return ["top", "bottom"].includes(
|
|
1499
|
+
function K(t) {
|
|
1500
|
+
return ["top", "bottom"].includes(j(t)) ? "y" : "x";
|
|
1067
1501
|
}
|
|
1068
|
-
function
|
|
1069
|
-
return
|
|
1502
|
+
function zt(t) {
|
|
1503
|
+
return _t(K(t));
|
|
1070
1504
|
}
|
|
1071
|
-
function
|
|
1072
|
-
|
|
1073
|
-
const
|
|
1074
|
-
let
|
|
1075
|
-
return e.reference[
|
|
1505
|
+
function An(t, e, s) {
|
|
1506
|
+
s === void 0 && (s = !1);
|
|
1507
|
+
const n = vt(t), i = zt(t), r = Wt(i);
|
|
1508
|
+
let o = i === "x" ? n === (s ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
|
|
1509
|
+
return e.reference[r] > e.floating[r] && (o = $t(o)), [o, $t(o)];
|
|
1076
1510
|
}
|
|
1077
|
-
function
|
|
1078
|
-
const e =
|
|
1079
|
-
return [
|
|
1511
|
+
function kn(t) {
|
|
1512
|
+
const e = $t(t);
|
|
1513
|
+
return [Ht(t), e, Ht(e)];
|
|
1080
1514
|
}
|
|
1081
|
-
function
|
|
1082
|
-
return t.replace(/start|end/g, (e) =>
|
|
1515
|
+
function Ht(t) {
|
|
1516
|
+
return t.replace(/start|end/g, (e) => $n[e]);
|
|
1083
1517
|
}
|
|
1084
|
-
function
|
|
1085
|
-
const
|
|
1518
|
+
function On(t, e, s) {
|
|
1519
|
+
const n = ["left", "right"], i = ["right", "left"], r = ["top", "bottom"], o = ["bottom", "top"];
|
|
1086
1520
|
switch (t) {
|
|
1087
1521
|
case "top":
|
|
1088
1522
|
case "bottom":
|
|
1089
|
-
return
|
|
1523
|
+
return s ? e ? i : n : e ? n : i;
|
|
1090
1524
|
case "left":
|
|
1091
1525
|
case "right":
|
|
1092
|
-
return e ?
|
|
1526
|
+
return e ? r : o;
|
|
1093
1527
|
default:
|
|
1094
1528
|
return [];
|
|
1095
1529
|
}
|
|
1096
1530
|
}
|
|
1097
|
-
function
|
|
1098
|
-
const
|
|
1099
|
-
let
|
|
1100
|
-
return
|
|
1531
|
+
function Ln(t, e, s, n) {
|
|
1532
|
+
const i = vt(t);
|
|
1533
|
+
let r = On(j(t), s === "start", n);
|
|
1534
|
+
return i && (r = r.map((o) => o + "-" + i), e && (r = r.concat(r.map(Ht)))), r;
|
|
1101
1535
|
}
|
|
1102
|
-
function
|
|
1103
|
-
return t.replace(/left|right|bottom|top/g, (e) =>
|
|
1536
|
+
function $t(t) {
|
|
1537
|
+
return t.replace(/left|right|bottom|top/g, (e) => Cn[e]);
|
|
1104
1538
|
}
|
|
1105
|
-
function
|
|
1539
|
+
function Rn(t) {
|
|
1106
1540
|
return {
|
|
1107
1541
|
top: 0,
|
|
1108
1542
|
right: 0,
|
|
@@ -1112,292 +1546,296 @@ function yi(t) {
|
|
|
1112
1546
|
};
|
|
1113
1547
|
}
|
|
1114
1548
|
function Ae(t) {
|
|
1115
|
-
return typeof t != "number" ?
|
|
1549
|
+
return typeof t != "number" ? Rn(t) : {
|
|
1116
1550
|
top: t,
|
|
1117
1551
|
right: t,
|
|
1118
1552
|
bottom: t,
|
|
1119
1553
|
left: t
|
|
1120
1554
|
};
|
|
1121
1555
|
}
|
|
1122
|
-
function
|
|
1556
|
+
function At(t) {
|
|
1123
1557
|
const {
|
|
1124
1558
|
x: e,
|
|
1125
|
-
y:
|
|
1126
|
-
width:
|
|
1127
|
-
height:
|
|
1559
|
+
y: s,
|
|
1560
|
+
width: n,
|
|
1561
|
+
height: i
|
|
1128
1562
|
} = t;
|
|
1129
1563
|
return {
|
|
1130
|
-
width:
|
|
1131
|
-
height:
|
|
1132
|
-
top:
|
|
1564
|
+
width: n,
|
|
1565
|
+
height: i,
|
|
1566
|
+
top: s,
|
|
1133
1567
|
left: e,
|
|
1134
|
-
right: e +
|
|
1135
|
-
bottom:
|
|
1568
|
+
right: e + n,
|
|
1569
|
+
bottom: s + i,
|
|
1136
1570
|
x: e,
|
|
1137
|
-
y:
|
|
1571
|
+
y: s
|
|
1138
1572
|
};
|
|
1139
1573
|
}
|
|
1140
|
-
function
|
|
1574
|
+
function Zt(t, e, s) {
|
|
1141
1575
|
let {
|
|
1142
|
-
reference:
|
|
1143
|
-
floating:
|
|
1576
|
+
reference: n,
|
|
1577
|
+
floating: i
|
|
1144
1578
|
} = t;
|
|
1145
|
-
const
|
|
1146
|
-
let
|
|
1579
|
+
const r = K(e), o = zt(e), l = Wt(o), a = j(e), c = r === "y", d = n.x + n.width / 2 - i.width / 2, f = n.y + n.height / 2 - i.height / 2, h = n[l] / 2 - i[l] / 2;
|
|
1580
|
+
let u;
|
|
1147
1581
|
switch (a) {
|
|
1148
1582
|
case "top":
|
|
1149
|
-
|
|
1583
|
+
u = {
|
|
1150
1584
|
x: d,
|
|
1151
|
-
y:
|
|
1585
|
+
y: n.y - i.height
|
|
1152
1586
|
};
|
|
1153
1587
|
break;
|
|
1154
1588
|
case "bottom":
|
|
1155
|
-
|
|
1589
|
+
u = {
|
|
1156
1590
|
x: d,
|
|
1157
|
-
y:
|
|
1591
|
+
y: n.y + n.height
|
|
1158
1592
|
};
|
|
1159
1593
|
break;
|
|
1160
1594
|
case "right":
|
|
1161
|
-
|
|
1162
|
-
x:
|
|
1163
|
-
y:
|
|
1595
|
+
u = {
|
|
1596
|
+
x: n.x + n.width,
|
|
1597
|
+
y: f
|
|
1164
1598
|
};
|
|
1165
1599
|
break;
|
|
1166
1600
|
case "left":
|
|
1167
|
-
|
|
1168
|
-
x:
|
|
1169
|
-
y:
|
|
1601
|
+
u = {
|
|
1602
|
+
x: n.x - i.width,
|
|
1603
|
+
y: f
|
|
1170
1604
|
};
|
|
1171
1605
|
break;
|
|
1172
1606
|
default:
|
|
1173
|
-
|
|
1174
|
-
x:
|
|
1175
|
-
y:
|
|
1607
|
+
u = {
|
|
1608
|
+
x: n.x,
|
|
1609
|
+
y: n.y
|
|
1176
1610
|
};
|
|
1177
1611
|
}
|
|
1178
|
-
switch (
|
|
1612
|
+
switch (vt(e)) {
|
|
1179
1613
|
case "start":
|
|
1180
|
-
|
|
1614
|
+
u[o] -= h * (s && c ? -1 : 1);
|
|
1181
1615
|
break;
|
|
1182
1616
|
case "end":
|
|
1183
|
-
|
|
1617
|
+
u[o] += h * (s && c ? -1 : 1);
|
|
1184
1618
|
break;
|
|
1185
1619
|
}
|
|
1186
|
-
return
|
|
1620
|
+
return u;
|
|
1187
1621
|
}
|
|
1188
|
-
const
|
|
1622
|
+
const Pn = async (t, e, s) => {
|
|
1189
1623
|
const {
|
|
1190
|
-
placement:
|
|
1191
|
-
strategy:
|
|
1192
|
-
middleware:
|
|
1193
|
-
platform:
|
|
1194
|
-
} =
|
|
1195
|
-
let c = await
|
|
1624
|
+
placement: n = "bottom",
|
|
1625
|
+
strategy: i = "absolute",
|
|
1626
|
+
middleware: r = [],
|
|
1627
|
+
platform: o
|
|
1628
|
+
} = s, l = r.filter(Boolean), a = await (o.isRTL == null ? void 0 : o.isRTL(e));
|
|
1629
|
+
let c = await o.getElementRects({
|
|
1196
1630
|
reference: t,
|
|
1197
1631
|
floating: e,
|
|
1198
|
-
strategy:
|
|
1632
|
+
strategy: i
|
|
1199
1633
|
}), {
|
|
1200
1634
|
x: d,
|
|
1201
|
-
y:
|
|
1202
|
-
} =
|
|
1635
|
+
y: f
|
|
1636
|
+
} = Zt(c, n, a), h = n, u = {}, g = 0;
|
|
1203
1637
|
for (let m = 0; m < l.length; m++) {
|
|
1204
1638
|
const {
|
|
1205
|
-
name:
|
|
1206
|
-
fn:
|
|
1639
|
+
name: p,
|
|
1640
|
+
fn: y
|
|
1207
1641
|
} = l[m], {
|
|
1208
|
-
x:
|
|
1209
|
-
y:
|
|
1210
|
-
data:
|
|
1211
|
-
reset:
|
|
1212
|
-
} = await
|
|
1642
|
+
x: w,
|
|
1643
|
+
y: b,
|
|
1644
|
+
data: v,
|
|
1645
|
+
reset: x
|
|
1646
|
+
} = await y({
|
|
1213
1647
|
x: d,
|
|
1214
|
-
y:
|
|
1215
|
-
initialPlacement:
|
|
1648
|
+
y: f,
|
|
1649
|
+
initialPlacement: n,
|
|
1216
1650
|
placement: h,
|
|
1217
|
-
strategy:
|
|
1218
|
-
middlewareData:
|
|
1651
|
+
strategy: i,
|
|
1652
|
+
middlewareData: u,
|
|
1219
1653
|
rects: c,
|
|
1220
|
-
platform:
|
|
1654
|
+
platform: o,
|
|
1221
1655
|
elements: {
|
|
1222
1656
|
reference: t,
|
|
1223
1657
|
floating: e
|
|
1224
1658
|
}
|
|
1225
1659
|
});
|
|
1226
|
-
d =
|
|
1227
|
-
...
|
|
1228
|
-
[
|
|
1229
|
-
...
|
|
1230
|
-
...
|
|
1660
|
+
d = w ?? d, f = b ?? f, u = {
|
|
1661
|
+
...u,
|
|
1662
|
+
[p]: {
|
|
1663
|
+
...u[p],
|
|
1664
|
+
...v
|
|
1231
1665
|
}
|
|
1232
|
-
},
|
|
1666
|
+
}, x && g <= 50 && (g++, typeof x == "object" && (x.placement && (h = x.placement), x.rects && (c = x.rects === !0 ? await o.getElementRects({
|
|
1233
1667
|
reference: t,
|
|
1234
1668
|
floating: e,
|
|
1235
|
-
strategy:
|
|
1236
|
-
}) :
|
|
1669
|
+
strategy: i
|
|
1670
|
+
}) : x.rects), {
|
|
1237
1671
|
x: d,
|
|
1238
|
-
y:
|
|
1239
|
-
} =
|
|
1672
|
+
y: f
|
|
1673
|
+
} = Zt(c, h, a)), m = -1);
|
|
1240
1674
|
}
|
|
1241
1675
|
return {
|
|
1242
1676
|
x: d,
|
|
1243
|
-
y:
|
|
1677
|
+
y: f,
|
|
1244
1678
|
placement: h,
|
|
1245
|
-
strategy:
|
|
1246
|
-
middlewareData:
|
|
1679
|
+
strategy: i,
|
|
1680
|
+
middlewareData: u
|
|
1247
1681
|
};
|
|
1248
1682
|
};
|
|
1249
|
-
async function
|
|
1250
|
-
var
|
|
1683
|
+
async function ke(t, e) {
|
|
1684
|
+
var s;
|
|
1251
1685
|
e === void 0 && (e = {});
|
|
1252
1686
|
const {
|
|
1253
|
-
x:
|
|
1254
|
-
y:
|
|
1255
|
-
platform:
|
|
1256
|
-
rects:
|
|
1687
|
+
x: n,
|
|
1688
|
+
y: i,
|
|
1689
|
+
platform: r,
|
|
1690
|
+
rects: o,
|
|
1257
1691
|
elements: l,
|
|
1258
1692
|
strategy: a
|
|
1259
1693
|
} = t, {
|
|
1260
1694
|
boundary: c = "clippingAncestors",
|
|
1261
1695
|
rootBoundary: d = "viewport",
|
|
1262
|
-
elementContext:
|
|
1696
|
+
elementContext: f = "floating",
|
|
1263
1697
|
altBoundary: h = !1,
|
|
1264
|
-
padding:
|
|
1265
|
-
} =
|
|
1266
|
-
element: (
|
|
1698
|
+
padding: u = 0
|
|
1699
|
+
} = tt(e, t), g = Ae(u), p = l[h ? f === "floating" ? "reference" : "floating" : f], y = At(await r.getClippingRect({
|
|
1700
|
+
element: (s = await (r.isElement == null ? void 0 : r.isElement(p))) == null || s ? p : p.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(l.floating)),
|
|
1267
1701
|
boundary: c,
|
|
1268
1702
|
rootBoundary: d,
|
|
1269
1703
|
strategy: a
|
|
1270
|
-
})),
|
|
1271
|
-
x:
|
|
1272
|
-
y:
|
|
1273
|
-
width:
|
|
1274
|
-
height:
|
|
1275
|
-
} :
|
|
1704
|
+
})), w = f === "floating" ? {
|
|
1705
|
+
x: n,
|
|
1706
|
+
y: i,
|
|
1707
|
+
width: o.floating.width,
|
|
1708
|
+
height: o.floating.height
|
|
1709
|
+
} : o.reference, b = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(l.floating)), v = await (r.isElement == null ? void 0 : r.isElement(b)) ? await (r.getScale == null ? void 0 : r.getScale(b)) || {
|
|
1276
1710
|
x: 1,
|
|
1277
1711
|
y: 1
|
|
1278
1712
|
} : {
|
|
1279
1713
|
x: 1,
|
|
1280
1714
|
y: 1
|
|
1281
|
-
},
|
|
1715
|
+
}, x = At(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
1282
1716
|
elements: l,
|
|
1283
|
-
rect:
|
|
1284
|
-
offsetParent:
|
|
1717
|
+
rect: w,
|
|
1718
|
+
offsetParent: b,
|
|
1285
1719
|
strategy: a
|
|
1286
|
-
}) :
|
|
1720
|
+
}) : w);
|
|
1287
1721
|
return {
|
|
1288
|
-
top: (
|
|
1289
|
-
bottom: (
|
|
1290
|
-
left: (
|
|
1291
|
-
right: (
|
|
1722
|
+
top: (y.top - x.top + g.top) / v.y,
|
|
1723
|
+
bottom: (x.bottom - y.bottom + g.bottom) / v.y,
|
|
1724
|
+
left: (y.left - x.left + g.left) / v.x,
|
|
1725
|
+
right: (x.right - y.right + g.right) / v.x
|
|
1292
1726
|
};
|
|
1293
1727
|
}
|
|
1294
|
-
const
|
|
1728
|
+
const Tn = (t) => ({
|
|
1295
1729
|
name: "arrow",
|
|
1296
1730
|
options: t,
|
|
1297
1731
|
async fn(e) {
|
|
1298
1732
|
const {
|
|
1299
|
-
x:
|
|
1300
|
-
y:
|
|
1301
|
-
placement:
|
|
1302
|
-
rects:
|
|
1303
|
-
platform:
|
|
1733
|
+
x: s,
|
|
1734
|
+
y: n,
|
|
1735
|
+
placement: i,
|
|
1736
|
+
rects: r,
|
|
1737
|
+
platform: o,
|
|
1304
1738
|
elements: l,
|
|
1305
1739
|
middlewareData: a
|
|
1306
1740
|
} = e, {
|
|
1307
1741
|
element: c,
|
|
1308
1742
|
padding: d = 0
|
|
1309
|
-
} =
|
|
1743
|
+
} = tt(t, e) || {};
|
|
1310
1744
|
if (c == null)
|
|
1311
1745
|
return {};
|
|
1312
|
-
const
|
|
1313
|
-
x:
|
|
1314
|
-
y:
|
|
1315
|
-
},
|
|
1316
|
-
let
|
|
1317
|
-
(!
|
|
1318
|
-
const
|
|
1746
|
+
const f = Ae(d), h = {
|
|
1747
|
+
x: s,
|
|
1748
|
+
y: n
|
|
1749
|
+
}, u = zt(i), g = Wt(u), m = await o.getDimensions(c), p = u === "y", y = p ? "top" : "left", w = p ? "bottom" : "right", b = p ? "clientHeight" : "clientWidth", v = r.reference[g] + r.reference[u] - h[u] - r.floating[g], x = h[u] - r.reference[u], k = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c));
|
|
1750
|
+
let O = k ? k[b] : 0;
|
|
1751
|
+
(!O || !await (o.isElement == null ? void 0 : o.isElement(k))) && (O = l.floating[b] || r.floating[g]);
|
|
1752
|
+
const dt = v / 2 - x / 2, J = O / 2 - m[g] / 2 - 1, N = ct(f[y], J), ht = ct(f[w], J), X = N, gt = O - m[g] - ht, M = O / 2 - m[g] / 2 + dt, R = Ft(X, M, gt), G = !a.arrow && vt(i) != null && M !== R && r.reference[g] / 2 - (M < X ? N : ht) - m[g] / 2 < 0, B = G ? M < X ? M - X : M - gt : 0;
|
|
1319
1753
|
return {
|
|
1320
|
-
[
|
|
1754
|
+
[u]: h[u] + B,
|
|
1321
1755
|
data: {
|
|
1322
|
-
[
|
|
1323
|
-
centerOffset:
|
|
1324
|
-
...
|
|
1325
|
-
alignmentOffset:
|
|
1756
|
+
[u]: R,
|
|
1757
|
+
centerOffset: M - R - B,
|
|
1758
|
+
...G && {
|
|
1759
|
+
alignmentOffset: B
|
|
1326
1760
|
}
|
|
1327
1761
|
},
|
|
1328
|
-
reset:
|
|
1762
|
+
reset: G
|
|
1329
1763
|
};
|
|
1330
1764
|
}
|
|
1331
|
-
}),
|
|
1765
|
+
}), Mn = function(t) {
|
|
1332
1766
|
return t === void 0 && (t = {}), {
|
|
1333
1767
|
name: "flip",
|
|
1334
1768
|
options: t,
|
|
1335
1769
|
async fn(e) {
|
|
1336
|
-
var
|
|
1770
|
+
var s, n;
|
|
1337
1771
|
const {
|
|
1338
|
-
placement:
|
|
1339
|
-
middlewareData:
|
|
1340
|
-
rects:
|
|
1772
|
+
placement: i,
|
|
1773
|
+
middlewareData: r,
|
|
1774
|
+
rects: o,
|
|
1341
1775
|
initialPlacement: l,
|
|
1342
1776
|
platform: a,
|
|
1343
1777
|
elements: c
|
|
1344
1778
|
} = e, {
|
|
1345
1779
|
mainAxis: d = !0,
|
|
1346
|
-
crossAxis:
|
|
1780
|
+
crossAxis: f = !0,
|
|
1347
1781
|
fallbackPlacements: h,
|
|
1348
|
-
fallbackStrategy:
|
|
1782
|
+
fallbackStrategy: u = "bestFit",
|
|
1349
1783
|
fallbackAxisSideDirection: g = "none",
|
|
1350
1784
|
flipAlignment: m = !0,
|
|
1351
|
-
...
|
|
1352
|
-
} =
|
|
1353
|
-
if ((
|
|
1785
|
+
...p
|
|
1786
|
+
} = tt(t, e);
|
|
1787
|
+
if ((s = r.arrow) != null && s.alignmentOffset)
|
|
1354
1788
|
return {};
|
|
1355
|
-
const
|
|
1356
|
-
!h && k &&
|
|
1357
|
-
const
|
|
1358
|
-
let
|
|
1359
|
-
if (d &&
|
|
1360
|
-
const
|
|
1361
|
-
|
|
1789
|
+
const y = j(i), w = K(l), b = j(l) === l, v = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), x = h || (b || !m ? [$t(l)] : kn(l)), k = g !== "none";
|
|
1790
|
+
!h && k && x.push(...Ln(l, m, g, v));
|
|
1791
|
+
const O = [l, ...x], dt = await ke(e, p), J = [];
|
|
1792
|
+
let N = ((n = r.flip) == null ? void 0 : n.overflows) || [];
|
|
1793
|
+
if (d && J.push(dt[y]), f) {
|
|
1794
|
+
const R = An(i, o, v);
|
|
1795
|
+
J.push(dt[R[0]], dt[R[1]]);
|
|
1362
1796
|
}
|
|
1363
|
-
if (
|
|
1364
|
-
placement:
|
|
1365
|
-
overflows:
|
|
1366
|
-
}], !
|
|
1367
|
-
var
|
|
1368
|
-
const
|
|
1369
|
-
if (
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1797
|
+
if (N = [...N, {
|
|
1798
|
+
placement: i,
|
|
1799
|
+
overflows: J
|
|
1800
|
+
}], !J.every((R) => R <= 0)) {
|
|
1801
|
+
var ht, X;
|
|
1802
|
+
const R = (((ht = r.flip) == null ? void 0 : ht.index) || 0) + 1, G = O[R];
|
|
1803
|
+
if (G) {
|
|
1804
|
+
var gt;
|
|
1805
|
+
const _ = f === "alignment" ? w !== K(G) : !1, D = ((gt = N[0]) == null ? void 0 : gt.overflows[0]) > 0;
|
|
1806
|
+
if (!_ || D)
|
|
1807
|
+
return {
|
|
1808
|
+
data: {
|
|
1809
|
+
index: R,
|
|
1810
|
+
overflows: N
|
|
1811
|
+
},
|
|
1812
|
+
reset: {
|
|
1813
|
+
placement: G
|
|
1814
|
+
}
|
|
1815
|
+
};
|
|
1816
|
+
}
|
|
1817
|
+
let B = (X = N.filter((_) => _.overflows[0] <= 0).sort((_, D) => _.overflows[1] - D.overflows[1])[0]) == null ? void 0 : X.placement;
|
|
1380
1818
|
if (!B)
|
|
1381
|
-
switch (
|
|
1819
|
+
switch (u) {
|
|
1382
1820
|
case "bestFit": {
|
|
1383
|
-
var
|
|
1384
|
-
const
|
|
1821
|
+
var M;
|
|
1822
|
+
const _ = (M = N.filter((D) => {
|
|
1385
1823
|
if (k) {
|
|
1386
|
-
const
|
|
1387
|
-
return
|
|
1824
|
+
const W = K(D.placement);
|
|
1825
|
+
return W === w || // Create a bias to the `y` side axis due to horizontal
|
|
1388
1826
|
// reading directions favoring greater width.
|
|
1389
|
-
|
|
1827
|
+
W === "y";
|
|
1390
1828
|
}
|
|
1391
1829
|
return !0;
|
|
1392
|
-
}).map((
|
|
1393
|
-
|
|
1830
|
+
}).map((D) => [D.placement, D.overflows.filter((W) => W > 0).reduce((W, Fe) => W + Fe, 0)]).sort((D, W) => D[1] - W[1])[0]) == null ? void 0 : M[0];
|
|
1831
|
+
_ && (B = _);
|
|
1394
1832
|
break;
|
|
1395
1833
|
}
|
|
1396
1834
|
case "initialPlacement":
|
|
1397
1835
|
B = l;
|
|
1398
1836
|
break;
|
|
1399
1837
|
}
|
|
1400
|
-
if (
|
|
1838
|
+
if (i !== B)
|
|
1401
1839
|
return {
|
|
1402
1840
|
reset: {
|
|
1403
1841
|
placement: B
|
|
@@ -1408,131 +1846,131 @@ const vi = (t) => ({
|
|
|
1408
1846
|
}
|
|
1409
1847
|
};
|
|
1410
1848
|
};
|
|
1411
|
-
async function
|
|
1849
|
+
async function Dn(t, e) {
|
|
1412
1850
|
const {
|
|
1413
|
-
placement:
|
|
1414
|
-
platform:
|
|
1415
|
-
elements:
|
|
1416
|
-
} = t,
|
|
1851
|
+
placement: s,
|
|
1852
|
+
platform: n,
|
|
1853
|
+
elements: i
|
|
1854
|
+
} = t, r = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), o = j(s), l = vt(s), a = K(s) === "y", c = ["left", "top"].includes(o) ? -1 : 1, d = r && a ? -1 : 1, f = tt(e, t);
|
|
1417
1855
|
let {
|
|
1418
1856
|
mainAxis: h,
|
|
1419
|
-
crossAxis:
|
|
1857
|
+
crossAxis: u,
|
|
1420
1858
|
alignmentAxis: g
|
|
1421
|
-
} = typeof
|
|
1422
|
-
mainAxis:
|
|
1859
|
+
} = typeof f == "number" ? {
|
|
1860
|
+
mainAxis: f,
|
|
1423
1861
|
crossAxis: 0,
|
|
1424
1862
|
alignmentAxis: null
|
|
1425
1863
|
} : {
|
|
1426
|
-
mainAxis:
|
|
1427
|
-
crossAxis:
|
|
1428
|
-
alignmentAxis:
|
|
1864
|
+
mainAxis: f.mainAxis || 0,
|
|
1865
|
+
crossAxis: f.crossAxis || 0,
|
|
1866
|
+
alignmentAxis: f.alignmentAxis
|
|
1429
1867
|
};
|
|
1430
|
-
return l && typeof g == "number" && (
|
|
1431
|
-
x:
|
|
1868
|
+
return l && typeof g == "number" && (u = l === "end" ? g * -1 : g), a ? {
|
|
1869
|
+
x: u * d,
|
|
1432
1870
|
y: h * c
|
|
1433
1871
|
} : {
|
|
1434
1872
|
x: h * c,
|
|
1435
|
-
y:
|
|
1873
|
+
y: u * d
|
|
1436
1874
|
};
|
|
1437
1875
|
}
|
|
1438
|
-
const
|
|
1876
|
+
const In = function(t) {
|
|
1439
1877
|
return t === void 0 && (t = 0), {
|
|
1440
1878
|
name: "offset",
|
|
1441
1879
|
options: t,
|
|
1442
1880
|
async fn(e) {
|
|
1443
|
-
var
|
|
1881
|
+
var s, n;
|
|
1444
1882
|
const {
|
|
1445
|
-
x:
|
|
1446
|
-
y:
|
|
1447
|
-
placement:
|
|
1883
|
+
x: i,
|
|
1884
|
+
y: r,
|
|
1885
|
+
placement: o,
|
|
1448
1886
|
middlewareData: l
|
|
1449
|
-
} = e, a = await
|
|
1450
|
-
return
|
|
1451
|
-
x:
|
|
1452
|
-
y:
|
|
1887
|
+
} = e, a = await Dn(e, t);
|
|
1888
|
+
return o === ((s = l.offset) == null ? void 0 : s.placement) && (n = l.arrow) != null && n.alignmentOffset ? {} : {
|
|
1889
|
+
x: i + a.x,
|
|
1890
|
+
y: r + a.y,
|
|
1453
1891
|
data: {
|
|
1454
1892
|
...a,
|
|
1455
|
-
placement:
|
|
1893
|
+
placement: o
|
|
1456
1894
|
}
|
|
1457
1895
|
};
|
|
1458
1896
|
}
|
|
1459
1897
|
};
|
|
1460
|
-
},
|
|
1898
|
+
}, Fn = function(t) {
|
|
1461
1899
|
return t === void 0 && (t = {}), {
|
|
1462
1900
|
name: "shift",
|
|
1463
1901
|
options: t,
|
|
1464
1902
|
async fn(e) {
|
|
1465
1903
|
const {
|
|
1466
|
-
x:
|
|
1467
|
-
y:
|
|
1468
|
-
placement:
|
|
1904
|
+
x: s,
|
|
1905
|
+
y: n,
|
|
1906
|
+
placement: i
|
|
1469
1907
|
} = e, {
|
|
1470
|
-
mainAxis:
|
|
1471
|
-
crossAxis:
|
|
1908
|
+
mainAxis: r = !0,
|
|
1909
|
+
crossAxis: o = !1,
|
|
1472
1910
|
limiter: l = {
|
|
1473
|
-
fn: (
|
|
1911
|
+
fn: (p) => {
|
|
1474
1912
|
let {
|
|
1475
|
-
x:
|
|
1476
|
-
y
|
|
1477
|
-
} =
|
|
1913
|
+
x: y,
|
|
1914
|
+
y: w
|
|
1915
|
+
} = p;
|
|
1478
1916
|
return {
|
|
1479
|
-
x:
|
|
1480
|
-
y
|
|
1917
|
+
x: y,
|
|
1918
|
+
y: w
|
|
1481
1919
|
};
|
|
1482
1920
|
}
|
|
1483
1921
|
},
|
|
1484
1922
|
...a
|
|
1485
|
-
} =
|
|
1486
|
-
x:
|
|
1487
|
-
y:
|
|
1488
|
-
}, d = await
|
|
1489
|
-
let
|
|
1490
|
-
if (o) {
|
|
1491
|
-
const b = h === "y" ? "top" : "left", p = h === "y" ? "bottom" : "right", y = f + d[b], x = f - d[p];
|
|
1492
|
-
f = _t(y, f, x);
|
|
1493
|
-
}
|
|
1923
|
+
} = tt(t, e), c = {
|
|
1924
|
+
x: s,
|
|
1925
|
+
y: n
|
|
1926
|
+
}, d = await ke(e, a), f = K(j(i)), h = _t(f);
|
|
1927
|
+
let u = c[h], g = c[f];
|
|
1494
1928
|
if (r) {
|
|
1495
|
-
const
|
|
1496
|
-
|
|
1929
|
+
const p = h === "y" ? "top" : "left", y = h === "y" ? "bottom" : "right", w = u + d[p], b = u - d[y];
|
|
1930
|
+
u = Ft(w, u, b);
|
|
1931
|
+
}
|
|
1932
|
+
if (o) {
|
|
1933
|
+
const p = f === "y" ? "top" : "left", y = f === "y" ? "bottom" : "right", w = g + d[p], b = g - d[y];
|
|
1934
|
+
g = Ft(w, g, b);
|
|
1497
1935
|
}
|
|
1498
1936
|
const m = l.fn({
|
|
1499
1937
|
...e,
|
|
1500
|
-
[h]:
|
|
1501
|
-
[
|
|
1938
|
+
[h]: u,
|
|
1939
|
+
[f]: g
|
|
1502
1940
|
});
|
|
1503
1941
|
return {
|
|
1504
1942
|
...m,
|
|
1505
1943
|
data: {
|
|
1506
|
-
x: m.x -
|
|
1507
|
-
y: m.y -
|
|
1944
|
+
x: m.x - s,
|
|
1945
|
+
y: m.y - n,
|
|
1508
1946
|
enabled: {
|
|
1509
|
-
[h]:
|
|
1510
|
-
[
|
|
1947
|
+
[h]: r,
|
|
1948
|
+
[f]: o
|
|
1511
1949
|
}
|
|
1512
1950
|
}
|
|
1513
1951
|
};
|
|
1514
1952
|
}
|
|
1515
1953
|
};
|
|
1516
|
-
},
|
|
1954
|
+
}, Hn = function(t) {
|
|
1517
1955
|
return t === void 0 && (t = {}), {
|
|
1518
1956
|
options: t,
|
|
1519
1957
|
fn(e) {
|
|
1520
1958
|
const {
|
|
1521
|
-
x:
|
|
1522
|
-
y:
|
|
1523
|
-
placement:
|
|
1524
|
-
rects:
|
|
1525
|
-
middlewareData:
|
|
1959
|
+
x: s,
|
|
1960
|
+
y: n,
|
|
1961
|
+
placement: i,
|
|
1962
|
+
rects: r,
|
|
1963
|
+
middlewareData: o
|
|
1526
1964
|
} = e, {
|
|
1527
1965
|
offset: l = 0,
|
|
1528
1966
|
mainAxis: a = !0,
|
|
1529
1967
|
crossAxis: c = !0
|
|
1530
|
-
} =
|
|
1531
|
-
x:
|
|
1532
|
-
y:
|
|
1533
|
-
},
|
|
1534
|
-
let
|
|
1535
|
-
const m =
|
|
1968
|
+
} = tt(t, e), d = {
|
|
1969
|
+
x: s,
|
|
1970
|
+
y: n
|
|
1971
|
+
}, f = K(i), h = _t(f);
|
|
1972
|
+
let u = d[h], g = d[f];
|
|
1973
|
+
const m = tt(l, e), p = typeof m == "number" ? {
|
|
1536
1974
|
mainAxis: m,
|
|
1537
1975
|
crossAxis: 0
|
|
1538
1976
|
} : {
|
|
@@ -1541,60 +1979,60 @@ const Ci = function(t) {
|
|
|
1541
1979
|
...m
|
|
1542
1980
|
};
|
|
1543
1981
|
if (a) {
|
|
1544
|
-
const
|
|
1545
|
-
|
|
1982
|
+
const b = h === "y" ? "height" : "width", v = r.reference[h] - r.floating[b] + p.mainAxis, x = r.reference[h] + r.reference[b] - p.mainAxis;
|
|
1983
|
+
u < v ? u = v : u > x && (u = x);
|
|
1546
1984
|
}
|
|
1547
1985
|
if (c) {
|
|
1548
|
-
var
|
|
1549
|
-
const
|
|
1550
|
-
g <
|
|
1986
|
+
var y, w;
|
|
1987
|
+
const b = h === "y" ? "width" : "height", v = ["top", "left"].includes(j(i)), x = r.reference[f] - r.floating[b] + (v && ((y = o.offset) == null ? void 0 : y[f]) || 0) + (v ? 0 : p.crossAxis), k = r.reference[f] + r.reference[b] + (v ? 0 : ((w = o.offset) == null ? void 0 : w[f]) || 0) - (v ? p.crossAxis : 0);
|
|
1988
|
+
g < x ? g = x : g > k && (g = k);
|
|
1551
1989
|
}
|
|
1552
1990
|
return {
|
|
1553
|
-
[h]:
|
|
1554
|
-
[
|
|
1991
|
+
[h]: u,
|
|
1992
|
+
[f]: g
|
|
1555
1993
|
};
|
|
1556
1994
|
}
|
|
1557
1995
|
};
|
|
1558
1996
|
};
|
|
1559
|
-
function
|
|
1997
|
+
function Rt() {
|
|
1560
1998
|
return typeof window < "u";
|
|
1561
1999
|
}
|
|
1562
|
-
function
|
|
1563
|
-
return
|
|
2000
|
+
function ut(t) {
|
|
2001
|
+
return Oe(t) ? (t.nodeName || "").toLowerCase() : "#document";
|
|
1564
2002
|
}
|
|
1565
|
-
function
|
|
2003
|
+
function A(t) {
|
|
1566
2004
|
var e;
|
|
1567
2005
|
return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
1568
2006
|
}
|
|
1569
|
-
function
|
|
2007
|
+
function H(t) {
|
|
1570
2008
|
var e;
|
|
1571
|
-
return (e = (
|
|
2009
|
+
return (e = (Oe(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
1572
2010
|
}
|
|
1573
|
-
function
|
|
1574
|
-
return
|
|
2011
|
+
function Oe(t) {
|
|
2012
|
+
return Rt() ? t instanceof Node || t instanceof A(t).Node : !1;
|
|
1575
2013
|
}
|
|
1576
|
-
function
|
|
1577
|
-
return
|
|
2014
|
+
function P(t) {
|
|
2015
|
+
return Rt() ? t instanceof Element || t instanceof A(t).Element : !1;
|
|
1578
2016
|
}
|
|
1579
|
-
function
|
|
1580
|
-
return
|
|
2017
|
+
function F(t) {
|
|
2018
|
+
return Rt() ? t instanceof HTMLElement || t instanceof A(t).HTMLElement : !1;
|
|
1581
2019
|
}
|
|
1582
|
-
function
|
|
1583
|
-
return !
|
|
2020
|
+
function te(t) {
|
|
2021
|
+
return !Rt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof A(t).ShadowRoot;
|
|
1584
2022
|
}
|
|
1585
|
-
function
|
|
2023
|
+
function Et(t) {
|
|
1586
2024
|
const {
|
|
1587
2025
|
overflow: e,
|
|
1588
|
-
overflowX:
|
|
1589
|
-
overflowY:
|
|
1590
|
-
display:
|
|
1591
|
-
} =
|
|
1592
|
-
return /auto|scroll|overlay|hidden|clip/.test(e +
|
|
2026
|
+
overflowX: s,
|
|
2027
|
+
overflowY: n,
|
|
2028
|
+
display: i
|
|
2029
|
+
} = T(t);
|
|
2030
|
+
return /auto|scroll|overlay|hidden|clip/.test(e + n + s) && !["inline", "contents"].includes(i);
|
|
1593
2031
|
}
|
|
1594
|
-
function
|
|
1595
|
-
return ["table", "td", "th"].includes(
|
|
2032
|
+
function Nn(t) {
|
|
2033
|
+
return ["table", "td", "th"].includes(ut(t));
|
|
1596
2034
|
}
|
|
1597
|
-
function
|
|
2035
|
+
function Pt(t) {
|
|
1598
2036
|
return [":popover-open", ":modal"].some((e) => {
|
|
1599
2037
|
try {
|
|
1600
2038
|
return t.matches(e);
|
|
@@ -1603,32 +2041,32 @@ function Ft(t) {
|
|
|
1603
2041
|
}
|
|
1604
2042
|
});
|
|
1605
2043
|
}
|
|
1606
|
-
function
|
|
1607
|
-
const e =
|
|
1608
|
-
return
|
|
2044
|
+
function Qt(t) {
|
|
2045
|
+
const e = Kt(), s = P(t) ? T(t) : t;
|
|
2046
|
+
return ["transform", "translate", "scale", "rotate", "perspective"].some((n) => s[n] ? s[n] !== "none" : !1) || (s.containerType ? s.containerType !== "normal" : !1) || !e && (s.backdropFilter ? s.backdropFilter !== "none" : !1) || !e && (s.filter ? s.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((n) => (s.willChange || "").includes(n)) || ["paint", "layout", "strict", "content"].some((n) => (s.contain || "").includes(n));
|
|
1609
2047
|
}
|
|
1610
|
-
function
|
|
1611
|
-
let e =
|
|
1612
|
-
for (;
|
|
1613
|
-
if (
|
|
2048
|
+
function Bn(t) {
|
|
2049
|
+
let e = Y(t);
|
|
2050
|
+
for (; F(e) && !ft(e); ) {
|
|
2051
|
+
if (Qt(e))
|
|
1614
2052
|
return e;
|
|
1615
|
-
if (
|
|
2053
|
+
if (Pt(e))
|
|
1616
2054
|
return null;
|
|
1617
|
-
e =
|
|
2055
|
+
e = Y(e);
|
|
1618
2056
|
}
|
|
1619
2057
|
return null;
|
|
1620
2058
|
}
|
|
1621
|
-
function
|
|
2059
|
+
function Kt() {
|
|
1622
2060
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
1623
2061
|
}
|
|
1624
|
-
function
|
|
1625
|
-
return ["html", "body", "#document"].includes(
|
|
2062
|
+
function ft(t) {
|
|
2063
|
+
return ["html", "body", "#document"].includes(ut(t));
|
|
1626
2064
|
}
|
|
1627
|
-
function
|
|
1628
|
-
return
|
|
2065
|
+
function T(t) {
|
|
2066
|
+
return A(t).getComputedStyle(t);
|
|
1629
2067
|
}
|
|
1630
|
-
function
|
|
1631
|
-
return
|
|
2068
|
+
function Tt(t) {
|
|
2069
|
+
return P(t) ? {
|
|
1632
2070
|
scrollLeft: t.scrollLeft,
|
|
1633
2071
|
scrollTop: t.scrollTop
|
|
1634
2072
|
} : {
|
|
@@ -1636,210 +2074,223 @@ function It(t) {
|
|
|
1636
2074
|
scrollTop: t.scrollY
|
|
1637
2075
|
};
|
|
1638
2076
|
}
|
|
1639
|
-
function
|
|
1640
|
-
if (
|
|
2077
|
+
function Y(t) {
|
|
2078
|
+
if (ut(t) === "html")
|
|
1641
2079
|
return t;
|
|
1642
2080
|
const e = (
|
|
1643
2081
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
1644
2082
|
t.assignedSlot || // DOM Element detected.
|
|
1645
2083
|
t.parentNode || // ShadowRoot detected.
|
|
1646
|
-
|
|
1647
|
-
|
|
2084
|
+
te(t) && t.host || // Fallback.
|
|
2085
|
+
H(t)
|
|
1648
2086
|
);
|
|
1649
|
-
return
|
|
2087
|
+
return te(e) ? e.host : e;
|
|
1650
2088
|
}
|
|
1651
2089
|
function Le(t) {
|
|
1652
|
-
const e =
|
|
1653
|
-
return
|
|
2090
|
+
const e = Y(t);
|
|
2091
|
+
return ft(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : F(e) && Et(e) ? e : Le(e);
|
|
1654
2092
|
}
|
|
1655
|
-
function
|
|
1656
|
-
var
|
|
1657
|
-
e === void 0 && (e = []),
|
|
1658
|
-
const
|
|
1659
|
-
if (
|
|
1660
|
-
const l =
|
|
1661
|
-
return e.concat(
|
|
2093
|
+
function yt(t, e, s) {
|
|
2094
|
+
var n;
|
|
2095
|
+
e === void 0 && (e = []), s === void 0 && (s = !0);
|
|
2096
|
+
const i = Le(t), r = i === ((n = t.ownerDocument) == null ? void 0 : n.body), o = A(i);
|
|
2097
|
+
if (r) {
|
|
2098
|
+
const l = Nt(o);
|
|
2099
|
+
return e.concat(o, o.visualViewport || [], Et(i) ? i : [], l && s ? yt(l) : []);
|
|
1662
2100
|
}
|
|
1663
|
-
return e.concat(
|
|
2101
|
+
return e.concat(i, yt(i, [], s));
|
|
1664
2102
|
}
|
|
1665
|
-
function
|
|
2103
|
+
function Nt(t) {
|
|
1666
2104
|
return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
|
|
1667
2105
|
}
|
|
1668
|
-
function
|
|
1669
|
-
const e =
|
|
1670
|
-
let
|
|
1671
|
-
const
|
|
1672
|
-
return l && (
|
|
1673
|
-
width:
|
|
1674
|
-
height:
|
|
2106
|
+
function Re(t) {
|
|
2107
|
+
const e = T(t);
|
|
2108
|
+
let s = parseFloat(e.width) || 0, n = parseFloat(e.height) || 0;
|
|
2109
|
+
const i = F(t), r = i ? t.offsetWidth : s, o = i ? t.offsetHeight : n, l = Ct(s) !== r || Ct(n) !== o;
|
|
2110
|
+
return l && (s = r, n = o), {
|
|
2111
|
+
width: s,
|
|
2112
|
+
height: n,
|
|
1675
2113
|
$: l
|
|
1676
2114
|
};
|
|
1677
2115
|
}
|
|
1678
|
-
function
|
|
1679
|
-
return
|
|
2116
|
+
function jt(t) {
|
|
2117
|
+
return P(t) ? t : t.contextElement;
|
|
1680
2118
|
}
|
|
1681
2119
|
function st(t) {
|
|
1682
|
-
const e =
|
|
1683
|
-
if (!
|
|
1684
|
-
return
|
|
1685
|
-
const
|
|
1686
|
-
width:
|
|
1687
|
-
height:
|
|
1688
|
-
$:
|
|
1689
|
-
} =
|
|
1690
|
-
let
|
|
1691
|
-
return (!
|
|
1692
|
-
x:
|
|
2120
|
+
const e = jt(t);
|
|
2121
|
+
if (!F(e))
|
|
2122
|
+
return I(1);
|
|
2123
|
+
const s = e.getBoundingClientRect(), {
|
|
2124
|
+
width: n,
|
|
2125
|
+
height: i,
|
|
2126
|
+
$: r
|
|
2127
|
+
} = Re(e);
|
|
2128
|
+
let o = (r ? Ct(s.width) : s.width) / n, l = (r ? Ct(s.height) : s.height) / i;
|
|
2129
|
+
return (!o || !Number.isFinite(o)) && (o = 1), (!l || !Number.isFinite(l)) && (l = 1), {
|
|
2130
|
+
x: o,
|
|
1693
2131
|
y: l
|
|
1694
2132
|
};
|
|
1695
2133
|
}
|
|
1696
|
-
const
|
|
1697
|
-
function
|
|
1698
|
-
const e =
|
|
1699
|
-
return !
|
|
2134
|
+
const Un = /* @__PURE__ */ I(0);
|
|
2135
|
+
function Pe(t) {
|
|
2136
|
+
const e = A(t);
|
|
2137
|
+
return !Kt() || !e.visualViewport ? Un : {
|
|
1700
2138
|
x: e.visualViewport.offsetLeft,
|
|
1701
2139
|
y: e.visualViewport.offsetTop
|
|
1702
2140
|
};
|
|
1703
2141
|
}
|
|
1704
|
-
function
|
|
1705
|
-
return e === void 0 && (e = !1), !
|
|
1706
|
-
}
|
|
1707
|
-
function
|
|
1708
|
-
e === void 0 && (e = !1),
|
|
1709
|
-
const
|
|
1710
|
-
let
|
|
1711
|
-
e && (
|
|
1712
|
-
const l =
|
|
1713
|
-
let a = (
|
|
1714
|
-
if (
|
|
1715
|
-
const h =
|
|
1716
|
-
let g = h, m =
|
|
1717
|
-
for (; m &&
|
|
1718
|
-
const
|
|
1719
|
-
a *=
|
|
2142
|
+
function Vn(t, e, s) {
|
|
2143
|
+
return e === void 0 && (e = !1), !s || e && s !== A(t) ? !1 : e;
|
|
2144
|
+
}
|
|
2145
|
+
function et(t, e, s, n) {
|
|
2146
|
+
e === void 0 && (e = !1), s === void 0 && (s = !1);
|
|
2147
|
+
const i = t.getBoundingClientRect(), r = jt(t);
|
|
2148
|
+
let o = I(1);
|
|
2149
|
+
e && (n ? P(n) && (o = st(n)) : o = st(t));
|
|
2150
|
+
const l = Vn(r, s, n) ? Pe(r) : I(0);
|
|
2151
|
+
let a = (i.left + l.x) / o.x, c = (i.top + l.y) / o.y, d = i.width / o.x, f = i.height / o.y;
|
|
2152
|
+
if (r) {
|
|
2153
|
+
const h = A(r), u = n && P(n) ? A(n) : n;
|
|
2154
|
+
let g = h, m = Nt(g);
|
|
2155
|
+
for (; m && n && u !== g; ) {
|
|
2156
|
+
const p = st(m), y = m.getBoundingClientRect(), w = T(m), b = y.left + (m.clientLeft + parseFloat(w.paddingLeft)) * p.x, v = y.top + (m.clientTop + parseFloat(w.paddingTop)) * p.y;
|
|
2157
|
+
a *= p.x, c *= p.y, d *= p.x, f *= p.y, a += b, c += v, g = A(m), m = Nt(g);
|
|
1720
2158
|
}
|
|
1721
2159
|
}
|
|
1722
|
-
return
|
|
2160
|
+
return At({
|
|
1723
2161
|
width: d,
|
|
1724
|
-
height:
|
|
2162
|
+
height: f,
|
|
1725
2163
|
x: a,
|
|
1726
2164
|
y: c
|
|
1727
2165
|
});
|
|
1728
2166
|
}
|
|
1729
|
-
function
|
|
2167
|
+
function Yt(t, e) {
|
|
2168
|
+
const s = Tt(t).scrollLeft;
|
|
2169
|
+
return e ? e.left + s : et(H(t)).left + s;
|
|
2170
|
+
}
|
|
2171
|
+
function Te(t, e, s) {
|
|
2172
|
+
s === void 0 && (s = !1);
|
|
2173
|
+
const n = t.getBoundingClientRect(), i = n.left + e.scrollLeft - (s ? 0 : (
|
|
2174
|
+
// RTL <body> scrollbar.
|
|
2175
|
+
Yt(t, n)
|
|
2176
|
+
)), r = n.top + e.scrollTop;
|
|
2177
|
+
return {
|
|
2178
|
+
x: i,
|
|
2179
|
+
y: r
|
|
2180
|
+
};
|
|
2181
|
+
}
|
|
2182
|
+
function _n(t) {
|
|
1730
2183
|
let {
|
|
1731
2184
|
elements: e,
|
|
1732
|
-
rect:
|
|
1733
|
-
offsetParent:
|
|
1734
|
-
strategy:
|
|
2185
|
+
rect: s,
|
|
2186
|
+
offsetParent: n,
|
|
2187
|
+
strategy: i
|
|
1735
2188
|
} = t;
|
|
1736
|
-
const
|
|
1737
|
-
if (
|
|
1738
|
-
return
|
|
2189
|
+
const r = i === "fixed", o = H(n), l = e ? Pt(e.floating) : !1;
|
|
2190
|
+
if (n === o || l && r)
|
|
2191
|
+
return s;
|
|
1739
2192
|
let a = {
|
|
1740
2193
|
scrollLeft: 0,
|
|
1741
2194
|
scrollTop: 0
|
|
1742
|
-
}, c =
|
|
1743
|
-
const d =
|
|
1744
|
-
if ((
|
|
1745
|
-
const
|
|
1746
|
-
c = st(
|
|
2195
|
+
}, c = I(1);
|
|
2196
|
+
const d = I(0), f = F(n);
|
|
2197
|
+
if ((f || !f && !r) && ((ut(n) !== "body" || Et(o)) && (a = Tt(n)), F(n))) {
|
|
2198
|
+
const u = et(n);
|
|
2199
|
+
c = st(n), d.x = u.x + n.clientLeft, d.y = u.y + n.clientTop;
|
|
1747
2200
|
}
|
|
2201
|
+
const h = o && !f && !r ? Te(o, a, !0) : I(0);
|
|
1748
2202
|
return {
|
|
1749
|
-
width:
|
|
1750
|
-
height:
|
|
1751
|
-
x:
|
|
1752
|
-
y:
|
|
2203
|
+
width: s.width * c.x,
|
|
2204
|
+
height: s.height * c.y,
|
|
2205
|
+
x: s.x * c.x - a.scrollLeft * c.x + d.x + h.x,
|
|
2206
|
+
y: s.y * c.y - a.scrollTop * c.y + d.y + h.y
|
|
1753
2207
|
};
|
|
1754
2208
|
}
|
|
1755
|
-
function
|
|
2209
|
+
function Wn(t) {
|
|
1756
2210
|
return Array.from(t.getClientRects());
|
|
1757
2211
|
}
|
|
1758
|
-
function
|
|
1759
|
-
const
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
return M(s).direction === "rtl" && (r += Z(e.clientWidth, s.clientWidth) - n), {
|
|
1767
|
-
width: n,
|
|
1768
|
-
height: o,
|
|
1769
|
-
x: r,
|
|
2212
|
+
function zn(t) {
|
|
2213
|
+
const e = H(t), s = Tt(t), n = t.ownerDocument.body, i = Z(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), r = Z(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
|
|
2214
|
+
let o = -s.scrollLeft + Yt(t);
|
|
2215
|
+
const l = -s.scrollTop;
|
|
2216
|
+
return T(n).direction === "rtl" && (o += Z(e.clientWidth, n.clientWidth) - i), {
|
|
2217
|
+
width: i,
|
|
2218
|
+
height: r,
|
|
2219
|
+
x: o,
|
|
1770
2220
|
y: l
|
|
1771
2221
|
};
|
|
1772
2222
|
}
|
|
1773
|
-
function
|
|
1774
|
-
const
|
|
1775
|
-
let
|
|
1776
|
-
if (
|
|
1777
|
-
|
|
1778
|
-
const c =
|
|
1779
|
-
(!c || c && e === "fixed") && (l =
|
|
2223
|
+
function Qn(t, e) {
|
|
2224
|
+
const s = A(t), n = H(t), i = s.visualViewport;
|
|
2225
|
+
let r = n.clientWidth, o = n.clientHeight, l = 0, a = 0;
|
|
2226
|
+
if (i) {
|
|
2227
|
+
r = i.width, o = i.height;
|
|
2228
|
+
const c = Kt();
|
|
2229
|
+
(!c || c && e === "fixed") && (l = i.offsetLeft, a = i.offsetTop);
|
|
1780
2230
|
}
|
|
1781
2231
|
return {
|
|
1782
|
-
width:
|
|
1783
|
-
height:
|
|
2232
|
+
width: r,
|
|
2233
|
+
height: o,
|
|
1784
2234
|
x: l,
|
|
1785
2235
|
y: a
|
|
1786
2236
|
};
|
|
1787
2237
|
}
|
|
1788
|
-
function
|
|
1789
|
-
const
|
|
2238
|
+
function Kn(t, e) {
|
|
2239
|
+
const s = et(t, !0, e === "fixed"), n = s.top + t.clientTop, i = s.left + t.clientLeft, r = F(t) ? st(t) : I(1), o = t.clientWidth * r.x, l = t.clientHeight * r.y, a = i * r.x, c = n * r.y;
|
|
1790
2240
|
return {
|
|
1791
|
-
width:
|
|
2241
|
+
width: o,
|
|
1792
2242
|
height: l,
|
|
1793
2243
|
x: a,
|
|
1794
2244
|
y: c
|
|
1795
2245
|
};
|
|
1796
2246
|
}
|
|
1797
|
-
function
|
|
1798
|
-
let
|
|
2247
|
+
function ee(t, e, s) {
|
|
2248
|
+
let n;
|
|
1799
2249
|
if (e === "viewport")
|
|
1800
|
-
|
|
2250
|
+
n = Qn(t, s);
|
|
1801
2251
|
else if (e === "document")
|
|
1802
|
-
|
|
1803
|
-
else if (
|
|
1804
|
-
|
|
2252
|
+
n = zn(H(t));
|
|
2253
|
+
else if (P(e))
|
|
2254
|
+
n = Kn(e, s);
|
|
1805
2255
|
else {
|
|
1806
|
-
const
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
2256
|
+
const i = Pe(t);
|
|
2257
|
+
n = {
|
|
2258
|
+
x: e.x - i.x,
|
|
2259
|
+
y: e.y - i.y,
|
|
2260
|
+
width: e.width,
|
|
2261
|
+
height: e.height
|
|
1811
2262
|
};
|
|
1812
2263
|
}
|
|
1813
|
-
return
|
|
2264
|
+
return At(n);
|
|
1814
2265
|
}
|
|
1815
|
-
function
|
|
1816
|
-
const
|
|
1817
|
-
return
|
|
2266
|
+
function Me(t, e) {
|
|
2267
|
+
const s = Y(t);
|
|
2268
|
+
return s === e || !P(s) || ft(s) ? !1 : T(s).position === "fixed" || Me(s, e);
|
|
1818
2269
|
}
|
|
1819
|
-
function
|
|
1820
|
-
const
|
|
1821
|
-
if (
|
|
1822
|
-
return
|
|
1823
|
-
let
|
|
1824
|
-
const
|
|
1825
|
-
let
|
|
1826
|
-
for (;
|
|
1827
|
-
const l =
|
|
1828
|
-
!a && l.position === "fixed" && (
|
|
2270
|
+
function jn(t, e) {
|
|
2271
|
+
const s = e.get(t);
|
|
2272
|
+
if (s)
|
|
2273
|
+
return s;
|
|
2274
|
+
let n = yt(t, [], !1).filter((l) => P(l) && ut(l) !== "body"), i = null;
|
|
2275
|
+
const r = T(t).position === "fixed";
|
|
2276
|
+
let o = r ? Y(t) : t;
|
|
2277
|
+
for (; P(o) && !ft(o); ) {
|
|
2278
|
+
const l = T(o), a = Qt(o);
|
|
2279
|
+
!a && l.position === "fixed" && (i = null), (r ? !a && !i : !a && l.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || Et(o) && !a && Me(t, o)) ? n = n.filter((d) => d !== o) : i = l, o = Y(o);
|
|
1829
2280
|
}
|
|
1830
|
-
return e.set(t,
|
|
2281
|
+
return e.set(t, n), n;
|
|
1831
2282
|
}
|
|
1832
|
-
function
|
|
2283
|
+
function Yn(t) {
|
|
1833
2284
|
let {
|
|
1834
2285
|
element: e,
|
|
1835
|
-
boundary:
|
|
1836
|
-
rootBoundary:
|
|
1837
|
-
strategy:
|
|
2286
|
+
boundary: s,
|
|
2287
|
+
rootBoundary: n,
|
|
2288
|
+
strategy: i
|
|
1838
2289
|
} = t;
|
|
1839
|
-
const
|
|
1840
|
-
const
|
|
1841
|
-
return c.top = Z(
|
|
1842
|
-
},
|
|
2290
|
+
const o = [...s === "clippingAncestors" ? Pt(e) ? [] : jn(e, this._c) : [].concat(s), n], l = o[0], a = o.reduce((c, d) => {
|
|
2291
|
+
const f = ee(e, d, i);
|
|
2292
|
+
return c.top = Z(f.top, c.top), c.right = ct(f.right, c.right), c.bottom = ct(f.bottom, c.bottom), c.left = Z(f.left, c.left), c;
|
|
2293
|
+
}, ee(e, l, i));
|
|
1843
2294
|
return {
|
|
1844
2295
|
width: a.right - a.left,
|
|
1845
2296
|
height: a.bottom - a.top,
|
|
@@ -1847,254 +2298,257 @@ function Ni(t) {
|
|
|
1847
2298
|
y: a.top
|
|
1848
2299
|
};
|
|
1849
2300
|
}
|
|
1850
|
-
function
|
|
2301
|
+
function Jn(t) {
|
|
1851
2302
|
const {
|
|
1852
2303
|
width: e,
|
|
1853
|
-
height:
|
|
1854
|
-
} =
|
|
2304
|
+
height: s
|
|
2305
|
+
} = Re(t);
|
|
1855
2306
|
return {
|
|
1856
2307
|
width: e,
|
|
1857
|
-
height:
|
|
2308
|
+
height: s
|
|
1858
2309
|
};
|
|
1859
2310
|
}
|
|
1860
|
-
function
|
|
1861
|
-
const
|
|
2311
|
+
function Xn(t, e, s) {
|
|
2312
|
+
const n = F(e), i = H(e), r = s === "fixed", o = et(t, !0, r, e);
|
|
1862
2313
|
let l = {
|
|
1863
2314
|
scrollLeft: 0,
|
|
1864
2315
|
scrollTop: 0
|
|
1865
2316
|
};
|
|
1866
|
-
const a =
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
}
|
|
1878
|
-
const u = r.left + l.scrollLeft - a.x - c, h = r.top + l.scrollTop - a.y - d;
|
|
2317
|
+
const a = I(0);
|
|
2318
|
+
function c() {
|
|
2319
|
+
a.x = Yt(i);
|
|
2320
|
+
}
|
|
2321
|
+
if (n || !n && !r)
|
|
2322
|
+
if ((ut(e) !== "body" || Et(i)) && (l = Tt(e)), n) {
|
|
2323
|
+
const u = et(e, !0, r, e);
|
|
2324
|
+
a.x = u.x + e.clientLeft, a.y = u.y + e.clientTop;
|
|
2325
|
+
} else i && c();
|
|
2326
|
+
r && !n && i && c();
|
|
2327
|
+
const d = i && !n && !r ? Te(i, l) : I(0), f = o.left + l.scrollLeft - a.x - d.x, h = o.top + l.scrollTop - a.y - d.y;
|
|
1879
2328
|
return {
|
|
1880
|
-
x:
|
|
2329
|
+
x: f,
|
|
1881
2330
|
y: h,
|
|
1882
|
-
width:
|
|
1883
|
-
height:
|
|
2331
|
+
width: o.width,
|
|
2332
|
+
height: o.height
|
|
1884
2333
|
};
|
|
1885
2334
|
}
|
|
1886
|
-
function
|
|
1887
|
-
return
|
|
2335
|
+
function Dt(t) {
|
|
2336
|
+
return T(t).position === "static";
|
|
1888
2337
|
}
|
|
1889
|
-
function
|
|
1890
|
-
if (!
|
|
2338
|
+
function ne(t, e) {
|
|
2339
|
+
if (!F(t) || T(t).position === "fixed")
|
|
1891
2340
|
return null;
|
|
1892
2341
|
if (e)
|
|
1893
2342
|
return e(t);
|
|
1894
|
-
let
|
|
1895
|
-
return
|
|
1896
|
-
}
|
|
1897
|
-
function
|
|
1898
|
-
const
|
|
1899
|
-
if (
|
|
1900
|
-
return
|
|
1901
|
-
if (!
|
|
1902
|
-
let
|
|
1903
|
-
for (;
|
|
1904
|
-
if (
|
|
1905
|
-
return
|
|
1906
|
-
|
|
2343
|
+
let s = t.offsetParent;
|
|
2344
|
+
return H(t) === s && (s = s.ownerDocument.body), s;
|
|
2345
|
+
}
|
|
2346
|
+
function De(t, e) {
|
|
2347
|
+
const s = A(t);
|
|
2348
|
+
if (Pt(t))
|
|
2349
|
+
return s;
|
|
2350
|
+
if (!F(t)) {
|
|
2351
|
+
let i = Y(t);
|
|
2352
|
+
for (; i && !ft(i); ) {
|
|
2353
|
+
if (P(i) && !Dt(i))
|
|
2354
|
+
return i;
|
|
2355
|
+
i = Y(i);
|
|
1907
2356
|
}
|
|
1908
|
-
return
|
|
2357
|
+
return s;
|
|
1909
2358
|
}
|
|
1910
|
-
let
|
|
1911
|
-
for (;
|
|
1912
|
-
|
|
1913
|
-
return
|
|
2359
|
+
let n = ne(t, e);
|
|
2360
|
+
for (; n && Nn(n) && Dt(n); )
|
|
2361
|
+
n = ne(n, e);
|
|
2362
|
+
return n && ft(n) && Dt(n) && !Qt(n) ? s : n || Bn(t) || s;
|
|
1914
2363
|
}
|
|
1915
|
-
const
|
|
1916
|
-
const e = this.getOffsetParent ||
|
|
2364
|
+
const Gn = async function(t) {
|
|
2365
|
+
const e = this.getOffsetParent || De, s = this.getDimensions, n = await s(t.floating);
|
|
1917
2366
|
return {
|
|
1918
|
-
reference:
|
|
2367
|
+
reference: Xn(t.reference, await e(t.floating), t.strategy),
|
|
1919
2368
|
floating: {
|
|
1920
2369
|
x: 0,
|
|
1921
2370
|
y: 0,
|
|
1922
|
-
width:
|
|
1923
|
-
height:
|
|
2371
|
+
width: n.width,
|
|
2372
|
+
height: n.height
|
|
1924
2373
|
}
|
|
1925
2374
|
};
|
|
1926
2375
|
};
|
|
1927
|
-
function
|
|
1928
|
-
return
|
|
1929
|
-
}
|
|
1930
|
-
const
|
|
1931
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
1932
|
-
getDocumentElement:
|
|
1933
|
-
getClippingRect:
|
|
1934
|
-
getOffsetParent:
|
|
1935
|
-
getElementRects:
|
|
1936
|
-
getClientRects:
|
|
1937
|
-
getDimensions:
|
|
2376
|
+
function qn(t) {
|
|
2377
|
+
return T(t).direction === "rtl";
|
|
2378
|
+
}
|
|
2379
|
+
const Zn = {
|
|
2380
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: _n,
|
|
2381
|
+
getDocumentElement: H,
|
|
2382
|
+
getClippingRect: Yn,
|
|
2383
|
+
getOffsetParent: De,
|
|
2384
|
+
getElementRects: Gn,
|
|
2385
|
+
getClientRects: Wn,
|
|
2386
|
+
getDimensions: Jn,
|
|
1938
2387
|
getScale: st,
|
|
1939
|
-
isElement:
|
|
1940
|
-
isRTL:
|
|
2388
|
+
isElement: P,
|
|
2389
|
+
isRTL: qn
|
|
1941
2390
|
};
|
|
1942
|
-
function
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
2391
|
+
function Ie(t, e) {
|
|
2392
|
+
return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
|
|
2393
|
+
}
|
|
2394
|
+
function ts(t, e) {
|
|
2395
|
+
let s = null, n;
|
|
2396
|
+
const i = H(t);
|
|
2397
|
+
function r() {
|
|
1946
2398
|
var l;
|
|
1947
|
-
clearTimeout(
|
|
1948
|
-
}
|
|
1949
|
-
function
|
|
1950
|
-
l === void 0 && (l = !1), a === void 0 && (a = 1),
|
|
1951
|
-
const {
|
|
1952
|
-
left:
|
|
1953
|
-
top:
|
|
1954
|
-
width:
|
|
1955
|
-
height:
|
|
1956
|
-
} =
|
|
1957
|
-
if (l || e(), !
|
|
2399
|
+
clearTimeout(n), (l = s) == null || l.disconnect(), s = null;
|
|
2400
|
+
}
|
|
2401
|
+
function o(l, a) {
|
|
2402
|
+
l === void 0 && (l = !1), a === void 0 && (a = 1), r();
|
|
2403
|
+
const c = t.getBoundingClientRect(), {
|
|
2404
|
+
left: d,
|
|
2405
|
+
top: f,
|
|
2406
|
+
width: h,
|
|
2407
|
+
height: u
|
|
2408
|
+
} = c;
|
|
2409
|
+
if (l || e(), !h || !u)
|
|
1958
2410
|
return;
|
|
1959
|
-
const
|
|
1960
|
-
rootMargin: -
|
|
1961
|
-
threshold: Z(0,
|
|
2411
|
+
const g = St(f), m = St(i.clientWidth - (d + h)), p = St(i.clientHeight - (f + u)), y = St(d), b = {
|
|
2412
|
+
rootMargin: -g + "px " + -m + "px " + -p + "px " + -y + "px",
|
|
2413
|
+
threshold: Z(0, ct(1, a)) || 1
|
|
1962
2414
|
};
|
|
1963
|
-
let
|
|
1964
|
-
function
|
|
1965
|
-
const
|
|
1966
|
-
if (
|
|
1967
|
-
if (!
|
|
1968
|
-
return
|
|
1969
|
-
|
|
1970
|
-
|
|
2415
|
+
let v = !0;
|
|
2416
|
+
function x(k) {
|
|
2417
|
+
const O = k[0].intersectionRatio;
|
|
2418
|
+
if (O !== a) {
|
|
2419
|
+
if (!v)
|
|
2420
|
+
return o();
|
|
2421
|
+
O ? o(!1, O) : n = setTimeout(() => {
|
|
2422
|
+
o(!1, 1e-7);
|
|
1971
2423
|
}, 1e3);
|
|
1972
2424
|
}
|
|
1973
|
-
|
|
2425
|
+
O === 1 && !Ie(c, t.getBoundingClientRect()) && o(), v = !1;
|
|
1974
2426
|
}
|
|
1975
2427
|
try {
|
|
1976
|
-
|
|
1977
|
-
...
|
|
2428
|
+
s = new IntersectionObserver(x, {
|
|
2429
|
+
...b,
|
|
1978
2430
|
// Handle <iframe>s
|
|
1979
|
-
root:
|
|
2431
|
+
root: i.ownerDocument
|
|
1980
2432
|
});
|
|
1981
2433
|
} catch {
|
|
1982
|
-
|
|
2434
|
+
s = new IntersectionObserver(x, b);
|
|
1983
2435
|
}
|
|
1984
|
-
|
|
2436
|
+
s.observe(t);
|
|
1985
2437
|
}
|
|
1986
|
-
return
|
|
2438
|
+
return o(!0), r;
|
|
1987
2439
|
}
|
|
1988
|
-
function
|
|
1989
|
-
|
|
2440
|
+
function es(t, e, s, n) {
|
|
2441
|
+
n === void 0 && (n = {});
|
|
1990
2442
|
const {
|
|
1991
|
-
ancestorScroll:
|
|
1992
|
-
ancestorResize:
|
|
1993
|
-
elementResize:
|
|
2443
|
+
ancestorScroll: i = !0,
|
|
2444
|
+
ancestorResize: r = !0,
|
|
2445
|
+
elementResize: o = typeof ResizeObserver == "function",
|
|
1994
2446
|
layoutShift: l = typeof IntersectionObserver == "function",
|
|
1995
2447
|
animationFrame: a = !1
|
|
1996
|
-
} =
|
|
1997
|
-
d.forEach((
|
|
1998
|
-
|
|
2448
|
+
} = n, c = jt(t), d = i || r ? [...c ? yt(c) : [], ...yt(e)] : [];
|
|
2449
|
+
d.forEach((y) => {
|
|
2450
|
+
i && y.addEventListener("scroll", s, {
|
|
1999
2451
|
passive: !0
|
|
2000
|
-
}),
|
|
2452
|
+
}), r && y.addEventListener("resize", s);
|
|
2001
2453
|
});
|
|
2002
|
-
const
|
|
2003
|
-
let h = -1,
|
|
2004
|
-
|
|
2005
|
-
let [
|
|
2006
|
-
|
|
2007
|
-
var
|
|
2008
|
-
(
|
|
2009
|
-
})),
|
|
2010
|
-
}), c && !a &&
|
|
2011
|
-
let g, m = a ?
|
|
2012
|
-
a &&
|
|
2013
|
-
function
|
|
2014
|
-
const
|
|
2015
|
-
m && (
|
|
2016
|
-
}
|
|
2017
|
-
return
|
|
2018
|
-
var
|
|
2019
|
-
d.forEach((
|
|
2020
|
-
|
|
2021
|
-
}),
|
|
2454
|
+
const f = c && l ? ts(c, s) : null;
|
|
2455
|
+
let h = -1, u = null;
|
|
2456
|
+
o && (u = new ResizeObserver((y) => {
|
|
2457
|
+
let [w] = y;
|
|
2458
|
+
w && w.target === c && u && (u.unobserve(e), cancelAnimationFrame(h), h = requestAnimationFrame(() => {
|
|
2459
|
+
var b;
|
|
2460
|
+
(b = u) == null || b.observe(e);
|
|
2461
|
+
})), s();
|
|
2462
|
+
}), c && !a && u.observe(c), u.observe(e));
|
|
2463
|
+
let g, m = a ? et(t) : null;
|
|
2464
|
+
a && p();
|
|
2465
|
+
function p() {
|
|
2466
|
+
const y = et(t);
|
|
2467
|
+
m && !Ie(m, y) && s(), m = y, g = requestAnimationFrame(p);
|
|
2468
|
+
}
|
|
2469
|
+
return s(), () => {
|
|
2470
|
+
var y;
|
|
2471
|
+
d.forEach((w) => {
|
|
2472
|
+
i && w.removeEventListener("scroll", s), r && w.removeEventListener("resize", s);
|
|
2473
|
+
}), f == null || f(), (y = u) == null || y.disconnect(), u = null, a && cancelAnimationFrame(g);
|
|
2022
2474
|
};
|
|
2023
2475
|
}
|
|
2024
|
-
const
|
|
2025
|
-
const
|
|
2026
|
-
platform:
|
|
2027
|
-
...
|
|
2028
|
-
},
|
|
2029
|
-
...
|
|
2030
|
-
_c:
|
|
2476
|
+
const ns = In, ss = Fn, is = Mn, os = Tn, rs = Hn, ls = (t, e, s) => {
|
|
2477
|
+
const n = /* @__PURE__ */ new Map(), i = {
|
|
2478
|
+
platform: Zn,
|
|
2479
|
+
...s
|
|
2480
|
+
}, r = {
|
|
2481
|
+
...i.platform,
|
|
2482
|
+
_c: n
|
|
2031
2483
|
};
|
|
2032
|
-
return
|
|
2033
|
-
...
|
|
2034
|
-
platform:
|
|
2484
|
+
return Pn(t, e, {
|
|
2485
|
+
...i,
|
|
2486
|
+
platform: r
|
|
2035
2487
|
});
|
|
2036
2488
|
};
|
|
2037
|
-
async function
|
|
2038
|
-
const e =
|
|
2039
|
-
e.el.inert = !1, e.el.classList.add(this.settings.stateActive), e.isTooltip || e.trigger.setAttribute("aria-expanded", "true"), e.
|
|
2040
|
-
const
|
|
2041
|
-
return
|
|
2042
|
-
|
|
2489
|
+
async function as(t) {
|
|
2490
|
+
const e = Ee.call(this, t);
|
|
2491
|
+
e.el.inert = !1, e.el.classList.add(this.settings.stateActive), e.isTooltip || e.trigger.setAttribute("aria-expanded", "true"), e.buildCustomProps();
|
|
2492
|
+
const s = pn(e), n = e.el.querySelector(s.arrow.element);
|
|
2493
|
+
return s.arrow.element = n || void 0, e.floatingCleanup = es(e.trigger, e.el, () => {
|
|
2494
|
+
ls(e.trigger, e.el, {
|
|
2043
2495
|
placement: e.getSetting("placement"),
|
|
2044
2496
|
middleware: [
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2497
|
+
is(s.flip),
|
|
2498
|
+
ss({ ...s.shift, limiter: rs() }),
|
|
2499
|
+
ns(s.offset),
|
|
2500
|
+
os(s.arrow)
|
|
2049
2501
|
]
|
|
2050
|
-
}).then(({ x:
|
|
2502
|
+
}).then(({ x: i, y: r, placement: o, middlewareData: l }) => {
|
|
2051
2503
|
if (e.el) {
|
|
2052
|
-
if (
|
|
2504
|
+
if (qt(e.el, i, r), s.arrow.element && l.arrow) {
|
|
2053
2505
|
const { x: a, y: c } = l.arrow;
|
|
2054
|
-
|
|
2506
|
+
qt(s.arrow.element, a, c);
|
|
2055
2507
|
}
|
|
2056
|
-
e.el.setAttribute("data-floating-placement",
|
|
2508
|
+
e.el.setAttribute("data-floating-placement", o);
|
|
2057
2509
|
}
|
|
2058
2510
|
});
|
|
2059
|
-
}), e.state = "opened", e.getSetting("event") === "click" &&
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2511
|
+
}), e.state = "opened", e.getSetting("event") === "click" && En.call(this, e), e.el.dispatchEvent(
|
|
2512
|
+
new CustomEvent(e.getSetting("customEventPrefix") + "opened", {
|
|
2513
|
+
detail: this,
|
|
2514
|
+
bubbles: !0
|
|
2515
|
+
})
|
|
2516
|
+
), await e.parent.emit("opened", e), e;
|
|
2517
|
+
}
|
|
2518
|
+
var at;
|
|
2519
|
+
class hs extends Ot {
|
|
2520
|
+
constructor(s = {}) {
|
|
2521
|
+
super({ ...mn, ...s });
|
|
2522
|
+
U(this, at);
|
|
2523
|
+
this.module = "Popover", this.entryClass = Sn, this.trigger = null, S(this, at, vn.bind(this));
|
|
2067
2524
|
}
|
|
2068
2525
|
get active() {
|
|
2069
2526
|
return this.get("opened", "state");
|
|
2070
2527
|
}
|
|
2071
2528
|
get activeHover() {
|
|
2072
|
-
return this.collection.find((
|
|
2073
|
-
}
|
|
2074
|
-
async createEntry(i, s) {
|
|
2075
|
-
return new di(this, i, s);
|
|
2529
|
+
return this.collection.find((s) => s.state == "opened" && s.getSetting("event") == "hover");
|
|
2076
2530
|
}
|
|
2077
|
-
async open(
|
|
2078
|
-
return
|
|
2531
|
+
async open(s) {
|
|
2532
|
+
return as.call(this, s);
|
|
2079
2533
|
}
|
|
2080
|
-
async close(
|
|
2081
|
-
return Se.call(this,
|
|
2534
|
+
async close(s) {
|
|
2535
|
+
return Se.call(this, s);
|
|
2082
2536
|
}
|
|
2083
2537
|
async afterMount() {
|
|
2084
|
-
document.addEventListener("keydown",
|
|
2538
|
+
document.addEventListener("keydown", E(this, at), !1);
|
|
2085
2539
|
}
|
|
2086
2540
|
async beforeUnmount() {
|
|
2087
2541
|
this.trigger = null;
|
|
2088
2542
|
}
|
|
2089
2543
|
async afterUnmount() {
|
|
2090
|
-
document.removeEventListener("keydown",
|
|
2544
|
+
document.removeEventListener("keydown", E(this, at), !1);
|
|
2091
2545
|
}
|
|
2092
2546
|
}
|
|
2093
|
-
|
|
2547
|
+
at = new WeakMap();
|
|
2094
2548
|
export {
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2549
|
+
us as Drawer,
|
|
2550
|
+
ds as Modal,
|
|
2551
|
+
hs as Popover,
|
|
2552
|
+
fs as core
|
|
2099
2553
|
};
|
|
2100
2554
|
//# sourceMappingURL=index.js.map
|