vrembem 4.0.0-next.26 → 4.0.0-next.28
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/dev/index.js +648 -757
- package/dev/index.js.map +1 -1
- package/dev/index.umd.cjs +648 -757
- package/dev/index.umd.cjs.map +1 -1
- package/dist/index.js +1251 -1300
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +3 -3
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +22 -22
package/dist/index.js
CHANGED
|
@@ -1,117 +1,201 @@
|
|
|
1
|
-
var
|
|
1
|
+
var te = (t) => {
|
|
2
2
|
throw TypeError(t);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
var ee = (t, e, i) => e.has(t) || te("Cannot " + i);
|
|
5
|
+
var w = (t, e, i) => (ee(t, e, "read from private field"), i ? i.call(t) : e.get(t)), k = (t, e, i) => e.has(t) ? te("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), E = (t, e, i, s) => (ee(t, e, "write to private field"), s ? s.call(t, i) : e.set(t, i), i);
|
|
6
|
+
function le(t) {
|
|
7
|
+
return t.split("-").map((e, i) => i === 0 ? e : e.charAt(0).toUpperCase() + e.slice(1)).join("");
|
|
8
|
+
}
|
|
9
|
+
function Ut(t) {
|
|
10
|
+
return t.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
11
|
+
}
|
|
12
|
+
function ae(t) {
|
|
13
|
+
if (typeof t == "number")
|
|
14
|
+
return t;
|
|
15
|
+
const e = parseFloat(t);
|
|
16
|
+
if (!Number.isNaN(e)) {
|
|
17
|
+
const i = t.includes("ms");
|
|
18
|
+
return e * (i ? 1 : 1e3);
|
|
19
|
+
}
|
|
20
|
+
throw new Error(`Could not convert value to milliseconds: ${t}`);
|
|
21
|
+
}
|
|
22
|
+
function Rt() {
|
|
23
|
+
return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
|
|
24
|
+
}
|
|
25
|
+
function ce(t, e) {
|
|
26
|
+
const i = {
|
|
27
|
+
fallback: null,
|
|
28
|
+
element: document.body,
|
|
29
|
+
...e
|
|
30
|
+
};
|
|
31
|
+
if (t.slice(0, 2) !== "--") {
|
|
32
|
+
const n = Rt();
|
|
33
|
+
n && (t = `${n}${t}`), t = `--${t}`;
|
|
34
|
+
}
|
|
35
|
+
const s = getComputedStyle(i.element).getPropertyValue(t).trim();
|
|
36
|
+
if (s)
|
|
37
|
+
return s;
|
|
38
|
+
if (i.fallback)
|
|
39
|
+
return i.fallback;
|
|
40
|
+
throw new Error(`CSS variable "${t}" was not found!`);
|
|
41
|
+
}
|
|
42
|
+
function fe(t, e = "config") {
|
|
43
|
+
const s = (t.getAttribute(`data-${e}`) || "").replace(/'/g, '"');
|
|
44
|
+
return s ? JSON.parse(s) : {};
|
|
45
|
+
}
|
|
46
|
+
function ue(t) {
|
|
47
|
+
const e = getComputedStyle(t.el), i = {}, s = Object.keys(t.context.settings);
|
|
48
|
+
for (let n = 0; n < s.length; n++) {
|
|
49
|
+
const o = Rt(), r = t.context.module.toLowerCase(), l = Ut(s[n]), a = e.getPropertyValue(`--${o}${r}-${l}`).trim();
|
|
50
|
+
a && (i[l] = a);
|
|
51
|
+
}
|
|
52
|
+
return i;
|
|
53
|
+
}
|
|
54
|
+
function de(t) {
|
|
55
|
+
return typeof t == "string" ? document.getElementById(t) : t instanceof HTMLElement ? t : null;
|
|
56
|
+
}
|
|
57
|
+
async function C(t, ...e) {
|
|
58
|
+
t in this && typeof this[t] == "function" && await this[t](...e);
|
|
59
|
+
}
|
|
60
|
+
function St(t, e, i, s, n = 0) {
|
|
61
|
+
return new Promise((o) => {
|
|
62
|
+
t.classList.remove(e), t.classList.add(i), setTimeout(() => {
|
|
63
|
+
t.classList.add(s), t.classList.remove(i), o(t);
|
|
64
|
+
}, ae(n));
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function De(t, e) {
|
|
68
|
+
e && document.querySelectorAll(e).forEach((s) => {
|
|
69
|
+
t ? s.style.overflow = "hidden" : s.style.removeProperty("overflow");
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function Me(t, e) {
|
|
73
|
+
e && document.querySelectorAll(e).forEach((s) => {
|
|
74
|
+
t ? (s.inert = !0, s.setAttribute("aria-hidden", !0)) : (s.inert = null, s.removeAttribute("aria-hidden"));
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function Et(t, e, i) {
|
|
78
|
+
Me(!!t, e), De(!!t, i);
|
|
79
|
+
}
|
|
80
|
+
var R;
|
|
81
|
+
class he {
|
|
82
|
+
constructor(e, i) {
|
|
83
|
+
k(this, R);
|
|
84
|
+
this.value = e, E(this, R, i), this.mql = null;
|
|
11
85
|
}
|
|
12
86
|
get handler() {
|
|
13
|
-
return
|
|
87
|
+
return w(this, R);
|
|
14
88
|
}
|
|
15
89
|
// Unmount existing handler before setting a new one.
|
|
16
|
-
set handler(
|
|
17
|
-
this.mql && this.mql.removeEventListener("change",
|
|
90
|
+
set handler(e) {
|
|
91
|
+
this.mql && this.mql.removeEventListener("change", w(this, R)), E(this, R, e);
|
|
18
92
|
}
|
|
19
|
-
mount(
|
|
20
|
-
return
|
|
93
|
+
mount(e, i) {
|
|
94
|
+
return e && (this.value = e), i && E(this, R, i), this.value ? (this.mql = window.matchMedia(`(min-width: ${this.value})`), this.mql.addEventListener("change", w(this, R)), w(this, R).call(this, this.mql), this) : this;
|
|
21
95
|
}
|
|
22
96
|
unmount() {
|
|
23
|
-
return this.mql ? (this.mql.removeEventListener("change",
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
},
|
|
57
|
-
teleportReturn() {
|
|
58
|
-
return this.returnRef ? (this.returnRef = Mt(this.el, this.returnRef), this.el) : (console.error("No return reference found:", this.el), !1);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
createEntry(s, e = {}) {
|
|
63
|
-
const i = de(s), n = Object.create(y(this, pt));
|
|
64
|
-
return Object.assign(n, {
|
|
65
|
-
id: i == null ? void 0 : i.id,
|
|
66
|
-
el: i,
|
|
67
|
-
settings: {},
|
|
68
|
-
dataConfig: {},
|
|
69
|
-
customProps: {},
|
|
70
|
-
customPropKeys: [],
|
|
71
|
-
returnRef: null
|
|
72
|
-
}, e), n;
|
|
73
|
-
}
|
|
74
|
-
async register(s) {
|
|
75
|
-
return await this.deregister(s), this.collection.push(s), this.collection;
|
|
76
|
-
}
|
|
77
|
-
async deregister(s) {
|
|
78
|
-
const e = this.collection.findIndex((i) => i === s);
|
|
79
|
-
if (e >= 0) {
|
|
80
|
-
const i = this.collection[e];
|
|
81
|
-
Object.getOwnPropertyNames(i).forEach((n) => {
|
|
82
|
-
delete i[n];
|
|
83
|
-
}), this.collection.splice(e, 1);
|
|
97
|
+
return this.mql ? (this.mql.removeEventListener("change", w(this, R)), this.value = null, E(this, R, null), this.mql = null, this) : this;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
R = new WeakMap();
|
|
101
|
+
class Pt {
|
|
102
|
+
constructor(e = {}) {
|
|
103
|
+
this.module = this.constructor.name, this.collection = [], this.settings = Object.assign({
|
|
104
|
+
dataConfig: "config",
|
|
105
|
+
teleport: null,
|
|
106
|
+
teleportMethod: "append"
|
|
107
|
+
}, e);
|
|
108
|
+
}
|
|
109
|
+
get(e, i = "id") {
|
|
110
|
+
return this.collection.find((s) => s[i] === e);
|
|
111
|
+
}
|
|
112
|
+
applySettings(e) {
|
|
113
|
+
return Object.assign(this.settings, e);
|
|
114
|
+
}
|
|
115
|
+
async createEntry(e, i) {
|
|
116
|
+
return new Ct(this, e, i);
|
|
117
|
+
}
|
|
118
|
+
async register(e, i = {}) {
|
|
119
|
+
await this.deregister((e == null ? void 0 : e.id) || e, !0);
|
|
120
|
+
const s = await this.createEntry(e, i);
|
|
121
|
+
return await s.mount(), await C.call(this, "beforeRegister", s), await C.call(s, "beforeRegister"), this.collection.push(s), await C.call(s, "afterRegister"), await C.call(this, "afterRegister", s), s;
|
|
122
|
+
}
|
|
123
|
+
async deregister(e, i = !1) {
|
|
124
|
+
const s = this.collection.findIndex((n) => n.id === e);
|
|
125
|
+
if (~s) {
|
|
126
|
+
const n = this.collection[s];
|
|
127
|
+
await n.unmount(i), await C.call(this, "beforeDeregister", n), await C.call(n, "beforeDeregister", i), Object.getOwnPropertyNames(n).forEach((o) => {
|
|
128
|
+
o != "beforeDeregister" && o != "afterDeregister" && delete n[o];
|
|
129
|
+
}), this.collection.splice(s, 1), await C.call(n, "afterDeregister", i), await C.call(this, "afterDeregister", n);
|
|
84
130
|
}
|
|
85
131
|
return this.collection;
|
|
86
132
|
}
|
|
87
|
-
async
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
133
|
+
async mount(e = {}) {
|
|
134
|
+
this.applySettings(e), await C.call(this, "beforeMount");
|
|
135
|
+
const i = document.querySelectorAll(this.settings.selector);
|
|
136
|
+
for (const s of i)
|
|
137
|
+
await this.register(s);
|
|
138
|
+
return await C.call(this, "afterMount"), this;
|
|
91
139
|
}
|
|
92
|
-
async
|
|
93
|
-
for (; this.collection.length > 0; )
|
|
94
|
-
await this.deregister(this.collection[0]);
|
|
95
|
-
return this
|
|
140
|
+
async unmount() {
|
|
141
|
+
for (await C.call(this, "beforeUnmount"); this.collection.length > 0; )
|
|
142
|
+
await this.deregister(this.collection[0].id);
|
|
143
|
+
return await C.call(this, "afterUnmount"), this;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
class Ct {
|
|
147
|
+
constructor(e, i, s = {}) {
|
|
148
|
+
this.context = e, this.id = (i == null ? void 0 : i.id) || i, this.el = de(i), this.settings = Object.assign({}, s), this.dataConfig = {}, this.customProps = {}, this.returnRef = null;
|
|
149
|
+
}
|
|
150
|
+
applySettings(e) {
|
|
151
|
+
return Object.assign(this.settings, e);
|
|
152
|
+
}
|
|
153
|
+
getDataConfig() {
|
|
154
|
+
return Object.assign(this.dataConfig, fe(this.el, this.getSetting("dataConfig")));
|
|
155
|
+
}
|
|
156
|
+
getCustomProps() {
|
|
157
|
+
return Object.assign(this.customProps, ue(this));
|
|
158
|
+
}
|
|
159
|
+
getSetting(e) {
|
|
160
|
+
const i = le(e), s = Ut(e);
|
|
161
|
+
if ("dataConfig" in this && i in this.dataConfig)
|
|
162
|
+
return this.dataConfig[i];
|
|
163
|
+
if ("customProps" in this && s in this.customProps)
|
|
164
|
+
return this.customProps[s];
|
|
165
|
+
if ("settings" in this && i in this.settings)
|
|
166
|
+
return this.settings[i];
|
|
167
|
+
if ("settings" in this.context && i in this.context.settings)
|
|
168
|
+
return this.context.settings[i];
|
|
169
|
+
throw new Error(`${this.context.module} setting does not exist: ${e}`);
|
|
96
170
|
}
|
|
97
|
-
|
|
98
|
-
|
|
171
|
+
async mount(e = {}) {
|
|
172
|
+
if (this.el === null)
|
|
173
|
+
throw new Error(`${this.context.module} element was not found with ID: "${this.id}"`);
|
|
174
|
+
this.applySettings(e), this.getDataConfig(), this.getCustomProps(), await C.call(this, "beforeMount"), this.getSetting("teleport") && this.teleport(), await C.call(this, "afterMount");
|
|
175
|
+
}
|
|
176
|
+
async unmount(e = !1) {
|
|
177
|
+
await C.call(this, "beforeUnmount", e), this.getSetting("teleport") && this.teleportReturn(), await C.call(this, "afterUnmount", e);
|
|
178
|
+
}
|
|
179
|
+
teleport(e = this.getSetting("teleport"), i = this.getSetting("teleportMethod")) {
|
|
180
|
+
return this.returnRef ? (console.error("Element has already been teleported:", this.el), !1) : (this.returnRef = Vt(this.el, e, i), this.el);
|
|
181
|
+
}
|
|
182
|
+
teleportReturn() {
|
|
183
|
+
return this.returnRef ? (this.returnRef = Vt(this.el, this.returnRef), this.el) : (console.error("No return reference found:", this.el), !1);
|
|
99
184
|
}
|
|
100
185
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
this.el = s, this.selectorFocus = e, C(this, X, Fe.bind(this)), C(this, Y, Ne.bind(this));
|
|
186
|
+
var nt, G, J;
|
|
187
|
+
class Kt {
|
|
188
|
+
constructor(e = null, i = "[data-focus]") {
|
|
189
|
+
k(this, nt);
|
|
190
|
+
k(this, G);
|
|
191
|
+
k(this, J);
|
|
192
|
+
this.el = e, this.selectorFocus = i, E(this, G, Ie.bind(this)), E(this, J, Ne.bind(this));
|
|
109
193
|
}
|
|
110
194
|
get focusable() {
|
|
111
|
-
return
|
|
195
|
+
return w(this, nt);
|
|
112
196
|
}
|
|
113
|
-
set focusable(
|
|
114
|
-
|
|
197
|
+
set focusable(e) {
|
|
198
|
+
E(this, nt, e), w(this, nt).length ? (document.removeEventListener("keydown", w(this, J)), document.addEventListener("keydown", w(this, G))) : (document.removeEventListener("keydown", w(this, G)), document.addEventListener("keydown", w(this, J)));
|
|
115
199
|
}
|
|
116
200
|
get focusableFirst() {
|
|
117
201
|
return this.focusable[0];
|
|
@@ -119,205 +203,140 @@ class zt {
|
|
|
119
203
|
get focusableLast() {
|
|
120
204
|
return this.focusable[this.focusable.length - 1];
|
|
121
205
|
}
|
|
122
|
-
mount(
|
|
123
|
-
|
|
206
|
+
mount(e, i) {
|
|
207
|
+
e && (this.el = e), i && (this.selectorFocus = i), this.focusable = this.getFocusable(), this.focus();
|
|
124
208
|
}
|
|
125
209
|
unmount() {
|
|
126
|
-
this.el = null, this.focusable = [], document.removeEventListener("keydown",
|
|
127
|
-
}
|
|
128
|
-
focus(
|
|
129
|
-
(
|
|
130
|
-
}
|
|
131
|
-
getFocusable(
|
|
132
|
-
const
|
|
133
|
-
return
|
|
134
|
-
l.focus(), document.activeElement === l &&
|
|
135
|
-
}),
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
const
|
|
140
|
-
`a[href]${
|
|
141
|
-
`area[href]${
|
|
142
|
-
`input:not([type="hidden"]):not([type="radio"])${
|
|
143
|
-
`input[type="radio"]${
|
|
144
|
-
`select${
|
|
145
|
-
`textarea${
|
|
146
|
-
`button${
|
|
147
|
-
`details${
|
|
148
|
-
`iframe${
|
|
149
|
-
`audio[controls]${
|
|
150
|
-
`video[controls]${
|
|
151
|
-
`[contenteditable]${
|
|
152
|
-
`[tabindex]${
|
|
210
|
+
this.el = null, this.focusable = [], document.removeEventListener("keydown", w(this, G)), document.removeEventListener("keydown", w(this, J));
|
|
211
|
+
}
|
|
212
|
+
focus(e = this.el, i = this.selectorFocus) {
|
|
213
|
+
(e.querySelector(i) || e).focus();
|
|
214
|
+
}
|
|
215
|
+
getFocusable(e = this.el) {
|
|
216
|
+
const i = [], s = document.activeElement, n = e.scrollTop, o = Fe.join(",");
|
|
217
|
+
return e.querySelectorAll(o).forEach((l) => {
|
|
218
|
+
l.focus(), document.activeElement === l && i.push(l);
|
|
219
|
+
}), e.scrollTop = n, s.focus(), i;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
nt = new WeakMap(), G = new WeakMap(), J = new WeakMap();
|
|
223
|
+
const L = ":not([inert])", O = ':not([tabindex^="-"])', yt = ":not(:disabled)", Fe = [
|
|
224
|
+
`a[href]${L}${O}`,
|
|
225
|
+
`area[href]${L}${O}`,
|
|
226
|
+
`input:not([type="hidden"]):not([type="radio"])${L}${O}${yt}`,
|
|
227
|
+
`input[type="radio"]${L}${O}${yt}`,
|
|
228
|
+
`select${L}${O}${yt}`,
|
|
229
|
+
`textarea${L}${O}${yt}`,
|
|
230
|
+
`button${L}${O}${yt}`,
|
|
231
|
+
`details${L} > summary:first-of-type${O}`,
|
|
232
|
+
`iframe${L}${O}`,
|
|
233
|
+
`audio[controls]${L}${O}`,
|
|
234
|
+
`video[controls]${L}${O}`,
|
|
235
|
+
`[contenteditable]${L}${O}`,
|
|
236
|
+
`[tabindex]${L}${O}`
|
|
153
237
|
];
|
|
154
|
-
function
|
|
238
|
+
function Ie(t) {
|
|
155
239
|
(t.key === "Tab" || t.keyCode === 9) && (t.shiftKey ? (document.activeElement === this.focusableFirst || document.activeElement === this.el) && (t.preventDefault(), this.focusableLast.focus()) : (document.activeElement === this.focusableLast || document.activeElement === this.el) && (t.preventDefault(), this.focusableFirst.focus()));
|
|
156
240
|
}
|
|
157
241
|
function Ne(t) {
|
|
158
242
|
(t.key === "Tab" || t.keyCode === 9) && t.preventDefault();
|
|
159
243
|
}
|
|
160
|
-
function
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
function Wt(t, s) {
|
|
164
|
-
const e = {
|
|
165
|
-
fallback: null,
|
|
166
|
-
element: document.body,
|
|
167
|
-
...s
|
|
168
|
-
};
|
|
169
|
-
if (t.slice(0, 2) !== "--") {
|
|
170
|
-
const n = At();
|
|
171
|
-
n && (t = `${n}${t}`), t = `--${t}`;
|
|
172
|
-
}
|
|
173
|
-
const i = getComputedStyle(e.element).getPropertyValue(t).trim();
|
|
174
|
-
if (i)
|
|
175
|
-
return i;
|
|
176
|
-
if (e.fallback)
|
|
177
|
-
return e.fallback;
|
|
178
|
-
throw new Error(`CSS variable "${t}" was not found!`);
|
|
179
|
-
}
|
|
180
|
-
function fe(t, s = "config") {
|
|
181
|
-
const i = (t.getAttribute(`data-${s}`) || "").replace(/'/g, '"');
|
|
182
|
-
return i ? JSON.parse(i) : {};
|
|
183
|
-
}
|
|
184
|
-
function ue(t, s, e) {
|
|
185
|
-
const i = getComputedStyle(t), n = {};
|
|
186
|
-
for (let o = 0; o < e.length; o++) {
|
|
187
|
-
const r = At(), l = i.getPropertyValue(`--${r}${s.toLowerCase()}-${e[o]}`).trim();
|
|
188
|
-
l && (n[e[o]] = l);
|
|
189
|
-
}
|
|
190
|
-
return n;
|
|
191
|
-
}
|
|
192
|
-
function de(t) {
|
|
193
|
-
if (typeof t == "string")
|
|
194
|
-
return document.getElementById(t);
|
|
195
|
-
if (t instanceof HTMLElement)
|
|
196
|
-
return t;
|
|
197
|
-
}
|
|
198
|
-
function Kt(t, s = !0) {
|
|
199
|
-
const e = localStorage.getItem(t), i = e ? JSON.parse(e) : {};
|
|
244
|
+
function Xt(t, e = !0) {
|
|
245
|
+
const i = localStorage.getItem(t), s = i ? JSON.parse(i) : {};
|
|
200
246
|
return {
|
|
201
247
|
get(n) {
|
|
202
|
-
return n ?
|
|
248
|
+
return n ? s[n] : s;
|
|
203
249
|
},
|
|
204
250
|
set(n, o) {
|
|
205
|
-
return o ?
|
|
251
|
+
return o ? s[n] = o : delete s[n], e && localStorage.setItem(t, JSON.stringify(s)), s;
|
|
206
252
|
}
|
|
207
253
|
};
|
|
208
254
|
}
|
|
209
|
-
function
|
|
210
|
-
const
|
|
211
|
-
if (
|
|
212
|
-
if (typeof
|
|
255
|
+
function Vt(t, e, i) {
|
|
256
|
+
const s = e.nodeType === Node.COMMENT_NODE, n = e.nodeType === Node.ELEMENT_NODE;
|
|
257
|
+
if (e = s || n ? e : document.querySelector(e), s && (i = "after"), !e) throw new Error(`Not a valid teleport reference: '${e}'`);
|
|
258
|
+
if (typeof e[i] != "function") throw new Error(`Not a valid teleport method: '${i}'`);
|
|
213
259
|
let o = null;
|
|
214
|
-
return
|
|
260
|
+
return s || (o = document.createComment("teleported #" + t.id), t.before(o)), e[i](t), s && e.remove(), o;
|
|
215
261
|
}
|
|
216
|
-
function
|
|
217
|
-
const
|
|
218
|
-
prefix:
|
|
262
|
+
function Be(t) {
|
|
263
|
+
const e = {
|
|
264
|
+
prefix: ce("prefix-themes", { fallback: "vb-theme-" }),
|
|
219
265
|
themes: ["root", "light", "dark"],
|
|
220
266
|
storeKey: "VB:Profile"
|
|
221
267
|
};
|
|
222
|
-
for (const [o] of Object.entries(
|
|
223
|
-
t && t[o] && (
|
|
224
|
-
const
|
|
268
|
+
for (const [o] of Object.entries(e))
|
|
269
|
+
t && t[o] && (e[o] = t[o]);
|
|
270
|
+
const i = {
|
|
225
271
|
onInit() {
|
|
226
272
|
},
|
|
227
273
|
onChange() {
|
|
228
274
|
}
|
|
229
275
|
};
|
|
230
|
-
for (const [o] of Object.entries(
|
|
231
|
-
t && t[o] && (
|
|
232
|
-
const
|
|
276
|
+
for (const [o] of Object.entries(i))
|
|
277
|
+
t && t[o] && (i[o] = t[o]);
|
|
278
|
+
const s = Xt(e.storeKey), n = {
|
|
233
279
|
// Store our settings in the API.
|
|
234
|
-
settings:
|
|
280
|
+
settings: e,
|
|
235
281
|
// Actions.
|
|
236
282
|
add(o) {
|
|
237
|
-
|
|
283
|
+
e.themes.push(o);
|
|
238
284
|
},
|
|
239
285
|
remove(o) {
|
|
240
|
-
const r =
|
|
241
|
-
~r &&
|
|
286
|
+
const r = e.themes.indexOf(o);
|
|
287
|
+
~r && e.themes.splice(r, 1);
|
|
242
288
|
},
|
|
243
289
|
callback(o) {
|
|
244
|
-
|
|
290
|
+
i[o].call(this);
|
|
245
291
|
},
|
|
246
292
|
// Getters.
|
|
247
293
|
get class() {
|
|
248
|
-
return `${
|
|
294
|
+
return `${e.prefix}${this.theme}`;
|
|
249
295
|
},
|
|
250
296
|
get classes() {
|
|
251
|
-
return
|
|
297
|
+
return e.themes.map((o) => `${e.prefix}${o}`);
|
|
252
298
|
},
|
|
253
299
|
get themes() {
|
|
254
|
-
return
|
|
300
|
+
return e.themes;
|
|
255
301
|
},
|
|
256
302
|
// Setup the theme get and set methods.
|
|
257
303
|
get theme() {
|
|
258
|
-
return
|
|
304
|
+
return s.get("theme") || "root";
|
|
259
305
|
},
|
|
260
306
|
set theme(o) {
|
|
261
|
-
|
|
307
|
+
e.themes.includes(o) ? this.theme != o && (s.set("theme", o), document.documentElement.classList.remove(...this.classes), document.documentElement.classList.add(`${e.prefix}${o}`), this.callback("onChange")) : console.error(`Not a valid theme value: "${o}"`);
|
|
262
308
|
}
|
|
263
309
|
};
|
|
264
310
|
return n.callback("onInit"), n;
|
|
265
311
|
}
|
|
266
|
-
function ge(t) {
|
|
267
|
-
return t.split("-").map((s, e) => e === 0 ? s : s.charAt(0).toUpperCase() + s.slice(1)).join("");
|
|
268
|
-
}
|
|
269
|
-
function he(t) {
|
|
270
|
-
return t.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
271
|
-
}
|
|
272
|
-
function wt(t, s, e, i = "transition-duration") {
|
|
273
|
-
return new Promise((n) => {
|
|
274
|
-
if (typeof i == "string") {
|
|
275
|
-
const o = Wt(i, { element: t }), r = !!o.includes("ms");
|
|
276
|
-
i = parseFloat(o) * (r ? 1 : 1e3);
|
|
277
|
-
}
|
|
278
|
-
t.classList.remove(s.finish), t.classList.add(e.start), setTimeout(() => {
|
|
279
|
-
t.classList.add(e.finish), t.classList.remove(e.start), n(t);
|
|
280
|
-
}, i);
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
function Be(t, s) {
|
|
284
|
-
s && document.querySelectorAll(s).forEach((i) => {
|
|
285
|
-
t ? i.style.overflow = "hidden" : i.style.removeProperty("overflow");
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
function Ve(t, s) {
|
|
289
|
-
s && document.querySelectorAll(s).forEach((i) => {
|
|
290
|
-
t ? (i.inert = !0, i.setAttribute("aria-hidden", !0)) : (i.inert = null, i.removeAttribute("aria-hidden"));
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
function bt(t, s, e) {
|
|
294
|
-
Ve(!!t, s), Be(!!t, e);
|
|
295
|
-
}
|
|
296
312
|
const Zi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
297
313
|
__proto__: null,
|
|
298
|
-
Breakpoint:
|
|
299
|
-
Collection:
|
|
300
|
-
|
|
301
|
-
|
|
314
|
+
Breakpoint: he,
|
|
315
|
+
Collection: Pt,
|
|
316
|
+
CollectionEntry: Ct,
|
|
317
|
+
FocusTrap: Kt,
|
|
318
|
+
cssVar: ce,
|
|
302
319
|
getConfig: fe,
|
|
303
320
|
getCustomProps: ue,
|
|
304
321
|
getElement: de,
|
|
305
|
-
getPrefix:
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
322
|
+
getPrefix: Rt,
|
|
323
|
+
lifecycleHook: C,
|
|
324
|
+
localStore: Xt,
|
|
325
|
+
setGlobalState: Et,
|
|
326
|
+
teleport: Vt,
|
|
327
|
+
themeStore: Be,
|
|
328
|
+
toCamel: le,
|
|
329
|
+
toKebab: Ut,
|
|
330
|
+
toMilliseconds: ae,
|
|
331
|
+
transition: St
|
|
332
|
+
}, Symbol.toStringTag, { value: "Module" })), Ve = {
|
|
314
333
|
// Data attributes
|
|
315
334
|
dataOpen: "drawer-open",
|
|
316
335
|
dataClose: "drawer-close",
|
|
317
336
|
dataToggle: "drawer-toggle",
|
|
318
337
|
dataBreakpoint: "drawer-breakpoint",
|
|
319
338
|
// Selectors
|
|
320
|
-
|
|
339
|
+
selector: ".drawer",
|
|
321
340
|
selectorDialog: ".drawer__dialog",
|
|
322
341
|
selectorScreen: ".drawer",
|
|
323
342
|
selectorFocus: "[data-focus]",
|
|
@@ -333,7 +352,6 @@ const Zi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
333
352
|
// Feature toggles
|
|
334
353
|
breakpoints: null,
|
|
335
354
|
customEventPrefix: "drawer:",
|
|
336
|
-
eventListeners: !0,
|
|
337
355
|
store: !0,
|
|
338
356
|
storeKey: "VB:DrawerState",
|
|
339
357
|
setTabindex: !0,
|
|
@@ -345,42 +363,123 @@ const Zi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
345
363
|
function He(t) {
|
|
346
364
|
t.store === "opened" ? t.open(!1, !1) : t.store === "closed" ? t.close(!1, !1) : t.store === "indeterminate" ? t.state = "indeterminate" : t.el.classList.contains(t.getSetting("stateOpened")) ? t.open(!1, !1) : t.el.classList.contains(t.getSetting("stateClosed")) ? t.close(!1, !1) : t.state = "indeterminate";
|
|
347
365
|
}
|
|
348
|
-
async function
|
|
366
|
+
async function _e(t) {
|
|
349
367
|
t.store === "opened" ? await t.open(!1, !1) : t.store === "closed" ? await t.close(!1, !1) : t.store === "indeterminate" ? t.state != "indeterminate" && (t.state = "indeterminate") : (t.state != t.inlineState && (t.state = t.inlineState), t.inlineState === "opened" ? await t.open(!1, !1) : t.inlineState === "closed" && await t.close(!1, !1));
|
|
350
368
|
}
|
|
351
|
-
function
|
|
352
|
-
const
|
|
353
|
-
return this.settings.breakpoints && this.settings.breakpoints[
|
|
369
|
+
function ze(t) {
|
|
370
|
+
const e = Rt(), i = t.getAttribute(`data-${this.settings.dataBreakpoint}`);
|
|
371
|
+
return this.settings.breakpoints && this.settings.breakpoints[i] ? this.settings.breakpoints[i] : getComputedStyle(document.body).getPropertyValue(`--${e}breakpoint-${i}`).trim() ? getComputedStyle(document.body).getPropertyValue(`--${e}breakpoint-${i}`).trim() : i;
|
|
354
372
|
}
|
|
355
|
-
function
|
|
356
|
-
const
|
|
357
|
-
if (
|
|
358
|
-
return
|
|
373
|
+
function it(t) {
|
|
374
|
+
const e = typeof t == "string" ? this.get(t) : t;
|
|
375
|
+
if (e)
|
|
376
|
+
return e;
|
|
359
377
|
throw new Error(`Drawer not found in collection with id of "${t.id || t}".`);
|
|
360
378
|
}
|
|
361
|
-
function
|
|
379
|
+
function ge(t) {
|
|
362
380
|
t.state === "opened" ? t.mode === "modal" ? this.focusTrap.mount(t.dialog, this.settings.selectorFocus) : this.focusTrap.focus(t.dialog, this.settings.selectorFocus) : (t.trigger && (t.trigger.focus(), t.trigger = null), this.focusTrap.unmount());
|
|
363
381
|
}
|
|
364
|
-
|
|
365
|
-
|
|
382
|
+
function We(t) {
|
|
383
|
+
switch (t.mode) {
|
|
384
|
+
case "inline":
|
|
385
|
+
return je.call(this, t);
|
|
386
|
+
case "modal":
|
|
387
|
+
return Ue.call(this, t);
|
|
388
|
+
default:
|
|
389
|
+
throw new Error(`"${t.mode}" is not a valid drawer mode.`);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
async function je(t) {
|
|
393
|
+
return t.el.classList.remove(t.getSetting("classModal")), t.dialog.removeAttribute("aria-modal"), Et(!1, t.getSetting("selectorInert"), t.getSetting("selectorOverflow")), this.focusTrap.unmount(), await _e(t), t.el.dispatchEvent(new CustomEvent(t.getSetting("customEventPrefix") + "switchMode", {
|
|
394
|
+
detail: this,
|
|
395
|
+
bubbles: !0
|
|
396
|
+
})), t;
|
|
397
|
+
}
|
|
398
|
+
async function Ue(t) {
|
|
399
|
+
return t.el.classList.add(t.getSetting("classModal")), t.dialog.setAttribute("aria-modal", "true"), await t.close(!1, !1), t.el.dispatchEvent(new CustomEvent(t.getSetting("customEventPrefix") + "switchMode", {
|
|
400
|
+
detail: this,
|
|
401
|
+
bubbles: !0
|
|
402
|
+
})), t;
|
|
403
|
+
}
|
|
404
|
+
var ot, rt, lt;
|
|
405
|
+
class Ke extends Ct {
|
|
406
|
+
constructor(i, s, n = {}) {
|
|
407
|
+
super(i, s, n);
|
|
408
|
+
k(this, ot);
|
|
409
|
+
k(this, rt);
|
|
410
|
+
k(this, lt);
|
|
411
|
+
this.dialog = null, this.trigger = null, E(this, lt, new he()), E(this, ot, "indeterminate"), E(this, rt, "indeterminate"), this.inlineState = "indeterminate";
|
|
412
|
+
}
|
|
413
|
+
get breakpoint() {
|
|
414
|
+
return ze.call(this.context, this.el);
|
|
415
|
+
}
|
|
416
|
+
get store() {
|
|
417
|
+
return this.context.store.get(this.id);
|
|
418
|
+
}
|
|
419
|
+
get mode() {
|
|
420
|
+
return w(this, ot);
|
|
421
|
+
}
|
|
422
|
+
set mode(i) {
|
|
423
|
+
E(this, ot, i), We.call(this.context, this);
|
|
424
|
+
}
|
|
425
|
+
get state() {
|
|
426
|
+
return w(this, rt);
|
|
427
|
+
}
|
|
428
|
+
set state(i) {
|
|
429
|
+
E(this, rt, i), this.mode === "inline" && i != "opening" && i != "closing" && (this.inlineState = i, this.getSetting("store") && this.context.store.set(this.id, i)), i === "indeterminate" && (this.el.classList.remove(this.getSetting("stateOpened")), this.el.classList.remove(this.getSetting("stateOpening")), this.el.classList.remove(this.getSetting("stateClosed")), this.el.classList.remove(this.getSetting("stateClosing")));
|
|
430
|
+
}
|
|
431
|
+
async open(i, s) {
|
|
432
|
+
return this.context.open(this, i, s);
|
|
433
|
+
}
|
|
434
|
+
async close(i, s) {
|
|
435
|
+
return this.context.close(this, i, s);
|
|
436
|
+
}
|
|
437
|
+
async toggle(i, s) {
|
|
438
|
+
return this.context.toggle(this, i, s);
|
|
439
|
+
}
|
|
440
|
+
async deregister() {
|
|
441
|
+
return this.context.deregister(this.id);
|
|
442
|
+
}
|
|
443
|
+
mountBreakpoint() {
|
|
444
|
+
const i = this.breakpoint, s = this.handleBreakpoint.bind(this);
|
|
445
|
+
w(this, lt).mount(i, s);
|
|
446
|
+
}
|
|
447
|
+
unmountBreakpoint() {
|
|
448
|
+
w(this, lt).unmount();
|
|
449
|
+
}
|
|
450
|
+
handleBreakpoint(i) {
|
|
451
|
+
const s = i.matches ? "inline" : "modal";
|
|
452
|
+
this.mode != s && (this.mode = s);
|
|
453
|
+
}
|
|
454
|
+
async beforeMount() {
|
|
455
|
+
const i = this.el.querySelector(this.getSetting("selectorDialog"));
|
|
456
|
+
this.dialog = i || this.el, this.getSetting("setTabindex") && this.dialog.setAttribute("tabindex", "-1"), He(this), this.inlineState = this.state, this.mode = this.el.classList.contains(this.getSetting("classModal")) ? "modal" : "inline", this.breakpoint && this.mountBreakpoint();
|
|
457
|
+
}
|
|
458
|
+
async beforeUnmount(i = !0) {
|
|
459
|
+
i && this.state === "opened" && await this.close(!1), this.context.store.set(this.id), this.unmountBreakpoint();
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
ot = new WeakMap(), rt = new WeakMap(), lt = new WeakMap();
|
|
463
|
+
async function Xe(t) {
|
|
464
|
+
const e = t.target.closest(`
|
|
366
465
|
[data-${this.settings.dataOpen}],
|
|
367
466
|
[data-${this.settings.dataToggle}],
|
|
368
467
|
[data-${this.settings.dataClose}]
|
|
369
468
|
`);
|
|
370
|
-
if (
|
|
371
|
-
t.preventDefault(),
|
|
372
|
-
const n =
|
|
373
|
-
return n.trigger =
|
|
374
|
-
}),
|
|
375
|
-
const n =
|
|
376
|
-
return n.trigger =
|
|
377
|
-
}),
|
|
378
|
-
if (
|
|
379
|
-
const n =
|
|
380
|
-
return n.trigger =
|
|
469
|
+
if (e) {
|
|
470
|
+
t.preventDefault(), e.matches(`[data-${this.settings.dataToggle}]`) && e.getAttribute(`data-${this.settings.dataToggle}`).trim().split(" ").forEach((s) => {
|
|
471
|
+
const n = it.call(this, s);
|
|
472
|
+
return n.trigger = e, n.toggle();
|
|
473
|
+
}), e.matches(`[data-${this.settings.dataOpen}]`) && e.getAttribute(`data-${this.settings.dataOpen}`).trim().split(" ").forEach((s) => {
|
|
474
|
+
const n = it.call(this, s);
|
|
475
|
+
return n.trigger = e, n.open();
|
|
476
|
+
}), e.matches(`[data-${this.settings.dataClose}]`) && e.getAttribute(`data-${this.settings.dataClose}`).trim().split(" ").forEach((s) => {
|
|
477
|
+
if (s) {
|
|
478
|
+
const n = it.call(this, s);
|
|
479
|
+
return n.trigger = e, n.close();
|
|
381
480
|
} else {
|
|
382
|
-
const n = t.target.closest(this.settings.
|
|
383
|
-
if (n) return this.close(n);
|
|
481
|
+
const n = t.target.closest(this.settings.selector);
|
|
482
|
+
if (n) return this.close(n.id);
|
|
384
483
|
}
|
|
385
484
|
});
|
|
386
485
|
return;
|
|
@@ -388,178 +487,81 @@ async function Ke(t) {
|
|
|
388
487
|
if (this.activeModal && t.target.matches(this.settings.selectorScreen))
|
|
389
488
|
return this.close(this.activeModal.id);
|
|
390
489
|
}
|
|
391
|
-
function Xe(t) {
|
|
392
|
-
if (t.key === "Escape" && this.activeModal)
|
|
393
|
-
return this.close(this.activeModal);
|
|
394
|
-
}
|
|
395
|
-
async function It(t, s = !0) {
|
|
396
|
-
const e = this.collection.findIndex((i) => i.id === t.id);
|
|
397
|
-
if (e >= 0) {
|
|
398
|
-
const i = this.collection[e];
|
|
399
|
-
s && i.state === "opened" && await i.close(!1), this.store.set(i.id), i.unmountBreakpoint(), Object.getOwnPropertyNames(i).forEach((n) => {
|
|
400
|
-
delete i[n];
|
|
401
|
-
}), this.collection.splice(e, 1);
|
|
402
|
-
}
|
|
403
|
-
return this.collection;
|
|
404
|
-
}
|
|
405
|
-
async function Xt(t, s, e = !0) {
|
|
406
|
-
const i = q.call(this, t);
|
|
407
|
-
return (i.state === "closed" || i.state === "indeterminate") && (i.state = "opening", s ?? i.getSetting("transition") ? await wt(i.el, {
|
|
408
|
-
start: i.getSetting("stateClosing"),
|
|
409
|
-
finish: i.getSetting("stateClosed")
|
|
410
|
-
}, {
|
|
411
|
-
start: i.getSetting("stateOpening"),
|
|
412
|
-
finish: i.getSetting("stateOpened")
|
|
413
|
-
}, i.getSetting("transitionDuration")) : (i.el.classList.add(i.getSetting("stateOpened")), i.el.classList.remove(i.getSetting("stateClosed"))), i.state = "opened", i.mode === "modal" && bt(!0, i.getSetting("selectorInert"), i.getSetting("selectorOverflow")), e && me.call(this, i), i.el.dispatchEvent(new CustomEvent(i.getSetting("customEventPrefix") + "opened", {
|
|
414
|
-
detail: this,
|
|
415
|
-
bubbles: !0
|
|
416
|
-
}))), i;
|
|
417
|
-
}
|
|
418
|
-
async function $t(t, s, e = !0) {
|
|
419
|
-
const i = q.call(this, t);
|
|
420
|
-
return (i.state === "opened" || i.state === "indeterminate") && (i.state = "closing", document.activeElement.blur(), s ?? i.getSetting("transition") ? await wt(i.el, {
|
|
421
|
-
start: i.getSetting("stateOpening"),
|
|
422
|
-
finish: i.getSetting("stateOpened")
|
|
423
|
-
}, {
|
|
424
|
-
start: i.getSetting("stateClosing"),
|
|
425
|
-
finish: i.getSetting("stateClosed")
|
|
426
|
-
}, i.getSetting("transitionDuration")) : (i.el.classList.add(i.getSetting("stateClosed")), i.el.classList.remove(i.getSetting("stateOpened"))), i.state = "closed", i.mode === "modal" && bt(!1, i.getSetting("selectorInert"), i.getSetting("selectorOverflow")), e && me.call(this, i), i.el.dispatchEvent(new CustomEvent(i.getSetting("customEventPrefix") + "closed", {
|
|
427
|
-
detail: this,
|
|
428
|
-
bubbles: !0
|
|
429
|
-
}))), i;
|
|
430
|
-
}
|
|
431
|
-
async function pe(t, s, e) {
|
|
432
|
-
const i = q.call(this, t);
|
|
433
|
-
return i.state === "closed" ? Xt.call(this, i, s, e) : $t.call(this, i, s, e);
|
|
434
|
-
}
|
|
435
490
|
function Ye(t) {
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
return Ge.call(this, t);
|
|
439
|
-
case "modal":
|
|
440
|
-
return Je.call(this, t);
|
|
441
|
-
default:
|
|
442
|
-
throw new Error(`"${t.mode}" is not a valid drawer mode.`);
|
|
443
|
-
}
|
|
491
|
+
if (t.key === "Escape" && this.activeModal)
|
|
492
|
+
return this.close(this.activeModal.id);
|
|
444
493
|
}
|
|
445
|
-
async function
|
|
446
|
-
|
|
494
|
+
async function me(t, e, i = !0) {
|
|
495
|
+
const s = it.call(this, t);
|
|
496
|
+
return (s.state === "closed" || s.state === "indeterminate") && (s.state = "opening", e ?? s.getSetting("transition") ? await St(
|
|
497
|
+
s.el,
|
|
498
|
+
s.getSetting("stateClosed"),
|
|
499
|
+
s.getSetting("stateOpening"),
|
|
500
|
+
s.getSetting("stateOpened"),
|
|
501
|
+
s.getSetting("transitionDuration")
|
|
502
|
+
) : (s.el.classList.add(s.getSetting("stateOpened")), s.el.classList.remove(s.getSetting("stateClosed"))), s.state = "opened", s.mode === "modal" && Et(!0, s.getSetting("selectorInert"), s.getSetting("selectorOverflow")), i && ge.call(this, s), s.el.dispatchEvent(new CustomEvent(s.getSetting("customEventPrefix") + "opened", {
|
|
447
503
|
detail: this,
|
|
448
504
|
bubbles: !0
|
|
449
|
-
})),
|
|
450
|
-
}
|
|
451
|
-
async function
|
|
452
|
-
|
|
505
|
+
}))), s;
|
|
506
|
+
}
|
|
507
|
+
async function pe(t, e, i = !0) {
|
|
508
|
+
const s = it.call(this, t);
|
|
509
|
+
return (s.state === "opened" || s.state === "indeterminate") && (s.state = "closing", document.activeElement.blur(), e ?? s.getSetting("transition") ? await St(
|
|
510
|
+
s.el,
|
|
511
|
+
s.getSetting("stateOpened"),
|
|
512
|
+
s.getSetting("stateClosing"),
|
|
513
|
+
s.getSetting("stateClosed"),
|
|
514
|
+
s.getSetting("transitionDuration")
|
|
515
|
+
) : (s.el.classList.add(s.getSetting("stateClosed")), s.el.classList.remove(s.getSetting("stateOpened"))), s.state = "closed", s.mode === "modal" && Et(!1, s.getSetting("selectorInert"), s.getSetting("selectorOverflow")), i && ge.call(this, s), s.el.dispatchEvent(new CustomEvent(s.getSetting("customEventPrefix") + "closed", {
|
|
453
516
|
detail: this,
|
|
454
517
|
bubbles: !0
|
|
455
|
-
})),
|
|
518
|
+
}))), s;
|
|
456
519
|
}
|
|
457
|
-
async function
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
},
|
|
469
|
-
close(c, a) {
|
|
470
|
-
return $t.call(e, this, c, a);
|
|
471
|
-
},
|
|
472
|
-
toggle(c, a) {
|
|
473
|
-
return pe.call(e, this, c, a);
|
|
474
|
-
},
|
|
475
|
-
deregister() {
|
|
476
|
-
return It.call(e, this);
|
|
477
|
-
},
|
|
478
|
-
mountBreakpoint() {
|
|
479
|
-
const c = this.breakpoint, a = this.handleBreakpoint.bind(this);
|
|
480
|
-
return i.mount(c, a), this;
|
|
481
|
-
},
|
|
482
|
-
unmountBreakpoint() {
|
|
483
|
-
return i.unmount(), this;
|
|
484
|
-
},
|
|
485
|
-
handleBreakpoint(c) {
|
|
486
|
-
const a = c.matches ? "inline" : "modal";
|
|
487
|
-
return this.mode != a && (this.mode = a), this;
|
|
488
|
-
}
|
|
489
|
-
}), Object.defineProperties(r, Object.getOwnPropertyDescriptors({
|
|
490
|
-
get breakpoint() {
|
|
491
|
-
return We.call(e, t);
|
|
492
|
-
},
|
|
493
|
-
get store() {
|
|
494
|
-
return e.store.get(this.id);
|
|
495
|
-
},
|
|
496
|
-
get mode() {
|
|
497
|
-
return n;
|
|
498
|
-
},
|
|
499
|
-
set mode(c) {
|
|
500
|
-
n = c, Ye.call(e, this);
|
|
501
|
-
},
|
|
502
|
-
get state() {
|
|
503
|
-
return o;
|
|
504
|
-
},
|
|
505
|
-
set state(c) {
|
|
506
|
-
o = c, this.mode === "inline" && c != "opening" && c != "closing" && (this.inlineState = c, this.getSetting("store") && e.store.set(this.id, c)), c === "indeterminate" && (this.el.classList.remove(this.getSetting("stateOpened")), this.el.classList.remove(this.getSetting("stateOpening")), this.el.classList.remove(this.getSetting("stateClosed")), this.el.classList.remove(this.getSetting("stateClosing")));
|
|
507
|
-
}
|
|
508
|
-
})), r.applySettings(s), r.getDataConfig(), r.getSetting("teleport") && r.teleport(), this.collection.push(r);
|
|
509
|
-
const l = t.querySelector(r.getSetting("selectorDialog"));
|
|
510
|
-
return r.dialog = l || t, r.getSetting("setTabindex") && r.dialog.setAttribute("tabindex", "-1"), He(r), r.inlineState = r.state, r.mode = t.classList.contains(r.getSetting("classModal")) ? "modal" : "inline", r.breakpoint && r.mountBreakpoint(), r;
|
|
511
|
-
}
|
|
512
|
-
var it, st;
|
|
513
|
-
class Qi extends Lt {
|
|
514
|
-
constructor(e) {
|
|
515
|
-
super({ ...je, ...e });
|
|
516
|
-
P(this, it);
|
|
517
|
-
P(this, st);
|
|
518
|
-
this.focusTrap = new zt(), this.store = Kt(this.settings.storeKey, this.settings.store), C(this, it, Ke.bind(this)), C(this, st, Xe.bind(this));
|
|
520
|
+
async function Ge(t, e, i) {
|
|
521
|
+
const s = it.call(this, t);
|
|
522
|
+
return s.state === "closed" ? me.call(this, s, e, i) : pe.call(this, s, e, i);
|
|
523
|
+
}
|
|
524
|
+
var at, ct;
|
|
525
|
+
class Qi extends Pt {
|
|
526
|
+
constructor(i) {
|
|
527
|
+
super({ ...Ve, ...i });
|
|
528
|
+
k(this, at);
|
|
529
|
+
k(this, ct);
|
|
530
|
+
this.focusTrap = new Kt(), E(this, at, Xe.bind(this)), E(this, ct, Ye.bind(this)), this.store = Xt(this.settings.storeKey, this.settings.store);
|
|
519
531
|
}
|
|
520
532
|
get activeModal() {
|
|
521
|
-
return this.collection.find((
|
|
522
|
-
}
|
|
523
|
-
async mount(e = null) {
|
|
524
|
-
e && (this.settings = { ...this.settings, ...e });
|
|
525
|
-
const i = document.querySelectorAll(this.settings.selectorDrawer);
|
|
526
|
-
return await this.registerCollection(i), this.settings.eventListeners && this.mountEventListeners(), this;
|
|
533
|
+
return this.collection.find((i) => i.state === "opened" && i.mode === "modal");
|
|
527
534
|
}
|
|
528
|
-
async
|
|
529
|
-
return
|
|
530
|
-
}
|
|
531
|
-
mountEventListeners() {
|
|
532
|
-
document.addEventListener("click", y(this, it), !1), document.addEventListener("keydown", y(this, st), !1);
|
|
535
|
+
async createEntry(i, s) {
|
|
536
|
+
return new Ke(this, i, s);
|
|
533
537
|
}
|
|
534
|
-
|
|
535
|
-
|
|
538
|
+
async open(i, s, n) {
|
|
539
|
+
return me.call(this, i, s, n);
|
|
536
540
|
}
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
return n ? Ue.call(this, n, i) : Promise.reject(new Error(`Failed to register; drawer not found with ID of: "${e.id || e}".`));
|
|
541
|
+
async close(i, s, n) {
|
|
542
|
+
return pe.call(this, i, s, n);
|
|
540
543
|
}
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
return i ? It.call(this, i) : Promise.reject(new Error(`Failed to deregister; drawer does not exist in collection with ID of: "${e.id || e}".`));
|
|
544
|
+
async toggle(i, s, n) {
|
|
545
|
+
return Ge.call(this, i, s, n);
|
|
544
546
|
}
|
|
545
|
-
|
|
546
|
-
|
|
547
|
+
async afterMount() {
|
|
548
|
+
document.addEventListener("click", w(this, at), !1), document.addEventListener("keydown", w(this, ct), !1);
|
|
547
549
|
}
|
|
548
|
-
|
|
549
|
-
|
|
550
|
+
async beforeUnmount() {
|
|
551
|
+
this.trigger = null;
|
|
550
552
|
}
|
|
551
|
-
|
|
552
|
-
|
|
553
|
+
async afterUnmount() {
|
|
554
|
+
document.removeEventListener("click", w(this, at), !1), document.removeEventListener("keydown", w(this, ct), !1);
|
|
553
555
|
}
|
|
554
556
|
}
|
|
555
|
-
|
|
556
|
-
const
|
|
557
|
+
at = new WeakMap(), ct = new WeakMap();
|
|
558
|
+
const Je = {
|
|
557
559
|
// Data attributes
|
|
558
560
|
dataOpen: "modal-open",
|
|
559
561
|
dataClose: "modal-close",
|
|
560
562
|
dataReplace: "modal-replace",
|
|
561
563
|
// Selectors
|
|
562
|
-
|
|
564
|
+
selector: ".modal",
|
|
563
565
|
selectorDialog: ".modal__dialog",
|
|
564
566
|
selectorScreen: ".modal",
|
|
565
567
|
selectorRequired: '[role="alertdialog"]',
|
|
@@ -573,40 +575,69 @@ const Ze = {
|
|
|
573
575
|
stateClosed: "is-closed",
|
|
574
576
|
// Feature settings
|
|
575
577
|
customEventPrefix: "modal:",
|
|
576
|
-
eventListeners: !0,
|
|
577
578
|
setTabindex: !0,
|
|
578
579
|
teleport: null,
|
|
579
580
|
teleportMethod: "append",
|
|
580
581
|
transition: !0,
|
|
581
582
|
transitionDuration: "modal-transition-duration"
|
|
582
583
|
};
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
584
|
+
class Ze extends Ct {
|
|
585
|
+
constructor(e, i, s = {}) {
|
|
586
|
+
super(e, i, s), this.state = "closed", this.dialog = null;
|
|
587
|
+
}
|
|
588
|
+
get isRequired() {
|
|
589
|
+
return this.dialog.matches(this.getSetting("selectorRequired"));
|
|
590
|
+
}
|
|
591
|
+
async open(e, i) {
|
|
592
|
+
return this.context.open(this, e, i);
|
|
593
|
+
}
|
|
594
|
+
async close(e, i) {
|
|
595
|
+
return this.context.close(this, e, i);
|
|
596
|
+
}
|
|
597
|
+
async replace(e, i) {
|
|
598
|
+
return this.context.replace(this, e, i);
|
|
599
|
+
}
|
|
600
|
+
async deregister() {
|
|
601
|
+
return this.context.deregister(this.id);
|
|
602
|
+
}
|
|
603
|
+
async beforeMount() {
|
|
604
|
+
const e = this.el.querySelector(this.getSetting("selectorDialog"));
|
|
605
|
+
this.dialog = e || this.el, this.dialog.setAttribute("aria-modal", "true"), this.dialog.hasAttribute("role") || this.dialog.setAttribute("role", "dialog"), this.getSetting("setTabindex") && this.dialog.setAttribute("tabindex", "-1");
|
|
606
|
+
}
|
|
607
|
+
async afterRegister() {
|
|
608
|
+
this.el.classList.contains(this.getSetting("stateOpened")) ? await this.open(!1) : (this.el.classList.remove(this.getSetting("stateOpening")), this.el.classList.remove(this.getSetting("stateClosing")), this.el.classList.add(this.getSetting("stateClosed")));
|
|
609
|
+
}
|
|
610
|
+
async beforeUnmount(e = !1) {
|
|
611
|
+
!e && this.state === "opened" ? await this.close(!1) : this.context.stack.remove(this);
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
function xt(t) {
|
|
615
|
+
const e = typeof t == "string" ? this.get(t) : this.get(t.id);
|
|
616
|
+
if (e)
|
|
617
|
+
return e;
|
|
587
618
|
throw new Error(`Modal not found in collection with id of "${t.id || t}".`);
|
|
588
619
|
}
|
|
589
|
-
function
|
|
620
|
+
function Dt() {
|
|
590
621
|
this.active ? this.focusTrap.mount(this.active.dialog, this.settings.selectorFocus) : (this.trigger && (this.trigger.focus(), this.trigger = null), this.focusTrap.unmount());
|
|
591
622
|
}
|
|
592
623
|
async function Qe(t) {
|
|
593
|
-
const
|
|
624
|
+
const e = t.target.closest(`
|
|
594
625
|
[data-${this.settings.dataOpen}],
|
|
595
626
|
[data-${this.settings.dataReplace}],
|
|
596
627
|
[data-${this.settings.dataClose}]
|
|
597
628
|
`);
|
|
598
|
-
if (
|
|
599
|
-
if (t.preventDefault(),
|
|
600
|
-
const
|
|
601
|
-
return t.target.closest(this.settings.
|
|
629
|
+
if (e) {
|
|
630
|
+
if (t.preventDefault(), e.matches(`[data-${this.settings.dataOpen}]`)) {
|
|
631
|
+
const i = e.getAttribute(`data-${this.settings.dataOpen}`).trim(), s = xt.call(this, i);
|
|
632
|
+
return t.target.closest(this.settings.selector) || (this.trigger = e), s.open();
|
|
602
633
|
}
|
|
603
|
-
if (
|
|
604
|
-
const
|
|
605
|
-
return t.target.closest(this.settings.
|
|
634
|
+
if (e.matches(`[data-${this.settings.dataReplace}]`)) {
|
|
635
|
+
const i = e.getAttribute(`data-${this.settings.dataReplace}`).trim(), s = xt.call(this, i);
|
|
636
|
+
return t.target.closest(this.settings.selector) || (this.trigger = e), s.replace();
|
|
606
637
|
}
|
|
607
|
-
if (
|
|
608
|
-
const
|
|
609
|
-
return
|
|
638
|
+
if (e.matches(`[data-${this.settings.dataClose}]`)) {
|
|
639
|
+
const i = e.getAttribute(`data-${this.settings.dataClose}`).trim();
|
|
640
|
+
return i === "*" ? this.closeAll() : this.close(i);
|
|
610
641
|
}
|
|
611
642
|
}
|
|
612
643
|
if (this.active && t.target.matches(this.settings.selectorScreen) && !this.active.isRequired)
|
|
@@ -616,170 +647,124 @@ function qe(t) {
|
|
|
616
647
|
if (t.key === "Escape" && this.active && !this.active.dialog.matches(this.settings.selectorRequired))
|
|
617
648
|
return this.close();
|
|
618
649
|
}
|
|
619
|
-
async function
|
|
620
|
-
const
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
s
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
}
|
|
629
|
-
async function Yt(t, s = void 0, e = !0) {
|
|
630
|
-
const i = ht.call(this, t);
|
|
631
|
-
return this.stack.moveToTop(i), i.state === "closed" && (i.state = "opening", this.stack.add(i), s ?? i.getSetting("transition") ? await wt(i.el, {
|
|
632
|
-
start: i.getSetting("stateClosing"),
|
|
633
|
-
finish: i.getSetting("stateClosed")
|
|
634
|
-
}, {
|
|
635
|
-
start: i.getSetting("stateOpening"),
|
|
636
|
-
finish: i.getSetting("stateOpened")
|
|
637
|
-
}, i.getSetting("transitionDuration")) : (i.el.classList.add(i.getSetting("stateOpened")), i.el.classList.remove(i.getSetting("stateClosed"))), i.state = "opened"), e && Ot.call(this), i.el.dispatchEvent(new CustomEvent(i.getSetting("customEventPrefix") + "opened", {
|
|
650
|
+
async function we(t, e = void 0, i = !0) {
|
|
651
|
+
const s = xt.call(this, t);
|
|
652
|
+
return this.stack.moveToTop(s), s.state === "closed" && (s.state = "opening", this.stack.add(s), e ?? s.getSetting("transition") ? await St(
|
|
653
|
+
s.el,
|
|
654
|
+
s.getSetting("stateClosed"),
|
|
655
|
+
s.getSetting("stateOpening"),
|
|
656
|
+
s.getSetting("stateOpened"),
|
|
657
|
+
s.getSetting("transitionDuration")
|
|
658
|
+
) : (s.el.classList.add(s.getSetting("stateOpened")), s.el.classList.remove(s.getSetting("stateClosed"))), s.state = "opened"), i && Dt.call(this), s.el.dispatchEvent(new CustomEvent(s.getSetting("customEventPrefix") + "opened", {
|
|
638
659
|
detail: this,
|
|
639
660
|
bubbles: !0
|
|
640
|
-
})),
|
|
641
|
-
}
|
|
642
|
-
async function
|
|
643
|
-
const
|
|
644
|
-
return
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
661
|
+
})), s;
|
|
662
|
+
}
|
|
663
|
+
async function be(t, e, i = !0) {
|
|
664
|
+
const s = t ? xt.call(this, t) : this.active;
|
|
665
|
+
return s && s.state === "opened" && (s.state = "closing", document.activeElement.blur(), e ?? s.getSetting("transition") ? await St(
|
|
666
|
+
s.el,
|
|
667
|
+
s.getSetting("stateOpened"),
|
|
668
|
+
s.getSetting("stateClosing"),
|
|
669
|
+
s.getSetting("stateClosed"),
|
|
670
|
+
s.getSetting("transitionDuration")
|
|
671
|
+
) : (s.el.classList.add(s.getSetting("stateClosed")), s.el.classList.remove(s.getSetting("stateOpened"))), this.stack.remove(s), s.state = "closed", i && Dt.call(this), s.el.dispatchEvent(new CustomEvent(s.getSetting("customEventPrefix") + "closed", {
|
|
651
672
|
detail: this,
|
|
652
673
|
bubbles: !0
|
|
653
|
-
}))),
|
|
674
|
+
}))), s;
|
|
654
675
|
}
|
|
655
|
-
async function
|
|
656
|
-
const
|
|
657
|
-
return await Promise.all(this.stack.value.map(async (
|
|
658
|
-
t && t ===
|
|
659
|
-
})),
|
|
676
|
+
async function Ht(t, e) {
|
|
677
|
+
const i = [];
|
|
678
|
+
return await Promise.all(this.stack.value.map(async (s) => {
|
|
679
|
+
t && t === s.id ? Promise.resolve() : i.push(await be.call(this, s, e, !1)), s.trigger = null;
|
|
680
|
+
})), i;
|
|
660
681
|
}
|
|
661
|
-
async function
|
|
662
|
-
const
|
|
682
|
+
async function ti(t, e, i = !0) {
|
|
683
|
+
const s = xt.call(this, t);
|
|
663
684
|
let n, o;
|
|
664
|
-
return
|
|
665
|
-
}
|
|
666
|
-
async function ti(t, s = {}) {
|
|
667
|
-
await Ft.call(this, t, !1);
|
|
668
|
-
const e = this, i = this.createEntry(t);
|
|
669
|
-
Object.assign(i, {
|
|
670
|
-
state: "closed",
|
|
671
|
-
dialog: null,
|
|
672
|
-
open(o, r) {
|
|
673
|
-
return Yt.call(e, this, o, r);
|
|
674
|
-
},
|
|
675
|
-
close(o, r) {
|
|
676
|
-
return Gt.call(e, this, o, r);
|
|
677
|
-
},
|
|
678
|
-
replace(o, r) {
|
|
679
|
-
return we.call(e, this, o, r);
|
|
680
|
-
},
|
|
681
|
-
deregister() {
|
|
682
|
-
return Ft.call(e, this);
|
|
683
|
-
}
|
|
684
|
-
}), Object.defineProperties(i, Object.getOwnPropertyDescriptors({
|
|
685
|
-
get isRequired() {
|
|
686
|
-
return this.dialog.matches(this.getSetting("selectorRequired"));
|
|
687
|
-
}
|
|
688
|
-
})), i.applySettings(s), i.getDataConfig();
|
|
689
|
-
const n = t.querySelector(i.getSetting("selectorDialog"));
|
|
690
|
-
return i.dialog = n || t, i.dialog.setAttribute("aria-modal", "true"), i.dialog.hasAttribute("role") || i.dialog.setAttribute("role", "dialog"), i.getSetting("setTabindex") && i.dialog.setAttribute("tabindex", "-1"), i.getSetting("teleport") && i.teleport(), this.collection.push(i), i.el.classList.contains(i.getSetting("stateOpened")) ? await i.open(!1) : (i.el.classList.remove(i.getSetting("stateOpening")), i.el.classList.remove(i.getSetting("stateClosing")), i.el.classList.add(i.getSetting("stateClosed"))), i;
|
|
685
|
+
return s.state === "opened" ? (n = s, o = await Ht.call(this, s.id, e)) : (o = Ht.call(this, !1, e), n = we.call(this, s, e, !1), await Promise.all([n, o])), i && Dt.call(this), { opened: n, closed: o };
|
|
691
686
|
}
|
|
692
687
|
function ei(t) {
|
|
693
|
-
const
|
|
688
|
+
const e = [];
|
|
694
689
|
return {
|
|
695
690
|
get value() {
|
|
696
|
-
return [...
|
|
691
|
+
return [...e];
|
|
697
692
|
},
|
|
698
693
|
get top() {
|
|
699
|
-
const
|
|
700
|
-
return
|
|
694
|
+
const i = e[e.length - 1];
|
|
695
|
+
return i || null;
|
|
701
696
|
},
|
|
702
697
|
updateIndex() {
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
const n = getComputedStyle(
|
|
706
|
-
|
|
698
|
+
e.forEach((i, s) => {
|
|
699
|
+
i.el.style.zIndex = null;
|
|
700
|
+
const n = getComputedStyle(i.el)["z-index"];
|
|
701
|
+
i.el.style.zIndex = parseInt(n) + s + 1;
|
|
707
702
|
});
|
|
708
703
|
},
|
|
709
|
-
|
|
710
|
-
|
|
704
|
+
setGlobalState() {
|
|
705
|
+
Et(this.top, t.selectorInert, t.selectorOverflow), this.updateIndex();
|
|
711
706
|
},
|
|
712
|
-
add(
|
|
713
|
-
|
|
714
|
-
const
|
|
715
|
-
|
|
707
|
+
add(i) {
|
|
708
|
+
i.el.style.zIndex = null;
|
|
709
|
+
const s = getComputedStyle(i.el)["z-index"];
|
|
710
|
+
i.el.style.zIndex = parseInt(s) + e.length + 1, e.push(i), this.setGlobalState();
|
|
716
711
|
},
|
|
717
|
-
remove(
|
|
718
|
-
const
|
|
719
|
-
|
|
712
|
+
remove(i) {
|
|
713
|
+
const s = e.findIndex((n) => n.id === i.id);
|
|
714
|
+
s >= 0 && (i.el.style.zIndex = null, e.splice(s, 1), this.setGlobalState());
|
|
720
715
|
},
|
|
721
|
-
moveToTop(
|
|
722
|
-
const
|
|
723
|
-
|
|
716
|
+
moveToTop(i) {
|
|
717
|
+
const s = e.findIndex((n) => n.id === i.id);
|
|
718
|
+
s >= 0 && (e.splice(s, 1), this.add(i));
|
|
724
719
|
}
|
|
725
720
|
};
|
|
726
721
|
}
|
|
727
|
-
var
|
|
728
|
-
class qi extends
|
|
729
|
-
constructor(
|
|
730
|
-
super({ ...
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
this.trigger = null, this.focusTrap = new
|
|
722
|
+
var ft, ut;
|
|
723
|
+
class qi extends Pt {
|
|
724
|
+
constructor(i) {
|
|
725
|
+
super({ ...Je, ...i });
|
|
726
|
+
k(this, ft);
|
|
727
|
+
k(this, ut);
|
|
728
|
+
this.trigger = null, this.focusTrap = new Kt(), E(this, ft, Qe.bind(this)), E(this, ut, qe.bind(this)), this.stack = ei(this.settings);
|
|
734
729
|
}
|
|
735
730
|
get active() {
|
|
736
731
|
return this.stack.top;
|
|
737
732
|
}
|
|
738
|
-
async
|
|
739
|
-
|
|
740
|
-
const i = document.querySelectorAll(this.settings.selectorModal);
|
|
741
|
-
return await this.registerCollection(i), this.settings.eventListeners && this.mountEventListeners(), this;
|
|
742
|
-
}
|
|
743
|
-
async unmount() {
|
|
744
|
-
return this.trigger = null, await this.deregisterCollection(), this.settings.eventListeners && this.unmountEventListeners(), this;
|
|
745
|
-
}
|
|
746
|
-
mountEventListeners() {
|
|
747
|
-
document.addEventListener("click", y(this, nt), !1), document.addEventListener("keydown", y(this, ot), !1);
|
|
733
|
+
async createEntry(i, s) {
|
|
734
|
+
return new Ze(this, i, s);
|
|
748
735
|
}
|
|
749
|
-
|
|
750
|
-
|
|
736
|
+
async open(i, s, n) {
|
|
737
|
+
return we.call(this, i, s, n);
|
|
751
738
|
}
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
return n ? ti.call(this, n, i) : Promise.reject(new Error(`Failed to register; modal not found with ID of: "${e.id || e}".`));
|
|
739
|
+
async close(i, s, n) {
|
|
740
|
+
return be.call(this, i, s, n);
|
|
755
741
|
}
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
return i ? Ft.call(this, i) : Promise.reject(new Error(`Failed to deregister; modal does not exist in collection with ID of: "${e.id || e}".`));
|
|
742
|
+
async replace(i, s, n) {
|
|
743
|
+
return ti.call(this, i, s, n);
|
|
759
744
|
}
|
|
760
|
-
|
|
761
|
-
|
|
745
|
+
async closeAll(i = !1, s, n = !0) {
|
|
746
|
+
const o = await Ht.call(this, i, s);
|
|
747
|
+
return n && Dt.call(this), o;
|
|
762
748
|
}
|
|
763
|
-
|
|
764
|
-
|
|
749
|
+
async afterMount() {
|
|
750
|
+
document.addEventListener("click", w(this, ft), !1), document.addEventListener("keydown", w(this, ut), !1);
|
|
765
751
|
}
|
|
766
|
-
|
|
767
|
-
|
|
752
|
+
async beforeUnmount() {
|
|
753
|
+
this.trigger = null;
|
|
768
754
|
}
|
|
769
|
-
async
|
|
770
|
-
|
|
771
|
-
return n && Ot.call(this), o;
|
|
755
|
+
async afterUnmount() {
|
|
756
|
+
document.removeEventListener("click", w(this, ft), !1), document.removeEventListener("keydown", w(this, ut), !1);
|
|
772
757
|
}
|
|
773
758
|
}
|
|
774
|
-
|
|
759
|
+
ft = new WeakMap(), ut = new WeakMap();
|
|
775
760
|
const ii = {
|
|
776
761
|
// Selectors
|
|
777
|
-
|
|
762
|
+
selector: ".popover",
|
|
778
763
|
selectorTooltip: ".popover_tooltip",
|
|
779
764
|
selectorArrow: ".popover__arrow",
|
|
780
765
|
// State classes
|
|
781
766
|
stateActive: "is-active",
|
|
782
|
-
// Custom
|
|
767
|
+
// Custom properties and their defaults
|
|
783
768
|
placement: "bottom",
|
|
784
769
|
event: "click",
|
|
785
770
|
offset: 0,
|
|
@@ -788,180 +773,241 @@ const ii = {
|
|
|
788
773
|
arrowPadding: 0,
|
|
789
774
|
toggleDelay: 0,
|
|
790
775
|
// Feature settings
|
|
791
|
-
eventListeners: !0,
|
|
792
776
|
teleport: null,
|
|
793
777
|
teleportMethod: "append"
|
|
794
778
|
};
|
|
795
|
-
function
|
|
779
|
+
function ie(t, e, i) {
|
|
796
780
|
Object.assign(t.style, {
|
|
797
|
-
left:
|
|
798
|
-
top:
|
|
781
|
+
left: e != null ? `${e}px` : "",
|
|
782
|
+
top: i != null ? `${i}px` : ""
|
|
799
783
|
});
|
|
800
784
|
}
|
|
801
|
-
function
|
|
802
|
-
let
|
|
803
|
-
typeof
|
|
804
|
-
const
|
|
805
|
-
if (Number.isNaN(
|
|
806
|
-
throw new Error(`Provided delay value is not a number: "${
|
|
807
|
-
return
|
|
785
|
+
function ye(t, e) {
|
|
786
|
+
let i = t.getSetting("toggle-delay");
|
|
787
|
+
typeof i == "string" && (i.indexOf(",") > -1 && (i = i.split(",")), i.indexOf(" ") > -1 && (i = i.split(" "))), Array.isArray(i) && (i = i[e]);
|
|
788
|
+
const s = Number(i);
|
|
789
|
+
if (Number.isNaN(s))
|
|
790
|
+
throw new Error(`Provided delay value is not a number: "${i}"`);
|
|
791
|
+
return s;
|
|
808
792
|
}
|
|
809
|
-
function
|
|
810
|
-
let
|
|
811
|
-
const
|
|
812
|
-
for (let
|
|
813
|
-
|
|
814
|
-
switch (
|
|
793
|
+
function Nt(t) {
|
|
794
|
+
let e;
|
|
795
|
+
const i = typeof t == "string" ? t.trim().split(" ") : [t];
|
|
796
|
+
for (let s = 0; s < i.length; s++)
|
|
797
|
+
i[s] = Number(i[s]);
|
|
798
|
+
switch (i.length) {
|
|
815
799
|
case 1:
|
|
816
|
-
|
|
800
|
+
e = i[0];
|
|
817
801
|
break;
|
|
818
802
|
case 2:
|
|
819
|
-
|
|
820
|
-
top:
|
|
821
|
-
right:
|
|
822
|
-
bottom:
|
|
823
|
-
left:
|
|
803
|
+
e = {
|
|
804
|
+
top: i[0],
|
|
805
|
+
right: i[1],
|
|
806
|
+
bottom: i[0],
|
|
807
|
+
left: i[1]
|
|
824
808
|
};
|
|
825
809
|
break;
|
|
826
810
|
case 3:
|
|
827
|
-
|
|
828
|
-
top:
|
|
829
|
-
right:
|
|
830
|
-
bottom:
|
|
831
|
-
left:
|
|
811
|
+
e = {
|
|
812
|
+
top: i[0],
|
|
813
|
+
right: i[1],
|
|
814
|
+
bottom: i[2],
|
|
815
|
+
left: i[1]
|
|
832
816
|
};
|
|
833
817
|
break;
|
|
834
818
|
case 4:
|
|
835
|
-
|
|
836
|
-
top:
|
|
837
|
-
right:
|
|
838
|
-
bottom:
|
|
839
|
-
left:
|
|
819
|
+
e = {
|
|
820
|
+
top: i[0],
|
|
821
|
+
right: i[1],
|
|
822
|
+
bottom: i[2],
|
|
823
|
+
left: i[3]
|
|
840
824
|
};
|
|
841
825
|
break;
|
|
842
826
|
default:
|
|
843
|
-
|
|
827
|
+
e = !1;
|
|
844
828
|
break;
|
|
845
829
|
}
|
|
846
|
-
return
|
|
830
|
+
return e;
|
|
847
831
|
}
|
|
848
832
|
function si(t) {
|
|
849
833
|
return {
|
|
850
834
|
offset: Number(t.getSetting("offset")),
|
|
851
835
|
flip: {
|
|
852
|
-
padding:
|
|
836
|
+
padding: Nt(t.getSetting("flip-padding"))
|
|
853
837
|
},
|
|
854
838
|
shift: {
|
|
855
|
-
padding:
|
|
839
|
+
padding: Nt(t.getSetting("shift-padding"))
|
|
856
840
|
},
|
|
857
841
|
arrow: {
|
|
858
842
|
element: t.getSetting("selectorArrow"),
|
|
859
|
-
padding:
|
|
843
|
+
padding: Nt(t.getSetting("arrow-padding"))
|
|
860
844
|
}
|
|
861
845
|
};
|
|
862
846
|
}
|
|
863
|
-
function
|
|
864
|
-
const
|
|
865
|
-
if (
|
|
866
|
-
return
|
|
847
|
+
function xe(t) {
|
|
848
|
+
const e = typeof t == "string" ? this.get(t) : this.get(t.id);
|
|
849
|
+
if (e)
|
|
850
|
+
return e;
|
|
867
851
|
throw new Error(`Popover not found in collection with id of "${t}".`);
|
|
868
852
|
}
|
|
869
|
-
function
|
|
870
|
-
|
|
853
|
+
async function ve(t) {
|
|
854
|
+
const e = t ? xe.call(this, t) : await Se.call(this);
|
|
855
|
+
return e && e.state === "opened" && (e.el.inert = !0, e.el.classList.remove(this.settings.stateActive), e.isTooltip || e.trigger.setAttribute("aria-expanded", "false"), e.floatingCleanup(), e.state = "closed", e.trigger === this.trigger && (this.trigger = null)), e;
|
|
871
856
|
}
|
|
872
|
-
function
|
|
873
|
-
const s = ni.call(this, t);
|
|
874
|
-
if (s) {
|
|
875
|
-
const e = document.querySelector(`#${s}`), i = document.querySelector(`[aria-controls="${s}"]`) || document.querySelector(`[aria-describedby="${s}"]`);
|
|
876
|
-
return !i && !e ? { error: new Error(`No popover elements found using the ID: "${s}".`) } : i ? e ? { popover: e, trigger: i } : { error: new Error(`No popover associated with the provided popover trigger: "${s}".`) } : { error: new Error(`No popover trigger associated with the provided popover: "${s}".`) };
|
|
877
|
-
} else
|
|
878
|
-
return { error: new Error("Could not resolve the popover ID.") };
|
|
879
|
-
}
|
|
880
|
-
async function Jt(t) {
|
|
881
|
-
const s = t ? ve.call(this, t) : await xe.call(this);
|
|
882
|
-
return s && s.state === "opened" && (s.el.inert = !0, s.el.classList.remove(this.settings.stateActive), s.isTooltip || s.trigger.setAttribute("aria-expanded", "false"), s.cleanup(), s.state = "closed", s.trigger === this.trigger && (this.trigger = null)), s;
|
|
883
|
-
}
|
|
884
|
-
async function xe() {
|
|
857
|
+
async function Se() {
|
|
885
858
|
const t = [];
|
|
886
|
-
return await Promise.all(this.collection.map(async (
|
|
887
|
-
|
|
859
|
+
return await Promise.all(this.collection.map(async (e) => {
|
|
860
|
+
e.state === "opened" && t.push(await ve.call(this, e));
|
|
888
861
|
})), t;
|
|
889
862
|
}
|
|
890
|
-
function
|
|
863
|
+
function Ee(t) {
|
|
891
864
|
t.state == "opened" && setTimeout(() => {
|
|
892
|
-
const
|
|
893
|
-
let
|
|
865
|
+
const e = t.el.matches(":hover") === t.el || t.trigger.matches(":hover") === t.trigger;
|
|
866
|
+
let i = document.activeElement.closest(
|
|
894
867
|
`#${t.id}, [aria-controls="${t.id}"], [aria-describedby="${t.id}"]`
|
|
895
868
|
);
|
|
896
|
-
return
|
|
869
|
+
return i = i ? i.matches(":focus-visible") : !1, !e && !i && t.close(), t;
|
|
897
870
|
}, 1);
|
|
898
871
|
}
|
|
899
|
-
function
|
|
900
|
-
t.state === "opened" ? t.close() : (this.trigger = t.trigger, t.open()
|
|
872
|
+
function ni(t) {
|
|
873
|
+
t.state === "opened" ? t.close() : (this.trigger = t.trigger, t.open());
|
|
901
874
|
}
|
|
902
|
-
function
|
|
875
|
+
function oi(t) {
|
|
903
876
|
t.isTooltip && (t.toggleDelayId && clearTimeout(t.toggleDelayId), t.close());
|
|
904
877
|
}
|
|
905
|
-
function
|
|
906
|
-
if (t.isHovered =
|
|
878
|
+
function ri(t, e) {
|
|
879
|
+
if (t.isHovered = e, e.type == "focus" && !t.trigger.matches(":focus-visible"))
|
|
907
880
|
return;
|
|
908
881
|
t.toggleDelayId && clearTimeout(t.toggleDelayId);
|
|
909
|
-
const
|
|
910
|
-
if (
|
|
911
|
-
const
|
|
882
|
+
const i = t.trigger.getAttribute("aria-expanded");
|
|
883
|
+
if (i && i == "true") return;
|
|
884
|
+
const s = this.activeHover ? 0 : ye(t, 0);
|
|
912
885
|
this.activeHover && this.activeHover.close(), t.toggleDelayId = setTimeout(() => {
|
|
913
886
|
t.id && t.open();
|
|
914
|
-
},
|
|
887
|
+
}, s);
|
|
915
888
|
}
|
|
916
|
-
function
|
|
889
|
+
function li(t, e) {
|
|
917
890
|
setTimeout(() => {
|
|
918
|
-
t.isHovered =
|
|
919
|
-
|
|
920
|
-
},
|
|
891
|
+
t.isHovered = e, !t.isHovered && (t.toggleDelayId && clearTimeout(t.toggleDelayId), t.toggleDelayId = setTimeout(() => {
|
|
892
|
+
Ee.call(this, t);
|
|
893
|
+
}, ye(t, 1)));
|
|
921
894
|
}, 1);
|
|
922
895
|
}
|
|
923
|
-
function
|
|
896
|
+
function ai(t) {
|
|
924
897
|
switch (t.key) {
|
|
925
898
|
case "Escape":
|
|
926
|
-
this.trigger && this.trigger.focus(),
|
|
899
|
+
this.trigger && this.trigger.focus(), Se.call(this);
|
|
927
900
|
return;
|
|
928
901
|
case "Tab":
|
|
929
|
-
this.collection.forEach((
|
|
930
|
-
|
|
902
|
+
this.collection.forEach((e) => {
|
|
903
|
+
Ee.call(this, e);
|
|
931
904
|
});
|
|
932
905
|
return;
|
|
933
906
|
default:
|
|
934
907
|
return;
|
|
935
908
|
}
|
|
936
909
|
}
|
|
937
|
-
function
|
|
938
|
-
const
|
|
939
|
-
document.addEventListener("click", function
|
|
940
|
-
|
|
910
|
+
function ci(t) {
|
|
911
|
+
const e = this;
|
|
912
|
+
document.addEventListener("click", function i(s) {
|
|
913
|
+
s.target.closest(
|
|
941
914
|
`#${t.id}, [aria-controls="${t.id}"], [aria-describedby="${t.id}"]`
|
|
942
|
-
) ? t.el && !t.el.classList.contains(
|
|
915
|
+
) ? t.el && !t.el.classList.contains(e.settings.stateActive) && this.removeEventListener("click", i) : (t.el && t.el.classList.contains(e.settings.stateActive) && t.close(), this.removeEventListener("click", i));
|
|
943
916
|
});
|
|
944
917
|
}
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
}
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
918
|
+
var P, z;
|
|
919
|
+
class fi extends Ct {
|
|
920
|
+
constructor(i, s, n = {}) {
|
|
921
|
+
super(i, s, n);
|
|
922
|
+
k(this, P);
|
|
923
|
+
k(this, z);
|
|
924
|
+
this.state = "closed", this.toggleDelayId = null, this.trigger = null, E(this, P, null), E(this, z, {
|
|
925
|
+
el: !1,
|
|
926
|
+
trigger: !1
|
|
927
|
+
}), this.floatingCleanup = () => {
|
|
928
|
+
};
|
|
929
|
+
}
|
|
930
|
+
get isTooltip() {
|
|
931
|
+
return !!this.el.closest(this.getSetting("selectorTooltip")) || this.el.getAttribute("role") == "tooltip";
|
|
932
|
+
}
|
|
933
|
+
get isHovered() {
|
|
934
|
+
return w(this, z).el || w(this, z).trigger;
|
|
935
|
+
}
|
|
936
|
+
set isHovered(i) {
|
|
937
|
+
const s = i.type == "mouseenter" ? !0 : i.type == "mouseleave" ? !1 : void 0;
|
|
938
|
+
if (s != null)
|
|
939
|
+
switch (i.target) {
|
|
940
|
+
case this.el:
|
|
941
|
+
w(this, z).el = s;
|
|
942
|
+
break;
|
|
943
|
+
case this.trigger:
|
|
944
|
+
w(this, z).trigger = s;
|
|
945
|
+
break;
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
async open() {
|
|
949
|
+
return this.context.open(this);
|
|
950
|
+
}
|
|
951
|
+
async close() {
|
|
952
|
+
return this.context.close(this);
|
|
953
|
+
}
|
|
954
|
+
async deregister() {
|
|
955
|
+
return this.context.deregister(this.id);
|
|
956
|
+
}
|
|
957
|
+
registerEventListeners() {
|
|
958
|
+
w(this, P) || (this.getSetting("event") === "hover" ? (E(this, P, [{
|
|
959
|
+
el: ["el", "trigger"],
|
|
960
|
+
type: ["mouseenter", "focus"],
|
|
961
|
+
listener: ri.bind(this.context, this)
|
|
962
|
+
}, {
|
|
963
|
+
el: ["el", "trigger"],
|
|
964
|
+
type: ["mouseleave", "focusout"],
|
|
965
|
+
listener: li.bind(this.context, this)
|
|
966
|
+
}, {
|
|
967
|
+
el: ["trigger"],
|
|
968
|
+
type: ["click"],
|
|
969
|
+
listener: oi.bind(this.context, this)
|
|
970
|
+
}]), w(this, P).forEach((s) => {
|
|
971
|
+
s.el.forEach((n) => {
|
|
972
|
+
s.type.forEach((o) => {
|
|
973
|
+
this[n].addEventListener(o, s.listener, !1);
|
|
974
|
+
});
|
|
960
975
|
});
|
|
961
|
-
})
|
|
962
|
-
|
|
976
|
+
})) : (E(this, P, [{
|
|
977
|
+
el: ["trigger"],
|
|
978
|
+
type: ["click"],
|
|
979
|
+
listener: ni.bind(this.context, this)
|
|
980
|
+
}]), w(this, P).forEach((s) => {
|
|
981
|
+
s.el.forEach((n) => {
|
|
982
|
+
s.type.forEach((o) => {
|
|
983
|
+
this[n].addEventListener(o, s.listener, !1);
|
|
984
|
+
});
|
|
985
|
+
});
|
|
986
|
+
})));
|
|
987
|
+
}
|
|
988
|
+
deregisterEventListeners() {
|
|
989
|
+
w(this, P) && (w(this, P).forEach((i) => {
|
|
990
|
+
i.el.forEach((s) => {
|
|
991
|
+
i.type.forEach((n) => {
|
|
992
|
+
this[s].removeEventListener(n, i.listener, !1);
|
|
993
|
+
});
|
|
994
|
+
});
|
|
995
|
+
}), E(this, P, null));
|
|
996
|
+
}
|
|
997
|
+
async beforeMount() {
|
|
998
|
+
this.trigger = document.querySelector(
|
|
999
|
+
`[aria-controls="${this.id}"], [aria-describedby="${this.id}"]`
|
|
1000
|
+
), this.isTooltip ? (this.settings.event = "hover", this.el.setAttribute("role", "tooltip")) : this.trigger.setAttribute("aria-expanded", "false"), this.registerEventListeners();
|
|
1001
|
+
}
|
|
1002
|
+
async afterRegister() {
|
|
1003
|
+
this.el.classList.contains(this.getSetting("stateActive")) ? await this.open() : this.el.inert = !0;
|
|
1004
|
+
}
|
|
1005
|
+
async beforeUnmount() {
|
|
1006
|
+
this.state === "opened" && await this.close(), this.floatingCleanup(), this.deregisterEventListeners();
|
|
1007
|
+
}
|
|
963
1008
|
}
|
|
964
|
-
|
|
1009
|
+
P = new WeakMap(), z = new WeakMap();
|
|
1010
|
+
const ht = Math.min, Z = Math.max, Lt = Math.round, $t = Math.floor, W = (t) => ({
|
|
965
1011
|
x: t,
|
|
966
1012
|
y: t
|
|
967
1013
|
}), ui = {
|
|
@@ -973,63 +1019,63 @@ const lt = Math.min, G = Math.max, Et = Math.round, yt = Math.floor, V = (t) =>
|
|
|
973
1019
|
start: "end",
|
|
974
1020
|
end: "start"
|
|
975
1021
|
};
|
|
976
|
-
function
|
|
977
|
-
return
|
|
1022
|
+
function _t(t, e, i) {
|
|
1023
|
+
return Z(t, ht(e, i));
|
|
978
1024
|
}
|
|
979
|
-
function
|
|
980
|
-
return typeof t == "function" ? t(
|
|
1025
|
+
function Q(t, e) {
|
|
1026
|
+
return typeof t == "function" ? t(e) : t;
|
|
981
1027
|
}
|
|
982
1028
|
function j(t) {
|
|
983
1029
|
return t.split("-")[0];
|
|
984
1030
|
}
|
|
985
|
-
function
|
|
1031
|
+
function At(t) {
|
|
986
1032
|
return t.split("-")[1];
|
|
987
1033
|
}
|
|
988
|
-
function
|
|
1034
|
+
function Yt(t) {
|
|
989
1035
|
return t === "x" ? "y" : "x";
|
|
990
1036
|
}
|
|
991
|
-
function
|
|
1037
|
+
function Gt(t) {
|
|
992
1038
|
return t === "y" ? "height" : "width";
|
|
993
1039
|
}
|
|
994
|
-
function
|
|
1040
|
+
function q(t) {
|
|
995
1041
|
return ["top", "bottom"].includes(j(t)) ? "y" : "x";
|
|
996
1042
|
}
|
|
997
|
-
function
|
|
998
|
-
return
|
|
1043
|
+
function Jt(t) {
|
|
1044
|
+
return Yt(q(t));
|
|
999
1045
|
}
|
|
1000
|
-
function
|
|
1001
|
-
|
|
1002
|
-
const
|
|
1003
|
-
let r = n === "x" ?
|
|
1004
|
-
return
|
|
1046
|
+
function hi(t, e, i) {
|
|
1047
|
+
i === void 0 && (i = !1);
|
|
1048
|
+
const s = At(t), n = Jt(t), o = Gt(n);
|
|
1049
|
+
let r = n === "x" ? s === (i ? "end" : "start") ? "right" : "left" : s === "start" ? "bottom" : "top";
|
|
1050
|
+
return e.reference[o] > e.floating[o] && (r = Ot(r)), [r, Ot(r)];
|
|
1005
1051
|
}
|
|
1006
|
-
function
|
|
1007
|
-
const
|
|
1008
|
-
return [
|
|
1052
|
+
function gi(t) {
|
|
1053
|
+
const e = Ot(t);
|
|
1054
|
+
return [zt(t), e, zt(e)];
|
|
1009
1055
|
}
|
|
1010
|
-
function
|
|
1011
|
-
return t.replace(/start|end/g, (
|
|
1056
|
+
function zt(t) {
|
|
1057
|
+
return t.replace(/start|end/g, (e) => di[e]);
|
|
1012
1058
|
}
|
|
1013
|
-
function mi(t,
|
|
1014
|
-
const
|
|
1059
|
+
function mi(t, e, i) {
|
|
1060
|
+
const s = ["left", "right"], n = ["right", "left"], o = ["top", "bottom"], r = ["bottom", "top"];
|
|
1015
1061
|
switch (t) {
|
|
1016
1062
|
case "top":
|
|
1017
1063
|
case "bottom":
|
|
1018
|
-
return
|
|
1064
|
+
return i ? e ? n : s : e ? s : n;
|
|
1019
1065
|
case "left":
|
|
1020
1066
|
case "right":
|
|
1021
|
-
return
|
|
1067
|
+
return e ? o : r;
|
|
1022
1068
|
default:
|
|
1023
1069
|
return [];
|
|
1024
1070
|
}
|
|
1025
1071
|
}
|
|
1026
|
-
function pi(t,
|
|
1027
|
-
const n =
|
|
1028
|
-
let o = mi(j(t),
|
|
1029
|
-
return n && (o = o.map((r) => r + "-" + n),
|
|
1072
|
+
function pi(t, e, i, s) {
|
|
1073
|
+
const n = At(t);
|
|
1074
|
+
let o = mi(j(t), i === "start", s);
|
|
1075
|
+
return n && (o = o.map((r) => r + "-" + n), e && (o = o.concat(o.map(zt)))), o;
|
|
1030
1076
|
}
|
|
1031
|
-
function
|
|
1032
|
-
return t.replace(/left|right|bottom|top/g, (
|
|
1077
|
+
function Ot(t) {
|
|
1078
|
+
return t.replace(/left|right|bottom|top/g, (e) => ui[e]);
|
|
1033
1079
|
}
|
|
1034
1080
|
function wi(t) {
|
|
1035
1081
|
return {
|
|
@@ -1048,288 +1094,288 @@ function Ce(t) {
|
|
|
1048
1094
|
left: t
|
|
1049
1095
|
};
|
|
1050
1096
|
}
|
|
1051
|
-
function
|
|
1097
|
+
function Tt(t) {
|
|
1052
1098
|
const {
|
|
1053
|
-
x:
|
|
1054
|
-
y:
|
|
1055
|
-
width:
|
|
1099
|
+
x: e,
|
|
1100
|
+
y: i,
|
|
1101
|
+
width: s,
|
|
1056
1102
|
height: n
|
|
1057
1103
|
} = t;
|
|
1058
1104
|
return {
|
|
1059
|
-
width:
|
|
1105
|
+
width: s,
|
|
1060
1106
|
height: n,
|
|
1061
|
-
top:
|
|
1062
|
-
left:
|
|
1063
|
-
right:
|
|
1064
|
-
bottom:
|
|
1065
|
-
x:
|
|
1066
|
-
y:
|
|
1107
|
+
top: i,
|
|
1108
|
+
left: e,
|
|
1109
|
+
right: e + s,
|
|
1110
|
+
bottom: i + n,
|
|
1111
|
+
x: e,
|
|
1112
|
+
y: i
|
|
1067
1113
|
};
|
|
1068
1114
|
}
|
|
1069
|
-
function
|
|
1115
|
+
function se(t, e, i) {
|
|
1070
1116
|
let {
|
|
1071
|
-
reference:
|
|
1117
|
+
reference: s,
|
|
1072
1118
|
floating: n
|
|
1073
1119
|
} = t;
|
|
1074
|
-
const o =
|
|
1120
|
+
const o = q(e), r = Jt(e), l = Gt(r), a = j(e), c = o === "y", d = s.x + s.width / 2 - n.width / 2, u = s.y + s.height / 2 - n.height / 2, h = s[l] / 2 - n[l] / 2;
|
|
1075
1121
|
let f;
|
|
1076
|
-
switch (
|
|
1122
|
+
switch (a) {
|
|
1077
1123
|
case "top":
|
|
1078
1124
|
f = {
|
|
1079
1125
|
x: d,
|
|
1080
|
-
y:
|
|
1126
|
+
y: s.y - n.height
|
|
1081
1127
|
};
|
|
1082
1128
|
break;
|
|
1083
1129
|
case "bottom":
|
|
1084
1130
|
f = {
|
|
1085
1131
|
x: d,
|
|
1086
|
-
y:
|
|
1132
|
+
y: s.y + s.height
|
|
1087
1133
|
};
|
|
1088
1134
|
break;
|
|
1089
1135
|
case "right":
|
|
1090
1136
|
f = {
|
|
1091
|
-
x:
|
|
1137
|
+
x: s.x + s.width,
|
|
1092
1138
|
y: u
|
|
1093
1139
|
};
|
|
1094
1140
|
break;
|
|
1095
1141
|
case "left":
|
|
1096
1142
|
f = {
|
|
1097
|
-
x:
|
|
1143
|
+
x: s.x - n.width,
|
|
1098
1144
|
y: u
|
|
1099
1145
|
};
|
|
1100
1146
|
break;
|
|
1101
1147
|
default:
|
|
1102
1148
|
f = {
|
|
1103
|
-
x:
|
|
1104
|
-
y:
|
|
1149
|
+
x: s.x,
|
|
1150
|
+
y: s.y
|
|
1105
1151
|
};
|
|
1106
1152
|
}
|
|
1107
|
-
switch (
|
|
1153
|
+
switch (At(e)) {
|
|
1108
1154
|
case "start":
|
|
1109
|
-
f[r] -=
|
|
1155
|
+
f[r] -= h * (i && c ? -1 : 1);
|
|
1110
1156
|
break;
|
|
1111
1157
|
case "end":
|
|
1112
|
-
f[r] +=
|
|
1158
|
+
f[r] += h * (i && c ? -1 : 1);
|
|
1113
1159
|
break;
|
|
1114
1160
|
}
|
|
1115
1161
|
return f;
|
|
1116
1162
|
}
|
|
1117
|
-
const bi = async (t,
|
|
1163
|
+
const bi = async (t, e, i) => {
|
|
1118
1164
|
const {
|
|
1119
|
-
placement:
|
|
1165
|
+
placement: s = "bottom",
|
|
1120
1166
|
strategy: n = "absolute",
|
|
1121
1167
|
middleware: o = [],
|
|
1122
1168
|
platform: r
|
|
1123
|
-
} =
|
|
1124
|
-
let
|
|
1169
|
+
} = i, l = o.filter(Boolean), a = await (r.isRTL == null ? void 0 : r.isRTL(e));
|
|
1170
|
+
let c = await r.getElementRects({
|
|
1125
1171
|
reference: t,
|
|
1126
|
-
floating:
|
|
1172
|
+
floating: e,
|
|
1127
1173
|
strategy: n
|
|
1128
1174
|
}), {
|
|
1129
1175
|
x: d,
|
|
1130
1176
|
y: u
|
|
1131
|
-
} =
|
|
1177
|
+
} = se(c, s, a), h = s, f = {}, g = 0;
|
|
1132
1178
|
for (let m = 0; m < l.length; m++) {
|
|
1133
1179
|
const {
|
|
1134
|
-
name:
|
|
1180
|
+
name: b,
|
|
1135
1181
|
fn: p
|
|
1136
1182
|
} = l[m], {
|
|
1137
|
-
x:
|
|
1138
|
-
y:
|
|
1139
|
-
data:
|
|
1140
|
-
reset:
|
|
1183
|
+
x: y,
|
|
1184
|
+
y: x,
|
|
1185
|
+
data: S,
|
|
1186
|
+
reset: v
|
|
1141
1187
|
} = await p({
|
|
1142
1188
|
x: d,
|
|
1143
1189
|
y: u,
|
|
1144
|
-
initialPlacement:
|
|
1145
|
-
placement:
|
|
1190
|
+
initialPlacement: s,
|
|
1191
|
+
placement: h,
|
|
1146
1192
|
strategy: n,
|
|
1147
1193
|
middlewareData: f,
|
|
1148
|
-
rects:
|
|
1194
|
+
rects: c,
|
|
1149
1195
|
platform: r,
|
|
1150
1196
|
elements: {
|
|
1151
1197
|
reference: t,
|
|
1152
|
-
floating:
|
|
1198
|
+
floating: e
|
|
1153
1199
|
}
|
|
1154
1200
|
});
|
|
1155
|
-
d =
|
|
1201
|
+
d = y ?? d, u = x ?? u, f = {
|
|
1156
1202
|
...f,
|
|
1157
|
-
[
|
|
1158
|
-
...f[
|
|
1159
|
-
...
|
|
1203
|
+
[b]: {
|
|
1204
|
+
...f[b],
|
|
1205
|
+
...S
|
|
1160
1206
|
}
|
|
1161
|
-
},
|
|
1207
|
+
}, v && g <= 50 && (g++, typeof v == "object" && (v.placement && (h = v.placement), v.rects && (c = v.rects === !0 ? await r.getElementRects({
|
|
1162
1208
|
reference: t,
|
|
1163
|
-
floating:
|
|
1209
|
+
floating: e,
|
|
1164
1210
|
strategy: n
|
|
1165
|
-
}) :
|
|
1211
|
+
}) : v.rects), {
|
|
1166
1212
|
x: d,
|
|
1167
1213
|
y: u
|
|
1168
|
-
} =
|
|
1214
|
+
} = se(c, h, a)), m = -1);
|
|
1169
1215
|
}
|
|
1170
1216
|
return {
|
|
1171
1217
|
x: d,
|
|
1172
1218
|
y: u,
|
|
1173
|
-
placement:
|
|
1219
|
+
placement: h,
|
|
1174
1220
|
strategy: n,
|
|
1175
1221
|
middlewareData: f
|
|
1176
1222
|
};
|
|
1177
1223
|
};
|
|
1178
|
-
async function
|
|
1179
|
-
var
|
|
1180
|
-
|
|
1224
|
+
async function Ae(t, e) {
|
|
1225
|
+
var i;
|
|
1226
|
+
e === void 0 && (e = {});
|
|
1181
1227
|
const {
|
|
1182
|
-
x:
|
|
1228
|
+
x: s,
|
|
1183
1229
|
y: n,
|
|
1184
1230
|
platform: o,
|
|
1185
1231
|
rects: r,
|
|
1186
1232
|
elements: l,
|
|
1187
|
-
strategy:
|
|
1233
|
+
strategy: a
|
|
1188
1234
|
} = t, {
|
|
1189
|
-
boundary:
|
|
1235
|
+
boundary: c = "clippingAncestors",
|
|
1190
1236
|
rootBoundary: d = "viewport",
|
|
1191
1237
|
elementContext: u = "floating",
|
|
1192
|
-
altBoundary:
|
|
1238
|
+
altBoundary: h = !1,
|
|
1193
1239
|
padding: f = 0
|
|
1194
|
-
} =
|
|
1195
|
-
element: (
|
|
1196
|
-
boundary:
|
|
1240
|
+
} = Q(e, t), g = Ce(f), b = l[h ? u === "floating" ? "reference" : "floating" : u], p = Tt(await o.getClippingRect({
|
|
1241
|
+
element: (i = await (o.isElement == null ? void 0 : o.isElement(b))) == null || i ? b : b.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(l.floating)),
|
|
1242
|
+
boundary: c,
|
|
1197
1243
|
rootBoundary: d,
|
|
1198
|
-
strategy:
|
|
1199
|
-
})),
|
|
1200
|
-
x:
|
|
1244
|
+
strategy: a
|
|
1245
|
+
})), y = u === "floating" ? {
|
|
1246
|
+
x: s,
|
|
1201
1247
|
y: n,
|
|
1202
1248
|
width: r.floating.width,
|
|
1203
1249
|
height: r.floating.height
|
|
1204
|
-
} : r.reference,
|
|
1250
|
+
} : r.reference, x = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l.floating)), S = await (o.isElement == null ? void 0 : o.isElement(x)) ? await (o.getScale == null ? void 0 : o.getScale(x)) || {
|
|
1205
1251
|
x: 1,
|
|
1206
1252
|
y: 1
|
|
1207
1253
|
} : {
|
|
1208
1254
|
x: 1,
|
|
1209
1255
|
y: 1
|
|
1210
|
-
},
|
|
1256
|
+
}, v = Tt(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
1211
1257
|
elements: l,
|
|
1212
|
-
rect:
|
|
1213
|
-
offsetParent:
|
|
1214
|
-
strategy:
|
|
1215
|
-
}) :
|
|
1258
|
+
rect: y,
|
|
1259
|
+
offsetParent: x,
|
|
1260
|
+
strategy: a
|
|
1261
|
+
}) : y);
|
|
1216
1262
|
return {
|
|
1217
|
-
top: (p.top -
|
|
1218
|
-
bottom: (
|
|
1219
|
-
left: (p.left -
|
|
1220
|
-
right: (
|
|
1263
|
+
top: (p.top - v.top + g.top) / S.y,
|
|
1264
|
+
bottom: (v.bottom - p.bottom + g.bottom) / S.y,
|
|
1265
|
+
left: (p.left - v.left + g.left) / S.x,
|
|
1266
|
+
right: (v.right - p.right + g.right) / S.x
|
|
1221
1267
|
};
|
|
1222
1268
|
}
|
|
1223
|
-
const
|
|
1269
|
+
const yi = (t) => ({
|
|
1224
1270
|
name: "arrow",
|
|
1225
1271
|
options: t,
|
|
1226
|
-
async fn(
|
|
1272
|
+
async fn(e) {
|
|
1227
1273
|
const {
|
|
1228
|
-
x:
|
|
1229
|
-
y:
|
|
1274
|
+
x: i,
|
|
1275
|
+
y: s,
|
|
1230
1276
|
placement: n,
|
|
1231
1277
|
rects: o,
|
|
1232
1278
|
platform: r,
|
|
1233
1279
|
elements: l,
|
|
1234
|
-
middlewareData:
|
|
1235
|
-
} =
|
|
1236
|
-
element:
|
|
1280
|
+
middlewareData: a
|
|
1281
|
+
} = e, {
|
|
1282
|
+
element: c,
|
|
1237
1283
|
padding: d = 0
|
|
1238
|
-
} =
|
|
1239
|
-
if (
|
|
1284
|
+
} = Q(t, e) || {};
|
|
1285
|
+
if (c == null)
|
|
1240
1286
|
return {};
|
|
1241
|
-
const u = Ce(d),
|
|
1242
|
-
x:
|
|
1243
|
-
y:
|
|
1244
|
-
}, f =
|
|
1245
|
-
let
|
|
1246
|
-
(!
|
|
1247
|
-
const
|
|
1287
|
+
const u = Ce(d), h = {
|
|
1288
|
+
x: i,
|
|
1289
|
+
y: s
|
|
1290
|
+
}, f = Jt(n), g = Gt(f), m = await r.getDimensions(c), b = f === "y", p = b ? "top" : "left", y = b ? "bottom" : "right", x = b ? "clientHeight" : "clientWidth", S = o.reference[g] + o.reference[f] - h[f] - o.floating[g], v = h[f] - o.reference[f], $ = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c));
|
|
1291
|
+
let K = $ ? $[x] : 0;
|
|
1292
|
+
(!K || !await (r.isElement == null ? void 0 : r.isElement($))) && (K = l.floating[x] || o.floating[g]);
|
|
1293
|
+
const pt = S / 2 - v / 2, X = K / 2 - m[g] / 2 - 1, V = ht(u[p], X), wt = ht(u[y], X), Y = V, bt = K - m[g] - wt, A = K / 2 - m[g] / 2 + pt, et = _t(Y, A, bt), B = !a.arrow && At(n) != null && A !== et && o.reference[g] / 2 - (A < Y ? V : wt) - m[g] / 2 < 0, F = B ? A < Y ? A - Y : A - bt : 0;
|
|
1248
1294
|
return {
|
|
1249
|
-
[f]:
|
|
1295
|
+
[f]: h[f] + F,
|
|
1250
1296
|
data: {
|
|
1251
|
-
[f]:
|
|
1252
|
-
centerOffset:
|
|
1253
|
-
...
|
|
1254
|
-
alignmentOffset:
|
|
1297
|
+
[f]: et,
|
|
1298
|
+
centerOffset: A - et - F,
|
|
1299
|
+
...B && {
|
|
1300
|
+
alignmentOffset: F
|
|
1255
1301
|
}
|
|
1256
1302
|
},
|
|
1257
|
-
reset:
|
|
1303
|
+
reset: B
|
|
1258
1304
|
};
|
|
1259
1305
|
}
|
|
1260
1306
|
}), xi = function(t) {
|
|
1261
1307
|
return t === void 0 && (t = {}), {
|
|
1262
1308
|
name: "flip",
|
|
1263
1309
|
options: t,
|
|
1264
|
-
async fn(
|
|
1265
|
-
var
|
|
1310
|
+
async fn(e) {
|
|
1311
|
+
var i, s;
|
|
1266
1312
|
const {
|
|
1267
1313
|
placement: n,
|
|
1268
1314
|
middlewareData: o,
|
|
1269
1315
|
rects: r,
|
|
1270
1316
|
initialPlacement: l,
|
|
1271
|
-
platform:
|
|
1272
|
-
elements:
|
|
1273
|
-
} =
|
|
1317
|
+
platform: a,
|
|
1318
|
+
elements: c
|
|
1319
|
+
} = e, {
|
|
1274
1320
|
mainAxis: d = !0,
|
|
1275
1321
|
crossAxis: u = !0,
|
|
1276
|
-
fallbackPlacements:
|
|
1322
|
+
fallbackPlacements: h,
|
|
1277
1323
|
fallbackStrategy: f = "bestFit",
|
|
1278
|
-
fallbackAxisSideDirection:
|
|
1324
|
+
fallbackAxisSideDirection: g = "none",
|
|
1279
1325
|
flipAlignment: m = !0,
|
|
1280
|
-
...
|
|
1281
|
-
} =
|
|
1282
|
-
if ((
|
|
1326
|
+
...b
|
|
1327
|
+
} = Q(t, e);
|
|
1328
|
+
if ((i = o.arrow) != null && i.alignmentOffset)
|
|
1283
1329
|
return {};
|
|
1284
|
-
const p = j(n),
|
|
1285
|
-
!
|
|
1286
|
-
const
|
|
1287
|
-
let
|
|
1288
|
-
if (d &&
|
|
1289
|
-
const
|
|
1290
|
-
|
|
1330
|
+
const p = j(n), y = q(l), x = j(l) === l, S = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), v = h || (x || !m ? [Ot(l)] : gi(l)), $ = g !== "none";
|
|
1331
|
+
!h && $ && v.push(...pi(l, m, g, S));
|
|
1332
|
+
const K = [l, ...v], pt = await Ae(e, b), X = [];
|
|
1333
|
+
let V = ((s = o.flip) == null ? void 0 : s.overflows) || [];
|
|
1334
|
+
if (d && X.push(pt[p]), u) {
|
|
1335
|
+
const A = hi(n, r, S);
|
|
1336
|
+
X.push(pt[A[0]], pt[A[1]]);
|
|
1291
1337
|
}
|
|
1292
|
-
if (
|
|
1338
|
+
if (V = [...V, {
|
|
1293
1339
|
placement: n,
|
|
1294
|
-
overflows:
|
|
1295
|
-
}], !
|
|
1296
|
-
var
|
|
1297
|
-
const
|
|
1298
|
-
if (
|
|
1340
|
+
overflows: X
|
|
1341
|
+
}], !X.every((A) => A <= 0)) {
|
|
1342
|
+
var wt, Y;
|
|
1343
|
+
const A = (((wt = o.flip) == null ? void 0 : wt.index) || 0) + 1, et = K[A];
|
|
1344
|
+
if (et)
|
|
1299
1345
|
return {
|
|
1300
1346
|
data: {
|
|
1301
|
-
index:
|
|
1302
|
-
overflows:
|
|
1347
|
+
index: A,
|
|
1348
|
+
overflows: V
|
|
1303
1349
|
},
|
|
1304
1350
|
reset: {
|
|
1305
|
-
placement:
|
|
1351
|
+
placement: et
|
|
1306
1352
|
}
|
|
1307
1353
|
};
|
|
1308
|
-
let
|
|
1309
|
-
if (!
|
|
1354
|
+
let B = (Y = V.filter((F) => F.overflows[0] <= 0).sort((F, H) => F.overflows[1] - H.overflows[1])[0]) == null ? void 0 : Y.placement;
|
|
1355
|
+
if (!B)
|
|
1310
1356
|
switch (f) {
|
|
1311
1357
|
case "bestFit": {
|
|
1312
|
-
var
|
|
1313
|
-
const
|
|
1314
|
-
if (
|
|
1315
|
-
const
|
|
1316
|
-
return
|
|
1358
|
+
var bt;
|
|
1359
|
+
const F = (bt = V.filter((H) => {
|
|
1360
|
+
if ($) {
|
|
1361
|
+
const _ = q(H.placement);
|
|
1362
|
+
return _ === y || // Create a bias to the `y` side axis due to horizontal
|
|
1317
1363
|
// reading directions favoring greater width.
|
|
1318
|
-
|
|
1364
|
+
_ === "y";
|
|
1319
1365
|
}
|
|
1320
1366
|
return !0;
|
|
1321
|
-
}).map((
|
|
1322
|
-
|
|
1367
|
+
}).map((H) => [H.placement, H.overflows.filter((_) => _ > 0).reduce((_, Pe) => _ + Pe, 0)]).sort((H, _) => H[1] - _[1])[0]) == null ? void 0 : bt[0];
|
|
1368
|
+
F && (B = F);
|
|
1323
1369
|
break;
|
|
1324
1370
|
}
|
|
1325
1371
|
case "initialPlacement":
|
|
1326
|
-
|
|
1372
|
+
B = l;
|
|
1327
1373
|
break;
|
|
1328
1374
|
}
|
|
1329
|
-
if (n !==
|
|
1375
|
+
if (n !== B)
|
|
1330
1376
|
return {
|
|
1331
1377
|
reset: {
|
|
1332
|
-
placement:
|
|
1378
|
+
placement: B
|
|
1333
1379
|
}
|
|
1334
1380
|
};
|
|
1335
1381
|
}
|
|
@@ -1337,16 +1383,16 @@ const vi = (t) => ({
|
|
|
1337
1383
|
}
|
|
1338
1384
|
};
|
|
1339
1385
|
};
|
|
1340
|
-
async function
|
|
1386
|
+
async function vi(t, e) {
|
|
1341
1387
|
const {
|
|
1342
|
-
placement:
|
|
1343
|
-
platform:
|
|
1388
|
+
placement: i,
|
|
1389
|
+
platform: s,
|
|
1344
1390
|
elements: n
|
|
1345
|
-
} = t, o = await (
|
|
1391
|
+
} = t, o = await (s.isRTL == null ? void 0 : s.isRTL(n.floating)), r = j(i), l = At(i), a = q(i) === "y", c = ["left", "top"].includes(r) ? -1 : 1, d = o && a ? -1 : 1, u = Q(e, t);
|
|
1346
1392
|
let {
|
|
1347
|
-
mainAxis:
|
|
1393
|
+
mainAxis: h,
|
|
1348
1394
|
crossAxis: f,
|
|
1349
|
-
alignmentAxis:
|
|
1395
|
+
alignmentAxis: g
|
|
1350
1396
|
} = typeof u == "number" ? {
|
|
1351
1397
|
mainAxis: u,
|
|
1352
1398
|
crossAxis: 0,
|
|
@@ -1356,86 +1402,86 @@ async function yi(t, s) {
|
|
|
1356
1402
|
crossAxis: u.crossAxis || 0,
|
|
1357
1403
|
alignmentAxis: u.alignmentAxis
|
|
1358
1404
|
};
|
|
1359
|
-
return l && typeof
|
|
1405
|
+
return l && typeof g == "number" && (f = l === "end" ? g * -1 : g), a ? {
|
|
1360
1406
|
x: f * d,
|
|
1361
|
-
y:
|
|
1407
|
+
y: h * c
|
|
1362
1408
|
} : {
|
|
1363
|
-
x:
|
|
1409
|
+
x: h * c,
|
|
1364
1410
|
y: f * d
|
|
1365
1411
|
};
|
|
1366
1412
|
}
|
|
1367
|
-
const
|
|
1413
|
+
const Si = function(t) {
|
|
1368
1414
|
return t === void 0 && (t = 0), {
|
|
1369
1415
|
name: "offset",
|
|
1370
1416
|
options: t,
|
|
1371
|
-
async fn(
|
|
1372
|
-
var
|
|
1417
|
+
async fn(e) {
|
|
1418
|
+
var i, s;
|
|
1373
1419
|
const {
|
|
1374
1420
|
x: n,
|
|
1375
1421
|
y: o,
|
|
1376
1422
|
placement: r,
|
|
1377
1423
|
middlewareData: l
|
|
1378
|
-
} =
|
|
1379
|
-
return r === ((
|
|
1380
|
-
x: n +
|
|
1381
|
-
y: o +
|
|
1424
|
+
} = e, a = await vi(e, t);
|
|
1425
|
+
return r === ((i = l.offset) == null ? void 0 : i.placement) && (s = l.arrow) != null && s.alignmentOffset ? {} : {
|
|
1426
|
+
x: n + a.x,
|
|
1427
|
+
y: o + a.y,
|
|
1382
1428
|
data: {
|
|
1383
|
-
...
|
|
1429
|
+
...a,
|
|
1384
1430
|
placement: r
|
|
1385
1431
|
}
|
|
1386
1432
|
};
|
|
1387
1433
|
}
|
|
1388
1434
|
};
|
|
1389
|
-
},
|
|
1435
|
+
}, Ei = function(t) {
|
|
1390
1436
|
return t === void 0 && (t = {}), {
|
|
1391
1437
|
name: "shift",
|
|
1392
1438
|
options: t,
|
|
1393
|
-
async fn(
|
|
1439
|
+
async fn(e) {
|
|
1394
1440
|
const {
|
|
1395
|
-
x:
|
|
1396
|
-
y:
|
|
1441
|
+
x: i,
|
|
1442
|
+
y: s,
|
|
1397
1443
|
placement: n
|
|
1398
|
-
} =
|
|
1444
|
+
} = e, {
|
|
1399
1445
|
mainAxis: o = !0,
|
|
1400
1446
|
crossAxis: r = !1,
|
|
1401
1447
|
limiter: l = {
|
|
1402
|
-
fn: (
|
|
1448
|
+
fn: (b) => {
|
|
1403
1449
|
let {
|
|
1404
1450
|
x: p,
|
|
1405
|
-
y
|
|
1406
|
-
} =
|
|
1451
|
+
y
|
|
1452
|
+
} = b;
|
|
1407
1453
|
return {
|
|
1408
1454
|
x: p,
|
|
1409
|
-
y
|
|
1455
|
+
y
|
|
1410
1456
|
};
|
|
1411
1457
|
}
|
|
1412
1458
|
},
|
|
1413
|
-
...
|
|
1414
|
-
} =
|
|
1415
|
-
x:
|
|
1416
|
-
y:
|
|
1417
|
-
}, d = await
|
|
1418
|
-
let f =
|
|
1459
|
+
...a
|
|
1460
|
+
} = Q(t, e), c = {
|
|
1461
|
+
x: i,
|
|
1462
|
+
y: s
|
|
1463
|
+
}, d = await Ae(e, a), u = q(j(n)), h = Yt(u);
|
|
1464
|
+
let f = c[h], g = c[u];
|
|
1419
1465
|
if (o) {
|
|
1420
|
-
const
|
|
1421
|
-
f =
|
|
1466
|
+
const b = h === "y" ? "top" : "left", p = h === "y" ? "bottom" : "right", y = f + d[b], x = f - d[p];
|
|
1467
|
+
f = _t(y, f, x);
|
|
1422
1468
|
}
|
|
1423
1469
|
if (r) {
|
|
1424
|
-
const
|
|
1425
|
-
|
|
1470
|
+
const b = u === "y" ? "top" : "left", p = u === "y" ? "bottom" : "right", y = g + d[b], x = g - d[p];
|
|
1471
|
+
g = _t(y, g, x);
|
|
1426
1472
|
}
|
|
1427
1473
|
const m = l.fn({
|
|
1428
|
-
...
|
|
1429
|
-
[
|
|
1430
|
-
[u]:
|
|
1474
|
+
...e,
|
|
1475
|
+
[h]: f,
|
|
1476
|
+
[u]: g
|
|
1431
1477
|
});
|
|
1432
1478
|
return {
|
|
1433
1479
|
...m,
|
|
1434
1480
|
data: {
|
|
1435
|
-
x: m.x -
|
|
1436
|
-
y: m.y -
|
|
1481
|
+
x: m.x - i,
|
|
1482
|
+
y: m.y - s,
|
|
1437
1483
|
enabled: {
|
|
1438
|
-
[
|
|
1484
|
+
[h]: o,
|
|
1439
1485
|
[u]: r
|
|
1440
1486
|
}
|
|
1441
1487
|
}
|
|
@@ -1445,23 +1491,23 @@ const Ei = function(t) {
|
|
|
1445
1491
|
}, Ci = function(t) {
|
|
1446
1492
|
return t === void 0 && (t = {}), {
|
|
1447
1493
|
options: t,
|
|
1448
|
-
fn(
|
|
1494
|
+
fn(e) {
|
|
1449
1495
|
const {
|
|
1450
|
-
x:
|
|
1451
|
-
y:
|
|
1496
|
+
x: i,
|
|
1497
|
+
y: s,
|
|
1452
1498
|
placement: n,
|
|
1453
1499
|
rects: o,
|
|
1454
1500
|
middlewareData: r
|
|
1455
|
-
} =
|
|
1501
|
+
} = e, {
|
|
1456
1502
|
offset: l = 0,
|
|
1457
|
-
mainAxis:
|
|
1458
|
-
crossAxis:
|
|
1459
|
-
} =
|
|
1460
|
-
x:
|
|
1461
|
-
y:
|
|
1462
|
-
}, u =
|
|
1463
|
-
let f = d[
|
|
1464
|
-
const m =
|
|
1503
|
+
mainAxis: a = !0,
|
|
1504
|
+
crossAxis: c = !0
|
|
1505
|
+
} = Q(t, e), d = {
|
|
1506
|
+
x: i,
|
|
1507
|
+
y: s
|
|
1508
|
+
}, u = q(n), h = Yt(u);
|
|
1509
|
+
let f = d[h], g = d[u];
|
|
1510
|
+
const m = Q(l, e), b = typeof m == "number" ? {
|
|
1465
1511
|
mainAxis: m,
|
|
1466
1512
|
crossAxis: 0
|
|
1467
1513
|
} : {
|
|
@@ -1469,95 +1515,95 @@ const Ei = function(t) {
|
|
|
1469
1515
|
crossAxis: 0,
|
|
1470
1516
|
...m
|
|
1471
1517
|
};
|
|
1472
|
-
if (c) {
|
|
1473
|
-
const v = g === "y" ? "height" : "width", E = o.reference[g] - o.floating[v] + w.mainAxis, x = o.reference[g] + o.reference[v] - w.mainAxis;
|
|
1474
|
-
f < E ? f = E : f > x && (f = x);
|
|
1475
|
-
}
|
|
1476
1518
|
if (a) {
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1519
|
+
const x = h === "y" ? "height" : "width", S = o.reference[h] - o.floating[x] + b.mainAxis, v = o.reference[h] + o.reference[x] - b.mainAxis;
|
|
1520
|
+
f < S ? f = S : f > v && (f = v);
|
|
1521
|
+
}
|
|
1522
|
+
if (c) {
|
|
1523
|
+
var p, y;
|
|
1524
|
+
const x = h === "y" ? "width" : "height", S = ["top", "left"].includes(j(n)), v = o.reference[u] - o.floating[x] + (S && ((p = r.offset) == null ? void 0 : p[u]) || 0) + (S ? 0 : b.crossAxis), $ = o.reference[u] + o.reference[x] + (S ? 0 : ((y = r.offset) == null ? void 0 : y[u]) || 0) - (S ? b.crossAxis : 0);
|
|
1525
|
+
g < v ? g = v : g > $ && (g = $);
|
|
1480
1526
|
}
|
|
1481
1527
|
return {
|
|
1482
|
-
[
|
|
1483
|
-
[u]:
|
|
1528
|
+
[h]: f,
|
|
1529
|
+
[u]: g
|
|
1484
1530
|
};
|
|
1485
1531
|
}
|
|
1486
1532
|
};
|
|
1487
1533
|
};
|
|
1488
|
-
function
|
|
1534
|
+
function Mt() {
|
|
1489
1535
|
return typeof window < "u";
|
|
1490
1536
|
}
|
|
1491
|
-
function
|
|
1492
|
-
return
|
|
1537
|
+
function mt(t) {
|
|
1538
|
+
return ke(t) ? (t.nodeName || "").toLowerCase() : "#document";
|
|
1493
1539
|
}
|
|
1494
|
-
function
|
|
1495
|
-
var
|
|
1496
|
-
return (t == null || (
|
|
1540
|
+
function T(t) {
|
|
1541
|
+
var e;
|
|
1542
|
+
return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
1497
1543
|
}
|
|
1498
|
-
function
|
|
1499
|
-
var
|
|
1500
|
-
return (
|
|
1544
|
+
function N(t) {
|
|
1545
|
+
var e;
|
|
1546
|
+
return (e = (ke(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
1501
1547
|
}
|
|
1502
|
-
function
|
|
1503
|
-
return
|
|
1548
|
+
function ke(t) {
|
|
1549
|
+
return Mt() ? t instanceof Node || t instanceof T(t).Node : !1;
|
|
1504
1550
|
}
|
|
1505
|
-
function
|
|
1506
|
-
return
|
|
1551
|
+
function D(t) {
|
|
1552
|
+
return Mt() ? t instanceof Element || t instanceof T(t).Element : !1;
|
|
1507
1553
|
}
|
|
1508
|
-
function
|
|
1509
|
-
return
|
|
1554
|
+
function I(t) {
|
|
1555
|
+
return Mt() ? t instanceof HTMLElement || t instanceof T(t).HTMLElement : !1;
|
|
1510
1556
|
}
|
|
1511
|
-
function
|
|
1512
|
-
return !
|
|
1557
|
+
function ne(t) {
|
|
1558
|
+
return !Mt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof T(t).ShadowRoot;
|
|
1513
1559
|
}
|
|
1514
|
-
function
|
|
1560
|
+
function kt(t) {
|
|
1515
1561
|
const {
|
|
1516
|
-
overflow:
|
|
1517
|
-
overflowX:
|
|
1518
|
-
overflowY:
|
|
1562
|
+
overflow: e,
|
|
1563
|
+
overflowX: i,
|
|
1564
|
+
overflowY: s,
|
|
1519
1565
|
display: n
|
|
1520
|
-
} =
|
|
1521
|
-
return /auto|scroll|overlay|hidden|clip/.test(
|
|
1566
|
+
} = M(t);
|
|
1567
|
+
return /auto|scroll|overlay|hidden|clip/.test(e + s + i) && !["inline", "contents"].includes(n);
|
|
1522
1568
|
}
|
|
1523
|
-
function
|
|
1524
|
-
return ["table", "td", "th"].includes(
|
|
1569
|
+
function Ai(t) {
|
|
1570
|
+
return ["table", "td", "th"].includes(mt(t));
|
|
1525
1571
|
}
|
|
1526
|
-
function
|
|
1527
|
-
return [":popover-open", ":modal"].some((
|
|
1572
|
+
function Ft(t) {
|
|
1573
|
+
return [":popover-open", ":modal"].some((e) => {
|
|
1528
1574
|
try {
|
|
1529
|
-
return t.matches(
|
|
1575
|
+
return t.matches(e);
|
|
1530
1576
|
} catch {
|
|
1531
1577
|
return !1;
|
|
1532
1578
|
}
|
|
1533
1579
|
});
|
|
1534
1580
|
}
|
|
1535
|
-
function
|
|
1536
|
-
const
|
|
1537
|
-
return
|
|
1581
|
+
function Zt(t) {
|
|
1582
|
+
const e = Qt(), i = D(t) ? M(t) : t;
|
|
1583
|
+
return i.transform !== "none" || i.perspective !== "none" || (i.containerType ? i.containerType !== "normal" : !1) || !e && (i.backdropFilter ? i.backdropFilter !== "none" : !1) || !e && (i.filter ? i.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((s) => (i.willChange || "").includes(s)) || ["paint", "layout", "strict", "content"].some((s) => (i.contain || "").includes(s));
|
|
1538
1584
|
}
|
|
1539
|
-
function
|
|
1540
|
-
let
|
|
1541
|
-
for (;
|
|
1542
|
-
if (
|
|
1543
|
-
return
|
|
1544
|
-
if (
|
|
1585
|
+
function ki(t) {
|
|
1586
|
+
let e = U(t);
|
|
1587
|
+
for (; I(e) && !gt(e); ) {
|
|
1588
|
+
if (Zt(e))
|
|
1589
|
+
return e;
|
|
1590
|
+
if (Ft(e))
|
|
1545
1591
|
return null;
|
|
1546
|
-
|
|
1592
|
+
e = U(e);
|
|
1547
1593
|
}
|
|
1548
1594
|
return null;
|
|
1549
1595
|
}
|
|
1550
|
-
function
|
|
1596
|
+
function Qt() {
|
|
1551
1597
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
1552
1598
|
}
|
|
1553
|
-
function
|
|
1554
|
-
return ["html", "body", "#document"].includes(
|
|
1599
|
+
function gt(t) {
|
|
1600
|
+
return ["html", "body", "#document"].includes(mt(t));
|
|
1555
1601
|
}
|
|
1556
|
-
function
|
|
1557
|
-
return
|
|
1602
|
+
function M(t) {
|
|
1603
|
+
return T(t).getComputedStyle(t);
|
|
1558
1604
|
}
|
|
1559
|
-
function
|
|
1560
|
-
return
|
|
1605
|
+
function It(t) {
|
|
1606
|
+
return D(t) ? {
|
|
1561
1607
|
scrollLeft: t.scrollLeft,
|
|
1562
1608
|
scrollTop: t.scrollTop
|
|
1563
1609
|
} : {
|
|
@@ -1565,556 +1611,461 @@ function Tt(t) {
|
|
|
1565
1611
|
scrollTop: t.scrollY
|
|
1566
1612
|
};
|
|
1567
1613
|
}
|
|
1568
|
-
function
|
|
1569
|
-
if (
|
|
1614
|
+
function U(t) {
|
|
1615
|
+
if (mt(t) === "html")
|
|
1570
1616
|
return t;
|
|
1571
|
-
const
|
|
1617
|
+
const e = (
|
|
1572
1618
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
1573
1619
|
t.assignedSlot || // DOM Element detected.
|
|
1574
1620
|
t.parentNode || // ShadowRoot detected.
|
|
1575
|
-
|
|
1576
|
-
|
|
1621
|
+
ne(t) && t.host || // Fallback.
|
|
1622
|
+
N(t)
|
|
1577
1623
|
);
|
|
1578
|
-
return
|
|
1624
|
+
return ne(e) ? e.host : e;
|
|
1579
1625
|
}
|
|
1580
1626
|
function $e(t) {
|
|
1581
|
-
const
|
|
1582
|
-
return
|
|
1627
|
+
const e = U(t);
|
|
1628
|
+
return gt(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : I(e) && kt(e) ? e : $e(e);
|
|
1583
1629
|
}
|
|
1584
|
-
function
|
|
1585
|
-
var
|
|
1586
|
-
|
|
1587
|
-
const n = $e(t), o = n === ((
|
|
1630
|
+
function vt(t, e, i) {
|
|
1631
|
+
var s;
|
|
1632
|
+
e === void 0 && (e = []), i === void 0 && (i = !0);
|
|
1633
|
+
const n = $e(t), o = n === ((s = t.ownerDocument) == null ? void 0 : s.body), r = T(n);
|
|
1588
1634
|
if (o) {
|
|
1589
|
-
const l =
|
|
1590
|
-
return
|
|
1635
|
+
const l = Wt(r);
|
|
1636
|
+
return e.concat(r, r.visualViewport || [], kt(n) ? n : [], l && i ? vt(l) : []);
|
|
1591
1637
|
}
|
|
1592
|
-
return
|
|
1638
|
+
return e.concat(n, vt(n, [], i));
|
|
1593
1639
|
}
|
|
1594
|
-
function
|
|
1640
|
+
function Wt(t) {
|
|
1595
1641
|
return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
|
|
1596
1642
|
}
|
|
1597
|
-
function
|
|
1598
|
-
const
|
|
1599
|
-
let
|
|
1600
|
-
const n =
|
|
1601
|
-
return l && (
|
|
1602
|
-
width:
|
|
1603
|
-
height:
|
|
1643
|
+
function Le(t) {
|
|
1644
|
+
const e = M(t);
|
|
1645
|
+
let i = parseFloat(e.width) || 0, s = parseFloat(e.height) || 0;
|
|
1646
|
+
const n = I(t), o = n ? t.offsetWidth : i, r = n ? t.offsetHeight : s, l = Lt(i) !== o || Lt(s) !== r;
|
|
1647
|
+
return l && (i = o, s = r), {
|
|
1648
|
+
width: i,
|
|
1649
|
+
height: s,
|
|
1604
1650
|
$: l
|
|
1605
1651
|
};
|
|
1606
1652
|
}
|
|
1607
|
-
function
|
|
1608
|
-
return
|
|
1653
|
+
function qt(t) {
|
|
1654
|
+
return D(t) ? t : t.contextElement;
|
|
1609
1655
|
}
|
|
1610
|
-
function
|
|
1611
|
-
const
|
|
1612
|
-
if (!
|
|
1613
|
-
return
|
|
1614
|
-
const
|
|
1615
|
-
width:
|
|
1656
|
+
function st(t) {
|
|
1657
|
+
const e = qt(t);
|
|
1658
|
+
if (!I(e))
|
|
1659
|
+
return W(1);
|
|
1660
|
+
const i = e.getBoundingClientRect(), {
|
|
1661
|
+
width: s,
|
|
1616
1662
|
height: n,
|
|
1617
1663
|
$: o
|
|
1618
|
-
} =
|
|
1619
|
-
let r = (o ?
|
|
1664
|
+
} = Le(e);
|
|
1665
|
+
let r = (o ? Lt(i.width) : i.width) / s, l = (o ? Lt(i.height) : i.height) / n;
|
|
1620
1666
|
return (!r || !Number.isFinite(r)) && (r = 1), (!l || !Number.isFinite(l)) && (l = 1), {
|
|
1621
1667
|
x: r,
|
|
1622
1668
|
y: l
|
|
1623
1669
|
};
|
|
1624
1670
|
}
|
|
1625
|
-
const $i = /* @__PURE__ */
|
|
1626
|
-
function
|
|
1627
|
-
const
|
|
1628
|
-
return !
|
|
1629
|
-
x:
|
|
1630
|
-
y:
|
|
1671
|
+
const $i = /* @__PURE__ */ W(0);
|
|
1672
|
+
function Oe(t) {
|
|
1673
|
+
const e = T(t);
|
|
1674
|
+
return !Qt() || !e.visualViewport ? $i : {
|
|
1675
|
+
x: e.visualViewport.offsetLeft,
|
|
1676
|
+
y: e.visualViewport.offsetTop
|
|
1631
1677
|
};
|
|
1632
1678
|
}
|
|
1633
|
-
function
|
|
1634
|
-
return
|
|
1679
|
+
function Li(t, e, i) {
|
|
1680
|
+
return e === void 0 && (e = !1), !i || e && i !== T(t) ? !1 : e;
|
|
1635
1681
|
}
|
|
1636
|
-
function
|
|
1637
|
-
|
|
1638
|
-
const n = t.getBoundingClientRect(), o =
|
|
1639
|
-
let r =
|
|
1640
|
-
|
|
1641
|
-
const l =
|
|
1642
|
-
let
|
|
1682
|
+
function tt(t, e, i, s) {
|
|
1683
|
+
e === void 0 && (e = !1), i === void 0 && (i = !1);
|
|
1684
|
+
const n = t.getBoundingClientRect(), o = qt(t);
|
|
1685
|
+
let r = W(1);
|
|
1686
|
+
e && (s ? D(s) && (r = st(s)) : r = st(t));
|
|
1687
|
+
const l = Li(o, i, s) ? Oe(o) : W(0);
|
|
1688
|
+
let a = (n.left + l.x) / r.x, c = (n.top + l.y) / r.y, d = n.width / r.x, u = n.height / r.y;
|
|
1643
1689
|
if (o) {
|
|
1644
|
-
const
|
|
1645
|
-
let
|
|
1646
|
-
for (; m &&
|
|
1647
|
-
const
|
|
1648
|
-
|
|
1690
|
+
const h = T(o), f = s && D(s) ? T(s) : s;
|
|
1691
|
+
let g = h, m = Wt(g);
|
|
1692
|
+
for (; m && s && f !== g; ) {
|
|
1693
|
+
const b = st(m), p = m.getBoundingClientRect(), y = M(m), x = p.left + (m.clientLeft + parseFloat(y.paddingLeft)) * b.x, S = p.top + (m.clientTop + parseFloat(y.paddingTop)) * b.y;
|
|
1694
|
+
a *= b.x, c *= b.y, d *= b.x, u *= b.y, a += x, c += S, g = T(m), m = Wt(g);
|
|
1649
1695
|
}
|
|
1650
1696
|
}
|
|
1651
|
-
return
|
|
1697
|
+
return Tt({
|
|
1652
1698
|
width: d,
|
|
1653
1699
|
height: u,
|
|
1654
|
-
x:
|
|
1655
|
-
y:
|
|
1700
|
+
x: a,
|
|
1701
|
+
y: c
|
|
1656
1702
|
});
|
|
1657
1703
|
}
|
|
1658
|
-
function
|
|
1704
|
+
function Oi(t) {
|
|
1659
1705
|
let {
|
|
1660
|
-
elements:
|
|
1661
|
-
rect:
|
|
1662
|
-
offsetParent:
|
|
1706
|
+
elements: e,
|
|
1707
|
+
rect: i,
|
|
1708
|
+
offsetParent: s,
|
|
1663
1709
|
strategy: n
|
|
1664
1710
|
} = t;
|
|
1665
|
-
const o = n === "fixed", r =
|
|
1666
|
-
if (
|
|
1667
|
-
return
|
|
1668
|
-
let
|
|
1711
|
+
const o = n === "fixed", r = N(s), l = e ? Ft(e.floating) : !1;
|
|
1712
|
+
if (s === r || l && o)
|
|
1713
|
+
return i;
|
|
1714
|
+
let a = {
|
|
1669
1715
|
scrollLeft: 0,
|
|
1670
1716
|
scrollTop: 0
|
|
1671
|
-
},
|
|
1672
|
-
const d =
|
|
1673
|
-
if ((u || !u && !o) && ((
|
|
1674
|
-
const
|
|
1675
|
-
|
|
1717
|
+
}, c = W(1);
|
|
1718
|
+
const d = W(0), u = I(s);
|
|
1719
|
+
if ((u || !u && !o) && ((mt(s) !== "body" || kt(r)) && (a = It(s)), I(s))) {
|
|
1720
|
+
const h = tt(s);
|
|
1721
|
+
c = st(s), d.x = h.x + s.clientLeft, d.y = h.y + s.clientTop;
|
|
1676
1722
|
}
|
|
1677
1723
|
return {
|
|
1678
|
-
width:
|
|
1679
|
-
height:
|
|
1680
|
-
x:
|
|
1681
|
-
y:
|
|
1724
|
+
width: i.width * c.x,
|
|
1725
|
+
height: i.height * c.y,
|
|
1726
|
+
x: i.x * c.x - a.scrollLeft * c.x + d.x,
|
|
1727
|
+
y: i.y * c.y - a.scrollTop * c.y + d.y
|
|
1682
1728
|
};
|
|
1683
1729
|
}
|
|
1684
|
-
function
|
|
1730
|
+
function Ti(t) {
|
|
1685
1731
|
return Array.from(t.getClientRects());
|
|
1686
1732
|
}
|
|
1687
|
-
function
|
|
1688
|
-
const
|
|
1689
|
-
return
|
|
1733
|
+
function jt(t, e) {
|
|
1734
|
+
const i = It(t).scrollLeft;
|
|
1735
|
+
return e ? e.left + i : tt(N(t)).left + i;
|
|
1690
1736
|
}
|
|
1691
|
-
function
|
|
1692
|
-
const
|
|
1693
|
-
let r = -
|
|
1694
|
-
const l = -
|
|
1695
|
-
return
|
|
1737
|
+
function Ri(t) {
|
|
1738
|
+
const e = N(t), i = It(t), s = t.ownerDocument.body, n = Z(e.scrollWidth, e.clientWidth, s.scrollWidth, s.clientWidth), o = Z(e.scrollHeight, e.clientHeight, s.scrollHeight, s.clientHeight);
|
|
1739
|
+
let r = -i.scrollLeft + jt(t);
|
|
1740
|
+
const l = -i.scrollTop;
|
|
1741
|
+
return M(s).direction === "rtl" && (r += Z(e.clientWidth, s.clientWidth) - n), {
|
|
1696
1742
|
width: n,
|
|
1697
1743
|
height: o,
|
|
1698
1744
|
x: r,
|
|
1699
1745
|
y: l
|
|
1700
1746
|
};
|
|
1701
1747
|
}
|
|
1702
|
-
function
|
|
1703
|
-
const
|
|
1704
|
-
let o =
|
|
1748
|
+
function Pi(t, e) {
|
|
1749
|
+
const i = T(t), s = N(t), n = i.visualViewport;
|
|
1750
|
+
let o = s.clientWidth, r = s.clientHeight, l = 0, a = 0;
|
|
1705
1751
|
if (n) {
|
|
1706
1752
|
o = n.width, r = n.height;
|
|
1707
|
-
const
|
|
1708
|
-
(!
|
|
1753
|
+
const c = Qt();
|
|
1754
|
+
(!c || c && e === "fixed") && (l = n.offsetLeft, a = n.offsetTop);
|
|
1709
1755
|
}
|
|
1710
1756
|
return {
|
|
1711
1757
|
width: o,
|
|
1712
1758
|
height: r,
|
|
1713
1759
|
x: l,
|
|
1714
|
-
y:
|
|
1760
|
+
y: a
|
|
1715
1761
|
};
|
|
1716
1762
|
}
|
|
1717
|
-
function
|
|
1718
|
-
const
|
|
1763
|
+
function Di(t, e) {
|
|
1764
|
+
const i = tt(t, !0, e === "fixed"), s = i.top + t.clientTop, n = i.left + t.clientLeft, o = I(t) ? st(t) : W(1), r = t.clientWidth * o.x, l = t.clientHeight * o.y, a = n * o.x, c = s * o.y;
|
|
1719
1765
|
return {
|
|
1720
1766
|
width: r,
|
|
1721
1767
|
height: l,
|
|
1722
|
-
x:
|
|
1723
|
-
y:
|
|
1768
|
+
x: a,
|
|
1769
|
+
y: c
|
|
1724
1770
|
};
|
|
1725
1771
|
}
|
|
1726
|
-
function
|
|
1727
|
-
let
|
|
1728
|
-
if (
|
|
1729
|
-
|
|
1730
|
-
else if (
|
|
1731
|
-
|
|
1732
|
-
else if (
|
|
1733
|
-
|
|
1772
|
+
function oe(t, e, i) {
|
|
1773
|
+
let s;
|
|
1774
|
+
if (e === "viewport")
|
|
1775
|
+
s = Pi(t, i);
|
|
1776
|
+
else if (e === "document")
|
|
1777
|
+
s = Ri(N(t));
|
|
1778
|
+
else if (D(e))
|
|
1779
|
+
s = Di(e, i);
|
|
1734
1780
|
else {
|
|
1735
|
-
const n =
|
|
1736
|
-
|
|
1737
|
-
...
|
|
1738
|
-
x:
|
|
1739
|
-
y:
|
|
1781
|
+
const n = Oe(t);
|
|
1782
|
+
s = {
|
|
1783
|
+
...e,
|
|
1784
|
+
x: e.x - n.x,
|
|
1785
|
+
y: e.y - n.y
|
|
1740
1786
|
};
|
|
1741
1787
|
}
|
|
1742
|
-
return
|
|
1788
|
+
return Tt(s);
|
|
1743
1789
|
}
|
|
1744
|
-
function
|
|
1745
|
-
const
|
|
1746
|
-
return
|
|
1790
|
+
function Te(t, e) {
|
|
1791
|
+
const i = U(t);
|
|
1792
|
+
return i === e || !D(i) || gt(i) ? !1 : M(i).position === "fixed" || Te(i, e);
|
|
1747
1793
|
}
|
|
1748
|
-
function Mi(t,
|
|
1749
|
-
const
|
|
1750
|
-
if (
|
|
1751
|
-
return
|
|
1752
|
-
let
|
|
1753
|
-
const o =
|
|
1754
|
-
let r = o ?
|
|
1755
|
-
for (;
|
|
1756
|
-
const l =
|
|
1757
|
-
!
|
|
1794
|
+
function Mi(t, e) {
|
|
1795
|
+
const i = e.get(t);
|
|
1796
|
+
if (i)
|
|
1797
|
+
return i;
|
|
1798
|
+
let s = vt(t, [], !1).filter((l) => D(l) && mt(l) !== "body"), n = null;
|
|
1799
|
+
const o = M(t).position === "fixed";
|
|
1800
|
+
let r = o ? U(t) : t;
|
|
1801
|
+
for (; D(r) && !gt(r); ) {
|
|
1802
|
+
const l = M(r), a = Zt(r);
|
|
1803
|
+
!a && l.position === "fixed" && (n = null), (o ? !a && !n : !a && l.position === "static" && !!n && ["absolute", "fixed"].includes(n.position) || kt(r) && !a && Te(t, r)) ? s = s.filter((d) => d !== r) : n = l, r = U(r);
|
|
1758
1804
|
}
|
|
1759
|
-
return
|
|
1805
|
+
return e.set(t, s), s;
|
|
1760
1806
|
}
|
|
1761
|
-
function
|
|
1807
|
+
function Fi(t) {
|
|
1762
1808
|
let {
|
|
1763
|
-
element:
|
|
1764
|
-
boundary:
|
|
1765
|
-
rootBoundary:
|
|
1809
|
+
element: e,
|
|
1810
|
+
boundary: i,
|
|
1811
|
+
rootBoundary: s,
|
|
1766
1812
|
strategy: n
|
|
1767
1813
|
} = t;
|
|
1768
|
-
const r = [...
|
|
1769
|
-
const u =
|
|
1770
|
-
return
|
|
1771
|
-
},
|
|
1814
|
+
const r = [...i === "clippingAncestors" ? Ft(e) ? [] : Mi(e, this._c) : [].concat(i), s], l = r[0], a = r.reduce((c, d) => {
|
|
1815
|
+
const u = oe(e, d, n);
|
|
1816
|
+
return c.top = Z(u.top, c.top), c.right = ht(u.right, c.right), c.bottom = ht(u.bottom, c.bottom), c.left = Z(u.left, c.left), c;
|
|
1817
|
+
}, oe(e, l, n));
|
|
1772
1818
|
return {
|
|
1773
|
-
width:
|
|
1774
|
-
height:
|
|
1775
|
-
x:
|
|
1776
|
-
y:
|
|
1819
|
+
width: a.right - a.left,
|
|
1820
|
+
height: a.bottom - a.top,
|
|
1821
|
+
x: a.left,
|
|
1822
|
+
y: a.top
|
|
1777
1823
|
};
|
|
1778
1824
|
}
|
|
1779
|
-
function
|
|
1825
|
+
function Ii(t) {
|
|
1780
1826
|
const {
|
|
1781
|
-
width:
|
|
1782
|
-
height:
|
|
1783
|
-
} =
|
|
1827
|
+
width: e,
|
|
1828
|
+
height: i
|
|
1829
|
+
} = Le(t);
|
|
1784
1830
|
return {
|
|
1785
|
-
width:
|
|
1786
|
-
height:
|
|
1831
|
+
width: e,
|
|
1832
|
+
height: i
|
|
1787
1833
|
};
|
|
1788
1834
|
}
|
|
1789
|
-
function Ni(t,
|
|
1790
|
-
const
|
|
1835
|
+
function Ni(t, e, i) {
|
|
1836
|
+
const s = I(e), n = N(e), o = i === "fixed", r = tt(t, !0, o, e);
|
|
1791
1837
|
let l = {
|
|
1792
1838
|
scrollLeft: 0,
|
|
1793
1839
|
scrollTop: 0
|
|
1794
1840
|
};
|
|
1795
|
-
const
|
|
1796
|
-
if (
|
|
1797
|
-
if ((
|
|
1798
|
-
const f =
|
|
1799
|
-
|
|
1800
|
-
} else n && (
|
|
1801
|
-
let
|
|
1802
|
-
if (n && !
|
|
1841
|
+
const a = W(0);
|
|
1842
|
+
if (s || !s && !o)
|
|
1843
|
+
if ((mt(e) !== "body" || kt(n)) && (l = It(e)), s) {
|
|
1844
|
+
const f = tt(e, !0, o, e);
|
|
1845
|
+
a.x = f.x + e.clientLeft, a.y = f.y + e.clientTop;
|
|
1846
|
+
} else n && (a.x = jt(n));
|
|
1847
|
+
let c = 0, d = 0;
|
|
1848
|
+
if (n && !s && !o) {
|
|
1803
1849
|
const f = n.getBoundingClientRect();
|
|
1804
|
-
d = f.top + l.scrollTop,
|
|
1805
|
-
|
|
1850
|
+
d = f.top + l.scrollTop, c = f.left + l.scrollLeft - // RTL <body> scrollbar.
|
|
1851
|
+
jt(n, f);
|
|
1806
1852
|
}
|
|
1807
|
-
const u = r.left + l.scrollLeft -
|
|
1853
|
+
const u = r.left + l.scrollLeft - a.x - c, h = r.top + l.scrollTop - a.y - d;
|
|
1808
1854
|
return {
|
|
1809
1855
|
x: u,
|
|
1810
|
-
y:
|
|
1856
|
+
y: h,
|
|
1811
1857
|
width: r.width,
|
|
1812
1858
|
height: r.height
|
|
1813
1859
|
};
|
|
1814
1860
|
}
|
|
1815
|
-
function
|
|
1816
|
-
return
|
|
1861
|
+
function Bt(t) {
|
|
1862
|
+
return M(t).position === "static";
|
|
1817
1863
|
}
|
|
1818
|
-
function
|
|
1819
|
-
if (!
|
|
1864
|
+
function re(t, e) {
|
|
1865
|
+
if (!I(t) || M(t).position === "fixed")
|
|
1820
1866
|
return null;
|
|
1821
|
-
if (
|
|
1822
|
-
return
|
|
1823
|
-
let
|
|
1824
|
-
return
|
|
1867
|
+
if (e)
|
|
1868
|
+
return e(t);
|
|
1869
|
+
let i = t.offsetParent;
|
|
1870
|
+
return N(t) === i && (i = i.ownerDocument.body), i;
|
|
1825
1871
|
}
|
|
1826
|
-
function
|
|
1827
|
-
const
|
|
1828
|
-
if (
|
|
1829
|
-
return
|
|
1830
|
-
if (!
|
|
1831
|
-
let n =
|
|
1832
|
-
for (; n && !
|
|
1833
|
-
if (
|
|
1872
|
+
function Re(t, e) {
|
|
1873
|
+
const i = T(t);
|
|
1874
|
+
if (Ft(t))
|
|
1875
|
+
return i;
|
|
1876
|
+
if (!I(t)) {
|
|
1877
|
+
let n = U(t);
|
|
1878
|
+
for (; n && !gt(n); ) {
|
|
1879
|
+
if (D(n) && !Bt(n))
|
|
1834
1880
|
return n;
|
|
1835
|
-
n =
|
|
1881
|
+
n = U(n);
|
|
1836
1882
|
}
|
|
1837
|
-
return
|
|
1883
|
+
return i;
|
|
1838
1884
|
}
|
|
1839
|
-
let
|
|
1840
|
-
for (;
|
|
1841
|
-
|
|
1842
|
-
return
|
|
1885
|
+
let s = re(t, e);
|
|
1886
|
+
for (; s && Ai(s) && Bt(s); )
|
|
1887
|
+
s = re(s, e);
|
|
1888
|
+
return s && gt(s) && Bt(s) && !Zt(s) ? i : s || ki(t) || i;
|
|
1843
1889
|
}
|
|
1844
|
-
const
|
|
1845
|
-
const
|
|
1890
|
+
const Bi = async function(t) {
|
|
1891
|
+
const e = this.getOffsetParent || Re, i = this.getDimensions, s = await i(t.floating);
|
|
1846
1892
|
return {
|
|
1847
|
-
reference: Ni(t.reference, await
|
|
1893
|
+
reference: Ni(t.reference, await e(t.floating), t.strategy),
|
|
1848
1894
|
floating: {
|
|
1849
1895
|
x: 0,
|
|
1850
1896
|
y: 0,
|
|
1851
|
-
width:
|
|
1852
|
-
height:
|
|
1897
|
+
width: s.width,
|
|
1898
|
+
height: s.height
|
|
1853
1899
|
}
|
|
1854
1900
|
};
|
|
1855
1901
|
};
|
|
1856
|
-
function
|
|
1857
|
-
return
|
|
1858
|
-
}
|
|
1859
|
-
const
|
|
1860
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
1861
|
-
getDocumentElement:
|
|
1862
|
-
getClippingRect:
|
|
1863
|
-
getOffsetParent:
|
|
1864
|
-
getElementRects:
|
|
1865
|
-
getClientRects:
|
|
1866
|
-
getDimensions:
|
|
1867
|
-
getScale:
|
|
1868
|
-
isElement:
|
|
1869
|
-
isRTL:
|
|
1902
|
+
function Vi(t) {
|
|
1903
|
+
return M(t).direction === "rtl";
|
|
1904
|
+
}
|
|
1905
|
+
const Hi = {
|
|
1906
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Oi,
|
|
1907
|
+
getDocumentElement: N,
|
|
1908
|
+
getClippingRect: Fi,
|
|
1909
|
+
getOffsetParent: Re,
|
|
1910
|
+
getElementRects: Bi,
|
|
1911
|
+
getClientRects: Ti,
|
|
1912
|
+
getDimensions: Ii,
|
|
1913
|
+
getScale: st,
|
|
1914
|
+
isElement: D,
|
|
1915
|
+
isRTL: Vi
|
|
1870
1916
|
};
|
|
1871
|
-
function
|
|
1872
|
-
let
|
|
1873
|
-
const n =
|
|
1917
|
+
function _i(t, e) {
|
|
1918
|
+
let i = null, s;
|
|
1919
|
+
const n = N(t);
|
|
1874
1920
|
function o() {
|
|
1875
1921
|
var l;
|
|
1876
|
-
clearTimeout(
|
|
1922
|
+
clearTimeout(s), (l = i) == null || l.disconnect(), i = null;
|
|
1877
1923
|
}
|
|
1878
|
-
function r(l,
|
|
1879
|
-
l === void 0 && (l = !1),
|
|
1924
|
+
function r(l, a) {
|
|
1925
|
+
l === void 0 && (l = !1), a === void 0 && (a = 1), o();
|
|
1880
1926
|
const {
|
|
1881
|
-
left:
|
|
1927
|
+
left: c,
|
|
1882
1928
|
top: d,
|
|
1883
1929
|
width: u,
|
|
1884
|
-
height:
|
|
1930
|
+
height: h
|
|
1885
1931
|
} = t.getBoundingClientRect();
|
|
1886
|
-
if (l ||
|
|
1932
|
+
if (l || e(), !u || !h)
|
|
1887
1933
|
return;
|
|
1888
|
-
const f =
|
|
1889
|
-
rootMargin: -f + "px " + -
|
|
1890
|
-
threshold:
|
|
1934
|
+
const f = $t(d), g = $t(n.clientWidth - (c + u)), m = $t(n.clientHeight - (d + h)), b = $t(c), y = {
|
|
1935
|
+
rootMargin: -f + "px " + -g + "px " + -m + "px " + -b + "px",
|
|
1936
|
+
threshold: Z(0, ht(1, a)) || 1
|
|
1891
1937
|
};
|
|
1892
|
-
let
|
|
1893
|
-
function
|
|
1894
|
-
const
|
|
1895
|
-
if (
|
|
1896
|
-
if (!
|
|
1938
|
+
let x = !0;
|
|
1939
|
+
function S(v) {
|
|
1940
|
+
const $ = v[0].intersectionRatio;
|
|
1941
|
+
if ($ !== a) {
|
|
1942
|
+
if (!x)
|
|
1897
1943
|
return r();
|
|
1898
|
-
|
|
1944
|
+
$ ? r(!1, $) : s = setTimeout(() => {
|
|
1899
1945
|
r(!1, 1e-7);
|
|
1900
1946
|
}, 1e3);
|
|
1901
1947
|
}
|
|
1902
|
-
|
|
1948
|
+
x = !1;
|
|
1903
1949
|
}
|
|
1904
1950
|
try {
|
|
1905
|
-
|
|
1906
|
-
...
|
|
1951
|
+
i = new IntersectionObserver(S, {
|
|
1952
|
+
...y,
|
|
1907
1953
|
// Handle <iframe>s
|
|
1908
1954
|
root: n.ownerDocument
|
|
1909
1955
|
});
|
|
1910
1956
|
} catch {
|
|
1911
|
-
|
|
1957
|
+
i = new IntersectionObserver(S, y);
|
|
1912
1958
|
}
|
|
1913
|
-
|
|
1959
|
+
i.observe(t);
|
|
1914
1960
|
}
|
|
1915
1961
|
return r(!0), o;
|
|
1916
1962
|
}
|
|
1917
|
-
function
|
|
1918
|
-
|
|
1963
|
+
function zi(t, e, i, s) {
|
|
1964
|
+
s === void 0 && (s = {});
|
|
1919
1965
|
const {
|
|
1920
1966
|
ancestorScroll: n = !0,
|
|
1921
1967
|
ancestorResize: o = !0,
|
|
1922
1968
|
elementResize: r = typeof ResizeObserver == "function",
|
|
1923
1969
|
layoutShift: l = typeof IntersectionObserver == "function",
|
|
1924
|
-
animationFrame:
|
|
1925
|
-
} =
|
|
1970
|
+
animationFrame: a = !1
|
|
1971
|
+
} = s, c = qt(t), d = n || o ? [...c ? vt(c) : [], ...vt(e)] : [];
|
|
1926
1972
|
d.forEach((p) => {
|
|
1927
|
-
n && p.addEventListener("scroll",
|
|
1973
|
+
n && p.addEventListener("scroll", i, {
|
|
1928
1974
|
passive: !0
|
|
1929
|
-
}), o && p.addEventListener("resize",
|
|
1975
|
+
}), o && p.addEventListener("resize", i);
|
|
1930
1976
|
});
|
|
1931
|
-
const u =
|
|
1932
|
-
let
|
|
1977
|
+
const u = c && l ? _i(c, i) : null;
|
|
1978
|
+
let h = -1, f = null;
|
|
1933
1979
|
r && (f = new ResizeObserver((p) => {
|
|
1934
|
-
let [
|
|
1935
|
-
|
|
1936
|
-
var
|
|
1937
|
-
(
|
|
1938
|
-
})),
|
|
1939
|
-
}),
|
|
1940
|
-
let
|
|
1941
|
-
|
|
1942
|
-
function
|
|
1943
|
-
const p =
|
|
1944
|
-
m && (p.x !== m.x || p.y !== m.y || p.width !== m.width || p.height !== m.height) &&
|
|
1945
|
-
}
|
|
1946
|
-
return
|
|
1980
|
+
let [y] = p;
|
|
1981
|
+
y && y.target === c && f && (f.unobserve(e), cancelAnimationFrame(h), h = requestAnimationFrame(() => {
|
|
1982
|
+
var x;
|
|
1983
|
+
(x = f) == null || x.observe(e);
|
|
1984
|
+
})), i();
|
|
1985
|
+
}), c && !a && f.observe(c), f.observe(e));
|
|
1986
|
+
let g, m = a ? tt(t) : null;
|
|
1987
|
+
a && b();
|
|
1988
|
+
function b() {
|
|
1989
|
+
const p = tt(t);
|
|
1990
|
+
m && (p.x !== m.x || p.y !== m.y || p.width !== m.width || p.height !== m.height) && i(), m = p, g = requestAnimationFrame(b);
|
|
1991
|
+
}
|
|
1992
|
+
return i(), () => {
|
|
1947
1993
|
var p;
|
|
1948
|
-
d.forEach((
|
|
1949
|
-
n &&
|
|
1950
|
-
}), u == null || u(), (p = f) == null || p.disconnect(), f = null,
|
|
1994
|
+
d.forEach((y) => {
|
|
1995
|
+
n && y.removeEventListener("scroll", i), o && y.removeEventListener("resize", i);
|
|
1996
|
+
}), u == null || u(), (p = f) == null || p.disconnect(), f = null, a && cancelAnimationFrame(g);
|
|
1951
1997
|
};
|
|
1952
1998
|
}
|
|
1953
|
-
const
|
|
1954
|
-
const
|
|
1955
|
-
platform:
|
|
1956
|
-
...
|
|
1999
|
+
const Wi = Si, ji = Ei, Ui = xi, Ki = yi, Xi = Ci, Yi = (t, e, i) => {
|
|
2000
|
+
const s = /* @__PURE__ */ new Map(), n = {
|
|
2001
|
+
platform: Hi,
|
|
2002
|
+
...i
|
|
1957
2003
|
}, o = {
|
|
1958
2004
|
...n.platform,
|
|
1959
|
-
_c:
|
|
2005
|
+
_c: s
|
|
1960
2006
|
};
|
|
1961
|
-
return bi(t,
|
|
2007
|
+
return bi(t, e, {
|
|
1962
2008
|
...n,
|
|
1963
2009
|
platform: o
|
|
1964
2010
|
});
|
|
1965
2011
|
};
|
|
1966
|
-
async function
|
|
1967
|
-
const
|
|
1968
|
-
|
|
1969
|
-
const
|
|
1970
|
-
return
|
|
1971
|
-
|
|
1972
|
-
placement:
|
|
2012
|
+
async function Gi(t) {
|
|
2013
|
+
const e = xe.call(this, t);
|
|
2014
|
+
e.el.inert = !1, e.el.classList.add(this.settings.stateActive), e.isTooltip || e.trigger.setAttribute("aria-expanded", "true"), e.getCustomProps();
|
|
2015
|
+
const i = si(e), s = e.el.querySelector(i.arrow.element);
|
|
2016
|
+
return i.arrow.element = s || void 0, e.floatingCleanup = zi(e.trigger, e.el, () => {
|
|
2017
|
+
Yi(e.trigger, e.el, {
|
|
2018
|
+
placement: e.getSetting("placement"),
|
|
1973
2019
|
middleware: [
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
2020
|
+
Ui(i.flip),
|
|
2021
|
+
ji({ ...i.shift, limiter: Xi() }),
|
|
2022
|
+
Wi(i.offset),
|
|
2023
|
+
Ki(i.arrow)
|
|
1978
2024
|
]
|
|
1979
2025
|
}).then(({ x: n, y: o, placement: r, middlewareData: l }) => {
|
|
1980
|
-
if (
|
|
1981
|
-
if (
|
|
1982
|
-
const { x:
|
|
1983
|
-
|
|
2026
|
+
if (e.el) {
|
|
2027
|
+
if (ie(e.el, n, o), i.arrow.element && l.arrow) {
|
|
2028
|
+
const { x: a, y: c } = l.arrow;
|
|
2029
|
+
ie(i.arrow.element, a, c);
|
|
1984
2030
|
}
|
|
1985
|
-
|
|
2031
|
+
e.el.setAttribute("data-floating-placement", r);
|
|
1986
2032
|
}
|
|
1987
2033
|
});
|
|
1988
|
-
}),
|
|
1989
|
-
}
|
|
1990
|
-
async function Ji(t, s, e = {}) {
|
|
1991
|
-
await _t.call(this, t);
|
|
1992
|
-
const i = this, n = {
|
|
1993
|
-
el: !1,
|
|
1994
|
-
trigger: !1
|
|
1995
|
-
}, o = [
|
|
1996
|
-
"placement",
|
|
1997
|
-
"event",
|
|
1998
|
-
"offset",
|
|
1999
|
-
"flip-padding",
|
|
2000
|
-
"shift-padding",
|
|
2001
|
-
"arrow-padding",
|
|
2002
|
-
"toggle-delay"
|
|
2003
|
-
], r = this.createEntry(t, { customPropKeys: o });
|
|
2004
|
-
return Object.assign(r, {
|
|
2005
|
-
state: "closed",
|
|
2006
|
-
trigger: s,
|
|
2007
|
-
toggleDelayId: null,
|
|
2008
|
-
cleanup: () => {
|
|
2009
|
-
},
|
|
2010
|
-
open() {
|
|
2011
|
-
return De.call(i, this);
|
|
2012
|
-
},
|
|
2013
|
-
close() {
|
|
2014
|
-
return Jt.call(i, this);
|
|
2015
|
-
},
|
|
2016
|
-
deregister() {
|
|
2017
|
-
return _t.call(i, this);
|
|
2018
|
-
}
|
|
2019
|
-
}), Object.defineProperties(r, Object.getOwnPropertyDescriptors({
|
|
2020
|
-
set isHovered(l) {
|
|
2021
|
-
const c = l.type == "mouseenter" ? !0 : l.type == "mouseleave" ? !1 : void 0;
|
|
2022
|
-
if (c != null)
|
|
2023
|
-
switch (l.target) {
|
|
2024
|
-
case this.el:
|
|
2025
|
-
n.el = c;
|
|
2026
|
-
break;
|
|
2027
|
-
case this.trigger:
|
|
2028
|
-
n.trigger = c;
|
|
2029
|
-
break;
|
|
2030
|
-
}
|
|
2031
|
-
},
|
|
2032
|
-
get isHovered() {
|
|
2033
|
-
return n.el || n.trigger;
|
|
2034
|
-
},
|
|
2035
|
-
get isTooltip() {
|
|
2036
|
-
return !!t.closest(i.settings.selectorTooltip) || t.getAttribute("role") == "tooltip";
|
|
2037
|
-
}
|
|
2038
|
-
})), r.isTooltip && (r.settings.event = "hover"), r.applySettings(e), r.getDataConfig(), r.getCustomProps(), r.isTooltip && r.el.setAttribute("role", "tooltip"), r.isTooltip || r.trigger.setAttribute("aria-expanded", "false"), Re.call(this, r), r.getSetting("teleport") && r.teleport(), this.collection.push(r), r.el.classList.contains(this.settings.stateActive) ? (await r.open(), Ee.call(this, r)) : r.el.inert = !0, r;
|
|
2039
|
-
}
|
|
2040
|
-
function Re(t) {
|
|
2041
|
-
return t._eventListeners || (t.getSetting("event") === "hover" ? (t._eventListeners = [{
|
|
2042
|
-
el: ["el", "trigger"],
|
|
2043
|
-
type: ["mouseenter", "focus"],
|
|
2044
|
-
listener: ci.bind(this, t)
|
|
2045
|
-
}, {
|
|
2046
|
-
el: ["el", "trigger"],
|
|
2047
|
-
type: ["mouseleave", "focusout"],
|
|
2048
|
-
listener: ai.bind(this, t)
|
|
2049
|
-
}, {
|
|
2050
|
-
el: ["trigger"],
|
|
2051
|
-
type: ["click"],
|
|
2052
|
-
listener: li.bind(this, t)
|
|
2053
|
-
}], t._eventListeners.forEach((e) => {
|
|
2054
|
-
e.el.forEach((i) => {
|
|
2055
|
-
e.type.forEach((n) => {
|
|
2056
|
-
t[i].addEventListener(n, e.listener, !1);
|
|
2057
|
-
});
|
|
2058
|
-
});
|
|
2059
|
-
})) : (t._eventListeners = [{
|
|
2060
|
-
el: ["trigger"],
|
|
2061
|
-
type: ["click"],
|
|
2062
|
-
listener: ri.bind(this, t)
|
|
2063
|
-
}], t._eventListeners.forEach((e) => {
|
|
2064
|
-
e.el.forEach((i) => {
|
|
2065
|
-
e.type.forEach((n) => {
|
|
2066
|
-
t[i].addEventListener(n, e.listener, !1);
|
|
2067
|
-
});
|
|
2068
|
-
});
|
|
2069
|
-
}))), t;
|
|
2034
|
+
}), e.state = "opened", e.getSetting("event") === "click" && ci.call(this, e), e;
|
|
2070
2035
|
}
|
|
2071
|
-
var
|
|
2072
|
-
class ts extends
|
|
2073
|
-
constructor(
|
|
2074
|
-
super({ ...ii, ...
|
|
2075
|
-
|
|
2076
|
-
this.trigger = null,
|
|
2036
|
+
var dt;
|
|
2037
|
+
class ts extends Pt {
|
|
2038
|
+
constructor(i = {}) {
|
|
2039
|
+
super({ ...ii, ...i });
|
|
2040
|
+
k(this, dt);
|
|
2041
|
+
this.trigger = null, E(this, dt, ai.bind(this));
|
|
2077
2042
|
}
|
|
2078
2043
|
get active() {
|
|
2079
|
-
return this.
|
|
2044
|
+
return this.get("opened", "state");
|
|
2080
2045
|
}
|
|
2081
2046
|
get activeHover() {
|
|
2082
|
-
return this.collection.find((
|
|
2083
|
-
}
|
|
2084
|
-
async mount(e) {
|
|
2085
|
-
e && (this.settings = { ...this.settings, ...e });
|
|
2086
|
-
const i = document.querySelectorAll(this.settings.selectorPopover);
|
|
2087
|
-
return await this.registerCollection(i), this.settings.eventListeners && this.mountEventListeners(!1), this;
|
|
2088
|
-
}
|
|
2089
|
-
async unmount() {
|
|
2090
|
-
return this.trigger = null, await this.deregisterCollection(), this.settings.eventListeners && this.unmountEventListeners(!1), this;
|
|
2047
|
+
return this.collection.find((i) => i.state == "opened" && i.getSetting("event") == "hover");
|
|
2091
2048
|
}
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
Re.call(this, i);
|
|
2095
|
-
}), document.addEventListener("keydown", y(this, rt), !1);
|
|
2049
|
+
async createEntry(i, s) {
|
|
2050
|
+
return new fi(this, i, s);
|
|
2096
2051
|
}
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
Se(i);
|
|
2100
|
-
}), document.removeEventListener("keydown", y(this, rt), !1);
|
|
2052
|
+
async open(i) {
|
|
2053
|
+
return Gi.call(this, i);
|
|
2101
2054
|
}
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
return n.error ? Promise.reject(n.error) : Ji.call(this, n.popover, n.trigger, i);
|
|
2055
|
+
async close(i) {
|
|
2056
|
+
return ve.call(this, i);
|
|
2105
2057
|
}
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
return i ? _t.call(this, i) : Promise.reject(new Error(`Failed to deregister; popover does not exist in collection with ID of: "${e.id || e}".`));
|
|
2058
|
+
async afterMount() {
|
|
2059
|
+
document.addEventListener("keydown", w(this, dt), !1);
|
|
2109
2060
|
}
|
|
2110
|
-
|
|
2111
|
-
|
|
2061
|
+
async beforeUnmount() {
|
|
2062
|
+
this.trigger = null;
|
|
2112
2063
|
}
|
|
2113
|
-
|
|
2114
|
-
|
|
2064
|
+
async afterUnmount() {
|
|
2065
|
+
document.removeEventListener("keydown", w(this, dt), !1);
|
|
2115
2066
|
}
|
|
2116
2067
|
}
|
|
2117
|
-
|
|
2068
|
+
dt = new WeakMap();
|
|
2118
2069
|
export {
|
|
2119
2070
|
Qi as Drawer,
|
|
2120
2071
|
qi as Modal,
|