vrembem 4.0.0-next.33 → 4.0.0-next.34
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 +20 -8
- package/dev/base.css.map +1 -1
- package/dev/index.css +23 -12
- package/dev/index.css.map +1 -1
- package/dev/index.js +1542 -1520
- package/dev/index.js.map +1 -1
- package/dev/index.umd.cjs +1509 -1487
- package/dev/index.umd.cjs.map +1 -1
- package/dev/root.css +3 -4
- 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 +2072 -2059
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +9 -9
- package/dist/index.umd.cjs.map +1 -1
- package/dist/root.css +1 -1
- package/dist/root.css.map +1 -1
- package/package.json +22 -22
package/dev/index.umd.cjs
CHANGED
|
@@ -2,41 +2,44 @@
|
|
|
2
2
|
typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.vrembem = {}));
|
|
3
3
|
})(this, (function(exports2) {
|
|
4
4
|
"use strict";
|
|
5
|
-
const
|
|
6
|
-
`a[href]${
|
|
7
|
-
`area[href]${
|
|
8
|
-
`input:not([type="hidden"]):not([type="radio"])${
|
|
9
|
-
`input[type="radio"]${
|
|
10
|
-
`select${
|
|
11
|
-
`textarea${
|
|
12
|
-
`button${
|
|
13
|
-
`details${
|
|
14
|
-
`iframe${
|
|
15
|
-
`audio[controls]${
|
|
16
|
-
`video[controls]${
|
|
17
|
-
`[contenteditable]${
|
|
18
|
-
`[tabindex]${
|
|
5
|
+
const l$2 = ":not([inert])", u$2 = ':not([tabindex^="-"])', m$2 = ":not(:disabled)", C$2 = [
|
|
6
|
+
`a[href]${l$2}${u$2}`,
|
|
7
|
+
`area[href]${l$2}${u$2}`,
|
|
8
|
+
`input:not([type="hidden"]):not([type="radio"])${l$2}${u$2}${m$2}`,
|
|
9
|
+
`input[type="radio"]${l$2}${u$2}${m$2}`,
|
|
10
|
+
`select${l$2}${u$2}${m$2}`,
|
|
11
|
+
`textarea${l$2}${u$2}${m$2}`,
|
|
12
|
+
`button${l$2}${u$2}${m$2}`,
|
|
13
|
+
`details${l$2} > summary:first-of-type${u$2}`,
|
|
14
|
+
`iframe${l$2}${u$2}`,
|
|
15
|
+
`audio[controls]${l$2}${u$2}`,
|
|
16
|
+
`video[controls]${l$2}${u$2}`,
|
|
17
|
+
`[contenteditable]${l$2}${u$2}`,
|
|
18
|
+
`[tabindex]${l$2}${u$2}`
|
|
19
19
|
];
|
|
20
|
-
function
|
|
21
|
-
const
|
|
22
|
-
return
|
|
20
|
+
function x$2(i, t = "config") {
|
|
21
|
+
const o = (i.getAttribute(`data-${t}`) || "").replace(/'/g, '"');
|
|
22
|
+
return o ? JSON.parse(o) : {};
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
if (typeof
|
|
26
|
-
const t = document.getElementById(
|
|
24
|
+
function v$2(i) {
|
|
25
|
+
if (typeof i == "string") {
|
|
26
|
+
const t = document.getElementById(i);
|
|
27
27
|
if (t) return t;
|
|
28
|
-
throw new Error(`Element not found with ID: "${
|
|
29
|
-
} else if (
|
|
30
|
-
if (!
|
|
28
|
+
throw new Error(`Element not found with ID: "${i}"`);
|
|
29
|
+
} else if (i instanceof HTMLElement) {
|
|
30
|
+
if (!i.id)
|
|
31
31
|
throw new Error("HTMLElement must have an ID");
|
|
32
|
-
return
|
|
32
|
+
return i;
|
|
33
33
|
} else
|
|
34
34
|
throw new Error("Invalid argument: query must be a string or HTMLElement");
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
function h$2(i, ...t) {
|
|
37
|
+
return typeof i == "function" ? i(...t) : i;
|
|
38
|
+
}
|
|
39
|
+
async function g$2(i, t, ...e) {
|
|
40
|
+
t in i && typeof i[t] == "function" && await i[t](...e);
|
|
38
41
|
}
|
|
39
|
-
function
|
|
42
|
+
function k$3(i, t, e) {
|
|
40
43
|
if (typeof t == "string") {
|
|
41
44
|
const r2 = document.querySelector(t);
|
|
42
45
|
if (!r2)
|
|
@@ -46,121 +49,143 @@
|
|
|
46
49
|
throw new Error(`Not a valid teleport reference: '${t}'`);
|
|
47
50
|
if (typeof t[e] != "function")
|
|
48
51
|
throw new Error(`Not a valid teleport method: '${e}'`);
|
|
49
|
-
let
|
|
50
|
-
"teleported #" +
|
|
52
|
+
let o = document.createComment(
|
|
53
|
+
"teleported #" + i.id
|
|
51
54
|
);
|
|
52
|
-
return
|
|
53
|
-
|
|
55
|
+
return i.before(o), t[e](i), () => {
|
|
56
|
+
o && (o.after(i), o.remove(), o = null);
|
|
54
57
|
};
|
|
55
58
|
}
|
|
56
|
-
function
|
|
57
|
-
return
|
|
59
|
+
function R$1(i) {
|
|
60
|
+
return i.split("-").map(
|
|
58
61
|
(t, e) => e === 0 ? t : t.charAt(0).toUpperCase() + t.slice(1)
|
|
59
62
|
).join("");
|
|
60
63
|
}
|
|
61
|
-
function
|
|
62
|
-
return
|
|
64
|
+
function M$2(i) {
|
|
65
|
+
return i.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
63
66
|
}
|
|
64
|
-
function
|
|
65
|
-
if (typeof
|
|
66
|
-
return
|
|
67
|
-
const t = parseFloat(
|
|
67
|
+
function A$3(i) {
|
|
68
|
+
if (typeof i == "number")
|
|
69
|
+
return i;
|
|
70
|
+
const t = parseFloat(i);
|
|
68
71
|
if (!Number.isNaN(t)) {
|
|
69
|
-
const e =
|
|
72
|
+
const e = i.includes("ms");
|
|
70
73
|
return t * (e ? 1 : 1e3);
|
|
71
74
|
}
|
|
72
|
-
throw new Error(`Could not convert value to milliseconds: ${
|
|
75
|
+
throw new Error(`Could not convert value to milliseconds: ${i}`);
|
|
73
76
|
}
|
|
74
|
-
function
|
|
75
|
-
return new Promise((
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
},
|
|
77
|
+
function W$1(i, t, e, o, r2 = 0) {
|
|
78
|
+
return new Promise((n) => {
|
|
79
|
+
i.classList.remove(t), i.classList.add(e), setTimeout(() => {
|
|
80
|
+
i.classList.add(o), i.classList.remove(e), n(i);
|
|
81
|
+
}, A$3(r2));
|
|
79
82
|
});
|
|
80
83
|
}
|
|
81
|
-
function
|
|
84
|
+
function S$3(i, t = {}) {
|
|
82
85
|
const e = {
|
|
83
86
|
fallback: null,
|
|
84
87
|
element: document.body,
|
|
85
88
|
...t
|
|
86
89
|
};
|
|
87
|
-
if (!
|
|
90
|
+
if (!i.startsWith("--")) {
|
|
88
91
|
const r2 = y$2();
|
|
89
|
-
r2 && (
|
|
92
|
+
r2 && (i = `${r2}${i}`), i = `--${i}`;
|
|
90
93
|
}
|
|
91
|
-
const
|
|
92
|
-
if (
|
|
93
|
-
return
|
|
94
|
+
const o = getComputedStyle(e.element).getPropertyValue(i).trim();
|
|
95
|
+
if (o)
|
|
96
|
+
return o;
|
|
94
97
|
if (e.fallback)
|
|
95
98
|
return e.fallback;
|
|
96
|
-
throw new Error(`CSS variable "${
|
|
99
|
+
throw new Error(`CSS variable "${i}" was not found!`);
|
|
97
100
|
}
|
|
98
|
-
async function
|
|
99
|
-
await g$
|
|
100
|
-
for (const
|
|
101
|
-
await g$
|
|
102
|
-
await t.emit(
|
|
101
|
+
async function d$1(i, t, e) {
|
|
102
|
+
await g$2(t, i, e), e && await g$2(e, i);
|
|
103
|
+
for (const o of t.plugins)
|
|
104
|
+
await g$2(o, i, { parent: t, entry: e });
|
|
105
|
+
await t.emit(i, { parent: t, entry: e });
|
|
103
106
|
}
|
|
104
|
-
function
|
|
105
|
-
const t = getComputedStyle(
|
|
106
|
-
for (let r2 = 0; r2 <
|
|
107
|
-
const
|
|
108
|
-
|
|
107
|
+
function b$2(i) {
|
|
108
|
+
const t = getComputedStyle(i.el), e = {}, o = i.config.get("customProps");
|
|
109
|
+
for (let r2 = 0; r2 < o.length; r2++) {
|
|
110
|
+
const n = y$2(), s = i.parent.name.toLowerCase(), c2 = M$2(o[r2]), a2 = t.getPropertyValue(`--${n}${s}-${c2}`).trim();
|
|
111
|
+
a2 && (e[R$1(c2)] = a2);
|
|
109
112
|
}
|
|
110
113
|
return e;
|
|
111
114
|
}
|
|
112
115
|
function y$2() {
|
|
113
116
|
return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
|
|
114
117
|
}
|
|
115
|
-
function P$3(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
function A$2(n, t = {}) {
|
|
119
|
-
const {
|
|
120
|
-
fallback: e,
|
|
121
|
-
props: s = ["dataConfig", "customProps", "settings", "parent.settings"]
|
|
122
|
-
} = t;
|
|
123
|
-
for (const r2 of s) {
|
|
124
|
-
const a2 = r2 !== "customProps" ? "camel" : "kebab", o = P$3.call(this, r2, n, a2);
|
|
125
|
-
if (o !== void 0)
|
|
126
|
-
return o;
|
|
127
|
-
}
|
|
128
|
-
if (e !== void 0)
|
|
129
|
-
return e;
|
|
130
|
-
throw new Error(`${this.parent.module} setting does not exist: ${n}`);
|
|
131
|
-
}
|
|
132
|
-
function T$3(n, t) {
|
|
133
|
-
t && document.querySelectorAll(t).forEach((s) => {
|
|
134
|
-
n ? s.style.overflow = "hidden" : s.style.removeProperty("overflow");
|
|
118
|
+
function P$3(i, t) {
|
|
119
|
+
t && document.querySelectorAll(t).forEach((o) => {
|
|
120
|
+
i ? o.style.overflow = "hidden" : o.style.removeProperty("overflow");
|
|
135
121
|
});
|
|
136
122
|
}
|
|
137
|
-
function
|
|
138
|
-
t && document.querySelectorAll(t).forEach((
|
|
139
|
-
|
|
123
|
+
function T$2(i, t) {
|
|
124
|
+
t && document.querySelectorAll(t).forEach((o) => {
|
|
125
|
+
o.inert = i;
|
|
140
126
|
});
|
|
141
127
|
}
|
|
142
|
-
function
|
|
143
|
-
|
|
128
|
+
function Z(i, t, e) {
|
|
129
|
+
T$2(!!i, t), P$3(!!i, e);
|
|
144
130
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
131
|
+
let I$3 = class I {
|
|
132
|
+
#t;
|
|
133
|
+
#e;
|
|
134
|
+
constructor() {
|
|
135
|
+
this.#t = {}, this.#e = [];
|
|
136
|
+
}
|
|
137
|
+
get(t, e) {
|
|
138
|
+
const { fallback: o, source: r2 } = e ?? {};
|
|
139
|
+
if (r2) {
|
|
140
|
+
const n = this.#t?.[r2]?.[t];
|
|
141
|
+
if (n !== void 0)
|
|
142
|
+
return n;
|
|
143
|
+
} else
|
|
144
|
+
for (const n of this.#e) {
|
|
145
|
+
const s = this.#t?.[n]?.[t];
|
|
146
|
+
if (s !== void 0)
|
|
147
|
+
return s;
|
|
148
|
+
}
|
|
149
|
+
if (o !== void 0)
|
|
150
|
+
return o;
|
|
151
|
+
throw new Error(`Config does not exist: ${t}`);
|
|
152
|
+
}
|
|
153
|
+
set(t, e = {}) {
|
|
154
|
+
let o, r2;
|
|
155
|
+
return typeof t == "string" ? (o = t, r2 = e) : (o = "entry", r2 = t), this.#t[o] ? Object.assign(this.#t[o], r2) : (this.#e.unshift(o), this.#t[o] = r2), this.#t[o];
|
|
156
|
+
}
|
|
157
|
+
remove(t) {
|
|
158
|
+
const e = this.#e.indexOf(t);
|
|
159
|
+
e !== -1 && this.#e.splice(e, 1), delete this.#t[t];
|
|
160
|
+
}
|
|
161
|
+
setSourceOrder(t) {
|
|
162
|
+
const e = Object.keys(this.#t).reverse(), o = t.filter((r2) => e.includes(r2));
|
|
163
|
+
for (const r2 of e)
|
|
164
|
+
o.includes(r2) || o.push(r2);
|
|
165
|
+
return this.#e = o;
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
let L$2 = class L {
|
|
169
|
+
constructor() {
|
|
170
|
+
this.events = {};
|
|
171
|
+
}
|
|
172
|
+
on(t, e, ...o) {
|
|
173
|
+
this.events[t] || (this.events[t] = []), this.events[t].some(
|
|
174
|
+
(n) => n.listener === e
|
|
175
|
+
) || this.events[t].push({ listener: e, args: o });
|
|
176
|
+
}
|
|
177
|
+
off(t, e) {
|
|
178
|
+
this.events[t] && (this.events[t] = this.events[t].filter(
|
|
179
|
+
(o) => o.listener !== e
|
|
155
180
|
));
|
|
156
|
-
}
|
|
157
|
-
async emit(
|
|
158
|
-
if (
|
|
159
|
-
for (const { listener:
|
|
160
|
-
await e
|
|
181
|
+
}
|
|
182
|
+
async emit(t, ...e) {
|
|
183
|
+
if (t = t.startsWith("on") ? t.slice(2, 3).toLowerCase() + t.slice(3) : t, !!this.events[t])
|
|
184
|
+
for (const { listener: o, args: r2 } of this.events[t])
|
|
185
|
+
await o(...e, ...r2);
|
|
161
186
|
}
|
|
162
187
|
};
|
|
163
|
-
let
|
|
188
|
+
let U$1 = class U extends Array {
|
|
164
189
|
constructor(t = null) {
|
|
165
190
|
super(), this.el = t, this.el && this.set();
|
|
166
191
|
}
|
|
@@ -177,70 +202,70 @@
|
|
|
177
202
|
this.length = 0;
|
|
178
203
|
}
|
|
179
204
|
};
|
|
180
|
-
let
|
|
205
|
+
let D$2 = class D {
|
|
181
206
|
constructor(t = null) {
|
|
182
|
-
this.el = t, this.focusable = new
|
|
207
|
+
this.el = t, this.focusable = new U$1(), this.handleFocusTrap = O$2.bind(this);
|
|
183
208
|
}
|
|
184
209
|
on(t = this.el) {
|
|
185
|
-
this.focusable.set(t), this.focusable.length ? document.addEventListener("keydown", this.handleFocusTrap) : document.addEventListener("keydown",
|
|
210
|
+
this.focusable.set(t), this.focusable.length ? document.addEventListener("keydown", this.handleFocusTrap) : document.addEventListener("keydown", $$2);
|
|
186
211
|
}
|
|
187
212
|
off() {
|
|
188
|
-
this.focusable.clear(), document.removeEventListener("keydown", this.handleFocusTrap), document.removeEventListener("keydown",
|
|
213
|
+
this.focusable.clear(), document.removeEventListener("keydown", this.handleFocusTrap), document.removeEventListener("keydown", $$2);
|
|
189
214
|
}
|
|
190
215
|
};
|
|
191
|
-
function
|
|
192
|
-
(
|
|
216
|
+
function $$2(i) {
|
|
217
|
+
(i.key === "Tab" || i.keyCode === 9) && i.preventDefault();
|
|
193
218
|
}
|
|
194
|
-
function
|
|
195
|
-
if (
|
|
196
|
-
const { activeElement: t } = document, { el: e, focusable:
|
|
197
|
-
if (r2 &&
|
|
198
|
-
|
|
199
|
-
const
|
|
200
|
-
|
|
219
|
+
function O$2(i) {
|
|
220
|
+
if (i.key !== "Tab" && i.keyCode !== 9) return;
|
|
221
|
+
const { activeElement: t } = document, { el: e, focusable: o } = this, r2 = i.shiftKey, n = t === o.first || t === e, s = t === o.last || t === e;
|
|
222
|
+
if (r2 && n || !r2 && s) {
|
|
223
|
+
i.preventDefault();
|
|
224
|
+
const c2 = r2 ? o.last : o.first;
|
|
225
|
+
c2 && typeof c2.focus == "function" && c2.focus();
|
|
201
226
|
}
|
|
202
227
|
}
|
|
203
|
-
function w$2(
|
|
204
|
-
const e = localStorage.getItem(
|
|
228
|
+
function w$2(i, t = true) {
|
|
229
|
+
const e = localStorage.getItem(i), o = e ? JSON.parse(e) : {};
|
|
205
230
|
return {
|
|
206
|
-
get(r2,
|
|
207
|
-
return r2 ? r2 in
|
|
231
|
+
get(r2, n) {
|
|
232
|
+
return r2 ? r2 in o ? o[r2] : n : o;
|
|
208
233
|
},
|
|
209
|
-
set(r2,
|
|
210
|
-
return
|
|
234
|
+
set(r2, n) {
|
|
235
|
+
return n ? o[r2] = n : delete o[r2], t && localStorage.setItem(i, JSON.stringify(o)), o;
|
|
211
236
|
}
|
|
212
237
|
};
|
|
213
238
|
}
|
|
214
|
-
|
|
239
|
+
class H extends Array {
|
|
215
240
|
constructor(t = {}) {
|
|
216
241
|
super(), this.presets = t;
|
|
217
242
|
}
|
|
218
|
-
|
|
219
|
-
const e =
|
|
220
|
-
t.
|
|
243
|
+
#t(t) {
|
|
244
|
+
const e = this.presets?.[t.name] || {}, o = t?.options || {};
|
|
245
|
+
t.config = { ...t.config, ...e, ...o };
|
|
221
246
|
}
|
|
222
|
-
|
|
247
|
+
#e(t) {
|
|
223
248
|
return !("name" in t) || typeof t.name != "string" ? (console.error("Plugin requires a name!"), false) : true;
|
|
224
249
|
}
|
|
225
250
|
get(t) {
|
|
226
|
-
return this.find((e) => e.name === t);
|
|
251
|
+
return this.find((e) => e.name === t) || null;
|
|
227
252
|
}
|
|
228
253
|
add(t) {
|
|
229
254
|
if (Array.isArray(t))
|
|
230
255
|
t.forEach((e) => this.add(e));
|
|
231
|
-
else if (this
|
|
232
|
-
const e = this.findIndex((
|
|
256
|
+
else if (this.#t(t), this.#e(t)) {
|
|
257
|
+
const e = this.findIndex((o) => o.name === t.name);
|
|
233
258
|
~e ? this[e] = t : this.push(t);
|
|
234
259
|
}
|
|
235
260
|
}
|
|
236
261
|
remove(t) {
|
|
237
|
-
const e = this.findIndex((
|
|
262
|
+
const e = this.findIndex((o) => o.name === t);
|
|
238
263
|
~e && this.splice(e, 1);
|
|
239
264
|
}
|
|
240
|
-
}
|
|
241
|
-
class
|
|
265
|
+
}
|
|
266
|
+
class _ extends Array {
|
|
242
267
|
constructor(t = {}) {
|
|
243
|
-
super(), this.
|
|
268
|
+
super(), this.config = t;
|
|
244
269
|
}
|
|
245
270
|
get copy() {
|
|
246
271
|
return [...this];
|
|
@@ -252,49 +277,104 @@
|
|
|
252
277
|
updateIndex() {
|
|
253
278
|
this.forEach((t, e) => {
|
|
254
279
|
t.el.style.zIndex = "";
|
|
255
|
-
const
|
|
256
|
-
t.el.style.zIndex =
|
|
280
|
+
const o = getComputedStyle(t.el).getPropertyValue("z-index"), r2 = parseInt(o, 10), n = String((Number.isNaN(r2) ? 0 : r2) + e + 1);
|
|
281
|
+
t.el.style.zIndex = n;
|
|
257
282
|
});
|
|
258
283
|
}
|
|
259
284
|
onChange() {
|
|
260
|
-
this.updateIndex(), typeof this.
|
|
285
|
+
this.updateIndex(), typeof this.config.onChange == "function" && this.config.onChange();
|
|
261
286
|
}
|
|
262
287
|
add(t) {
|
|
263
288
|
this.push(t), this.onChange();
|
|
264
289
|
}
|
|
265
290
|
remove(t) {
|
|
266
|
-
const e = this.findIndex((
|
|
291
|
+
const e = this.findIndex((o) => o.id === t.id);
|
|
267
292
|
~e && (t.el.style.zIndex = "", this.splice(e, 1), this.onChange());
|
|
268
293
|
}
|
|
269
294
|
moveToTop(t) {
|
|
270
|
-
const e = this.findIndex((
|
|
295
|
+
const e = this.findIndex((o) => o.id === t.id);
|
|
271
296
|
~e && (this.splice(e, 1), this.add(t));
|
|
272
297
|
}
|
|
273
298
|
}
|
|
274
299
|
const N$1 = {
|
|
300
|
+
attr: "config",
|
|
301
|
+
sourceKey: "attr"
|
|
302
|
+
};
|
|
303
|
+
function X$1(i = {}) {
|
|
304
|
+
return { ...{
|
|
305
|
+
name: "attrConfig",
|
|
306
|
+
config: N$1,
|
|
307
|
+
options: i
|
|
308
|
+
}, ...{
|
|
309
|
+
onCreateEntry({ entry: o }) {
|
|
310
|
+
const r2 = x$2(o.el, this.config.attr);
|
|
311
|
+
o.config.set(this.config.sourceKey, r2);
|
|
312
|
+
},
|
|
313
|
+
onDestroyEntry({ entry: o }) {
|
|
314
|
+
o.config.remove(this.config.sourceKey);
|
|
315
|
+
}
|
|
316
|
+
} };
|
|
317
|
+
}
|
|
318
|
+
const K$1 = {
|
|
319
|
+
sourceKey: "css"
|
|
320
|
+
};
|
|
321
|
+
function Y$1(i = {}) {
|
|
322
|
+
const t = {
|
|
323
|
+
name: "cssConfig",
|
|
324
|
+
config: K$1,
|
|
325
|
+
options: i
|
|
326
|
+
}, e = {
|
|
327
|
+
setup(r2) {
|
|
328
|
+
r2.on("updateCustomProps", o, this);
|
|
329
|
+
},
|
|
330
|
+
teardown(r2) {
|
|
331
|
+
r2.off("updateCustomProps", o);
|
|
332
|
+
},
|
|
333
|
+
onCreateEntry({ entry: r2 }) {
|
|
334
|
+
const n = b$2(r2);
|
|
335
|
+
r2.config.set(this.config.sourceKey, n);
|
|
336
|
+
},
|
|
337
|
+
onDestroyEntry({ entry: r2 }) {
|
|
338
|
+
r2.config.remove(this.config.sourceKey);
|
|
339
|
+
}
|
|
340
|
+
};
|
|
341
|
+
function o(r2, n) {
|
|
342
|
+
const s = b$2(r2);
|
|
343
|
+
r2.config.set(n.config.sourceKey, s);
|
|
344
|
+
}
|
|
345
|
+
return { ...t, ...e };
|
|
346
|
+
}
|
|
347
|
+
const Q = {
|
|
275
348
|
condition: true
|
|
276
|
-
},
|
|
349
|
+
}, q$2 = {
|
|
277
350
|
primary: "hsl(152deg 60% 50%)",
|
|
278
351
|
secondary: "hsl(214deg 50% 50%)",
|
|
279
352
|
neutral: "hsl(214deg 20% 50%)",
|
|
280
353
|
important: "hsl(0deg 80% 50%)"
|
|
281
354
|
};
|
|
282
|
-
function
|
|
355
|
+
function tt$1(i = {}) {
|
|
283
356
|
const t = {
|
|
284
357
|
name: "debug",
|
|
285
|
-
|
|
286
|
-
options:
|
|
358
|
+
config: Q,
|
|
359
|
+
options: i
|
|
287
360
|
};
|
|
288
|
-
function e(
|
|
289
|
-
const
|
|
290
|
-
console.log(`%c📡 DEBUG: %c${
|
|
291
|
-
}
|
|
292
|
-
function s(o, ...i) {
|
|
293
|
-
return typeof o == "function" ? o(...i) : o;
|
|
361
|
+
function e(n, s = [], c2 = ["primary", "secondary"]) {
|
|
362
|
+
const a2 = c2.map((f2) => `color: ${q$2[f2]}`);
|
|
363
|
+
console.log(`%c📡 DEBUG: %c${n}`, ...a2, ...s);
|
|
294
364
|
}
|
|
295
|
-
const
|
|
296
|
-
beforeMountRef: e.bind(
|
|
297
|
-
|
|
365
|
+
const o = {
|
|
366
|
+
beforeMountRef: e.bind(
|
|
367
|
+
null,
|
|
368
|
+
"Event > beforeMount()",
|
|
369
|
+
[],
|
|
370
|
+
["primary", "secondary"]
|
|
371
|
+
),
|
|
372
|
+
afterMountRef: e.bind(
|
|
373
|
+
null,
|
|
374
|
+
"Event > afterMount()",
|
|
375
|
+
[],
|
|
376
|
+
["primary", "secondary"]
|
|
377
|
+
),
|
|
298
378
|
beforeUnmountRef: e.bind(
|
|
299
379
|
null,
|
|
300
380
|
"Event > beforeUnmount()",
|
|
@@ -307,33 +387,33 @@
|
|
|
307
387
|
[],
|
|
308
388
|
["important", "neutral"]
|
|
309
389
|
),
|
|
310
|
-
createEntryRef: (
|
|
311
|
-
if (
|
|
312
|
-
const
|
|
313
|
-
e(`Event > createEntry() > [${
|
|
390
|
+
createEntryRef: ({ parent: n, entry: s }, c2) => {
|
|
391
|
+
if (h$2(c2.config.condition, s)) {
|
|
392
|
+
const a2 = n.collection.length;
|
|
393
|
+
e(`Event > createEntry() > [${a2}] #${s.id}`);
|
|
314
394
|
}
|
|
315
395
|
},
|
|
316
|
-
registerEntryRef: (
|
|
317
|
-
if (
|
|
318
|
-
const
|
|
319
|
-
e(`Event > registerEntry() > [${
|
|
396
|
+
registerEntryRef: ({ parent: n, entry: s }, c2) => {
|
|
397
|
+
if (h$2(c2.config.condition, s)) {
|
|
398
|
+
const a2 = n.collection.length;
|
|
399
|
+
e(`Event > registerEntry() > [${a2}] #${s.id}`);
|
|
320
400
|
}
|
|
321
401
|
},
|
|
322
|
-
destroyEntryRef: (
|
|
323
|
-
if (
|
|
324
|
-
const
|
|
402
|
+
destroyEntryRef: ({ parent: n, entry: s }, c2) => {
|
|
403
|
+
if (h$2(c2.config.condition, s)) {
|
|
404
|
+
const a2 = n.collection.length;
|
|
325
405
|
e(
|
|
326
|
-
`Event > destroyEntry() > [${
|
|
406
|
+
`Event > destroyEntry() > [${a2}] #${s.id}`,
|
|
327
407
|
[],
|
|
328
408
|
["important", "neutral"]
|
|
329
409
|
);
|
|
330
410
|
}
|
|
331
411
|
},
|
|
332
|
-
deregisterEntryRef: (
|
|
333
|
-
if (
|
|
334
|
-
const
|
|
412
|
+
deregisterEntryRef: ({ parent: n, entry: s }, c2) => {
|
|
413
|
+
if (h$2(c2.config.condition, s)) {
|
|
414
|
+
const a2 = n.collection.length;
|
|
335
415
|
e(
|
|
336
|
-
`Event > deregisterEntry() > [${
|
|
416
|
+
`Event > deregisterEntry() > [${a2}]`,
|
|
337
417
|
[],
|
|
338
418
|
["important", "neutral"]
|
|
339
419
|
);
|
|
@@ -342,39 +422,33 @@
|
|
|
342
422
|
};
|
|
343
423
|
return { ...t, ...{
|
|
344
424
|
// Plugin setup/teardown methods
|
|
345
|
-
setup(
|
|
346
|
-
e("Plugin > setup()", Array.from(arguments), ["secondary", "neutral"]),
|
|
347
|
-
parent: o,
|
|
348
|
-
plugin: this
|
|
349
|
-
}), o.on("afterMount", r2.afterMountRef), o.on("beforeUnmount", r2.beforeUnmountRef), o.on("destroyEntry", r2.destroyEntryRef, { parent: o, plugin: this }), o.on("deregisterEntry", r2.deregisterEntryRef, {
|
|
350
|
-
parent: o,
|
|
351
|
-
plugin: this
|
|
352
|
-
}), o.on("afterUnmount", r2.afterUnmountRef);
|
|
425
|
+
setup(n) {
|
|
426
|
+
e("Plugin > setup()", Array.from(arguments), ["secondary", "neutral"]), n.on("beforeMount", o.beforeMountRef), n.on("createEntry", o.createEntryRef, this), n.on("registerEntry", o.registerEntryRef, this), n.on("afterMount", o.afterMountRef), n.on("beforeUnmount", o.beforeUnmountRef), n.on("destroyEntry", o.destroyEntryRef, this), n.on("deregisterEntry", o.deregisterEntryRef, this), n.on("afterUnmount", o.afterUnmountRef);
|
|
353
427
|
},
|
|
354
|
-
teardown(
|
|
428
|
+
teardown(n) {
|
|
355
429
|
e("Plugin > teardown()", Array.from(arguments), [
|
|
356
430
|
"secondary",
|
|
357
431
|
"neutral"
|
|
358
|
-
]),
|
|
432
|
+
]), n.off("beforeMount", o.beforeMountRef), n.off("createEntry", o.createEntryRef), n.off("registerEntry", o.registerEntryRef), n.off("afterMount", o.afterMountRef), n.off("beforeUnmount", o.beforeUnmountRef), n.off("destroyEntry", o.destroyEntryRef), n.off("deregisterEntry", o.deregisterEntryRef), n.off("afterUnmount", o.afterUnmountRef);
|
|
359
433
|
},
|
|
360
434
|
// Mount lifecycle hooks
|
|
361
435
|
beforeMount() {
|
|
362
436
|
e("Hook > beforeMount()", Array.from(arguments));
|
|
363
437
|
},
|
|
364
|
-
onCreateEntry({ parent:
|
|
365
|
-
if (
|
|
366
|
-
const c2 =
|
|
438
|
+
onCreateEntry({ parent: n, entry: s }) {
|
|
439
|
+
if (h$2(this.config.condition, s)) {
|
|
440
|
+
const c2 = n.collection.length;
|
|
367
441
|
e(
|
|
368
|
-
`Hook > onCreateEntry() > [${c2}] #${
|
|
442
|
+
`Hook > onCreateEntry() > [${c2}] #${s.id}`,
|
|
369
443
|
Array.from(arguments)
|
|
370
444
|
);
|
|
371
445
|
}
|
|
372
446
|
},
|
|
373
|
-
onRegisterEntry({ parent:
|
|
374
|
-
if (
|
|
375
|
-
const c2 =
|
|
447
|
+
onRegisterEntry({ parent: n, entry: s }) {
|
|
448
|
+
if (h$2(this.config.condition, s)) {
|
|
449
|
+
const c2 = n.collection.length - 1;
|
|
376
450
|
e(
|
|
377
|
-
`Hook > onRegisterEntry() > [${c2}] #${
|
|
451
|
+
`Hook > onRegisterEntry() > [${c2}] #${s.id}`,
|
|
378
452
|
Array.from(arguments)
|
|
379
453
|
);
|
|
380
454
|
}
|
|
@@ -389,19 +463,19 @@
|
|
|
389
463
|
"neutral"
|
|
390
464
|
]);
|
|
391
465
|
},
|
|
392
|
-
onDestroyEntry({ parent:
|
|
393
|
-
if (
|
|
394
|
-
const c2 =
|
|
466
|
+
onDestroyEntry({ parent: n, entry: s }) {
|
|
467
|
+
if (h$2(this.config.condition, s)) {
|
|
468
|
+
const c2 = n.collection.length - 1;
|
|
395
469
|
e(
|
|
396
|
-
`Hook > onDestroyEntry() > [${c2}] #${
|
|
470
|
+
`Hook > onDestroyEntry() > [${c2}] #${s.id}`,
|
|
397
471
|
Array.from(arguments),
|
|
398
472
|
["important", "neutral"]
|
|
399
473
|
);
|
|
400
474
|
}
|
|
401
475
|
},
|
|
402
|
-
onDeregisterEntry({ parent:
|
|
403
|
-
if (
|
|
404
|
-
const c2 =
|
|
476
|
+
onDeregisterEntry({ parent: n, entry: s }) {
|
|
477
|
+
if (h$2(this.config.condition, s)) {
|
|
478
|
+
const c2 = n.collection.length;
|
|
405
479
|
e(`Hook > onDeregisterEntry() > [${c2}]`, Array.from(arguments), [
|
|
406
480
|
"important",
|
|
407
481
|
"neutral"
|
|
@@ -416,43 +490,40 @@
|
|
|
416
490
|
}
|
|
417
491
|
} };
|
|
418
492
|
}
|
|
419
|
-
const
|
|
493
|
+
const F$1 = {
|
|
420
494
|
condition: true
|
|
421
495
|
};
|
|
422
|
-
function
|
|
496
|
+
function et$1(i = {}) {
|
|
423
497
|
const t = {
|
|
424
498
|
name: "focusTrap",
|
|
425
|
-
|
|
426
|
-
options:
|
|
499
|
+
config: F$1,
|
|
500
|
+
options: i
|
|
427
501
|
}, e = {
|
|
428
|
-
setup(
|
|
429
|
-
|
|
502
|
+
setup(n) {
|
|
503
|
+
n.on("opened", o, this), n.on("closed", r2, this);
|
|
430
504
|
},
|
|
431
|
-
teardown(
|
|
432
|
-
|
|
505
|
+
teardown(n) {
|
|
506
|
+
n.off("opened", o), n.off("closed", r2);
|
|
433
507
|
},
|
|
434
|
-
onCreateEntry({ entry:
|
|
435
|
-
|
|
508
|
+
onCreateEntry({ entry: n }) {
|
|
509
|
+
n.focusTrap = new D$2();
|
|
436
510
|
}
|
|
437
511
|
};
|
|
438
|
-
function
|
|
439
|
-
|
|
512
|
+
function o(n, s) {
|
|
513
|
+
const c2 = { plugin: s, parent: n.parent, entry: n };
|
|
514
|
+
n.focusTrap && h$2(s.config.condition, c2) && n.focusTrap.on(n.dialog);
|
|
440
515
|
}
|
|
441
|
-
function r2(
|
|
442
|
-
const c2 = { plugin:
|
|
443
|
-
s
|
|
444
|
-
}
|
|
445
|
-
function a2(o, i) {
|
|
446
|
-
const c2 = { plugin: i, parent: o.parent, entry: o };
|
|
447
|
-
s(i.settings.condition, c2) && o.focusTrap?.off();
|
|
516
|
+
function r2(n, s) {
|
|
517
|
+
const c2 = { plugin: s, parent: n.parent, entry: n };
|
|
518
|
+
n.focusTrap && h$2(s.config.condition, c2) && n.focusTrap.off();
|
|
448
519
|
}
|
|
449
520
|
return { ...t, ...e };
|
|
450
521
|
}
|
|
451
|
-
const
|
|
522
|
+
const V = {
|
|
452
523
|
// The data attributes to get the breakpoint values from
|
|
453
|
-
|
|
524
|
+
attrBreakpoint: "breakpoint",
|
|
454
525
|
// The data attributes to get the media query value from
|
|
455
|
-
|
|
526
|
+
attrMediaQuery: "media-query",
|
|
456
527
|
// The string token to replace in the media query string
|
|
457
528
|
token: "{{BP}}",
|
|
458
529
|
// Sets a global breakpoint. Can be overridden by setting a data attribute
|
|
@@ -473,47 +544,47 @@
|
|
|
473
544
|
onChange: () => {
|
|
474
545
|
}
|
|
475
546
|
};
|
|
476
|
-
function
|
|
547
|
+
function ot$1(i = {}) {
|
|
477
548
|
const t = {
|
|
478
549
|
name: "mediaQuery",
|
|
479
|
-
|
|
480
|
-
options:
|
|
550
|
+
config: V,
|
|
551
|
+
options: i
|
|
481
552
|
}, e = {
|
|
482
553
|
// Run when an entry is created
|
|
483
554
|
// Sets up the MediaQueryList and event listener
|
|
484
|
-
onCreateEntry({ entry:
|
|
485
|
-
|
|
555
|
+
onCreateEntry({ entry: c2 }) {
|
|
556
|
+
n.call(this, c2);
|
|
486
557
|
},
|
|
487
558
|
// Run when an entry is destroyed
|
|
488
559
|
// Removes the MediaQueryList and event listener
|
|
489
|
-
onDestroyEntry({ entry:
|
|
490
|
-
|
|
560
|
+
onDestroyEntry({ entry: c2 }) {
|
|
561
|
+
s(c2);
|
|
491
562
|
}
|
|
492
563
|
};
|
|
493
|
-
function
|
|
494
|
-
const
|
|
495
|
-
return !
|
|
496
|
-
}
|
|
497
|
-
function r2(
|
|
498
|
-
let
|
|
499
|
-
return !
|
|
500
|
-
}
|
|
501
|
-
function
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
const
|
|
507
|
-
|
|
508
|
-
this.
|
|
509
|
-
}, this.
|
|
510
|
-
}
|
|
511
|
-
function
|
|
512
|
-
|
|
564
|
+
function o(c2) {
|
|
565
|
+
const a2 = c2.el.getAttribute(`data-${this.config.attrMediaQuery}`);
|
|
566
|
+
return !a2 && c2.id in this.config.mediaQueries ? this.config.mediaQueries[c2.id] : a2 || void 0;
|
|
567
|
+
}
|
|
568
|
+
function r2(c2) {
|
|
569
|
+
let a2 = c2.el.getAttribute(`data-${this.config.attrBreakpoint}`);
|
|
570
|
+
return !a2 && c2.id in this.config.breakpoints && (a2 = this.config.breakpoints[c2.id]), a2 && a2 in this.config.breakpoints && (a2 = this.config.breakpoints[a2]), a2 && (a2 = getComputedStyle(document.body).getPropertyValue(`--${y$2()}breakpoint-${a2}`).trim() || a2), a2 || this.config.breakpoint;
|
|
571
|
+
}
|
|
572
|
+
function n(c2) {
|
|
573
|
+
const a2 = r2.call(this, c2);
|
|
574
|
+
if (!a2) return;
|
|
575
|
+
let f2 = o.call(this, c2) || this.config.mediaQuery;
|
|
576
|
+
if (!f2) return;
|
|
577
|
+
const p2 = f2.replace(new RegExp(`${this.config.token}`, "g"), a2);
|
|
578
|
+
c2.mql = window.matchMedia(p2), c2.mql.onchange = (E2) => {
|
|
579
|
+
this.config.onChange(E2, c2);
|
|
580
|
+
}, this.config.onChange(c2.mql, c2);
|
|
581
|
+
}
|
|
582
|
+
function s(c2) {
|
|
583
|
+
c2.mql && (c2.mql.onchange = null, c2.mql = null);
|
|
513
584
|
}
|
|
514
585
|
return { ...t, ...e };
|
|
515
586
|
}
|
|
516
|
-
const
|
|
587
|
+
const B = {
|
|
517
588
|
// The property on entry objects to watch
|
|
518
589
|
prop: "state",
|
|
519
590
|
// The default value or a function to compute the initial value
|
|
@@ -529,289 +600,251 @@
|
|
|
529
600
|
onChange() {
|
|
530
601
|
}
|
|
531
602
|
};
|
|
532
|
-
function
|
|
603
|
+
function nt$1(i = {}) {
|
|
533
604
|
const t = {
|
|
534
605
|
name: "propStore",
|
|
535
|
-
|
|
536
|
-
options:
|
|
606
|
+
config: B,
|
|
607
|
+
options: i,
|
|
537
608
|
store: null
|
|
538
609
|
}, e = {
|
|
539
|
-
setup(
|
|
540
|
-
this.store = w$2(
|
|
610
|
+
setup(s) {
|
|
611
|
+
this.store = w$2(n.call(this, s.name));
|
|
541
612
|
},
|
|
542
|
-
async onCreateEntry({ entry:
|
|
543
|
-
await
|
|
613
|
+
async onCreateEntry({ entry: s }) {
|
|
614
|
+
await o.call(this, s);
|
|
544
615
|
},
|
|
545
|
-
onDestroyEntry({ entry:
|
|
546
|
-
|
|
616
|
+
onDestroyEntry({ entry: s }) {
|
|
617
|
+
r2.call(this, s);
|
|
547
618
|
}
|
|
548
619
|
};
|
|
549
|
-
async function s
|
|
550
|
-
let c2 =
|
|
551
|
-
const
|
|
552
|
-
Object.defineProperty(
|
|
620
|
+
async function o(s) {
|
|
621
|
+
let c2 = s[this.config.prop] || null;
|
|
622
|
+
const a2 = { plugin: this, parent: s.parent, entry: s };
|
|
623
|
+
Object.defineProperty(s, this.config.prop, {
|
|
553
624
|
configurable: true,
|
|
554
625
|
get() {
|
|
555
626
|
return c2;
|
|
556
627
|
},
|
|
557
|
-
set: async (
|
|
558
|
-
if (c2 ===
|
|
628
|
+
set: async (f2) => {
|
|
629
|
+
if (c2 === f2) return;
|
|
559
630
|
const p2 = c2;
|
|
560
|
-
c2 =
|
|
561
|
-
this.
|
|
562
|
-
|
|
563
|
-
|
|
631
|
+
c2 = f2, h$2(
|
|
632
|
+
this.config.condition,
|
|
633
|
+
a2,
|
|
634
|
+
f2,
|
|
564
635
|
p2
|
|
565
|
-
) && this.store
|
|
636
|
+
) && this.store?.set(s.id, f2), await this.config.onChange(a2, f2, p2);
|
|
566
637
|
}
|
|
567
|
-
}), Object.defineProperty(
|
|
638
|
+
}), Object.defineProperty(s, "store", {
|
|
568
639
|
configurable: true,
|
|
569
|
-
get: () => this.store
|
|
570
|
-
set: (
|
|
571
|
-
|
|
640
|
+
get: () => this.store?.get(s.id),
|
|
641
|
+
set: (f2) => {
|
|
642
|
+
s[this.config.prop] = f2;
|
|
572
643
|
}
|
|
573
|
-
}),
|
|
574
|
-
}
|
|
575
|
-
function r2(i, ...c2) {
|
|
576
|
-
return typeof i == "function" ? i(...c2) : i;
|
|
644
|
+
}), s[this.config.prop] = await h$2(this.config.value, a2) || s[this.config.prop];
|
|
577
645
|
}
|
|
578
|
-
async function
|
|
579
|
-
const c2 =
|
|
580
|
-
delete
|
|
646
|
+
async function r2(s) {
|
|
647
|
+
const c2 = s[this.config.prop];
|
|
648
|
+
delete s[this.config.prop], s[this.config.prop] = c2, this.store?.set(s.id, null);
|
|
581
649
|
}
|
|
582
|
-
function
|
|
583
|
-
const c2 = this.
|
|
584
|
-
return this.
|
|
650
|
+
function n(s) {
|
|
651
|
+
const c2 = this.config.prop.charAt(0).toUpperCase() + this.config.prop.slice(1), a2 = this.config.key || s + c2;
|
|
652
|
+
return this.config.keyPrefix + a2;
|
|
585
653
|
}
|
|
586
654
|
return { ...t, ...e };
|
|
587
655
|
}
|
|
588
|
-
const
|
|
656
|
+
const j$1 = {
|
|
589
657
|
where: null,
|
|
590
658
|
how: "append"
|
|
591
659
|
};
|
|
592
|
-
function
|
|
660
|
+
function it$1(i = {}) {
|
|
593
661
|
const t = {
|
|
594
662
|
name: "teleport",
|
|
595
|
-
|
|
596
|
-
options:
|
|
663
|
+
config: j$1,
|
|
664
|
+
options: i
|
|
597
665
|
}, e = {
|
|
598
|
-
onCreateEntry({
|
|
599
|
-
|
|
666
|
+
onCreateEntry({ entry: n }) {
|
|
667
|
+
o(this, n);
|
|
600
668
|
},
|
|
601
|
-
onDestroyEntry({
|
|
602
|
-
r2(
|
|
669
|
+
onDestroyEntry({ entry: n }) {
|
|
670
|
+
r2(this, n);
|
|
603
671
|
}
|
|
604
672
|
};
|
|
605
|
-
function
|
|
606
|
-
|
|
607
|
-
typeof
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
673
|
+
function o(n, s) {
|
|
674
|
+
s.teleport = () => {
|
|
675
|
+
typeof s.teleportReturn == "function" && s.teleportReturn(), s.teleportReturn = k$3(
|
|
676
|
+
s.el,
|
|
677
|
+
s.config.get("teleport", { fallback: n.config.where }),
|
|
678
|
+
s.config.get("teleportMethod", { fallback: n.config.how })
|
|
611
679
|
);
|
|
612
|
-
},
|
|
680
|
+
}, s.teleport(), s.parent.emit("teleport", { plugin: n, parent: s.parent, entry: s });
|
|
613
681
|
}
|
|
614
|
-
function r2(
|
|
615
|
-
typeof
|
|
616
|
-
plugin:
|
|
617
|
-
parent:
|
|
618
|
-
entry:
|
|
682
|
+
function r2(n, s) {
|
|
683
|
+
typeof s.teleportReturn == "function" && s.teleportReturn(), s.parent.emit("teleportReturn", {
|
|
684
|
+
plugin: n,
|
|
685
|
+
parent: s.parent,
|
|
686
|
+
entry: s
|
|
619
687
|
});
|
|
620
688
|
}
|
|
621
689
|
return { ...t, ...e };
|
|
622
690
|
}
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
};
|
|
627
|
-
let z$2 = class z {
|
|
628
|
-
constructor(t, e, s = {}) {
|
|
629
|
-
this.parent = t, this.el = E$3(e), this.settings = { ...s }, this.dataConfig = {}, this.customProps = {};
|
|
630
|
-
}
|
|
631
|
-
get id() {
|
|
632
|
-
return this.el.id;
|
|
633
|
-
}
|
|
634
|
-
applySettings(t) {
|
|
635
|
-
return Object.assign(this.settings, t);
|
|
636
|
-
}
|
|
637
|
-
getSetting(t, e) {
|
|
638
|
-
return A$2.call(this, t, e);
|
|
639
|
-
}
|
|
640
|
-
buildDataConfig() {
|
|
641
|
-
return Object.assign(
|
|
642
|
-
this.dataConfig,
|
|
643
|
-
k$3(this.el, this.getSetting("dataConfig"))
|
|
644
|
-
);
|
|
645
|
-
}
|
|
646
|
-
buildCustomProps() {
|
|
647
|
-
return Object.assign(this.customProps, M$2(this));
|
|
648
|
-
}
|
|
649
|
-
async init(t = {}) {
|
|
650
|
-
this.applySettings(t), this.buildDataConfig(), this.buildCustomProps();
|
|
651
|
-
}
|
|
652
|
-
async destroy() {
|
|
653
|
-
Object.getOwnPropertyNames(this).forEach((t) => {
|
|
654
|
-
delete this[t];
|
|
655
|
-
});
|
|
691
|
+
let z$1 = class z {
|
|
692
|
+
constructor(t, e) {
|
|
693
|
+
this.config = new I$3(), this.parent = t, this.el = v$2(e), this.id = this.el.id, this.config.set("parent", this.parent.config), this.config.set("entry", {});
|
|
656
694
|
}
|
|
657
695
|
};
|
|
658
|
-
|
|
696
|
+
const J$1 = {
|
|
697
|
+
selector: "",
|
|
698
|
+
plugins: [],
|
|
699
|
+
presets: {}
|
|
700
|
+
};
|
|
701
|
+
let st$1 = class st {
|
|
659
702
|
constructor(t = {}) {
|
|
660
|
-
this.
|
|
703
|
+
this.#t = new L$2(), this.events = this.#t.events, this.on = this.#t.on.bind(this.#t), this.off = this.#t.off.bind(this.#t), this.emit = this.#t.emit.bind(this.#t), this.collection = [], this.entryClass = z$1, this.name = this.constructor.name, this.config = { ...J$1, ...t }, this.plugins = new H(this.config.presets);
|
|
661
704
|
}
|
|
705
|
+
#t;
|
|
662
706
|
get(t, e = "id") {
|
|
663
|
-
return this.collection.find((
|
|
707
|
+
return this.collection.find((o) => o[e] === t);
|
|
664
708
|
}
|
|
665
709
|
getOrThrow(t, e = "id") {
|
|
666
|
-
const
|
|
667
|
-
if (
|
|
668
|
-
return
|
|
710
|
+
const o = this.get(t, e);
|
|
711
|
+
if (o)
|
|
712
|
+
return o;
|
|
669
713
|
throw new Error(
|
|
670
|
-
`${this.
|
|
714
|
+
`${this.name} entry not found in collection with ${String(e)} of "${t}"`
|
|
671
715
|
);
|
|
672
716
|
}
|
|
673
|
-
|
|
674
|
-
return Object.assign(this.
|
|
717
|
+
updateConfig(t = {}) {
|
|
718
|
+
return Object.assign(this.config, t);
|
|
675
719
|
}
|
|
676
|
-
async createEntry(t
|
|
677
|
-
const
|
|
678
|
-
return await g$
|
|
720
|
+
async createEntry(t) {
|
|
721
|
+
const e = new this.entryClass(this, t);
|
|
722
|
+
return await g$2(e, "init"), await d$1("onCreateEntry", this, e), e;
|
|
679
723
|
}
|
|
680
724
|
async destroyEntry(t) {
|
|
681
|
-
return await
|
|
682
|
-
}
|
|
683
|
-
async register(t
|
|
684
|
-
const
|
|
685
|
-
|
|
686
|
-
const a2 = this.collection[r2];
|
|
687
|
-
return a2.el = s, typeof a2.init == "function" && await a2.init(e), a2;
|
|
688
|
-
} else {
|
|
689
|
-
const a2 = await this.createEntry(s, e);
|
|
690
|
-
return this.collection.push(a2), await h$1("onRegisterEntry", this, a2), a2;
|
|
691
|
-
}
|
|
725
|
+
return await d$1("onDestroyEntry", this, t), await g$2(t, "destroy"), t;
|
|
726
|
+
}
|
|
727
|
+
async register(t) {
|
|
728
|
+
const e = this.collection.findIndex((o) => o.id === t.id);
|
|
729
|
+
return ~e ? this.collection[e] = t : this.collection.push(t), await d$1("onRegisterEntry", this, t), t;
|
|
692
730
|
}
|
|
693
731
|
async deregister(t) {
|
|
694
|
-
const e = this.collection.findIndex((
|
|
732
|
+
const e = this.collection.findIndex((o) => o.id === t.id);
|
|
695
733
|
if (~e) {
|
|
696
|
-
|
|
697
|
-
return await h$1(
|
|
734
|
+
await d$1(
|
|
698
735
|
"onDeregisterEntry",
|
|
699
736
|
this,
|
|
700
737
|
this.collection[e]
|
|
701
|
-
)
|
|
738
|
+
);
|
|
739
|
+
const [o] = this.collection.splice(e, 1);
|
|
702
740
|
}
|
|
703
|
-
return
|
|
741
|
+
return t;
|
|
704
742
|
}
|
|
705
|
-
async mount(t =
|
|
706
|
-
this.
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
return await
|
|
716
|
-
}
|
|
717
|
-
async unmount() {
|
|
718
|
-
for (await
|
|
719
|
-
await this.
|
|
720
|
-
await
|
|
721
|
-
for (const
|
|
722
|
-
await g$
|
|
723
|
-
for (const
|
|
724
|
-
this.plugins.remove(
|
|
743
|
+
async mount(t = (e) => e) {
|
|
744
|
+
for (const e of this.config?.plugins || [])
|
|
745
|
+
this.plugins.add(e);
|
|
746
|
+
for (const e of this.plugins)
|
|
747
|
+
await g$2(e, "setup", this);
|
|
748
|
+
if (await d$1("beforeMount", this), this.config.selector) {
|
|
749
|
+
const e = document.querySelectorAll(this.config.selector);
|
|
750
|
+
for (const o of e)
|
|
751
|
+
await this.createEntry(o).then((r2) => t(r2)).then((r2) => this.register(r2));
|
|
752
|
+
}
|
|
753
|
+
return await d$1("afterMount", this), this;
|
|
754
|
+
}
|
|
755
|
+
async unmount(t = (e) => e) {
|
|
756
|
+
for (await d$1("beforeUnmount", this); this.collection.length > 0; )
|
|
757
|
+
await this.destroyEntry(this.collection[0]).then((e) => t(e)).then((e) => this.deregister(e));
|
|
758
|
+
await d$1("afterUnmount", this);
|
|
759
|
+
for (const e of this.plugins)
|
|
760
|
+
await g$2(e, "teardown", this);
|
|
761
|
+
for (const e of [...this.plugins])
|
|
762
|
+
this.plugins.remove(e.name);
|
|
725
763
|
return this;
|
|
726
764
|
}
|
|
727
765
|
};
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
settings: t,
|
|
766
|
+
const G = {
|
|
767
|
+
prefix: S$3("theme-prefix", { fallback: "vb-theme-" }),
|
|
768
|
+
storeKey: "VB:Profile",
|
|
769
|
+
fallback: "root",
|
|
770
|
+
themes: ["root", "light", "dark"],
|
|
771
|
+
onInit() {
|
|
772
|
+
},
|
|
773
|
+
onChange() {
|
|
774
|
+
}
|
|
775
|
+
};
|
|
776
|
+
function rt$1(i = {}) {
|
|
777
|
+
const t = { ...G, ...i };
|
|
778
|
+
function e(n) {
|
|
779
|
+
t[n].call(r2);
|
|
780
|
+
}
|
|
781
|
+
const o = w$2(t.storeKey), r2 = {
|
|
782
|
+
// Store our config in the API
|
|
783
|
+
config: t,
|
|
747
784
|
// Actions
|
|
748
|
-
add(
|
|
749
|
-
t.themes.push(
|
|
750
|
-
},
|
|
751
|
-
remove(a2) {
|
|
752
|
-
const o = t.themes.indexOf(a2);
|
|
753
|
-
~o && t.themes.splice(o, 1);
|
|
785
|
+
add(n) {
|
|
786
|
+
t.themes.push(n);
|
|
754
787
|
},
|
|
755
|
-
|
|
756
|
-
|
|
788
|
+
remove(n) {
|
|
789
|
+
const s = t.themes.indexOf(n);
|
|
790
|
+
~s && t.themes.splice(s, 1);
|
|
757
791
|
},
|
|
758
792
|
// Getters
|
|
759
793
|
get class() {
|
|
760
794
|
return `${t.prefix}${this.theme}`;
|
|
761
795
|
},
|
|
762
796
|
get classes() {
|
|
763
|
-
return t.themes.map((
|
|
797
|
+
return t.themes.map((n) => `${t.prefix}${n}`);
|
|
764
798
|
},
|
|
765
799
|
get themes() {
|
|
766
800
|
return t.themes;
|
|
767
801
|
},
|
|
768
802
|
// Setup the theme get and set methods
|
|
769
803
|
get theme() {
|
|
770
|
-
return
|
|
804
|
+
return o.get("theme") || t.fallback;
|
|
771
805
|
},
|
|
772
|
-
set theme(
|
|
773
|
-
t.themes.includes(
|
|
806
|
+
set theme(n) {
|
|
807
|
+
t.themes.includes(n) ? this.theme != n && (o.set("theme", n), document.documentElement.classList.remove(...this.classes), document.documentElement.classList.add(`${t.prefix}${n}`), e("onChange")) : console.error(`Not a valid theme value: "${n}"`);
|
|
774
808
|
}
|
|
775
809
|
};
|
|
776
|
-
return
|
|
810
|
+
return e("onInit"), r2;
|
|
777
811
|
}
|
|
778
812
|
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
779
813
|
__proto__: null,
|
|
780
|
-
Collection:
|
|
781
|
-
CollectionEntry: z$
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
814
|
+
Collection: st$1,
|
|
815
|
+
CollectionEntry: z$1,
|
|
816
|
+
ConfigManager: I$3,
|
|
817
|
+
EventEmitter: L$2,
|
|
818
|
+
FocusTrap: D$2,
|
|
819
|
+
FocusableArray: U$1,
|
|
820
|
+
PluginArray: H,
|
|
821
|
+
StackArray: _,
|
|
822
|
+
attrConfig: X$1,
|
|
823
|
+
cssConfig: Y$1,
|
|
824
|
+
cssVar: S$3,
|
|
825
|
+
debug: tt$1,
|
|
826
|
+
dispatchLifecycleHook: d$1,
|
|
827
|
+
focusTrap: et$1,
|
|
791
828
|
focusableSelectors: C$2,
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
getElement:
|
|
829
|
+
getAttrData: x$2,
|
|
830
|
+
getCustomProps: b$2,
|
|
831
|
+
getElement: v$2,
|
|
795
832
|
getPrefix: y$2,
|
|
796
|
-
|
|
833
|
+
getValue: h$2,
|
|
797
834
|
localStore: w$2,
|
|
798
|
-
maybeRunMethod: g$
|
|
799
|
-
mediaQuery:
|
|
800
|
-
propStore:
|
|
801
|
-
setGlobalState:
|
|
802
|
-
teleport:
|
|
803
|
-
teleportElement:
|
|
804
|
-
themeStore:
|
|
805
|
-
toCamel:
|
|
806
|
-
toKebab:
|
|
807
|
-
toMilliseconds:
|
|
808
|
-
transition:
|
|
835
|
+
maybeRunMethod: g$2,
|
|
836
|
+
mediaQuery: ot$1,
|
|
837
|
+
propStore: nt$1,
|
|
838
|
+
setGlobalState: Z,
|
|
839
|
+
teleport: it$1,
|
|
840
|
+
teleportElement: k$3,
|
|
841
|
+
themeStore: rt$1,
|
|
842
|
+
toCamel: R$1,
|
|
843
|
+
toKebab: M$2,
|
|
844
|
+
toMilliseconds: A$3,
|
|
845
|
+
transition: W$1
|
|
809
846
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
810
|
-
function
|
|
811
|
-
const s = (t.getAttribute(`data-${e}`) || "").replace(/'/g, '"');
|
|
812
|
-
return s ? JSON.parse(s) : {};
|
|
813
|
-
}
|
|
814
|
-
function f$1(t) {
|
|
847
|
+
function p$1(t) {
|
|
815
848
|
if (typeof t == "string") {
|
|
816
849
|
const e = document.getElementById(t);
|
|
817
850
|
if (e) return e;
|
|
@@ -826,15 +859,7 @@
|
|
|
826
859
|
async function r$1(t, e, ...s) {
|
|
827
860
|
e in t && typeof t[e] == "function" && await t[e](...s);
|
|
828
861
|
}
|
|
829
|
-
function
|
|
830
|
-
return t.split("-").map(
|
|
831
|
-
(e, s) => s === 0 ? e : e.charAt(0).toUpperCase() + e.slice(1)
|
|
832
|
-
).join("");
|
|
833
|
-
}
|
|
834
|
-
function p$1(t) {
|
|
835
|
-
return t.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
836
|
-
}
|
|
837
|
-
function C$1(t) {
|
|
862
|
+
function w$1(t) {
|
|
838
863
|
if (typeof t == "number")
|
|
839
864
|
return t;
|
|
840
865
|
const e = parseFloat(t);
|
|
@@ -844,96 +869,127 @@
|
|
|
844
869
|
}
|
|
845
870
|
throw new Error(`Could not convert value to milliseconds: ${t}`);
|
|
846
871
|
}
|
|
847
|
-
function
|
|
848
|
-
return new Promise((
|
|
872
|
+
function f(t, e, s, i, o = 0) {
|
|
873
|
+
return new Promise((n) => {
|
|
849
874
|
t.classList.remove(e), t.classList.add(s), setTimeout(() => {
|
|
850
|
-
t.classList.add(i), t.classList.remove(s),
|
|
851
|
-
},
|
|
875
|
+
t.classList.add(i), t.classList.remove(s), n(t);
|
|
876
|
+
}, w$1(o));
|
|
852
877
|
});
|
|
853
878
|
}
|
|
879
|
+
function v$1(t, e = {}) {
|
|
880
|
+
const s = {
|
|
881
|
+
fallback: null,
|
|
882
|
+
element: document.body,
|
|
883
|
+
...e
|
|
884
|
+
};
|
|
885
|
+
if (!t.startsWith("--")) {
|
|
886
|
+
const o = E$1();
|
|
887
|
+
o && (t = `${o}${t}`), t = `--${t}`;
|
|
888
|
+
}
|
|
889
|
+
const i = getComputedStyle(s.element).getPropertyValue(t).trim();
|
|
890
|
+
if (i)
|
|
891
|
+
return i;
|
|
892
|
+
if (s.fallback)
|
|
893
|
+
return s.fallback;
|
|
894
|
+
throw new Error(`CSS variable "${t}" was not found!`);
|
|
895
|
+
}
|
|
854
896
|
async function a$1(t, e, s) {
|
|
855
897
|
await r$1(e, t, s), s && await r$1(s, t);
|
|
856
898
|
for (const i of e.plugins)
|
|
857
|
-
await r$1(i, t, {
|
|
858
|
-
await e.emit(t, s);
|
|
899
|
+
await r$1(i, t, { parent: e, entry: s });
|
|
900
|
+
await e.emit(t, { parent: e, entry: s });
|
|
859
901
|
}
|
|
860
|
-
function
|
|
861
|
-
const e = getComputedStyle(t.el), s = {}, i = t.getSetting("customProps");
|
|
862
|
-
for (let n = 0; n < i.length; n++) {
|
|
863
|
-
const o = L$1(), l = t.parent.module.toLowerCase(), h2 = p$1(i[n]), u2 = e.getPropertyValue(`--${o}${l}-${h2}`).trim();
|
|
864
|
-
u2 && (s[h2] = u2);
|
|
865
|
-
}
|
|
866
|
-
return s;
|
|
867
|
-
}
|
|
868
|
-
function L$1() {
|
|
902
|
+
function E$1() {
|
|
869
903
|
return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
|
|
870
904
|
}
|
|
871
|
-
function
|
|
872
|
-
return e = s === "camel" ? b$1(e) : p$1(e), t.split(".").concat(e).reduce((i, n) => i?.[n], this);
|
|
873
|
-
}
|
|
874
|
-
function M$1(t, e = {}) {
|
|
875
|
-
const {
|
|
876
|
-
fallback: s,
|
|
877
|
-
props: i = ["dataConfig", "customProps", "settings", "parent.settings"]
|
|
878
|
-
} = e;
|
|
879
|
-
for (const n of i) {
|
|
880
|
-
const o = n !== "customProps" ? "camel" : "kebab", l = $$1.call(this, n, t, o);
|
|
881
|
-
if (l !== void 0)
|
|
882
|
-
return l;
|
|
883
|
-
}
|
|
884
|
-
if (s !== void 0)
|
|
885
|
-
return s;
|
|
886
|
-
throw new Error(`${this.parent.module} setting does not exist: ${t}`);
|
|
887
|
-
}
|
|
888
|
-
function P$2(t, e) {
|
|
905
|
+
function b$1(t, e) {
|
|
889
906
|
e && document.querySelectorAll(e).forEach((s) => {
|
|
890
907
|
t ? s.style.overflow = "hidden" : s.style.removeProperty("overflow");
|
|
891
908
|
});
|
|
892
909
|
}
|
|
893
|
-
function
|
|
910
|
+
function C$1(t, e) {
|
|
894
911
|
e && document.querySelectorAll(e).forEach((s) => {
|
|
895
912
|
s.inert = t;
|
|
896
913
|
});
|
|
897
914
|
}
|
|
898
915
|
function c$1(t, e, s) {
|
|
899
|
-
|
|
916
|
+
C$1(!!t, e), b$1(!!t, s);
|
|
900
917
|
}
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
918
|
+
let S$2 = class S {
|
|
919
|
+
#t;
|
|
920
|
+
#e;
|
|
921
|
+
constructor() {
|
|
922
|
+
this.#t = {}, this.#e = [];
|
|
923
|
+
}
|
|
924
|
+
get(e, s) {
|
|
925
|
+
const { fallback: i, source: o } = s ?? {};
|
|
926
|
+
if (o) {
|
|
927
|
+
const n = this.#t?.[o]?.[e];
|
|
928
|
+
if (n !== void 0)
|
|
929
|
+
return n;
|
|
930
|
+
} else
|
|
931
|
+
for (const n of this.#e) {
|
|
932
|
+
const d2 = this.#t?.[n]?.[e];
|
|
933
|
+
if (d2 !== void 0)
|
|
934
|
+
return d2;
|
|
935
|
+
}
|
|
936
|
+
if (i !== void 0)
|
|
937
|
+
return i;
|
|
938
|
+
throw new Error(`Config does not exist: ${e}`);
|
|
939
|
+
}
|
|
940
|
+
set(e, s = {}) {
|
|
941
|
+
let i, o;
|
|
942
|
+
return typeof e == "string" ? (i = e, o = s) : (i = "entry", o = e), this.#t[i] ? Object.assign(this.#t[i], o) : (this.#e.unshift(i), this.#t[i] = o), this.#t[i];
|
|
943
|
+
}
|
|
944
|
+
remove(e) {
|
|
945
|
+
const s = this.#e.indexOf(e);
|
|
946
|
+
s !== -1 && this.#e.splice(s, 1), delete this.#t[e];
|
|
947
|
+
}
|
|
948
|
+
setSourceOrder(e) {
|
|
949
|
+
const s = Object.keys(this.#t).reverse(), i = e.filter((o) => s.includes(o));
|
|
950
|
+
for (const o of s)
|
|
951
|
+
i.includes(o) || i.push(o);
|
|
952
|
+
return this.#e = i;
|
|
953
|
+
}
|
|
954
|
+
};
|
|
955
|
+
let O$1 = class O {
|
|
956
|
+
constructor() {
|
|
957
|
+
this.events = {};
|
|
958
|
+
}
|
|
959
|
+
on(e, s, ...i) {
|
|
960
|
+
this.events[e] || (this.events[e] = []), this.events[e].some(
|
|
961
|
+
(o) => o.listener === s
|
|
962
|
+
) || this.events[e].push({ listener: s, args: i });
|
|
963
|
+
}
|
|
964
|
+
off(e, s) {
|
|
965
|
+
this.events[e] && (this.events[e] = this.events[e].filter(
|
|
966
|
+
(i) => i.listener !== s
|
|
911
967
|
));
|
|
912
|
-
}
|
|
913
|
-
async emit(
|
|
914
|
-
if (
|
|
915
|
-
for (const { listener:
|
|
916
|
-
await s
|
|
968
|
+
}
|
|
969
|
+
async emit(e, ...s) {
|
|
970
|
+
if (e = e.startsWith("on") ? e.slice(2, 3).toLowerCase() + e.slice(3) : e, !!this.events[e])
|
|
971
|
+
for (const { listener: i, args: o } of this.events[e])
|
|
972
|
+
await i(...s, ...o);
|
|
917
973
|
}
|
|
918
974
|
};
|
|
919
|
-
let
|
|
975
|
+
let L$1 = class L extends Array {
|
|
920
976
|
constructor(e = {}) {
|
|
921
977
|
super(), this.presets = e;
|
|
922
978
|
}
|
|
923
|
-
|
|
924
|
-
const s =
|
|
925
|
-
e.
|
|
979
|
+
#t(e) {
|
|
980
|
+
const s = this.presets?.[e.name] || {}, i = e?.options || {};
|
|
981
|
+
e.config = { ...e.config, ...s, ...i };
|
|
926
982
|
}
|
|
927
|
-
|
|
983
|
+
#e(e) {
|
|
928
984
|
return !("name" in e) || typeof e.name != "string" ? (console.error("Plugin requires a name!"), false) : true;
|
|
929
985
|
}
|
|
930
986
|
get(e) {
|
|
931
|
-
return this.find((s) => s.name === e);
|
|
987
|
+
return this.find((s) => s.name === e) || null;
|
|
932
988
|
}
|
|
933
989
|
add(e) {
|
|
934
990
|
if (Array.isArray(e))
|
|
935
991
|
e.forEach((s) => this.add(s));
|
|
936
|
-
else if (this
|
|
992
|
+
else if (this.#t(e), this.#e(e)) {
|
|
937
993
|
const s = this.findIndex((i) => i.name === e.name);
|
|
938
994
|
~s ? this[s] = e : this.push(e);
|
|
939
995
|
}
|
|
@@ -943,45 +999,21 @@
|
|
|
943
999
|
~s && this.splice(s, 1);
|
|
944
1000
|
}
|
|
945
1001
|
};
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
};
|
|
950
|
-
let w$1 = class w {
|
|
951
|
-
constructor(e, s, i = {}) {
|
|
952
|
-
this.parent = e, this.el = f$1(s), this.settings = { ...i }, this.dataConfig = {}, this.customProps = {};
|
|
953
|
-
}
|
|
954
|
-
get id() {
|
|
955
|
-
return this.el.id;
|
|
956
|
-
}
|
|
957
|
-
applySettings(e) {
|
|
958
|
-
return Object.assign(this.settings, e);
|
|
959
|
-
}
|
|
960
|
-
getSetting(e, s) {
|
|
961
|
-
return M$1.call(this, e, s);
|
|
962
|
-
}
|
|
963
|
-
buildDataConfig() {
|
|
964
|
-
return Object.assign(
|
|
965
|
-
this.dataConfig,
|
|
966
|
-
E$2(this.el, this.getSetting("dataConfig"))
|
|
967
|
-
);
|
|
968
|
-
}
|
|
969
|
-
buildCustomProps() {
|
|
970
|
-
return Object.assign(this.customProps, O$1(this));
|
|
971
|
-
}
|
|
972
|
-
async init(e = {}) {
|
|
973
|
-
this.applySettings(e), this.buildDataConfig(), this.buildCustomProps();
|
|
974
|
-
}
|
|
975
|
-
async destroy() {
|
|
976
|
-
Object.getOwnPropertyNames(this).forEach((e) => {
|
|
977
|
-
delete this[e];
|
|
978
|
-
});
|
|
1002
|
+
let g$1 = class g {
|
|
1003
|
+
constructor(e, s) {
|
|
1004
|
+
this.config = new S$2(), this.parent = e, this.el = p$1(s), this.id = this.el.id, this.config.set("parent", this.parent.config), this.config.set("entry", {});
|
|
979
1005
|
}
|
|
980
1006
|
};
|
|
981
|
-
|
|
1007
|
+
const M$1 = {
|
|
1008
|
+
selector: "",
|
|
1009
|
+
plugins: [],
|
|
1010
|
+
presets: {}
|
|
1011
|
+
};
|
|
1012
|
+
let x$1 = class x {
|
|
982
1013
|
constructor(e = {}) {
|
|
983
|
-
this.
|
|
1014
|
+
this.#t = new O$1(), this.events = this.#t.events, this.on = this.#t.on.bind(this.#t), this.off = this.#t.off.bind(this.#t), this.emit = this.#t.emit.bind(this.#t), this.collection = [], this.entryClass = g$1, this.name = this.constructor.name, this.config = { ...M$1, ...e }, this.plugins = new L$1(this.config.presets);
|
|
984
1015
|
}
|
|
1016
|
+
#t;
|
|
985
1017
|
get(e, s = "id") {
|
|
986
1018
|
return this.collection.find((i) => i[s] === e);
|
|
987
1019
|
}
|
|
@@ -990,65 +1022,60 @@
|
|
|
990
1022
|
if (i)
|
|
991
1023
|
return i;
|
|
992
1024
|
throw new Error(
|
|
993
|
-
`${this.
|
|
1025
|
+
`${this.name} entry not found in collection with ${String(s)} of "${e}"`
|
|
994
1026
|
);
|
|
995
1027
|
}
|
|
996
|
-
|
|
997
|
-
return Object.assign(this.
|
|
1028
|
+
updateConfig(e = {}) {
|
|
1029
|
+
return Object.assign(this.config, e);
|
|
998
1030
|
}
|
|
999
|
-
async createEntry(e
|
|
1000
|
-
const
|
|
1001
|
-
return await r$1(
|
|
1031
|
+
async createEntry(e) {
|
|
1032
|
+
const s = new this.entryClass(this, e);
|
|
1033
|
+
return await r$1(s, "init"), await a$1("onCreateEntry", this, s), s;
|
|
1002
1034
|
}
|
|
1003
1035
|
async destroyEntry(e) {
|
|
1004
1036
|
return await a$1("onDestroyEntry", this, e), await r$1(e, "destroy"), e;
|
|
1005
1037
|
}
|
|
1006
|
-
async register(e
|
|
1007
|
-
const
|
|
1008
|
-
|
|
1009
|
-
const o = this.collection[n];
|
|
1010
|
-
return o.el = i, typeof o.init == "function" && await o.init(s), o;
|
|
1011
|
-
} else {
|
|
1012
|
-
const o = await this.createEntry(i, s);
|
|
1013
|
-
return this.collection.push(o), await a$1("onRegisterEntry", this, o), o;
|
|
1014
|
-
}
|
|
1038
|
+
async register(e) {
|
|
1039
|
+
const s = this.collection.findIndex((i) => i.id === e.id);
|
|
1040
|
+
return ~s ? this.collection[s] = e : this.collection.push(e), await a$1("onRegisterEntry", this, e), e;
|
|
1015
1041
|
}
|
|
1016
1042
|
async deregister(e) {
|
|
1017
|
-
const s = this.collection.findIndex((i) => i.id === e);
|
|
1043
|
+
const s = this.collection.findIndex((i) => i.id === e.id);
|
|
1018
1044
|
if (~s) {
|
|
1019
|
-
|
|
1020
|
-
return await a$1(
|
|
1045
|
+
await a$1(
|
|
1021
1046
|
"onDeregisterEntry",
|
|
1022
1047
|
this,
|
|
1023
1048
|
this.collection[s]
|
|
1024
|
-
)
|
|
1049
|
+
);
|
|
1050
|
+
const [i] = this.collection.splice(s, 1);
|
|
1025
1051
|
}
|
|
1026
|
-
return
|
|
1052
|
+
return e;
|
|
1027
1053
|
}
|
|
1028
|
-
async mount(e =
|
|
1029
|
-
this.
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1054
|
+
async mount(e = (s) => s) {
|
|
1055
|
+
for (const s of this.config?.plugins || [])
|
|
1056
|
+
this.plugins.add(s);
|
|
1057
|
+
for (const s of this.plugins)
|
|
1058
|
+
await r$1(s, "setup", this);
|
|
1059
|
+
if (await a$1("beforeMount", this), this.config.selector) {
|
|
1060
|
+
const s = document.querySelectorAll(this.config.selector);
|
|
1061
|
+
for (const i of s)
|
|
1062
|
+
await this.createEntry(i).then((o) => e(o)).then((o) => this.register(o));
|
|
1063
|
+
}
|
|
1038
1064
|
return await a$1("afterMount", this), this;
|
|
1039
1065
|
}
|
|
1040
|
-
async unmount() {
|
|
1066
|
+
async unmount(e = (s) => s) {
|
|
1041
1067
|
for (await a$1("beforeUnmount", this); this.collection.length > 0; )
|
|
1042
|
-
await this.
|
|
1068
|
+
await this.destroyEntry(this.collection[0]).then((s) => e(s)).then((s) => this.deregister(s));
|
|
1043
1069
|
await a$1("afterUnmount", this);
|
|
1044
|
-
for (const
|
|
1045
|
-
await r$1(
|
|
1046
|
-
for (const
|
|
1047
|
-
this.plugins.remove(
|
|
1070
|
+
for (const s of this.plugins)
|
|
1071
|
+
await r$1(s, "teardown", this);
|
|
1072
|
+
for (const s of [...this.plugins])
|
|
1073
|
+
this.plugins.remove(s.name);
|
|
1048
1074
|
return this;
|
|
1049
1075
|
}
|
|
1050
1076
|
};
|
|
1051
|
-
|
|
1077
|
+
v$1("theme-prefix", { fallback: "vb-theme-" });
|
|
1078
|
+
const T$1 = {
|
|
1052
1079
|
focusTrap: {
|
|
1053
1080
|
condition: ({ entry: t }) => t.state === "closed" || t.state === "opened" && t.mode === "modal"
|
|
1054
1081
|
},
|
|
@@ -1063,11 +1090,11 @@
|
|
|
1063
1090
|
condition: ({ entry: t }) => ["opened", "closed", "indeterminate"].includes(t.state),
|
|
1064
1091
|
onChange: ({ entry: t }) => t.applyState()
|
|
1065
1092
|
}
|
|
1066
|
-
},
|
|
1067
|
-
presets:
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1093
|
+
}, $$1 = {
|
|
1094
|
+
presets: T$1,
|
|
1095
|
+
attrOpen: "drawer-open",
|
|
1096
|
+
attrClose: "drawer-close",
|
|
1097
|
+
attrToggle: "drawer-toggle",
|
|
1071
1098
|
selector: ".drawer",
|
|
1072
1099
|
selectorDialog: ".drawer__dialog",
|
|
1073
1100
|
selectorScreen: ".drawer",
|
|
@@ -1086,93 +1113,93 @@
|
|
|
1086
1113
|
transition: true,
|
|
1087
1114
|
transitionDuration: 300
|
|
1088
1115
|
};
|
|
1089
|
-
function
|
|
1116
|
+
function k$2(t) {
|
|
1090
1117
|
switch (t.mode) {
|
|
1091
1118
|
case "inline":
|
|
1092
|
-
return
|
|
1119
|
+
return D$1(t);
|
|
1093
1120
|
case "modal":
|
|
1094
|
-
return
|
|
1121
|
+
return I$2(t);
|
|
1095
1122
|
default:
|
|
1096
1123
|
throw new Error(`"${t.mode}" is not a valid drawer mode.`);
|
|
1097
1124
|
}
|
|
1098
1125
|
}
|
|
1099
|
-
async function
|
|
1100
|
-
return t.el.classList.remove(t.
|
|
1126
|
+
async function D$1(t) {
|
|
1127
|
+
return t.el.classList.remove(t.config.get("classModal")), t.dialog.removeAttribute("aria-modal"), c$1(
|
|
1101
1128
|
false,
|
|
1102
|
-
t.
|
|
1103
|
-
t.
|
|
1129
|
+
t.config.get("selectorInert"),
|
|
1130
|
+
t.config.get("selectorOverflow")
|
|
1104
1131
|
), t.applyState(), t.el.dispatchEvent(
|
|
1105
|
-
new CustomEvent(t.
|
|
1132
|
+
new CustomEvent(t.config.get("customEventPrefix") + "switchMode", {
|
|
1106
1133
|
detail: t.parent,
|
|
1107
1134
|
bubbles: true
|
|
1108
1135
|
})
|
|
1109
1136
|
), await t.parent.emit("switchMode", t), t;
|
|
1110
1137
|
}
|
|
1111
|
-
async function
|
|
1112
|
-
return t.el.classList.add(t.
|
|
1113
|
-
new CustomEvent(t.
|
|
1138
|
+
async function I$2(t) {
|
|
1139
|
+
return t.el.classList.add(t.config.get("classModal")), t.dialog.setAttribute("aria-modal", "true"), await t.close(false, false), t.el.dispatchEvent(
|
|
1140
|
+
new CustomEvent(t.config.get("customEventPrefix") + "switchMode", {
|
|
1114
1141
|
detail: t.parent,
|
|
1115
1142
|
bubbles: true
|
|
1116
1143
|
})
|
|
1117
1144
|
), await t.parent.emit("switchMode", t), t;
|
|
1118
1145
|
}
|
|
1119
|
-
function
|
|
1120
|
-
t.dialog && t.state === "opened" ? (t.dialog.querySelector(t.
|
|
1146
|
+
function u$1(t) {
|
|
1147
|
+
t.dialog && t.state === "opened" ? (t.dialog.querySelector(t.config.get("selectorFocus")) || t.dialog).focus() : t.trigger && (t.trigger.focus(), t.trigger = null);
|
|
1121
1148
|
}
|
|
1122
|
-
async function
|
|
1123
|
-
return (t.state === "closed" || t.state === "indeterminate" || t.state === null) && (t.setState("opening"), e ?? t.
|
|
1149
|
+
async function l$1(t, e, s = true) {
|
|
1150
|
+
return (t.state === "closed" || t.state === "indeterminate" || t.state === null) && (t.setState("opening"), e ?? t.config.get("transition") ? await f(
|
|
1124
1151
|
t.el,
|
|
1125
|
-
t.
|
|
1126
|
-
t.
|
|
1127
|
-
t.
|
|
1128
|
-
t.
|
|
1129
|
-
) : (t.el.classList.add(t.
|
|
1152
|
+
t.config.get("stateClosed"),
|
|
1153
|
+
t.config.get("stateOpening"),
|
|
1154
|
+
t.config.get("stateOpened"),
|
|
1155
|
+
t.config.get("transitionDuration")
|
|
1156
|
+
) : (t.el.classList.add(t.config.get("stateOpened")), t.el.classList.remove(t.config.get("stateClosed"))), t.setState("opened"), t.mode === "modal" && c$1(
|
|
1130
1157
|
true,
|
|
1131
|
-
t.
|
|
1132
|
-
t.
|
|
1133
|
-
), s &&
|
|
1134
|
-
new CustomEvent(t.
|
|
1158
|
+
t.config.get("selectorInert"),
|
|
1159
|
+
t.config.get("selectorOverflow")
|
|
1160
|
+
), s && u$1(t), t.el.dispatchEvent(
|
|
1161
|
+
new CustomEvent(t.config.get("customEventPrefix") + "opened", {
|
|
1135
1162
|
detail: t.parent,
|
|
1136
1163
|
bubbles: true
|
|
1137
1164
|
})
|
|
1138
1165
|
), await t.parent.emit("opened", t)), t;
|
|
1139
1166
|
}
|
|
1140
|
-
async function
|
|
1141
|
-
return (t.state === "opened" || t.state === "indeterminate" || t.state === null) && (t.setState("closing"), document.activeElement && document.activeElement instanceof HTMLElement && document.activeElement.blur(), e ?? t.
|
|
1167
|
+
async function h$1(t, e, s = true) {
|
|
1168
|
+
return (t.state === "opened" || t.state === "indeterminate" || t.state === null) && (t.setState("closing"), document.activeElement && document.activeElement instanceof HTMLElement && document.activeElement.blur(), e ?? t.config.get("transition") ? await f(
|
|
1142
1169
|
t.el,
|
|
1143
|
-
t.
|
|
1144
|
-
t.
|
|
1145
|
-
t.
|
|
1146
|
-
t.
|
|
1147
|
-
) : (t.el.classList.add(t.
|
|
1170
|
+
t.config.get("stateOpened"),
|
|
1171
|
+
t.config.get("stateClosing"),
|
|
1172
|
+
t.config.get("stateClosed"),
|
|
1173
|
+
t.config.get("transitionDuration")
|
|
1174
|
+
) : (t.el.classList.add(t.config.get("stateClosed")), t.el.classList.remove(t.config.get("stateOpened"))), t.setState("closed"), t.mode === "modal" && c$1(
|
|
1148
1175
|
false,
|
|
1149
|
-
t.
|
|
1150
|
-
t.
|
|
1151
|
-
), s &&
|
|
1152
|
-
new CustomEvent(t.
|
|
1176
|
+
t.config.get("selectorInert"),
|
|
1177
|
+
t.config.get("selectorOverflow")
|
|
1178
|
+
), s && u$1(t), t.el.dispatchEvent(
|
|
1179
|
+
new CustomEvent(t.config.get("customEventPrefix") + "closed", {
|
|
1153
1180
|
detail: t.parent,
|
|
1154
1181
|
bubbles: true
|
|
1155
1182
|
})
|
|
1156
1183
|
), await t.parent.emit("closed", t)), t;
|
|
1157
1184
|
}
|
|
1158
|
-
async function
|
|
1159
|
-
return t.state === "closed" ?
|
|
1185
|
+
async function m$1(t, e, s) {
|
|
1186
|
+
return t.state === "closed" ? l$1(t, e, s) : h$1(t, e, s);
|
|
1160
1187
|
}
|
|
1161
|
-
class
|
|
1188
|
+
let A$2 = class A extends g$1 {
|
|
1162
1189
|
#t;
|
|
1163
|
-
constructor(e, s
|
|
1164
|
-
super(e, s
|
|
1190
|
+
constructor(e, s) {
|
|
1191
|
+
super(e, s), this.#t = "indeterminate", this.dialog = this.el.querySelector(this.config.get("selectorDialog")) || this.el, this.trigger = null, this.state = null, this.inlineState = null;
|
|
1165
1192
|
}
|
|
1166
1193
|
get mode() {
|
|
1167
1194
|
return this.#t;
|
|
1168
1195
|
}
|
|
1169
1196
|
set mode(e) {
|
|
1170
|
-
this.#t !== e && (this.#t = e,
|
|
1197
|
+
this.#t !== e && (this.#t = e, k$2(this));
|
|
1171
1198
|
}
|
|
1172
1199
|
setState(e) {
|
|
1173
1200
|
this.state = e;
|
|
1174
1201
|
const s = ["opening", "closing"];
|
|
1175
|
-
this.mode === "inline" && !s.includes(e) && (this.inlineState = e), e === "indeterminate" && (this.el.classList.remove(this.
|
|
1202
|
+
this.mode === "inline" && !s.includes(e) && (this.inlineState = e), e === "indeterminate" && (this.el.classList.remove(this.config.get("stateOpened")), this.el.classList.remove(this.config.get("stateOpening")), this.el.classList.remove(this.config.get("stateClosed")), this.el.classList.remove(this.config.get("stateClosing")));
|
|
1176
1203
|
}
|
|
1177
1204
|
async applyState() {
|
|
1178
1205
|
if (this.mode === "modal") return this;
|
|
@@ -1181,86 +1208,86 @@
|
|
|
1181
1208
|
if (this.inlineState === "closed")
|
|
1182
1209
|
return await this.close(false, false);
|
|
1183
1210
|
if (this.state === null) {
|
|
1184
|
-
if (this.el.classList.contains(this.
|
|
1211
|
+
if (this.el.classList.contains(this.config.get("stateOpened")))
|
|
1185
1212
|
return await this.open(false, false);
|
|
1186
|
-
if (this.el.classList.contains(this.
|
|
1213
|
+
if (this.el.classList.contains(this.config.get("stateClosed")))
|
|
1187
1214
|
return await this.close(false, false);
|
|
1188
1215
|
}
|
|
1189
1216
|
return this.setState("indeterminate"), this;
|
|
1190
1217
|
}
|
|
1191
1218
|
async open(e, s) {
|
|
1192
|
-
return
|
|
1219
|
+
return l$1(this, e, s);
|
|
1193
1220
|
}
|
|
1194
1221
|
async close(e, s) {
|
|
1195
|
-
return
|
|
1222
|
+
return h$1(this, e, s);
|
|
1196
1223
|
}
|
|
1197
1224
|
async toggle(e, s) {
|
|
1198
|
-
return
|
|
1225
|
+
return m$1(this, e, s);
|
|
1199
1226
|
}
|
|
1200
1227
|
async deregister() {
|
|
1201
|
-
return this.parent.deregister(this
|
|
1228
|
+
return this.parent.deregister(this);
|
|
1202
1229
|
}
|
|
1203
1230
|
async onCreateEntry() {
|
|
1204
|
-
this.
|
|
1231
|
+
this.config.get("setTabindex") && this.dialog && this.dialog.setAttribute("tabindex", "-1"), await this.applyState(), this.inlineState = this.state, this.mode = this.el && this.el.classList.contains(this.config.get("classModal")) ? "modal" : "inline";
|
|
1205
1232
|
}
|
|
1206
1233
|
async onDestroyEntry() {
|
|
1207
1234
|
this.mode === "modal" && this.state === "opened" && await this.close(false);
|
|
1208
1235
|
}
|
|
1209
|
-
}
|
|
1210
|
-
async function
|
|
1236
|
+
};
|
|
1237
|
+
async function P$2(t) {
|
|
1211
1238
|
const e = t.target;
|
|
1212
1239
|
if (e) {
|
|
1213
1240
|
const s = e.closest(`
|
|
1214
|
-
[data-${this.
|
|
1215
|
-
[data-${this.
|
|
1216
|
-
[data-${this.
|
|
1241
|
+
[data-${this.config.attrOpen}],
|
|
1242
|
+
[data-${this.config.attrToggle}],
|
|
1243
|
+
[data-${this.config.attrClose}]
|
|
1217
1244
|
`);
|
|
1218
1245
|
if (s) {
|
|
1219
|
-
t.preventDefault(), s.matches(`[data-${this.
|
|
1220
|
-
const
|
|
1221
|
-
return
|
|
1222
|
-
}), s.matches(`[data-${this.
|
|
1223
|
-
const
|
|
1224
|
-
return
|
|
1225
|
-
}), s.matches(`[data-${this.
|
|
1226
|
-
if (
|
|
1227
|
-
const
|
|
1228
|
-
return
|
|
1246
|
+
t.preventDefault(), s.matches(`[data-${this.config.attrToggle}]`) && s.getAttribute(`data-${this.config.attrToggle}`)?.trim().split(" ")?.forEach((o) => {
|
|
1247
|
+
const n = this.getOrThrow(o);
|
|
1248
|
+
return n.trigger = s, n.toggle();
|
|
1249
|
+
}), s.matches(`[data-${this.config.attrOpen}]`) && s.getAttribute(`data-${this.config.attrOpen}`)?.trim().split(" ")?.forEach((o) => {
|
|
1250
|
+
const n = this.getOrThrow(o);
|
|
1251
|
+
return n.trigger = s, n.open();
|
|
1252
|
+
}), s.matches(`[data-${this.config.attrClose}]`) && s.getAttribute(`data-${this.config.attrClose}`)?.trim().split(" ")?.forEach((o) => {
|
|
1253
|
+
if (o) {
|
|
1254
|
+
const n = this.getOrThrow(o);
|
|
1255
|
+
return n.trigger = s, n.close();
|
|
1229
1256
|
} else {
|
|
1230
|
-
const
|
|
1231
|
-
if (
|
|
1257
|
+
const n = e.closest(this.config.selector);
|
|
1258
|
+
if (n) return this.close(n.id);
|
|
1232
1259
|
}
|
|
1233
1260
|
});
|
|
1234
1261
|
return;
|
|
1235
1262
|
}
|
|
1236
|
-
if (this.activeModal && e.matches(this.
|
|
1263
|
+
if (this.activeModal && e.matches(this.config.selectorScreen))
|
|
1237
1264
|
return this.close(this.activeModal.id);
|
|
1238
1265
|
}
|
|
1239
1266
|
}
|
|
1240
|
-
function
|
|
1267
|
+
function y$1(t) {
|
|
1241
1268
|
if (t.key === "Escape" && this.activeModal)
|
|
1242
1269
|
return this.close(this.activeModal.id);
|
|
1243
1270
|
}
|
|
1244
|
-
class
|
|
1245
|
-
#t;
|
|
1246
|
-
#e;
|
|
1271
|
+
let q$1 = class q extends x$1 {
|
|
1247
1272
|
constructor(e) {
|
|
1248
|
-
super({
|
|
1273
|
+
super({ ...$$1, ...e }), this.entryClass = A$2, this.name = "Drawer", this.#t = P$2.bind(this), this.#e = y$1.bind(this);
|
|
1249
1274
|
}
|
|
1275
|
+
#t;
|
|
1276
|
+
#e;
|
|
1250
1277
|
get activeModal() {
|
|
1251
1278
|
return this.collection.find((e) => e.state === "opened" && e.mode === "modal");
|
|
1252
1279
|
}
|
|
1253
1280
|
async open(e, s, i) {
|
|
1254
|
-
const
|
|
1255
|
-
return
|
|
1281
|
+
const o = this.getOrThrow(e);
|
|
1282
|
+
return l$1(o, s, i);
|
|
1256
1283
|
}
|
|
1257
1284
|
async close(e, s, i) {
|
|
1258
|
-
const
|
|
1259
|
-
return
|
|
1285
|
+
const o = this.getOrThrow(e);
|
|
1286
|
+
return h$1(o, s, i);
|
|
1260
1287
|
}
|
|
1261
1288
|
async toggle(e, s, i) {
|
|
1262
|
-
const
|
|
1263
|
-
return
|
|
1289
|
+
const o = this.getOrThrow(e);
|
|
1290
|
+
return m$1(o, s, i);
|
|
1264
1291
|
}
|
|
1265
1292
|
async afterMount() {
|
|
1266
1293
|
document.addEventListener("click", this.#t, false), document.addEventListener("keydown", this.#e, false);
|
|
@@ -1268,146 +1295,165 @@
|
|
|
1268
1295
|
async afterUnmount() {
|
|
1269
1296
|
document.removeEventListener("click", this.#t, false), document.removeEventListener("keydown", this.#e, false);
|
|
1270
1297
|
}
|
|
1271
|
-
}
|
|
1272
|
-
function
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
}
|
|
1276
|
-
function f(e) {
|
|
1277
|
-
if (typeof e == "string") {
|
|
1278
|
-
const t = document.getElementById(e);
|
|
1298
|
+
};
|
|
1299
|
+
function p(s) {
|
|
1300
|
+
if (typeof s == "string") {
|
|
1301
|
+
const t = document.getElementById(s);
|
|
1279
1302
|
if (t) return t;
|
|
1280
|
-
throw new Error(`Element not found with ID: "${
|
|
1281
|
-
} else if (
|
|
1282
|
-
if (!
|
|
1303
|
+
throw new Error(`Element not found with ID: "${s}"`);
|
|
1304
|
+
} else if (s instanceof HTMLElement) {
|
|
1305
|
+
if (!s.id)
|
|
1283
1306
|
throw new Error("HTMLElement must have an ID");
|
|
1284
|
-
return
|
|
1307
|
+
return s;
|
|
1285
1308
|
} else
|
|
1286
1309
|
throw new Error("Invalid argument: query must be a string or HTMLElement");
|
|
1287
1310
|
}
|
|
1288
|
-
async function
|
|
1289
|
-
t in
|
|
1290
|
-
}
|
|
1291
|
-
function C(e) {
|
|
1292
|
-
return e.split("-").map(
|
|
1293
|
-
(t, s) => s === 0 ? t : t.charAt(0).toUpperCase() + t.slice(1)
|
|
1294
|
-
).join("");
|
|
1295
|
-
}
|
|
1296
|
-
function p(e) {
|
|
1297
|
-
return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1311
|
+
async function a(s, t, ...e) {
|
|
1312
|
+
t in s && typeof s[t] == "function" && await s[t](...e);
|
|
1298
1313
|
}
|
|
1299
|
-
function
|
|
1300
|
-
if (typeof
|
|
1301
|
-
return
|
|
1302
|
-
const t = parseFloat(
|
|
1314
|
+
function m(s) {
|
|
1315
|
+
if (typeof s == "number")
|
|
1316
|
+
return s;
|
|
1317
|
+
const t = parseFloat(s);
|
|
1303
1318
|
if (!Number.isNaN(t)) {
|
|
1304
|
-
const
|
|
1305
|
-
return t * (
|
|
1319
|
+
const e = s.includes("ms");
|
|
1320
|
+
return t * (e ? 1 : 1e3);
|
|
1306
1321
|
}
|
|
1307
|
-
throw new Error(`Could not convert value to milliseconds: ${
|
|
1322
|
+
throw new Error(`Could not convert value to milliseconds: ${s}`);
|
|
1308
1323
|
}
|
|
1309
|
-
function
|
|
1324
|
+
function u(s, t, e, i, n = 0) {
|
|
1310
1325
|
return new Promise((o) => {
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
},
|
|
1326
|
+
s.classList.remove(t), s.classList.add(e), setTimeout(() => {
|
|
1327
|
+
s.classList.add(i), s.classList.remove(e), o(s);
|
|
1328
|
+
}, m(n));
|
|
1314
1329
|
});
|
|
1315
1330
|
}
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
const o = b(), l = e.parent.module.toLowerCase(), u2 = p(i[n]), g2 = t.getPropertyValue(`--${o}${l}-${u2}`).trim();
|
|
1326
|
-
g2 && (s[u2] = g2);
|
|
1331
|
+
function w(s, t = {}) {
|
|
1332
|
+
const e = {
|
|
1333
|
+
fallback: null,
|
|
1334
|
+
element: document.body,
|
|
1335
|
+
...t
|
|
1336
|
+
};
|
|
1337
|
+
if (!s.startsWith("--")) {
|
|
1338
|
+
const n = v();
|
|
1339
|
+
n && (s = `${n}${s}`), s = `--${s}`;
|
|
1327
1340
|
}
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1341
|
+
const i = getComputedStyle(e.element).getPropertyValue(s).trim();
|
|
1342
|
+
if (i)
|
|
1343
|
+
return i;
|
|
1344
|
+
if (e.fallback)
|
|
1345
|
+
return e.fallback;
|
|
1346
|
+
throw new Error(`CSS variable "${s}" was not found!`);
|
|
1332
1347
|
}
|
|
1333
|
-
function
|
|
1334
|
-
|
|
1348
|
+
async function r(s, t, e) {
|
|
1349
|
+
await a(t, s, e), e && await a(e, s);
|
|
1350
|
+
for (const i of t.plugins)
|
|
1351
|
+
await a(i, s, { parent: t, entry: e });
|
|
1352
|
+
await t.emit(s, { parent: t, entry: e });
|
|
1335
1353
|
}
|
|
1336
|
-
function
|
|
1337
|
-
|
|
1338
|
-
fallback: s,
|
|
1339
|
-
props: i = ["dataConfig", "customProps", "settings", "parent.settings"]
|
|
1340
|
-
} = t;
|
|
1341
|
-
for (const n of i) {
|
|
1342
|
-
const o = n !== "customProps" ? "camel" : "kebab", l = O.call(this, n, e, o);
|
|
1343
|
-
if (l !== void 0)
|
|
1344
|
-
return l;
|
|
1345
|
-
}
|
|
1346
|
-
if (s !== void 0)
|
|
1347
|
-
return s;
|
|
1348
|
-
throw new Error(`${this.parent.module} setting does not exist: ${e}`);
|
|
1354
|
+
function v() {
|
|
1355
|
+
return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
|
|
1349
1356
|
}
|
|
1350
|
-
function
|
|
1351
|
-
t && document.querySelectorAll(t).forEach((
|
|
1352
|
-
|
|
1357
|
+
function y(s, t) {
|
|
1358
|
+
t && document.querySelectorAll(t).forEach((e) => {
|
|
1359
|
+
s ? e.style.overflow = "hidden" : e.style.removeProperty("overflow");
|
|
1353
1360
|
});
|
|
1354
1361
|
}
|
|
1355
|
-
function
|
|
1356
|
-
t && document.querySelectorAll(t).forEach((
|
|
1357
|
-
|
|
1362
|
+
function E(s, t) {
|
|
1363
|
+
t && document.querySelectorAll(t).forEach((e) => {
|
|
1364
|
+
e.inert = s;
|
|
1358
1365
|
});
|
|
1359
1366
|
}
|
|
1360
|
-
function
|
|
1361
|
-
|
|
1367
|
+
function b(s, t, e) {
|
|
1368
|
+
E(!!s, t), y(!!s, e);
|
|
1362
1369
|
}
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1370
|
+
class C {
|
|
1371
|
+
#t;
|
|
1372
|
+
#e;
|
|
1373
|
+
constructor() {
|
|
1374
|
+
this.#t = {}, this.#e = [];
|
|
1375
|
+
}
|
|
1376
|
+
get(t, e) {
|
|
1377
|
+
const { fallback: i, source: n } = e ?? {};
|
|
1378
|
+
if (n) {
|
|
1379
|
+
const o = this.#t?.[n]?.[t];
|
|
1380
|
+
if (o !== void 0)
|
|
1381
|
+
return o;
|
|
1382
|
+
} else
|
|
1383
|
+
for (const o of this.#e) {
|
|
1384
|
+
const f2 = this.#t?.[o]?.[t];
|
|
1385
|
+
if (f2 !== void 0)
|
|
1386
|
+
return f2;
|
|
1387
|
+
}
|
|
1388
|
+
if (i !== void 0)
|
|
1389
|
+
return i;
|
|
1390
|
+
throw new Error(`Config does not exist: ${t}`);
|
|
1391
|
+
}
|
|
1392
|
+
set(t, e = {}) {
|
|
1393
|
+
let i, n;
|
|
1394
|
+
return typeof t == "string" ? (i = t, n = e) : (i = "entry", n = t), this.#t[i] ? Object.assign(this.#t[i], n) : (this.#e.unshift(i), this.#t[i] = n), this.#t[i];
|
|
1395
|
+
}
|
|
1396
|
+
remove(t) {
|
|
1397
|
+
const e = this.#e.indexOf(t);
|
|
1398
|
+
e !== -1 && this.#e.splice(e, 1), delete this.#t[t];
|
|
1399
|
+
}
|
|
1400
|
+
setSourceOrder(t) {
|
|
1401
|
+
const e = Object.keys(this.#t).reverse(), i = t.filter((n) => e.includes(n));
|
|
1402
|
+
for (const n of e)
|
|
1403
|
+
i.includes(n) || i.push(n);
|
|
1404
|
+
return this.#e = i;
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
class x {
|
|
1408
|
+
constructor() {
|
|
1409
|
+
this.events = {};
|
|
1410
|
+
}
|
|
1411
|
+
on(t, e, ...i) {
|
|
1412
|
+
this.events[t] || (this.events[t] = []), this.events[t].some(
|
|
1413
|
+
(n) => n.listener === e
|
|
1414
|
+
) || this.events[t].push({ listener: e, args: i });
|
|
1415
|
+
}
|
|
1416
|
+
off(t, e) {
|
|
1417
|
+
this.events[t] && (this.events[t] = this.events[t].filter(
|
|
1418
|
+
(i) => i.listener !== e
|
|
1373
1419
|
));
|
|
1374
|
-
},
|
|
1375
|
-
async emit(e, t) {
|
|
1376
|
-
if (e = e.startsWith("on") ? e.slice(2, 3).toLowerCase() + e.slice(3) : e, !!this.events[e])
|
|
1377
|
-
for (const { listener: s, args: i } of this.events[e])
|
|
1378
|
-
await s(t, ...i);
|
|
1379
1420
|
}
|
|
1380
|
-
|
|
1381
|
-
|
|
1421
|
+
async emit(t, ...e) {
|
|
1422
|
+
if (t = t.startsWith("on") ? t.slice(2, 3).toLowerCase() + t.slice(3) : t, !!this.events[t])
|
|
1423
|
+
for (const { listener: i, args: n } of this.events[t])
|
|
1424
|
+
await i(...e, ...n);
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
class O extends Array {
|
|
1382
1428
|
constructor(t = {}) {
|
|
1383
1429
|
super(), this.presets = t;
|
|
1384
1430
|
}
|
|
1385
|
-
|
|
1386
|
-
const
|
|
1387
|
-
t.
|
|
1431
|
+
#t(t) {
|
|
1432
|
+
const e = this.presets?.[t.name] || {}, i = t?.options || {};
|
|
1433
|
+
t.config = { ...t.config, ...e, ...i };
|
|
1388
1434
|
}
|
|
1389
|
-
|
|
1435
|
+
#e(t) {
|
|
1390
1436
|
return !("name" in t) || typeof t.name != "string" ? (console.error("Plugin requires a name!"), false) : true;
|
|
1391
1437
|
}
|
|
1392
1438
|
get(t) {
|
|
1393
|
-
return this.find((
|
|
1439
|
+
return this.find((e) => e.name === t) || null;
|
|
1394
1440
|
}
|
|
1395
1441
|
add(t) {
|
|
1396
1442
|
if (Array.isArray(t))
|
|
1397
|
-
t.forEach((
|
|
1398
|
-
else if (this
|
|
1399
|
-
const
|
|
1400
|
-
~
|
|
1443
|
+
t.forEach((e) => this.add(e));
|
|
1444
|
+
else if (this.#t(t), this.#e(t)) {
|
|
1445
|
+
const e = this.findIndex((i) => i.name === t.name);
|
|
1446
|
+
~e ? this[e] = t : this.push(t);
|
|
1401
1447
|
}
|
|
1402
1448
|
}
|
|
1403
1449
|
remove(t) {
|
|
1404
|
-
const
|
|
1405
|
-
~
|
|
1450
|
+
const e = this.findIndex((i) => i.name === t);
|
|
1451
|
+
~e && this.splice(e, 1);
|
|
1406
1452
|
}
|
|
1407
|
-
}
|
|
1408
|
-
|
|
1453
|
+
}
|
|
1454
|
+
class L extends Array {
|
|
1409
1455
|
constructor(t = {}) {
|
|
1410
|
-
super(), this.
|
|
1456
|
+
super(), this.config = t;
|
|
1411
1457
|
}
|
|
1412
1458
|
get copy() {
|
|
1413
1459
|
return [...this];
|
|
@@ -1416,137 +1462,108 @@
|
|
|
1416
1462
|
return this[this.length - 1] || null;
|
|
1417
1463
|
}
|
|
1418
1464
|
updateIndex() {
|
|
1419
|
-
this.forEach((t,
|
|
1465
|
+
this.forEach((t, e) => {
|
|
1420
1466
|
t.el.style.zIndex = "";
|
|
1421
|
-
const i = getComputedStyle(t.el)
|
|
1422
|
-
t.el.style.zIndex =
|
|
1467
|
+
const i = getComputedStyle(t.el).getPropertyValue("z-index"), n = parseInt(i, 10), o = String((Number.isNaN(n) ? 0 : n) + e + 1);
|
|
1468
|
+
t.el.style.zIndex = o;
|
|
1423
1469
|
});
|
|
1424
1470
|
}
|
|
1425
1471
|
onChange() {
|
|
1426
|
-
this.updateIndex(), typeof this.
|
|
1472
|
+
this.updateIndex(), typeof this.config.onChange == "function" && this.config.onChange();
|
|
1427
1473
|
}
|
|
1428
1474
|
add(t) {
|
|
1429
1475
|
this.push(t), this.onChange();
|
|
1430
1476
|
}
|
|
1431
1477
|
remove(t) {
|
|
1432
|
-
const
|
|
1433
|
-
~
|
|
1478
|
+
const e = this.findIndex((i) => i.id === t.id);
|
|
1479
|
+
~e && (t.el.style.zIndex = "", this.splice(e, 1), this.onChange());
|
|
1434
1480
|
}
|
|
1435
1481
|
moveToTop(t) {
|
|
1436
|
-
const
|
|
1437
|
-
~
|
|
1438
|
-
}
|
|
1439
|
-
};
|
|
1440
|
-
const k$1 = {
|
|
1441
|
-
dataConfig: "config",
|
|
1442
|
-
customProps: []
|
|
1443
|
-
};
|
|
1444
|
-
class w {
|
|
1445
|
-
constructor(t, s, i = {}) {
|
|
1446
|
-
this.parent = t, this.el = f(s), this.settings = { ...i }, this.dataConfig = {}, this.customProps = {};
|
|
1447
|
-
}
|
|
1448
|
-
get id() {
|
|
1449
|
-
return this.el.id;
|
|
1450
|
-
}
|
|
1451
|
-
applySettings(t) {
|
|
1452
|
-
return Object.assign(this.settings, t);
|
|
1453
|
-
}
|
|
1454
|
-
getSetting(t, s) {
|
|
1455
|
-
return x.call(this, t, s);
|
|
1456
|
-
}
|
|
1457
|
-
buildDataConfig() {
|
|
1458
|
-
return Object.assign(
|
|
1459
|
-
this.dataConfig,
|
|
1460
|
-
y(this.el, this.getSetting("dataConfig"))
|
|
1461
|
-
);
|
|
1462
|
-
}
|
|
1463
|
-
buildCustomProps() {
|
|
1464
|
-
return Object.assign(this.customProps, E$1(this));
|
|
1465
|
-
}
|
|
1466
|
-
async init(t = {}) {
|
|
1467
|
-
this.applySettings(t), this.buildDataConfig(), this.buildCustomProps();
|
|
1482
|
+
const e = this.findIndex((i) => i.id === t.id);
|
|
1483
|
+
~e && (this.splice(e, 1), this.add(t));
|
|
1468
1484
|
}
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
});
|
|
1485
|
+
}
|
|
1486
|
+
class d {
|
|
1487
|
+
constructor(t, e) {
|
|
1488
|
+
this.config = new C(), this.parent = t, this.el = p(e), this.id = this.el.id, this.config.set("parent", this.parent.config), this.config.set("entry", {});
|
|
1473
1489
|
}
|
|
1474
1490
|
}
|
|
1475
|
-
|
|
1491
|
+
const k$1 = {
|
|
1492
|
+
selector: "",
|
|
1493
|
+
plugins: [],
|
|
1494
|
+
presets: {}
|
|
1495
|
+
};
|
|
1496
|
+
let A$1 = class A {
|
|
1476
1497
|
constructor(t = {}) {
|
|
1477
|
-
this.
|
|
1498
|
+
this.#t = new x(), this.events = this.#t.events, this.on = this.#t.on.bind(this.#t), this.off = this.#t.off.bind(this.#t), this.emit = this.#t.emit.bind(this.#t), this.collection = [], this.entryClass = d, this.name = this.constructor.name, this.config = { ...k$1, ...t }, this.plugins = new O(this.config.presets);
|
|
1478
1499
|
}
|
|
1479
|
-
|
|
1480
|
-
|
|
1500
|
+
#t;
|
|
1501
|
+
get(t, e = "id") {
|
|
1502
|
+
return this.collection.find((i) => i[e] === t);
|
|
1481
1503
|
}
|
|
1482
|
-
getOrThrow(t,
|
|
1483
|
-
const i = this.get(t,
|
|
1504
|
+
getOrThrow(t, e = "id") {
|
|
1505
|
+
const i = this.get(t, e);
|
|
1484
1506
|
if (i)
|
|
1485
1507
|
return i;
|
|
1486
1508
|
throw new Error(
|
|
1487
|
-
`${this.
|
|
1509
|
+
`${this.name} entry not found in collection with ${String(e)} of "${t}"`
|
|
1488
1510
|
);
|
|
1489
1511
|
}
|
|
1490
|
-
|
|
1491
|
-
return Object.assign(this.
|
|
1512
|
+
updateConfig(t = {}) {
|
|
1513
|
+
return Object.assign(this.config, t);
|
|
1492
1514
|
}
|
|
1493
|
-
async createEntry(t
|
|
1494
|
-
const
|
|
1495
|
-
return await
|
|
1515
|
+
async createEntry(t) {
|
|
1516
|
+
const e = new this.entryClass(this, t);
|
|
1517
|
+
return await a(e, "init"), await r("onCreateEntry", this, e), e;
|
|
1496
1518
|
}
|
|
1497
1519
|
async destroyEntry(t) {
|
|
1498
|
-
return await
|
|
1520
|
+
return await r("onDestroyEntry", this, t), await a(t, "destroy"), t;
|
|
1499
1521
|
}
|
|
1500
|
-
async register(t
|
|
1501
|
-
const
|
|
1502
|
-
|
|
1503
|
-
const o = this.collection[n];
|
|
1504
|
-
return o.el = i, typeof o.init == "function" && await o.init(s), o;
|
|
1505
|
-
} else {
|
|
1506
|
-
const o = await this.createEntry(i, s);
|
|
1507
|
-
return this.collection.push(o), await a("onRegisterEntry", this, o), o;
|
|
1508
|
-
}
|
|
1522
|
+
async register(t) {
|
|
1523
|
+
const e = this.collection.findIndex((i) => i.id === t.id);
|
|
1524
|
+
return ~e ? this.collection[e] = t : this.collection.push(t), await r("onRegisterEntry", this, t), t;
|
|
1509
1525
|
}
|
|
1510
1526
|
async deregister(t) {
|
|
1511
|
-
const
|
|
1512
|
-
if (~
|
|
1513
|
-
|
|
1514
|
-
return await a(
|
|
1527
|
+
const e = this.collection.findIndex((i) => i.id === t.id);
|
|
1528
|
+
if (~e) {
|
|
1529
|
+
await r(
|
|
1515
1530
|
"onDeregisterEntry",
|
|
1516
1531
|
this,
|
|
1517
|
-
this.collection[
|
|
1518
|
-
)
|
|
1532
|
+
this.collection[e]
|
|
1533
|
+
);
|
|
1534
|
+
const [i] = this.collection.splice(e, 1);
|
|
1519
1535
|
}
|
|
1520
|
-
return
|
|
1536
|
+
return t;
|
|
1537
|
+
}
|
|
1538
|
+
async mount(t = (e) => e) {
|
|
1539
|
+
for (const e of this.config?.plugins || [])
|
|
1540
|
+
this.plugins.add(e);
|
|
1541
|
+
for (const e of this.plugins)
|
|
1542
|
+
await a(e, "setup", this);
|
|
1543
|
+
if (await r("beforeMount", this), this.config.selector) {
|
|
1544
|
+
const e = document.querySelectorAll(this.config.selector);
|
|
1545
|
+
for (const i of e)
|
|
1546
|
+
await this.createEntry(i).then((n) => t(n)).then((n) => this.register(n));
|
|
1547
|
+
}
|
|
1548
|
+
return await r("afterMount", this), this;
|
|
1521
1549
|
}
|
|
1522
|
-
async
|
|
1523
|
-
this.
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
for (const
|
|
1527
|
-
await
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
for (const i of s)
|
|
1531
|
-
await this.register(i);
|
|
1532
|
-
return await a("afterMount", this), this;
|
|
1533
|
-
}
|
|
1534
|
-
async unmount() {
|
|
1535
|
-
for (await a("beforeUnmount", this); this.collection.length > 0; )
|
|
1536
|
-
await this.deregister(this.collection[0].id);
|
|
1537
|
-
await a("afterUnmount", this);
|
|
1538
|
-
for (const t of this.plugins)
|
|
1539
|
-
await r(t, "teardown", { plugin: t, parent: this });
|
|
1540
|
-
for (const t of [...this.plugins])
|
|
1541
|
-
this.plugins.remove(t.name);
|
|
1550
|
+
async unmount(t = (e) => e) {
|
|
1551
|
+
for (await r("beforeUnmount", this); this.collection.length > 0; )
|
|
1552
|
+
await this.destroyEntry(this.collection[0]).then((e) => t(e)).then((e) => this.deregister(e));
|
|
1553
|
+
await r("afterUnmount", this);
|
|
1554
|
+
for (const e of this.plugins)
|
|
1555
|
+
await a(e, "teardown", this);
|
|
1556
|
+
for (const e of [...this.plugins])
|
|
1557
|
+
this.plugins.remove(e.name);
|
|
1542
1558
|
return this;
|
|
1543
1559
|
}
|
|
1544
|
-
}
|
|
1545
|
-
|
|
1560
|
+
};
|
|
1561
|
+
w("theme-prefix", { fallback: "vb-theme-" });
|
|
1562
|
+
const I$1 = {
|
|
1546
1563
|
// Data attributes
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1564
|
+
attrOpen: "modal-open",
|
|
1565
|
+
attrClose: "modal-close",
|
|
1566
|
+
attrReplace: "modal-replace",
|
|
1550
1567
|
// Selectors
|
|
1551
1568
|
selector: ".modal",
|
|
1552
1569
|
selectorDialog: ".modal__dialog",
|
|
@@ -1560,149 +1577,153 @@
|
|
|
1560
1577
|
stateOpening: "is-opening",
|
|
1561
1578
|
stateClosing: "is-closing",
|
|
1562
1579
|
stateClosed: "is-closed",
|
|
1563
|
-
// Feature
|
|
1580
|
+
// Feature configurations
|
|
1564
1581
|
customProps: ["transition-duration"],
|
|
1565
1582
|
customEventPrefix: "modal:",
|
|
1566
1583
|
setTabindex: true,
|
|
1567
1584
|
transition: true,
|
|
1568
1585
|
transitionDuration: 300
|
|
1569
1586
|
};
|
|
1570
|
-
function c(
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1587
|
+
function c(s) {
|
|
1588
|
+
if (s.active) {
|
|
1589
|
+
const t = s.active.dialog.querySelector(s.config.selectorFocus) || s.active.dialog;
|
|
1590
|
+
"focus" in t && typeof t.focus == "function" && t.focus();
|
|
1591
|
+
} else
|
|
1592
|
+
s.trigger && (s.trigger.focus(), s.trigger = null);
|
|
1593
|
+
}
|
|
1594
|
+
async function l(s, t, e = true) {
|
|
1595
|
+
return s.parent.stack.moveToTop(s), s.state === "closed" && (s.state = "opening", s.parent.stack.add(s), t ?? s.config.get("transition") ? await u(
|
|
1596
|
+
s.el,
|
|
1597
|
+
s.config.get("stateClosed"),
|
|
1598
|
+
s.config.get("stateOpening"),
|
|
1599
|
+
s.config.get("stateOpened"),
|
|
1600
|
+
s.config.get("transitionDuration")
|
|
1601
|
+
) : (s.el.classList.add(s.config.get("stateOpened")), s.el.classList.remove(s.config.get("stateClosed"))), s.state = "opened"), e && c(s.parent), s.el.dispatchEvent(
|
|
1602
|
+
new CustomEvent(s.config.get("customEventPrefix") + "opened", {
|
|
1603
|
+
detail: s.parent,
|
|
1583
1604
|
bubbles: true
|
|
1584
1605
|
})
|
|
1585
|
-
), await
|
|
1586
|
-
}
|
|
1587
|
-
async function
|
|
1588
|
-
return
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
) : (
|
|
1595
|
-
new CustomEvent(
|
|
1596
|
-
detail:
|
|
1606
|
+
), await s.parent.emit("opened", s), s;
|
|
1607
|
+
}
|
|
1608
|
+
async function h(s, t, e = true) {
|
|
1609
|
+
return s && s.state === "opened" && (s.state = "closing", document.activeElement && document.activeElement instanceof HTMLElement && document.activeElement.blur(), t ?? s.config.get("transition") ? await u(
|
|
1610
|
+
s.el,
|
|
1611
|
+
s.config.get("stateOpened"),
|
|
1612
|
+
s.config.get("stateClosing"),
|
|
1613
|
+
s.config.get("stateClosed"),
|
|
1614
|
+
s.config.get("transitionDuration")
|
|
1615
|
+
) : (s.el.classList.add(s.config.get("stateClosed")), s.el.classList.remove(s.config.get("stateOpened"))), s.parent.stack.remove(s), s.state = "closed", e && c(s.parent), s.el.dispatchEvent(
|
|
1616
|
+
new CustomEvent(s.config.get("customEventPrefix") + "closed", {
|
|
1617
|
+
detail: s.parent,
|
|
1597
1618
|
bubbles: true
|
|
1598
1619
|
})
|
|
1599
|
-
), await
|
|
1620
|
+
), await s.parent.emit("closed", s)), s;
|
|
1600
1621
|
}
|
|
1601
|
-
async function
|
|
1622
|
+
async function g(s, t, e = true) {
|
|
1602
1623
|
let i, n;
|
|
1603
|
-
return
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
]),
|
|
1624
|
+
return s.state === "opened" ? (i = s, n = await s.parent.closeAll(s.id, t)) : [n, i] = await Promise.all([
|
|
1625
|
+
s.parent.closeAll("", t),
|
|
1626
|
+
l(s, t, false)
|
|
1627
|
+
]), e && c(s.parent), { opened: i, closed: n };
|
|
1607
1628
|
}
|
|
1608
|
-
|
|
1609
|
-
constructor(t,
|
|
1610
|
-
super(t,
|
|
1629
|
+
class $ extends d {
|
|
1630
|
+
constructor(t, e) {
|
|
1631
|
+
super(t, e), this.state = "closed", this.dialog = this.el.querySelector(this.config.get("selectorDialog")) || this.el;
|
|
1611
1632
|
}
|
|
1612
1633
|
get isRequired() {
|
|
1613
|
-
return this.dialog.matches(this.
|
|
1634
|
+
return this.dialog.matches(this.config.get("selectorRequired"));
|
|
1614
1635
|
}
|
|
1615
|
-
async open(t,
|
|
1616
|
-
return
|
|
1636
|
+
async open(t, e) {
|
|
1637
|
+
return l(this, t, e);
|
|
1617
1638
|
}
|
|
1618
|
-
async close(t,
|
|
1619
|
-
return
|
|
1639
|
+
async close(t, e) {
|
|
1640
|
+
return h(this, t, e);
|
|
1620
1641
|
}
|
|
1621
|
-
async replace(t,
|
|
1622
|
-
return
|
|
1642
|
+
async replace(t, e) {
|
|
1643
|
+
return g(this, t, e);
|
|
1623
1644
|
}
|
|
1624
1645
|
async deregister() {
|
|
1625
|
-
return this.parent.deregister(this
|
|
1646
|
+
return this.parent.deregister(this);
|
|
1626
1647
|
}
|
|
1627
1648
|
async onCreateEntry() {
|
|
1628
|
-
this.dialog.setAttribute("aria-modal", "true"), this.dialog.hasAttribute("role") || this.dialog.setAttribute("role", "dialog"), this.
|
|
1649
|
+
this.dialog.setAttribute("aria-modal", "true"), this.dialog.hasAttribute("role") || this.dialog.setAttribute("role", "dialog"), this.config.get("setTabindex") && this.dialog.setAttribute("tabindex", "-1");
|
|
1629
1650
|
}
|
|
1630
1651
|
async onRegisterEntry() {
|
|
1631
|
-
this.el.classList.contains(this.
|
|
1652
|
+
this.el.classList.contains(this.config.get("stateOpened")) ? await this.open(false) : (this.el.classList.remove(this.config.get("stateOpening")), this.el.classList.remove(this.config.get("stateClosing")), this.el.classList.add(this.config.get("stateClosed")));
|
|
1632
1653
|
}
|
|
1633
1654
|
async onDestroyEntry() {
|
|
1634
1655
|
this.state === "opened" && await this.close(false);
|
|
1635
1656
|
}
|
|
1636
|
-
}
|
|
1637
|
-
async function
|
|
1638
|
-
const t =
|
|
1657
|
+
}
|
|
1658
|
+
async function T(s) {
|
|
1659
|
+
const t = s.target;
|
|
1639
1660
|
if (t) {
|
|
1640
|
-
const
|
|
1641
|
-
[data-${this.
|
|
1642
|
-
[data-${this.
|
|
1643
|
-
[data-${this.
|
|
1661
|
+
const e = t.closest(`
|
|
1662
|
+
[data-${this.config.attrOpen}],
|
|
1663
|
+
[data-${this.config.attrReplace}],
|
|
1664
|
+
[data-${this.config.attrClose}]
|
|
1644
1665
|
`);
|
|
1645
|
-
if (
|
|
1646
|
-
if (
|
|
1647
|
-
const i =
|
|
1648
|
-
return t.closest(this.
|
|
1666
|
+
if (e) {
|
|
1667
|
+
if (s.preventDefault(), e.matches(`[data-${this.config.attrOpen}]`)) {
|
|
1668
|
+
const i = e.getAttribute(`data-${this.config.attrOpen}`)?.trim(), n = this.getOrThrow(i);
|
|
1669
|
+
return t.closest(this.config.selector) || (this.trigger = e), n.open();
|
|
1649
1670
|
}
|
|
1650
|
-
if (
|
|
1651
|
-
const i =
|
|
1652
|
-
return t.closest(this.
|
|
1671
|
+
if (e.matches(`[data-${this.config.attrReplace}]`)) {
|
|
1672
|
+
const i = e.getAttribute(`data-${this.config.attrReplace}`)?.trim(), n = this.getOrThrow(i);
|
|
1673
|
+
return t.closest(this.config.selector) || (this.trigger = e), n.replace();
|
|
1653
1674
|
}
|
|
1654
|
-
if (
|
|
1655
|
-
const i =
|
|
1675
|
+
if (e.matches(`[data-${this.config.attrClose}]`)) {
|
|
1676
|
+
const i = e.getAttribute(`data-${this.config.attrClose}`)?.trim();
|
|
1656
1677
|
return i === "*" ? this.closeAll() : this.close(i || "");
|
|
1657
1678
|
}
|
|
1658
1679
|
}
|
|
1659
|
-
if (this.active && t.matches(this.
|
|
1680
|
+
if (this.active && t.matches(this.config.selectorScreen) && !this.active.isRequired)
|
|
1660
1681
|
return this.close();
|
|
1661
1682
|
}
|
|
1662
1683
|
}
|
|
1663
|
-
function
|
|
1664
|
-
if (
|
|
1684
|
+
function S$1(s) {
|
|
1685
|
+
if (s.key === "Escape" && this.active && !this.active.dialog.matches(this.config.selectorRequired))
|
|
1665
1686
|
return this.close();
|
|
1666
1687
|
}
|
|
1667
|
-
async function
|
|
1668
|
-
const
|
|
1688
|
+
async function M(s = "", t) {
|
|
1689
|
+
const e = [];
|
|
1669
1690
|
return await Promise.all(
|
|
1670
1691
|
this.stack.copy.map(async (i) => {
|
|
1671
|
-
|
|
1692
|
+
s && s === i.id || e.push(await h(i, t, false));
|
|
1672
1693
|
})
|
|
1673
|
-
),
|
|
1694
|
+
), e;
|
|
1674
1695
|
}
|
|
1675
|
-
let
|
|
1676
|
-
#t;
|
|
1677
|
-
#e;
|
|
1696
|
+
let P$1 = class P extends A$1 {
|
|
1678
1697
|
constructor(t) {
|
|
1679
|
-
super({ ...
|
|
1698
|
+
super({ ...I$1, ...t }), this.entryClass = $, this.name = "Modal", this.trigger = null, this.#t = T.bind(this), this.#e = S$1.bind(this), this.stack = new L({
|
|
1680
1699
|
onChange: () => {
|
|
1681
|
-
|
|
1700
|
+
b(
|
|
1682
1701
|
!!this.stack.top,
|
|
1683
|
-
this.
|
|
1684
|
-
this.
|
|
1702
|
+
this.config.selectorInert,
|
|
1703
|
+
this.config.selectorOverflow
|
|
1685
1704
|
);
|
|
1686
1705
|
}
|
|
1687
1706
|
});
|
|
1688
1707
|
}
|
|
1708
|
+
#t;
|
|
1709
|
+
#e;
|
|
1689
1710
|
get active() {
|
|
1690
1711
|
return this.stack.top;
|
|
1691
1712
|
}
|
|
1692
|
-
async open(t,
|
|
1713
|
+
async open(t, e, i) {
|
|
1693
1714
|
const n = this.getOrThrow(t);
|
|
1694
|
-
return
|
|
1715
|
+
return l(n, e, i);
|
|
1695
1716
|
}
|
|
1696
|
-
async close(t,
|
|
1717
|
+
async close(t, e, i) {
|
|
1697
1718
|
const n = t ? this.getOrThrow(t) : this.active;
|
|
1698
|
-
return
|
|
1719
|
+
return h(n, e, i);
|
|
1699
1720
|
}
|
|
1700
|
-
async replace(t,
|
|
1721
|
+
async replace(t, e, i) {
|
|
1701
1722
|
const n = this.getOrThrow(t);
|
|
1702
|
-
return
|
|
1723
|
+
return g(n, e, i);
|
|
1703
1724
|
}
|
|
1704
|
-
async closeAll(t,
|
|
1705
|
-
const n = await
|
|
1725
|
+
async closeAll(t, e, i = true) {
|
|
1726
|
+
const n = await M.call(this, t, e);
|
|
1706
1727
|
return i && c(this), n;
|
|
1707
1728
|
}
|
|
1708
1729
|
async afterMount() {
|
|
@@ -1715,11 +1736,7 @@
|
|
|
1715
1736
|
document.removeEventListener("click", this.#t, false), document.removeEventListener("keydown", this.#e, false);
|
|
1716
1737
|
}
|
|
1717
1738
|
};
|
|
1718
|
-
function
|
|
1719
|
-
const n = (t.getAttribute(`data-${e}`) || "").replace(/'/g, '"');
|
|
1720
|
-
return n ? JSON.parse(n) : {};
|
|
1721
|
-
}
|
|
1722
|
-
function Rt(t) {
|
|
1739
|
+
function jt(t) {
|
|
1723
1740
|
if (typeof t == "string") {
|
|
1724
1741
|
const e = document.getElementById(t);
|
|
1725
1742
|
if (e) return e;
|
|
@@ -1734,84 +1751,107 @@
|
|
|
1734
1751
|
async function z(t, e, ...n) {
|
|
1735
1752
|
e in t && typeof t[e] == "function" && await t[e](...n);
|
|
1736
1753
|
}
|
|
1737
|
-
function
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1754
|
+
function Kt(t, e = {}) {
|
|
1755
|
+
const n = {
|
|
1756
|
+
fallback: null,
|
|
1757
|
+
element: document.body,
|
|
1758
|
+
...e
|
|
1759
|
+
};
|
|
1760
|
+
if (!t.startsWith("--")) {
|
|
1761
|
+
const s = Jt();
|
|
1762
|
+
s && (t = `${s}${t}`), t = `--${t}`;
|
|
1763
|
+
}
|
|
1764
|
+
const i = getComputedStyle(n.element).getPropertyValue(t).trim();
|
|
1765
|
+
if (i)
|
|
1766
|
+
return i;
|
|
1767
|
+
if (n.fallback)
|
|
1768
|
+
return n.fallback;
|
|
1769
|
+
throw new Error(`CSS variable "${t}" was not found!`);
|
|
1770
|
+
}
|
|
1771
|
+
async function N(t, e, n) {
|
|
1746
1772
|
await z(e, t, n), n && await z(n, t);
|
|
1747
1773
|
for (const i of e.plugins)
|
|
1748
|
-
await z(i, t, {
|
|
1749
|
-
await e.emit(t, n);
|
|
1774
|
+
await z(i, t, { parent: e, entry: n });
|
|
1775
|
+
await e.emit(t, { parent: e, entry: n });
|
|
1750
1776
|
}
|
|
1751
|
-
function
|
|
1752
|
-
const e = getComputedStyle(t.el), n = {}, i = t.getSetting("customProps");
|
|
1753
|
-
for (let s = 0; s < i.length; s++) {
|
|
1754
|
-
const o = Qt(), r2 = t.parent.module.toLowerCase(), c2 = kt(i[s]), l = e.getPropertyValue(`--${o}${r2}-${c2}`).trim();
|
|
1755
|
-
l && (n[c2] = l);
|
|
1756
|
-
}
|
|
1757
|
-
return n;
|
|
1758
|
-
}
|
|
1759
|
-
function Qt() {
|
|
1777
|
+
function Jt() {
|
|
1760
1778
|
return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
|
|
1761
1779
|
}
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1780
|
+
class Gt {
|
|
1781
|
+
#t;
|
|
1782
|
+
#e;
|
|
1783
|
+
constructor() {
|
|
1784
|
+
this.#t = {}, this.#e = [];
|
|
1785
|
+
}
|
|
1786
|
+
get(e, n) {
|
|
1787
|
+
const { fallback: i, source: s } = n ?? {};
|
|
1788
|
+
if (s) {
|
|
1789
|
+
const o = this.#t?.[s]?.[e];
|
|
1790
|
+
if (o !== void 0)
|
|
1791
|
+
return o;
|
|
1792
|
+
} else
|
|
1793
|
+
for (const o of this.#e) {
|
|
1794
|
+
const r2 = this.#t?.[o]?.[e];
|
|
1795
|
+
if (r2 !== void 0)
|
|
1796
|
+
return r2;
|
|
1797
|
+
}
|
|
1798
|
+
if (i !== void 0)
|
|
1799
|
+
return i;
|
|
1800
|
+
throw new Error(`Config does not exist: ${e}`);
|
|
1801
|
+
}
|
|
1802
|
+
set(e, n = {}) {
|
|
1803
|
+
let i, s;
|
|
1804
|
+
return typeof e == "string" ? (i = e, s = n) : (i = "entry", s = e), this.#t[i] ? Object.assign(this.#t[i], s) : (this.#e.unshift(i), this.#t[i] = s), this.#t[i];
|
|
1805
|
+
}
|
|
1806
|
+
remove(e) {
|
|
1807
|
+
const n = this.#e.indexOf(e);
|
|
1808
|
+
n !== -1 && this.#e.splice(n, 1), delete this.#t[e];
|
|
1809
|
+
}
|
|
1810
|
+
setSourceOrder(e) {
|
|
1811
|
+
const n = Object.keys(this.#t).reverse(), i = e.filter((s) => n.includes(s));
|
|
1812
|
+
for (const s of n)
|
|
1813
|
+
i.includes(s) || i.push(s);
|
|
1814
|
+
return this.#e = i;
|
|
1815
|
+
}
|
|
1778
1816
|
}
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1817
|
+
class Qt {
|
|
1818
|
+
constructor() {
|
|
1819
|
+
this.events = {};
|
|
1820
|
+
}
|
|
1821
|
+
on(e, n, ...i) {
|
|
1822
|
+
this.events[e] || (this.events[e] = []), this.events[e].some(
|
|
1823
|
+
(s) => s.listener === n
|
|
1824
|
+
) || this.events[e].push({ listener: n, args: i });
|
|
1825
|
+
}
|
|
1826
|
+
off(e, n) {
|
|
1827
|
+
this.events[e] && (this.events[e] = this.events[e].filter(
|
|
1828
|
+
(i) => i.listener !== n
|
|
1789
1829
|
));
|
|
1790
|
-
},
|
|
1791
|
-
async emit(t, e) {
|
|
1792
|
-
if (t = t.startsWith("on") ? t.slice(2, 3).toLowerCase() + t.slice(3) : t, !!this.events[t])
|
|
1793
|
-
for (const { listener: n, args: i } of this.events[t])
|
|
1794
|
-
await n(e, ...i);
|
|
1795
1830
|
}
|
|
1796
|
-
|
|
1797
|
-
|
|
1831
|
+
async emit(e, ...n) {
|
|
1832
|
+
if (e = e.startsWith("on") ? e.slice(2, 3).toLowerCase() + e.slice(3) : e, !!this.events[e])
|
|
1833
|
+
for (const { listener: i, args: s } of this.events[e])
|
|
1834
|
+
await i(...n, ...s);
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1837
|
+
class Zt extends Array {
|
|
1798
1838
|
constructor(e = {}) {
|
|
1799
1839
|
super(), this.presets = e;
|
|
1800
1840
|
}
|
|
1801
|
-
|
|
1802
|
-
const n =
|
|
1803
|
-
e.
|
|
1841
|
+
#t(e) {
|
|
1842
|
+
const n = this.presets?.[e.name] || {}, i = e?.options || {};
|
|
1843
|
+
e.config = { ...e.config, ...n, ...i };
|
|
1804
1844
|
}
|
|
1805
|
-
|
|
1845
|
+
#e(e) {
|
|
1806
1846
|
return !("name" in e) || typeof e.name != "string" ? (console.error("Plugin requires a name!"), false) : true;
|
|
1807
1847
|
}
|
|
1808
1848
|
get(e) {
|
|
1809
|
-
return this.find((n) => n.name === e);
|
|
1849
|
+
return this.find((n) => n.name === e) || null;
|
|
1810
1850
|
}
|
|
1811
1851
|
add(e) {
|
|
1812
1852
|
if (Array.isArray(e))
|
|
1813
1853
|
e.forEach((n) => this.add(n));
|
|
1814
|
-
else if (this
|
|
1854
|
+
else if (this.#t(e), this.#e(e)) {
|
|
1815
1855
|
const n = this.findIndex((i) => i.name === e.name);
|
|
1816
1856
|
~n ? this[n] = e : this.push(e);
|
|
1817
1857
|
}
|
|
@@ -1821,45 +1861,21 @@
|
|
|
1821
1861
|
~n && this.splice(n, 1);
|
|
1822
1862
|
}
|
|
1823
1863
|
}
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
};
|
|
1828
|
-
class Dt {
|
|
1829
|
-
constructor(e, n, i = {}) {
|
|
1830
|
-
this.parent = e, this.el = Rt(n), this.settings = { ...i }, this.dataConfig = {}, this.customProps = {};
|
|
1831
|
-
}
|
|
1832
|
-
get id() {
|
|
1833
|
-
return this.el.id;
|
|
1834
|
-
}
|
|
1835
|
-
applySettings(e) {
|
|
1836
|
-
return Object.assign(this.settings, e);
|
|
1837
|
-
}
|
|
1838
|
-
getSetting(e, n) {
|
|
1839
|
-
return ee.call(this, e, n);
|
|
1840
|
-
}
|
|
1841
|
-
buildDataConfig() {
|
|
1842
|
-
return Object.assign(
|
|
1843
|
-
this.dataConfig,
|
|
1844
|
-
Jt(this.el, this.getSetting("dataConfig"))
|
|
1845
|
-
);
|
|
1846
|
-
}
|
|
1847
|
-
buildCustomProps() {
|
|
1848
|
-
return Object.assign(this.customProps, Gt(this));
|
|
1849
|
-
}
|
|
1850
|
-
async init(e = {}) {
|
|
1851
|
-
this.applySettings(e), this.buildDataConfig(), this.buildCustomProps();
|
|
1852
|
-
}
|
|
1853
|
-
async destroy() {
|
|
1854
|
-
Object.getOwnPropertyNames(this).forEach((e) => {
|
|
1855
|
-
delete this[e];
|
|
1856
|
-
});
|
|
1864
|
+
class Pt {
|
|
1865
|
+
constructor(e, n) {
|
|
1866
|
+
this.config = new Gt(), this.parent = e, this.el = jt(n), this.id = this.el.id, this.config.set("parent", this.parent.config), this.config.set("entry", {});
|
|
1857
1867
|
}
|
|
1858
1868
|
}
|
|
1859
|
-
|
|
1869
|
+
const te = {
|
|
1870
|
+
selector: "",
|
|
1871
|
+
plugins: [],
|
|
1872
|
+
presets: {}
|
|
1873
|
+
};
|
|
1874
|
+
class ee {
|
|
1860
1875
|
constructor(e = {}) {
|
|
1861
|
-
this.
|
|
1876
|
+
this.#t = new Qt(), this.events = this.#t.events, this.on = this.#t.on.bind(this.#t), this.off = this.#t.off.bind(this.#t), this.emit = this.#t.emit.bind(this.#t), this.collection = [], this.entryClass = Pt, this.name = this.constructor.name, this.config = { ...te, ...e }, this.plugins = new Zt(this.config.presets);
|
|
1862
1877
|
}
|
|
1878
|
+
#t;
|
|
1863
1879
|
get(e, n = "id") {
|
|
1864
1880
|
return this.collection.find((i) => i[n] === e);
|
|
1865
1881
|
}
|
|
@@ -1868,65 +1884,60 @@
|
|
|
1868
1884
|
if (i)
|
|
1869
1885
|
return i;
|
|
1870
1886
|
throw new Error(
|
|
1871
|
-
`${this.
|
|
1887
|
+
`${this.name} entry not found in collection with ${String(n)} of "${e}"`
|
|
1872
1888
|
);
|
|
1873
1889
|
}
|
|
1874
|
-
|
|
1875
|
-
return Object.assign(this.
|
|
1890
|
+
updateConfig(e = {}) {
|
|
1891
|
+
return Object.assign(this.config, e);
|
|
1876
1892
|
}
|
|
1877
|
-
async createEntry(e
|
|
1878
|
-
const
|
|
1879
|
-
return await z(
|
|
1893
|
+
async createEntry(e) {
|
|
1894
|
+
const n = new this.entryClass(this, e);
|
|
1895
|
+
return await z(n, "init"), await N("onCreateEntry", this, n), n;
|
|
1880
1896
|
}
|
|
1881
1897
|
async destroyEntry(e) {
|
|
1882
|
-
return await
|
|
1898
|
+
return await N("onDestroyEntry", this, e), await z(e, "destroy"), e;
|
|
1883
1899
|
}
|
|
1884
|
-
async register(e
|
|
1885
|
-
const
|
|
1886
|
-
|
|
1887
|
-
const o = this.collection[s];
|
|
1888
|
-
return o.el = i, typeof o.init == "function" && await o.init(n), o;
|
|
1889
|
-
} else {
|
|
1890
|
-
const o = await this.createEntry(i, n);
|
|
1891
|
-
return this.collection.push(o), await H("onRegisterEntry", this, o), o;
|
|
1892
|
-
}
|
|
1900
|
+
async register(e) {
|
|
1901
|
+
const n = this.collection.findIndex((i) => i.id === e.id);
|
|
1902
|
+
return ~n ? this.collection[n] = e : this.collection.push(e), await N("onRegisterEntry", this, e), e;
|
|
1893
1903
|
}
|
|
1894
1904
|
async deregister(e) {
|
|
1895
|
-
const n = this.collection.findIndex((i) => i.id === e);
|
|
1905
|
+
const n = this.collection.findIndex((i) => i.id === e.id);
|
|
1896
1906
|
if (~n) {
|
|
1897
|
-
|
|
1898
|
-
return await H(
|
|
1907
|
+
await N(
|
|
1899
1908
|
"onDeregisterEntry",
|
|
1900
1909
|
this,
|
|
1901
1910
|
this.collection[n]
|
|
1902
|
-
)
|
|
1911
|
+
);
|
|
1912
|
+
const [i] = this.collection.splice(n, 1);
|
|
1903
1913
|
}
|
|
1904
|
-
return
|
|
1914
|
+
return e;
|
|
1905
1915
|
}
|
|
1906
|
-
async mount(e =
|
|
1907
|
-
this.
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
return await
|
|
1917
|
-
}
|
|
1918
|
-
async unmount() {
|
|
1919
|
-
for (await
|
|
1920
|
-
await this.
|
|
1921
|
-
await
|
|
1922
|
-
for (const
|
|
1923
|
-
await z(
|
|
1924
|
-
for (const
|
|
1925
|
-
this.plugins.remove(
|
|
1916
|
+
async mount(e = (n) => n) {
|
|
1917
|
+
for (const n of this.config?.plugins || [])
|
|
1918
|
+
this.plugins.add(n);
|
|
1919
|
+
for (const n of this.plugins)
|
|
1920
|
+
await z(n, "setup", this);
|
|
1921
|
+
if (await N("beforeMount", this), this.config.selector) {
|
|
1922
|
+
const n = document.querySelectorAll(this.config.selector);
|
|
1923
|
+
for (const i of n)
|
|
1924
|
+
await this.createEntry(i).then((s) => e(s)).then((s) => this.register(s));
|
|
1925
|
+
}
|
|
1926
|
+
return await N("afterMount", this), this;
|
|
1927
|
+
}
|
|
1928
|
+
async unmount(e = (n) => n) {
|
|
1929
|
+
for (await N("beforeUnmount", this); this.collection.length > 0; )
|
|
1930
|
+
await this.destroyEntry(this.collection[0]).then((n) => e(n)).then((n) => this.deregister(n));
|
|
1931
|
+
await N("afterUnmount", this);
|
|
1932
|
+
for (const n of this.plugins)
|
|
1933
|
+
await z(n, "teardown", this);
|
|
1934
|
+
for (const n of [...this.plugins])
|
|
1935
|
+
this.plugins.remove(n.name);
|
|
1926
1936
|
return this;
|
|
1927
1937
|
}
|
|
1928
1938
|
}
|
|
1929
|
-
|
|
1939
|
+
Kt("theme-prefix", { fallback: "vb-theme-" });
|
|
1940
|
+
const ne = {
|
|
1930
1941
|
// Selectors
|
|
1931
1942
|
selector: ".popover",
|
|
1932
1943
|
selectorTooltip: ".popover_tooltip",
|
|
@@ -1951,22 +1962,22 @@
|
|
|
1951
1962
|
shiftPadding: 0,
|
|
1952
1963
|
arrowPadding: 0,
|
|
1953
1964
|
toggleDelay: 0
|
|
1954
|
-
},
|
|
1965
|
+
}, j = Math.min, q = Math.max, st = Math.round, it = Math.floor, P = (t) => ({
|
|
1955
1966
|
x: t,
|
|
1956
1967
|
y: t
|
|
1957
|
-
}),
|
|
1968
|
+
}), ie = {
|
|
1958
1969
|
left: "right",
|
|
1959
1970
|
right: "left",
|
|
1960
1971
|
bottom: "top",
|
|
1961
1972
|
top: "bottom"
|
|
1962
|
-
},
|
|
1973
|
+
}, se = {
|
|
1963
1974
|
start: "end",
|
|
1964
1975
|
end: "start"
|
|
1965
1976
|
};
|
|
1966
|
-
function
|
|
1967
|
-
return
|
|
1977
|
+
function ht(t, e, n) {
|
|
1978
|
+
return q(t, j(e, n));
|
|
1968
1979
|
}
|
|
1969
|
-
function
|
|
1980
|
+
function X(t, e) {
|
|
1970
1981
|
return typeof t == "function" ? t(e) : t;
|
|
1971
1982
|
}
|
|
1972
1983
|
function I(t) {
|
|
@@ -1981,48 +1992,48 @@
|
|
|
1981
1992
|
function wt(t) {
|
|
1982
1993
|
return t === "y" ? "height" : "width";
|
|
1983
1994
|
}
|
|
1984
|
-
const
|
|
1995
|
+
const oe = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
1985
1996
|
function F(t) {
|
|
1986
|
-
return
|
|
1997
|
+
return oe.has(I(t)) ? "y" : "x";
|
|
1987
1998
|
}
|
|
1988
1999
|
function yt(t) {
|
|
1989
2000
|
return pt(F(t));
|
|
1990
2001
|
}
|
|
1991
|
-
function
|
|
2002
|
+
function re(t, e, n) {
|
|
1992
2003
|
n === void 0 && (n = false);
|
|
1993
2004
|
const i = et(t), s = yt(t), o = wt(s);
|
|
1994
2005
|
let r2 = s === "x" ? i === (n ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
1995
2006
|
return e.reference[o] > e.floating[o] && (r2 = ot(r2)), [r2, ot(r2)];
|
|
1996
2007
|
}
|
|
1997
|
-
function
|
|
2008
|
+
function ce(t) {
|
|
1998
2009
|
const e = ot(t);
|
|
1999
|
-
return [
|
|
2010
|
+
return [gt(t), e, gt(e)];
|
|
2000
2011
|
}
|
|
2001
|
-
function
|
|
2002
|
-
return t.replace(/start|end/g, (e) =>
|
|
2012
|
+
function gt(t) {
|
|
2013
|
+
return t.replace(/start|end/g, (e) => se[e]);
|
|
2003
2014
|
}
|
|
2004
|
-
const
|
|
2005
|
-
function
|
|
2015
|
+
const Et = ["left", "right"], At = ["right", "left"], le = ["top", "bottom"], ae = ["bottom", "top"];
|
|
2016
|
+
function fe(t, e, n) {
|
|
2006
2017
|
switch (t) {
|
|
2007
2018
|
case "top":
|
|
2008
2019
|
case "bottom":
|
|
2009
|
-
return n ? e ?
|
|
2020
|
+
return n ? e ? At : Et : e ? Et : At;
|
|
2010
2021
|
case "left":
|
|
2011
2022
|
case "right":
|
|
2012
|
-
return e ?
|
|
2023
|
+
return e ? le : ae;
|
|
2013
2024
|
default:
|
|
2014
2025
|
return [];
|
|
2015
2026
|
}
|
|
2016
2027
|
}
|
|
2017
|
-
function
|
|
2028
|
+
function ue(t, e, n, i) {
|
|
2018
2029
|
const s = et(t);
|
|
2019
|
-
let o =
|
|
2020
|
-
return s && (o = o.map((r2) => r2 + "-" + s), e && (o = o.concat(o.map(
|
|
2030
|
+
let o = fe(I(t), n === "start", i);
|
|
2031
|
+
return s && (o = o.map((r2) => r2 + "-" + s), e && (o = o.concat(o.map(gt)))), o;
|
|
2021
2032
|
}
|
|
2022
2033
|
function ot(t) {
|
|
2023
|
-
return t.replace(/left|right|bottom|top/g, (e) =>
|
|
2034
|
+
return t.replace(/left|right|bottom|top/g, (e) => ie[e]);
|
|
2024
2035
|
}
|
|
2025
|
-
function
|
|
2036
|
+
function de(t) {
|
|
2026
2037
|
return {
|
|
2027
2038
|
top: 0,
|
|
2028
2039
|
right: 0,
|
|
@@ -2031,8 +2042,8 @@
|
|
|
2031
2042
|
...t
|
|
2032
2043
|
};
|
|
2033
2044
|
}
|
|
2034
|
-
function
|
|
2035
|
-
return typeof t != "number" ?
|
|
2045
|
+
function kt(t) {
|
|
2046
|
+
return typeof t != "number" ? de(t) : {
|
|
2036
2047
|
top: t,
|
|
2037
2048
|
right: t,
|
|
2038
2049
|
bottom: t,
|
|
@@ -2062,9 +2073,9 @@
|
|
|
2062
2073
|
reference: i,
|
|
2063
2074
|
floating: s
|
|
2064
2075
|
} = t;
|
|
2065
|
-
const o = F(e), r2 = yt(e), c2 = wt(r2),
|
|
2076
|
+
const o = F(e), r2 = yt(e), c2 = wt(r2), a2 = I(e), l2 = o === "y", d2 = i.x + i.width / 2 - s.width / 2, u2 = i.y + i.height / 2 - s.height / 2, h2 = i[c2] / 2 - s[c2] / 2;
|
|
2066
2077
|
let f2;
|
|
2067
|
-
switch (
|
|
2078
|
+
switch (a2) {
|
|
2068
2079
|
case "top":
|
|
2069
2080
|
f2 = {
|
|
2070
2081
|
x: d2,
|
|
@@ -2097,29 +2108,29 @@
|
|
|
2097
2108
|
}
|
|
2098
2109
|
switch (et(e)) {
|
|
2099
2110
|
case "start":
|
|
2100
|
-
f2[r2] -=
|
|
2111
|
+
f2[r2] -= h2 * (n && l2 ? -1 : 1);
|
|
2101
2112
|
break;
|
|
2102
2113
|
case "end":
|
|
2103
|
-
f2[r2] +=
|
|
2114
|
+
f2[r2] += h2 * (n && l2 ? -1 : 1);
|
|
2104
2115
|
break;
|
|
2105
2116
|
}
|
|
2106
2117
|
return f2;
|
|
2107
2118
|
}
|
|
2108
|
-
const
|
|
2119
|
+
const he = async (t, e, n) => {
|
|
2109
2120
|
const {
|
|
2110
2121
|
placement: i = "bottom",
|
|
2111
2122
|
strategy: s = "absolute",
|
|
2112
2123
|
middleware: o = [],
|
|
2113
2124
|
platform: r2
|
|
2114
|
-
} = n, c2 = o.filter(Boolean),
|
|
2115
|
-
let
|
|
2125
|
+
} = n, c2 = o.filter(Boolean), a2 = await (r2.isRTL == null ? void 0 : r2.isRTL(e));
|
|
2126
|
+
let l2 = await r2.getElementRects({
|
|
2116
2127
|
reference: t,
|
|
2117
2128
|
floating: e,
|
|
2118
2129
|
strategy: s
|
|
2119
2130
|
}), {
|
|
2120
2131
|
x: d2,
|
|
2121
2132
|
y: u2
|
|
2122
|
-
} = Ct(
|
|
2133
|
+
} = Ct(l2, i, a2), h2 = i, f2 = {}, g2 = 0;
|
|
2123
2134
|
for (let m2 = 0; m2 < c2.length; m2++) {
|
|
2124
2135
|
const {
|
|
2125
2136
|
name: p2,
|
|
@@ -2127,16 +2138,16 @@
|
|
|
2127
2138
|
} = c2[m2], {
|
|
2128
2139
|
x: y2,
|
|
2129
2140
|
y: x2,
|
|
2130
|
-
data:
|
|
2131
|
-
reset:
|
|
2141
|
+
data: b2,
|
|
2142
|
+
reset: v2
|
|
2132
2143
|
} = await w2({
|
|
2133
2144
|
x: d2,
|
|
2134
2145
|
y: u2,
|
|
2135
2146
|
initialPlacement: i,
|
|
2136
|
-
placement:
|
|
2147
|
+
placement: h2,
|
|
2137
2148
|
strategy: s,
|
|
2138
2149
|
middlewareData: f2,
|
|
2139
|
-
rects:
|
|
2150
|
+
rects: l2,
|
|
2140
2151
|
platform: r2,
|
|
2141
2152
|
elements: {
|
|
2142
2153
|
reference: t,
|
|
@@ -2147,26 +2158,26 @@
|
|
|
2147
2158
|
...f2,
|
|
2148
2159
|
[p2]: {
|
|
2149
2160
|
...f2[p2],
|
|
2150
|
-
...
|
|
2161
|
+
...b2
|
|
2151
2162
|
}
|
|
2152
|
-
},
|
|
2163
|
+
}, v2 && g2 <= 50 && (g2++, typeof v2 == "object" && (v2.placement && (h2 = v2.placement), v2.rects && (l2 = v2.rects === true ? await r2.getElementRects({
|
|
2153
2164
|
reference: t,
|
|
2154
2165
|
floating: e,
|
|
2155
2166
|
strategy: s
|
|
2156
|
-
}) :
|
|
2167
|
+
}) : v2.rects), {
|
|
2157
2168
|
x: d2,
|
|
2158
2169
|
y: u2
|
|
2159
|
-
} = Ct(
|
|
2170
|
+
} = Ct(l2, h2, a2)), m2 = -1);
|
|
2160
2171
|
}
|
|
2161
2172
|
return {
|
|
2162
2173
|
x: d2,
|
|
2163
2174
|
y: u2,
|
|
2164
|
-
placement:
|
|
2175
|
+
placement: h2,
|
|
2165
2176
|
strategy: s,
|
|
2166
2177
|
middlewareData: f2
|
|
2167
2178
|
};
|
|
2168
2179
|
};
|
|
2169
|
-
async function
|
|
2180
|
+
async function Dt(t, e) {
|
|
2170
2181
|
var n;
|
|
2171
2182
|
e === void 0 && (e = {});
|
|
2172
2183
|
const {
|
|
@@ -2175,43 +2186,43 @@
|
|
|
2175
2186
|
platform: o,
|
|
2176
2187
|
rects: r2,
|
|
2177
2188
|
elements: c2,
|
|
2178
|
-
strategy:
|
|
2189
|
+
strategy: a2
|
|
2179
2190
|
} = t, {
|
|
2180
|
-
boundary:
|
|
2191
|
+
boundary: l2 = "clippingAncestors",
|
|
2181
2192
|
rootBoundary: d2 = "viewport",
|
|
2182
2193
|
elementContext: u2 = "floating",
|
|
2183
|
-
altBoundary:
|
|
2194
|
+
altBoundary: h2 = false,
|
|
2184
2195
|
padding: f2 = 0
|
|
2185
|
-
} =
|
|
2196
|
+
} = X(e, t), g2 = kt(f2), p2 = c2[h2 ? u2 === "floating" ? "reference" : "floating" : u2], w2 = rt(await o.getClippingRect({
|
|
2186
2197
|
element: (n = await (o.isElement == null ? void 0 : o.isElement(p2))) == null || n ? p2 : p2.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(c2.floating)),
|
|
2187
|
-
boundary:
|
|
2198
|
+
boundary: l2,
|
|
2188
2199
|
rootBoundary: d2,
|
|
2189
|
-
strategy:
|
|
2200
|
+
strategy: a2
|
|
2190
2201
|
})), y2 = u2 === "floating" ? {
|
|
2191
2202
|
x: i,
|
|
2192
2203
|
y: s,
|
|
2193
2204
|
width: r2.floating.width,
|
|
2194
2205
|
height: r2.floating.height
|
|
2195
|
-
} : r2.reference, x2 = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c2.floating)),
|
|
2206
|
+
} : r2.reference, x2 = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c2.floating)), b2 = await (o.isElement == null ? void 0 : o.isElement(x2)) ? await (o.getScale == null ? void 0 : o.getScale(x2)) || {
|
|
2196
2207
|
x: 1,
|
|
2197
2208
|
y: 1
|
|
2198
2209
|
} : {
|
|
2199
2210
|
x: 1,
|
|
2200
2211
|
y: 1
|
|
2201
|
-
},
|
|
2212
|
+
}, v2 = rt(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
2202
2213
|
elements: c2,
|
|
2203
2214
|
rect: y2,
|
|
2204
2215
|
offsetParent: x2,
|
|
2205
|
-
strategy:
|
|
2216
|
+
strategy: a2
|
|
2206
2217
|
}) : y2);
|
|
2207
2218
|
return {
|
|
2208
|
-
top: (w2.top -
|
|
2209
|
-
bottom: (
|
|
2210
|
-
left: (w2.left -
|
|
2211
|
-
right: (
|
|
2219
|
+
top: (w2.top - v2.top + g2.top) / b2.y,
|
|
2220
|
+
bottom: (v2.bottom - w2.bottom + g2.bottom) / b2.y,
|
|
2221
|
+
left: (w2.left - v2.left + g2.left) / b2.x,
|
|
2222
|
+
right: (v2.right - w2.right + g2.right) / b2.x
|
|
2212
2223
|
};
|
|
2213
2224
|
}
|
|
2214
|
-
const
|
|
2225
|
+
const ge = (t) => ({
|
|
2215
2226
|
name: "arrow",
|
|
2216
2227
|
options: t,
|
|
2217
2228
|
async fn(e) {
|
|
@@ -2222,33 +2233,33 @@
|
|
|
2222
2233
|
rects: o,
|
|
2223
2234
|
platform: r2,
|
|
2224
2235
|
elements: c2,
|
|
2225
|
-
middlewareData:
|
|
2236
|
+
middlewareData: a2
|
|
2226
2237
|
} = e, {
|
|
2227
|
-
element:
|
|
2238
|
+
element: l2,
|
|
2228
2239
|
padding: d2 = 0
|
|
2229
|
-
} =
|
|
2230
|
-
if (
|
|
2240
|
+
} = X(t, e) || {};
|
|
2241
|
+
if (l2 == null)
|
|
2231
2242
|
return {};
|
|
2232
|
-
const u2 =
|
|
2243
|
+
const u2 = kt(d2), h2 = {
|
|
2233
2244
|
x: n,
|
|
2234
2245
|
y: i
|
|
2235
|
-
}, f2 = yt(s),
|
|
2236
|
-
let
|
|
2237
|
-
(!
|
|
2238
|
-
const
|
|
2246
|
+
}, f2 = yt(s), g2 = wt(f2), m2 = await r2.getDimensions(l2), p2 = f2 === "y", w2 = p2 ? "top" : "left", y2 = p2 ? "bottom" : "right", x2 = p2 ? "clientHeight" : "clientWidth", b2 = o.reference[g2] + o.reference[f2] - h2[f2] - o.floating[g2], v2 = h2[f2] - o.reference[f2], C2 = await (r2.getOffsetParent == null ? void 0 : r2.getOffsetParent(l2));
|
|
2247
|
+
let L2 = C2 ? C2[x2] : 0;
|
|
2248
|
+
(!L2 || !await (r2.isElement == null ? void 0 : r2.isElement(C2))) && (L2 = c2.floating[x2] || o.floating[g2]);
|
|
2249
|
+
const G2 = b2 / 2 - v2 / 2, V2 = L2 / 2 - m2[g2] / 2 - 1, M2 = j(u2[w2], V2), Q2 = j(u2[y2], V2), B2 = M2, Z2 = L2 - m2[g2] - Q2, E2 = L2 / 2 - m2[g2] / 2 + G2, _2 = ht(B2, E2, Z2), $2 = !a2.arrow && et(s) != null && E2 !== _2 && o.reference[g2] / 2 - (E2 < B2 ? M2 : Q2) - m2[g2] / 2 < 0, O2 = $2 ? E2 < B2 ? E2 - B2 : E2 - Z2 : 0;
|
|
2239
2250
|
return {
|
|
2240
|
-
[f2]:
|
|
2251
|
+
[f2]: h2[f2] + O2,
|
|
2241
2252
|
data: {
|
|
2242
2253
|
[f2]: _2,
|
|
2243
|
-
centerOffset:
|
|
2254
|
+
centerOffset: E2 - _2 - O2,
|
|
2244
2255
|
...$2 && {
|
|
2245
|
-
alignmentOffset:
|
|
2256
|
+
alignmentOffset: O2
|
|
2246
2257
|
}
|
|
2247
2258
|
},
|
|
2248
2259
|
reset: $2
|
|
2249
2260
|
};
|
|
2250
2261
|
}
|
|
2251
|
-
}),
|
|
2262
|
+
}), me = function(t) {
|
|
2252
2263
|
return t === void 0 && (t = {}), {
|
|
2253
2264
|
name: "flip",
|
|
2254
2265
|
options: t,
|
|
@@ -2259,60 +2270,60 @@
|
|
|
2259
2270
|
middlewareData: o,
|
|
2260
2271
|
rects: r2,
|
|
2261
2272
|
initialPlacement: c2,
|
|
2262
|
-
platform:
|
|
2263
|
-
elements:
|
|
2273
|
+
platform: a2,
|
|
2274
|
+
elements: l2
|
|
2264
2275
|
} = e, {
|
|
2265
2276
|
mainAxis: d2 = true,
|
|
2266
2277
|
crossAxis: u2 = true,
|
|
2267
|
-
fallbackPlacements:
|
|
2278
|
+
fallbackPlacements: h2,
|
|
2268
2279
|
fallbackStrategy: f2 = "bestFit",
|
|
2269
|
-
fallbackAxisSideDirection:
|
|
2280
|
+
fallbackAxisSideDirection: g2 = "none",
|
|
2270
2281
|
flipAlignment: m2 = true,
|
|
2271
2282
|
...p2
|
|
2272
|
-
} =
|
|
2283
|
+
} = X(t, e);
|
|
2273
2284
|
if ((n = o.arrow) != null && n.alignmentOffset)
|
|
2274
2285
|
return {};
|
|
2275
|
-
const w2 = I(s), y2 = F(c2), x2 = I(c2) === c2,
|
|
2276
|
-
!
|
|
2277
|
-
const
|
|
2286
|
+
const w2 = I(s), y2 = F(c2), x2 = I(c2) === c2, b2 = await (a2.isRTL == null ? void 0 : a2.isRTL(l2.floating)), v2 = h2 || (x2 || !m2 ? [ot(c2)] : ce(c2)), C2 = g2 !== "none";
|
|
2287
|
+
!h2 && C2 && v2.push(...ue(c2, m2, g2, b2));
|
|
2288
|
+
const L2 = [c2, ...v2], G2 = await Dt(e, p2), V2 = [];
|
|
2278
2289
|
let M2 = ((i = o.flip) == null ? void 0 : i.overflows) || [];
|
|
2279
|
-
if (d2 &&
|
|
2280
|
-
const
|
|
2281
|
-
|
|
2290
|
+
if (d2 && V2.push(G2[w2]), u2) {
|
|
2291
|
+
const E2 = re(s, r2, b2);
|
|
2292
|
+
V2.push(G2[E2[0]], G2[E2[1]]);
|
|
2282
2293
|
}
|
|
2283
2294
|
if (M2 = [...M2, {
|
|
2284
2295
|
placement: s,
|
|
2285
|
-
overflows:
|
|
2286
|
-
}], !
|
|
2287
|
-
var
|
|
2288
|
-
const
|
|
2296
|
+
overflows: V2
|
|
2297
|
+
}], !V2.every((E2) => E2 <= 0)) {
|
|
2298
|
+
var Q2, B2;
|
|
2299
|
+
const E2 = (((Q2 = o.flip) == null ? void 0 : Q2.index) || 0) + 1, _2 = L2[E2];
|
|
2289
2300
|
if (_2 && (!(u2 === "alignment" ? y2 !== F(_2) : false) || // We leave the current main axis only if every placement on that axis
|
|
2290
2301
|
// overflows the main axis.
|
|
2291
|
-
M2.every((
|
|
2302
|
+
M2.every((T2) => F(T2.placement) === y2 ? T2.overflows[0] > 0 : true)))
|
|
2292
2303
|
return {
|
|
2293
2304
|
data: {
|
|
2294
|
-
index:
|
|
2305
|
+
index: E2,
|
|
2295
2306
|
overflows: M2
|
|
2296
2307
|
},
|
|
2297
2308
|
reset: {
|
|
2298
2309
|
placement: _2
|
|
2299
2310
|
}
|
|
2300
2311
|
};
|
|
2301
|
-
let $2 = (B2 = M2.filter((
|
|
2312
|
+
let $2 = (B2 = M2.filter((O2) => O2.overflows[0] <= 0).sort((O2, T2) => O2.overflows[1] - T2.overflows[1])[0]) == null ? void 0 : B2.placement;
|
|
2302
2313
|
if (!$2)
|
|
2303
2314
|
switch (f2) {
|
|
2304
2315
|
case "bestFit": {
|
|
2305
|
-
var
|
|
2306
|
-
const
|
|
2316
|
+
var Z2;
|
|
2317
|
+
const O2 = (Z2 = M2.filter((T2) => {
|
|
2307
2318
|
if (C2) {
|
|
2308
|
-
const
|
|
2309
|
-
return
|
|
2319
|
+
const H2 = F(T2.placement);
|
|
2320
|
+
return H2 === y2 || // Create a bias to the `y` side axis due to horizontal
|
|
2310
2321
|
// reading directions favoring greater width.
|
|
2311
|
-
|
|
2322
|
+
H2 === "y";
|
|
2312
2323
|
}
|
|
2313
2324
|
return true;
|
|
2314
|
-
}).map((
|
|
2315
|
-
|
|
2325
|
+
}).map((T2) => [T2.placement, T2.overflows.filter((H2) => H2 > 0).reduce((H2, Yt) => H2 + Yt, 0)]).sort((T2, H2) => T2[1] - H2[1])[0]) == null ? void 0 : Z2[0];
|
|
2326
|
+
O2 && ($2 = O2);
|
|
2316
2327
|
break;
|
|
2317
2328
|
}
|
|
2318
2329
|
case "initialPlacement":
|
|
@@ -2329,17 +2340,17 @@
|
|
|
2329
2340
|
return {};
|
|
2330
2341
|
}
|
|
2331
2342
|
};
|
|
2332
|
-
},
|
|
2333
|
-
async function
|
|
2343
|
+
}, Mt = /* @__PURE__ */ new Set(["left", "top"]);
|
|
2344
|
+
async function pe(t, e) {
|
|
2334
2345
|
const {
|
|
2335
2346
|
placement: n,
|
|
2336
2347
|
platform: i,
|
|
2337
2348
|
elements: s
|
|
2338
|
-
} = t, o = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), r2 = I(n), c2 = et(n),
|
|
2349
|
+
} = t, o = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), r2 = I(n), c2 = et(n), a2 = F(n) === "y", l2 = Mt.has(r2) ? -1 : 1, d2 = o && a2 ? -1 : 1, u2 = X(e, t);
|
|
2339
2350
|
let {
|
|
2340
|
-
mainAxis:
|
|
2351
|
+
mainAxis: h2,
|
|
2341
2352
|
crossAxis: f2,
|
|
2342
|
-
alignmentAxis:
|
|
2353
|
+
alignmentAxis: g2
|
|
2343
2354
|
} = typeof u2 == "number" ? {
|
|
2344
2355
|
mainAxis: u2,
|
|
2345
2356
|
crossAxis: 0,
|
|
@@ -2349,15 +2360,15 @@
|
|
|
2349
2360
|
crossAxis: u2.crossAxis || 0,
|
|
2350
2361
|
alignmentAxis: u2.alignmentAxis
|
|
2351
2362
|
};
|
|
2352
|
-
return c2 && typeof
|
|
2363
|
+
return c2 && typeof g2 == "number" && (f2 = c2 === "end" ? g2 * -1 : g2), a2 ? {
|
|
2353
2364
|
x: f2 * d2,
|
|
2354
|
-
y:
|
|
2365
|
+
y: h2 * l2
|
|
2355
2366
|
} : {
|
|
2356
|
-
x:
|
|
2367
|
+
x: h2 * l2,
|
|
2357
2368
|
y: f2 * d2
|
|
2358
2369
|
};
|
|
2359
2370
|
}
|
|
2360
|
-
const
|
|
2371
|
+
const we = function(t) {
|
|
2361
2372
|
return t === void 0 && (t = 0), {
|
|
2362
2373
|
name: "offset",
|
|
2363
2374
|
options: t,
|
|
@@ -2368,18 +2379,18 @@
|
|
|
2368
2379
|
y: o,
|
|
2369
2380
|
placement: r2,
|
|
2370
2381
|
middlewareData: c2
|
|
2371
|
-
} = e,
|
|
2382
|
+
} = e, a2 = await pe(e, t);
|
|
2372
2383
|
return r2 === ((n = c2.offset) == null ? void 0 : n.placement) && (i = c2.arrow) != null && i.alignmentOffset ? {} : {
|
|
2373
|
-
x: s +
|
|
2374
|
-
y: o +
|
|
2384
|
+
x: s + a2.x,
|
|
2385
|
+
y: o + a2.y,
|
|
2375
2386
|
data: {
|
|
2376
|
-
...
|
|
2387
|
+
...a2,
|
|
2377
2388
|
placement: r2
|
|
2378
2389
|
}
|
|
2379
2390
|
};
|
|
2380
2391
|
}
|
|
2381
2392
|
};
|
|
2382
|
-
},
|
|
2393
|
+
}, ye = function(t) {
|
|
2383
2394
|
return t === void 0 && (t = {}), {
|
|
2384
2395
|
name: "shift",
|
|
2385
2396
|
options: t,
|
|
@@ -2403,24 +2414,24 @@
|
|
|
2403
2414
|
};
|
|
2404
2415
|
}
|
|
2405
2416
|
},
|
|
2406
|
-
...
|
|
2407
|
-
} =
|
|
2417
|
+
...a2
|
|
2418
|
+
} = X(t, e), l2 = {
|
|
2408
2419
|
x: n,
|
|
2409
2420
|
y: i
|
|
2410
|
-
}, d2 = await
|
|
2411
|
-
let f2 =
|
|
2421
|
+
}, d2 = await Dt(e, a2), u2 = F(I(s)), h2 = pt(u2);
|
|
2422
|
+
let f2 = l2[h2], g2 = l2[u2];
|
|
2412
2423
|
if (o) {
|
|
2413
|
-
const p2 =
|
|
2414
|
-
f2 =
|
|
2424
|
+
const p2 = h2 === "y" ? "top" : "left", w2 = h2 === "y" ? "bottom" : "right", y2 = f2 + d2[p2], x2 = f2 - d2[w2];
|
|
2425
|
+
f2 = ht(y2, f2, x2);
|
|
2415
2426
|
}
|
|
2416
2427
|
if (r2) {
|
|
2417
|
-
const p2 = u2 === "y" ? "top" : "left", w2 = u2 === "y" ? "bottom" : "right", y2 =
|
|
2418
|
-
|
|
2428
|
+
const p2 = u2 === "y" ? "top" : "left", w2 = u2 === "y" ? "bottom" : "right", y2 = g2 + d2[p2], x2 = g2 - d2[w2];
|
|
2429
|
+
g2 = ht(y2, g2, x2);
|
|
2419
2430
|
}
|
|
2420
2431
|
const m2 = c2.fn({
|
|
2421
2432
|
...e,
|
|
2422
|
-
[
|
|
2423
|
-
[u2]:
|
|
2433
|
+
[h2]: f2,
|
|
2434
|
+
[u2]: g2
|
|
2424
2435
|
});
|
|
2425
2436
|
return {
|
|
2426
2437
|
...m2,
|
|
@@ -2428,14 +2439,14 @@
|
|
|
2428
2439
|
x: m2.x - n,
|
|
2429
2440
|
y: m2.y - i,
|
|
2430
2441
|
enabled: {
|
|
2431
|
-
[
|
|
2442
|
+
[h2]: o,
|
|
2432
2443
|
[u2]: r2
|
|
2433
2444
|
}
|
|
2434
2445
|
}
|
|
2435
2446
|
};
|
|
2436
2447
|
}
|
|
2437
2448
|
};
|
|
2438
|
-
},
|
|
2449
|
+
}, xe = function(t) {
|
|
2439
2450
|
return t === void 0 && (t = {}), {
|
|
2440
2451
|
options: t,
|
|
2441
2452
|
fn(e) {
|
|
@@ -2447,14 +2458,14 @@
|
|
|
2447
2458
|
middlewareData: r2
|
|
2448
2459
|
} = e, {
|
|
2449
2460
|
offset: c2 = 0,
|
|
2450
|
-
mainAxis:
|
|
2451
|
-
crossAxis:
|
|
2452
|
-
} =
|
|
2461
|
+
mainAxis: a2 = true,
|
|
2462
|
+
crossAxis: l2 = true
|
|
2463
|
+
} = X(t, e), d2 = {
|
|
2453
2464
|
x: n,
|
|
2454
2465
|
y: i
|
|
2455
|
-
}, u2 = F(s),
|
|
2456
|
-
let f2 = d2[
|
|
2457
|
-
const m2 =
|
|
2466
|
+
}, u2 = F(s), h2 = pt(u2);
|
|
2467
|
+
let f2 = d2[h2], g2 = d2[u2];
|
|
2468
|
+
const m2 = X(c2, e), p2 = typeof m2 == "number" ? {
|
|
2458
2469
|
mainAxis: m2,
|
|
2459
2470
|
crossAxis: 0
|
|
2460
2471
|
} : {
|
|
@@ -2462,18 +2473,18 @@
|
|
|
2462
2473
|
crossAxis: 0,
|
|
2463
2474
|
...m2
|
|
2464
2475
|
};
|
|
2465
|
-
if (l) {
|
|
2466
|
-
const x2 = g2 === "y" ? "height" : "width", v2 = o.reference[g2] - o.floating[x2] + p2.mainAxis, b2 = o.reference[g2] + o.reference[x2] - p2.mainAxis;
|
|
2467
|
-
f2 < v2 ? f2 = v2 : f2 > b2 && (f2 = b2);
|
|
2468
|
-
}
|
|
2469
2476
|
if (a2) {
|
|
2477
|
+
const x2 = h2 === "y" ? "height" : "width", b2 = o.reference[h2] - o.floating[x2] + p2.mainAxis, v2 = o.reference[h2] + o.reference[x2] - p2.mainAxis;
|
|
2478
|
+
f2 < b2 ? f2 = b2 : f2 > v2 && (f2 = v2);
|
|
2479
|
+
}
|
|
2480
|
+
if (l2) {
|
|
2470
2481
|
var w2, y2;
|
|
2471
|
-
const x2 =
|
|
2472
|
-
|
|
2482
|
+
const x2 = h2 === "y" ? "width" : "height", b2 = Mt.has(I(s)), v2 = o.reference[u2] - o.floating[x2] + (b2 && ((w2 = r2.offset) == null ? void 0 : w2[u2]) || 0) + (b2 ? 0 : p2.crossAxis), C2 = o.reference[u2] + o.reference[x2] + (b2 ? 0 : ((y2 = r2.offset) == null ? void 0 : y2[u2]) || 0) - (b2 ? p2.crossAxis : 0);
|
|
2483
|
+
g2 < v2 ? g2 = v2 : g2 > C2 && (g2 = C2);
|
|
2473
2484
|
}
|
|
2474
2485
|
return {
|
|
2475
|
-
[
|
|
2476
|
-
[u2]:
|
|
2486
|
+
[h2]: f2,
|
|
2487
|
+
[u2]: g2
|
|
2477
2488
|
};
|
|
2478
2489
|
}
|
|
2479
2490
|
};
|
|
@@ -2482,45 +2493,45 @@
|
|
|
2482
2493
|
return typeof window < "u";
|
|
2483
2494
|
}
|
|
2484
2495
|
function J(t) {
|
|
2485
|
-
return
|
|
2496
|
+
return $t(t) ? (t.nodeName || "").toLowerCase() : "#document";
|
|
2486
2497
|
}
|
|
2487
|
-
function
|
|
2498
|
+
function A(t) {
|
|
2488
2499
|
var e;
|
|
2489
2500
|
return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
2490
2501
|
}
|
|
2491
2502
|
function D(t) {
|
|
2492
2503
|
var e;
|
|
2493
|
-
return (e = (
|
|
2504
|
+
return (e = ($t(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
2494
2505
|
}
|
|
2495
|
-
function
|
|
2496
|
-
return ct() ? t instanceof Node || t instanceof
|
|
2506
|
+
function $t(t) {
|
|
2507
|
+
return ct() ? t instanceof Node || t instanceof A(t).Node : false;
|
|
2497
2508
|
}
|
|
2498
|
-
function
|
|
2499
|
-
return ct() ? t instanceof Element || t instanceof
|
|
2509
|
+
function S(t) {
|
|
2510
|
+
return ct() ? t instanceof Element || t instanceof A(t).Element : false;
|
|
2500
2511
|
}
|
|
2501
2512
|
function k(t) {
|
|
2502
|
-
return ct() ? t instanceof HTMLElement || t instanceof
|
|
2513
|
+
return ct() ? t instanceof HTMLElement || t instanceof A(t).HTMLElement : false;
|
|
2503
2514
|
}
|
|
2504
|
-
function
|
|
2505
|
-
return !ct() || typeof ShadowRoot > "u" ? false : t instanceof ShadowRoot || t instanceof
|
|
2515
|
+
function Lt(t) {
|
|
2516
|
+
return !ct() || typeof ShadowRoot > "u" ? false : t instanceof ShadowRoot || t instanceof A(t).ShadowRoot;
|
|
2506
2517
|
}
|
|
2507
|
-
const
|
|
2518
|
+
const ve = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
2508
2519
|
function nt(t) {
|
|
2509
2520
|
const {
|
|
2510
2521
|
overflow: e,
|
|
2511
2522
|
overflowX: n,
|
|
2512
2523
|
overflowY: i,
|
|
2513
2524
|
display: s
|
|
2514
|
-
} =
|
|
2515
|
-
return /auto|scroll|overlay|hidden|clip/.test(e + i + n) && !
|
|
2525
|
+
} = R(t);
|
|
2526
|
+
return /auto|scroll|overlay|hidden|clip/.test(e + i + n) && !ve.has(s);
|
|
2516
2527
|
}
|
|
2517
|
-
const
|
|
2518
|
-
function
|
|
2519
|
-
return
|
|
2528
|
+
const be = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
2529
|
+
function Ee(t) {
|
|
2530
|
+
return be.has(J(t));
|
|
2520
2531
|
}
|
|
2521
|
-
const
|
|
2532
|
+
const Ae = [":popover-open", ":modal"];
|
|
2522
2533
|
function lt(t) {
|
|
2523
|
-
return
|
|
2534
|
+
return Ae.some((e) => {
|
|
2524
2535
|
try {
|
|
2525
2536
|
return t.matches(e);
|
|
2526
2537
|
} catch {
|
|
@@ -2528,34 +2539,34 @@
|
|
|
2528
2539
|
}
|
|
2529
2540
|
});
|
|
2530
2541
|
}
|
|
2531
|
-
const
|
|
2542
|
+
const Ce = ["transform", "translate", "scale", "rotate", "perspective"], Le = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Oe = ["paint", "layout", "strict", "content"];
|
|
2532
2543
|
function xt(t) {
|
|
2533
|
-
const e =
|
|
2534
|
-
return
|
|
2544
|
+
const e = vt(), n = S(t) ? R(t) : t;
|
|
2545
|
+
return Ce.some((i) => n[i] ? n[i] !== "none" : false) || (n.containerType ? n.containerType !== "normal" : false) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : false) || !e && (n.filter ? n.filter !== "none" : false) || Le.some((i) => (n.willChange || "").includes(i)) || Oe.some((i) => (n.contain || "").includes(i));
|
|
2535
2546
|
}
|
|
2536
|
-
function
|
|
2537
|
-
let e =
|
|
2547
|
+
function Te(t) {
|
|
2548
|
+
let e = W(t);
|
|
2538
2549
|
for (; k(e) && !K(e); ) {
|
|
2539
2550
|
if (xt(e))
|
|
2540
2551
|
return e;
|
|
2541
2552
|
if (lt(e))
|
|
2542
2553
|
return null;
|
|
2543
|
-
e =
|
|
2554
|
+
e = W(e);
|
|
2544
2555
|
}
|
|
2545
2556
|
return null;
|
|
2546
2557
|
}
|
|
2547
|
-
function
|
|
2558
|
+
function vt() {
|
|
2548
2559
|
return typeof CSS > "u" || !CSS.supports ? false : CSS.supports("-webkit-backdrop-filter", "none");
|
|
2549
2560
|
}
|
|
2550
|
-
const
|
|
2561
|
+
const Se = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
2551
2562
|
function K(t) {
|
|
2552
|
-
return
|
|
2563
|
+
return Se.has(J(t));
|
|
2553
2564
|
}
|
|
2554
|
-
function
|
|
2555
|
-
return
|
|
2565
|
+
function R(t) {
|
|
2566
|
+
return A(t).getComputedStyle(t);
|
|
2556
2567
|
}
|
|
2557
2568
|
function at(t) {
|
|
2558
|
-
return
|
|
2569
|
+
return S(t) ? {
|
|
2559
2570
|
scrollLeft: t.scrollLeft,
|
|
2560
2571
|
scrollTop: t.scrollTop
|
|
2561
2572
|
} : {
|
|
@@ -2563,26 +2574,26 @@
|
|
|
2563
2574
|
scrollTop: t.scrollY
|
|
2564
2575
|
};
|
|
2565
2576
|
}
|
|
2566
|
-
function
|
|
2577
|
+
function W(t) {
|
|
2567
2578
|
if (J(t) === "html")
|
|
2568
2579
|
return t;
|
|
2569
2580
|
const e = (
|
|
2570
2581
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
2571
2582
|
t.assignedSlot || // DOM Element detected.
|
|
2572
2583
|
t.parentNode || // ShadowRoot detected.
|
|
2573
|
-
|
|
2584
|
+
Lt(t) && t.host || // Fallback.
|
|
2574
2585
|
D(t)
|
|
2575
2586
|
);
|
|
2576
|
-
return
|
|
2587
|
+
return Lt(e) ? e.host : e;
|
|
2577
2588
|
}
|
|
2578
|
-
function
|
|
2579
|
-
const e =
|
|
2580
|
-
return K(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : k(e) && nt(e) ? e :
|
|
2589
|
+
function Ft(t) {
|
|
2590
|
+
const e = W(t);
|
|
2591
|
+
return K(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : k(e) && nt(e) ? e : Ft(e);
|
|
2581
2592
|
}
|
|
2582
2593
|
function tt(t, e, n) {
|
|
2583
2594
|
var i;
|
|
2584
2595
|
e === void 0 && (e = []), n === void 0 && (n = true);
|
|
2585
|
-
const s =
|
|
2596
|
+
const s = Ft(t), o = s === ((i = t.ownerDocument) == null ? void 0 : i.body), r2 = A(s);
|
|
2586
2597
|
if (o) {
|
|
2587
2598
|
const c2 = mt(r2);
|
|
2588
2599
|
return e.concat(r2, r2.visualViewport || [], nt(s) ? s : [], c2 && n ? tt(c2) : []);
|
|
@@ -2592,8 +2603,8 @@
|
|
|
2592
2603
|
function mt(t) {
|
|
2593
2604
|
return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
|
|
2594
2605
|
}
|
|
2595
|
-
function
|
|
2596
|
-
const e =
|
|
2606
|
+
function Ht(t) {
|
|
2607
|
+
const e = R(t);
|
|
2597
2608
|
let n = parseFloat(e.width) || 0, i = parseFloat(e.height) || 0;
|
|
2598
2609
|
const s = k(t), o = s ? t.offsetWidth : n, r2 = s ? t.offsetHeight : i, c2 = st(n) !== o || st(i) !== r2;
|
|
2599
2610
|
return c2 && (n = o, i = r2), {
|
|
@@ -2602,69 +2613,69 @@
|
|
|
2602
2613
|
$: c2
|
|
2603
2614
|
};
|
|
2604
2615
|
}
|
|
2605
|
-
function
|
|
2606
|
-
return
|
|
2616
|
+
function bt(t) {
|
|
2617
|
+
return S(t) ? t : t.contextElement;
|
|
2607
2618
|
}
|
|
2608
|
-
function
|
|
2609
|
-
const e =
|
|
2619
|
+
function Y(t) {
|
|
2620
|
+
const e = bt(t);
|
|
2610
2621
|
if (!k(e))
|
|
2611
|
-
return
|
|
2622
|
+
return P(1);
|
|
2612
2623
|
const n = e.getBoundingClientRect(), {
|
|
2613
2624
|
width: i,
|
|
2614
2625
|
height: s,
|
|
2615
2626
|
$: o
|
|
2616
|
-
} =
|
|
2627
|
+
} = Ht(e);
|
|
2617
2628
|
let r2 = (o ? st(n.width) : n.width) / i, c2 = (o ? st(n.height) : n.height) / s;
|
|
2618
2629
|
return (!r2 || !Number.isFinite(r2)) && (r2 = 1), (!c2 || !Number.isFinite(c2)) && (c2 = 1), {
|
|
2619
2630
|
x: r2,
|
|
2620
2631
|
y: c2
|
|
2621
2632
|
};
|
|
2622
2633
|
}
|
|
2623
|
-
const
|
|
2624
|
-
function
|
|
2625
|
-
const e =
|
|
2626
|
-
return !
|
|
2634
|
+
const Re = /* @__PURE__ */ P(0);
|
|
2635
|
+
function Nt(t) {
|
|
2636
|
+
const e = A(t);
|
|
2637
|
+
return !vt() || !e.visualViewport ? Re : {
|
|
2627
2638
|
x: e.visualViewport.offsetLeft,
|
|
2628
2639
|
y: e.visualViewport.offsetTop
|
|
2629
2640
|
};
|
|
2630
2641
|
}
|
|
2631
|
-
function
|
|
2632
|
-
return e === void 0 && (e = false), !n || e && n !==
|
|
2642
|
+
function Pe(t, e, n) {
|
|
2643
|
+
return e === void 0 && (e = false), !n || e && n !== A(t) ? false : e;
|
|
2633
2644
|
}
|
|
2634
2645
|
function U(t, e, n, i) {
|
|
2635
2646
|
e === void 0 && (e = false), n === void 0 && (n = false);
|
|
2636
|
-
const s = t.getBoundingClientRect(), o =
|
|
2637
|
-
let r2 =
|
|
2638
|
-
e && (i ?
|
|
2639
|
-
const c2 =
|
|
2640
|
-
let
|
|
2647
|
+
const s = t.getBoundingClientRect(), o = bt(t);
|
|
2648
|
+
let r2 = P(1);
|
|
2649
|
+
e && (i ? S(i) && (r2 = Y(i)) : r2 = Y(t));
|
|
2650
|
+
const c2 = Pe(o, n, i) ? Nt(o) : P(0);
|
|
2651
|
+
let a2 = (s.left + c2.x) / r2.x, l2 = (s.top + c2.y) / r2.y, d2 = s.width / r2.x, u2 = s.height / r2.y;
|
|
2641
2652
|
if (o) {
|
|
2642
|
-
const
|
|
2643
|
-
let
|
|
2644
|
-
for (; m2 && i && f2 !==
|
|
2645
|
-
const p2 =
|
|
2646
|
-
|
|
2653
|
+
const h2 = A(o), f2 = i && S(i) ? A(i) : i;
|
|
2654
|
+
let g2 = h2, m2 = mt(g2);
|
|
2655
|
+
for (; m2 && i && f2 !== g2; ) {
|
|
2656
|
+
const p2 = Y(m2), w2 = m2.getBoundingClientRect(), y2 = R(m2), x2 = w2.left + (m2.clientLeft + parseFloat(y2.paddingLeft)) * p2.x, b2 = w2.top + (m2.clientTop + parseFloat(y2.paddingTop)) * p2.y;
|
|
2657
|
+
a2 *= p2.x, l2 *= p2.y, d2 *= p2.x, u2 *= p2.y, a2 += x2, l2 += b2, g2 = A(m2), m2 = mt(g2);
|
|
2647
2658
|
}
|
|
2648
2659
|
}
|
|
2649
2660
|
return rt({
|
|
2650
2661
|
width: d2,
|
|
2651
2662
|
height: u2,
|
|
2652
|
-
x:
|
|
2653
|
-
y:
|
|
2663
|
+
x: a2,
|
|
2664
|
+
y: l2
|
|
2654
2665
|
});
|
|
2655
2666
|
}
|
|
2656
2667
|
function ft(t, e) {
|
|
2657
2668
|
const n = at(t).scrollLeft;
|
|
2658
2669
|
return e ? e.left + n : U(D(t)).left + n;
|
|
2659
2670
|
}
|
|
2660
|
-
function
|
|
2671
|
+
function It(t, e) {
|
|
2661
2672
|
const n = t.getBoundingClientRect(), i = n.left + e.scrollLeft - ft(t, n), s = n.top + e.scrollTop;
|
|
2662
2673
|
return {
|
|
2663
2674
|
x: i,
|
|
2664
2675
|
y: s
|
|
2665
2676
|
};
|
|
2666
2677
|
}
|
|
2667
|
-
function
|
|
2678
|
+
function ke(t) {
|
|
2668
2679
|
let {
|
|
2669
2680
|
elements: e,
|
|
2670
2681
|
rect: n,
|
|
@@ -2674,78 +2685,78 @@
|
|
|
2674
2685
|
const o = s === "fixed", r2 = D(i), c2 = e ? lt(e.floating) : false;
|
|
2675
2686
|
if (i === r2 || c2 && o)
|
|
2676
2687
|
return n;
|
|
2677
|
-
let
|
|
2688
|
+
let a2 = {
|
|
2678
2689
|
scrollLeft: 0,
|
|
2679
2690
|
scrollTop: 0
|
|
2680
|
-
},
|
|
2681
|
-
const d2 =
|
|
2682
|
-
if ((u2 || !u2 && !o) && ((J(i) !== "body" || nt(r2)) && (
|
|
2691
|
+
}, l2 = P(1);
|
|
2692
|
+
const d2 = P(0), u2 = k(i);
|
|
2693
|
+
if ((u2 || !u2 && !o) && ((J(i) !== "body" || nt(r2)) && (a2 = at(i)), k(i))) {
|
|
2683
2694
|
const f2 = U(i);
|
|
2684
|
-
|
|
2695
|
+
l2 = Y(i), d2.x = f2.x + i.clientLeft, d2.y = f2.y + i.clientTop;
|
|
2685
2696
|
}
|
|
2686
|
-
const
|
|
2697
|
+
const h2 = r2 && !u2 && !o ? It(r2, a2) : P(0);
|
|
2687
2698
|
return {
|
|
2688
|
-
width: n.width *
|
|
2689
|
-
height: n.height *
|
|
2690
|
-
x: n.x *
|
|
2691
|
-
y: n.y *
|
|
2699
|
+
width: n.width * l2.x,
|
|
2700
|
+
height: n.height * l2.y,
|
|
2701
|
+
x: n.x * l2.x - a2.scrollLeft * l2.x + d2.x + h2.x,
|
|
2702
|
+
y: n.y * l2.y - a2.scrollTop * l2.y + d2.y + h2.y
|
|
2692
2703
|
};
|
|
2693
2704
|
}
|
|
2694
|
-
function
|
|
2705
|
+
function De(t) {
|
|
2695
2706
|
return Array.from(t.getClientRects());
|
|
2696
2707
|
}
|
|
2697
|
-
function
|
|
2698
|
-
const e = D(t), n = at(t), i = t.ownerDocument.body, s =
|
|
2708
|
+
function Me(t) {
|
|
2709
|
+
const e = D(t), n = at(t), i = t.ownerDocument.body, s = q(e.scrollWidth, e.clientWidth, i.scrollWidth, i.clientWidth), o = q(e.scrollHeight, e.clientHeight, i.scrollHeight, i.clientHeight);
|
|
2699
2710
|
let r2 = -n.scrollLeft + ft(t);
|
|
2700
2711
|
const c2 = -n.scrollTop;
|
|
2701
|
-
return
|
|
2712
|
+
return R(i).direction === "rtl" && (r2 += q(e.clientWidth, i.clientWidth) - s), {
|
|
2702
2713
|
width: s,
|
|
2703
2714
|
height: o,
|
|
2704
2715
|
x: r2,
|
|
2705
2716
|
y: c2
|
|
2706
2717
|
};
|
|
2707
2718
|
}
|
|
2708
|
-
const
|
|
2709
|
-
function
|
|
2710
|
-
const n =
|
|
2711
|
-
let o = i.clientWidth, r2 = i.clientHeight, c2 = 0,
|
|
2719
|
+
const Ot = 25;
|
|
2720
|
+
function $e(t, e) {
|
|
2721
|
+
const n = A(t), i = D(t), s = n.visualViewport;
|
|
2722
|
+
let o = i.clientWidth, r2 = i.clientHeight, c2 = 0, a2 = 0;
|
|
2712
2723
|
if (s) {
|
|
2713
2724
|
o = s.width, r2 = s.height;
|
|
2714
|
-
const d2 =
|
|
2715
|
-
(!d2 || d2 && e === "fixed") && (c2 = s.offsetLeft,
|
|
2716
|
-
}
|
|
2717
|
-
const
|
|
2718
|
-
if (
|
|
2719
|
-
const d2 = i.ownerDocument, u2 = d2.body,
|
|
2720
|
-
|
|
2721
|
-
} else
|
|
2725
|
+
const d2 = vt();
|
|
2726
|
+
(!d2 || d2 && e === "fixed") && (c2 = s.offsetLeft, a2 = s.offsetTop);
|
|
2727
|
+
}
|
|
2728
|
+
const l2 = ft(i);
|
|
2729
|
+
if (l2 <= 0) {
|
|
2730
|
+
const d2 = i.ownerDocument, u2 = d2.body, h2 = getComputedStyle(u2), f2 = d2.compatMode === "CSS1Compat" && parseFloat(h2.marginLeft) + parseFloat(h2.marginRight) || 0, g2 = Math.abs(i.clientWidth - u2.clientWidth - f2);
|
|
2731
|
+
g2 <= Ot && (o -= g2);
|
|
2732
|
+
} else l2 <= Ot && (o += l2);
|
|
2722
2733
|
return {
|
|
2723
2734
|
width: o,
|
|
2724
2735
|
height: r2,
|
|
2725
2736
|
x: c2,
|
|
2726
|
-
y:
|
|
2737
|
+
y: a2
|
|
2727
2738
|
};
|
|
2728
2739
|
}
|
|
2729
|
-
const
|
|
2730
|
-
function
|
|
2731
|
-
const n = U(t, true, e === "fixed"), i = n.top + t.clientTop, s = n.left + t.clientLeft, o = k(t) ?
|
|
2740
|
+
const Fe = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
2741
|
+
function He(t, e) {
|
|
2742
|
+
const n = U(t, true, e === "fixed"), i = n.top + t.clientTop, s = n.left + t.clientLeft, o = k(t) ? Y(t) : P(1), r2 = t.clientWidth * o.x, c2 = t.clientHeight * o.y, a2 = s * o.x, l2 = i * o.y;
|
|
2732
2743
|
return {
|
|
2733
2744
|
width: r2,
|
|
2734
2745
|
height: c2,
|
|
2735
|
-
x:
|
|
2736
|
-
y:
|
|
2746
|
+
x: a2,
|
|
2747
|
+
y: l2
|
|
2737
2748
|
};
|
|
2738
2749
|
}
|
|
2739
|
-
function
|
|
2750
|
+
function Tt(t, e, n) {
|
|
2740
2751
|
let i;
|
|
2741
2752
|
if (e === "viewport")
|
|
2742
|
-
i =
|
|
2753
|
+
i = $e(t, n);
|
|
2743
2754
|
else if (e === "document")
|
|
2744
|
-
i =
|
|
2745
|
-
else if (
|
|
2746
|
-
i =
|
|
2755
|
+
i = Me(D(t));
|
|
2756
|
+
else if (S(e))
|
|
2757
|
+
i = He(e, n);
|
|
2747
2758
|
else {
|
|
2748
|
-
const s =
|
|
2759
|
+
const s = Nt(t);
|
|
2749
2760
|
i = {
|
|
2750
2761
|
x: e.x - s.x,
|
|
2751
2762
|
y: e.y - s.y,
|
|
@@ -2755,108 +2766,108 @@
|
|
|
2755
2766
|
}
|
|
2756
2767
|
return rt(i);
|
|
2757
2768
|
}
|
|
2758
|
-
function
|
|
2759
|
-
const n =
|
|
2760
|
-
return n === e || !
|
|
2769
|
+
function Wt(t, e) {
|
|
2770
|
+
const n = W(t);
|
|
2771
|
+
return n === e || !S(n) || K(n) ? false : R(n).position === "fixed" || Wt(n, e);
|
|
2761
2772
|
}
|
|
2762
|
-
function
|
|
2773
|
+
function Ne(t, e) {
|
|
2763
2774
|
const n = e.get(t);
|
|
2764
2775
|
if (n)
|
|
2765
2776
|
return n;
|
|
2766
|
-
let i = tt(t, [], false).filter((c2) =>
|
|
2767
|
-
const o =
|
|
2768
|
-
let r2 = o ?
|
|
2769
|
-
for (;
|
|
2770
|
-
const c2 =
|
|
2771
|
-
!
|
|
2777
|
+
let i = tt(t, [], false).filter((c2) => S(c2) && J(c2) !== "body"), s = null;
|
|
2778
|
+
const o = R(t).position === "fixed";
|
|
2779
|
+
let r2 = o ? W(t) : t;
|
|
2780
|
+
for (; S(r2) && !K(r2); ) {
|
|
2781
|
+
const c2 = R(r2), a2 = xt(r2);
|
|
2782
|
+
!a2 && c2.position === "fixed" && (s = null), (o ? !a2 && !s : !a2 && c2.position === "static" && !!s && Fe.has(s.position) || nt(r2) && !a2 && Wt(t, r2)) ? i = i.filter((d2) => d2 !== r2) : s = c2, r2 = W(r2);
|
|
2772
2783
|
}
|
|
2773
2784
|
return e.set(t, i), i;
|
|
2774
2785
|
}
|
|
2775
|
-
function
|
|
2786
|
+
function Ie(t) {
|
|
2776
2787
|
let {
|
|
2777
2788
|
element: e,
|
|
2778
2789
|
boundary: n,
|
|
2779
2790
|
rootBoundary: i,
|
|
2780
2791
|
strategy: s
|
|
2781
2792
|
} = t;
|
|
2782
|
-
const r2 = [...n === "clippingAncestors" ? lt(e) ? [] :
|
|
2783
|
-
const u2 =
|
|
2784
|
-
return
|
|
2785
|
-
},
|
|
2793
|
+
const r2 = [...n === "clippingAncestors" ? lt(e) ? [] : Ne(e, this._c) : [].concat(n), i], c2 = r2[0], a2 = r2.reduce((l2, d2) => {
|
|
2794
|
+
const u2 = Tt(e, d2, s);
|
|
2795
|
+
return l2.top = q(u2.top, l2.top), l2.right = j(u2.right, l2.right), l2.bottom = j(u2.bottom, l2.bottom), l2.left = q(u2.left, l2.left), l2;
|
|
2796
|
+
}, Tt(e, c2, s));
|
|
2786
2797
|
return {
|
|
2787
|
-
width:
|
|
2788
|
-
height:
|
|
2789
|
-
x:
|
|
2790
|
-
y:
|
|
2798
|
+
width: a2.right - a2.left,
|
|
2799
|
+
height: a2.bottom - a2.top,
|
|
2800
|
+
x: a2.left,
|
|
2801
|
+
y: a2.top
|
|
2791
2802
|
};
|
|
2792
2803
|
}
|
|
2793
|
-
function
|
|
2804
|
+
function We(t) {
|
|
2794
2805
|
const {
|
|
2795
2806
|
width: e,
|
|
2796
2807
|
height: n
|
|
2797
|
-
} =
|
|
2808
|
+
} = Ht(t);
|
|
2798
2809
|
return {
|
|
2799
2810
|
width: e,
|
|
2800
2811
|
height: n
|
|
2801
2812
|
};
|
|
2802
2813
|
}
|
|
2803
|
-
function
|
|
2814
|
+
function Ve(t, e, n) {
|
|
2804
2815
|
const i = k(e), s = D(e), o = n === "fixed", r2 = U(t, true, o, e);
|
|
2805
2816
|
let c2 = {
|
|
2806
2817
|
scrollLeft: 0,
|
|
2807
2818
|
scrollTop: 0
|
|
2808
2819
|
};
|
|
2809
|
-
const
|
|
2810
|
-
function
|
|
2811
|
-
|
|
2820
|
+
const a2 = P(0);
|
|
2821
|
+
function l2() {
|
|
2822
|
+
a2.x = ft(s);
|
|
2812
2823
|
}
|
|
2813
2824
|
if (i || !i && !o)
|
|
2814
2825
|
if ((J(e) !== "body" || nt(s)) && (c2 = at(e)), i) {
|
|
2815
2826
|
const f2 = U(e, true, o, e);
|
|
2816
|
-
|
|
2817
|
-
} else s &&
|
|
2818
|
-
o && !i && s &&
|
|
2819
|
-
const d2 = s && !i && !o ?
|
|
2827
|
+
a2.x = f2.x + e.clientLeft, a2.y = f2.y + e.clientTop;
|
|
2828
|
+
} else s && l2();
|
|
2829
|
+
o && !i && s && l2();
|
|
2830
|
+
const d2 = s && !i && !o ? It(s, c2) : P(0), u2 = r2.left + c2.scrollLeft - a2.x - d2.x, h2 = r2.top + c2.scrollTop - a2.y - d2.y;
|
|
2820
2831
|
return {
|
|
2821
2832
|
x: u2,
|
|
2822
|
-
y:
|
|
2833
|
+
y: h2,
|
|
2823
2834
|
width: r2.width,
|
|
2824
2835
|
height: r2.height
|
|
2825
2836
|
};
|
|
2826
2837
|
}
|
|
2827
2838
|
function ut(t) {
|
|
2828
|
-
return
|
|
2839
|
+
return R(t).position === "static";
|
|
2829
2840
|
}
|
|
2830
|
-
function
|
|
2831
|
-
if (!k(t) ||
|
|
2841
|
+
function St(t, e) {
|
|
2842
|
+
if (!k(t) || R(t).position === "fixed")
|
|
2832
2843
|
return null;
|
|
2833
2844
|
if (e)
|
|
2834
2845
|
return e(t);
|
|
2835
2846
|
let n = t.offsetParent;
|
|
2836
2847
|
return D(t) === n && (n = n.ownerDocument.body), n;
|
|
2837
2848
|
}
|
|
2838
|
-
function
|
|
2839
|
-
const n =
|
|
2849
|
+
function Vt(t, e) {
|
|
2850
|
+
const n = A(t);
|
|
2840
2851
|
if (lt(t))
|
|
2841
2852
|
return n;
|
|
2842
2853
|
if (!k(t)) {
|
|
2843
|
-
let s =
|
|
2854
|
+
let s = W(t);
|
|
2844
2855
|
for (; s && !K(s); ) {
|
|
2845
|
-
if (
|
|
2856
|
+
if (S(s) && !ut(s))
|
|
2846
2857
|
return s;
|
|
2847
|
-
s =
|
|
2858
|
+
s = W(s);
|
|
2848
2859
|
}
|
|
2849
2860
|
return n;
|
|
2850
2861
|
}
|
|
2851
|
-
let i =
|
|
2852
|
-
for (; i &&
|
|
2853
|
-
i =
|
|
2854
|
-
return i && K(i) && ut(i) && !xt(i) ? n : i ||
|
|
2862
|
+
let i = St(t, e);
|
|
2863
|
+
for (; i && Ee(i) && ut(i); )
|
|
2864
|
+
i = St(i, e);
|
|
2865
|
+
return i && K(i) && ut(i) && !xt(i) ? n : i || Te(t) || n;
|
|
2855
2866
|
}
|
|
2856
|
-
const
|
|
2857
|
-
const e = this.getOffsetParent ||
|
|
2867
|
+
const Be = async function(t) {
|
|
2868
|
+
const e = this.getOffsetParent || Vt, n = this.getDimensions, i = await n(t.floating);
|
|
2858
2869
|
return {
|
|
2859
|
-
reference:
|
|
2870
|
+
reference: Ve(t.reference, await e(t.floating), t.strategy),
|
|
2860
2871
|
floating: {
|
|
2861
2872
|
x: 0,
|
|
2862
2873
|
y: 0,
|
|
@@ -2865,127 +2876,127 @@
|
|
|
2865
2876
|
}
|
|
2866
2877
|
};
|
|
2867
2878
|
};
|
|
2868
|
-
function
|
|
2869
|
-
return
|
|
2879
|
+
function _e(t) {
|
|
2880
|
+
return R(t).direction === "rtl";
|
|
2870
2881
|
}
|
|
2871
|
-
const
|
|
2872
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
2882
|
+
const ze = {
|
|
2883
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: ke,
|
|
2873
2884
|
getDocumentElement: D,
|
|
2874
|
-
getClippingRect:
|
|
2875
|
-
getOffsetParent:
|
|
2876
|
-
getElementRects:
|
|
2877
|
-
getClientRects:
|
|
2878
|
-
getDimensions:
|
|
2879
|
-
getScale:
|
|
2880
|
-
isElement:
|
|
2881
|
-
isRTL:
|
|
2885
|
+
getClippingRect: Ie,
|
|
2886
|
+
getOffsetParent: Vt,
|
|
2887
|
+
getElementRects: Be,
|
|
2888
|
+
getClientRects: De,
|
|
2889
|
+
getDimensions: We,
|
|
2890
|
+
getScale: Y,
|
|
2891
|
+
isElement: S,
|
|
2892
|
+
isRTL: _e
|
|
2882
2893
|
};
|
|
2883
|
-
function
|
|
2894
|
+
function Bt(t, e) {
|
|
2884
2895
|
return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
|
|
2885
2896
|
}
|
|
2886
|
-
function
|
|
2897
|
+
function qe(t, e) {
|
|
2887
2898
|
let n = null, i;
|
|
2888
2899
|
const s = D(t);
|
|
2889
2900
|
function o() {
|
|
2890
2901
|
var c2;
|
|
2891
2902
|
clearTimeout(i), (c2 = n) == null || c2.disconnect(), n = null;
|
|
2892
2903
|
}
|
|
2893
|
-
function r2(c2,
|
|
2894
|
-
c2 === void 0 && (c2 = false),
|
|
2895
|
-
const
|
|
2904
|
+
function r2(c2, a2) {
|
|
2905
|
+
c2 === void 0 && (c2 = false), a2 === void 0 && (a2 = 1), o();
|
|
2906
|
+
const l2 = t.getBoundingClientRect(), {
|
|
2896
2907
|
left: d2,
|
|
2897
2908
|
top: u2,
|
|
2898
|
-
width:
|
|
2909
|
+
width: h2,
|
|
2899
2910
|
height: f2
|
|
2900
|
-
} =
|
|
2901
|
-
if (c2 || e(), !
|
|
2911
|
+
} = l2;
|
|
2912
|
+
if (c2 || e(), !h2 || !f2)
|
|
2902
2913
|
return;
|
|
2903
|
-
const
|
|
2904
|
-
rootMargin: -
|
|
2905
|
-
threshold:
|
|
2914
|
+
const g2 = it(u2), m2 = it(s.clientWidth - (d2 + h2)), p2 = it(s.clientHeight - (u2 + f2)), w2 = it(d2), x2 = {
|
|
2915
|
+
rootMargin: -g2 + "px " + -m2 + "px " + -p2 + "px " + -w2 + "px",
|
|
2916
|
+
threshold: q(0, j(1, a2)) || 1
|
|
2906
2917
|
};
|
|
2907
|
-
let
|
|
2908
|
-
function
|
|
2909
|
-
const
|
|
2910
|
-
if (
|
|
2911
|
-
if (!
|
|
2918
|
+
let b2 = true;
|
|
2919
|
+
function v2(C2) {
|
|
2920
|
+
const L2 = C2[0].intersectionRatio;
|
|
2921
|
+
if (L2 !== a2) {
|
|
2922
|
+
if (!b2)
|
|
2912
2923
|
return r2();
|
|
2913
|
-
|
|
2924
|
+
L2 ? r2(false, L2) : i = setTimeout(() => {
|
|
2914
2925
|
r2(false, 1e-7);
|
|
2915
2926
|
}, 1e3);
|
|
2916
2927
|
}
|
|
2917
|
-
|
|
2928
|
+
L2 === 1 && !Bt(l2, t.getBoundingClientRect()) && r2(), b2 = false;
|
|
2918
2929
|
}
|
|
2919
2930
|
try {
|
|
2920
|
-
n = new IntersectionObserver(
|
|
2931
|
+
n = new IntersectionObserver(v2, {
|
|
2921
2932
|
...x2,
|
|
2922
2933
|
// Handle <iframe>s
|
|
2923
2934
|
root: s.ownerDocument
|
|
2924
2935
|
});
|
|
2925
2936
|
} catch {
|
|
2926
|
-
n = new IntersectionObserver(
|
|
2937
|
+
n = new IntersectionObserver(v2, x2);
|
|
2927
2938
|
}
|
|
2928
2939
|
n.observe(t);
|
|
2929
2940
|
}
|
|
2930
2941
|
return r2(true), o;
|
|
2931
2942
|
}
|
|
2932
|
-
function
|
|
2943
|
+
function Xe(t, e, n, i) {
|
|
2933
2944
|
i === void 0 && (i = {});
|
|
2934
2945
|
const {
|
|
2935
2946
|
ancestorScroll: s = true,
|
|
2936
2947
|
ancestorResize: o = true,
|
|
2937
2948
|
elementResize: r2 = typeof ResizeObserver == "function",
|
|
2938
2949
|
layoutShift: c2 = typeof IntersectionObserver == "function",
|
|
2939
|
-
animationFrame:
|
|
2940
|
-
} = i,
|
|
2950
|
+
animationFrame: a2 = false
|
|
2951
|
+
} = i, l2 = bt(t), d2 = s || o ? [...l2 ? tt(l2) : [], ...tt(e)] : [];
|
|
2941
2952
|
d2.forEach((w2) => {
|
|
2942
2953
|
s && w2.addEventListener("scroll", n, {
|
|
2943
2954
|
passive: true
|
|
2944
2955
|
}), o && w2.addEventListener("resize", n);
|
|
2945
2956
|
});
|
|
2946
|
-
const u2 =
|
|
2947
|
-
let
|
|
2957
|
+
const u2 = l2 && c2 ? qe(l2, n) : null;
|
|
2958
|
+
let h2 = -1, f2 = null;
|
|
2948
2959
|
r2 && (f2 = new ResizeObserver((w2) => {
|
|
2949
2960
|
let [y2] = w2;
|
|
2950
|
-
y2 && y2.target ===
|
|
2961
|
+
y2 && y2.target === l2 && f2 && (f2.unobserve(e), cancelAnimationFrame(h2), h2 = requestAnimationFrame(() => {
|
|
2951
2962
|
var x2;
|
|
2952
2963
|
(x2 = f2) == null || x2.observe(e);
|
|
2953
2964
|
})), n();
|
|
2954
|
-
}),
|
|
2955
|
-
let
|
|
2956
|
-
|
|
2965
|
+
}), l2 && !a2 && f2.observe(l2), f2.observe(e));
|
|
2966
|
+
let g2, m2 = a2 ? U(t) : null;
|
|
2967
|
+
a2 && p2();
|
|
2957
2968
|
function p2() {
|
|
2958
2969
|
const w2 = U(t);
|
|
2959
|
-
m2 && !
|
|
2970
|
+
m2 && !Bt(m2, w2) && n(), m2 = w2, g2 = requestAnimationFrame(p2);
|
|
2960
2971
|
}
|
|
2961
2972
|
return n(), () => {
|
|
2962
2973
|
var w2;
|
|
2963
2974
|
d2.forEach((y2) => {
|
|
2964
2975
|
s && y2.removeEventListener("scroll", n), o && y2.removeEventListener("resize", n);
|
|
2965
|
-
}), u2?.(), (w2 = f2) == null || w2.disconnect(), f2 = null,
|
|
2976
|
+
}), u2?.(), (w2 = f2) == null || w2.disconnect(), f2 = null, a2 && cancelAnimationFrame(g2);
|
|
2966
2977
|
};
|
|
2967
2978
|
}
|
|
2968
|
-
const
|
|
2979
|
+
const Ue = we, Ye = ye, je = me, Ke = ge, Je = xe, Ge = (t, e, n) => {
|
|
2969
2980
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
2970
|
-
platform:
|
|
2981
|
+
platform: ze,
|
|
2971
2982
|
...n
|
|
2972
2983
|
}, o = {
|
|
2973
2984
|
...s.platform,
|
|
2974
2985
|
_c: i
|
|
2975
2986
|
};
|
|
2976
|
-
return
|
|
2987
|
+
return he(t, e, {
|
|
2977
2988
|
...s,
|
|
2978
2989
|
platform: o
|
|
2979
2990
|
});
|
|
2980
2991
|
};
|
|
2981
|
-
function
|
|
2992
|
+
function Rt(t, e, n) {
|
|
2982
2993
|
Object.assign(t.style, {
|
|
2983
2994
|
left: e != null ? `${e}px` : "",
|
|
2984
2995
|
top: n != null ? `${n}px` : ""
|
|
2985
2996
|
});
|
|
2986
2997
|
}
|
|
2987
|
-
function
|
|
2988
|
-
let n = t.
|
|
2998
|
+
function _t(t, e) {
|
|
2999
|
+
let n = t.config.get("toggleDelay");
|
|
2989
3000
|
typeof n == "string" && (n.indexOf(",") > -1 && (n = n.split(",")), n.indexOf(" ") > -1 && (n = n.split(" "))), Array.isArray(n) && (n = n[e]);
|
|
2990
3001
|
const i = Number(n);
|
|
2991
3002
|
if (Number.isNaN(i))
|
|
@@ -3031,31 +3042,31 @@
|
|
|
3031
3042
|
}
|
|
3032
3043
|
return e;
|
|
3033
3044
|
}
|
|
3034
|
-
function
|
|
3045
|
+
function Qe(t) {
|
|
3035
3046
|
return {
|
|
3036
|
-
offset: Number(t.
|
|
3047
|
+
offset: Number(t.config.get("offset")),
|
|
3037
3048
|
flip: {
|
|
3038
|
-
padding: dt(t.
|
|
3049
|
+
padding: dt(t.config.get("flipPadding"))
|
|
3039
3050
|
},
|
|
3040
3051
|
shift: {
|
|
3041
|
-
padding: dt(t.
|
|
3052
|
+
padding: dt(t.config.get("shiftPadding"))
|
|
3042
3053
|
},
|
|
3043
3054
|
arrow: {
|
|
3044
|
-
selector: t.
|
|
3055
|
+
selector: t.config.get("selectorArrow"),
|
|
3045
3056
|
element: null,
|
|
3046
|
-
padding: dt(t.
|
|
3057
|
+
padding: dt(t.config.get("arrowPadding"))
|
|
3047
3058
|
}
|
|
3048
3059
|
};
|
|
3049
3060
|
}
|
|
3050
|
-
async function
|
|
3051
|
-
return t && t.state === "opened" && (t.el.inert = true, t.el.classList.remove(t.
|
|
3052
|
-
new CustomEvent(t.
|
|
3061
|
+
async function zt(t) {
|
|
3062
|
+
return t && t.state === "opened" && (t.el.inert = true, t.el.classList.remove(t.config.get("stateActive")), t.isTooltip || t.trigger?.setAttribute("aria-expanded", "false"), t.floatingCleanup(), t.state = "closed", t.trigger === t.parent.trigger && (t.parent.trigger = null), t.el.dispatchEvent(
|
|
3063
|
+
new CustomEvent(t.config.get("customEventPrefix") + "closed", {
|
|
3053
3064
|
detail: t.parent,
|
|
3054
3065
|
bubbles: true
|
|
3055
3066
|
})
|
|
3056
3067
|
), await t.parent.emit("closed", t)), t;
|
|
3057
3068
|
}
|
|
3058
|
-
async function
|
|
3069
|
+
async function qt(t) {
|
|
3059
3070
|
const e = [];
|
|
3060
3071
|
for (const n of t.collection)
|
|
3061
3072
|
n.state === "opened" && e.push(await n.close());
|
|
@@ -3066,35 +3077,35 @@
|
|
|
3066
3077
|
`#${t.id}, [aria-controls="${t.id}"], [aria-describedby="${t.id}"]`
|
|
3067
3078
|
) || t.close(), t), 1);
|
|
3068
3079
|
}
|
|
3069
|
-
function
|
|
3080
|
+
function Ze(t) {
|
|
3070
3081
|
t.state === "opened" ? t.close() : (this.trigger = t.trigger, t.open());
|
|
3071
3082
|
}
|
|
3072
|
-
function
|
|
3083
|
+
function tn(t) {
|
|
3073
3084
|
t.isTooltip && (t.toggleDelayId && clearTimeout(t.toggleDelayId), t.close());
|
|
3074
3085
|
}
|
|
3075
|
-
function
|
|
3076
|
-
if (t.isHovered = e, e.type == "focus" && t.trigger && !t.trigger.matches(":focus-visible"))
|
|
3086
|
+
function en(t, e) {
|
|
3087
|
+
if (!(e instanceof MouseEvent) || (t.isHovered = e, e.type == "focus" && t.trigger && !t.trigger.matches(":focus-visible")))
|
|
3077
3088
|
return;
|
|
3078
3089
|
t.toggleDelayId && clearTimeout(t.toggleDelayId);
|
|
3079
3090
|
const n = t.trigger?.getAttribute("aria-expanded");
|
|
3080
3091
|
if (n && n == "true") return;
|
|
3081
|
-
const i = this.activeHover ? 0 :
|
|
3092
|
+
const i = this.activeHover ? 0 : _t(t, 0);
|
|
3082
3093
|
this.activeHover && this.activeHover.close(), t.toggleDelayId = setTimeout(() => {
|
|
3083
3094
|
t.id && t.open();
|
|
3084
3095
|
}, i);
|
|
3085
3096
|
}
|
|
3086
|
-
function
|
|
3087
|
-
setTimeout(() => {
|
|
3097
|
+
function nn(t, e) {
|
|
3098
|
+
e instanceof MouseEvent && setTimeout(() => {
|
|
3088
3099
|
t.isHovered = e, !t.isHovered && (t.toggleDelayId && clearTimeout(t.toggleDelayId), t.toggleDelayId = setTimeout(
|
|
3089
3100
|
() => Xt(t),
|
|
3090
|
-
|
|
3101
|
+
_t(t, 1)
|
|
3091
3102
|
));
|
|
3092
3103
|
}, 1);
|
|
3093
3104
|
}
|
|
3094
|
-
function
|
|
3105
|
+
function sn(t) {
|
|
3095
3106
|
switch (t.key) {
|
|
3096
3107
|
case "Escape":
|
|
3097
|
-
this.trigger && this.trigger.focus(),
|
|
3108
|
+
this.trigger && this.trigger.focus(), qt(this);
|
|
3098
3109
|
return;
|
|
3099
3110
|
case "Tab":
|
|
3100
3111
|
this.collection.forEach((e) => {
|
|
@@ -3105,62 +3116,61 @@
|
|
|
3105
3116
|
return;
|
|
3106
3117
|
}
|
|
3107
3118
|
}
|
|
3108
|
-
function
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
s && (s.closest(
|
|
3119
|
+
function on(t) {
|
|
3120
|
+
document.addEventListener("click", function e(n) {
|
|
3121
|
+
const i = n.target;
|
|
3122
|
+
i && (i.closest(
|
|
3113
3123
|
`#${t.id}, [aria-controls="${t.id}"], [aria-describedby="${t.id}"]`
|
|
3114
|
-
) ? t.el && !t.el.classList.contains(
|
|
3124
|
+
) ? t.el && !t.el.classList.contains(t.config.get("stateActive")) && this.removeEventListener("click", e) : (t.el && t.el.classList.contains(t.config.get("stateActive")) && t.close(), this.removeEventListener("click", e)));
|
|
3115
3125
|
});
|
|
3116
3126
|
}
|
|
3117
|
-
async function
|
|
3118
|
-
t.el.inert = false, t.el.classList.add(t.
|
|
3119
|
-
const e =
|
|
3127
|
+
async function Ut(t) {
|
|
3128
|
+
t.el.inert = false, t.el.classList.add(t.config.get("stateActive")), t.isTooltip || t.trigger?.setAttribute("aria-expanded", "true"), await t.parent.emit("updateCustomProps", t);
|
|
3129
|
+
const e = Qe(t), n = t.el.querySelector(
|
|
3120
3130
|
e.arrow.selector
|
|
3121
3131
|
);
|
|
3122
|
-
return e.arrow.element = n || null, t.trigger instanceof HTMLElement && (t.floatingCleanup =
|
|
3132
|
+
return e.arrow.element = n || null, t.trigger instanceof HTMLElement && (t.floatingCleanup = Xe(t.trigger, t.el, () => {
|
|
3123
3133
|
const i = [
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3134
|
+
je(e.flip),
|
|
3135
|
+
Ye({ ...e.shift, limiter: Je() }),
|
|
3136
|
+
Ue(e.offset)
|
|
3127
3137
|
];
|
|
3128
3138
|
e.arrow.element && i.push(
|
|
3129
|
-
|
|
3139
|
+
Ke({
|
|
3130
3140
|
...e.arrow,
|
|
3131
3141
|
element: e.arrow.element
|
|
3132
3142
|
})
|
|
3133
|
-
),
|
|
3134
|
-
placement: t.
|
|
3143
|
+
), Ge(t.trigger, t.el, {
|
|
3144
|
+
placement: t.config.get("placement"),
|
|
3135
3145
|
middleware: i
|
|
3136
3146
|
}).then(({ x: s, y: o, placement: r2, middlewareData: c2 }) => {
|
|
3137
3147
|
if (t.el) {
|
|
3138
|
-
if (
|
|
3139
|
-
const { x:
|
|
3140
|
-
|
|
3148
|
+
if (Rt(t.el, s, o), e.arrow.element && c2.arrow) {
|
|
3149
|
+
const { x: a2, y: l2 } = c2.arrow;
|
|
3150
|
+
Rt(e.arrow.element, a2, l2);
|
|
3141
3151
|
}
|
|
3142
3152
|
t.el.setAttribute("data-floating-placement", r2);
|
|
3143
3153
|
}
|
|
3144
3154
|
});
|
|
3145
|
-
})), t.state = "opened", t.
|
|
3146
|
-
new CustomEvent(t.
|
|
3155
|
+
})), t.state = "opened", t.config.get("event") === "click" && on.call(t.parent, t), t.el.dispatchEvent(
|
|
3156
|
+
new CustomEvent(t.config.get("customEventPrefix") + "opened", {
|
|
3147
3157
|
detail: t.parent,
|
|
3148
3158
|
bubbles: true
|
|
3149
3159
|
})
|
|
3150
3160
|
), await t.parent.emit("opened", t), t;
|
|
3151
3161
|
}
|
|
3152
|
-
class
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
constructor(e, n, i = {}) {
|
|
3156
|
-
super(e, n, i), this.state = "closed", this.toggleDelayId = null, this.trigger = null, this.#t = null, this.#e = {
|
|
3162
|
+
class rn extends Pt {
|
|
3163
|
+
constructor(e, n) {
|
|
3164
|
+
super(e, n), this.#t = [], this.#e = {
|
|
3157
3165
|
el: false,
|
|
3158
3166
|
trigger: false
|
|
3159
|
-
}, this.floatingCleanup = () => {
|
|
3167
|
+
}, this.state = "closed", this.trigger = null, this.toggleDelayId = null, this.floatingCleanup = () => {
|
|
3160
3168
|
};
|
|
3161
3169
|
}
|
|
3170
|
+
#t;
|
|
3171
|
+
#e;
|
|
3162
3172
|
get isTooltip() {
|
|
3163
|
-
return !!this.el.closest(this.
|
|
3173
|
+
return !!this.el.closest(this.config.get("selectorTooltip")) || this.el.getAttribute("role") == "tooltip";
|
|
3164
3174
|
}
|
|
3165
3175
|
get isHovered() {
|
|
3166
3176
|
return this.#e.el || this.#e.trigger;
|
|
@@ -3178,47 +3188,55 @@
|
|
|
3178
3188
|
}
|
|
3179
3189
|
}
|
|
3180
3190
|
async open() {
|
|
3181
|
-
return
|
|
3191
|
+
return Ut(this);
|
|
3182
3192
|
}
|
|
3183
3193
|
async close() {
|
|
3184
|
-
return
|
|
3194
|
+
return zt(this);
|
|
3185
3195
|
}
|
|
3186
3196
|
async deregister() {
|
|
3187
|
-
return this.parent.deregister(this
|
|
3197
|
+
return this.parent.deregister(this);
|
|
3188
3198
|
}
|
|
3189
3199
|
registerEventListeners() {
|
|
3190
|
-
this.#t || (this.
|
|
3200
|
+
this.#t.length || (this.config.get("event") === "hover" ? (this.#t = [
|
|
3191
3201
|
{
|
|
3192
3202
|
el: ["el", "trigger"],
|
|
3193
3203
|
type: ["mouseenter", "focus"],
|
|
3194
|
-
listener:
|
|
3204
|
+
listener: en.bind(this.parent, this)
|
|
3195
3205
|
},
|
|
3196
3206
|
{
|
|
3197
3207
|
el: ["el", "trigger"],
|
|
3198
3208
|
type: ["mouseleave", "focusout"],
|
|
3199
|
-
listener:
|
|
3209
|
+
listener: nn.bind(this.parent, this)
|
|
3200
3210
|
},
|
|
3201
3211
|
{
|
|
3202
3212
|
el: ["trigger"],
|
|
3203
3213
|
type: ["click"],
|
|
3204
|
-
listener:
|
|
3214
|
+
listener: tn.bind(this.parent, this)
|
|
3205
3215
|
}
|
|
3206
3216
|
], this.#t.forEach((n) => {
|
|
3207
3217
|
n.el.forEach((i) => {
|
|
3208
3218
|
n.type.forEach((s) => {
|
|
3209
|
-
this[i].addEventListener(
|
|
3219
|
+
this[i].addEventListener(
|
|
3220
|
+
s,
|
|
3221
|
+
n.listener,
|
|
3222
|
+
false
|
|
3223
|
+
);
|
|
3210
3224
|
});
|
|
3211
3225
|
});
|
|
3212
3226
|
})) : (this.#t = [
|
|
3213
3227
|
{
|
|
3214
3228
|
el: ["trigger"],
|
|
3215
3229
|
type: ["click"],
|
|
3216
|
-
listener:
|
|
3230
|
+
listener: Ze.bind(this.parent, this)
|
|
3217
3231
|
}
|
|
3218
3232
|
], this.#t.forEach((n) => {
|
|
3219
3233
|
n.el.forEach((i) => {
|
|
3220
3234
|
n.type.forEach((s) => {
|
|
3221
|
-
this[i].addEventListener(
|
|
3235
|
+
this[i].addEventListener(
|
|
3236
|
+
s,
|
|
3237
|
+
n.listener,
|
|
3238
|
+
false
|
|
3239
|
+
);
|
|
3222
3240
|
});
|
|
3223
3241
|
});
|
|
3224
3242
|
})));
|
|
@@ -3227,41 +3245,45 @@
|
|
|
3227
3245
|
this.#t && (this.#t.forEach((e) => {
|
|
3228
3246
|
e.el.forEach((n) => {
|
|
3229
3247
|
e.type.forEach((i) => {
|
|
3230
|
-
this[n].removeEventListener(
|
|
3248
|
+
this[n].removeEventListener(
|
|
3249
|
+
i,
|
|
3250
|
+
e.listener,
|
|
3251
|
+
false
|
|
3252
|
+
);
|
|
3231
3253
|
});
|
|
3232
3254
|
});
|
|
3233
|
-
}), this.#t =
|
|
3255
|
+
}), this.#t = []);
|
|
3234
3256
|
}
|
|
3235
3257
|
async onCreateEntry() {
|
|
3236
3258
|
this.trigger = document.querySelector(
|
|
3237
3259
|
`[aria-controls="${this.id}"], [aria-describedby="${this.id}"]`
|
|
3238
|
-
), this.isTooltip ? (this.
|
|
3260
|
+
), this.isTooltip ? (this.config.set({ event: "hover" }), this.el.setAttribute("role", "tooltip")) : this.trigger && this.trigger instanceof HTMLElement && this.trigger.setAttribute("aria-expanded", "false");
|
|
3239
3261
|
}
|
|
3240
3262
|
async onRegisterEntry() {
|
|
3241
|
-
this.el.classList.contains(this.
|
|
3263
|
+
this.registerEventListeners(), this.el.classList.contains(this.config.get("stateActive")) ? await this.open() : this.el.inert = true;
|
|
3242
3264
|
}
|
|
3243
3265
|
async onDestroyEntry() {
|
|
3244
3266
|
this.state === "opened" && await this.close(), this.floatingCleanup(), this.deregisterEventListeners();
|
|
3245
3267
|
}
|
|
3246
3268
|
}
|
|
3247
|
-
class
|
|
3248
|
-
#t;
|
|
3269
|
+
class cn extends ee {
|
|
3249
3270
|
constructor(e) {
|
|
3250
|
-
super({ ...
|
|
3271
|
+
super({ ...ne, ...e }), this.entryClass = rn, this.name = "Popover", this.trigger = null, this.#t = sn.bind(this);
|
|
3251
3272
|
}
|
|
3273
|
+
#t;
|
|
3252
3274
|
get active() {
|
|
3253
3275
|
return this.get("opened", "state");
|
|
3254
3276
|
}
|
|
3255
3277
|
get activeHover() {
|
|
3256
|
-
return this.collection.find((e) => e.state == "opened" && e.
|
|
3278
|
+
return this.collection.find((e) => e.state == "opened" && e.config.get("event") == "hover");
|
|
3257
3279
|
}
|
|
3258
3280
|
async open(e) {
|
|
3259
3281
|
const n = this.getOrThrow(e);
|
|
3260
|
-
return
|
|
3282
|
+
return Ut(n);
|
|
3261
3283
|
}
|
|
3262
3284
|
async close(e) {
|
|
3263
3285
|
const n = e ? this.getOrThrow(e) : void 0;
|
|
3264
|
-
return n ?
|
|
3286
|
+
return n ? zt(n) : qt(this);
|
|
3265
3287
|
}
|
|
3266
3288
|
async afterMount() {
|
|
3267
3289
|
document.addEventListener("keydown", this.#t, false);
|
|
@@ -3273,9 +3295,9 @@
|
|
|
3273
3295
|
document.removeEventListener("keydown", this.#t, false);
|
|
3274
3296
|
}
|
|
3275
3297
|
}
|
|
3276
|
-
exports2.Drawer =
|
|
3277
|
-
exports2.Modal =
|
|
3278
|
-
exports2.Popover =
|
|
3298
|
+
exports2.Drawer = q$1;
|
|
3299
|
+
exports2.Modal = P$1;
|
|
3300
|
+
exports2.Popover = cn;
|
|
3279
3301
|
exports2.core = index;
|
|
3280
3302
|
Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
|
|
3281
3303
|
}));
|