vrembem 4.0.0-next.32 → 4.0.0-next.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dev/index.js CHANGED
@@ -1,19 +1,19 @@
1
- const u$2 = ":not([inert])", f = ':not([tabindex^="-"])', m$2 = ":not(:disabled)", k$3 = [
2
- `a[href]${u$2}${f}`,
3
- `area[href]${u$2}${f}`,
4
- `input:not([type="hidden"]):not([type="radio"])${u$2}${f}${m$2}`,
5
- `input[type="radio"]${u$2}${f}${m$2}`,
6
- `select${u$2}${f}${m$2}`,
7
- `textarea${u$2}${f}${m$2}`,
8
- `button${u$2}${f}${m$2}`,
9
- `details${u$2} > summary:first-of-type${f}`,
10
- `iframe${u$2}${f}`,
11
- `audio[controls]${u$2}${f}`,
12
- `video[controls]${u$2}${f}`,
13
- `[contenteditable]${u$2}${f}`,
14
- `[tabindex]${u$2}${f}`
1
+ const u = ":not([inert])", f$2 = ':not([tabindex^="-"])', m$2 = ":not(:disabled)", C$2 = [
2
+ `a[href]${u}${f$2}`,
3
+ `area[href]${u}${f$2}`,
4
+ `input:not([type="hidden"]):not([type="radio"])${u}${f$2}${m$2}`,
5
+ `input[type="radio"]${u}${f$2}${m$2}`,
6
+ `select${u}${f$2}${m$2}`,
7
+ `textarea${u}${f$2}${m$2}`,
8
+ `button${u}${f$2}${m$2}`,
9
+ `details${u} > summary:first-of-type${f$2}`,
10
+ `iframe${u}${f$2}`,
11
+ `audio[controls]${u}${f$2}`,
12
+ `video[controls]${u}${f$2}`,
13
+ `[contenteditable]${u}${f$2}`,
14
+ `[tabindex]${u}${f$2}`
15
15
  ];
16
- function C$2(n, t = "config") {
16
+ function k$3(n, t = "config") {
17
17
  const s = (n.getAttribute(`data-${t}`) || "").replace(/'/g, '"');
18
18
  return s ? JSON.parse(s) : {};
19
19
  }
@@ -100,8 +100,8 @@ async function h$1(n, t, e) {
100
100
  function M$2(n) {
101
101
  const t = getComputedStyle(n.el), e = {}, s = n.getSetting("customProps");
102
102
  for (let r2 = 0; r2 < s.length; r2++) {
103
- const a2 = y$2(), o2 = n.parent.module.toLowerCase(), i = $$2(s[r2]), c = t.getPropertyValue(`--${a2}${o2}-${i}`).trim();
104
- c && (e[i] = c);
103
+ const a2 = y$2(), o = n.parent.module.toLowerCase(), i = $$2(s[r2]), c2 = t.getPropertyValue(`--${a2}${o}-${i}`).trim();
104
+ c2 && (e[i] = c2);
105
105
  }
106
106
  return e;
107
107
  }
@@ -117,26 +117,26 @@ function A$2(n, t = {}) {
117
117
  props: s = ["dataConfig", "customProps", "settings", "parent.settings"]
118
118
  } = t;
119
119
  for (const r2 of s) {
120
- const a2 = r2 !== "customProps" ? "camel" : "kebab", o2 = P$3.call(this, r2, n, a2);
121
- if (o2 !== void 0)
122
- return o2;
120
+ const a2 = r2 !== "customProps" ? "camel" : "kebab", o = P$3.call(this, r2, n, a2);
121
+ if (o !== void 0)
122
+ return o;
123
123
  }
124
124
  if (e !== void 0)
125
125
  return e;
126
126
  throw new Error(`${this.parent.module} setting does not exist: ${n}`);
127
127
  }
128
- function I$3(n, t) {
128
+ function T$3(n, t) {
129
129
  t && document.querySelectorAll(t).forEach((s) => {
130
130
  n ? s.style.overflow = "hidden" : s.style.removeProperty("overflow");
131
131
  });
132
132
  }
133
- function T$3(n, t) {
133
+ function I$3(n, t) {
134
134
  t && document.querySelectorAll(t).forEach((s) => {
135
- n ? (s.inert = true, s.setAttribute("aria-hidden", "true")) : (s.inert = false, s.removeAttribute("aria-hidden"));
135
+ s.inert = n;
136
136
  });
137
137
  }
138
138
  function G(n, t, e) {
139
- T$3(!!n, t), I$3(!!n, e);
139
+ I$3(!!n, t), T$3(!!n, e);
140
140
  }
141
141
  const L$2 = {
142
142
  events: {},
@@ -167,7 +167,7 @@ let O$2 = class O extends Array {
167
167
  return this[this.length - 1];
168
168
  }
169
169
  set(t = this.el) {
170
- this.length = 0, t && this.push(...t.querySelectorAll(k$3.join(",")));
170
+ this.length = 0, t && this.push(...t.querySelectorAll(C$2.join(",")));
171
171
  }
172
172
  clear() {
173
173
  this.length = 0;
@@ -189,8 +189,8 @@ function b$2(n) {
189
189
  }
190
190
  function D$3(n) {
191
191
  if (n.key !== "Tab" && n.keyCode !== 9) return;
192
- const { activeElement: t } = document, { el: e, focusable: s } = this, r2 = n.shiftKey, a2 = t === s.first || t === e, o2 = t === s.last || t === e;
193
- if (r2 && a2 || !r2 && o2) {
192
+ const { activeElement: t } = document, { el: e, focusable: s } = this, r2 = n.shiftKey, a2 = t === s.first || t === e, o = t === s.last || t === e;
193
+ if (r2 && a2 || !r2 && o) {
194
194
  n.preventDefault();
195
195
  const i = r2 ? s.last : s.first;
196
196
  i && typeof i.focus == "function" && i.focus();
@@ -267,7 +267,7 @@ class W extends Array {
267
267
  ~e && (this.splice(e, 1), this.add(t));
268
268
  }
269
269
  }
270
- const N$3 = {
270
+ const N$1 = {
271
271
  condition: true
272
272
  }, Q = {
273
273
  primary: "hsl(152deg 60% 50%)",
@@ -278,15 +278,15 @@ const N$3 = {
278
278
  function Z(n = {}) {
279
279
  const t = {
280
280
  name: "debug",
281
- defaults: N$3,
281
+ defaults: N$1,
282
282
  options: n
283
283
  };
284
- function e(o2, i = [], c = ["primary", "secondary"]) {
285
- const l2 = c.map((d2) => `color: ${Q[d2]}`);
286
- console.log(`%c📡 DEBUG: %c${o2}`, ...l2, ...i);
284
+ function e(o, i = [], c2 = ["primary", "secondary"]) {
285
+ const l = c2.map((d2) => `color: ${Q[d2]}`);
286
+ console.log(`%c📡 DEBUG: %c${o}`, ...l, ...i);
287
287
  }
288
- function s(o2, ...i) {
289
- return typeof o2 == "function" ? o2(...i) : o2;
288
+ function s(o, ...i) {
289
+ return typeof o == "function" ? o(...i) : o;
290
290
  }
291
291
  const r2 = {
292
292
  beforeMountRef: e.bind(null, "Event > beforeMount()"),
@@ -303,33 +303,33 @@ function Z(n = {}) {
303
303
  [],
304
304
  ["important", "neutral"]
305
305
  ),
306
- createEntryRef: (o2, { parent: i, plugin: c }) => {
307
- if (s(c.settings.condition, o2)) {
308
- const l2 = i.collection.length;
309
- e(`Event > createEntry() > [${l2}] #${o2.id}`);
306
+ createEntryRef: (o, { parent: i, plugin: c2 }) => {
307
+ if (s(c2.settings.condition, o)) {
308
+ const l = i.collection.length;
309
+ e(`Event > createEntry() > [${l}] #${o.id}`);
310
310
  }
311
311
  },
312
- registerEntryRef: (o2, { parent: i, plugin: c }) => {
313
- if (s(c.settings.condition, o2)) {
314
- const l2 = i.collection.length;
315
- e(`Event > registerEntry() > [${l2}] #${o2.id}`);
312
+ registerEntryRef: (o, { parent: i, plugin: c2 }) => {
313
+ if (s(c2.settings.condition, o)) {
314
+ const l = i.collection.length;
315
+ e(`Event > registerEntry() > [${l}] #${o.id}`);
316
316
  }
317
317
  },
318
- destroyEntryRef: (o2, { parent: i, plugin: c }) => {
319
- if (s(c.settings.condition, o2)) {
320
- const l2 = i.collection.length;
318
+ destroyEntryRef: (o, { parent: i, plugin: c2 }) => {
319
+ if (s(c2.settings.condition, o)) {
320
+ const l = i.collection.length;
321
321
  e(
322
- `Event > destroyEntry() > [${l2}] #${o2.id}`,
322
+ `Event > destroyEntry() > [${l}] #${o.id}`,
323
323
  [],
324
324
  ["important", "neutral"]
325
325
  );
326
326
  }
327
327
  },
328
- deregisterEntryRef: (o2, { parent: i, plugin: c }) => {
329
- if (s(c.settings.condition, o2)) {
330
- const l2 = i.collection.length;
328
+ deregisterEntryRef: (o, { parent: i, plugin: c2 }) => {
329
+ if (s(c2.settings.condition, o)) {
330
+ const l = i.collection.length;
331
331
  e(
332
- `Event > deregisterEntry() > [${l2}]`,
332
+ `Event > deregisterEntry() > [${l}]`,
333
333
  [],
334
334
  ["important", "neutral"]
335
335
  );
@@ -338,39 +338,39 @@ function Z(n = {}) {
338
338
  };
339
339
  return { ...t, ...{
340
340
  // Plugin setup/teardown methods
341
- setup({ parent: o2 }) {
342
- e("Plugin > setup()", Array.from(arguments), ["secondary", "neutral"]), o2.on("beforeMount", r2.beforeMountRef), o2.on("createEntry", r2.createEntryRef, { parent: o2, plugin: this }), o2.on("registerEntry", r2.registerEntryRef, {
343
- parent: o2,
341
+ setup({ parent: o }) {
342
+ e("Plugin > setup()", Array.from(arguments), ["secondary", "neutral"]), o.on("beforeMount", r2.beforeMountRef), o.on("createEntry", r2.createEntryRef, { parent: o, plugin: this }), o.on("registerEntry", r2.registerEntryRef, {
343
+ parent: o,
344
344
  plugin: this
345
- }), o2.on("afterMount", r2.afterMountRef), o2.on("beforeUnmount", r2.beforeUnmountRef), o2.on("destroyEntry", r2.destroyEntryRef, { parent: o2, plugin: this }), o2.on("deregisterEntry", r2.deregisterEntryRef, {
346
- parent: o2,
345
+ }), o.on("afterMount", r2.afterMountRef), o.on("beforeUnmount", r2.beforeUnmountRef), o.on("destroyEntry", r2.destroyEntryRef, { parent: o, plugin: this }), o.on("deregisterEntry", r2.deregisterEntryRef, {
346
+ parent: o,
347
347
  plugin: this
348
- }), o2.on("afterUnmount", r2.afterUnmountRef);
348
+ }), o.on("afterUnmount", r2.afterUnmountRef);
349
349
  },
350
- teardown({ parent: o2 }) {
350
+ teardown({ parent: o }) {
351
351
  e("Plugin > teardown()", Array.from(arguments), [
352
352
  "secondary",
353
353
  "neutral"
354
- ]), o2.off("beforeMount", r2.beforeMountRef), o2.off("createEntry", r2.createEntryRef), o2.off("registerEntry", r2.registerEntryRef), o2.off("afterMount", r2.afterMountRef), o2.off("beforeUnmount", r2.beforeUnmountRef), o2.off("destroyEntry", r2.destroyEntryRef), o2.off("deregisterEntry", r2.deregisterEntryRef), o2.off("afterUnmount", r2.afterUnmountRef);
354
+ ]), o.off("beforeMount", r2.beforeMountRef), o.off("createEntry", r2.createEntryRef), o.off("registerEntry", r2.registerEntryRef), o.off("afterMount", r2.afterMountRef), o.off("beforeUnmount", r2.beforeUnmountRef), o.off("destroyEntry", r2.destroyEntryRef), o.off("deregisterEntry", r2.deregisterEntryRef), o.off("afterUnmount", r2.afterUnmountRef);
355
355
  },
356
356
  // Mount lifecycle hooks
357
357
  beforeMount() {
358
358
  e("Hook > beforeMount()", Array.from(arguments));
359
359
  },
360
- onCreateEntry({ parent: o2, entry: i }) {
360
+ onCreateEntry({ parent: o, entry: i }) {
361
361
  if (s(this.settings.condition, i)) {
362
- const c = o2.collection.length;
362
+ const c2 = o.collection.length;
363
363
  e(
364
- `Hook > onCreateEntry() > [${c}] #${i.id}`,
364
+ `Hook > onCreateEntry() > [${c2}] #${i.id}`,
365
365
  Array.from(arguments)
366
366
  );
367
367
  }
368
368
  },
369
- onRegisterEntry({ parent: o2, entry: i }) {
369
+ onRegisterEntry({ parent: o, entry: i }) {
370
370
  if (s(this.settings.condition, i)) {
371
- const c = o2.collection.length - 1;
371
+ const c2 = o.collection.length - 1;
372
372
  e(
373
- `Hook > onRegisterEntry() > [${c}] #${i.id}`,
373
+ `Hook > onRegisterEntry() > [${c2}] #${i.id}`,
374
374
  Array.from(arguments)
375
375
  );
376
376
  }
@@ -385,20 +385,20 @@ function Z(n = {}) {
385
385
  "neutral"
386
386
  ]);
387
387
  },
388
- onDestroyEntry({ parent: o2, entry: i }) {
388
+ onDestroyEntry({ parent: o, entry: i }) {
389
389
  if (s(this.settings.condition, i)) {
390
- const c = o2.collection.length - 1;
390
+ const c2 = o.collection.length - 1;
391
391
  e(
392
- `Hook > onDestroyEntry() > [${c}] #${i.id}`,
392
+ `Hook > onDestroyEntry() > [${c2}] #${i.id}`,
393
393
  Array.from(arguments),
394
394
  ["important", "neutral"]
395
395
  );
396
396
  }
397
397
  },
398
- onDeregisterEntry({ parent: o2, entry: i }) {
398
+ onDeregisterEntry({ parent: o, entry: i }) {
399
399
  if (s(this.settings.condition, i)) {
400
- const c = o2.collection.length;
401
- e(`Hook > onDeregisterEntry() > [${c}]`, Array.from(arguments), [
400
+ const c2 = o.collection.length;
401
+ e(`Hook > onDeregisterEntry() > [${c2}]`, Array.from(arguments), [
402
402
  "important",
403
403
  "neutral"
404
404
  ]);
@@ -421,30 +421,30 @@ function _$1(n = {}) {
421
421
  defaults: q$3,
422
422
  options: n
423
423
  }, e = {
424
- setup({ parent: o2 }) {
425
- o2.on("opened", r2, this), o2.on("closed", a2, this);
424
+ setup({ parent: o }) {
425
+ o.on("opened", r2, this), o.on("closed", a2, this);
426
426
  },
427
- teardown({ parent: o2 }) {
428
- o2.off("opened", r2), o2.off("closed", a2);
427
+ teardown({ parent: o }) {
428
+ o.off("opened", r2), o.off("closed", a2);
429
429
  },
430
- onCreateEntry({ entry: o2 }) {
431
- o2.focusTrap = new U$2();
430
+ onCreateEntry({ entry: o }) {
431
+ o.focusTrap = new U$2();
432
432
  }
433
433
  };
434
- function s(o2, ...i) {
435
- return typeof o2 == "function" ? o2(...i) : o2;
434
+ function s(o, ...i) {
435
+ return typeof o == "function" ? o(...i) : o;
436
436
  }
437
- function r2(o2, i) {
438
- const c = { plugin: i, parent: o2.parent, entry: o2 };
439
- s(i.settings.condition, c) && o2.focusTrap?.on(o2.dialog);
437
+ function r2(o, i) {
438
+ const c2 = { plugin: i, parent: o.parent, entry: o };
439
+ s(i.settings.condition, c2) && o.focusTrap?.on(o.dialog);
440
440
  }
441
- function a2(o2, i) {
442
- const c = { plugin: i, parent: o2.parent, entry: o2 };
443
- s(i.settings.condition, c) && o2.focusTrap?.off();
441
+ function a2(o, i) {
442
+ const c2 = { plugin: i, parent: o.parent, entry: o };
443
+ s(i.settings.condition, c2) && o.focusTrap?.off();
444
444
  }
445
445
  return { ...t, ...e };
446
446
  }
447
- const F$1 = {
447
+ const F$2 = {
448
448
  // The data attributes to get the breakpoint values from
449
449
  dataBreakpoint: "breakpoint",
450
450
  // The data attributes to get the media query value from
@@ -472,7 +472,7 @@ const F$1 = {
472
472
  function X$1(n = {}) {
473
473
  const t = {
474
474
  name: "mediaQuery",
475
- defaults: F$1,
475
+ defaults: F$2,
476
476
  options: n
477
477
  }, e = {
478
478
  // Run when an entry is created
@@ -483,28 +483,28 @@ function X$1(n = {}) {
483
483
  // Run when an entry is destroyed
484
484
  // Removes the MediaQueryList and event listener
485
485
  onDestroyEntry({ entry: i }) {
486
- o2(i);
486
+ o(i);
487
487
  }
488
488
  };
489
489
  function s(i) {
490
- const c = i.el.getAttribute(`data-${this.settings.dataMediaQuery}`);
491
- return !c && i.id in this.settings.mediaQueries ? this.settings.mediaQueries[i.id] : c || void 0;
490
+ const c2 = i.el.getAttribute(`data-${this.settings.dataMediaQuery}`);
491
+ return !c2 && i.id in this.settings.mediaQueries ? this.settings.mediaQueries[i.id] : c2 || void 0;
492
492
  }
493
493
  function r2(i) {
494
- let c = i.el.getAttribute(`data-${this.settings.dataBreakpoint}`);
495
- return !c && i.id in this.settings.breakpoints && (c = this.settings.breakpoints[i.id]), c && c in this.settings.breakpoints && (c = this.settings.breakpoints[c]), c && (c = getComputedStyle(document.body).getPropertyValue(`--${y$2()}breakpoint-${c}`).trim() || c), c || this.settings.breakpoint;
494
+ let c2 = i.el.getAttribute(`data-${this.settings.dataBreakpoint}`);
495
+ return !c2 && i.id in this.settings.breakpoints && (c2 = this.settings.breakpoints[i.id]), c2 && c2 in this.settings.breakpoints && (c2 = this.settings.breakpoints[c2]), c2 && (c2 = getComputedStyle(document.body).getPropertyValue(`--${y$2()}breakpoint-${c2}`).trim() || c2), c2 || this.settings.breakpoint;
496
496
  }
497
497
  function a2(i) {
498
- let c = s.call(this, i);
499
- const l2 = r2.call(this, i);
500
- if (!l2 && !c) return;
501
- l2 && !c && (c = this.settings.mediaQuery);
502
- const d2 = c.replace(new RegExp(`${this.settings.token}`, "g"), l2);
498
+ let c2 = s.call(this, i);
499
+ const l = r2.call(this, i);
500
+ if (!l && !c2) return;
501
+ l && !c2 && (c2 = this.settings.mediaQuery);
502
+ const d2 = c2.replace(new RegExp(`${this.settings.token}`, "g"), l);
503
503
  i.mql = window.matchMedia(d2), i.mql.onchange = (p2) => {
504
504
  this.settings.onChange(p2, i);
505
505
  }, this.settings.onChange(i.mql, i);
506
506
  }
507
- function o2(i) {
507
+ function o(i) {
508
508
  i.mql && (i.mql.onchange = null, i.mql = null);
509
509
  }
510
510
  return { ...t, ...e };
@@ -533,7 +533,7 @@ function Y$1(n = {}) {
533
533
  store: null
534
534
  }, e = {
535
535
  setup({ parent: i }) {
536
- this.store = w$2(o2.call(this, i.module));
536
+ this.store = w$2(o.call(this, i.module));
537
537
  },
538
538
  async onCreateEntry({ entry: i }) {
539
539
  await s.call(this, i);
@@ -543,22 +543,22 @@ function Y$1(n = {}) {
543
543
  }
544
544
  };
545
545
  async function s(i) {
546
- let c = i[this.settings.prop] || null;
547
- const l2 = { plugin: this, parent: i.parent, entry: i };
546
+ let c2 = i[this.settings.prop] || null;
547
+ const l = { plugin: this, parent: i.parent, entry: i };
548
548
  Object.defineProperty(i, this.settings.prop, {
549
549
  configurable: true,
550
550
  get() {
551
- return c;
551
+ return c2;
552
552
  },
553
553
  set: async (d2) => {
554
- if (c === d2) return;
555
- const p2 = c;
556
- c = d2, r2(
554
+ if (c2 === d2) return;
555
+ const p2 = c2;
556
+ c2 = d2, r2(
557
557
  this.settings.condition,
558
- l2,
558
+ l,
559
559
  d2,
560
560
  p2
561
- ) && this.store.set(i.id, d2), await this.settings.onChange(l2, d2, p2);
561
+ ) && this.store.set(i.id, d2), await this.settings.onChange(l, d2, p2);
562
562
  }
563
563
  }), Object.defineProperty(i, "store", {
564
564
  configurable: true,
@@ -566,18 +566,18 @@ function Y$1(n = {}) {
566
566
  set: (d2) => {
567
567
  i[this.settings.prop] = d2;
568
568
  }
569
- }), i[this.settings.prop] = await r2(this.settings.value, l2) || i[this.settings.prop];
569
+ }), i[this.settings.prop] = await r2(this.settings.value, l) || i[this.settings.prop];
570
570
  }
571
- function r2(i, ...c) {
572
- return typeof i == "function" ? i(...c) : i;
571
+ function r2(i, ...c2) {
572
+ return typeof i == "function" ? i(...c2) : i;
573
573
  }
574
574
  async function a2(i) {
575
- const c = i[this.settings.prop];
576
- delete i[this.settings.prop], i[this.settings.prop] = c, this.store.set(i.id, null);
575
+ const c2 = i[this.settings.prop];
576
+ delete i[this.settings.prop], i[this.settings.prop] = c2, this.store.set(i.id, null);
577
577
  }
578
- function o2(i) {
579
- const c = this.settings.prop.charAt(0).toUpperCase() + this.settings.prop.slice(1), l2 = this.settings.key || i + c;
580
- return this.settings.keyPrefix + l2;
578
+ function o(i) {
579
+ const c2 = this.settings.prop.charAt(0).toUpperCase() + this.settings.prop.slice(1), l = this.settings.key || i + c2;
580
+ return this.settings.keyPrefix + l;
581
581
  }
582
582
  return { ...t, ...e };
583
583
  }
@@ -591,27 +591,27 @@ function tt$1(n = {}) {
591
591
  defaults: B,
592
592
  options: n
593
593
  }, e = {
594
- onCreateEntry({ plugin: a2, entry: o2 }) {
595
- s(a2, o2);
594
+ onCreateEntry({ plugin: a2, entry: o }) {
595
+ s(a2, o);
596
596
  },
597
- onDestroyEntry({ plugin: a2, entry: o2 }) {
598
- r2(a2, o2);
597
+ onDestroyEntry({ plugin: a2, entry: o }) {
598
+ r2(a2, o);
599
599
  }
600
600
  };
601
- function s(a2, o2) {
602
- o2.teleport = () => {
603
- typeof o2.teleportReturn == "function" && o2.teleportReturn(), o2.teleportReturn = x$2(
604
- o2.el,
605
- o2.getSetting("teleport", { fallback: a2.settings.where }),
606
- o2.getSetting("teleportMethod", { fallback: a2.settings.how })
601
+ function s(a2, o) {
602
+ o.teleport = () => {
603
+ typeof o.teleportReturn == "function" && o.teleportReturn(), o.teleportReturn = x$2(
604
+ o.el,
605
+ o.getSetting("teleport", { fallback: a2.settings.where }),
606
+ o.getSetting("teleportMethod", { fallback: a2.settings.how })
607
607
  );
608
- }, o2.teleport(), o2.parent.emit("teleport", { plugin: a2, parent: o2.parent, entry: o2 });
608
+ }, o.teleport(), o.parent.emit("teleport", { plugin: a2, parent: o.parent, entry: o });
609
609
  }
610
- function r2(a2, o2) {
611
- typeof o2.teleportReturn == "function" && o2.teleportReturn(), o2.parent.emit("teleportReturn", {
610
+ function r2(a2, o) {
611
+ typeof o.teleportReturn == "function" && o.teleportReturn(), o.parent.emit("teleportReturn", {
612
612
  plugin: a2,
613
- parent: o2.parent,
614
- entry: o2
613
+ parent: o.parent,
614
+ entry: o
615
615
  });
616
616
  }
617
617
  return { ...t, ...e };
@@ -620,7 +620,7 @@ const j$3 = {
620
620
  dataConfig: "config",
621
621
  customProps: []
622
622
  };
623
- let z$3 = class z {
623
+ let z$2 = class z {
624
624
  constructor(t, e, s = {}) {
625
625
  this.parent = t, this.el = E$3(e), this.settings = { ...s }, this.dataConfig = {}, this.customProps = {};
626
626
  }
@@ -636,7 +636,7 @@ let z$3 = class z {
636
636
  buildDataConfig() {
637
637
  return Object.assign(
638
638
  this.dataConfig,
639
- C$2(this.el, this.getSetting("dataConfig"))
639
+ k$3(this.el, this.getSetting("dataConfig"))
640
640
  );
641
641
  }
642
642
  buildCustomProps() {
@@ -653,11 +653,19 @@ let z$3 = class z {
653
653
  };
654
654
  let et$1 = class et {
655
655
  constructor(t = {}) {
656
- this.module = this.constructor.name, this.collection = [], this.entryClass = z$3, this.settings = { ...j$3, ...t }, this.plugins = new H$3(this.settings.presets), this.events = {}, Object.assign(this, L$2);
656
+ this.module = this.constructor.name, this.collection = [], this.entryClass = z$2, this.settings = { ...j$3, ...t }, this.plugins = new H$3(this.settings.presets), this.events = {}, Object.assign(this, L$2);
657
657
  }
658
658
  get(t, e = "id") {
659
659
  return this.collection.find((s) => s[e] === t);
660
660
  }
661
+ getOrThrow(t, e = "id") {
662
+ const s = this.get(t, e);
663
+ if (s)
664
+ return s;
665
+ throw new Error(
666
+ `${this.module} entry not found in collection with ${e} of "${t}"`
667
+ );
668
+ }
661
669
  applySettings(t) {
662
670
  return Object.assign(this.settings, t);
663
671
  }
@@ -737,8 +745,8 @@ function nt$1(n = {}) {
737
745
  t.themes.push(a2);
738
746
  },
739
747
  remove(a2) {
740
- const o2 = t.themes.indexOf(a2);
741
- ~o2 && t.themes.splice(o2, 1);
748
+ const o = t.themes.indexOf(a2);
749
+ ~o && t.themes.splice(o, 1);
742
750
  },
743
751
  callback(a2) {
744
752
  e[a2].call(this);
@@ -766,7 +774,7 @@ function nt$1(n = {}) {
766
774
  const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
767
775
  __proto__: null,
768
776
  Collection: et$1,
769
- CollectionEntry: z$3,
777
+ CollectionEntry: z$2,
770
778
  FocusTrap: U$2,
771
779
  FocusableArray: O$2,
772
780
  PluginsArray: H$3,
@@ -776,9 +784,9 @@ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
776
784
  dispatchLifecycleHook: h$1,
777
785
  eventEmitter: L$2,
778
786
  focusTrap: _$1,
779
- focusableSelectors: k$3,
787
+ focusableSelectors: C$2,
780
788
  getCustomProps: M$2,
781
- getDataConfig: C$2,
789
+ getDataConfig: k$3,
782
790
  getElement: E$3,
783
791
  getPrefix: y$2,
784
792
  getSetting: A$2,
@@ -795,11 +803,11 @@ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
795
803
  toMilliseconds: S$2,
796
804
  transition: J$1
797
805
  }, Symbol.toStringTag, { value: "Module" }));
798
- function b$1(t, e = "config") {
806
+ function E$2(t, e = "config") {
799
807
  const s = (t.getAttribute(`data-${e}`) || "").replace(/'/g, '"');
800
808
  return s ? JSON.parse(s) : {};
801
809
  }
802
- function p$1(t) {
810
+ function f$1(t) {
803
811
  if (typeof t == "string") {
804
812
  const e = document.getElementById(t);
805
813
  if (e) return e;
@@ -814,15 +822,15 @@ function p$1(t) {
814
822
  async function r$1(t, e, ...s) {
815
823
  e in t && typeof t[e] == "function" && await t[e](...s);
816
824
  }
817
- function C$1(t) {
825
+ function b$1(t) {
818
826
  return t.split("-").map(
819
827
  (e, s) => s === 0 ? e : e.charAt(0).toUpperCase() + e.slice(1)
820
828
  ).join("");
821
829
  }
822
- function m$1(t) {
830
+ function p$1(t) {
823
831
  return t.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
824
832
  }
825
- function L$1(t) {
833
+ function C$1(t) {
826
834
  if (typeof t == "number")
827
835
  return t;
828
836
  const e = parseFloat(t);
@@ -832,14 +840,14 @@ function L$1(t) {
832
840
  }
833
841
  throw new Error(`Could not convert value to milliseconds: ${t}`);
834
842
  }
835
- function w$1(t, e, s, i, n = 0) {
836
- return new Promise((a2) => {
843
+ function m$1(t, e, s, i, n = 0) {
844
+ return new Promise((o) => {
837
845
  t.classList.remove(e), t.classList.add(s), setTimeout(() => {
838
- t.classList.add(i), t.classList.remove(s), a2(t);
839
- }, L$1(n));
846
+ t.classList.add(i), t.classList.remove(s), o(t);
847
+ }, C$1(n));
840
848
  });
841
849
  }
842
- async function o(t, e, s) {
850
+ async function a$1(t, e, s) {
843
851
  await r$1(e, t, s), s && await r$1(s, t);
844
852
  for (const i of e.plugins)
845
853
  await r$1(i, t, { plugin: i, parent: e, entry: s });
@@ -848,45 +856,45 @@ async function o(t, e, s) {
848
856
  function O$1(t) {
849
857
  const e = getComputedStyle(t.el), s = {}, i = t.getSetting("customProps");
850
858
  for (let n = 0; n < i.length; n++) {
851
- const a2 = M$1(), c = t.parent.module.toLowerCase(), h2 = m$1(i[n]), f2 = e.getPropertyValue(`--${a2}${c}-${h2}`).trim();
852
- f2 && (s[h2] = f2);
859
+ const o = L$1(), l = t.parent.module.toLowerCase(), h2 = p$1(i[n]), u2 = e.getPropertyValue(`--${o}${l}-${h2}`).trim();
860
+ u2 && (s[h2] = u2);
853
861
  }
854
862
  return s;
855
863
  }
856
- function M$1() {
864
+ function L$1() {
857
865
  return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
858
866
  }
859
867
  function $$1(t, e, s = "camel") {
860
- return e = s === "camel" ? C$1(e) : m$1(e), t.split(".").concat(e).reduce((i, n) => i?.[n], this);
868
+ return e = s === "camel" ? b$1(e) : p$1(e), t.split(".").concat(e).reduce((i, n) => i?.[n], this);
861
869
  }
862
- function P$2(t, e = {}) {
870
+ function M$1(t, e = {}) {
863
871
  const {
864
872
  fallback: s,
865
873
  props: i = ["dataConfig", "customProps", "settings", "parent.settings"]
866
874
  } = e;
867
875
  for (const n of i) {
868
- const a2 = n !== "customProps" ? "camel" : "kebab", c = $$1.call(this, n, t, a2);
869
- if (c !== void 0)
870
- return c;
876
+ const o = n !== "customProps" ? "camel" : "kebab", l = $$1.call(this, n, t, o);
877
+ if (l !== void 0)
878
+ return l;
871
879
  }
872
880
  if (s !== void 0)
873
881
  return s;
874
882
  throw new Error(`${this.parent.module} setting does not exist: ${t}`);
875
883
  }
876
- function x$1(t, e) {
884
+ function P$2(t, e) {
877
885
  e && document.querySelectorAll(e).forEach((s) => {
878
886
  t ? s.style.overflow = "hidden" : s.style.removeProperty("overflow");
879
887
  });
880
888
  }
881
- function A$1(t, e) {
889
+ function T$2(t, e) {
882
890
  e && document.querySelectorAll(e).forEach((s) => {
883
- t ? (s.inert = true, s.setAttribute("aria-hidden", "true")) : (s.inert = false, s.removeAttribute("aria-hidden"));
891
+ s.inert = t;
884
892
  });
885
893
  }
886
- function d$1(t, e, s) {
887
- A$1(!!t, e), x$1(!!t, s);
894
+ function c$1(t, e, s) {
895
+ T$2(!!t, e), P$2(!!t, s);
888
896
  }
889
- const D$2 = {
897
+ const x$1 = {
890
898
  events: {},
891
899
  on(t, e, ...s) {
892
900
  this.events[t] || (this.events[t] = []), this.events[t].some(
@@ -931,13 +939,13 @@ let y$1 = class y extends Array {
931
939
  ~s && this.splice(s, 1);
932
940
  }
933
941
  };
934
- const I$2 = {
942
+ const A$1 = {
935
943
  dataConfig: "config",
936
944
  customProps: []
937
945
  };
938
- let S$1 = class S {
946
+ let w$1 = class w {
939
947
  constructor(e, s, i = {}) {
940
- this.parent = e, this.el = p$1(s), this.settings = { ...i }, this.dataConfig = {}, this.customProps = {};
948
+ this.parent = e, this.el = f$1(s), this.settings = { ...i }, this.dataConfig = {}, this.customProps = {};
941
949
  }
942
950
  get id() {
943
951
  return this.el.id;
@@ -946,12 +954,12 @@ let S$1 = class S {
946
954
  return Object.assign(this.settings, e);
947
955
  }
948
956
  getSetting(e, s) {
949
- return P$2.call(this, e, s);
957
+ return M$1.call(this, e, s);
950
958
  }
951
959
  buildDataConfig() {
952
960
  return Object.assign(
953
961
  this.dataConfig,
954
- b$1(this.el, this.getSetting("dataConfig"))
962
+ E$2(this.el, this.getSetting("dataConfig"))
955
963
  );
956
964
  }
957
965
  buildCustomProps() {
@@ -966,38 +974,46 @@ let S$1 = class S {
966
974
  });
967
975
  }
968
976
  };
969
- let T$2 = class T {
977
+ let D$2 = class D {
970
978
  constructor(e = {}) {
971
- this.module = this.constructor.name, this.collection = [], this.entryClass = S$1, this.settings = { ...I$2, ...e }, this.plugins = new y$1(this.settings.presets), this.events = {}, Object.assign(this, D$2);
979
+ this.module = this.constructor.name, this.collection = [], this.entryClass = w$1, this.settings = { ...A$1, ...e }, this.plugins = new y$1(this.settings.presets), this.events = {}, Object.assign(this, x$1);
972
980
  }
973
981
  get(e, s = "id") {
974
982
  return this.collection.find((i) => i[s] === e);
975
983
  }
984
+ getOrThrow(e, s = "id") {
985
+ const i = this.get(e, s);
986
+ if (i)
987
+ return i;
988
+ throw new Error(
989
+ `${this.module} entry not found in collection with ${s} of "${e}"`
990
+ );
991
+ }
976
992
  applySettings(e) {
977
993
  return Object.assign(this.settings, e);
978
994
  }
979
995
  async createEntry(e, s) {
980
996
  const i = new this.entryClass(this, e, s);
981
- return await r$1(i, "init"), await o("onCreateEntry", this, i), i;
997
+ return await r$1(i, "init"), await a$1("onCreateEntry", this, i), i;
982
998
  }
983
999
  async destroyEntry(e) {
984
- return await o("onDestroyEntry", this, e), await r$1(e, "destroy"), e;
1000
+ return await a$1("onDestroyEntry", this, e), await r$1(e, "destroy"), e;
985
1001
  }
986
1002
  async register(e, s = {}) {
987
- const i = p$1(e), n = this.collection.findIndex((a2) => a2.id === i.id);
1003
+ const i = f$1(e), n = this.collection.findIndex((o) => o.id === i.id);
988
1004
  if (~n) {
989
- const a2 = this.collection[n];
990
- return a2.el = i, typeof a2.init == "function" && await a2.init(s), a2;
1005
+ const o = this.collection[n];
1006
+ return o.el = i, typeof o.init == "function" && await o.init(s), o;
991
1007
  } else {
992
- const a2 = await this.createEntry(i, s);
993
- return this.collection.push(a2), await o("onRegisterEntry", this, a2), a2;
1008
+ const o = await this.createEntry(i, s);
1009
+ return this.collection.push(o), await a$1("onRegisterEntry", this, o), o;
994
1010
  }
995
1011
  }
996
1012
  async deregister(e) {
997
1013
  const s = this.collection.findIndex((i) => i.id === e);
998
1014
  if (~s) {
999
1015
  const i = await this.destroyEntry(this.collection[s]);
1000
- return await o(
1016
+ return await a$1(
1001
1017
  "onDeregisterEntry",
1002
1018
  this,
1003
1019
  this.collection[s]
@@ -1011,16 +1027,16 @@ let T$2 = class T {
1011
1027
  this.plugins.add(i);
1012
1028
  for (const i of this.plugins)
1013
1029
  await r$1(i, "setup", { plugin: i, parent: this });
1014
- await o("beforeMount", this);
1030
+ await a$1("beforeMount", this);
1015
1031
  const s = document.querySelectorAll(this.settings.selector);
1016
1032
  for (const i of s)
1017
1033
  await this.register(i);
1018
- return await o("afterMount", this), this;
1034
+ return await a$1("afterMount", this), this;
1019
1035
  }
1020
1036
  async unmount() {
1021
- for (await o("beforeUnmount", this); this.collection.length > 0; )
1037
+ for (await a$1("beforeUnmount", this); this.collection.length > 0; )
1022
1038
  await this.deregister(this.collection[0].id);
1023
- await o("afterUnmount", this);
1039
+ await a$1("afterUnmount", this);
1024
1040
  for (const e of this.plugins)
1025
1041
  await r$1(e, "teardown", { plugin: e, parent: this });
1026
1042
  for (const e of [...this.plugins])
@@ -1028,7 +1044,7 @@ let T$2 = class T {
1028
1044
  return this;
1029
1045
  }
1030
1046
  };
1031
- const k$2 = {
1047
+ const I$2 = {
1032
1048
  focusTrap: {
1033
1049
  condition: ({ entry: t }) => t.state === "closed" || t.state === "opened" && t.mode === "modal"
1034
1050
  },
@@ -1043,8 +1059,8 @@ const k$2 = {
1043
1059
  condition: ({ entry: t }) => ["opened", "closed", "indeterminate"].includes(t.state),
1044
1060
  onChange: ({ entry: t }) => t.applyState()
1045
1061
  }
1046
- }, j$2 = {
1047
- presets: k$2,
1062
+ }, k$2 = {
1063
+ presets: I$2,
1048
1064
  dataOpen: "drawer-open",
1049
1065
  dataClose: "drawer-close",
1050
1066
  dataToggle: "drawer-toggle",
@@ -1066,18 +1082,18 @@ const k$2 = {
1066
1082
  transition: true,
1067
1083
  transitionDuration: 300
1068
1084
  };
1069
- function q$2(t) {
1085
+ function j$2(t) {
1070
1086
  switch (t.mode) {
1071
1087
  case "inline":
1072
- return H$2(t);
1088
+ return q$2(t);
1073
1089
  case "modal":
1074
- return N$2(t);
1090
+ return H$2(t);
1075
1091
  default:
1076
1092
  throw new Error(`"${t.mode}" is not a valid drawer mode.`);
1077
1093
  }
1078
1094
  }
1079
- async function H$2(t) {
1080
- return t.el.classList.remove(t.getSetting("classModal")), t.dialog.removeAttribute("aria-modal"), d$1(
1095
+ async function q$2(t) {
1096
+ return t.el.classList.remove(t.getSetting("classModal")), t.dialog.removeAttribute("aria-modal"), c$1(
1081
1097
  false,
1082
1098
  t.getSetting("selectorInert"),
1083
1099
  t.getSetting("selectorOverflow")
@@ -1088,7 +1104,7 @@ async function H$2(t) {
1088
1104
  })
1089
1105
  ), await t.parent.emit("switchMode", t), t;
1090
1106
  }
1091
- async function N$2(t) {
1107
+ async function H$2(t) {
1092
1108
  return t.el.classList.add(t.getSetting("classModal")), t.dialog.setAttribute("aria-modal", "true"), await t.close(false, false), t.el.dispatchEvent(
1093
1109
  new CustomEvent(t.getSetting("customEventPrefix") + "switchMode", {
1094
1110
  detail: t.parent,
@@ -1096,21 +1112,21 @@ async function N$2(t) {
1096
1112
  })
1097
1113
  ), await t.parent.emit("switchMode", t), t;
1098
1114
  }
1099
- function v$1(t) {
1115
+ function S$1(t) {
1100
1116
  t.dialog && t.state === "opened" ? (t.dialog.querySelector(t.parent.settings.selectorFocus) || t.dialog).focus() : t.trigger && (t.trigger.focus(), t.trigger = null);
1101
1117
  }
1102
- async function u$1(t, e, s = true) {
1103
- return (t.state === "closed" || t.state === "indeterminate" || t.state === null) && (t.setState("opening"), e ?? t.getSetting("transition") ? await w$1(
1118
+ async function d$1(t, e, s = true) {
1119
+ return (t.state === "closed" || t.state === "indeterminate" || t.state === null) && (t.setState("opening"), e ?? t.getSetting("transition") ? await m$1(
1104
1120
  t.el,
1105
1121
  t.getSetting("stateClosed"),
1106
1122
  t.getSetting("stateOpening"),
1107
1123
  t.getSetting("stateOpened"),
1108
1124
  t.getSetting("transitionDuration")
1109
- ) : (t.el.classList.add(t.getSetting("stateOpened")), t.el.classList.remove(t.getSetting("stateClosed"))), t.setState("opened"), t.mode === "modal" && d$1(
1125
+ ) : (t.el.classList.add(t.getSetting("stateOpened")), t.el.classList.remove(t.getSetting("stateClosed"))), t.setState("opened"), t.mode === "modal" && c$1(
1110
1126
  true,
1111
1127
  t.getSetting("selectorInert"),
1112
1128
  t.getSetting("selectorOverflow")
1113
- ), s && v$1(t), t.el.dispatchEvent(
1129
+ ), s && S$1(t), t.el.dispatchEvent(
1114
1130
  new CustomEvent(t.getSetting("customEventPrefix") + "opened", {
1115
1131
  detail: t.parent,
1116
1132
  bubbles: true
@@ -1118,27 +1134,27 @@ async function u$1(t, e, s = true) {
1118
1134
  ), await t.parent.emit("opened", t)), t;
1119
1135
  }
1120
1136
  async function g(t, e, s = true) {
1121
- return (t.state === "opened" || t.state === "indeterminate" || t.state === null) && (t.setState("closing"), document.activeElement && document.activeElement instanceof HTMLElement && document.activeElement.blur(), e ?? t.getSetting("transition") ? await w$1(
1137
+ return (t.state === "opened" || t.state === "indeterminate" || t.state === null) && (t.setState("closing"), document.activeElement && document.activeElement instanceof HTMLElement && document.activeElement.blur(), e ?? t.getSetting("transition") ? await m$1(
1122
1138
  t.el,
1123
1139
  t.getSetting("stateOpened"),
1124
1140
  t.getSetting("stateClosing"),
1125
1141
  t.getSetting("stateClosed"),
1126
1142
  t.getSetting("transitionDuration")
1127
- ) : (t.el.classList.add(t.getSetting("stateClosed")), t.el.classList.remove(t.getSetting("stateOpened"))), t.setState("closed"), t.mode === "modal" && d$1(
1143
+ ) : (t.el.classList.add(t.getSetting("stateClosed")), t.el.classList.remove(t.getSetting("stateOpened"))), t.setState("closed"), t.mode === "modal" && c$1(
1128
1144
  false,
1129
1145
  t.getSetting("selectorInert"),
1130
1146
  t.getSetting("selectorOverflow")
1131
- ), s && v$1(t), t.el.dispatchEvent(
1147
+ ), s && S$1(t), t.el.dispatchEvent(
1132
1148
  new CustomEvent(t.getSetting("customEventPrefix") + "closed", {
1133
1149
  detail: t.parent,
1134
1150
  bubbles: true
1135
1151
  })
1136
1152
  ), await t.parent.emit("closed", t)), t;
1137
1153
  }
1138
- async function E$2(t, e, s) {
1139
- return t.state === "closed" ? u$1(t, e, s) : g(t, e, s);
1154
+ async function v$1(t, e, s) {
1155
+ return t.state === "closed" ? d$1(t, e, s) : g(t, e, s);
1140
1156
  }
1141
- class F extends S$1 {
1157
+ class N extends w$1 {
1142
1158
  #t;
1143
1159
  constructor(e, s, i = {}) {
1144
1160
  super(e, s, i), this.#t = "indeterminate", this.dialog = this.el.querySelector(this.getSetting("selectorDialog")) || this.el, this.trigger = null, this.state = null, this.inlineState = null;
@@ -1147,7 +1163,7 @@ class F extends S$1 {
1147
1163
  return this.#t;
1148
1164
  }
1149
1165
  set mode(e) {
1150
- this.#t !== e && (this.#t = e, q$2(this));
1166
+ this.#t !== e && (this.#t = e, j$2(this));
1151
1167
  }
1152
1168
  setState(e) {
1153
1169
  this.state = e;
@@ -1169,13 +1185,13 @@ class F extends S$1 {
1169
1185
  return this.setState("indeterminate"), this;
1170
1186
  }
1171
1187
  async open(e, s) {
1172
- return u$1(this, e, s);
1188
+ return d$1(this, e, s);
1173
1189
  }
1174
1190
  async close(e, s) {
1175
1191
  return g(this, e, s);
1176
1192
  }
1177
1193
  async toggle(e, s) {
1178
- return E$2(this, e, s);
1194
+ return v$1(this, e, s);
1179
1195
  }
1180
1196
  async deregister() {
1181
1197
  return this.parent.deregister(this.id);
@@ -1187,13 +1203,7 @@ class F extends S$1 {
1187
1203
  this.mode === "modal" && this.state === "opened" && await this.close(false);
1188
1204
  }
1189
1205
  }
1190
- function l$1(t) {
1191
- const e = this.get(t);
1192
- if (e)
1193
- return e;
1194
- throw new Error(`Drawer not found in collection with id of "${t}"`);
1195
- }
1196
- async function U$1(t) {
1206
+ async function F$1(t) {
1197
1207
  const e = t.target;
1198
1208
  if (e) {
1199
1209
  const s = e.closest(`
@@ -1203,18 +1213,18 @@ async function U$1(t) {
1203
1213
  `);
1204
1214
  if (s) {
1205
1215
  t.preventDefault(), s.matches(`[data-${this.settings.dataToggle}]`) && s.getAttribute(`data-${this.settings.dataToggle}`)?.trim().split(" ")?.forEach((n) => {
1206
- const a2 = l$1.call(this, n);
1207
- return a2.trigger = s, a2.toggle();
1216
+ const o = this.getOrThrow(n);
1217
+ return o.trigger = s, o.toggle();
1208
1218
  }), s.matches(`[data-${this.settings.dataOpen}]`) && s.getAttribute(`data-${this.settings.dataOpen}`)?.trim().split(" ")?.forEach((n) => {
1209
- const a2 = l$1.call(this, n);
1210
- return a2.trigger = s, a2.open();
1219
+ const o = this.getOrThrow(n);
1220
+ return o.trigger = s, o.open();
1211
1221
  }), s.matches(`[data-${this.settings.dataClose}]`) && s.getAttribute(`data-${this.settings.dataClose}`)?.trim().split(" ")?.forEach((n) => {
1212
1222
  if (n) {
1213
- const a2 = l$1.call(this, n);
1214
- return a2.trigger = s, a2.close();
1223
+ const o = this.getOrThrow(n);
1224
+ return o.trigger = s, o.close();
1215
1225
  } else {
1216
- const a2 = e.closest(this.settings.selector);
1217
- if (a2) return this.close(a2.id);
1226
+ const o = e.closest(this.settings.selector);
1227
+ if (o) return this.close(o.id);
1218
1228
  }
1219
1229
  });
1220
1230
  return;
@@ -1223,30 +1233,30 @@ async function U$1(t) {
1223
1233
  return this.close(this.activeModal.id);
1224
1234
  }
1225
1235
  }
1226
- function _(t) {
1236
+ function U$1(t) {
1227
1237
  if (t.key === "Escape" && this.activeModal)
1228
1238
  return this.close(this.activeModal.id);
1229
1239
  }
1230
- let z$2 = class z2 extends T$2 {
1240
+ class _ extends D$2 {
1231
1241
  #t;
1232
1242
  #e;
1233
1243
  constructor(e) {
1234
- super({ ...j$2, ...e }), this.module = "Drawer", this.entryClass = F, this.#t = U$1.bind(this), this.#e = _.bind(this);
1244
+ super({ ...k$2, ...e }), this.module = "Drawer", this.entryClass = N, this.#t = F$1.bind(this), this.#e = U$1.bind(this);
1235
1245
  }
1236
1246
  get activeModal() {
1237
1247
  return this.collection.find((e) => e.state === "opened" && e.mode === "modal");
1238
1248
  }
1239
1249
  async open(e, s, i) {
1240
- const n = l$1.call(this, e);
1241
- return u$1(n, s, i);
1250
+ const n = this.getOrThrow(e);
1251
+ return d$1(n, s, i);
1242
1252
  }
1243
1253
  async close(e, s, i) {
1244
- const n = l$1.call(this, e);
1254
+ const n = this.getOrThrow(e);
1245
1255
  return g(n, s, i);
1246
1256
  }
1247
1257
  async toggle(e, s, i) {
1248
- const n = l$1.call(this, e);
1249
- return E$2(n, s, i);
1258
+ const n = this.getOrThrow(e);
1259
+ return v$1(n, s, i);
1250
1260
  }
1251
1261
  async afterMount() {
1252
1262
  document.addEventListener("click", this.#t, false), document.addEventListener("keydown", this.#e, false);
@@ -1254,12 +1264,12 @@ let z$2 = class z2 extends T$2 {
1254
1264
  async afterUnmount() {
1255
1265
  document.removeEventListener("click", this.#t, false), document.removeEventListener("keydown", this.#e, false);
1256
1266
  }
1257
- };
1258
- function C(e, t = "config") {
1267
+ }
1268
+ function y2(e, t = "config") {
1259
1269
  const s = (e.getAttribute(`data-${t}`) || "").replace(/'/g, '"');
1260
1270
  return s ? JSON.parse(s) : {};
1261
1271
  }
1262
- function p(e) {
1272
+ function f(e) {
1263
1273
  if (typeof e == "string") {
1264
1274
  const t = document.getElementById(e);
1265
1275
  if (t) return t;
@@ -1274,15 +1284,15 @@ function p(e) {
1274
1284
  async function r(e, t, ...s) {
1275
1285
  t in e && typeof e[t] == "function" && await e[t](...s);
1276
1286
  }
1277
- function S2(e) {
1287
+ function C(e) {
1278
1288
  return e.split("-").map(
1279
1289
  (t, s) => s === 0 ? t : t.charAt(0).toUpperCase() + t.slice(1)
1280
1290
  ).join("");
1281
1291
  }
1282
- function m(e) {
1292
+ function p(e) {
1283
1293
  return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
1284
1294
  }
1285
- function E$1(e) {
1295
+ function S(e) {
1286
1296
  if (typeof e == "number")
1287
1297
  return e;
1288
1298
  const t = parseFloat(e);
@@ -1292,11 +1302,11 @@ function E$1(e) {
1292
1302
  }
1293
1303
  throw new Error(`Could not convert value to milliseconds: ${e}`);
1294
1304
  }
1295
- function w(e, t, s, i, n = 0) {
1296
- return new Promise((o2) => {
1305
+ function m(e, t, s, i, n = 0) {
1306
+ return new Promise((o) => {
1297
1307
  e.classList.remove(t), e.classList.add(s), setTimeout(() => {
1298
- e.classList.add(i), e.classList.remove(s), o2(e);
1299
- }, E$1(n));
1308
+ e.classList.add(i), e.classList.remove(s), o(e);
1309
+ }, S(n));
1300
1310
  });
1301
1311
  }
1302
1312
  async function a(e, t, s) {
@@ -1305,48 +1315,48 @@ async function a(e, t, s) {
1305
1315
  await r(i, e, { plugin: i, parent: t, entry: s });
1306
1316
  await t.emit(e, s);
1307
1317
  }
1308
- function b(e) {
1318
+ function E$1(e) {
1309
1319
  const t = getComputedStyle(e.el), s = {}, i = e.getSetting("customProps");
1310
1320
  for (let n = 0; n < i.length; n++) {
1311
- const o2 = A(), c = e.parent.module.toLowerCase(), g2 = m(i[n]), f2 = t.getPropertyValue(`--${o2}${c}-${g2}`).trim();
1312
- f2 && (s[g2] = f2);
1321
+ const o = b(), l = e.parent.module.toLowerCase(), u2 = p(i[n]), g2 = t.getPropertyValue(`--${o}${l}-${u2}`).trim();
1322
+ g2 && (s[u2] = g2);
1313
1323
  }
1314
1324
  return s;
1315
1325
  }
1316
- function A() {
1326
+ function b() {
1317
1327
  return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim();
1318
1328
  }
1319
- function x(e, t, s = "camel") {
1320
- return t = s === "camel" ? S2(t) : m(t), e.split(".").concat(t).reduce((i, n) => i?.[n], this);
1329
+ function O2(e, t, s = "camel") {
1330
+ return t = s === "camel" ? C(t) : p(t), e.split(".").concat(t).reduce((i, n) => i?.[n], this);
1321
1331
  }
1322
- function L(e, t = {}) {
1332
+ function x(e, t = {}) {
1323
1333
  const {
1324
1334
  fallback: s,
1325
1335
  props: i = ["dataConfig", "customProps", "settings", "parent.settings"]
1326
1336
  } = t;
1327
1337
  for (const n of i) {
1328
- const o2 = n !== "customProps" ? "camel" : "kebab", c = x.call(this, n, e, o2);
1329
- if (c !== void 0)
1330
- return c;
1338
+ const o = n !== "customProps" ? "camel" : "kebab", l = O2.call(this, n, e, o);
1339
+ if (l !== void 0)
1340
+ return l;
1331
1341
  }
1332
1342
  if (s !== void 0)
1333
1343
  return s;
1334
1344
  throw new Error(`${this.parent.module} setting does not exist: ${e}`);
1335
1345
  }
1336
- function O2(e, t) {
1346
+ function L(e, t) {
1337
1347
  t && document.querySelectorAll(t).forEach((s) => {
1338
1348
  e ? s.style.overflow = "hidden" : s.style.removeProperty("overflow");
1339
1349
  });
1340
1350
  }
1341
- function P$1(e, t) {
1351
+ function A(e, t) {
1342
1352
  t && document.querySelectorAll(t).forEach((s) => {
1343
- e ? (s.inert = true, s.setAttribute("aria-hidden", "true")) : (s.inert = false, s.removeAttribute("aria-hidden"));
1353
+ s.inert = e;
1344
1354
  });
1345
1355
  }
1346
1356
  function $(e, t, s) {
1347
- P$1(!!e, t), O2(!!e, s);
1357
+ A(!!e, t), L(!!e, s);
1348
1358
  }
1349
- const I$1 = {
1359
+ const P$1 = {
1350
1360
  events: {},
1351
1361
  on(e, t, ...s) {
1352
1362
  this.events[e] || (this.events[e] = []), this.events[e].some(
@@ -1364,7 +1374,7 @@ const I$1 = {
1364
1374
  await s(t, ...i);
1365
1375
  }
1366
1376
  };
1367
- class M extends Array {
1377
+ let I$1 = class I extends Array {
1368
1378
  constructor(t = {}) {
1369
1379
  super(), this.presets = t;
1370
1380
  }
@@ -1390,8 +1400,8 @@ class M extends Array {
1390
1400
  const s = this.findIndex((i) => i.name === t);
1391
1401
  ~s && this.splice(s, 1);
1392
1402
  }
1393
- }
1394
- let k$1 = class k extends Array {
1403
+ };
1404
+ let T$1 = class T extends Array {
1395
1405
  constructor(t = {}) {
1396
1406
  super(), this.settings = t;
1397
1407
  }
@@ -1423,13 +1433,13 @@ let k$1 = class k extends Array {
1423
1433
  ~s && (this.splice(s, 1), this.add(t));
1424
1434
  }
1425
1435
  };
1426
- const D$1 = {
1436
+ const k$1 = {
1427
1437
  dataConfig: "config",
1428
1438
  customProps: []
1429
1439
  };
1430
- class v {
1440
+ class w2 {
1431
1441
  constructor(t, s, i = {}) {
1432
- this.parent = t, this.el = p(s), this.settings = { ...i }, this.dataConfig = {}, this.customProps = {};
1442
+ this.parent = t, this.el = f(s), this.settings = { ...i }, this.dataConfig = {}, this.customProps = {};
1433
1443
  }
1434
1444
  get id() {
1435
1445
  return this.el.id;
@@ -1438,16 +1448,16 @@ class v {
1438
1448
  return Object.assign(this.settings, t);
1439
1449
  }
1440
1450
  getSetting(t, s) {
1441
- return L.call(this, t, s);
1451
+ return x.call(this, t, s);
1442
1452
  }
1443
1453
  buildDataConfig() {
1444
1454
  return Object.assign(
1445
1455
  this.dataConfig,
1446
- C(this.el, this.getSetting("dataConfig"))
1456
+ y2(this.el, this.getSetting("dataConfig"))
1447
1457
  );
1448
1458
  }
1449
1459
  buildCustomProps() {
1450
- return Object.assign(this.customProps, b(this));
1460
+ return Object.assign(this.customProps, E$1(this));
1451
1461
  }
1452
1462
  async init(t = {}) {
1453
1463
  this.applySettings(t), this.buildDataConfig(), this.buildCustomProps();
@@ -1458,13 +1468,21 @@ class v {
1458
1468
  });
1459
1469
  }
1460
1470
  }
1461
- let q$1 = class q {
1471
+ class M {
1462
1472
  constructor(t = {}) {
1463
- this.module = this.constructor.name, this.collection = [], this.entryClass = v, this.settings = { ...D$1, ...t }, this.plugins = new M(this.settings.presets), this.events = {}, Object.assign(this, I$1);
1473
+ this.module = this.constructor.name, this.collection = [], this.entryClass = w2, this.settings = { ...k$1, ...t }, this.plugins = new I$1(this.settings.presets), this.events = {}, Object.assign(this, P$1);
1464
1474
  }
1465
1475
  get(t, s = "id") {
1466
1476
  return this.collection.find((i) => i[s] === t);
1467
1477
  }
1478
+ getOrThrow(t, s = "id") {
1479
+ const i = this.get(t, s);
1480
+ if (i)
1481
+ return i;
1482
+ throw new Error(
1483
+ `${this.module} entry not found in collection with ${s} of "${t}"`
1484
+ );
1485
+ }
1468
1486
  applySettings(t) {
1469
1487
  return Object.assign(this.settings, t);
1470
1488
  }
@@ -1476,13 +1494,13 @@ let q$1 = class q {
1476
1494
  return await a("onDestroyEntry", this, t), await r(t, "destroy"), t;
1477
1495
  }
1478
1496
  async register(t, s = {}) {
1479
- const i = p(t), n = this.collection.findIndex((o2) => o2.id === i.id);
1497
+ const i = f(t), n = this.collection.findIndex((o) => o.id === i.id);
1480
1498
  if (~n) {
1481
- const o2 = this.collection[n];
1482
- return o2.el = i, typeof o2.init == "function" && await o2.init(s), o2;
1499
+ const o = this.collection[n];
1500
+ return o.el = i, typeof o.init == "function" && await o.init(s), o;
1483
1501
  } else {
1484
- const o2 = await this.createEntry(i, s);
1485
- return this.collection.push(o2), await a("onRegisterEntry", this, o2), o2;
1502
+ const o = await this.createEntry(i, s);
1503
+ return this.collection.push(o), await a("onRegisterEntry", this, o), o;
1486
1504
  }
1487
1505
  }
1488
1506
  async deregister(t) {
@@ -1519,8 +1537,8 @@ let q$1 = class q {
1519
1537
  this.plugins.remove(t.name);
1520
1538
  return this;
1521
1539
  }
1522
- };
1523
- const T$1 = {
1540
+ }
1541
+ const D$1 = {
1524
1542
  // Data attributes
1525
1543
  dataOpen: "modal-open",
1526
1544
  dataClose: "modal-close",
@@ -1545,45 +1563,45 @@ const T$1 = {
1545
1563
  transition: true,
1546
1564
  transitionDuration: 300
1547
1565
  };
1548
- function d(e) {
1566
+ function c(e) {
1549
1567
  e.active ? (e.active.dialog.querySelector(e.settings.selectorFocus) || e.active.dialog).focus() : e.trigger && (e.trigger.focus(), e.trigger = null);
1550
1568
  }
1551
- async function u(e, t, s = true) {
1552
- return e.parent.stack.moveToTop(e), e.state === "closed" && (e.state = "opening", e.parent.stack.add(e), t ?? e.getSetting("transition") ? await w(
1569
+ async function h(e, t, s = true) {
1570
+ return e.parent.stack.moveToTop(e), e.state === "closed" && (e.state = "opening", e.parent.stack.add(e), t ?? e.getSetting("transition") ? await m(
1553
1571
  e.el,
1554
1572
  e.getSetting("stateClosed"),
1555
1573
  e.getSetting("stateOpening"),
1556
1574
  e.getSetting("stateOpened"),
1557
1575
  e.getSetting("transitionDuration")
1558
- ) : (e.el.classList.add(e.getSetting("stateOpened")), e.el.classList.remove(e.getSetting("stateClosed"))), e.state = "opened"), s && d(e.parent), e.el.dispatchEvent(
1576
+ ) : (e.el.classList.add(e.getSetting("stateOpened")), e.el.classList.remove(e.getSetting("stateClosed"))), e.state = "opened"), s && c(e.parent), e.el.dispatchEvent(
1559
1577
  new CustomEvent(e.getSetting("customEventPrefix") + "opened", {
1560
1578
  detail: e.parent,
1561
1579
  bubbles: true
1562
1580
  })
1563
1581
  ), await e.parent.emit("opened", e), e;
1564
1582
  }
1565
- async function h(e, t, s = true) {
1566
- return e && e.state === "opened" && (e.state = "closing", document.activeElement && document.activeElement instanceof HTMLElement && document.activeElement.blur(), t ?? e.getSetting("transition") ? await w(
1583
+ async function d(e, t, s = true) {
1584
+ return e && e.state === "opened" && (e.state = "closing", document.activeElement && document.activeElement instanceof HTMLElement && document.activeElement.blur(), t ?? e.getSetting("transition") ? await m(
1567
1585
  e.el,
1568
1586
  e.getSetting("stateOpened"),
1569
1587
  e.getSetting("stateClosing"),
1570
1588
  e.getSetting("stateClosed"),
1571
1589
  e.getSetting("transitionDuration")
1572
- ) : (e.el.classList.add(e.getSetting("stateClosed")), e.el.classList.remove(e.getSetting("stateOpened"))), e.parent.stack.remove(e), e.state = "closed", s && d(e.parent), e.el.dispatchEvent(
1590
+ ) : (e.el.classList.add(e.getSetting("stateClosed")), e.el.classList.remove(e.getSetting("stateOpened"))), e.parent.stack.remove(e), e.state = "closed", s && c(e.parent), e.el.dispatchEvent(
1573
1591
  new CustomEvent(e.getSetting("customEventPrefix") + "closed", {
1574
1592
  detail: e.parent,
1575
1593
  bubbles: true
1576
1594
  })
1577
1595
  ), await e.parent.emit("closed", e)), e;
1578
1596
  }
1579
- async function y2(e, t, s = true) {
1597
+ async function v(e, t, s = true) {
1580
1598
  let i, n;
1581
1599
  return e.state === "opened" ? (i = e, n = await e.parent.closeAll(e.id, t)) : [n, i] = await Promise.all([
1582
1600
  e.parent.closeAll("", t),
1583
- u(e, t, false)
1584
- ]), s && d(e.parent), { opened: i, closed: n };
1601
+ h(e, t, false)
1602
+ ]), s && c(e.parent), { opened: i, closed: n };
1585
1603
  }
1586
- let R$1 = class R extends v {
1604
+ let q$1 = class q extends w2 {
1587
1605
  constructor(t, s, i = {}) {
1588
1606
  super(t, s, i), this.state = "closed", this.dialog = this.el.querySelector(this.getSetting("selectorDialog")) || this.el;
1589
1607
  }
@@ -1591,13 +1609,13 @@ let R$1 = class R extends v {
1591
1609
  return this.dialog.matches(this.getSetting("selectorRequired"));
1592
1610
  }
1593
1611
  async open(t, s) {
1594
- return u(this, t, s);
1612
+ return h(this, t, s);
1595
1613
  }
1596
1614
  async close(t, s) {
1597
- return h(this, t, s);
1615
+ return d(this, t, s);
1598
1616
  }
1599
1617
  async replace(t, s) {
1600
- return y2(this, t, s);
1618
+ return v(this, t, s);
1601
1619
  }
1602
1620
  async deregister() {
1603
1621
  return this.parent.deregister(this.id);
@@ -1612,13 +1630,7 @@ let R$1 = class R extends v {
1612
1630
  this.state === "opened" && await this.close(false);
1613
1631
  }
1614
1632
  };
1615
- function l(e) {
1616
- const t = this.get(e);
1617
- if (t)
1618
- return t;
1619
- throw new Error(`Modal not found in collection with id of "${e}".`);
1620
- }
1621
- async function j$1(e) {
1633
+ async function R$1(e) {
1622
1634
  const t = e.target;
1623
1635
  if (t) {
1624
1636
  const s = t.closest(`
@@ -1628,11 +1640,11 @@ async function j$1(e) {
1628
1640
  `);
1629
1641
  if (s) {
1630
1642
  if (e.preventDefault(), s.matches(`[data-${this.settings.dataOpen}]`)) {
1631
- const i = s.getAttribute(`data-${this.settings.dataOpen}`)?.trim(), n = l.call(this, i);
1643
+ const i = s.getAttribute(`data-${this.settings.dataOpen}`)?.trim(), n = this.getOrThrow(i);
1632
1644
  return t.closest(this.settings.selector) || (this.trigger = s), n.open();
1633
1645
  }
1634
1646
  if (s.matches(`[data-${this.settings.dataReplace}]`)) {
1635
- const i = s.getAttribute(`data-${this.settings.dataReplace}`)?.trim(), n = l.call(this, i);
1647
+ const i = s.getAttribute(`data-${this.settings.dataReplace}`)?.trim(), n = this.getOrThrow(i);
1636
1648
  return t.closest(this.settings.selector) || (this.trigger = s), n.replace();
1637
1649
  }
1638
1650
  if (s.matches(`[data-${this.settings.dataClose}]`)) {
@@ -1644,23 +1656,23 @@ async function j$1(e) {
1644
1656
  return this.close();
1645
1657
  }
1646
1658
  }
1647
- function z$1(e) {
1659
+ function j$1(e) {
1648
1660
  if (e.key === "Escape" && this.active && !this.active.dialog.matches(this.settings.selectorRequired))
1649
1661
  return this.close();
1650
1662
  }
1651
- async function H$1(e = "", t) {
1663
+ async function z$1(e = "", t) {
1652
1664
  const s = [];
1653
1665
  return await Promise.all(
1654
1666
  this.stack.copy.map(async (i) => {
1655
- e && e === i.id || s.push(await h(i, t, false));
1667
+ e && e === i.id || s.push(await d(i, t, false));
1656
1668
  })
1657
1669
  ), s;
1658
1670
  }
1659
- let N$1 = class N extends q$1 {
1671
+ let H$1 = class H2 extends M {
1660
1672
  #t;
1661
1673
  #e;
1662
1674
  constructor(t) {
1663
- super({ ...T$1, ...t }), this.module = "Modal", this.entryClass = R$1, this.trigger = null, this.#t = j$1.bind(this), this.#e = z$1.bind(this), this.stack = new k$1({
1675
+ super({ ...D$1, ...t }), this.module = "Modal", this.entryClass = q$1, this.trigger = null, this.#t = R$1.bind(this), this.#e = j$1.bind(this), this.stack = new T$1({
1664
1676
  onChange: () => {
1665
1677
  $(
1666
1678
  !!this.stack.top,
@@ -1674,20 +1686,20 @@ let N$1 = class N extends q$1 {
1674
1686
  return this.stack.top;
1675
1687
  }
1676
1688
  async open(t, s, i) {
1677
- const n = l.call(this, t);
1678
- return u(n, s, i);
1689
+ const n = this.getOrThrow(t);
1690
+ return h(n, s, i);
1679
1691
  }
1680
1692
  async close(t, s, i) {
1681
- const n = t ? l.call(this, t) : this.active;
1682
- return h(n, s, i);
1693
+ const n = t ? this.getOrThrow(t) : this.active;
1694
+ return d(n, s, i);
1683
1695
  }
1684
1696
  async replace(t, s, i) {
1685
- const n = l.call(this, t);
1686
- return y2(n, s, i);
1697
+ const n = this.getOrThrow(t);
1698
+ return v(n, s, i);
1687
1699
  }
1688
1700
  async closeAll(t, s, i = true) {
1689
- const n = await H$1.call(this, t, s);
1690
- return i && d(this), n;
1701
+ const n = await z$1.call(this, t, s);
1702
+ return i && c(this), n;
1691
1703
  }
1692
1704
  async afterMount() {
1693
1705
  document.addEventListener("click", this.#t, false), document.addEventListener("keydown", this.#e, false);
@@ -1715,7 +1727,7 @@ function Rt(t) {
1715
1727
  } else
1716
1728
  throw new Error("Invalid argument: query must be a string or HTMLElement");
1717
1729
  }
1718
- async function z3(t, e, ...n) {
1730
+ async function z2(t, e, ...n) {
1719
1731
  e in t && typeof t[e] == "function" && await t[e](...n);
1720
1732
  }
1721
1733
  function Zt(t) {
@@ -1726,17 +1738,17 @@ function Zt(t) {
1726
1738
  function kt(t) {
1727
1739
  return t.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
1728
1740
  }
1729
- async function H2(t, e, n) {
1730
- await z3(e, t, n), n && await z3(n, t);
1741
+ async function H3(t, e, n) {
1742
+ await z2(e, t, n), n && await z2(n, t);
1731
1743
  for (const i of e.plugins)
1732
- await z3(i, t, { plugin: i, parent: e, entry: n });
1744
+ await z2(i, t, { plugin: i, parent: e, entry: n });
1733
1745
  await e.emit(t, n);
1734
1746
  }
1735
1747
  function Gt(t) {
1736
1748
  const e = getComputedStyle(t.el), n = {}, i = t.getSetting("customProps");
1737
1749
  for (let s = 0; s < i.length; s++) {
1738
- const o2 = Qt(), r2 = t.parent.module.toLowerCase(), c = kt(i[s]), l2 = e.getPropertyValue(`--${o2}${r2}-${c}`).trim();
1739
- l2 && (n[c] = l2);
1750
+ const o = Qt(), r2 = t.parent.module.toLowerCase(), c2 = kt(i[s]), l = e.getPropertyValue(`--${o}${r2}-${c2}`).trim();
1751
+ l && (n[c2] = l);
1740
1752
  }
1741
1753
  return n;
1742
1754
  }
@@ -1752,7 +1764,7 @@ function ee(t, e = {}) {
1752
1764
  props: i = ["dataConfig", "customProps", "settings", "parent.settings"]
1753
1765
  } = e;
1754
1766
  for (const s of i) {
1755
- const o2 = s !== "customProps" ? "camel" : "kebab", r2 = te.call(this, s, t, o2);
1767
+ const o = s !== "customProps" ? "camel" : "kebab", r2 = te.call(this, s, t, o);
1756
1768
  if (r2 !== void 0)
1757
1769
  return r2;
1758
1770
  }
@@ -1847,31 +1859,39 @@ class oe {
1847
1859
  get(e, n = "id") {
1848
1860
  return this.collection.find((i) => i[n] === e);
1849
1861
  }
1862
+ getOrThrow(e, n = "id") {
1863
+ const i = this.get(e, n);
1864
+ if (i)
1865
+ return i;
1866
+ throw new Error(
1867
+ `${this.module} entry not found in collection with ${n} of "${e}"`
1868
+ );
1869
+ }
1850
1870
  applySettings(e) {
1851
1871
  return Object.assign(this.settings, e);
1852
1872
  }
1853
1873
  async createEntry(e, n) {
1854
1874
  const i = new this.entryClass(this, e, n);
1855
- return await z3(i, "init"), await H2("onCreateEntry", this, i), i;
1875
+ return await z2(i, "init"), await H3("onCreateEntry", this, i), i;
1856
1876
  }
1857
1877
  async destroyEntry(e) {
1858
- return await H2("onDestroyEntry", this, e), await z3(e, "destroy"), e;
1878
+ return await H3("onDestroyEntry", this, e), await z2(e, "destroy"), e;
1859
1879
  }
1860
1880
  async register(e, n = {}) {
1861
- const i = Rt(e), s = this.collection.findIndex((o2) => o2.id === i.id);
1881
+ const i = Rt(e), s = this.collection.findIndex((o) => o.id === i.id);
1862
1882
  if (~s) {
1863
- const o2 = this.collection[s];
1864
- return o2.el = i, typeof o2.init == "function" && await o2.init(n), o2;
1883
+ const o = this.collection[s];
1884
+ return o.el = i, typeof o.init == "function" && await o.init(n), o;
1865
1885
  } else {
1866
- const o2 = await this.createEntry(i, n);
1867
- return this.collection.push(o2), await H2("onRegisterEntry", this, o2), o2;
1886
+ const o = await this.createEntry(i, n);
1887
+ return this.collection.push(o), await H3("onRegisterEntry", this, o), o;
1868
1888
  }
1869
1889
  }
1870
1890
  async deregister(e) {
1871
1891
  const n = this.collection.findIndex((i) => i.id === e);
1872
1892
  if (~n) {
1873
1893
  const i = await this.destroyEntry(this.collection[n]);
1874
- return await H2(
1894
+ return await H3(
1875
1895
  "onDeregisterEntry",
1876
1896
  this,
1877
1897
  this.collection[n]
@@ -1884,19 +1904,19 @@ class oe {
1884
1904
  for (const i of this.settings?.plugins || [])
1885
1905
  this.plugins.add(i);
1886
1906
  for (const i of this.plugins)
1887
- await z3(i, "setup", { plugin: i, parent: this });
1888
- await H2("beforeMount", this);
1907
+ await z2(i, "setup", { plugin: i, parent: this });
1908
+ await H3("beforeMount", this);
1889
1909
  const n = document.querySelectorAll(this.settings.selector);
1890
1910
  for (const i of n)
1891
1911
  await this.register(i);
1892
- return await H2("afterMount", this), this;
1912
+ return await H3("afterMount", this), this;
1893
1913
  }
1894
1914
  async unmount() {
1895
- for (await H2("beforeUnmount", this); this.collection.length > 0; )
1915
+ for (await H3("beforeUnmount", this); this.collection.length > 0; )
1896
1916
  await this.deregister(this.collection[0].id);
1897
- await H2("afterUnmount", this);
1917
+ await H3("afterUnmount", this);
1898
1918
  for (const e of this.plugins)
1899
- await z3(e, "teardown", { plugin: e, parent: this });
1919
+ await z2(e, "teardown", { plugin: e, parent: this });
1900
1920
  for (const e of [...this.plugins])
1901
1921
  this.plugins.remove(e.name);
1902
1922
  return this;
@@ -1927,7 +1947,7 @@ const re = {
1927
1947
  shiftPadding: 0,
1928
1948
  arrowPadding: 0,
1929
1949
  toggleDelay: 0
1930
- }, K = Math.min, j = Math.max, st = Math.round, it = Math.floor, R2 = (t) => ({
1950
+ }, Y = Math.min, j = Math.max, st = Math.round, it = Math.floor, R = (t) => ({
1931
1951
  x: t,
1932
1952
  y: t
1933
1953
  }), ce = {
@@ -1939,42 +1959,42 @@ const re = {
1939
1959
  start: "end",
1940
1960
  end: "start"
1941
1961
  };
1942
- function dt(t, e, n) {
1943
- return j(t, K(e, n));
1962
+ function gt(t, e, n) {
1963
+ return j(t, Y(e, n));
1944
1964
  }
1945
1965
  function q2(t, e) {
1946
1966
  return typeof t == "function" ? t(e) : t;
1947
1967
  }
1948
- function I(t) {
1968
+ function I2(t) {
1949
1969
  return t.split("-")[0];
1950
1970
  }
1951
1971
  function et2(t) {
1952
1972
  return t.split("-")[1];
1953
1973
  }
1954
- function mt(t) {
1974
+ function pt(t) {
1955
1975
  return t === "x" ? "y" : "x";
1956
1976
  }
1957
- function pt(t) {
1977
+ function wt(t) {
1958
1978
  return t === "y" ? "height" : "width";
1959
1979
  }
1960
1980
  const ae = /* @__PURE__ */ new Set(["top", "bottom"]);
1961
- function N2(t) {
1962
- return ae.has(I(t)) ? "y" : "x";
1981
+ function F(t) {
1982
+ return ae.has(I2(t)) ? "y" : "x";
1963
1983
  }
1964
- function wt(t) {
1965
- return mt(N2(t));
1984
+ function yt(t) {
1985
+ return pt(F(t));
1966
1986
  }
1967
1987
  function fe(t, e, n) {
1968
1988
  n === void 0 && (n = false);
1969
- const i = et2(t), s = wt(t), o2 = pt(s);
1989
+ const i = et2(t), s = yt(t), o = wt(s);
1970
1990
  let r2 = s === "x" ? i === (n ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
1971
- return e.reference[o2] > e.floating[o2] && (r2 = ot(r2)), [r2, ot(r2)];
1991
+ return e.reference[o] > e.floating[o] && (r2 = ot(r2)), [r2, ot(r2)];
1972
1992
  }
1973
1993
  function ue(t) {
1974
1994
  const e = ot(t);
1975
- return [gt(t), e, gt(e)];
1995
+ return [ht(t), e, ht(e)];
1976
1996
  }
1977
- function gt(t) {
1997
+ function ht(t) {
1978
1998
  return t.replace(/start|end/g, (e) => le[e]);
1979
1999
  }
1980
2000
  const At = ["left", "right"], Et = ["right", "left"], de = ["top", "bottom"], ge = ["bottom", "top"];
@@ -1992,8 +2012,8 @@ function he(t, e, n) {
1992
2012
  }
1993
2013
  function me(t, e, n, i) {
1994
2014
  const s = et2(t);
1995
- let o2 = he(I(t), n === "start", i);
1996
- return s && (o2 = o2.map((r2) => r2 + "-" + s), e && (o2 = o2.concat(o2.map(gt)))), o2;
2015
+ let o = he(I2(t), n === "start", i);
2016
+ return s && (o = o.map((r2) => r2 + "-" + s), e && (o = o.concat(o.map(ht)))), o;
1997
2017
  }
1998
2018
  function ot(t) {
1999
2019
  return t.replace(/left|right|bottom|top/g, (e) => ce[e]);
@@ -2038,9 +2058,9 @@ function Ct(t, e, n) {
2038
2058
  reference: i,
2039
2059
  floating: s
2040
2060
  } = t;
2041
- const o2 = N2(e), r2 = wt(e), c = pt(r2), l2 = I(e), a2 = o2 === "y", d2 = i.x + i.width / 2 - s.width / 2, u2 = i.y + i.height / 2 - s.height / 2, g2 = i[c] / 2 - s[c] / 2;
2061
+ const o = F(e), r2 = yt(e), c2 = wt(r2), l = I2(e), a2 = o === "y", d2 = i.x + i.width / 2 - s.width / 2, u2 = i.y + i.height / 2 - s.height / 2, g2 = i[c2] / 2 - s[c2] / 2;
2042
2062
  let f2;
2043
- switch (l2) {
2063
+ switch (l) {
2044
2064
  case "top":
2045
2065
  f2 = {
2046
2066
  x: d2,
@@ -2085,9 +2105,9 @@ const we = async (t, e, n) => {
2085
2105
  const {
2086
2106
  placement: i = "bottom",
2087
2107
  strategy: s = "absolute",
2088
- middleware: o2 = [],
2108
+ middleware: o = [],
2089
2109
  platform: r2
2090
- } = n, c = o2.filter(Boolean), l2 = await (r2.isRTL == null ? void 0 : r2.isRTL(e));
2110
+ } = n, c2 = o.filter(Boolean), l = await (r2.isRTL == null ? void 0 : r2.isRTL(e));
2091
2111
  let a2 = await r2.getElementRects({
2092
2112
  reference: t,
2093
2113
  floating: e,
@@ -2095,17 +2115,17 @@ const we = async (t, e, n) => {
2095
2115
  }), {
2096
2116
  x: d2,
2097
2117
  y: u2
2098
- } = Ct(a2, i, l2), g2 = i, f2 = {}, h2 = 0;
2099
- for (let m2 = 0; m2 < c.length; m2++) {
2118
+ } = Ct(a2, i, l), g2 = i, f2 = {}, h2 = 0;
2119
+ for (let m2 = 0; m2 < c2.length; m2++) {
2100
2120
  const {
2101
2121
  name: p2,
2102
- fn: w2
2103
- } = c[m2], {
2122
+ fn: w3
2123
+ } = c2[m2], {
2104
2124
  x: y3,
2105
2125
  y: x2,
2106
- data: b2,
2107
- reset: v2
2108
- } = await w2({
2126
+ data: v2,
2127
+ reset: b2
2128
+ } = await w3({
2109
2129
  x: d2,
2110
2130
  y: u2,
2111
2131
  initialPlacement: i,
@@ -2123,16 +2143,16 @@ const we = async (t, e, n) => {
2123
2143
  ...f2,
2124
2144
  [p2]: {
2125
2145
  ...f2[p2],
2126
- ...b2
2146
+ ...v2
2127
2147
  }
2128
- }, v2 && h2 <= 50 && (h2++, typeof v2 == "object" && (v2.placement && (g2 = v2.placement), v2.rects && (a2 = v2.rects === true ? await r2.getElementRects({
2148
+ }, b2 && h2 <= 50 && (h2++, typeof b2 == "object" && (b2.placement && (g2 = b2.placement), b2.rects && (a2 = b2.rects === true ? await r2.getElementRects({
2129
2149
  reference: t,
2130
2150
  floating: e,
2131
2151
  strategy: s
2132
- }) : v2.rects), {
2152
+ }) : b2.rects), {
2133
2153
  x: d2,
2134
2154
  y: u2
2135
- } = Ct(a2, g2, l2)), m2 = -1);
2155
+ } = Ct(a2, g2, l)), m2 = -1);
2136
2156
  }
2137
2157
  return {
2138
2158
  x: d2,
@@ -2148,43 +2168,43 @@ async function $t(t, e) {
2148
2168
  const {
2149
2169
  x: i,
2150
2170
  y: s,
2151
- platform: o2,
2171
+ platform: o,
2152
2172
  rects: r2,
2153
- elements: c,
2154
- strategy: l2
2173
+ elements: c2,
2174
+ strategy: l
2155
2175
  } = t, {
2156
2176
  boundary: a2 = "clippingAncestors",
2157
2177
  rootBoundary: d2 = "viewport",
2158
2178
  elementContext: u2 = "floating",
2159
2179
  altBoundary: g2 = false,
2160
2180
  padding: f2 = 0
2161
- } = q2(e, t), h2 = Mt(f2), p2 = c[g2 ? u2 === "floating" ? "reference" : "floating" : u2], w2 = rt(await o2.getClippingRect({
2162
- element: (n = await (o2.isElement == null ? void 0 : o2.isElement(p2))) == null || n ? p2 : p2.contextElement || await (o2.getDocumentElement == null ? void 0 : o2.getDocumentElement(c.floating)),
2181
+ } = q2(e, t), h2 = Mt(f2), p2 = c2[g2 ? u2 === "floating" ? "reference" : "floating" : u2], w3 = rt(await o.getClippingRect({
2182
+ element: (n = await (o.isElement == null ? void 0 : o.isElement(p2))) == null || n ? p2 : p2.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(c2.floating)),
2163
2183
  boundary: a2,
2164
2184
  rootBoundary: d2,
2165
- strategy: l2
2185
+ strategy: l
2166
2186
  })), y3 = u2 === "floating" ? {
2167
2187
  x: i,
2168
2188
  y: s,
2169
2189
  width: r2.floating.width,
2170
2190
  height: r2.floating.height
2171
- } : r2.reference, x2 = await (o2.getOffsetParent == null ? void 0 : o2.getOffsetParent(c.floating)), b2 = await (o2.isElement == null ? void 0 : o2.isElement(x2)) ? await (o2.getScale == null ? void 0 : o2.getScale(x2)) || {
2191
+ } : r2.reference, x2 = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c2.floating)), v2 = await (o.isElement == null ? void 0 : o.isElement(x2)) ? await (o.getScale == null ? void 0 : o.getScale(x2)) || {
2172
2192
  x: 1,
2173
2193
  y: 1
2174
2194
  } : {
2175
2195
  x: 1,
2176
2196
  y: 1
2177
- }, v2 = rt(o2.convertOffsetParentRelativeRectToViewportRelativeRect ? await o2.convertOffsetParentRelativeRectToViewportRelativeRect({
2178
- elements: c,
2197
+ }, b2 = rt(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
2198
+ elements: c2,
2179
2199
  rect: y3,
2180
2200
  offsetParent: x2,
2181
- strategy: l2
2201
+ strategy: l
2182
2202
  }) : y3);
2183
2203
  return {
2184
- top: (w2.top - v2.top + h2.top) / b2.y,
2185
- bottom: (v2.bottom - w2.bottom + h2.bottom) / b2.y,
2186
- left: (w2.left - v2.left + h2.left) / b2.x,
2187
- right: (v2.right - w2.right + h2.right) / b2.x
2204
+ top: (w3.top - b2.top + h2.top) / v2.y,
2205
+ bottom: (b2.bottom - w3.bottom + h2.bottom) / v2.y,
2206
+ left: (w3.left - b2.left + h2.left) / v2.x,
2207
+ right: (b2.right - w3.right + h2.right) / v2.x
2188
2208
  };
2189
2209
  }
2190
2210
  const ye = (t) => ({
@@ -2195,10 +2215,10 @@ const ye = (t) => ({
2195
2215
  x: n,
2196
2216
  y: i,
2197
2217
  placement: s,
2198
- rects: o2,
2218
+ rects: o,
2199
2219
  platform: r2,
2200
- elements: c,
2201
- middlewareData: l2
2220
+ elements: c2,
2221
+ middlewareData: l
2202
2222
  } = e, {
2203
2223
  element: a2,
2204
2224
  padding: d2 = 0
@@ -2208,10 +2228,10 @@ const ye = (t) => ({
2208
2228
  const u2 = Mt(d2), g2 = {
2209
2229
  x: n,
2210
2230
  y: i
2211
- }, f2 = wt(s), h2 = pt(f2), m2 = await r2.getDimensions(a2), p2 = f2 === "y", w2 = p2 ? "top" : "left", y3 = p2 ? "bottom" : "right", x2 = p2 ? "clientHeight" : "clientWidth", b2 = o2.reference[h2] + o2.reference[f2] - g2[f2] - o2.floating[h2], v2 = g2[f2] - o2.reference[f2], C2 = await (r2.getOffsetParent == null ? void 0 : r2.getOffsetParent(a2));
2212
- let S3 = C2 ? C2[x2] : 0;
2213
- (!S3 || !await (r2.isElement == null ? void 0 : r2.isElement(C2))) && (S3 = c.floating[x2] || o2.floating[h2]);
2214
- const Z2 = b2 / 2 - v2 / 2, B2 = S3 / 2 - m2[h2] / 2 - 1, M2 = K(u2[w2], B2), G2 = K(u2[y3], B2), W2 = M2, Q2 = S3 - m2[h2] - G2, A2 = S3 / 2 - m2[h2] / 2 + Z2, _2 = dt(W2, A2, Q2), $2 = !l2.arrow && et2(s) != null && A2 !== _2 && o2.reference[h2] / 2 - (A2 < W2 ? M2 : G2) - m2[h2] / 2 < 0, L2 = $2 ? A2 < W2 ? A2 - W2 : A2 - Q2 : 0;
2231
+ }, f2 = yt(s), h2 = wt(f2), m2 = await r2.getDimensions(a2), p2 = f2 === "y", w3 = p2 ? "top" : "left", y3 = p2 ? "bottom" : "right", x2 = p2 ? "clientHeight" : "clientWidth", v2 = o.reference[h2] + o.reference[f2] - g2[f2] - o.floating[h2], b2 = g2[f2] - o.reference[f2], C2 = await (r2.getOffsetParent == null ? void 0 : r2.getOffsetParent(a2));
2232
+ let S2 = C2 ? C2[x2] : 0;
2233
+ (!S2 || !await (r2.isElement == null ? void 0 : r2.isElement(C2))) && (S2 = c2.floating[x2] || o.floating[h2]);
2234
+ const Z2 = v2 / 2 - b2 / 2, W2 = S2 / 2 - m2[h2] / 2 - 1, M2 = Y(u2[w3], W2), G2 = Y(u2[y3], W2), B2 = M2, Q2 = S2 - m2[h2] - G2, A2 = S2 / 2 - m2[h2] / 2 + Z2, _2 = gt(B2, A2, Q2), $2 = !l.arrow && et2(s) != null && A2 !== _2 && o.reference[h2] / 2 - (A2 < B2 ? M2 : G2) - m2[h2] / 2 < 0, L2 = $2 ? A2 < B2 ? A2 - B2 : A2 - Q2 : 0;
2215
2235
  return {
2216
2236
  [f2]: g2[f2] + L2,
2217
2237
  data: {
@@ -2232,10 +2252,10 @@ const ye = (t) => ({
2232
2252
  var n, i;
2233
2253
  const {
2234
2254
  placement: s,
2235
- middlewareData: o2,
2255
+ middlewareData: o,
2236
2256
  rects: r2,
2237
- initialPlacement: c,
2238
- platform: l2,
2257
+ initialPlacement: c2,
2258
+ platform: l,
2239
2259
  elements: a2
2240
2260
  } = e, {
2241
2261
  mainAxis: d2 = true,
@@ -2246,25 +2266,25 @@ const ye = (t) => ({
2246
2266
  flipAlignment: m2 = true,
2247
2267
  ...p2
2248
2268
  } = q2(t, e);
2249
- if ((n = o2.arrow) != null && n.alignmentOffset)
2269
+ if ((n = o.arrow) != null && n.alignmentOffset)
2250
2270
  return {};
2251
- const w2 = I(s), y3 = N2(c), x2 = I(c) === c, b2 = await (l2.isRTL == null ? void 0 : l2.isRTL(a2.floating)), v2 = g2 || (x2 || !m2 ? [ot(c)] : ue(c)), C2 = h2 !== "none";
2252
- !g2 && C2 && v2.push(...me(c, m2, h2, b2));
2253
- const S3 = [c, ...v2], Z2 = await $t(e, p2), B2 = [];
2254
- let M2 = ((i = o2.flip) == null ? void 0 : i.overflows) || [];
2255
- if (d2 && B2.push(Z2[w2]), u2) {
2256
- const A2 = fe(s, r2, b2);
2257
- B2.push(Z2[A2[0]], Z2[A2[1]]);
2271
+ const w3 = I2(s), y3 = F(c2), x2 = I2(c2) === c2, v2 = await (l.isRTL == null ? void 0 : l.isRTL(a2.floating)), b2 = g2 || (x2 || !m2 ? [ot(c2)] : ue(c2)), C2 = h2 !== "none";
2272
+ !g2 && C2 && b2.push(...me(c2, m2, h2, v2));
2273
+ const S2 = [c2, ...b2], Z2 = await $t(e, p2), W2 = [];
2274
+ let M2 = ((i = o.flip) == null ? void 0 : i.overflows) || [];
2275
+ if (d2 && W2.push(Z2[w3]), u2) {
2276
+ const A2 = fe(s, r2, v2);
2277
+ W2.push(Z2[A2[0]], Z2[A2[1]]);
2258
2278
  }
2259
2279
  if (M2 = [...M2, {
2260
2280
  placement: s,
2261
- overflows: B2
2262
- }], !B2.every((A2) => A2 <= 0)) {
2263
- var G2, W2;
2264
- const A2 = (((G2 = o2.flip) == null ? void 0 : G2.index) || 0) + 1, _2 = S3[A2];
2265
- if (_2 && (!(u2 === "alignment" ? y3 !== N2(_2) : false) || // We leave the current main axis only if every placement on that axis
2281
+ overflows: W2
2282
+ }], !W2.every((A2) => A2 <= 0)) {
2283
+ var G2, B2;
2284
+ const A2 = (((G2 = o.flip) == null ? void 0 : G2.index) || 0) + 1, _2 = S2[A2];
2285
+ if (_2 && (!(u2 === "alignment" ? y3 !== F(_2) : false) || // We leave the current main axis only if every placement on that axis
2266
2286
  // overflows the main axis.
2267
- M2.every((O3) => O3.overflows[0] > 0 && N2(O3.placement) === y3)))
2287
+ M2.every((O3) => F(O3.placement) === y3 ? O3.overflows[0] > 0 : true)))
2268
2288
  return {
2269
2289
  data: {
2270
2290
  index: A2,
@@ -2274,25 +2294,25 @@ const ye = (t) => ({
2274
2294
  placement: _2
2275
2295
  }
2276
2296
  };
2277
- let $2 = (W2 = M2.filter((L2) => L2.overflows[0] <= 0).sort((L2, O3) => L2.overflows[1] - O3.overflows[1])[0]) == null ? void 0 : W2.placement;
2297
+ let $2 = (B2 = M2.filter((L2) => L2.overflows[0] <= 0).sort((L2, O3) => L2.overflows[1] - O3.overflows[1])[0]) == null ? void 0 : B2.placement;
2278
2298
  if (!$2)
2279
2299
  switch (f2) {
2280
2300
  case "bestFit": {
2281
2301
  var Q2;
2282
2302
  const L2 = (Q2 = M2.filter((O3) => {
2283
2303
  if (C2) {
2284
- const F2 = N2(O3.placement);
2285
- return F2 === y3 || // Create a bias to the `y` side axis due to horizontal
2304
+ const N2 = F(O3.placement);
2305
+ return N2 === y3 || // Create a bias to the `y` side axis due to horizontal
2286
2306
  // reading directions favoring greater width.
2287
- F2 === "y";
2307
+ N2 === "y";
2288
2308
  }
2289
2309
  return true;
2290
- }).map((O3) => [O3.placement, O3.overflows.filter((F2) => F2 > 0).reduce((F2, Xt) => F2 + Xt, 0)]).sort((O3, F2) => O3[1] - F2[1])[0]) == null ? void 0 : Q2[0];
2310
+ }).map((O3) => [O3.placement, O3.overflows.filter((N2) => N2 > 0).reduce((N2, Kt) => N2 + Kt, 0)]).sort((O3, N2) => O3[1] - N2[1])[0]) == null ? void 0 : Q2[0];
2291
2311
  L2 && ($2 = L2);
2292
2312
  break;
2293
2313
  }
2294
2314
  case "initialPlacement":
2295
- $2 = c;
2315
+ $2 = c2;
2296
2316
  break;
2297
2317
  }
2298
2318
  if (s !== $2)
@@ -2305,13 +2325,13 @@ const ye = (t) => ({
2305
2325
  return {};
2306
2326
  }
2307
2327
  };
2308
- }, Nt = /* @__PURE__ */ new Set(["left", "top"]);
2309
- async function ve(t, e) {
2328
+ }, Ft = /* @__PURE__ */ new Set(["left", "top"]);
2329
+ async function be(t, e) {
2310
2330
  const {
2311
2331
  placement: n,
2312
2332
  platform: i,
2313
2333
  elements: s
2314
- } = t, o2 = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), r2 = I(n), c = et2(n), l2 = N2(n) === "y", a2 = Nt.has(r2) ? -1 : 1, d2 = o2 && l2 ? -1 : 1, u2 = q2(e, t);
2334
+ } = t, o = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), r2 = I2(n), c2 = et2(n), l = F(n) === "y", a2 = Ft.has(r2) ? -1 : 1, d2 = o && l ? -1 : 1, u2 = q2(e, t);
2315
2335
  let {
2316
2336
  mainAxis: g2,
2317
2337
  crossAxis: f2,
@@ -2325,7 +2345,7 @@ async function ve(t, e) {
2325
2345
  crossAxis: u2.crossAxis || 0,
2326
2346
  alignmentAxis: u2.alignmentAxis
2327
2347
  };
2328
- return c && typeof h2 == "number" && (f2 = c === "end" ? h2 * -1 : h2), l2 ? {
2348
+ return c2 && typeof h2 == "number" && (f2 = c2 === "end" ? h2 * -1 : h2), l ? {
2329
2349
  x: f2 * d2,
2330
2350
  y: g2 * a2
2331
2351
  } : {
@@ -2333,7 +2353,7 @@ async function ve(t, e) {
2333
2353
  y: f2 * d2
2334
2354
  };
2335
2355
  }
2336
- const be = function(t) {
2356
+ const ve = function(t) {
2337
2357
  return t === void 0 && (t = 0), {
2338
2358
  name: "offset",
2339
2359
  options: t,
@@ -2341,15 +2361,15 @@ const be = function(t) {
2341
2361
  var n, i;
2342
2362
  const {
2343
2363
  x: s,
2344
- y: o2,
2364
+ y: o,
2345
2365
  placement: r2,
2346
- middlewareData: c
2347
- } = e, l2 = await ve(e, t);
2348
- return r2 === ((n = c.offset) == null ? void 0 : n.placement) && (i = c.arrow) != null && i.alignmentOffset ? {} : {
2349
- x: s + l2.x,
2350
- y: o2 + l2.y,
2366
+ middlewareData: c2
2367
+ } = e, l = await be(e, t);
2368
+ return r2 === ((n = c2.offset) == null ? void 0 : n.placement) && (i = c2.arrow) != null && i.alignmentOffset ? {} : {
2369
+ x: s + l.x,
2370
+ y: o + l.y,
2351
2371
  data: {
2352
- ...l2,
2372
+ ...l,
2353
2373
  placement: r2
2354
2374
  }
2355
2375
  };
@@ -2365,35 +2385,35 @@ const be = function(t) {
2365
2385
  y: i,
2366
2386
  placement: s
2367
2387
  } = e, {
2368
- mainAxis: o2 = true,
2388
+ mainAxis: o = true,
2369
2389
  crossAxis: r2 = false,
2370
- limiter: c = {
2390
+ limiter: c2 = {
2371
2391
  fn: (p2) => {
2372
2392
  let {
2373
- x: w2,
2393
+ x: w3,
2374
2394
  y: y3
2375
2395
  } = p2;
2376
2396
  return {
2377
- x: w2,
2397
+ x: w3,
2378
2398
  y: y3
2379
2399
  };
2380
2400
  }
2381
2401
  },
2382
- ...l2
2402
+ ...l
2383
2403
  } = q2(t, e), a2 = {
2384
2404
  x: n,
2385
2405
  y: i
2386
- }, d2 = await $t(e, l2), u2 = N2(I(s)), g2 = mt(u2);
2406
+ }, d2 = await $t(e, l), u2 = F(I2(s)), g2 = pt(u2);
2387
2407
  let f2 = a2[g2], h2 = a2[u2];
2388
- if (o2) {
2389
- const p2 = g2 === "y" ? "top" : "left", w2 = g2 === "y" ? "bottom" : "right", y3 = f2 + d2[p2], x2 = f2 - d2[w2];
2390
- f2 = dt(y3, f2, x2);
2408
+ if (o) {
2409
+ const p2 = g2 === "y" ? "top" : "left", w3 = g2 === "y" ? "bottom" : "right", y3 = f2 + d2[p2], x2 = f2 - d2[w3];
2410
+ f2 = gt(y3, f2, x2);
2391
2411
  }
2392
2412
  if (r2) {
2393
- const p2 = u2 === "y" ? "top" : "left", w2 = u2 === "y" ? "bottom" : "right", y3 = h2 + d2[p2], x2 = h2 - d2[w2];
2394
- h2 = dt(y3, h2, x2);
2413
+ const p2 = u2 === "y" ? "top" : "left", w3 = u2 === "y" ? "bottom" : "right", y3 = h2 + d2[p2], x2 = h2 - d2[w3];
2414
+ h2 = gt(y3, h2, x2);
2395
2415
  }
2396
- const m2 = c.fn({
2416
+ const m2 = c2.fn({
2397
2417
  ...e,
2398
2418
  [g2]: f2,
2399
2419
  [u2]: h2
@@ -2404,7 +2424,7 @@ const be = function(t) {
2404
2424
  x: m2.x - n,
2405
2425
  y: m2.y - i,
2406
2426
  enabled: {
2407
- [g2]: o2,
2427
+ [g2]: o,
2408
2428
  [u2]: r2
2409
2429
  }
2410
2430
  }
@@ -2419,18 +2439,18 @@ const be = function(t) {
2419
2439
  x: n,
2420
2440
  y: i,
2421
2441
  placement: s,
2422
- rects: o2,
2442
+ rects: o,
2423
2443
  middlewareData: r2
2424
2444
  } = e, {
2425
- offset: c = 0,
2426
- mainAxis: l2 = true,
2445
+ offset: c2 = 0,
2446
+ mainAxis: l = true,
2427
2447
  crossAxis: a2 = true
2428
2448
  } = q2(t, e), d2 = {
2429
2449
  x: n,
2430
2450
  y: i
2431
- }, u2 = N2(s), g2 = mt(u2);
2451
+ }, u2 = F(s), g2 = pt(u2);
2432
2452
  let f2 = d2[g2], h2 = d2[u2];
2433
- const m2 = q2(c, e), p2 = typeof m2 == "number" ? {
2453
+ const m2 = q2(c2, e), p2 = typeof m2 == "number" ? {
2434
2454
  mainAxis: m2,
2435
2455
  crossAxis: 0
2436
2456
  } : {
@@ -2438,14 +2458,14 @@ const be = function(t) {
2438
2458
  crossAxis: 0,
2439
2459
  ...m2
2440
2460
  };
2441
- if (l2) {
2442
- const x2 = g2 === "y" ? "height" : "width", b2 = o2.reference[g2] - o2.floating[x2] + p2.mainAxis, v2 = o2.reference[g2] + o2.reference[x2] - p2.mainAxis;
2443
- f2 < b2 ? f2 = b2 : f2 > v2 && (f2 = v2);
2461
+ if (l) {
2462
+ const x2 = g2 === "y" ? "height" : "width", v2 = o.reference[g2] - o.floating[x2] + p2.mainAxis, b2 = o.reference[g2] + o.reference[x2] - p2.mainAxis;
2463
+ f2 < v2 ? f2 = v2 : f2 > b2 && (f2 = b2);
2444
2464
  }
2445
2465
  if (a2) {
2446
- var w2, y3;
2447
- const x2 = g2 === "y" ? "width" : "height", b2 = Nt.has(I(s)), v2 = o2.reference[u2] - o2.floating[x2] + (b2 && ((w2 = r2.offset) == null ? void 0 : w2[u2]) || 0) + (b2 ? 0 : p2.crossAxis), C2 = o2.reference[u2] + o2.reference[x2] + (b2 ? 0 : ((y3 = r2.offset) == null ? void 0 : y3[u2]) || 0) - (b2 ? p2.crossAxis : 0);
2448
- h2 < v2 ? h2 = v2 : h2 > C2 && (h2 = C2);
2466
+ var w3, y3;
2467
+ const x2 = g2 === "y" ? "width" : "height", v2 = Ft.has(I2(s)), b2 = o.reference[u2] - o.floating[x2] + (v2 && ((w3 = r2.offset) == null ? void 0 : w3[u2]) || 0) + (v2 ? 0 : p2.crossAxis), C2 = o.reference[u2] + o.reference[x2] + (v2 ? 0 : ((y3 = r2.offset) == null ? void 0 : y3[u2]) || 0) - (v2 ? p2.crossAxis : 0);
2468
+ h2 < b2 ? h2 = b2 : h2 > C2 && (h2 = C2);
2449
2469
  }
2450
2470
  return {
2451
2471
  [g2]: f2,
@@ -2458,23 +2478,23 @@ function ct() {
2458
2478
  return typeof window < "u";
2459
2479
  }
2460
2480
  function J(t) {
2461
- return Ft(t) ? (t.nodeName || "").toLowerCase() : "#document";
2481
+ return Nt(t) ? (t.nodeName || "").toLowerCase() : "#document";
2462
2482
  }
2463
2483
  function E(t) {
2464
2484
  var e;
2465
2485
  return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
2466
2486
  }
2467
- function D(t) {
2487
+ function D2(t) {
2468
2488
  var e;
2469
- return (e = (Ft(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
2489
+ return (e = (Nt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
2470
2490
  }
2471
- function Ft(t) {
2491
+ function Nt(t) {
2472
2492
  return ct() ? t instanceof Node || t instanceof E(t).Node : false;
2473
2493
  }
2474
- function P(t) {
2494
+ function T2(t) {
2475
2495
  return ct() ? t instanceof Element || t instanceof E(t).Element : false;
2476
2496
  }
2477
- function k2(t) {
2497
+ function k(t) {
2478
2498
  return ct() ? t instanceof HTMLElement || t instanceof E(t).HTMLElement : false;
2479
2499
  }
2480
2500
  function St(t) {
@@ -2487,7 +2507,7 @@ function nt(t) {
2487
2507
  overflowX: n,
2488
2508
  overflowY: i,
2489
2509
  display: s
2490
- } = T2(t);
2510
+ } = P(t);
2491
2511
  return /auto|scroll|overlay|hidden|clip/.test(e + i + n) && !Ce.has(s);
2492
2512
  }
2493
2513
  const Se = /* @__PURE__ */ new Set(["table", "td", "th"]);
@@ -2504,15 +2524,15 @@ function lt(t) {
2504
2524
  }
2505
2525
  });
2506
2526
  }
2507
- const Pe = ["transform", "translate", "scale", "rotate", "perspective"], Te = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Re = ["paint", "layout", "strict", "content"];
2508
- function yt(t) {
2509
- const e = xt(), n = P(t) ? T2(t) : t;
2510
- return Pe.some((i) => n[i] ? n[i] !== "none" : false) || (n.containerType ? n.containerType !== "normal" : false) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : false) || !e && (n.filter ? n.filter !== "none" : false) || Te.some((i) => (n.willChange || "").includes(i)) || Re.some((i) => (n.contain || "").includes(i));
2527
+ const Te = ["transform", "translate", "scale", "rotate", "perspective"], Pe = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Re = ["paint", "layout", "strict", "content"];
2528
+ function xt(t) {
2529
+ const e = bt(), n = T2(t) ? P(t) : t;
2530
+ return Te.some((i) => n[i] ? n[i] !== "none" : false) || (n.containerType ? n.containerType !== "normal" : false) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : false) || !e && (n.filter ? n.filter !== "none" : false) || Pe.some((i) => (n.willChange || "").includes(i)) || Re.some((i) => (n.contain || "").includes(i));
2511
2531
  }
2512
2532
  function ke(t) {
2513
2533
  let e = V(t);
2514
- for (; k2(e) && !X(e); ) {
2515
- if (yt(e))
2534
+ for (; k(e) && !K(e); ) {
2535
+ if (xt(e))
2516
2536
  return e;
2517
2537
  if (lt(e))
2518
2538
  return null;
@@ -2520,18 +2540,18 @@ function ke(t) {
2520
2540
  }
2521
2541
  return null;
2522
2542
  }
2523
- function xt() {
2543
+ function bt() {
2524
2544
  return typeof CSS > "u" || !CSS.supports ? false : CSS.supports("-webkit-backdrop-filter", "none");
2525
2545
  }
2526
2546
  const De = /* @__PURE__ */ new Set(["html", "body", "#document"]);
2527
- function X(t) {
2547
+ function K(t) {
2528
2548
  return De.has(J(t));
2529
2549
  }
2530
- function T2(t) {
2550
+ function P(t) {
2531
2551
  return E(t).getComputedStyle(t);
2532
2552
  }
2533
2553
  function at(t) {
2534
- return P(t) ? {
2554
+ return T2(t) ? {
2535
2555
  scrollLeft: t.scrollLeft,
2536
2556
  scrollTop: t.scrollTop
2537
2557
  } : {
@@ -2547,59 +2567,59 @@ function V(t) {
2547
2567
  t.assignedSlot || // DOM Element detected.
2548
2568
  t.parentNode || // ShadowRoot detected.
2549
2569
  St(t) && t.host || // Fallback.
2550
- D(t)
2570
+ D2(t)
2551
2571
  );
2552
2572
  return St(e) ? e.host : e;
2553
2573
  }
2554
2574
  function Ht(t) {
2555
2575
  const e = V(t);
2556
- return X(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : k2(e) && nt(e) ? e : Ht(e);
2576
+ return K(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : k(e) && nt(e) ? e : Ht(e);
2557
2577
  }
2558
2578
  function tt(t, e, n) {
2559
2579
  var i;
2560
2580
  e === void 0 && (e = []), n === void 0 && (n = true);
2561
- const s = Ht(t), o2 = s === ((i = t.ownerDocument) == null ? void 0 : i.body), r2 = E(s);
2562
- if (o2) {
2563
- const c = ht(r2);
2564
- return e.concat(r2, r2.visualViewport || [], nt(s) ? s : [], c && n ? tt(c) : []);
2581
+ const s = Ht(t), o = s === ((i = t.ownerDocument) == null ? void 0 : i.body), r2 = E(s);
2582
+ if (o) {
2583
+ const c2 = mt(r2);
2584
+ return e.concat(r2, r2.visualViewport || [], nt(s) ? s : [], c2 && n ? tt(c2) : []);
2565
2585
  }
2566
2586
  return e.concat(s, tt(s, [], n));
2567
2587
  }
2568
- function ht(t) {
2588
+ function mt(t) {
2569
2589
  return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
2570
2590
  }
2571
2591
  function It(t) {
2572
- const e = T2(t);
2592
+ const e = P(t);
2573
2593
  let n = parseFloat(e.width) || 0, i = parseFloat(e.height) || 0;
2574
- const s = k2(t), o2 = s ? t.offsetWidth : n, r2 = s ? t.offsetHeight : i, c = st(n) !== o2 || st(i) !== r2;
2575
- return c && (n = o2, i = r2), {
2594
+ const s = k(t), o = s ? t.offsetWidth : n, r2 = s ? t.offsetHeight : i, c2 = st(n) !== o || st(i) !== r2;
2595
+ return c2 && (n = o, i = r2), {
2576
2596
  width: n,
2577
2597
  height: i,
2578
- $: c
2598
+ $: c2
2579
2599
  };
2580
2600
  }
2581
2601
  function vt(t) {
2582
- return P(t) ? t : t.contextElement;
2602
+ return T2(t) ? t : t.contextElement;
2583
2603
  }
2584
- function Y(t) {
2604
+ function X(t) {
2585
2605
  const e = vt(t);
2586
- if (!k2(e))
2587
- return R2(1);
2606
+ if (!k(e))
2607
+ return R(1);
2588
2608
  const n = e.getBoundingClientRect(), {
2589
2609
  width: i,
2590
2610
  height: s,
2591
- $: o2
2611
+ $: o
2592
2612
  } = It(e);
2593
- let r2 = (o2 ? st(n.width) : n.width) / i, c = (o2 ? st(n.height) : n.height) / s;
2594
- return (!r2 || !Number.isFinite(r2)) && (r2 = 1), (!c || !Number.isFinite(c)) && (c = 1), {
2613
+ let r2 = (o ? st(n.width) : n.width) / i, c2 = (o ? st(n.height) : n.height) / s;
2614
+ return (!r2 || !Number.isFinite(r2)) && (r2 = 1), (!c2 || !Number.isFinite(c2)) && (c2 = 1), {
2595
2615
  x: r2,
2596
- y: c
2616
+ y: c2
2597
2617
  };
2598
2618
  }
2599
- const Me = /* @__PURE__ */ R2(0);
2619
+ const Me = /* @__PURE__ */ R(0);
2600
2620
  function Vt(t) {
2601
2621
  const e = E(t);
2602
- return !xt() || !e.visualViewport ? Me : {
2622
+ return !bt() || !e.visualViewport ? Me : {
2603
2623
  x: e.visualViewport.offsetLeft,
2604
2624
  y: e.visualViewport.offsetTop
2605
2625
  };
@@ -2609,115 +2629,117 @@ function $e(t, e, n) {
2609
2629
  }
2610
2630
  function U2(t, e, n, i) {
2611
2631
  e === void 0 && (e = false), n === void 0 && (n = false);
2612
- const s = t.getBoundingClientRect(), o2 = vt(t);
2613
- let r2 = R2(1);
2614
- e && (i ? P(i) && (r2 = Y(i)) : r2 = Y(t));
2615
- const c = $e(o2, n, i) ? Vt(o2) : R2(0);
2616
- let l2 = (s.left + c.x) / r2.x, a2 = (s.top + c.y) / r2.y, d2 = s.width / r2.x, u2 = s.height / r2.y;
2617
- if (o2) {
2618
- const g2 = E(o2), f2 = i && P(i) ? E(i) : i;
2619
- let h2 = g2, m2 = ht(h2);
2632
+ const s = t.getBoundingClientRect(), o = vt(t);
2633
+ let r2 = R(1);
2634
+ e && (i ? T2(i) && (r2 = X(i)) : r2 = X(t));
2635
+ const c2 = $e(o, n, i) ? Vt(o) : R(0);
2636
+ let l = (s.left + c2.x) / r2.x, a2 = (s.top + c2.y) / r2.y, d2 = s.width / r2.x, u2 = s.height / r2.y;
2637
+ if (o) {
2638
+ const g2 = E(o), f2 = i && T2(i) ? E(i) : i;
2639
+ let h2 = g2, m2 = mt(h2);
2620
2640
  for (; m2 && i && f2 !== h2; ) {
2621
- const p2 = Y(m2), w2 = m2.getBoundingClientRect(), y3 = T2(m2), x2 = w2.left + (m2.clientLeft + parseFloat(y3.paddingLeft)) * p2.x, b2 = w2.top + (m2.clientTop + parseFloat(y3.paddingTop)) * p2.y;
2622
- l2 *= p2.x, a2 *= p2.y, d2 *= p2.x, u2 *= p2.y, l2 += x2, a2 += b2, h2 = E(m2), m2 = ht(h2);
2641
+ const p2 = X(m2), w3 = m2.getBoundingClientRect(), y3 = P(m2), x2 = w3.left + (m2.clientLeft + parseFloat(y3.paddingLeft)) * p2.x, v2 = w3.top + (m2.clientTop + parseFloat(y3.paddingTop)) * p2.y;
2642
+ l *= p2.x, a2 *= p2.y, d2 *= p2.x, u2 *= p2.y, l += x2, a2 += v2, h2 = E(m2), m2 = mt(h2);
2623
2643
  }
2624
2644
  }
2625
2645
  return rt({
2626
2646
  width: d2,
2627
2647
  height: u2,
2628
- x: l2,
2648
+ x: l,
2629
2649
  y: a2
2630
2650
  });
2631
2651
  }
2632
- function bt(t, e) {
2652
+ function ft(t, e) {
2633
2653
  const n = at(t).scrollLeft;
2634
- return e ? e.left + n : U2(D(t)).left + n;
2654
+ return e ? e.left + n : U2(D2(t)).left + n;
2635
2655
  }
2636
- function Bt(t, e, n) {
2637
- n === void 0 && (n = false);
2638
- const i = t.getBoundingClientRect(), s = i.left + e.scrollLeft - (n ? 0 : (
2639
- // RTL <body> scrollbar.
2640
- bt(t, i)
2641
- )), o2 = i.top + e.scrollTop;
2656
+ function Wt(t, e) {
2657
+ const n = t.getBoundingClientRect(), i = n.left + e.scrollLeft - ft(t, n), s = n.top + e.scrollTop;
2642
2658
  return {
2643
- x: s,
2644
- y: o2
2659
+ x: i,
2660
+ y: s
2645
2661
  };
2646
2662
  }
2647
- function Ne(t) {
2663
+ function Fe(t) {
2648
2664
  let {
2649
2665
  elements: e,
2650
2666
  rect: n,
2651
2667
  offsetParent: i,
2652
2668
  strategy: s
2653
2669
  } = t;
2654
- const o2 = s === "fixed", r2 = D(i), c = e ? lt(e.floating) : false;
2655
- if (i === r2 || c && o2)
2670
+ const o = s === "fixed", r2 = D2(i), c2 = e ? lt(e.floating) : false;
2671
+ if (i === r2 || c2 && o)
2656
2672
  return n;
2657
- let l2 = {
2673
+ let l = {
2658
2674
  scrollLeft: 0,
2659
2675
  scrollTop: 0
2660
- }, a2 = R2(1);
2661
- const d2 = R2(0), u2 = k2(i);
2662
- if ((u2 || !u2 && !o2) && ((J(i) !== "body" || nt(r2)) && (l2 = at(i)), k2(i))) {
2676
+ }, a2 = R(1);
2677
+ const d2 = R(0), u2 = k(i);
2678
+ if ((u2 || !u2 && !o) && ((J(i) !== "body" || nt(r2)) && (l = at(i)), k(i))) {
2663
2679
  const f2 = U2(i);
2664
- a2 = Y(i), d2.x = f2.x + i.clientLeft, d2.y = f2.y + i.clientTop;
2680
+ a2 = X(i), d2.x = f2.x + i.clientLeft, d2.y = f2.y + i.clientTop;
2665
2681
  }
2666
- const g2 = r2 && !u2 && !o2 ? Bt(r2, l2, true) : R2(0);
2682
+ const g2 = r2 && !u2 && !o ? Wt(r2, l) : R(0);
2667
2683
  return {
2668
2684
  width: n.width * a2.x,
2669
2685
  height: n.height * a2.y,
2670
- x: n.x * a2.x - l2.scrollLeft * a2.x + d2.x + g2.x,
2671
- y: n.y * a2.y - l2.scrollTop * a2.y + d2.y + g2.y
2686
+ x: n.x * a2.x - l.scrollLeft * a2.x + d2.x + g2.x,
2687
+ y: n.y * a2.y - l.scrollTop * a2.y + d2.y + g2.y
2672
2688
  };
2673
2689
  }
2674
- function Fe(t) {
2690
+ function Ne(t) {
2675
2691
  return Array.from(t.getClientRects());
2676
2692
  }
2677
2693
  function He(t) {
2678
- const e = D(t), n = at(t), i = t.ownerDocument.body, s = j(e.scrollWidth, e.clientWidth, i.scrollWidth, i.clientWidth), o2 = j(e.scrollHeight, e.clientHeight, i.scrollHeight, i.clientHeight);
2679
- let r2 = -n.scrollLeft + bt(t);
2680
- const c = -n.scrollTop;
2681
- return T2(i).direction === "rtl" && (r2 += j(e.clientWidth, i.clientWidth) - s), {
2694
+ const e = D2(t), n = at(t), i = t.ownerDocument.body, s = j(e.scrollWidth, e.clientWidth, i.scrollWidth, i.clientWidth), o = j(e.scrollHeight, e.clientHeight, i.scrollHeight, i.clientHeight);
2695
+ let r2 = -n.scrollLeft + ft(t);
2696
+ const c2 = -n.scrollTop;
2697
+ return P(i).direction === "rtl" && (r2 += j(e.clientWidth, i.clientWidth) - s), {
2682
2698
  width: s,
2683
- height: o2,
2699
+ height: o,
2684
2700
  x: r2,
2685
- y: c
2701
+ y: c2
2686
2702
  };
2687
2703
  }
2704
+ const Lt = 25;
2688
2705
  function Ie(t, e) {
2689
- const n = E(t), i = D(t), s = n.visualViewport;
2690
- let o2 = i.clientWidth, r2 = i.clientHeight, c = 0, l2 = 0;
2706
+ const n = E(t), i = D2(t), s = n.visualViewport;
2707
+ let o = i.clientWidth, r2 = i.clientHeight, c2 = 0, l = 0;
2691
2708
  if (s) {
2692
- o2 = s.width, r2 = s.height;
2693
- const a2 = xt();
2694
- (!a2 || a2 && e === "fixed") && (c = s.offsetLeft, l2 = s.offsetTop);
2695
- }
2709
+ o = s.width, r2 = s.height;
2710
+ const d2 = bt();
2711
+ (!d2 || d2 && e === "fixed") && (c2 = s.offsetLeft, l = s.offsetTop);
2712
+ }
2713
+ const a2 = ft(i);
2714
+ if (a2 <= 0) {
2715
+ const d2 = i.ownerDocument, u2 = d2.body, g2 = getComputedStyle(u2), f2 = d2.compatMode === "CSS1Compat" && parseFloat(g2.marginLeft) + parseFloat(g2.marginRight) || 0, h2 = Math.abs(i.clientWidth - u2.clientWidth - f2);
2716
+ h2 <= Lt && (o -= h2);
2717
+ } else a2 <= Lt && (o += a2);
2696
2718
  return {
2697
- width: o2,
2719
+ width: o,
2698
2720
  height: r2,
2699
- x: c,
2700
- y: l2
2721
+ x: c2,
2722
+ y: l
2701
2723
  };
2702
2724
  }
2703
2725
  const Ve = /* @__PURE__ */ new Set(["absolute", "fixed"]);
2704
- function Be(t, e) {
2705
- const n = U2(t, true, e === "fixed"), i = n.top + t.clientTop, s = n.left + t.clientLeft, o2 = k2(t) ? Y(t) : R2(1), r2 = t.clientWidth * o2.x, c = t.clientHeight * o2.y, l2 = s * o2.x, a2 = i * o2.y;
2726
+ function We(t, e) {
2727
+ const n = U2(t, true, e === "fixed"), i = n.top + t.clientTop, s = n.left + t.clientLeft, o = k(t) ? X(t) : R(1), r2 = t.clientWidth * o.x, c2 = t.clientHeight * o.y, l = s * o.x, a2 = i * o.y;
2706
2728
  return {
2707
2729
  width: r2,
2708
- height: c,
2709
- x: l2,
2730
+ height: c2,
2731
+ x: l,
2710
2732
  y: a2
2711
2733
  };
2712
2734
  }
2713
- function Lt(t, e, n) {
2735
+ function Ot(t, e, n) {
2714
2736
  let i;
2715
2737
  if (e === "viewport")
2716
2738
  i = Ie(t, n);
2717
2739
  else if (e === "document")
2718
- i = He(D(t));
2719
- else if (P(e))
2720
- i = Be(e, n);
2740
+ i = He(D2(t));
2741
+ else if (T2(e))
2742
+ i = We(e, n);
2721
2743
  else {
2722
2744
  const s = Vt(t);
2723
2745
  i = {
@@ -2729,20 +2751,20 @@ function Lt(t, e, n) {
2729
2751
  }
2730
2752
  return rt(i);
2731
2753
  }
2732
- function Wt(t, e) {
2754
+ function Bt(t, e) {
2733
2755
  const n = V(t);
2734
- return n === e || !P(n) || X(n) ? false : T2(n).position === "fixed" || Wt(n, e);
2756
+ return n === e || !T2(n) || K(n) ? false : P(n).position === "fixed" || Bt(n, e);
2735
2757
  }
2736
- function We(t, e) {
2758
+ function Be(t, e) {
2737
2759
  const n = e.get(t);
2738
2760
  if (n)
2739
2761
  return n;
2740
- let i = tt(t, [], false).filter((c) => P(c) && J(c) !== "body"), s = null;
2741
- const o2 = T2(t).position === "fixed";
2742
- let r2 = o2 ? V(t) : t;
2743
- for (; P(r2) && !X(r2); ) {
2744
- const c = T2(r2), l2 = yt(r2);
2745
- !l2 && c.position === "fixed" && (s = null), (o2 ? !l2 && !s : !l2 && c.position === "static" && !!s && Ve.has(s.position) || nt(r2) && !l2 && Wt(t, r2)) ? i = i.filter((d2) => d2 !== r2) : s = c, r2 = V(r2);
2762
+ let i = tt(t, [], false).filter((c2) => T2(c2) && J(c2) !== "body"), s = null;
2763
+ const o = P(t).position === "fixed";
2764
+ let r2 = o ? V(t) : t;
2765
+ for (; T2(r2) && !K(r2); ) {
2766
+ const c2 = P(r2), l = xt(r2);
2767
+ !l && c2.position === "fixed" && (s = null), (o ? !l && !s : !l && c2.position === "static" && !!s && Ve.has(s.position) || nt(r2) && !l && Bt(t, r2)) ? i = i.filter((d2) => d2 !== r2) : s = c2, r2 = V(r2);
2746
2768
  }
2747
2769
  return e.set(t, i), i;
2748
2770
  }
@@ -2753,15 +2775,15 @@ function _e(t) {
2753
2775
  rootBoundary: i,
2754
2776
  strategy: s
2755
2777
  } = t;
2756
- const r2 = [...n === "clippingAncestors" ? lt(e) ? [] : We(e, this._c) : [].concat(n), i], c = r2[0], l2 = r2.reduce((a2, d2) => {
2757
- const u2 = Lt(e, d2, s);
2758
- return a2.top = j(u2.top, a2.top), a2.right = K(u2.right, a2.right), a2.bottom = K(u2.bottom, a2.bottom), a2.left = j(u2.left, a2.left), a2;
2759
- }, Lt(e, c, s));
2778
+ const r2 = [...n === "clippingAncestors" ? lt(e) ? [] : Be(e, this._c) : [].concat(n), i], c2 = r2[0], l = r2.reduce((a2, d2) => {
2779
+ const u2 = Ot(e, d2, s);
2780
+ return a2.top = j(u2.top, a2.top), a2.right = Y(u2.right, a2.right), a2.bottom = Y(u2.bottom, a2.bottom), a2.left = j(u2.left, a2.left), a2;
2781
+ }, Ot(e, c2, s));
2760
2782
  return {
2761
- width: l2.right - l2.left,
2762
- height: l2.bottom - l2.top,
2763
- x: l2.left,
2764
- y: l2.top
2783
+ width: l.right - l.left,
2784
+ height: l.bottom - l.top,
2785
+ x: l.left,
2786
+ y: l.top
2765
2787
  };
2766
2788
  }
2767
2789
  function ze(t) {
@@ -2775,22 +2797,22 @@ function ze(t) {
2775
2797
  };
2776
2798
  }
2777
2799
  function je(t, e, n) {
2778
- const i = k2(e), s = D(e), o2 = n === "fixed", r2 = U2(t, true, o2, e);
2779
- let c = {
2800
+ const i = k(e), s = D2(e), o = n === "fixed", r2 = U2(t, true, o, e);
2801
+ let c2 = {
2780
2802
  scrollLeft: 0,
2781
2803
  scrollTop: 0
2782
2804
  };
2783
- const l2 = R2(0);
2805
+ const l = R(0);
2784
2806
  function a2() {
2785
- l2.x = bt(s);
2807
+ l.x = ft(s);
2786
2808
  }
2787
- if (i || !i && !o2)
2788
- if ((J(e) !== "body" || nt(s)) && (c = at(e)), i) {
2789
- const f2 = U2(e, true, o2, e);
2790
- l2.x = f2.x + e.clientLeft, l2.y = f2.y + e.clientTop;
2809
+ if (i || !i && !o)
2810
+ if ((J(e) !== "body" || nt(s)) && (c2 = at(e)), i) {
2811
+ const f2 = U2(e, true, o, e);
2812
+ l.x = f2.x + e.clientLeft, l.y = f2.y + e.clientTop;
2791
2813
  } else s && a2();
2792
- o2 && !i && s && a2();
2793
- const d2 = s && !i && !o2 ? Bt(s, c) : R2(0), u2 = r2.left + c.scrollLeft - l2.x - d2.x, g2 = r2.top + c.scrollTop - l2.y - d2.y;
2814
+ o && !i && s && a2();
2815
+ const d2 = s && !i && !o ? Wt(s, c2) : R(0), u2 = r2.left + c2.scrollLeft - l.x - d2.x, g2 = r2.top + c2.scrollTop - l.y - d2.y;
2794
2816
  return {
2795
2817
  x: u2,
2796
2818
  y: g2,
@@ -2798,34 +2820,34 @@ function je(t, e, n) {
2798
2820
  height: r2.height
2799
2821
  };
2800
2822
  }
2801
- function ft(t) {
2802
- return T2(t).position === "static";
2823
+ function ut(t) {
2824
+ return P(t).position === "static";
2803
2825
  }
2804
- function Ot(t, e) {
2805
- if (!k2(t) || T2(t).position === "fixed")
2826
+ function Tt(t, e) {
2827
+ if (!k(t) || P(t).position === "fixed")
2806
2828
  return null;
2807
2829
  if (e)
2808
2830
  return e(t);
2809
2831
  let n = t.offsetParent;
2810
- return D(t) === n && (n = n.ownerDocument.body), n;
2832
+ return D2(t) === n && (n = n.ownerDocument.body), n;
2811
2833
  }
2812
2834
  function _t(t, e) {
2813
2835
  const n = E(t);
2814
2836
  if (lt(t))
2815
2837
  return n;
2816
- if (!k2(t)) {
2838
+ if (!k(t)) {
2817
2839
  let s = V(t);
2818
- for (; s && !X(s); ) {
2819
- if (P(s) && !ft(s))
2840
+ for (; s && !K(s); ) {
2841
+ if (T2(s) && !ut(s))
2820
2842
  return s;
2821
2843
  s = V(s);
2822
2844
  }
2823
2845
  return n;
2824
2846
  }
2825
- let i = Ot(t, e);
2826
- for (; i && Le(i) && ft(i); )
2827
- i = Ot(i, e);
2828
- return i && X(i) && ft(i) && !yt(i) ? n : i || ke(t) || n;
2847
+ let i = Tt(t, e);
2848
+ for (; i && Le(i) && ut(i); )
2849
+ i = Tt(i, e);
2850
+ return i && K(i) && ut(i) && !xt(i) ? n : i || ke(t) || n;
2829
2851
  }
2830
2852
  const qe = async function(t) {
2831
2853
  const e = this.getOffsetParent || _t, n = this.getDimensions, i = await n(t.floating);
@@ -2840,116 +2862,116 @@ const qe = async function(t) {
2840
2862
  };
2841
2863
  };
2842
2864
  function Ue(t) {
2843
- return T2(t).direction === "rtl";
2865
+ return P(t).direction === "rtl";
2844
2866
  }
2845
- const Ye = {
2846
- convertOffsetParentRelativeRectToViewportRelativeRect: Ne,
2847
- getDocumentElement: D,
2867
+ const Xe = {
2868
+ convertOffsetParentRelativeRectToViewportRelativeRect: Fe,
2869
+ getDocumentElement: D2,
2848
2870
  getClippingRect: _e,
2849
2871
  getOffsetParent: _t,
2850
2872
  getElementRects: qe,
2851
- getClientRects: Fe,
2873
+ getClientRects: Ne,
2852
2874
  getDimensions: ze,
2853
- getScale: Y,
2854
- isElement: P,
2875
+ getScale: X,
2876
+ isElement: T2,
2855
2877
  isRTL: Ue
2856
2878
  };
2857
2879
  function zt(t, e) {
2858
2880
  return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
2859
2881
  }
2860
- function Ke(t, e) {
2882
+ function Ye(t, e) {
2861
2883
  let n = null, i;
2862
- const s = D(t);
2863
- function o2() {
2864
- var c;
2865
- clearTimeout(i), (c = n) == null || c.disconnect(), n = null;
2884
+ const s = D2(t);
2885
+ function o() {
2886
+ var c2;
2887
+ clearTimeout(i), (c2 = n) == null || c2.disconnect(), n = null;
2866
2888
  }
2867
- function r2(c, l2) {
2868
- c === void 0 && (c = false), l2 === void 0 && (l2 = 1), o2();
2889
+ function r2(c2, l) {
2890
+ c2 === void 0 && (c2 = false), l === void 0 && (l = 1), o();
2869
2891
  const a2 = t.getBoundingClientRect(), {
2870
2892
  left: d2,
2871
2893
  top: u2,
2872
2894
  width: g2,
2873
2895
  height: f2
2874
2896
  } = a2;
2875
- if (c || e(), !g2 || !f2)
2897
+ if (c2 || e(), !g2 || !f2)
2876
2898
  return;
2877
- const h2 = it(u2), m2 = it(s.clientWidth - (d2 + g2)), p2 = it(s.clientHeight - (u2 + f2)), w2 = it(d2), x2 = {
2878
- rootMargin: -h2 + "px " + -m2 + "px " + -p2 + "px " + -w2 + "px",
2879
- threshold: j(0, K(1, l2)) || 1
2899
+ const h2 = it(u2), m2 = it(s.clientWidth - (d2 + g2)), p2 = it(s.clientHeight - (u2 + f2)), w3 = it(d2), x2 = {
2900
+ rootMargin: -h2 + "px " + -m2 + "px " + -p2 + "px " + -w3 + "px",
2901
+ threshold: j(0, Y(1, l)) || 1
2880
2902
  };
2881
- let b2 = true;
2882
- function v2(C2) {
2883
- const S3 = C2[0].intersectionRatio;
2884
- if (S3 !== l2) {
2885
- if (!b2)
2903
+ let v2 = true;
2904
+ function b2(C2) {
2905
+ const S2 = C2[0].intersectionRatio;
2906
+ if (S2 !== l) {
2907
+ if (!v2)
2886
2908
  return r2();
2887
- S3 ? r2(false, S3) : i = setTimeout(() => {
2909
+ S2 ? r2(false, S2) : i = setTimeout(() => {
2888
2910
  r2(false, 1e-7);
2889
2911
  }, 1e3);
2890
2912
  }
2891
- S3 === 1 && !zt(a2, t.getBoundingClientRect()) && r2(), b2 = false;
2913
+ S2 === 1 && !zt(a2, t.getBoundingClientRect()) && r2(), v2 = false;
2892
2914
  }
2893
2915
  try {
2894
- n = new IntersectionObserver(v2, {
2916
+ n = new IntersectionObserver(b2, {
2895
2917
  ...x2,
2896
2918
  // Handle <iframe>s
2897
2919
  root: s.ownerDocument
2898
2920
  });
2899
2921
  } catch {
2900
- n = new IntersectionObserver(v2, x2);
2922
+ n = new IntersectionObserver(b2, x2);
2901
2923
  }
2902
2924
  n.observe(t);
2903
2925
  }
2904
- return r2(true), o2;
2926
+ return r2(true), o;
2905
2927
  }
2906
- function Xe(t, e, n, i) {
2928
+ function Ke(t, e, n, i) {
2907
2929
  i === void 0 && (i = {});
2908
2930
  const {
2909
2931
  ancestorScroll: s = true,
2910
- ancestorResize: o2 = true,
2932
+ ancestorResize: o = true,
2911
2933
  elementResize: r2 = typeof ResizeObserver == "function",
2912
- layoutShift: c = typeof IntersectionObserver == "function",
2913
- animationFrame: l2 = false
2914
- } = i, a2 = vt(t), d2 = s || o2 ? [...a2 ? tt(a2) : [], ...tt(e)] : [];
2915
- d2.forEach((w2) => {
2916
- s && w2.addEventListener("scroll", n, {
2934
+ layoutShift: c2 = typeof IntersectionObserver == "function",
2935
+ animationFrame: l = false
2936
+ } = i, a2 = vt(t), d2 = s || o ? [...a2 ? tt(a2) : [], ...tt(e)] : [];
2937
+ d2.forEach((w3) => {
2938
+ s && w3.addEventListener("scroll", n, {
2917
2939
  passive: true
2918
- }), o2 && w2.addEventListener("resize", n);
2940
+ }), o && w3.addEventListener("resize", n);
2919
2941
  });
2920
- const u2 = a2 && c ? Ke(a2, n) : null;
2942
+ const u2 = a2 && c2 ? Ye(a2, n) : null;
2921
2943
  let g2 = -1, f2 = null;
2922
- r2 && (f2 = new ResizeObserver((w2) => {
2923
- let [y3] = w2;
2944
+ r2 && (f2 = new ResizeObserver((w3) => {
2945
+ let [y3] = w3;
2924
2946
  y3 && y3.target === a2 && f2 && (f2.unobserve(e), cancelAnimationFrame(g2), g2 = requestAnimationFrame(() => {
2925
2947
  var x2;
2926
2948
  (x2 = f2) == null || x2.observe(e);
2927
2949
  })), n();
2928
- }), a2 && !l2 && f2.observe(a2), f2.observe(e));
2929
- let h2, m2 = l2 ? U2(t) : null;
2930
- l2 && p2();
2950
+ }), a2 && !l && f2.observe(a2), f2.observe(e));
2951
+ let h2, m2 = l ? U2(t) : null;
2952
+ l && p2();
2931
2953
  function p2() {
2932
- const w2 = U2(t);
2933
- m2 && !zt(m2, w2) && n(), m2 = w2, h2 = requestAnimationFrame(p2);
2954
+ const w3 = U2(t);
2955
+ m2 && !zt(m2, w3) && n(), m2 = w3, h2 = requestAnimationFrame(p2);
2934
2956
  }
2935
2957
  return n(), () => {
2936
- var w2;
2958
+ var w3;
2937
2959
  d2.forEach((y3) => {
2938
- s && y3.removeEventListener("scroll", n), o2 && y3.removeEventListener("resize", n);
2939
- }), u2?.(), (w2 = f2) == null || w2.disconnect(), f2 = null, l2 && cancelAnimationFrame(h2);
2960
+ s && y3.removeEventListener("scroll", n), o && y3.removeEventListener("resize", n);
2961
+ }), u2?.(), (w3 = f2) == null || w3.disconnect(), f2 = null, l && cancelAnimationFrame(h2);
2940
2962
  };
2941
2963
  }
2942
- const Je = be, Ze = Ae, Ge = xe, Qe = ye, tn = Ee, en = (t, e, n) => {
2964
+ const Je = ve, Ze = Ae, Ge = xe, Qe = ye, tn = Ee, en = (t, e, n) => {
2943
2965
  const i = /* @__PURE__ */ new Map(), s = {
2944
- platform: Ye,
2966
+ platform: Xe,
2945
2967
  ...n
2946
- }, o2 = {
2968
+ }, o = {
2947
2969
  ...s.platform,
2948
2970
  _c: i
2949
2971
  };
2950
2972
  return we(t, e, {
2951
2973
  ...s,
2952
- platform: o2
2974
+ platform: o
2953
2975
  });
2954
2976
  };
2955
2977
  function Pt(t, e, n) {
@@ -2966,7 +2988,7 @@ function jt(t, e) {
2966
2988
  throw new Error(`Provided delay value is not a number: "${n}"`);
2967
2989
  return i;
2968
2990
  }
2969
- function ut(t) {
2991
+ function dt(t) {
2970
2992
  let e;
2971
2993
  const n = typeof t == "string" ? t.trim().split(" ").map((i) => parseFloat(i)).filter((i) => !isNaN(i)) : [t];
2972
2994
  for (let i = 0; i < n.length; i++)
@@ -3009,24 +3031,18 @@ function nn(t) {
3009
3031
  return {
3010
3032
  offset: Number(t.getSetting("offset")),
3011
3033
  flip: {
3012
- padding: ut(t.getSetting("flip-padding"))
3034
+ padding: dt(t.getSetting("flip-padding"))
3013
3035
  },
3014
3036
  shift: {
3015
- padding: ut(t.getSetting("shift-padding"))
3037
+ padding: dt(t.getSetting("shift-padding"))
3016
3038
  },
3017
3039
  arrow: {
3018
3040
  selector: t.getSetting("selectorArrow"),
3019
3041
  element: null,
3020
- padding: ut(t.getSetting("arrow-padding"))
3042
+ padding: dt(t.getSetting("arrow-padding"))
3021
3043
  }
3022
3044
  };
3023
3045
  }
3024
- function Tt(t) {
3025
- const e = this.get(t);
3026
- if (e)
3027
- return e;
3028
- throw new Error(`Popover not found in collection with id of "${t}".`);
3029
- }
3030
3046
  async function qt(t) {
3031
3047
  return t && t.state === "opened" && (t.el.inert = true, t.el.classList.remove(t.parent.settings.stateActive), t.isTooltip || t.trigger?.setAttribute("aria-expanded", "false"), t.floatingCleanup(), t.state = "closed", t.trigger === t.parent.trigger && (t.parent.trigger = null), t.el.dispatchEvent(
3032
3048
  new CustomEvent(t.getSetting("customEventPrefix") + "closed", {
@@ -3041,7 +3057,7 @@ async function Ut(t) {
3041
3057
  n.state === "opened" && e.push(await n.close());
3042
3058
  return e;
3043
3059
  }
3044
- function Yt(t) {
3060
+ function Xt(t) {
3045
3061
  t.state == "opened" && setTimeout(() => (document.activeElement?.closest(
3046
3062
  `#${t.id}, [aria-controls="${t.id}"], [aria-describedby="${t.id}"]`
3047
3063
  ) || t.close(), t), 1);
@@ -3066,7 +3082,7 @@ function rn(t, e) {
3066
3082
  function cn(t, e) {
3067
3083
  setTimeout(() => {
3068
3084
  t.isHovered = e, !t.isHovered && (t.toggleDelayId && clearTimeout(t.toggleDelayId), t.toggleDelayId = setTimeout(
3069
- () => Yt(t),
3085
+ () => Xt(t),
3070
3086
  jt(t, 1)
3071
3087
  ));
3072
3088
  }, 1);
@@ -3078,7 +3094,7 @@ function ln(t) {
3078
3094
  return;
3079
3095
  case "Tab":
3080
3096
  this.collection.forEach((e) => {
3081
- Yt(e);
3097
+ Xt(e);
3082
3098
  });
3083
3099
  return;
3084
3100
  default:
@@ -3094,12 +3110,12 @@ function an(t) {
3094
3110
  ) ? 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)));
3095
3111
  });
3096
3112
  }
3097
- async function Kt(t) {
3113
+ async function Yt(t) {
3098
3114
  t.el.inert = false, t.el.classList.add(t.parent.settings.stateActive), t.isTooltip || t.trigger?.setAttribute("aria-expanded", "true"), t.buildCustomProps();
3099
3115
  const e = nn(t), n = t.el.querySelector(
3100
3116
  e.arrow.selector
3101
3117
  );
3102
- return e.arrow.element = n || null, t.trigger instanceof HTMLElement && (t.floatingCleanup = Xe(t.trigger, t.el, () => {
3118
+ return e.arrow.element = n || null, t.trigger instanceof HTMLElement && (t.floatingCleanup = Ke(t.trigger, t.el, () => {
3103
3119
  const i = [
3104
3120
  Ge(e.flip),
3105
3121
  Ze({ ...e.shift, limiter: tn() }),
@@ -3113,11 +3129,11 @@ async function Kt(t) {
3113
3129
  ), en(t.trigger, t.el, {
3114
3130
  placement: t.getSetting("placement"),
3115
3131
  middleware: i
3116
- }).then(({ x: s, y: o2, placement: r2, middlewareData: c }) => {
3132
+ }).then(({ x: s, y: o, placement: r2, middlewareData: c2 }) => {
3117
3133
  if (t.el) {
3118
- if (Pt(t.el, s, o2), e.arrow.element && c.arrow) {
3119
- const { x: l2, y: a2 } = c.arrow;
3120
- Pt(e.arrow.element, l2, a2);
3134
+ if (Pt(t.el, s, o), e.arrow.element && c2.arrow) {
3135
+ const { x: l, y: a2 } = c2.arrow;
3136
+ Pt(e.arrow.element, l, a2);
3121
3137
  }
3122
3138
  t.el.setAttribute("data-floating-placement", r2);
3123
3139
  }
@@ -3158,7 +3174,7 @@ class fn extends Dt {
3158
3174
  }
3159
3175
  }
3160
3176
  async open() {
3161
- return Kt(this);
3177
+ return Yt(this);
3162
3178
  }
3163
3179
  async close() {
3164
3180
  return qt(this);
@@ -3236,11 +3252,11 @@ class un extends oe {
3236
3252
  return this.collection.find((e) => e.state == "opened" && e.getSetting("event") == "hover");
3237
3253
  }
3238
3254
  async open(e) {
3239
- const n = Tt.call(this, e);
3240
- return Kt(n);
3255
+ const n = this.getOrThrow(e);
3256
+ return Yt(n);
3241
3257
  }
3242
3258
  async close(e) {
3243
- const n = e ? Tt.call(this, e) : void 0;
3259
+ const n = e ? this.getOrThrow(e) : void 0;
3244
3260
  return n ? qt(n) : Ut(this);
3245
3261
  }
3246
3262
  async afterMount() {
@@ -3254,8 +3270,8 @@ class un extends oe {
3254
3270
  }
3255
3271
  }
3256
3272
  export {
3257
- z$2 as Drawer,
3258
- N$1 as Modal,
3273
+ _ as Drawer,
3274
+ H$1 as Modal,
3259
3275
  un as Popover,
3260
3276
  index as core
3261
3277
  };