@editora/ui-core 0.1.10 → 0.1.13

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.
Files changed (130) hide show
  1. package/README.md +5 -5
  2. package/dist/alert-dialog.cjs.js +18 -18
  3. package/dist/alert-dialog.esm.js +130 -117
  4. package/dist/app-header.cjs.js +22 -2
  5. package/dist/app-header.esm.js +22 -2
  6. package/dist/badge.cjs.js +5 -5
  7. package/dist/badge.esm.js +9 -8
  8. package/dist/color-picker.cjs.js +4 -4
  9. package/dist/color-picker.esm.js +39 -31
  10. package/dist/combobox.cjs.js +21 -21
  11. package/dist/combobox.esm.js +79 -40
  12. package/dist/command-palette.cjs.js +1 -1
  13. package/dist/command-palette.esm.js +2 -2
  14. package/dist/components/date-time-utils.d.ts +2 -1
  15. package/dist/components/date-time-utils.d.ts.map +1 -1
  16. package/dist/components/ui-alert-dialog.d.ts +2 -0
  17. package/dist/components/ui-alert-dialog.d.ts.map +1 -1
  18. package/dist/components/ui-app-header.d.ts.map +1 -1
  19. package/dist/components/ui-badge.d.ts.map +1 -1
  20. package/dist/components/ui-color-picker.d.ts.map +1 -1
  21. package/dist/components/ui-combobox.d.ts +4 -1
  22. package/dist/components/ui-combobox.d.ts.map +1 -1
  23. package/dist/components/ui-date-picker.d.ts +3 -0
  24. package/dist/components/ui-date-picker.d.ts.map +1 -1
  25. package/dist/components/ui-date-range-picker.d.ts +3 -0
  26. package/dist/components/ui-date-range-picker.d.ts.map +1 -1
  27. package/dist/components/ui-date-range-time-picker.d.ts +3 -0
  28. package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
  29. package/dist/components/ui-date-time-picker.d.ts +3 -0
  30. package/dist/components/ui-date-time-picker.d.ts.map +1 -1
  31. package/dist/components/ui-dialog.d.ts +3 -0
  32. package/dist/components/ui-dialog.d.ts.map +1 -1
  33. package/dist/components/ui-drawer.d.ts +14 -0
  34. package/dist/components/ui-drawer.d.ts.map +1 -1
  35. package/dist/components/ui-floating-toolbar.d.ts.map +1 -1
  36. package/dist/components/ui-icon.d.ts.map +1 -1
  37. package/dist/components/ui-menu.d.ts +1 -0
  38. package/dist/components/ui-menu.d.ts.map +1 -1
  39. package/dist/components/ui-menubar.d.ts +1 -0
  40. package/dist/components/ui-menubar.d.ts.map +1 -1
  41. package/dist/components/ui-quick-actions.d.ts.map +1 -1
  42. package/dist/components/ui-radio.d.ts +47 -0
  43. package/dist/components/ui-radio.d.ts.map +1 -0
  44. package/dist/components/ui-select.d.ts +8 -0
  45. package/dist/components/ui-select.d.ts.map +1 -1
  46. package/dist/components/ui-selection-popup.d.ts.map +1 -1
  47. package/dist/components/ui-split-button.d.ts +2 -0
  48. package/dist/components/ui-split-button.d.ts.map +1 -1
  49. package/dist/components/ui-stepper.d.ts.map +1 -1
  50. package/dist/components/ui-time-picker.d.ts +3 -0
  51. package/dist/components/ui-time-picker.d.ts.map +1 -1
  52. package/dist/context-menu.cjs.js +2 -2
  53. package/dist/context-menu.esm.js +2 -2
  54. package/dist/date-field.cjs.js +1 -1
  55. package/dist/date-field.esm.js +2 -2
  56. package/dist/date-picker.cjs.js +13 -13
  57. package/dist/date-picker.esm.js +100 -67
  58. package/dist/date-range-picker.cjs.js +14 -14
  59. package/dist/date-range-picker.esm.js +98 -65
  60. package/dist/date-range-time-picker.cjs.js +13 -13
  61. package/dist/date-range-time-picker.esm.js +76 -45
  62. package/dist/date-time-picker.cjs.js +13 -13
  63. package/dist/date-time-picker.esm.js +132 -101
  64. package/dist/date-time-utils-378ecc21.js +1 -0
  65. package/dist/{date-time-utils-bdceb7af.mjs → date-time-utils-a8b17ea7.mjs} +128 -102
  66. package/dist/dialog.cjs.js +29 -20
  67. package/dist/dialog.esm.js +90 -70
  68. package/dist/drawer.cjs.js +16 -16
  69. package/dist/drawer.esm.js +216 -98
  70. package/dist/floating-toolbar.cjs.js +3 -13
  71. package/dist/floating-toolbar.esm.js +17 -27
  72. package/dist/hover-card.cjs.js +1 -1
  73. package/dist/hover-card.esm.js +1 -1
  74. package/dist/{icon-eaa486b3.js → icon-9e9da03b.js} +4 -4
  75. package/dist/{icon-9ed13093.mjs → icon-e2a85cc1.mjs} +22 -18
  76. package/dist/icon.cjs.js +1 -1
  77. package/dist/icon.esm.js +1 -1
  78. package/dist/icons.d.ts +1 -1
  79. package/dist/icons.d.ts.map +1 -1
  80. package/dist/index.cjs.js +1 -1
  81. package/dist/index.d.ts +2 -0
  82. package/dist/index.d.ts.map +1 -1
  83. package/dist/index.esm.js +246 -244
  84. package/dist/menu.cjs.js +2 -2
  85. package/dist/menu.esm.js +118 -110
  86. package/dist/menubar.cjs.js +5 -5
  87. package/dist/menubar.esm.js +83 -78
  88. package/dist/{overlayManager-ece06517.js → overlayManager-0eda4e08.js} +1 -1
  89. package/dist/{overlayManager-86454af7.mjs → overlayManager-5bbd4dc3.mjs} +1 -1
  90. package/dist/popover.cjs.js +1 -1
  91. package/dist/popover.esm.js +2 -2
  92. package/dist/{portal-1cf392ca.mjs → portal-9060f7a6.mjs} +7 -7
  93. package/dist/portal-d9bae456.js +1 -0
  94. package/dist/{positioner-fbd61bf1.mjs → positioner-16f3cca1.mjs} +16 -16
  95. package/dist/positioner-43b1c75a.js +1 -0
  96. package/dist/positioner.cjs.js +1 -1
  97. package/dist/positioner.esm.js +1 -1
  98. package/dist/quick-actions.cjs.js +10 -4
  99. package/dist/quick-actions.esm.js +27 -21
  100. package/dist/radio.cjs.js +259 -0
  101. package/dist/radio.esm.js +455 -0
  102. package/dist/{runtime-5f282bc8.js → runtime-668914fe.js} +1 -1
  103. package/dist/{runtime-4ac0107b.mjs → runtime-864efe2f.mjs} +1 -1
  104. package/dist/runtime.cjs.js +1 -1
  105. package/dist/runtime.esm.js +2 -2
  106. package/dist/scroll-lock-31da444f.mjs +56 -0
  107. package/dist/scroll-lock-d7b0df21.js +1 -0
  108. package/dist/scroll-lock.d.ts.map +1 -1
  109. package/dist/select.cjs.js +14 -15
  110. package/dist/select.esm.js +117 -97
  111. package/dist/selection-popup.cjs.js +4 -7
  112. package/dist/selection-popup.esm.js +8 -11
  113. package/dist/split-button.cjs.js +137 -62
  114. package/dist/split-button.esm.js +235 -145
  115. package/dist/standalone/radio.d.ts +2 -0
  116. package/dist/standalone/radio.d.ts.map +1 -0
  117. package/dist/stepper.cjs.js +19 -50
  118. package/dist/stepper.esm.js +17 -48
  119. package/dist/time-field.cjs.js +1 -1
  120. package/dist/time-field.esm.js +14 -14
  121. package/dist/time-picker.cjs.js +15 -15
  122. package/dist/time-picker.esm.js +99 -68
  123. package/dist/tooltip.cjs.js +1 -1
  124. package/dist/tooltip.esm.js +1 -1
  125. package/package.json +2 -2
  126. package/dist/date-time-utils-5cf58cd0.js +0 -1
  127. package/dist/portal-d8d7fbca.js +0 -1
  128. package/dist/positioner-accc6e5f.js +0 -1
  129. package/dist/scroll-lock-48793569.js +0 -1
  130. package/dist/scroll-lock-9de6d328.mjs +0 -53
@@ -1,17 +1,18 @@
1
- import { E as Y } from "./ElementBase-909688f3.mjs";
2
- import { r as W } from "./calendar-2c11b824.mjs";
3
- import { r as J, i as v, s as G, b as Q, f as X, t as tt, n as E, d as et, p as F, m as N, a as it, k as L, h as j, j as Z, o as y, l as nt, c as st } from "./date-time-utils-bdceb7af.mjs";
4
- import "./scroll-lock-9de6d328.mjs";
5
- let rt = 0;
6
- const at = `
1
+ import { E as W } from "./ElementBase-909688f3.mjs";
2
+ import { c as Y } from "./dismissable-layer-9c7e6b58.mjs";
3
+ import { r as J } from "./calendar-2c11b824.mjs";
4
+ import { r as G, e as Q, i as v, s as X, b as tt, f as et, t as it, n as R, d as st, p as F, o as N, a as nt, m as E, j as Z, k as j, q as y, l as rt, c as at } from "./date-time-utils-a8b17ea7.mjs";
5
+ import "./scroll-lock-31da444f.mjs";
6
+ let ot = 0;
7
+ const lt = `
7
8
  <svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
8
9
  <path d="M6 2a1 1 0 0 1 1 1v1h6V3a1 1 0 1 1 2 0v1h.5A2.5 2.5 0 0 1 18 6.5v9A2.5 2.5 0 0 1 15.5 18h-11A2.5 2.5 0 0 1 2 15.5v-9A2.5 2.5 0 0 1 4.5 4H5V3a1 1 0 0 1 1-1Zm10 7H4v6.5c0 .276.224.5.5.5h11a.5.5 0 0 0 .5-.5V9ZM4.5 6a.5.5 0 0 0-.5.5V7h12v-.5a.5.5 0 0 0-.5-.5h-11Z" fill="currentColor"/>
9
10
  </svg>
10
- `, ot = `
11
+ `, dt = `
11
12
  <svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
12
13
  <path d="M5.23 7.21a.75.75 0 0 1 1.06.02L10 11.12l3.71-3.9a.75.75 0 1 1 1.08 1.04l-4.25 4.47a.75.75 0 0 1-1.08 0L5.2 8.27a.75.75 0 0 1 .02-1.06Z" fill="currentColor"/>
13
14
  </svg>
14
- `, lt = `
15
+ `, ut = `
15
16
  <svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
16
17
  <path d="M5.22 5.22a.75.75 0 0 1 1.06 0L10 8.94l3.72-3.72a.75.75 0 1 1 1.06 1.06L11.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06L10 11.06l-3.72 3.72a.75.75 0 1 1-1.06-1.06L8.94 10 5.22 6.28a.75.75 0 0 1 0-1.06Z" fill="currentColor"/>
17
18
  </svg>
@@ -19,7 +20,7 @@ const at = `
19
20
  <svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
20
21
  <path d="M10 2a8 8 0 1 1 0 16 8 8 0 0 1 0-16Zm0 1.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13Zm.75 2.75a.75.75 0 0 0-1.5 0v3.88c0 .2.08.4.22.54l2.5 2.5a.75.75 0 1 0 1.06-1.06l-2.28-2.28V6.25Z" fill="currentColor"/>
21
22
  </svg>
22
- `, dt = `
23
+ `, ct = `
23
24
  :host {
24
25
  --ui-dtp-bg: color-mix(in srgb, var(--ui-color-surface, #ffffff) 96%, transparent);
25
26
  --ui-dtp-surface: linear-gradient(
@@ -285,7 +286,7 @@ const at = `
285
286
  outline-color: Highlight;
286
287
  }
287
288
  }
288
- `, ut = `
289
+ `, pt = `
289
290
  .overlay { position: fixed; z-index: var(--ui-dtp-z, 1600); pointer-events: none; }
290
291
  .panel {
291
292
  pointer-events: auto;
@@ -455,15 +456,17 @@ function c(h) {
455
456
  return h.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
456
457
  }
457
458
  function U(h) {
458
- const t = Z(h);
459
+ const t = j(h);
459
460
  return t ? { date: t.date, time: t.time } : { date: null, time: null };
460
461
  }
461
462
  function x(h) {
462
- return j(h.date, h.time);
463
+ return Z(h.date, h.time);
463
464
  }
464
- class ct extends Y {
465
+ class ht extends W {
465
466
  constructor() {
466
- super(...arguments), this._value = { date: null, time: null }, this._pending = { date: null, time: null }, this._draft = "", this._inlineError = "", this._open = !1, this._syncing = !1, this._overlay = null, this._releaseScrollLock = null, this._isInitialized = !1, this._hasView = !1, this._restoreFocusEl = null, this._overlayKey = null, this._uid = `ui-dtp-${++rt}`, this._inputId = `${this._uid}-input`, this._labelId = `${this._uid}-label`, this._hintId = `${this._uid}-hint`, this._errorId = `${this._uid}-error`, this._panelId = `${this._uid}-panel`, this._schedulePosition = J(() => this._positionOverlay()), this._onRootClickBound = (t) => this._onRootClick(t), this._onRootInputBound = (t) => this._onRootInput(t), this._onRootChangeBound = (t) => this._onRootChange(t), this._onRootBlurBound = (t) => this._onRootBlur(t), this._onRootKeyDownBound = (t) => this._onRootKeyDown(t), this._onOverlayClickBound = (t) => this._onOverlayClick(t), this._onOverlayChangeBound = (t) => this._onOverlayChange(t), this._onOverlayCalendarBound = (t) => this._onOverlayCalendar(t), this._onDocumentPointerDownBound = (t) => this._onDocumentPointerDown(t), this._onDocumentKeyDownBound = (t) => this._onDocumentKeyDown(t), this._onWindowResizeBound = () => this._schedulePosition.run(), this._onWindowScrollBound = () => this._schedulePosition.run();
467
+ super(...arguments), this._value = { date: null, time: null }, this._pending = { date: null, time: null }, this._draft = "", this._inlineError = "", this._open = !1, this._syncing = !1, this._overlay = null, this._dismissableLayer = null, this._releaseScrollLock = null, this._isInitialized = !1, this._hasView = !1, this._restoreFocusEl = null, this._overlayKey = null, this._uid = `ui-dtp-${++ot}`, this._inputId = `${this._uid}-input`, this._labelId = `${this._uid}-label`, this._hintId = `${this._uid}-hint`, this._errorId = `${this._uid}-error`, this._panelId = `${this._uid}-panel`, this._schedulePosition = G(() => this._positionOverlay()), this._onRootClickBound = (t) => this._onRootClick(t), this._onRootInputBound = (t) => this._onRootInput(t), this._onRootChangeBound = (t) => this._onRootChange(t), this._onRootBlurBound = (t) => this._onRootBlur(t), this._onRootKeyDownBound = (t) => this._onRootKeyDown(t), this._onOverlayClickBound = (t) => this._onOverlayClick(t), this._onOverlayChangeBound = (t) => this._onOverlayChange(t), this._onOverlayCalendarBound = (t) => this._onOverlayCalendar(t), this._onDocumentPointerDownBound = (t) => this._onDocumentPointerDown(t), this._onDocumentKeyDownBound = (t) => this._onDocumentKeyDown(t), this._onWindowResizeBound = () => this._schedulePosition.run(), this._onWindowScrollBound = (t) => {
468
+ Q(t, [this._overlay]) || this._schedulePosition.run();
469
+ };
467
470
  }
468
471
  static get observedAttributes() {
469
472
  return [
@@ -520,7 +523,7 @@ class ct extends Y {
520
523
  return (this.getAttribute("mode") || "popover") === "inline";
521
524
  }
522
525
  _isMobileSheet() {
523
- return G(this.getAttribute("mode"));
526
+ return X(this.getAttribute("mode"));
524
527
  }
525
528
  _isDisabled() {
526
529
  return this.hasAttribute("disabled");
@@ -554,10 +557,10 @@ class ct extends Y {
554
557
  return v(this.getAttribute("bare"), !1);
555
558
  }
556
559
  _locale() {
557
- return Q(this.getAttribute("locale"));
560
+ return tt(this.getAttribute("locale"));
558
561
  }
559
562
  _translations() {
560
- return W(
563
+ return J(
561
564
  this.getAttribute("locale"),
562
565
  this.getAttribute("translations")
563
566
  );
@@ -569,24 +572,24 @@ class ct extends Y {
569
572
  _formatDisplay(t) {
570
573
  if (!t.date || !t.time)
571
574
  return "";
572
- const e = X(t.date, this._locale(), "locale", null);
573
- return this._is12h() ? `${e} ${tt(t.time, this._locale())}` : `${e} ${t.time}`;
575
+ const e = et(t.date, this._locale(), "locale", null);
576
+ return this._is12h() ? `${e} ${it(t.time, this._locale())}` : `${e} ${t.time}`;
574
577
  }
575
578
  _is12h() {
576
579
  return (this.getAttribute("format") || "24h") === "12h";
577
580
  }
578
581
  _parseDateInput(t) {
579
- const e = E(t);
582
+ const e = R(t);
580
583
  if (e)
581
584
  return e;
582
- const i = et(t, this._locale());
585
+ const i = st(t, this._locale());
583
586
  if (i)
584
587
  return i;
585
- const n = new Date(t);
586
- if (!Number.isFinite(n.getTime()))
588
+ const s = new Date(t);
589
+ if (!Number.isFinite(s.getTime()))
587
590
  return null;
588
- const a = n.getFullYear(), o = String(n.getMonth() + 1).padStart(2, "0"), s = String(n.getDate()).padStart(2, "0");
589
- return `${a}-${o}-${s}`;
591
+ const a = s.getFullYear(), o = String(s.getMonth() + 1).padStart(2, "0"), n = String(s.getDate()).padStart(2, "0");
592
+ return `${a}-${o}-${n}`;
590
593
  }
591
594
  _syncOpenAttribute(t) {
592
595
  this._syncing = !0;
@@ -645,16 +648,16 @@ class ct extends Y {
645
648
  _clampState(t) {
646
649
  if (!t.date)
647
650
  return { date: null, time: t.time };
648
- const e = this._minDate(), i = this._maxDate(), n = it(t.date, e, i), a = t.time || "00:00";
649
- let o = this._minDateTime(), s = this._maxDateTime();
650
- if (o && s && L(o, s) > 0) {
651
+ const e = this._minDate(), i = this._maxDate(), s = nt(t.date, e, i), a = t.time || "00:00";
652
+ let o = this._minDateTime(), n = this._maxDateTime();
653
+ if (o && n && E(o, n) > 0) {
651
654
  const b = o;
652
- o = s, s = b;
655
+ o = n, n = b;
653
656
  }
654
- let r = j(n, a) || `${n}T00:00`;
655
- o && L(r, o) < 0 && (r = o), s && L(r, s) > 0 && (r = s);
656
- const d = Z(r);
657
- return d ? { date: d.date, time: d.time } : { date: n, time: a };
657
+ let r = Z(s, a) || `${s}T00:00`;
658
+ o && E(r, o) < 0 && (r = o), n && E(r, n) > 0 && (r = n);
659
+ const d = j(r);
660
+ return d ? { date: d.date, time: d.time } : { date: s, time: a };
658
661
  }
659
662
  _commit(t, e) {
660
663
  if (this._isInteractionBlocked() || this._isReadonly())
@@ -663,15 +666,15 @@ class ct extends Y {
663
666
  this._value = { date: null, time: null }, this._pending = { date: null, time: null }, this._draft = "", this._inlineError = "", this._syncValueAttribute(this._value), this._emitInput(e), this._emitChange(e), this._updateHostState();
664
667
  return;
665
668
  }
666
- const i = y(t.time || "", !0), n = this._clampState({
667
- date: E(t.date),
669
+ const i = y(t.time || "", !0), s = this._clampState({
670
+ date: R(t.date),
668
671
  time: i ? `${p(i.hours)}:${p(i.minutes)}` : null
669
672
  });
670
- if (!n.date || !n.time) {
673
+ if (!s.date || !s.time) {
671
674
  this._inlineError = this.getAttribute("error") || this._translations().invalidDateTime, this._emitInvalid(JSON.stringify(t), "parse"), this._updateHostState();
672
675
  return;
673
676
  }
674
- this._value = n, this._pending = { ...n }, this._draft = this._formatDisplay(n), this._inlineError = "", this._syncValueAttribute(this._value), this._emitInput(e), this._emitChange(e), this._updateHostState();
677
+ this._value = s, this._pending = { ...s }, this._draft = this._formatDisplay(s), this._inlineError = "", this._syncValueAttribute(this._value), this._emitInput(e), this._emitChange(e), this._updateHostState();
675
678
  }
676
679
  _setOpen(t, e) {
677
680
  t && this._isInteractionBlocked() || this._open !== t && (this._open = t, this._syncOpenAttribute(t), this._syncOverlay(e), this._updateHostState(), this.dispatchEvent(new CustomEvent(t ? "open" : "close", { bubbles: !0, composed: !0 })));
@@ -697,10 +700,31 @@ class ct extends Y {
697
700
  if (this._overlay || typeof document > "u")
698
701
  return;
699
702
  const t = document.createElement("div");
700
- t.style.position = "fixed", t.style.left = "0", t.style.top = "0", t.style.zIndex = "1100", t.style.pointerEvents = "none", t.addEventListener("click", this._onOverlayClickBound), t.addEventListener("change", this._onOverlayChangeBound), t.addEventListener("change", this._onOverlayCalendarBound), t.addEventListener("select", this._onOverlayCalendarBound), document.body.appendChild(t), this._overlay = t, document.addEventListener("pointerdown", this._onDocumentPointerDownBound, !0), document.addEventListener("keydown", this._onDocumentKeyDownBound), window.addEventListener("resize", this._onWindowResizeBound), window.addEventListener("scroll", this._onWindowScrollBound, !0), this._isMobileSheet() && (this._releaseScrollLock = nt());
703
+ t.style.position = "fixed", t.style.left = "0", t.style.top = "0", t.style.pointerEvents = "none", t.addEventListener("click", this._onOverlayClickBound), t.addEventListener("change", this._onOverlayChangeBound), t.addEventListener("change", this._onOverlayCalendarBound), t.addEventListener("select", this._onOverlayCalendarBound), document.body.appendChild(t), this._overlay = t, this._syncOverlayHostZIndex(), document.addEventListener("pointerdown", this._onDocumentPointerDownBound, !0), document.addEventListener("keydown", this._onDocumentKeyDownBound), window.addEventListener("resize", this._onWindowResizeBound), window.addEventListener("scroll", this._onWindowScrollBound, { passive: !0, capture: !0 }), this._isMobileSheet() && (this._releaseScrollLock = rt());
704
+ }
705
+ _syncOverlayHostZIndex() {
706
+ if (!this._overlay || typeof window > "u")
707
+ return;
708
+ const t = window.getComputedStyle(this).getPropertyValue("--ui-dtp-z").trim();
709
+ this._overlay.style.zIndex = t || "1600";
701
710
  }
702
711
  _destroyOverlay() {
703
- this._overlay && (this._schedulePosition.cancel(), document.removeEventListener("pointerdown", this._onDocumentPointerDownBound, !0), document.removeEventListener("keydown", this._onDocumentKeyDownBound), window.removeEventListener("resize", this._onWindowResizeBound), window.removeEventListener("scroll", this._onWindowScrollBound, !0), this._overlay.removeEventListener("click", this._onOverlayClickBound), this._overlay.removeEventListener("change", this._onOverlayChangeBound), this._overlay.removeEventListener("change", this._onOverlayCalendarBound), this._overlay.removeEventListener("select", this._onOverlayCalendarBound), this._overlay.parentElement && this._overlay.parentElement.removeChild(this._overlay), this._overlay = null, this._overlayKey = null, this._releaseScrollLock && (this._releaseScrollLock(), this._releaseScrollLock = null));
712
+ var t;
713
+ (t = this._dismissableLayer) == null || t.destroy(), this._dismissableLayer = null, this._overlay && (this._schedulePosition.cancel(), document.removeEventListener("pointerdown", this._onDocumentPointerDownBound, !0), document.removeEventListener("keydown", this._onDocumentKeyDownBound), window.removeEventListener("resize", this._onWindowResizeBound), window.removeEventListener("scroll", this._onWindowScrollBound, !0), this._overlay.removeEventListener("click", this._onOverlayClickBound), this._overlay.removeEventListener("change", this._onOverlayChangeBound), this._overlay.removeEventListener("change", this._onOverlayCalendarBound), this._overlay.removeEventListener("select", this._onOverlayCalendarBound), this._overlay.parentElement && this._overlay.parentElement.removeChild(this._overlay), this._overlay = null, this._overlayKey = null, this._releaseScrollLock && (this._releaseScrollLock(), this._releaseScrollLock = null));
714
+ }
715
+ _syncDismissableLayer() {
716
+ var i;
717
+ if ((i = this._dismissableLayer) == null || i.destroy(), this._dismissableLayer = null, !this._open || !this._overlay)
718
+ return;
719
+ const t = this._overlay.querySelector(".panel, .sheet"), e = this.root.querySelector(".field");
720
+ t && (this._dismissableLayer = Y({
721
+ node: t,
722
+ trigger: e,
723
+ closeOnEscape: !0,
724
+ closeOnPointerOutside: !0,
725
+ closeOnFocusOutside: !1,
726
+ onBeforeDismiss: (s) => s === "escape-key" ? (this._setOpen(!1, "escape"), !1) : (s === "outside-pointer" && this._setOpen(!1, "outside"), !1)
727
+ }));
704
728
  }
705
729
  _positionOverlay() {
706
730
  if (!this._overlay || !this._open || this._isMobileSheet())
@@ -708,21 +732,27 @@ class ct extends Y {
708
732
  const t = this.root.querySelector(".field"), e = this._overlay.querySelector(".panel");
709
733
  if (!t || !e)
710
734
  return;
711
- const i = st(t.getBoundingClientRect(), e.getBoundingClientRect());
712
- e.style.position = "absolute", e.style.top = `${Math.round(i.top)}px`, e.style.left = `${Math.round(i.left)}px`;
735
+ const i = e.getAttribute("data-placement"), s = at(
736
+ t.getBoundingClientRect(),
737
+ e.getBoundingClientRect(),
738
+ 8,
739
+ 8,
740
+ i === "top" ? "top" : i === "bottom" ? "bottom" : null
741
+ );
742
+ e.style.position = "absolute", e.style.top = `${Math.round(s.top)}px`, e.style.left = `${Math.round(s.left)}px`, e.setAttribute("data-placement", s.placement);
713
743
  }
714
744
  _timeOptions() {
715
- const t = y(this._pending.time || "00:00", !0) || { hours: 0, minutes: 0, seconds: 0 }, e = this._minuteStep(), i = this._is12h() ? Array.from({ length: 12 }, (o, s) => {
716
- const r = s + 1, d = t.hours % 12 || 12;
745
+ const t = y(this._pending.time || "00:00", !0) || { hours: 0, minutes: 0, seconds: 0 }, e = this._minuteStep(), i = this._is12h() ? Array.from({ length: 12 }, (o, n) => {
746
+ const r = n + 1, d = t.hours % 12 || 12;
717
747
  return `<option value="${r}" ${r === d ? "selected" : ""}>${p(r)}</option>`;
718
- }).join("") : Array.from({ length: 24 }, (o, s) => `<option value="${s}" ${s === t.hours ? "selected" : ""}>${p(s)}</option>`).join(""), n = Array.from({ length: Math.ceil(60 / e) }, (o, s) => {
719
- const r = Math.min(59, s * e);
748
+ }).join("") : Array.from({ length: 24 }, (o, n) => `<option value="${n}" ${n === t.hours ? "selected" : ""}>${p(n)}</option>`).join(""), s = Array.from({ length: Math.ceil(60 / e) }, (o, n) => {
749
+ const r = Math.min(59, n * e);
720
750
  return `<option value="${r}" ${r === t.minutes ? "selected" : ""}>${p(r)}</option>`;
721
751
  }).join(""), a = t.hours >= 12 ? "pm" : "am";
722
- return { hours: i, minutes: n, meridiem: a };
752
+ return { hours: i, minutes: s, meridiem: a };
723
753
  }
724
754
  _renderSurfaceInner(t, e = !1) {
725
- const i = this._translations(), n = this._timeOptions(), a = (this.getAttribute("label") || "").trim(), o = c(a), s = c(a || i.selectDate), r = this._pending.date && this._pending.time ? this._formatDisplay(this._pending) : "", d = `
755
+ const i = this._translations(), s = this._timeOptions(), a = (this.getAttribute("label") || "").trim(), o = c(a), n = c(a || i.selectDate), r = this._pending.date && this._pending.time ? this._formatDisplay(this._pending) : "", d = `
726
756
  <header class="head">
727
757
  <div>
728
758
  <p class="head-title" ${a ? "" : "hidden"}>${o}</p>
@@ -734,9 +764,9 @@ class ct extends Y {
734
764
  <section class="time-panel" part="time">
735
765
  <span class="icon" aria-hidden="true">${K}</span>
736
766
  <div class="time-grid" data-meridiem="${this._is12h() ? "true" : "false"}">
737
- <div><label>${c(i.hour)}</label><select data-segment="hours">${n.hours}</select></div>
738
- <div><label>${c(i.minute)}</label><select data-segment="minutes">${n.minutes}</select></div>
739
- ${this._is12h() ? `<div><label>${c(i.meridiem)}</label><select data-segment="meridiem"><option value="am" ${n.meridiem === "am" ? "selected" : ""}>${c(i.am)}</option><option value="pm" ${n.meridiem === "pm" ? "selected" : ""}>${c(i.pm)}</option></select></div>` : ""}
767
+ <div><label>${c(i.hour)}</label><select data-segment="hours">${s.hours}</select></div>
768
+ <div><label>${c(i.minute)}</label><select data-segment="minutes">${s.minutes}</select></div>
769
+ ${this._is12h() ? `<div><label>${c(i.meridiem)}</label><select data-segment="meridiem"><option value="am" ${s.meridiem === "am" ? "selected" : ""}>${c(i.am)}</option><option value="pm" ${s.meridiem === "pm" ? "selected" : ""}>${c(i.pm)}</option></select></div>` : ""}
740
770
  </div>
741
771
  </section>
742
772
  </div>
@@ -748,20 +778,20 @@ class ct extends Y {
748
778
  </footer>
749
779
  `;
750
780
  return e ? d : `
751
- <style>${ut}</style>
781
+ <style>${pt}</style>
752
782
  ${t ? '<div class="sheet-backdrop" data-action="backdrop"></div>' : ""}
753
- <section class="${t ? "sheet" : "panel"}" id="${this._panelId}" role="dialog" aria-modal="${t ? "true" : "false"}" aria-label="${s}" part="${t ? "sheet" : "popover"}">${d}</section>
783
+ <section class="${t ? "sheet" : "panel"}" id="${this._panelId}" role="dialog" aria-modal="${t ? "true" : "false"}" aria-label="${n}" part="${t ? "sheet" : "popover"}">${d}</section>
754
784
  `;
755
785
  }
756
786
  _syncCalendar(t) {
757
- const e = (s, r) => {
787
+ const e = (n, r) => {
758
788
  if (r == null || r === "") {
759
- t.hasAttribute(s) && t.removeAttribute(s);
789
+ t.hasAttribute(n) && t.removeAttribute(n);
760
790
  return;
761
791
  }
762
- t.getAttribute(s) !== r && t.setAttribute(s, r);
763
- }, i = (s, r) => {
764
- r ? e(s, "") : e(s, null);
792
+ t.getAttribute(n) !== r && t.setAttribute(n, r);
793
+ }, i = (n, r) => {
794
+ r ? e(n, "") : e(n, null);
765
795
  };
766
796
  e("selection", "single"), e("value", this._pending.date), e("min", this.getAttribute("min")), e("max", this.getAttribute("max")), e("locale", this.getAttribute("locale")), e("translations", this.getAttribute("translations")), e("week-start", this.getAttribute("week-start"));
767
797
  const a = this.getAttribute("size") || "sm", o = t.classList.contains("dt-calendar-inline");
@@ -786,20 +816,21 @@ class ct extends Y {
786
816
  const i = Array.from(t.options).map((o) => Number(o.value)).filter((o) => Number.isFinite(o));
787
817
  if (!i.length)
788
818
  return;
789
- let n = i[0], a = Math.abs(n - e);
819
+ let s = i[0], a = Math.abs(s - e);
790
820
  for (let o = 1; o < i.length; o += 1) {
791
- const s = i[o], r = Math.abs(s - e);
792
- r < a && (n = s, a = r);
821
+ const n = i[o], r = Math.abs(n - e);
822
+ r < a && (s = n, a = r);
793
823
  }
794
- t.value = String(n);
824
+ t.value = String(s);
795
825
  }
796
826
  _syncOverlayState() {
797
827
  if (!this._overlay)
798
828
  return;
829
+ this._syncOverlayHostZIndex();
799
830
  const t = this._isMobileSheet();
800
- this._ensureOverlayContent(t);
801
- const e = this._translations(), i = this._overlay.querySelector(".panel, .sheet"), n = this._overlay.querySelector(".footer");
802
- i && (i.dataset.bare = this._isBare() ? "true" : "false"), n && (n.hidden = !this._showFooter());
831
+ this._ensureOverlayContent(t), this._syncDismissableLayer();
832
+ const e = this._translations(), i = this._overlay.querySelector(".panel, .sheet"), s = this._overlay.querySelector(".footer");
833
+ i && (i.dataset.bare = this._isBare() ? "true" : "false"), s && (s.hidden = !this._showFooter());
803
834
  const a = this._overlay.querySelector(".head-title");
804
835
  if (a) {
805
836
  const l = (this.getAttribute("label") || "").trim();
@@ -807,8 +838,8 @@ class ct extends Y {
807
838
  }
808
839
  const o = this._overlay.querySelector(".head-meta");
809
840
  o && (o.textContent = this._pending.date && this._pending.time ? this._formatDisplay(this._pending) : e.selectDate);
810
- const s = this._overlay.querySelector(".dt-calendar");
811
- s && this._syncCalendar(s);
841
+ const n = this._overlay.querySelector(".dt-calendar");
842
+ n && this._syncCalendar(n);
812
843
  const r = y(this._pending.time || "00:00", !0) || { hours: 0, minutes: 0, seconds: 0 }, d = this._overlay.querySelector('select[data-segment="hours"]'), b = this._overlay.querySelector('select[data-segment="minutes"]'), m = this._overlay.querySelector('select[data-segment="meridiem"]');
813
844
  if (d) {
814
845
  const l = this._is12h() ? r.hours % 12 || 12 : r.hours;
@@ -824,28 +855,28 @@ class ct extends Y {
824
855
  this._syncOverlayState();
825
856
  }
826
857
  _applyTimeFromSurface(t) {
827
- const e = t.querySelector('select[data-segment="hours"]'), i = t.querySelector('select[data-segment="minutes"]'), n = t.querySelector('select[data-segment="meridiem"]');
858
+ const e = t.querySelector('select[data-segment="hours"]'), i = t.querySelector('select[data-segment="minutes"]'), s = t.querySelector('select[data-segment="meridiem"]');
828
859
  if (!e || !i)
829
860
  return;
830
861
  const a = Number(e.value), o = Number(i.value);
831
862
  if (!Number.isFinite(a) || !Number.isFinite(o))
832
863
  return;
833
- let s = a;
864
+ let n = a;
834
865
  if (this._is12h()) {
835
- const r = (n == null ? void 0 : n.value) === "pm" ? "pm" : "am";
836
- r === "pm" && s < 12 && (s += 12), r === "am" && s === 12 && (s = 0);
866
+ const r = (s == null ? void 0 : s.value) === "pm" ? "pm" : "am";
867
+ r === "pm" && n < 12 && (n += 12), r === "am" && n === 12 && (n = 0);
837
868
  }
838
869
  this._pending = this._clampState({
839
870
  date: this._pending.date,
840
- time: `${p(s)}:${p(o)}`
871
+ time: `${p(n)}:${p(o)}`
841
872
  }), this._emitInput("time");
842
873
  }
843
874
  _onRootClick(t) {
844
- var n;
875
+ var s;
845
876
  const e = t.target;
846
877
  if (!e)
847
878
  return;
848
- const i = (n = e.closest("[data-action]")) == null ? void 0 : n.getAttribute("data-action");
879
+ const i = (s = e.closest("[data-action]")) == null ? void 0 : s.getAttribute("data-action");
849
880
  if (i && !(this._isInteractionBlocked() || this._isReadonly())) {
850
881
  if (i === "toggle") {
851
882
  this._restoreFocusEl = e, this._setOpen(!this._open, "toggle");
@@ -856,7 +887,7 @@ class ct extends Y {
856
887
  return;
857
888
  }
858
889
  if (this._isInlineMode() && i === "now") {
859
- const a = /* @__PURE__ */ new Date(), o = String(a.getMonth() + 1).padStart(2, "0"), s = String(a.getDate()).padStart(2, "0"), r = `${a.getFullYear()}-${o}-${s}`, d = `${p(a.getHours())}:${p(a.getMinutes())}`;
890
+ const a = /* @__PURE__ */ new Date(), o = String(a.getMonth() + 1).padStart(2, "0"), n = String(a.getDate()).padStart(2, "0"), r = `${a.getFullYear()}-${o}-${n}`, d = `${p(a.getHours())}:${p(a.getMinutes())}`;
860
891
  this._pending = this._clampState({ date: r, time: d }), this._emitInput("now"), this._updateHostState();
861
892
  return;
862
893
  }
@@ -903,12 +934,12 @@ class ct extends Y {
903
934
  this._commit({ date: null, time: null }, "blur");
904
935
  return;
905
936
  }
906
- const n = /^(.+)\s+(\d{1,2}:\d{2}(?::\d{2})?(?:\s?[ap]m)?)$/i.exec(i);
907
- if (!n) {
937
+ const s = /^(.+)\s+(\d{1,2}:\d{2}(?::\d{2})?(?:\s?[ap]m)?)$/i.exec(i);
938
+ if (!s) {
908
939
  this._inlineError = this.getAttribute("error") || this._translations().invalidDateTime, this._emitInvalid(i, "parse"), this._updateHostState();
909
940
  return;
910
941
  }
911
- const a = this._parseDateInput(n[1]), o = y(n[2], !0) ? n[2] : null;
942
+ const a = this._parseDateInput(s[1]), o = y(s[2], !0) ? s[2] : null;
912
943
  if (!a || !o) {
913
944
  this._inlineError = this.getAttribute("error") || this._translations().invalidDateTime, this._emitInvalid(i, "parse"), this._updateHostState();
914
945
  return;
@@ -926,11 +957,11 @@ class ct extends Y {
926
957
  }
927
958
  }
928
959
  _onOverlayClick(t) {
929
- var n;
960
+ var s;
930
961
  const e = t.target;
931
962
  if (!e)
932
963
  return;
933
- const i = (n = e.closest("[data-action]")) == null ? void 0 : n.getAttribute("data-action");
964
+ const i = (s = e.closest("[data-action]")) == null ? void 0 : s.getAttribute("data-action");
934
965
  if (i && !this._isInteractionBlocked() && !(this._isReadonly() && i !== "toggle")) {
935
966
  if (i === "backdrop") {
936
967
  this._setOpen(!1, "outside");
@@ -945,7 +976,7 @@ class ct extends Y {
945
976
  return;
946
977
  }
947
978
  if (i === "now") {
948
- const a = /* @__PURE__ */ new Date(), o = String(a.getMonth() + 1).padStart(2, "0"), s = String(a.getDate()).padStart(2, "0"), r = `${a.getFullYear()}-${o}-${s}`, d = `${p(a.getHours())}:${p(a.getMinutes())}`;
979
+ const a = /* @__PURE__ */ new Date(), o = String(a.getMonth() + 1).padStart(2, "0"), n = String(a.getDate()).padStart(2, "0"), r = `${a.getFullYear()}-${o}-${n}`, d = `${p(a.getHours())}:${p(a.getMinutes())}`;
949
980
  this._pending = this._clampState({ date: r, time: d }), this._emitInput("now"), this._renderOverlay();
950
981
  return;
951
982
  }
@@ -962,7 +993,7 @@ class ct extends Y {
962
993
  const e = t.target;
963
994
  if (!e || e.tagName.toLowerCase() !== "ui-calendar")
964
995
  return;
965
- const i = t.type, n = t.detail, a = E(i === "select" ? (n == null ? void 0 : n.value) || null : n == null ? void 0 : n.value);
996
+ const i = t.type, s = t.detail, a = R(i === "select" ? (s == null ? void 0 : s.value) || null : s == null ? void 0 : s.value);
966
997
  if (a) {
967
998
  if (this._pending = this._clampState({ date: a, time: this._pending.time || "09:00" }), this._emitInput("calendar"), this._shouldAutoCommit() && this._pending.time) {
968
999
  this._commit(this._pending, "calendar"), this._setOpen(!1, "calendar");
@@ -983,23 +1014,23 @@ class ct extends Y {
983
1014
  _updateHostState() {
984
1015
  if (!this._hasView)
985
1016
  return;
986
- const t = this.getAttribute("label") || "", e = this.getAttribute("hint") || "", i = this.getAttribute("error") || "", n = this._inlineError || i, a = !!x(this._value), o = this.getAttribute("name") || "", s = this._allowInput() ? this._draft : this._formatDisplay(this._value), r = this._isInlineMode(), d = this._translations(), b = n ? "error" : this._state();
1017
+ const t = this.getAttribute("label") || "", e = this.getAttribute("hint") || "", i = this.getAttribute("error") || "", s = this._inlineError || i, a = !!x(this._value), o = this.getAttribute("name") || "", n = this._allowInput() ? this._draft : this._formatDisplay(this._value), r = this._isInlineMode(), d = this._translations(), b = s ? "error" : this._state();
987
1018
  this._state() === "loading" ? this.setAttribute("aria-busy", "true") : this.removeAttribute("aria-busy");
988
- const m = this.root.querySelector(".label"), S = this.root.querySelector(".label-text"), $ = this.root.querySelector(".required"), l = this.root.querySelector(".input"), I = this.root.querySelector('.btn[data-action="clear"]'), f = this.root.querySelector('.btn[data-action="toggle"]'), g = this.root.querySelector(".hint"), w = this.root.querySelector(".error"), k = this.root.querySelector(".hidden-input");
989
- if (m && (m.hidden = !t), m && (m.id = this._labelId, m.setAttribute("for", this._inputId)), S && (S.textContent = t), $ && ($.hidden = !this.hasAttribute("required")), l && (l.value !== s && (l.value = s), l.id = this._inputId, l.placeholder = d.dateTimePlaceholder, l.readOnly = !this._allowInput() || this._isReadonly(), l.disabled = this._isInteractionBlocked(), l.required = this.hasAttribute("required"), l.autocomplete = "off", l.setAttribute("role", "combobox"), l.setAttribute("aria-haspopup", "dialog"), l.setAttribute("aria-expanded", r ? "false" : String(this._open)), l.setAttribute("aria-controls", this._panelId), l.setAttribute("aria-invalid", n ? "true" : "false"), t ? l.setAttribute("aria-labelledby", this._labelId) : l.removeAttribute("aria-labelledby")), I && (I.hidden = !(this._clearable() && a), I.setAttribute("aria-label", d.clear), I.disabled = this._isInteractionBlocked()), f && (f.hidden = r, f.setAttribute("aria-label", d.toggleCalendar), f.setAttribute("aria-expanded", r ? "false" : String(this._open)), f.setAttribute("aria-controls", this._panelId), f.disabled = this._isInteractionBlocked()), g && (g.id = this._hintId, g.hidden = !e, g.textContent = e), w && (w.id = this._errorId, w.hidden = !n, w.textContent = n), l) {
1019
+ const m = this.root.querySelector(".label"), S = this.root.querySelector(".label-text"), D = this.root.querySelector(".required"), l = this.root.querySelector(".input"), I = this.root.querySelector('.btn[data-action="clear"]'), f = this.root.querySelector('.btn[data-action="toggle"]'), g = this.root.querySelector(".hint"), w = this.root.querySelector(".error"), k = this.root.querySelector(".hidden-input");
1020
+ if (m && (m.hidden = !t), m && (m.id = this._labelId, m.setAttribute("for", this._inputId)), S && (S.textContent = t), D && (D.hidden = !this.hasAttribute("required")), l && (l.value !== n && (l.value = n), l.id = this._inputId, l.placeholder = d.dateTimePlaceholder, l.readOnly = !this._allowInput() || this._isReadonly(), l.disabled = this._isInteractionBlocked(), l.required = this.hasAttribute("required"), l.autocomplete = "off", l.setAttribute("role", "combobox"), l.setAttribute("aria-haspopup", "dialog"), l.setAttribute("aria-expanded", r ? "false" : String(this._open)), l.setAttribute("aria-controls", this._panelId), l.setAttribute("aria-invalid", s ? "true" : "false"), t ? l.setAttribute("aria-labelledby", this._labelId) : l.removeAttribute("aria-labelledby")), I && (I.hidden = !(this._clearable() && a), I.setAttribute("aria-label", d.clear), I.disabled = this._isInteractionBlocked()), f && (f.hidden = r, f.setAttribute("aria-label", d.toggleCalendar), f.setAttribute("aria-expanded", r ? "false" : String(this._open)), f.setAttribute("aria-controls", this._panelId), f.disabled = this._isInteractionBlocked()), g && (g.id = this._hintId, g.hidden = !e, g.textContent = e), w && (w.id = this._errorId, w.hidden = !s, w.textContent = s), l) {
990
1021
  const _ = [];
991
- e && g && !g.hidden && _.push(this._hintId), n && _.push(this._errorId), _.length ? l.setAttribute("aria-describedby", _.join(" ")) : l.removeAttribute("aria-describedby");
1022
+ e && g && !g.hidden && _.push(this._hintId), s && _.push(this._errorId), _.length ? l.setAttribute("aria-describedby", _.join(" ")) : l.removeAttribute("aria-describedby");
992
1023
  }
993
1024
  k && (k.disabled = !o, k.name = o, k.value = x(this._value) || "");
994
- const C = this.root.querySelector(".field");
995
- C && (C.dataset.open = this._open && !r ? "true" : "false", C.dataset.invalid = n ? "true" : "false", C.dataset.state = b);
1025
+ const A = this.root.querySelector(".field");
1026
+ A && (A.dataset.open = this._open && !r ? "true" : "false", A.dataset.invalid = s ? "true" : "false", A.dataset.state = b);
996
1027
  const u = this.root.querySelector(".inline-panel");
997
1028
  if (u) {
998
1029
  u.hidden = !r, u.id = this._panelId, u.dataset.bare = this._isBare() ? "true" : "false", u.setAttribute("role", "dialog"), u.setAttribute("aria-modal", "false"), u.setAttribute("aria-label", t || d.selectDate);
999
1030
  const _ = u.querySelector(".panel-title");
1000
1031
  _ && (_.textContent = t, _.hidden = !t);
1001
- const D = u.querySelector(".head-title");
1002
- D && (D.textContent = t, D.hidden = !t);
1032
+ const $ = u.querySelector(".head-title");
1033
+ $ && ($.textContent = t, $.hidden = !t);
1003
1034
  const q = u.querySelector(".head-meta");
1004
1035
  q && (q.textContent = this._pending.date && this._pending.time ? this._formatDisplay(this._pending) : d.selectDate);
1005
1036
  const T = u.querySelector('[data-action="now"]');
@@ -1012,13 +1043,13 @@ class ct extends Y {
1012
1043
  H && (H.hidden = !this._showFooter());
1013
1044
  const V = u.querySelector(".dt-calendar-inline");
1014
1045
  V && this._syncCalendar(V);
1015
- const B = u.querySelector('select[data-segment="hours"]'), O = u.querySelector('select[data-segment="minutes"]'), z = u.querySelector('select[data-segment="meridiem"]'), A = y(this._pending.time || "00:00", !0) || { hours: 0, minutes: 0, seconds: 0 };
1016
- if (B) {
1017
- const R = this._is12h() ? A.hours % 12 || 12 : A.hours;
1018
- this._setClosestOptionValue(B, R), B.disabled = this._isInteractionBlocked() || this._isReadonly();
1046
+ const O = u.querySelector('select[data-segment="hours"]'), B = u.querySelector('select[data-segment="minutes"]'), z = u.querySelector('select[data-segment="meridiem"]'), C = y(this._pending.time || "00:00", !0) || { hours: 0, minutes: 0, seconds: 0 };
1047
+ if (O) {
1048
+ const L = this._is12h() ? C.hours % 12 || 12 : C.hours;
1049
+ this._setClosestOptionValue(O, L), O.disabled = this._isInteractionBlocked() || this._isReadonly();
1019
1050
  }
1020
- O && (this._setClosestOptionValue(O, A.minutes), O.disabled = this._isInteractionBlocked() || this._isReadonly()), z && (z.value = A.hours >= 12 ? "pm" : "am", z.disabled = this._isInteractionBlocked() || this._isReadonly()), u.querySelectorAll(".action").forEach((R) => {
1021
- R.disabled = this._isInteractionBlocked() || this._isReadonly();
1051
+ B && (this._setClosestOptionValue(B, C.minutes), B.disabled = this._isInteractionBlocked() || this._isReadonly()), z && (z.value = C.hours >= 12 ? "pm" : "am", z.disabled = this._isInteractionBlocked() || this._isReadonly()), u.querySelectorAll(".action").forEach((L) => {
1052
+ L.disabled = this._isInteractionBlocked() || this._isReadonly();
1022
1053
  });
1023
1054
  }
1024
1055
  !r && this._open && this._syncOverlayState(), r && this._destroyOverlay();
@@ -1027,18 +1058,18 @@ class ct extends Y {
1027
1058
  if (!this._hasView) {
1028
1059
  const t = this._translations();
1029
1060
  this.setContent(`
1030
- <style>${dt}</style>
1061
+ <style>${ct}</style>
1031
1062
  <div class="root">
1032
1063
  <label class="label" part="label" id="${this._labelId}">
1033
1064
  <span class="label-text"></span>
1034
1065
  <span class="required">*</span>
1035
1066
  </label>
1036
1067
  <div class="field" part="field input">
1037
- <span class="icon" part="icon">${at}</span>
1068
+ <span class="icon" part="icon">${lt}</span>
1038
1069
  <input class="input" id="${this._inputId}" part="input" />
1039
1070
  <span class="icon" part="icon">${K}</span>
1040
- <button type="button" class="btn" part="clear" data-action="clear">${lt}</button>
1041
- <button type="button" class="btn" part="toggle" data-action="toggle">${ot}</button>
1071
+ <button type="button" class="btn" part="clear" data-action="clear">${ut}</button>
1072
+ <button type="button" class="btn" part="toggle" data-action="toggle">${dt}</button>
1042
1073
  </div>
1043
1074
  <div class="hint" id="${this._hintId}" part="hint"></div>
1044
1075
  <div class="error" id="${this._errorId}" part="error" role="alert"></div>
@@ -1056,7 +1087,7 @@ class ct extends Y {
1056
1087
  return !1;
1057
1088
  }
1058
1089
  }
1059
- typeof customElements < "u" && !customElements.get("ui-date-time-picker") && customElements.define("ui-date-time-picker", ct);
1090
+ typeof customElements < "u" && !customElements.get("ui-date-time-picker") && customElements.define("ui-date-time-picker", ht);
1060
1091
  export {
1061
- ct as UIDateTimePicker
1092
+ ht as UIDateTimePicker
1062
1093
  };
@@ -0,0 +1 @@
1
+ "use strict";const l=require("./calendar-a8735e40.js"),U=require("./scroll-lock-d7b0df21.js"),C=new Map,F=24;function w(t,e,n){return Math.max(e,Math.min(n,t))}function u(t){return String(t).padStart(2,"0")}function b(t){if(!/^-?\d+$/.test(t))return null;const e=Number(t);return Number.isFinite(e)?Math.trunc(e):null}function z(t){return t.replace(/[.\-]/g,"/").replace(/\s+/g," ").trim()}function A(t){const e=[];for(let n=0;n<12;n+=1)e.push(new Intl.DateTimeFormat(t,{month:"short",timeZone:"UTC"}).format(new Date(Date.UTC(2024,n,1))));return e}function P(t){const e=[];for(let n=0;n<12;n+=1)e.push(new Intl.DateTimeFormat(t,{month:"long",timeZone:"UTC"}).format(new Date(Date.UTC(2024,n,1))));return e}function Y(t,e=!1){if(t==null)return e;const n=t.trim().toLowerCase();return n?n!=="false"&&n!=="0"&&n!=="off"&&n!=="no":!0}function k(t,e){const n=typeof t.composedPath=="function"?t.composedPath():[];for(const o of e)if(o&&n.includes(o))return!0;const r=t.target;if(!(r instanceof Node))return!1;for(const o of e)if(o instanceof Node&&o.contains(r))return!0;return!1}function B(t){const e=(t||"").trim();return e||(typeof navigator<"u"&&navigator.language?navigator.language:"en-US")}function m(t){if(!t)return null;const e=l.parseISO(t);return e?`${e.y}-${u(e.m)}-${u(e.d)}`:null}function y(t){if(!t)return null;const e=/^(\d{4}-\d{2}-\d{2})[T ](\d{1,2}:\d{2}(?::\d{2})?)$/.exec(t.trim());if(!e)return null;const n=m(e[1]);if(!n)return null;const r=T(e[2],!0);if(!r)return null;const o=e[2].split(":").length===3;return{date:n,time:M(r,o)}}function W(t,e){if(!t||!e)return null;const n=m(t),r=T(e,!0);return!n||!r?null:`${n}T${M(r,e.split(":").length>=3)}`}function q(t){if(!t)return null;const e=m(t);if(e)return e;const n=y(t);return(n==null?void 0:n.date)||null}function x(t){if(!t)return null;const e=y(t);if(e)return e;const n=m(t);return n?{date:n,time:"00:00"}:null}function E(t,e,n){const r=l.parseISO(t);if(!r)return t;const o=`${e}::${JSON.stringify(n||{})}`;let i=C.get(o);return i||(i=new Intl.DateTimeFormat(e,{year:"numeric",month:"short",day:"2-digit",timeZone:"UTC",...n||{}}),C.set(o,i)),i.format(new Date(Date.UTC(r.y,r.m-1,r.d)))}function H(t,e,n,r){if(!t)return"";if(n==="iso")return t;if(n==="custom"&&r){const o=l.parseISO(t);if(!o)return t;const i=A(e),s=P(e);return r.replace(/YYYY/g,String(o.y)).replace(/MMM/g,i[o.m-1]||"").replace(/MMMM/g,s[o.m-1]||"").replace(/MM/g,u(o.m)).replace(/DD/g,u(o.d))}return E(t,e)}function Z(t,e){const n=m(t.trim());if(n)return n;const r=z(t);if(!r)return null;const o=m(r);if(o)return o;const i=r.split("/").map(f=>f.trim()).filter(Boolean);if(i.length!==3)return null;const s=b(i[0]),a=b(i[1]),p=b(i[2]);if(s==null||a==null||p==null)return null;let c=p;c<100&&(c+=c>=70?1900:2e3);const d=e.toLowerCase().startsWith("en-us"),h=d?s:a,D=d?a:s;if(c<1e3||h<1||h>12||D<1||D>31)return null;const g=`${c}-${u(h)}-${u(D)}`;return m(g)}function T(t,e){const n=t.trim().toLowerCase();if(!n)return null;const r=/^(\d{1,2})(?::|\.|h)?(\d{1,2})?(?::|\.|m)?(\d{1,2})?\s*(am|pm)?$/.exec(n);if(!r)return null;let o=Number(r[1]);const i=Number(r[2]??"0"),s=Number(r[3]??"0");if(!Number.isFinite(o)||!Number.isFinite(i)||!Number.isFinite(s)||i<0||i>59||s<0||s>59||!e&&s!==0)return null;const a=r[4];if(a){if(o<1||o>12)return null;a==="pm"&&o<12&&(o+=12),a==="am"&&o===12&&(o=0)}return o<0||o>23?null:{hours:o,minutes:i,seconds:s}}function M(t,e=!1){if(!t)return"";const n=u(w(t.hours,0,23)),r=u(w(t.minutes,0,59));if(!e)return`${n}:${r}`;const o=u(w(t.seconds,0,59));return`${n}:${r}:${o}`}function _(t,e){const n=T(t,!0);if(!n)return t;const r=new Date;return r.setHours(n.hours,n.minutes,n.seconds,0),new Intl.DateTimeFormat(e,{hour:"numeric",minute:"2-digit",second:t.split(":").length>2?"2-digit":void 0,hour12:!0}).format(r)}function S(t,e){const n=T(t,!0),r=T(e,!0);if(!n||!r)return t.localeCompare(e);const o=n.hours*3600+n.minutes*60+n.seconds,i=r.hours*3600+r.minutes*60+r.seconds;return o-i}function X(t,e,n){const r=T(t,!0);if(!r)return t;let o=M(r,t.split(":").length>=3);return e&&S(o,e)<0&&(o=e),n&&S(o,n)>0&&(o=n),o}function G(t,e,n){let r=t;return e&&l.compareISO(r,e)<0&&(r=e),n&&l.compareISO(r,n)>0&&(r=n),r}function J(t,e){const n=y(t),r=y(e);if(!n||!r)return t.localeCompare(e);const o=l.compareISO(n.date,r.date);return o!==0?o:S(n.time,r.time)}function K(t){const e=l.parseISO(t);if(!e)return{start:t,end:t};const n=l.startOfMonth(e.y,e.m),r=l.endOfMonth(e.y,e.m);return{start:`${n.y}-${u(n.m)}-${u(n.d)}`,end:`${r.y}-${u(r.m)}-${u(r.d)}`}}function V(t,e){const n=w(e,1,366);return{start:l.addDaysISO(t,-(n-1)),end:t}}function j(t,e,n=8,r=8,o=null){const i=typeof window<"u"?window.innerWidth:1200,s=typeof window<"u"?window.innerHeight:800,a=typeof window<"u"&&window.scrollY||0,p=typeof window<"u"&&window.scrollX||0,c=s-t.bottom-r-n,d=t.top-r-n,h=c>=e.height,D=d>=e.height,g=o==="top"?"top":"bottom";let f;if(h&&!D)f="bottom";else if(D&&!h)f="top";else if(D&&h)f=g;else{const $=g==="bottom"?c:d,O=g==="bottom"?d:c;$>0&&O<=$+F?f=g:f=c>=d?"bottom":"top"}const I=f==="bottom"?t.bottom+r+a:t.top-e.height-r+a,v=t.left+p,N=p+i-e.width-n,L=w(v,p+n,Math.max(p+n,N));return{top:I,left:L,placement:f}}function Q(t){let e=0;return{run:()=>{e||(e=requestAnimationFrame(()=>{e=0,t()}))},cancel:()=>{e&&(cancelAnimationFrame(e),e=0)}}}function R(t){return(t||"popover")==="inline"||typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(max-width: 639px)").matches}function tt(){return U.acquireBodyScrollLock()}exports.clampDateIso=G;exports.clampTime=X;exports.combineDateTime=W;exports.compareDateTimes=J;exports.compareTimes=S;exports.computeLastDaysRange=V;exports.computeMonthRange=K;exports.computePopoverPosition=j;exports.eventOriginatesWithin=k;exports.formatDateForDisplay=H;exports.formatTime=M;exports.isTruthyAttr=Y;exports.lockBodyScroll=tt;exports.normalizeDateIso=m;exports.normalizeLocale=B;exports.parseConstraintDate=q;exports.parseConstraintDateTime=x;exports.parseTimeInput=T;exports.parseUserDateInput=Z;exports.rafThrottle=Q;exports.shouldUseMobileSheet=R;exports.splitDateTime=y;exports.to12hDisplay=_;