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