@luzmo/lucero 0.0.12 → 0.0.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 (166) hide show
  1. package/components/accordion/index.cjs +6 -6
  2. package/components/accordion/index.js +5 -5
  3. package/components/action-bar/index.cjs +4 -4
  4. package/components/action-bar/index.js +8 -9
  5. package/components/action-button/index.cjs +2 -2
  6. package/components/action-button/index.js +3 -4
  7. package/components/action-group/index.cjs +1 -1
  8. package/components/action-group/index.js +1 -1
  9. package/components/action-group-Uimj-MJP.cjs +20 -0
  10. package/components/{action-group-DzT5e9uS.js → action-group-enfc-YnW.js} +3 -3
  11. package/components/action-menu/index.cjs +7 -7
  12. package/components/action-menu/index.js +8 -8
  13. package/components/async-directive-DWRUSKKF.js +82 -0
  14. package/components/async-directive-D_Ter1F8.cjs +22 -0
  15. package/components/avatar/index.cjs +3 -3
  16. package/components/avatar/index.js +6 -6
  17. package/components/base-B7Pfl2if.cjs +40 -0
  18. package/components/{sized-mixin-DcvJLFeo.cjs → base-BjTwmyRF.cjs} +5 -1
  19. package/components/{base-CCsOyfm4.js → base-CawdqE7p.js} +132 -98
  20. package/components/base-D76d76ww.js +26 -0
  21. package/components/button/index.cjs +2 -2
  22. package/components/button/index.js +6 -7
  23. package/components/{button-base-BUylwU1F.js → button-base-B7v4eeRh.js} +5 -5
  24. package/components/{button-base-D62oiPcu.cjs → button-base-DmjYs2s9.cjs} +3 -3
  25. package/components/button-group/index.cjs +1 -1
  26. package/components/button-group/index.js +5 -6
  27. package/components/checkbox/index.cjs +4 -4
  28. package/components/checkbox/index.js +3 -4
  29. package/components/{checkbox-mixin-CM4VUJxF.js → checkbox-mixin-BFGTmw17.js} +9 -9
  30. package/components/{checkbox-mixin-CifGmiLR.cjs → checkbox-mixin-DUhXwD46.cjs} +3 -3
  31. package/components/{clear-button-BmUyRVoz.js → clear-button-DgZmX5RX.js} +6 -7
  32. package/components/clear-button-KdrF2jaV.cjs +18 -0
  33. package/components/{close-button-BekXo6bQ.js → close-button-CFHQnbsK.js} +9 -10
  34. package/components/close-button-DVGUppyd.cjs +18 -0
  35. package/components/color-area/index.cjs +5 -5
  36. package/components/color-area/index.js +4 -4
  37. package/components/color-field/index.cjs +2 -2
  38. package/components/color-field/index.js +2 -3
  39. package/components/color-handle/index.cjs +2 -2
  40. package/components/color-handle/index.js +2 -3
  41. package/components/color-loupe/index.cjs +1 -1
  42. package/components/color-loupe/index.js +1 -1
  43. package/components/{color-loupe-DiegGLZu.js → color-loupe-DxcqXoJ6.js} +1 -2
  44. package/components/color-loupe-SskbNeMp.cjs +56 -0
  45. package/components/color-menu/index.cjs +5 -5
  46. package/components/color-menu/index.js +4 -3
  47. package/components/color-picker/index.cjs +4 -4
  48. package/components/color-picker/index.js +9 -8
  49. package/components/color-slider/index.cjs +6 -6
  50. package/components/color-slider/index.js +6 -6
  51. package/components/directive-C7oCP5Bh.cjs +22 -0
  52. package/components/directive-helpers-TkFq2eZF.cjs +22 -0
  53. package/components/directive-helpers-nlQRAaQt.js +28 -0
  54. package/components/directive-oAbCiebi.js +44 -0
  55. package/components/divider/index.cjs +1 -1
  56. package/components/divider/index.js +2 -3
  57. package/components/field-group/index.cjs +1 -1
  58. package/components/field-group/index.js +1 -1
  59. package/components/{field-group-BPZvGJi1.js → field-group-DAhrTCfl.js} +2 -3
  60. package/components/field-group-DSY2HUoj.cjs +23 -0
  61. package/components/field-label/index.cjs +1 -1
  62. package/components/field-label/index.js +1 -1
  63. package/components/{field-label-6AaW05kA.js → field-label-CAFfGxEL.js} +3 -3
  64. package/components/field-label-CjsQ3ujK.cjs +25 -0
  65. package/components/focusable-DGWL1v1p.cjs +18 -0
  66. package/components/{focusable-CxA_NMK_.js → focusable-cj2QhwDT.js} +1 -2
  67. package/components/icon/index.cjs +1 -1
  68. package/components/icon/index.js +4 -5
  69. package/components/if-defined-B56xGmAg.cjs +22 -0
  70. package/components/if-defined-BSAr_4u4.js +27 -0
  71. package/components/{index-QeYYAZQR.js → index-CMvLpPKD.js} +17 -15
  72. package/components/index-DnWavOZD.cjs +77 -0
  73. package/components/index.cjs +1 -1
  74. package/components/index.js +16 -16
  75. package/components/infield-button/index.cjs +2 -2
  76. package/components/infield-button/index.js +3 -4
  77. package/components/label/index.cjs +1 -1
  78. package/components/label/index.js +1 -2
  79. package/components/like-anchor-Bmabl9ra.cjs +32 -0
  80. package/components/{like-anchor-D7tY6am5.js → like-anchor-QBlvwFfT.js} +23 -24
  81. package/components/{manage-help-text-CmE_nfjl.js → manage-help-text-Cozl9Sgn.js} +4 -4
  82. package/components/{manage-help-text-CoX77cTJ.cjs → manage-help-text-OHXDgxyj.cjs} +2 -2
  83. package/components/menu/index.cjs +1 -1
  84. package/components/menu/index.js +1 -1
  85. package/components/multi-language-field/index.cjs +2 -2
  86. package/components/multi-language-field/index.js +3 -4
  87. package/components/number-field/index.cjs +3 -3
  88. package/components/number-field/index.js +4 -4
  89. package/components/observe-slot-text-CrYB2Pj-.cjs +18 -0
  90. package/components/{observe-slot-text-CugmOzNZ.js → observe-slot-text-ggb4kKgY.js} +21 -20
  91. package/components/overlay/index.cjs +7 -7
  92. package/components/overlay/index.js +48 -46
  93. package/components/{overlay-CtdbWiFs.js → overlay-CJ9by37f.js} +71 -69
  94. package/components/overlay-Deh6Ki6I.cjs +47 -0
  95. package/components/{pending-state-DWvTsSoS.cjs → pending-state-Do522lTd.cjs} +1 -1
  96. package/components/{pending-state-B_JeaE62.js → pending-state-TJj1x9xn.js} +2 -2
  97. package/components/picker/index.cjs +1 -1
  98. package/components/picker/index.js +2 -2
  99. package/components/{picker-DwbcFve2.js → picker-833Apxe4.js} +134 -105
  100. package/components/picker-DDx8ii73.cjs +127 -0
  101. package/components/popover/index.cjs +1 -1
  102. package/components/popover/index.js +1 -1
  103. package/components/popover-BGOgXaka.cjs +30 -0
  104. package/components/{popover-DLFHilGS.js → popover-DlkzrLpl.js} +3 -3
  105. package/components/progress-circle/index.cjs +1 -1
  106. package/components/progress-circle/index.js +1 -1
  107. package/components/{progress-circle-CUCJ_Ehs.js → progress-circle-Be24kv6B.js} +4 -4
  108. package/components/{progress-circle-BXyXtMcs.cjs → progress-circle-NNbCMK2i.cjs} +6 -6
  109. package/components/query-BL-TJj7K.cjs +22 -0
  110. package/components/query-D_KR_GUc.js +51 -0
  111. package/components/query-assigned-elements-DjfhL1cl.js +36 -0
  112. package/components/query-assigned-elements-DsKsfk7G.cjs +22 -0
  113. package/components/query-assigned-nodes-BcKWmGzy.cjs +22 -0
  114. package/components/query-assigned-nodes-C76XVPWY.js +36 -0
  115. package/components/radio/index.cjs +2 -2
  116. package/components/radio/index.js +6 -6
  117. package/components/search/index.cjs +7 -7
  118. package/components/search/index.js +4 -4
  119. package/components/{sized-mixin-cJbo3PKR.js → sized-mixin-BxMraZLS.js} +5 -5
  120. package/components/sized-mixin-D9LkrMjb.cjs +18 -0
  121. package/components/slider/index.cjs +1 -1
  122. package/components/slider/index.js +2 -3
  123. package/components/state-C5I1gP3G.cjs +22 -0
  124. package/components/state-CYxk12SV.js +29 -0
  125. package/components/{streaming-listener-BgCzt2TI.js → streaming-listener-CCalHg57.js} +6 -5
  126. package/components/streaming-listener-KVex1WWB.cjs +18 -0
  127. package/components/style-map-Ct2LiEds.js +53 -0
  128. package/components/style-map-uMq-yDJ3.cjs +22 -0
  129. package/components/swatch/index.cjs +7 -7
  130. package/components/swatch/index.js +11 -11
  131. package/components/switch/index.cjs +2 -2
  132. package/components/switch/index.js +4 -5
  133. package/components/tags/index.cjs +4 -4
  134. package/components/tags/index.js +4 -4
  135. package/components/text-field/index.cjs +3 -3
  136. package/components/text-field/index.js +3 -4
  137. package/components/text-field-5_ev9way.cjs +85 -0
  138. package/components/text-field-CvKSS59x.js +313 -0
  139. package/components/toast/index.cjs +11 -11
  140. package/components/toast/index.js +2 -3
  141. package/components/tooltip/index.cjs +4 -4
  142. package/components/tooltip/index.js +4 -4
  143. package/components/unit-input/index.cjs +6 -6
  144. package/components/unit-input/index.js +3 -3
  145. package/components/utils.cjs +1 -1
  146. package/components/utils.js +4 -4
  147. package/components/when-CDK1Tt5Y.js +28 -0
  148. package/components/when-CDZyJPvd.cjs +22 -0
  149. package/package.json +1 -1
  150. package/components/action-group-B59CWNnT.cjs +0 -20
  151. package/components/base-CaRKlVkL.cjs +0 -36
  152. package/components/clear-button-Cc5-XUOJ.cjs +0 -18
  153. package/components/close-button-Bf8yzpLd.cjs +0 -18
  154. package/components/color-loupe-CLzp2MiI.cjs +0 -56
  155. package/components/field-group-CodR_26L.cjs +0 -23
  156. package/components/field-label-B91K6moC.cjs +0 -25
  157. package/components/focusable-BFdecx5l.cjs +0 -18
  158. package/components/index-Cg_y7WKM.cjs +0 -77
  159. package/components/like-anchor-b3cNzw52.cjs +0 -32
  160. package/components/observe-slot-text-ByPG1Lqw.cjs +0 -18
  161. package/components/overlay-BWBJGJN_.cjs +0 -47
  162. package/components/picker-CaC1rQOK.cjs +0 -123
  163. package/components/popover-C4w3aY8m.cjs +0 -30
  164. package/components/streaming-listener-C2bsIc4J.cjs +0 -18
  165. package/components/text-field-BX_aHXSW.js +0 -288
  166. package/components/text-field-DAr2RyH9.cjs +0 -81
@@ -15,15 +15,17 @@
15
15
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
16
16
  * SOFTWARE.
17
17
  * */
18
- import { a as ue, r as pe, x as ht } from "./base-CCsOyfm4.js";
19
- import { property as z, query as te, queryAssignedElements as fe, state as me } from "lit/decorators.js";
20
- import { ifDefined as Ct } from "lit/directives/if-defined.js";
21
- import { styleMap as Ut } from "lit/directives/style-map.js";
18
+ import { a as ue, r as pe, x as ht, n as z } from "./base-CawdqE7p.js";
19
+ import { r as fe } from "./state-CYxk12SV.js";
20
+ import { e as te } from "./query-D_KR_GUc.js";
21
+ import { o as me } from "./query-assigned-elements-DjfhL1cl.js";
22
+ import { o as Ct } from "./if-defined-BSAr_4u4.js";
23
+ import { o as Ut } from "./style-map-Ct2LiEds.js";
22
24
  import { r as St } from "./random-id-ByCz1xaq.js";
23
25
  import { E as ge, e as ve } from "./element-resolution-FCUT-wql.js";
24
26
  import { u as lt } from "./focusable-selectors-B4YgbghQ.js";
25
27
  import { S as ye, r as we } from "./slottable-request-event-DggLA4Rx.js";
26
- import { c as At } from "./condition-attribute-with-id-Dv4lSRbe.js";
28
+ import { c as Tt } from "./condition-attribute-with-id-Dv4lSRbe.js";
27
29
  import { c as be, j as xe } from "./platform-BM-uMWpX.js";
28
30
  function Ee(e, t, i = []) {
29
31
  for (const [n, o] of t.entries()) {
@@ -54,7 +56,7 @@ const Pe = (e, t, {
54
56
  return Ee(a, e, l);
55
57
  };
56
58
  }, Ce = 1e3, Oe = 1e3;
57
- class Ae {
59
+ class Te {
58
60
  constructor(t = {}) {
59
61
  this.warmUpDelay = Ce, this.coolDownDelay = Oe, this.isWarm = !1, this.timeout = 0, Object.assign(this, t);
60
62
  }
@@ -81,7 +83,7 @@ class Ae {
81
83
  this.cooldownTimeout && window.clearTimeout(this.cooldownTimeout), delete this.cooldownTimeout;
82
84
  }
83
85
  }
84
- const mt = new Ae(), J = () => {
86
+ const mt = new Te(), J = () => {
85
87
  }, kt = (e, t, i) => {
86
88
  const n = new AbortController(), o = /* @__PURE__ */ new Map(), s = () => {
87
89
  n.abort(), i();
@@ -287,7 +289,7 @@ class wt {
287
289
  };
288
290
  }
289
291
  }
290
- function Te(e) {
292
+ function Ae(e) {
291
293
  class t extends e {
292
294
  async manageDialogOpen() {
293
295
  const n = this.open;
@@ -662,7 +664,7 @@ class ke {
662
664
  this.closeOverlay(t);
663
665
  }
664
666
  }
665
- const Kt = new ke(), Fe = ':host{display:contents;pointer-events:none;--luzmo-overlay-animation-distance: .5rem}:host(:has(> luzmo-tooltip)){--luzmo-overlay-animation-distance: var( --luzmo-tooltip-animation-distance, 4px )}.dialog{margin:0;border:0;background:none;padding:0;position:fixed;overflow:visible;opacity:1!important;box-sizing:border-box;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);max-width:calc(100vw - 16px);height:auto;inset:auto;top:0;left:0;display:flex;--luzmo-overlay-open: true}.dialog:not([is-visible]){display:none}.dialog:focus{outline:none}dialog:modal{--luzmo-popover-filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, .15))}:host(:not([open])) .dialog{--luzmo-overlay-open: false}.dialog::backdrop{display:none}.dialog:before{position:absolute;top:-999em;right:-999em;bottom:-999em;left:-999em;content:"";pointer-events:auto!important}.dialog:not(.not-immediately-closable):before{display:none}.dialog>div{width:100%}::slotted(*){pointer-events:auto;visibility:visible!important}::slotted(luzmo-popover){position:static}.dialog:not([actual-placement])[placement*=top]{padding-block:var(--luzmo-overlay-animation-distance);margin-top:var(--luzmo-overlay-animation-distance)}.dialog:not([actual-placement])[placement*=right]{padding-inline:var(--luzmo-overlay-animation-distance);margin-left:calc(-1 * var(--luzmo-overlay-animation-distance))}.dialog:not([actual-placement])[placement*=bottom]{padding-block:var(--luzmo-overlay-animation-distance);margin-top:calc(-1 * var(--luzmo-overlay-animation-distance))}.dialog:not([actual-placement])[placement*=left]{padding-inline:var(--luzmo-overlay-animation-distance);margin-left:var(--luzmo-overlay-animation-distance)}.dialog[actual-placement*=top]{padding-block:var(--luzmo-overlay-animation-distance);margin-top:var(--luzmo-overlay-animation-distance)}.dialog[actual-placement*=right]{padding-inline:var(--luzmo-overlay-animation-distance);margin-left:calc(-1 * var(--luzmo-overlay-animation-distance))}.dialog[actual-placement*=bottom]{padding-block:var(--luzmo-overlay-animation-distance);margin-top:calc(-1 * var(--luzmo-overlay-animation-distance))}.dialog[actual-placement*=left]{padding-inline:var(--luzmo-overlay-animation-distance);margin-left:var(--luzmo-overlay-animation-distance)}slot[name=longpress-describedby-descriptor]{display:none}@supports selector(:open){.dialog{opacity:0}.dialog:open{opacity:1;--luzmo-popover-filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, .15))}}@supports selector(:popover-open){.dialog{opacity:0}.dialog:popover-open{opacity:1;--luzmo-popover-filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, .15))}}@supports (overlay: auto){.dialog{display:none;transition:all var(--luzmo-overlay-animation-duration, .13s),translate 0s,display var(--luzmo-overlay-animation-duration, .13s);transition-behavior:allow-discrete}.dialog:popover-open,.dialog:modal{display:flex}}@supports (not selector(:open)) and (not selector(:popover-open)){:host:not([open]) .dialog{pointer-events:none}.dialog[actual-placement]{z-index:calc(var(--luzmo-overlay-z-index-base, 1000) + var(--luzmo-overlay-open-count))}}', Y = Math.min, A = Math.max, gt = Math.round, dt = Math.floor, $ = (e) => ({
667
+ const Kt = new ke(), Fe = ':host{display:contents;pointer-events:none;--luzmo-overlay-animation-distance: .5rem}:host(:has(> luzmo-tooltip)){--luzmo-overlay-animation-distance: var( --luzmo-tooltip-animation-distance, 4px )}.dialog{margin:0;border:0;background:none;padding:0;position:fixed;overflow:visible;opacity:1!important;box-sizing:border-box;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);max-width:calc(100vw - 16px);height:auto;inset:auto;top:0;left:0;display:flex;--luzmo-overlay-open: true}.dialog:not([is-visible]){display:none}.dialog:focus{outline:none}dialog:modal{--luzmo-popover-filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, .15))}:host(:not([open])) .dialog{--luzmo-overlay-open: false}.dialog::backdrop{display:none}.dialog:before{position:absolute;top:-999em;right:-999em;bottom:-999em;left:-999em;content:"";pointer-events:auto!important}.dialog:not(.not-immediately-closable):before{display:none}.dialog>div{width:100%}::slotted(*){pointer-events:auto;visibility:visible!important}::slotted(luzmo-popover){position:static}.dialog:not([actual-placement])[placement*=top]{padding-block:var(--luzmo-overlay-animation-distance);margin-top:var(--luzmo-overlay-animation-distance)}.dialog:not([actual-placement])[placement*=right]{padding-inline:var(--luzmo-overlay-animation-distance);margin-left:calc(-1 * var(--luzmo-overlay-animation-distance))}.dialog:not([actual-placement])[placement*=bottom]{padding-block:var(--luzmo-overlay-animation-distance);margin-top:calc(-1 * var(--luzmo-overlay-animation-distance))}.dialog:not([actual-placement])[placement*=left]{padding-inline:var(--luzmo-overlay-animation-distance);margin-left:var(--luzmo-overlay-animation-distance)}.dialog[actual-placement*=top]{padding-block:var(--luzmo-overlay-animation-distance);margin-top:var(--luzmo-overlay-animation-distance)}.dialog[actual-placement*=right]{padding-inline:var(--luzmo-overlay-animation-distance);margin-left:calc(-1 * var(--luzmo-overlay-animation-distance))}.dialog[actual-placement*=bottom]{padding-block:var(--luzmo-overlay-animation-distance);margin-top:calc(-1 * var(--luzmo-overlay-animation-distance))}.dialog[actual-placement*=left]{padding-inline:var(--luzmo-overlay-animation-distance);margin-left:var(--luzmo-overlay-animation-distance)}slot[name=longpress-describedby-descriptor]{display:none}@supports selector(:open){.dialog{opacity:0}.dialog:open{opacity:1;--luzmo-popover-filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, .15))}}@supports selector(:popover-open){.dialog{opacity:0}.dialog:popover-open{opacity:1;--luzmo-popover-filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, .15))}}@supports (overlay: auto){.dialog{display:none;transition:all var(--luzmo-overlay-animation-duration, .13s),translate 0s,display var(--luzmo-overlay-animation-duration, .13s);transition-behavior:allow-discrete}.dialog:popover-open,.dialog:modal{display:flex}}@supports (not selector(:open)) and (not selector(:popover-open)){:host:not([open]) .dialog{pointer-events:none}.dialog[actual-placement]{z-index:calc(var(--luzmo-overlay-z-index-base, 1000) + var(--luzmo-overlay-open-count))}}', Y = Math.min, T = Math.max, gt = Math.round, dt = Math.floor, M = (e) => ({
666
668
  x: e,
667
669
  y: e
668
670
  }), ze = {
@@ -674,8 +676,8 @@ const Kt = new ke(), Fe = ':host{display:contents;pointer-events:none;--luzmo-ov
674
676
  start: "end",
675
677
  end: "start"
676
678
  };
677
- function Tt(e, t, i) {
678
- return A(e, Y(t, i));
679
+ function At(e, t, i) {
680
+ return T(e, Y(t, i));
679
681
  }
680
682
  function nt(e, t) {
681
683
  return typeof e == "function" ? e(t) : e;
@@ -689,29 +691,29 @@ function ot(e) {
689
691
  function ee(e) {
690
692
  return e === "x" ? "y" : "x";
691
693
  }
692
- function Mt(e) {
694
+ function $t(e) {
693
695
  return e === "y" ? "height" : "width";
694
696
  }
695
697
  function Q(e) {
696
698
  return ["top", "bottom"].includes(X(e)) ? "y" : "x";
697
699
  }
698
- function $t(e) {
700
+ function Mt(e) {
699
701
  return ee(Q(e));
700
702
  }
701
703
  function _e(e, t, i) {
702
704
  i === void 0 && (i = !1);
703
- const n = ot(e), o = $t(e), s = Mt(o);
705
+ const n = ot(e), o = Mt(e), s = $t(o);
704
706
  let r = o === "x" ? n === (i ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
705
707
  return t.reference[s] > t.floating[s] && (r = vt(r)), [r, vt(r)];
706
708
  }
707
- function Me(e) {
709
+ function $e(e) {
708
710
  const t = vt(e);
709
711
  return [Rt(e), t, Rt(t)];
710
712
  }
711
713
  function Rt(e) {
712
714
  return e.replace(/start|end/g, (t) => Ne[t]);
713
715
  }
714
- function $e(e, t, i) {
716
+ function Me(e, t, i) {
715
717
  const n = ["left", "right"], o = ["right", "left"], s = ["top", "bottom"], r = ["bottom", "top"];
716
718
  switch (e) {
717
719
  case "top":
@@ -726,7 +728,7 @@ function $e(e, t, i) {
726
728
  }
727
729
  function He(e, t, i, n) {
728
730
  const o = ot(e);
729
- let s = $e(X(e), i === "start", n);
731
+ let s = Me(X(e), i === "start", n);
730
732
  return o && (s = s.map((r) => r + "-" + o), t && (s = s.concat(s.map(Rt)))), s;
731
733
  }
732
734
  function vt(e) {
@@ -772,7 +774,7 @@ function Yt(e, t, i) {
772
774
  reference: n,
773
775
  floating: o
774
776
  } = e;
775
- const s = Q(t), r = $t(t), a = Mt(r), l = X(t), h = s === "y", c = n.x + n.width / 2 - o.width / 2, d = n.y + n.height / 2 - o.height / 2, f = n[a] / 2 - o[a] / 2;
777
+ const s = Q(t), r = Mt(t), a = $t(r), l = X(t), h = s === "y", c = n.x + n.width / 2 - o.width / 2, d = n.y + n.height / 2 - o.height / 2, f = n[a] / 2 - o[a] / 2;
776
778
  let u;
777
779
  switch (l) {
778
780
  case "top":
@@ -942,17 +944,17 @@ const qe = (e) => ({
942
944
  const d = ie(c), f = {
943
945
  x: i,
944
946
  y: n
945
- }, u = $t(o), p = Mt(u), m = await r.getDimensions(h), v = u === "y", g = v ? "top" : "left", y = v ? "bottom" : "right", w = v ? "clientHeight" : "clientWidth", x = s.reference[p] + s.reference[u] - f[u] - s.floating[p], b = f[u] - s.reference[u], D = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(h));
947
+ }, u = Mt(o), p = $t(u), m = await r.getDimensions(h), v = u === "y", g = v ? "top" : "left", y = v ? "bottom" : "right", w = v ? "clientHeight" : "clientWidth", x = s.reference[p] + s.reference[u] - f[u] - s.floating[p], b = f[u] - s.reference[u], D = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(h));
946
948
  let E = D ? D[w] : 0;
947
949
  (!E || !await (r.isElement == null ? void 0 : r.isElement(D))) && (E = a.floating[w] || s.floating[p]);
948
- const W = x / 2 - b / 2, N = E / 2 - m[p] / 2 - 1, L = Y(d[g], N), V = Y(d[y], N), _ = L, U = E - m[p] - V, C = E / 2 - m[p] / 2 + W, tt = Tt(_, C, U), q = !l.arrow && ot(o) != null && C !== tt && s.reference[p] / 2 - (C < _ ? L : V) - m[p] / 2 < 0, M = q ? C < _ ? C - _ : C - U : 0;
950
+ const W = x / 2 - b / 2, N = E / 2 - m[p] / 2 - 1, L = Y(d[g], N), V = Y(d[y], N), _ = L, U = E - m[p] - V, C = E / 2 - m[p] / 2 + W, tt = At(_, C, U), q = !l.arrow && ot(o) != null && C !== tt && s.reference[p] / 2 - (C < _ ? L : V) - m[p] / 2 < 0, $ = q ? C < _ ? C - _ : C - U : 0;
949
951
  return {
950
- [u]: f[u] + M,
952
+ [u]: f[u] + $,
951
953
  data: {
952
954
  [u]: tt,
953
- centerOffset: C - tt - M,
955
+ centerOffset: C - tt - $,
954
956
  ...q && {
955
- alignmentOffset: M
957
+ alignmentOffset: $
956
958
  }
957
959
  },
958
960
  reset: q
@@ -982,7 +984,7 @@ const qe = (e) => ({
982
984
  } = nt(e, t);
983
985
  if ((i = s.arrow) != null && i.alignmentOffset)
984
986
  return {};
985
- const g = X(o), y = Q(a), w = X(a) === a, x = await (l.isRTL == null ? void 0 : l.isRTL(h.floating)), b = f || (w || !m ? [vt(a)] : Me(a)), D = p !== "none";
987
+ const g = X(o), y = Q(a), w = X(a) === a, x = await (l.isRTL == null ? void 0 : l.isRTL(h.floating)), b = f || (w || !m ? [vt(a)] : $e(a)), D = p !== "none";
986
988
  !f && D && b.push(...He(a, m, p, x));
987
989
  const E = [a, ...b], W = await Ht(t, v), N = [];
988
990
  let L = ((n = s.flip) == null ? void 0 : n.overflows) || [];
@@ -1006,12 +1008,12 @@ const qe = (e) => ({
1006
1008
  placement: tt
1007
1009
  }
1008
1010
  };
1009
- let q = (_ = L.filter((M) => M.overflows[0] <= 0).sort((M, j) => M.overflows[1] - j.overflows[1])[0]) == null ? void 0 : _.placement;
1011
+ let q = (_ = L.filter(($) => $.overflows[0] <= 0).sort(($, j) => $.overflows[1] - j.overflows[1])[0]) == null ? void 0 : _.placement;
1010
1012
  if (!q)
1011
1013
  switch (u) {
1012
1014
  case "bestFit": {
1013
1015
  var U;
1014
- const M = (U = L.filter((j) => {
1016
+ const $ = (U = L.filter((j) => {
1015
1017
  if (D) {
1016
1018
  const K = Q(j.placement);
1017
1019
  return K === y || // Create a bias to the `y` side axis due to horizontal
@@ -1020,7 +1022,7 @@ const qe = (e) => ({
1020
1022
  }
1021
1023
  return !0;
1022
1024
  }).map((j) => [j.placement, j.overflows.filter((K) => K > 0).reduce((K, de) => K + de, 0)]).sort((j, K) => j[1] - K[1])[0]) == null ? void 0 : U[0];
1023
- M && (q = M);
1025
+ $ && (q = $);
1024
1026
  break;
1025
1027
  }
1026
1028
  case "initialPlacement":
@@ -1119,11 +1121,11 @@ const Ue = function(e) {
1119
1121
  let u = h[f], p = h[d];
1120
1122
  if (s) {
1121
1123
  const v = f === "y" ? "top" : "left", g = f === "y" ? "bottom" : "right", y = u + c[v], w = u - c[g];
1122
- u = Tt(y, u, w);
1124
+ u = At(y, u, w);
1123
1125
  }
1124
1126
  if (r) {
1125
1127
  const v = d === "y" ? "top" : "left", g = d === "y" ? "bottom" : "right", y = p + c[v], w = p - c[g];
1126
- p = Tt(y, p, w);
1128
+ p = At(y, p, w);
1127
1129
  }
1128
1130
  const m = a.fn({
1129
1131
  ...t,
@@ -1167,8 +1169,8 @@ const Ue = function(e) {
1167
1169
  const y = m - c.top - c.bottom, w = p - c.left - c.right, x = Y(m - c[v], y), b = Y(p - c[g], w), D = !t.middlewareData.shift;
1168
1170
  let E = x, W = b;
1169
1171
  if ((i = t.middlewareData.shift) != null && i.enabled.x && (W = w), (n = t.middlewareData.shift) != null && n.enabled.y && (E = y), D && !f) {
1170
- const L = A(c.left, 0), V = A(c.right, 0), _ = A(c.top, 0), U = A(c.bottom, 0);
1171
- u ? W = p - 2 * (L !== 0 || V !== 0 ? L + V : A(c.left, c.right)) : E = m - 2 * (_ !== 0 || U !== 0 ? _ + U : A(c.top, c.bottom));
1172
+ const L = T(c.left, 0), V = T(c.right, 0), _ = T(c.top, 0), U = T(c.bottom, 0);
1173
+ u ? W = p - 2 * (L !== 0 || V !== 0 ? L + V : T(c.left, c.right)) : E = m - 2 * (_ !== 0 || U !== 0 ? _ + U : T(c.top, c.bottom));
1172
1174
  }
1173
1175
  await l({
1174
1176
  ...t,
@@ -1190,7 +1192,7 @@ function bt() {
1190
1192
  function st(e) {
1191
1193
  return ne(e) ? (e.nodeName || "").toLowerCase() : "#document";
1192
1194
  }
1193
- function T(e) {
1195
+ function A(e) {
1194
1196
  var t;
1195
1197
  return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
1196
1198
  }
@@ -1199,16 +1201,16 @@ function B(e) {
1199
1201
  return (t = (ne(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
1200
1202
  }
1201
1203
  function ne(e) {
1202
- return bt() ? e instanceof Node || e instanceof T(e).Node : !1;
1204
+ return bt() ? e instanceof Node || e instanceof A(e).Node : !1;
1203
1205
  }
1204
1206
  function k(e) {
1205
- return bt() ? e instanceof Element || e instanceof T(e).Element : !1;
1207
+ return bt() ? e instanceof Element || e instanceof A(e).Element : !1;
1206
1208
  }
1207
1209
  function H(e) {
1208
- return bt() ? e instanceof HTMLElement || e instanceof T(e).HTMLElement : !1;
1210
+ return bt() ? e instanceof HTMLElement || e instanceof A(e).HTMLElement : !1;
1209
1211
  }
1210
1212
  function Xt(e) {
1211
- return !bt() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof T(e).ShadowRoot;
1213
+ return !bt() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof A(e).ShadowRoot;
1212
1214
  }
1213
1215
  function ct(e) {
1214
1216
  const {
@@ -1253,7 +1255,7 @@ function it(e) {
1253
1255
  return ["html", "body", "#document"].includes(st(e));
1254
1256
  }
1255
1257
  function F(e) {
1256
- return T(e).getComputedStyle(e);
1258
+ return A(e).getComputedStyle(e);
1257
1259
  }
1258
1260
  function Et(e) {
1259
1261
  return k(e) ? {
@@ -1283,7 +1285,7 @@ function oe(e) {
1283
1285
  function at(e, t, i) {
1284
1286
  var n;
1285
1287
  t === void 0 && (t = []), i === void 0 && (i = !0);
1286
- const o = oe(e), s = o === ((n = e.ownerDocument) == null ? void 0 : n.body), r = T(o);
1288
+ const o = oe(e), s = o === ((n = e.ownerDocument) == null ? void 0 : n.body), r = A(o);
1287
1289
  if (s) {
1288
1290
  const a = Dt(r);
1289
1291
  return t.concat(r, r.visualViewport || [], ct(o) ? o : [], a && i ? at(a) : []);
@@ -1309,7 +1311,7 @@ function qt(e) {
1309
1311
  function et(e) {
1310
1312
  const t = qt(e);
1311
1313
  if (!H(t))
1312
- return $(1);
1314
+ return M(1);
1313
1315
  const i = t.getBoundingClientRect(), {
1314
1316
  width: n,
1315
1317
  height: o,
@@ -1321,30 +1323,30 @@ function et(e) {
1321
1323
  y: a
1322
1324
  };
1323
1325
  }
1324
- const Ge = /* @__PURE__ */ $(0);
1326
+ const Ge = /* @__PURE__ */ M(0);
1325
1327
  function re(e) {
1326
- const t = T(e);
1328
+ const t = A(e);
1327
1329
  return !Wt() || !t.visualViewport ? Ge : {
1328
1330
  x: t.visualViewport.offsetLeft,
1329
1331
  y: t.visualViewport.offsetTop
1330
1332
  };
1331
1333
  }
1332
1334
  function Je(e, t, i) {
1333
- return t === void 0 && (t = !1), !i || t && i !== T(e) ? !1 : t;
1335
+ return t === void 0 && (t = !1), !i || t && i !== A(e) ? !1 : t;
1334
1336
  }
1335
1337
  function Z(e, t, i, n) {
1336
1338
  t === void 0 && (t = !1), i === void 0 && (i = !1);
1337
1339
  const o = e.getBoundingClientRect(), s = qt(e);
1338
- let r = $(1);
1340
+ let r = M(1);
1339
1341
  t && (n ? k(n) && (r = et(n)) : r = et(e));
1340
- const a = Je(s, i, n) ? re(s) : $(0);
1342
+ const a = Je(s, i, n) ? re(s) : M(0);
1341
1343
  let l = (o.left + a.x) / r.x, h = (o.top + a.y) / r.y, c = o.width / r.x, d = o.height / r.y;
1342
1344
  if (s) {
1343
- const f = T(s), u = n && k(n) ? T(n) : n;
1345
+ const f = A(s), u = n && k(n) ? A(n) : n;
1344
1346
  let p = f, m = Dt(p);
1345
1347
  for (; m && n && u !== p; ) {
1346
1348
  const v = et(m), g = m.getBoundingClientRect(), y = F(m), w = g.left + (m.clientLeft + parseFloat(y.paddingLeft)) * v.x, x = g.top + (m.clientTop + parseFloat(y.paddingTop)) * v.y;
1347
- l *= v.x, h *= v.y, c *= v.x, d *= v.y, l += w, h += x, p = T(m), m = Dt(p);
1349
+ l *= v.x, h *= v.y, c *= v.x, d *= v.y, l += w, h += x, p = A(m), m = Dt(p);
1348
1350
  }
1349
1351
  }
1350
1352
  return yt({
@@ -1382,13 +1384,13 @@ function Qe(e) {
1382
1384
  let l = {
1383
1385
  scrollLeft: 0,
1384
1386
  scrollTop: 0
1385
- }, h = $(1);
1386
- const c = $(0), d = H(n);
1387
+ }, h = M(1);
1388
+ const c = M(0), d = H(n);
1387
1389
  if ((d || !d && !s) && ((st(n) !== "body" || ct(r)) && (l = Et(n)), H(n))) {
1388
1390
  const u = Z(n);
1389
1391
  h = et(n), c.x = u.x + n.clientLeft, c.y = u.y + n.clientTop;
1390
1392
  }
1391
- const f = r && !d && !s ? ae(r, l, !0) : $(0);
1393
+ const f = r && !d && !s ? ae(r, l, !0) : M(0);
1392
1394
  return {
1393
1395
  width: i.width * h.x,
1394
1396
  height: i.height * h.y,
@@ -1400,10 +1402,10 @@ function Ze(e) {
1400
1402
  return Array.from(e.getClientRects());
1401
1403
  }
1402
1404
  function ti(e) {
1403
- const t = B(e), i = Et(e), n = e.ownerDocument.body, o = A(t.scrollWidth, t.clientWidth, n.scrollWidth, n.clientWidth), s = A(t.scrollHeight, t.clientHeight, n.scrollHeight, n.clientHeight);
1405
+ const t = B(e), i = Et(e), n = e.ownerDocument.body, o = T(t.scrollWidth, t.clientWidth, n.scrollWidth, n.clientWidth), s = T(t.scrollHeight, t.clientHeight, n.scrollHeight, n.clientHeight);
1404
1406
  let r = -i.scrollLeft + It(e);
1405
1407
  const a = -i.scrollTop;
1406
- return F(n).direction === "rtl" && (r += A(t.clientWidth, n.clientWidth) - o), {
1408
+ return F(n).direction === "rtl" && (r += T(t.clientWidth, n.clientWidth) - o), {
1407
1409
  width: o,
1408
1410
  height: s,
1409
1411
  x: r,
@@ -1411,7 +1413,7 @@ function ti(e) {
1411
1413
  };
1412
1414
  }
1413
1415
  function ei(e, t) {
1414
- const i = T(e), n = B(e), o = i.visualViewport;
1416
+ const i = A(e), n = B(e), o = i.visualViewport;
1415
1417
  let s = n.clientWidth, r = n.clientHeight, a = 0, l = 0;
1416
1418
  if (o) {
1417
1419
  s = o.width, r = o.height;
@@ -1426,7 +1428,7 @@ function ei(e, t) {
1426
1428
  };
1427
1429
  }
1428
1430
  function ii(e, t) {
1429
- const i = Z(e, !0, t === "fixed"), n = i.top + e.clientTop, o = i.left + e.clientLeft, s = H(e) ? et(e) : $(1), r = e.clientWidth * s.x, a = e.clientHeight * s.y, l = o * s.x, h = n * s.y;
1431
+ const i = Z(e, !0, t === "fixed"), n = i.top + e.clientTop, o = i.left + e.clientLeft, s = H(e) ? et(e) : M(1), r = e.clientWidth * s.x, a = e.clientHeight * s.y, l = o * s.x, h = n * s.y;
1430
1432
  return {
1431
1433
  width: r,
1432
1434
  height: a,
@@ -1479,7 +1481,7 @@ function oi(e) {
1479
1481
  } = e;
1480
1482
  const r = [...i === "clippingAncestors" ? xt(t) ? [] : ni(t, this._c) : [].concat(i), n], a = r[0], l = r.reduce((h, c) => {
1481
1483
  const d = Gt(t, c, o);
1482
- return h.top = A(d.top, h.top), h.right = Y(d.right, h.right), h.bottom = Y(d.bottom, h.bottom), h.left = A(d.left, h.left), h;
1484
+ return h.top = T(d.top, h.top), h.right = Y(d.right, h.right), h.bottom = Y(d.bottom, h.bottom), h.left = T(d.left, h.left), h;
1483
1485
  }, Gt(t, a, o));
1484
1486
  return {
1485
1487
  width: l.right - l.left,
@@ -1504,13 +1506,13 @@ function ri(e, t, i) {
1504
1506
  scrollLeft: 0,
1505
1507
  scrollTop: 0
1506
1508
  };
1507
- const l = $(0);
1509
+ const l = M(0);
1508
1510
  if (n || !n && !s)
1509
1511
  if ((st(t) !== "body" || ct(o)) && (a = Et(t)), n) {
1510
1512
  const f = Z(t, !0, s, t);
1511
1513
  l.x = f.x + t.clientLeft, l.y = f.y + t.clientTop;
1512
1514
  } else o && (l.x = It(o));
1513
- const h = o && !n && !s ? ae(o, a) : $(0), c = r.left + a.scrollLeft - l.x - h.x, d = r.top + a.scrollTop - l.y - h.y;
1515
+ const h = o && !n && !s ? ae(o, a) : M(0), c = r.left + a.scrollLeft - l.x - h.x, d = r.top + a.scrollTop - l.y - h.y;
1514
1516
  return {
1515
1517
  x: c,
1516
1518
  y: d,
@@ -1530,7 +1532,7 @@ function Jt(e, t) {
1530
1532
  return B(e) === i && (i = i.ownerDocument.body), i;
1531
1533
  }
1532
1534
  function ce(e, t) {
1533
- const i = T(e);
1535
+ const i = A(e);
1534
1536
  if (xt(e))
1535
1537
  return i;
1536
1538
  if (!H(e)) {
@@ -1596,7 +1598,7 @@ function hi(e, t) {
1596
1598
  return;
1597
1599
  const p = dt(d), m = dt(o.clientWidth - (c + f)), v = dt(o.clientHeight - (d + u)), g = dt(c), w = {
1598
1600
  rootMargin: -p + "px " + -m + "px " + -v + "px " + -g + "px",
1599
- threshold: A(0, Y(1, l)) || 1
1601
+ threshold: T(0, Y(1, l)) || 1
1600
1602
  };
1601
1603
  let x = !0;
1602
1604
  function b(D) {
@@ -1691,7 +1693,7 @@ const pt = 8, gi = 100, vi = (e) => ({
1691
1693
  bottom: ["top", "left", "right"],
1692
1694
  "bottom-start": ["top-start", "left", "right"],
1693
1695
  "bottom-end": ["top-end", "left", "right"]
1694
- })[e] ?? [e], Bi = Symbol("placement updated");
1696
+ })[e] ?? [e], qi = Symbol("placement updated");
1695
1697
  class yi {
1696
1698
  /**
1697
1699
  * Creates an instance of the PlacementController.
@@ -1979,7 +1981,7 @@ class xi extends Vt {
1979
1981
  t === n ? this.prepareOverlayRelativeDescription() : t === i && this.prepareContentRelativeDescription();
1980
1982
  }
1981
1983
  prepareOverlayRelativeDescription() {
1982
- const t = At(
1984
+ const t = Tt(
1983
1985
  this.target,
1984
1986
  "aria-describedby",
1985
1987
  [this.overlay.id]
@@ -1991,7 +1993,7 @@ class xi extends Vt {
1991
1993
  prepareContentRelativeDescription() {
1992
1994
  const t = [], i = this.overlay.elements.map((o) => (t.push(o.id), o.id || (o.id = `${this.overlay.tagName.toLowerCase()}-helper-${St()}`), o.id));
1993
1995
  this.elementIds = t;
1994
- const n = At(
1996
+ const n = Tt(
1995
1997
  this.target,
1996
1998
  "aria-describedby",
1997
1999
  i
@@ -2110,7 +2112,7 @@ class Ci extends Vt {
2110
2112
  i.textContent = Pi[n], i.slot = "longpress-describedby-descriptor";
2111
2113
  const o = t.getRootNode(), s = this.overlay.getRootNode();
2112
2114
  o === s ? this.overlay.append(i) : (i.hidden = !("host" in o), t.after(i));
2113
- const r = At(
2115
+ const r = Tt(
2114
2116
  t,
2115
2117
  "aria-describedby",
2116
2118
  [i.id]
@@ -2148,13 +2150,13 @@ const Oi = {
2148
2150
  longpress: Ci,
2149
2151
  hover: xi
2150
2152
  };
2151
- var Ai = Object.defineProperty, Ti = Object.getOwnPropertyDescriptor, O = (e, t, i, n) => {
2152
- for (var o = n > 1 ? void 0 : n ? Ti(t, i) : t, s = e.length - 1, r; s >= 0; s--)
2153
+ var Ti = Object.defineProperty, Ai = Object.getOwnPropertyDescriptor, O = (e, t, i, n) => {
2154
+ for (var o = n > 1 ? void 0 : n ? Ai(t, i) : t, s = e.length - 1, r; s >= 0; s--)
2153
2155
  (r = e[s]) && (o = (n ? r(t, i, o) : r(o)) || o);
2154
- return n && o && Ai(t, i, o), o;
2156
+ return n && o && Ti(t, i, o), o;
2155
2157
  };
2156
2158
  const Ri = "showPopover" in document.createElement("div");
2157
- let ft = Te(rt);
2159
+ let ft = Ae(rt);
2158
2160
  ft = Ri ? Le(ft) : Re(ft);
2159
2161
  var I;
2160
2162
  const P = (I = class extends ft {
@@ -2646,7 +2648,7 @@ O([
2646
2648
  z({ type: Boolean })
2647
2649
  ], P.prototype, "disabled", 1);
2648
2650
  O([
2649
- fe({
2651
+ me({
2650
2652
  flatten: !0,
2651
2653
  selector: ':not([slot="longpress-describedby-descriptor"], slot)'
2652
2654
  })
@@ -2667,7 +2669,7 @@ O([
2667
2669
  te("slot")
2668
2670
  ], P.prototype, "slotEl", 2);
2669
2671
  O([
2670
- me()
2672
+ fe()
2671
2673
  ], P.prototype, "state", 1);
2672
2674
  O([
2673
2675
  z({ type: Number, attribute: "tip-padding" })
@@ -2705,6 +2707,6 @@ export {
2705
2707
  kt as g,
2706
2708
  J as n,
2707
2709
  mt as o,
2708
- Bi as p,
2710
+ qi as p,
2709
2711
  Oi as s
2710
2712
  };
@@ -0,0 +1,47 @@
1
+ /*! * Lucero - The design system for Luzmo.
2
+ *
3
+ * Copyright © 2025 Luzmo
4
+ * All rights reserved.
5
+ * Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
6
+ * This license allows users with a current active Luzmo account to use Lucero.
7
+ * This license terminates automatically if a user no longer has an active Luzmo account.
8
+ * Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
9
+ *
10
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
11
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
13
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
14
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
15
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
16
+ * SOFTWARE.
17
+ * */
18
+ "use strict";const E=require("./base-B7Pfl2if.cjs"),xe=require("./state-C5I1gP3G.cjs"),ie=require("./query-BL-TJj7K.cjs"),Ee=require("./query-assigned-elements-DsKsfk7G.cjs"),Tt=require("./if-defined-B56xGmAg.cjs"),Vt=require("./style-map-uMq-yDJ3.cjs"),kt=require("./random-id-CqvckpWe.cjs"),Ut=require("./element-resolution-BvRLGqIU.cjs"),ct=require("./focusable-selectors-BgFlyFcY.cjs"),jt=require("./slottable-request-event-BfUUt1Mh.cjs"),Rt=require("./condition-attribute-with-id-DrQYZzFS.cjs"),Kt=require("./platform-BiXhwqk3.cjs");function Ce(e,t,i=[]){for(const[n,o]of t.entries()){const s=e[n],r=s.parentElement||s.getRootNode();i[n]&&i[n](o),r&&r!==s&&s.replaceWith(o),delete e[n]}return t}const Pe=(e,t,{position:i,prepareCallback:n}={position:"beforeend"})=>{let{length:o}=e;if(o===0)return()=>e;let s=1,r=0;(i==="afterbegin"||i==="afterend")&&(s=-1,r=o-1);const l=new Array(o),a=new Array(o),h=document.createComment("placeholder for reparented element");do{const c=e[r];n&&(a[r]=n(c)),l[r]=h.cloneNode();const d=c.parentElement||c.getRootNode();d&&d!==c&&d.replaceChild(l[r],c),t.insertAdjacentElement(i,c),r+=s}while(--o>0);return function(){return Ce(l,e,a)}},Oe=1e3,Te=1e3;class Ae{constructor(t={}){this.warmUpDelay=Oe,this.coolDownDelay=Te,this.isWarm=!1,this.timeout=0,Object.assign(this,t)}openTimer(t){if(this.cancelCooldownTimer(),!this.component||t!==this.component)return this.component&&(this.close(this.component),this.cancelCooldownTimer()),this.component=t,this.isWarm?Promise.resolve(!1):(this.promise=new Promise(i=>{this.resolve=i,this.timeout=window.setTimeout(()=>{this.resolve&&(this.resolve(!1),this.isWarm=!0)},this.warmUpDelay)}),this.promise);if(this.promise)return this.promise;throw new Error("Inconsistent state")}close(t){this.component&&this.component===t&&(this.resetCooldownTimer(),this.timeout>0&&(clearTimeout(this.timeout),this.timeout=0),this.resolve&&(this.resolve(!0),delete this.resolve),delete this.promise,delete this.component)}resetCooldownTimer(){this.isWarm&&(this.cooldownTimeout&&window.clearTimeout(this.cooldownTimeout),this.cooldownTimeout=window.setTimeout(()=>{this.isWarm=!1,delete this.cooldownTimeout},this.coolDownDelay))}cancelCooldownTimer(){this.cooldownTimeout&&window.clearTimeout(this.cooldownTimeout),delete this.cooldownTimeout}}const lt=new Ae,Y=()=>{},xt=(e,t,i)=>{const n=new AbortController,o=new Map,s=()=>{n.abort(),i()};let r,l;const a=requestAnimationFrame(()=>{r=requestAnimationFrame(()=>{l=requestAnimationFrame(()=>{s()})})}),h=d=>{d.target===e&&(o.set(d.propertyName,o.get(d.propertyName)-1),o.get(d.propertyName)||o.delete(d.propertyName),o.size===0&&s())},c=d=>{d.target===e&&(o.has(d.propertyName)||o.set(d.propertyName,0),o.set(d.propertyName,o.get(d.propertyName)+1),cancelAnimationFrame(a),cancelAnimationFrame(r),cancelAnimationFrame(l))};e.addEventListener("transitionrun",c,{signal:n.signal}),e.addEventListener("transitionend",h,{signal:n.signal}),e.addEventListener("transitioncancel",h,{signal:n.signal}),t()};function R(){return new Promise(e=>requestAnimationFrame(()=>e()))}class it extends E.LuzmoElement{constructor(){super(...arguments),this.dispose=Y,this.offset=0,this.willPreventClose=!1}applyFocus(t,i){}get delayed(){return!1}set delayed(t){}get disabled(){return!1}set disabled(t){}get elementResolver(){return this._elementResolver}set elementResolver(t){this._elementResolver=t}ensureOnDOM(t){}makeTransition(t){return null}manageDelay(t){}manageDialogOpen(){}managePopoverOpen(){}managePosition(){}get open(){return!1}set open(t){}get placementController(){return this._placementController}set placementController(t){this._placementController=t}requestSlottable(){}returnFocus(){}get state(){return"closed"}set state(t){}manuallyKeepOpen(){}static update(){const t=new CustomEvent("luzmo-update-overlays",{bubbles:!0,composed:!0,cancelable:!0});document.dispatchEvent(t)}static async open(t,i,n,o){await Promise.resolve().then(()=>bt);const s=arguments.length===2,r=n||t,l=new this;let a=!1;const h=Pe([r],l,{position:"beforeend",prepareCallback:f=>{const u=f.slot;return f.removeAttribute("slot"),()=>{f.slot=u}}});if(l.dispose=()=>{l.addEventListener("luzmo-closed",()=>{a||(h(),a=!0),requestAnimationFrame(()=>{l.remove()})}),l.open=!1,l.dispose=Y},!s&&r&&o){const f=t,u=i,p=o;return it.applyOptions(l,{...p,delayed:p.delayed||r.hasAttribute("delayed"),trigger:p.virtualTrigger||f,type:u==="modal"?"modal":u==="hover"?"hint":"auto"}),f.after(l),await l.updateComplete,l.open=!0,l.dispose}const d=i;return l.append(r),it.applyOptions(l,{...d,delayed:d.delayed||r.hasAttribute("delayed")}),l.updateComplete.then(()=>{l.open=!0}),l}static applyOptions(t,i){t.delayed=!!i.delayed,t.receivesFocus=i.receivesFocus??"auto",t.triggerElement=i.trigger||null,t.type=i.type||"modal",t.offset=i.offset??0,t.placement=i.placement,t.willPreventClose=!!i.notImmediatelyClosable}}const Ft=e=>e.querySelector(ct.userFocusableSelector),zt=e=>e.assignedElements().find(i=>i.matches(ct.userFocusableSelector));class Nt extends Event{constructor(){super("beforetoggle",{bubbles:!1,composed:!1}),this.currentState="open",this.newState="closed"}}class _t extends Event{constructor(){super("beforetoggle",{bubbles:!1,composed:!1}),this.currentState="closed",this.newState="open"}}class k extends Event{constructor(t,i,{publish:n,interaction:o,reason:s}){super(t,{bubbles:n,composed:n}),this.overlay=i,this.detail={interaction:o,reason:s}}}class ht{constructor(t,i){this.x=0,this.y=0,this.x=t,this.y=i}updateBoundingClientRect(t,i){this.x=t,this.y=i,it.update()}getBoundingClientRect(){return{width:0,height:0,top:this.y,right:this.x,y:this.y,x:this.x,bottom:this.y,left:this.x,toJSON(){}}}}function Re(e){class t extends e{async manageDialogOpen(){const n=this.open;if(await R(),await this.managePosition(),this.open!==n)return;const o=await this.dialogMakeTransition(n);this.open===n&&await this.dialogApplyFocus(n,o)}dialogMakeTransition(n){let o=null;const s=(l,a)=>()=>{if(l.open=n,!n){const c=()=>{l.removeEventListener("close",c)};l.addEventListener("close",c)}if(a>0)return;const h=n?_t:Nt;this.dispatchEvent(new h),n&&(l.matches(ct.userFocusableSelector)&&(o=l),o=o||Ft(l),o||l.querySelectorAll("slot").forEach(d=>{o||(o=zt(d))}),!(!this.isConnected||this.dialogEl.open)&&this.dialogEl.showModal())},r=(l,a)=>()=>{if(this.open!==n)return;const h=n?"luzmo-opened":"luzmo-closed";if(a>0){l.dispatchEvent(new k(h,this,{interaction:this.type,publish:!1}));return}if(!this.isConnected||n!==this.open)return;const c=async()=>{const d=this.triggerElement instanceof ht;this.dispatchEvent(new k(h,this,{interaction:this.type,publish:d})),l.dispatchEvent(new k(h,this,{interaction:this.type,publish:!1})),this.triggerElement&&!d&&this.triggerElement.dispatchEvent(new k(h,this,{interaction:this.type,publish:!0})),this.state=n?"opened":"closed",this.returnFocus(),await R(),await R(),n===this.open&&n===!1&&this.requestSlottable()};!n&&this.dialogEl.open?(this.dialogEl.addEventListener("close",()=>{c()},{once:!0}),this.dialogEl.close()):c()};return this.elements.forEach((l,a)=>{xt(l,s(l,a),r(l,a))}),o}dialogApplyFocus(n,o){this.applyFocus(n,o)}}return t}function De(e){class t extends e{async managePopoverOpen(){await this.managePosition()}async manageDelay(n){if(n===!1||n!==this.open){lt.close(this);return}this.delayed&&await lt.openTimer(this)&&(this.open=!n)}ensureOnDOM(n){document.body.offsetHeight}makeTransition(n){if(this.open!==n)return null;let o=null;const s=(l,a)=>()=>{if(n!==this.open)return;if(l.open=n,a===0){const c=n?_t:Nt;this.dispatchEvent(new c)}if(n!==!0||(l.matches(ct.userFocusableSelector)&&(o=l),o=o||Ft(l),o))return;l.querySelectorAll("slot").forEach(c=>{o||(o=zt(c))})},r=(l,a)=>async()=>{if(this.open!==n)return;const h=n?"luzmo-opened":"luzmo-closed";if(l.dispatchEvent(new k(h,this,{interaction:this.type})),a>0)return;const c=this.triggerElement instanceof ht;this.dispatchEvent(new k(h,this,{interaction:this.type,publish:c})),this.triggerElement&&!c&&this.triggerElement.dispatchEvent(new k(h,this,{interaction:this.type,publish:!0})),this.state=n?"opened":"closed",this.returnFocus(),await R(),await R(),n===this.open&&n===!1&&this.requestSlottable()};return this.elements.forEach((l,a)=>{xt(l,s(l,a),r(l,a))}),o}}return t}const Le=CSS.supports("(overlay: auto)");function Yt(e){let t=!1;try{t=e.matches(":popover-open")}catch{}let i=!1;try{i=e.matches(":open")}catch{}return t||i}function Se(e){class t extends e{async manageDelay(n){if(n===!1||n!==this.open){lt.close(this);return}this.delayed&&await lt.openTimer(this)&&(this.open=!n)}shouldHidePopover(n){if(n&&this.open!==n)return;const o=async({newState:s}={})=>{s!=="open"&&await this.placementController.resetOverlayPosition()};if(!Yt(this.dialogEl)){o();return}this.dialogEl.addEventListener("toggle",o,{once:!0})}shouldShowPopover(n){let o=!1;try{o=this.dialogEl.matches(":popover-open")}catch{}let s=!1;try{s=this.dialogEl.matches(":open")}catch{}n&&this.open===n&&!o&&!s&&this.isConnected&&(this.dialogEl.showPopover(),this.managePosition())}async ensureOnDOM(n){await R(),Le||await this.shouldHidePopover(n),this.shouldShowPopover(n),await R()}makeTransition(n){if(this.open!==n)return null;let o=null;const s=(l,a)=>()=>{if(l.open=n,a===0){const c=n?_t:Nt;this.dispatchEvent(new c)}if(!n||(l.matches(ct.userFocusableSelector)&&(o=l),o=o||Ft(l),o))return;l.querySelectorAll("slot").forEach(c=>{o||(o=zt(c))})},r=(l,a)=>()=>{if(this.open!==n)return;const h=n?"luzmo-opened":"luzmo-closed";if(a>0){l.dispatchEvent(new k(h,this,{interaction:this.type,publish:!1}));return}const c=async()=>{if(this.open!==n)return;await R();const f=this.triggerElement instanceof ht;this.dispatchEvent(new k(h,this,{interaction:this.type,publish:f})),l.dispatchEvent(new k(h,this,{interaction:this.type,publish:!1})),this.triggerElement&&!f&&this.triggerElement.dispatchEvent(new k(h,this,{interaction:this.type,publish:!0})),this.state=n?"opened":"closed",this.returnFocus(),await R(),await R(),n===this.open&&n===!1&&this.requestSlottable()};if(this.open!==n)return;const d=Yt(this.dialogEl);n!==!0&&d&&this.isConnected?(this.dialogEl.addEventListener("beforetoggle",()=>{c()},{once:!0}),this.dialogEl.hidePopover()):c()};return this.elements.forEach((l,a)=>{xt(l,s(l,a),r(l,a))}),o}}return t}const ke="showPopover"in document.createElement("div");class Fe{constructor(){this.root=document.body,this.stack=[],this.handlePointerdown=t=>{this.pointerdownPath=t.composedPath(),this.lastOverlay=this.stack.at(-1)},this.handlePointerup=()=>{const t=this.pointerdownPath;if(this.pointerdownPath=void 0,this.stack.length===0||!(t!=null&&t.length))return;const i=this.lastOverlay;this.lastOverlay=void 0;const n=this.stack.length-1,o=this.stack.filter((s,r)=>!t.find(a=>a===s||a===(s==null?void 0:s.triggerElement)&&(s==null?void 0:s.type)==="hint"||r===n&&s!==i&&s.triggerInteraction==="longpress")&&!s.shouldPreventClose()&&s.type!=="manual"&&!(s.type==="modal"&&i!==s));o.reverse(),o.forEach(s=>{this.closeOverlay(s);let r=s.parentOverlayToForceClose;for(;r;)this.closeOverlay(r),r=r.parentOverlayToForceClose})},this.handleBeforetoggle=t=>{const{target:i,newState:n}=t;n!=="open"&&this.closeOverlay(i)},this.handleKeydown=t=>{if(t.code!=="Escape"||this.stack.length===0)return;const i=this.stack.at(-1);if((i==null?void 0:i.type)==="page"){t.preventDefault();return}ke||(i==null?void 0:i.type)!=="manual"&&i&&this.closeOverlay(i)},this.bindEvents()}get document(){return this.root.ownerDocument||document}bindEvents(){this.document.addEventListener("pointerdown",this.handlePointerdown),this.document.addEventListener("pointerup",this.handlePointerup),this.document.addEventListener("keydown",this.handleKeydown)}closeOverlay(t){const i=this.stack.indexOf(t);i!==-1&&this.stack.splice(i,1),t.open=!1}overlaysByTriggerElement(t){return this.stack.filter(i=>i.triggerElement===t)}add(t){if(this.stack.includes(t)){const i=this.stack.indexOf(t);i!==-1&&(this.stack.splice(i,1),this.stack.push(t));return}if(t.type==="auto"||t.type==="modal"||t.type==="page"){const i="luzmo-overlay-query-path",n=new Event(i,{composed:!0,bubbles:!0});t.addEventListener(i,o=>{const s=o.composedPath();this.stack.forEach(r=>{!s.find(a=>a===r)&&r.type!=="manual"&&r.type!=="modal"&&this.closeOverlay(r)})},{once:!0}),t.dispatchEvent(n)}else if(t.type==="hint"){if(this.stack.some(n=>n.type!=="manual"&&n.triggerElement&&n.triggerElement===t.triggerElement)){t.open=!1;return}this.stack.forEach(n=>{n.type==="hint"&&this.closeOverlay(n)})}requestAnimationFrame(()=>{this.stack.push(t),t.addEventListener("beforetoggle",this.handleBeforetoggle,{once:!0})})}remove(t){this.closeOverlay(t)}}const Gt=new Fe,ze=':host{display:contents;pointer-events:none;--luzmo-overlay-animation-distance: .5rem}:host(:has(> luzmo-tooltip)){--luzmo-overlay-animation-distance: var( --luzmo-tooltip-animation-distance, 4px )}.dialog{margin:0;border:0;background:none;padding:0;position:fixed;overflow:visible;opacity:1!important;box-sizing:border-box;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);max-width:calc(100vw - 16px);height:auto;inset:auto;top:0;left:0;display:flex;--luzmo-overlay-open: true}.dialog:not([is-visible]){display:none}.dialog:focus{outline:none}dialog:modal{--luzmo-popover-filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, .15))}:host(:not([open])) .dialog{--luzmo-overlay-open: false}.dialog::backdrop{display:none}.dialog:before{position:absolute;top:-999em;right:-999em;bottom:-999em;left:-999em;content:"";pointer-events:auto!important}.dialog:not(.not-immediately-closable):before{display:none}.dialog>div{width:100%}::slotted(*){pointer-events:auto;visibility:visible!important}::slotted(luzmo-popover){position:static}.dialog:not([actual-placement])[placement*=top]{padding-block:var(--luzmo-overlay-animation-distance);margin-top:var(--luzmo-overlay-animation-distance)}.dialog:not([actual-placement])[placement*=right]{padding-inline:var(--luzmo-overlay-animation-distance);margin-left:calc(-1 * var(--luzmo-overlay-animation-distance))}.dialog:not([actual-placement])[placement*=bottom]{padding-block:var(--luzmo-overlay-animation-distance);margin-top:calc(-1 * var(--luzmo-overlay-animation-distance))}.dialog:not([actual-placement])[placement*=left]{padding-inline:var(--luzmo-overlay-animation-distance);margin-left:var(--luzmo-overlay-animation-distance)}.dialog[actual-placement*=top]{padding-block:var(--luzmo-overlay-animation-distance);margin-top:var(--luzmo-overlay-animation-distance)}.dialog[actual-placement*=right]{padding-inline:var(--luzmo-overlay-animation-distance);margin-left:calc(-1 * var(--luzmo-overlay-animation-distance))}.dialog[actual-placement*=bottom]{padding-block:var(--luzmo-overlay-animation-distance);margin-top:calc(-1 * var(--luzmo-overlay-animation-distance))}.dialog[actual-placement*=left]{padding-inline:var(--luzmo-overlay-animation-distance);margin-left:var(--luzmo-overlay-animation-distance)}slot[name=longpress-describedby-descriptor]{display:none}@supports selector(:open){.dialog{opacity:0}.dialog:open{opacity:1;--luzmo-popover-filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, .15))}}@supports selector(:popover-open){.dialog{opacity:0}.dialog:popover-open{opacity:1;--luzmo-popover-filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, .15))}}@supports (overlay: auto){.dialog{display:none;transition:all var(--luzmo-overlay-animation-duration, .13s),translate 0s,display var(--luzmo-overlay-animation-duration, .13s);transition-behavior:allow-discrete}.dialog:popover-open,.dialog:modal{display:flex}}@supports (not selector(:open)) and (not selector(:popover-open)){:host:not([open]) .dialog{pointer-events:none}.dialog[actual-placement]{z-index:calc(var(--luzmo-overlay-z-index-base, 1000) + var(--luzmo-overlay-open-count))}}',G=Math.min,A=Math.max,vt=Math.round,pt=Math.floor,M=e=>({x:e,y:e}),Ne={left:"right",right:"left",bottom:"top",top:"bottom"},_e={start:"end",end:"start"};function Dt(e,t,i){return A(e,G(t,i))}function ot(e,t){return typeof e=="function"?e(t):e}function X(e){return e.split("-")[0]}function st(e){return e.split("-")[1]}function ne(e){return e==="x"?"y":"x"}function qt(e){return e==="y"?"height":"width"}function Q(e){return["top","bottom"].includes(X(e))?"y":"x"}function Mt(e){return ne(Q(e))}function qe(e,t,i){i===void 0&&(i=!1);const n=st(e),o=Mt(e),s=qt(o);let r=o==="x"?n===(i?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=yt(r)),[r,yt(r)]}function Me(e){const t=yt(e);return[Lt(e),t,Lt(t)]}function Lt(e){return e.replace(/start|end/g,t=>_e[t])}function $e(e,t,i){const n=["left","right"],o=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return i?t?o:n:t?n:o;case"left":case"right":return t?s:r;default:return[]}}function We(e,t,i,n){const o=st(e);let s=$e(X(e),i==="start",n);return o&&(s=s.map(r=>r+"-"+o),t&&(s=s.concat(s.map(Lt)))),s}function yt(e){return e.replace(/left|right|bottom|top/g,t=>Ne[t])}function He(e){return{top:0,right:0,bottom:0,left:0,...e}}function oe(e){return typeof e!="number"?He(e):{top:e,right:e,bottom:e,left:e}}function wt(e){const{x:t,y:i,width:n,height:o}=e;return{width:n,height:o,top:i,left:t,right:t+n,bottom:i+o,x:t,y:i}}function Xt(e,t,i){let{reference:n,floating:o}=e;const s=Q(t),r=Mt(t),l=qt(r),a=X(t),h=s==="y",c=n.x+n.width/2-o.width/2,d=n.y+n.height/2-o.height/2,f=n[l]/2-o[l]/2;let u;switch(a){case"top":u={x:c,y:n.y-o.height};break;case"bottom":u={x:c,y:n.y+n.height};break;case"right":u={x:n.x+n.width,y:d};break;case"left":u={x:n.x-o.width,y:d};break;default:u={x:n.x,y:n.y}}switch(st(t)){case"start":u[r]-=f*(i&&h?-1:1);break;case"end":u[r]+=f*(i&&h?-1:1);break}return u}const Ie=async(e,t,i)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:r}=i,l=s.filter(Boolean),a=await(r.isRTL==null?void 0:r.isRTL(t));let h=await r.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=Xt(h,n,a),f=n,u={},p=0;for(let m=0;m<l.length;m++){const{name:v,fn:g}=l[m],{x:y,y:w,data:x,reset:b}=await g({x:c,y:d,initialPlacement:n,placement:f,strategy:o,middlewareData:u,rects:h,platform:r,elements:{reference:e,floating:t}});c=y??c,d=w??d,u={...u,[v]:{...u[v],...x}},b&&p<=50&&(p++,typeof b=="object"&&(b.placement&&(f=b.placement),b.rects&&(h=b.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:o}):b.rects),{x:c,y:d}=Xt(h,f,a)),m=-1)}return{x:c,y:d,placement:f,strategy:o,middlewareData:u}};async function $t(e,t){var i;t===void 0&&(t={});const{x:n,y:o,platform:s,rects:r,elements:l,strategy:a}=e,{boundary:h="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:u=0}=ot(t,e),p=oe(u),v=l[f?d==="floating"?"reference":"floating":d],g=wt(await s.getClippingRect({element:(i=await(s.isElement==null?void 0:s.isElement(v)))==null||i?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:h,rootBoundary:c,strategy:a})),y=d==="floating"?{x:n,y:o,width:r.floating.width,height:r.floating.height}:r.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),x=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},b=wt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:w,strategy:a}):y);return{top:(g.top-b.top+p.top)/x.y,bottom:(b.bottom-g.bottom+p.bottom)/x.y,left:(g.left-b.left+p.left)/x.x,right:(b.right-g.right+p.right)/x.x}}const Be=e=>({name:"arrow",options:e,async fn(t){const{x:i,y:n,placement:o,rects:s,platform:r,elements:l,middlewareData:a}=t,{element:h,padding:c=0}=ot(e,t)||{};if(h==null)return{};const d=oe(c),f={x:i,y:n},u=Mt(o),p=qt(u),m=await r.getDimensions(h),v=u==="y",g=v?"top":"left",y=v?"bottom":"right",w=v?"clientHeight":"clientWidth",x=s.reference[p]+s.reference[u]-f[u]-s.floating[p],b=f[u]-s.reference[u],L=await(r.getOffsetParent==null?void 0:r.getOffsetParent(h));let C=L?L[w]:0;(!C||!await(r.isElement==null?void 0:r.isElement(L)))&&(C=l.floating[w]||s.floating[p]);const H=x/2-b/2,N=C/2-m[p]/2-1,S=G(d[g],N),V=G(d[y],N),_=S,U=C-m[p]-V,O=C/2-m[p]/2+H,tt=Dt(_,O,U),I=!a.arrow&&st(o)!=null&&O!==tt&&s.reference[p]/2-(O<_?S:V)-m[p]/2<0,q=I?O<_?O-_:O-U:0;return{[u]:f[u]+q,data:{[u]:tt,centerOffset:O-tt-q,...I&&{alignmentOffset:q}},reset:I}}}),Ve=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var i,n;const{placement:o,middlewareData:s,rects:r,initialPlacement:l,platform:a,elements:h}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...v}=ot(e,t);if((i=s.arrow)!=null&&i.alignmentOffset)return{};const g=X(o),y=Q(l),w=X(l)===l,x=await(a.isRTL==null?void 0:a.isRTL(h.floating)),b=f||(w||!m?[yt(l)]:Me(l)),L=p!=="none";!f&&L&&b.push(...We(l,m,p,x));const C=[l,...b],H=await $t(t,v),N=[];let S=((n=s.flip)==null?void 0:n.overflows)||[];if(c&&N.push(H[g]),d){const O=qe(o,r,x);N.push(H[O[0]],H[O[1]])}if(S=[...S,{placement:o,overflows:N}],!N.every(O=>O<=0)){var V,_;const O=(((V=s.flip)==null?void 0:V.index)||0)+1,tt=C[O];if(tt)return{data:{index:O,overflows:S},reset:{placement:tt}};let I=(_=S.filter(q=>q.overflows[0]<=0).sort((q,j)=>q.overflows[1]-j.overflows[1])[0])==null?void 0:_.placement;if(!I)switch(u){case"bestFit":{var U;const q=(U=S.filter(j=>{if(L){const K=Q(j.placement);return K===y||K==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(K=>K>0).reduce((K,be)=>K+be,0)]).sort((j,K)=>j[1]-K[1])[0])==null?void 0:U[0];q&&(I=q);break}case"initialPlacement":I=l;break}if(o!==I)return{reset:{placement:I}}}return{}}}};async function Ue(e,t){const{placement:i,platform:n,elements:o}=e,s=await(n.isRTL==null?void 0:n.isRTL(o.floating)),r=X(i),l=st(i),a=Q(i)==="y",h=["left","top"].includes(r)?-1:1,c=s&&a?-1:1,d=ot(t,e);let{mainAxis:f,crossAxis:u,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof p=="number"&&(u=l==="end"?p*-1:p),a?{x:u*c,y:f*h}:{x:f*h,y:u*c}}const je=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var i,n;const{x:o,y:s,placement:r,middlewareData:l}=t,a=await Ue(t,e);return r===((i=l.offset)==null?void 0:i.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+a.x,y:s+a.y,data:{...a,placement:r}}}}},Ke=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:n,placement:o}=t,{mainAxis:s=!0,crossAxis:r=!1,limiter:l={fn:v=>{let{x:g,y}=v;return{x:g,y}}},...a}=ot(e,t),h={x:i,y:n},c=await $t(t,a),d=Q(X(o)),f=ne(d);let u=h[f],p=h[d];if(s){const v=f==="y"?"top":"left",g=f==="y"?"bottom":"right",y=u+c[v],w=u-c[g];u=Dt(y,u,w)}if(r){const v=d==="y"?"top":"left",g=d==="y"?"bottom":"right",y=p+c[v],w=p-c[g];p=Dt(y,p,w)}const m=l.fn({...t,[f]:u,[d]:p});return{...m,data:{x:m.x-i,y:m.y-n,enabled:{[f]:s,[d]:r}}}}}},Ye=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var i,n;const{placement:o,rects:s,platform:r,elements:l}=t,{apply:a=()=>{},...h}=ot(e,t),c=await $t(t,h),d=X(o),f=st(o),u=Q(o)==="y",{width:p,height:m}=s.floating;let v,g;d==="top"||d==="bottom"?(v=d,g=f===(await(r.isRTL==null?void 0:r.isRTL(l.floating))?"start":"end")?"left":"right"):(g=d,v=f==="end"?"top":"bottom");const y=m-c.top-c.bottom,w=p-c.left-c.right,x=G(m-c[v],y),b=G(p-c[g],w),L=!t.middlewareData.shift;let C=x,H=b;if((i=t.middlewareData.shift)!=null&&i.enabled.x&&(H=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(C=y),L&&!f){const S=A(c.left,0),V=A(c.right,0),_=A(c.top,0),U=A(c.bottom,0);u?H=p-2*(S!==0||V!==0?S+V:A(c.left,c.right)):C=m-2*(_!==0||U!==0?_+U:A(c.top,c.bottom))}await a({...t,availableWidth:H,availableHeight:C});const N=await r.getDimensions(l.floating);return p!==N.width||m!==N.height?{reset:{rects:!0}}:{}}}};function Et(){return typeof window<"u"}function rt(e){return se(e)?(e.nodeName||"").toLowerCase():"#document"}function D(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function W(e){var t;return(t=(se(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function se(e){return Et()?e instanceof Node||e instanceof D(e).Node:!1}function F(e){return Et()?e instanceof Element||e instanceof D(e).Element:!1}function $(e){return Et()?e instanceof HTMLElement||e instanceof D(e).HTMLElement:!1}function Jt(e){return!Et()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof D(e).ShadowRoot}function dt(e){const{overflow:t,overflowX:i,overflowY:n,display:o}=z(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+i)&&!["inline","contents"].includes(o)}function Ge(e){return["table","td","th"].includes(rt(e))}function Ct(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Wt(e){const t=Ht(),i=F(e)?z(e):e;return["transform","translate","scale","rotate","perspective"].some(n=>i[n]?i[n]!=="none":!1)||(i.containerType?i.containerType!=="normal":!1)||!t&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!t&&(i.filter?i.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(i.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(i.contain||"").includes(n))}function Xe(e){let t=J(e);for(;$(t)&&!nt(t);){if(Wt(t))return t;if(Ct(t))return null;t=J(t)}return null}function Ht(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function nt(e){return["html","body","#document"].includes(rt(e))}function z(e){return D(e).getComputedStyle(e)}function Pt(e){return F(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function J(e){if(rt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Jt(e)&&e.host||W(e);return Jt(t)?t.host:t}function re(e){const t=J(e);return nt(t)?e.ownerDocument?e.ownerDocument.body:e.body:$(t)&&dt(t)?t:re(t)}function at(e,t,i){var n;t===void 0&&(t=[]),i===void 0&&(i=!0);const o=re(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),r=D(o);if(s){const l=St(r);return t.concat(r,r.visualViewport||[],dt(o)?o:[],l&&i?at(l):[])}return t.concat(o,at(o,[],i))}function St(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function le(e){const t=z(e);let i=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=$(e),s=o?e.offsetWidth:i,r=o?e.offsetHeight:n,l=vt(i)!==s||vt(n)!==r;return l&&(i=s,n=r),{width:i,height:n,$:l}}function It(e){return F(e)?e:e.contextElement}function et(e){const t=It(e);if(!$(t))return M(1);const i=t.getBoundingClientRect(),{width:n,height:o,$:s}=le(t);let r=(s?vt(i.width):i.width)/n,l=(s?vt(i.height):i.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}const Je=M(0);function ae(e){const t=D(e);return!Ht()||!t.visualViewport?Je:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Qe(e,t,i){return t===void 0&&(t=!1),!i||t&&i!==D(e)?!1:t}function Z(e,t,i,n){t===void 0&&(t=!1),i===void 0&&(i=!1);const o=e.getBoundingClientRect(),s=It(e);let r=M(1);t&&(n?F(n)&&(r=et(n)):r=et(e));const l=Qe(s,i,n)?ae(s):M(0);let a=(o.left+l.x)/r.x,h=(o.top+l.y)/r.y,c=o.width/r.x,d=o.height/r.y;if(s){const f=D(s),u=n&&F(n)?D(n):n;let p=f,m=St(p);for(;m&&n&&u!==p;){const v=et(m),g=m.getBoundingClientRect(),y=z(m),w=g.left+(m.clientLeft+parseFloat(y.paddingLeft))*v.x,x=g.top+(m.clientTop+parseFloat(y.paddingTop))*v.y;a*=v.x,h*=v.y,c*=v.x,d*=v.y,a+=w,h+=x,p=D(m),m=St(p)}}return wt({width:c,height:d,x:a,y:h})}function Bt(e,t){const i=Pt(e).scrollLeft;return t?t.left+i:Z(W(e)).left+i}function ce(e,t,i){i===void 0&&(i=!1);const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-(i?0:Bt(e,n)),s=n.top+t.scrollTop;return{x:o,y:s}}function Ze(e){let{elements:t,rect:i,offsetParent:n,strategy:o}=e;const s=o==="fixed",r=W(n),l=t?Ct(t.floating):!1;if(n===r||l&&s)return i;let a={scrollLeft:0,scrollTop:0},h=M(1);const c=M(0),d=$(n);if((d||!d&&!s)&&((rt(n)!=="body"||dt(r))&&(a=Pt(n)),$(n))){const u=Z(n);h=et(n),c.x=u.x+n.clientLeft,c.y=u.y+n.clientTop}const f=r&&!d&&!s?ce(r,a,!0):M(0);return{width:i.width*h.x,height:i.height*h.y,x:i.x*h.x-a.scrollLeft*h.x+c.x+f.x,y:i.y*h.y-a.scrollTop*h.y+c.y+f.y}}function ti(e){return Array.from(e.getClientRects())}function ei(e){const t=W(e),i=Pt(e),n=e.ownerDocument.body,o=A(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=A(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-i.scrollLeft+Bt(e);const l=-i.scrollTop;return z(n).direction==="rtl"&&(r+=A(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:r,y:l}}function ii(e,t){const i=D(e),n=W(e),o=i.visualViewport;let s=n.clientWidth,r=n.clientHeight,l=0,a=0;if(o){s=o.width,r=o.height;const h=Ht();(!h||h&&t==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}return{width:s,height:r,x:l,y:a}}function ni(e,t){const i=Z(e,!0,t==="fixed"),n=i.top+e.clientTop,o=i.left+e.clientLeft,s=$(e)?et(e):M(1),r=e.clientWidth*s.x,l=e.clientHeight*s.y,a=o*s.x,h=n*s.y;return{width:r,height:l,x:a,y:h}}function Qt(e,t,i){let n;if(t==="viewport")n=ii(e,i);else if(t==="document")n=ei(W(e));else if(F(t))n=ni(t,i);else{const o=ae(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return wt(n)}function he(e,t){const i=J(e);return i===t||!F(i)||nt(i)?!1:z(i).position==="fixed"||he(i,t)}function oi(e,t){const i=t.get(e);if(i)return i;let n=at(e,[],!1).filter(l=>F(l)&&rt(l)!=="body"),o=null;const s=z(e).position==="fixed";let r=s?J(e):e;for(;F(r)&&!nt(r);){const l=z(r),a=Wt(r);!a&&l.position==="fixed"&&(o=null),(s?!a&&!o:!a&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||dt(r)&&!a&&he(e,r))?n=n.filter(c=>c!==r):o=l,r=J(r)}return t.set(e,n),n}function si(e){let{element:t,boundary:i,rootBoundary:n,strategy:o}=e;const r=[...i==="clippingAncestors"?Ct(t)?[]:oi(t,this._c):[].concat(i),n],l=r[0],a=r.reduce((h,c)=>{const d=Qt(t,c,o);return h.top=A(d.top,h.top),h.right=G(d.right,h.right),h.bottom=G(d.bottom,h.bottom),h.left=A(d.left,h.left),h},Qt(t,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function ri(e){const{width:t,height:i}=le(e);return{width:t,height:i}}function li(e,t,i){const n=$(t),o=W(t),s=i==="fixed",r=Z(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const a=M(0);if(n||!n&&!s)if((rt(t)!=="body"||dt(o))&&(l=Pt(t)),n){const f=Z(t,!0,s,t);a.x=f.x+t.clientLeft,a.y=f.y+t.clientTop}else o&&(a.x=Bt(o));const h=o&&!n&&!s?ce(o,l):M(0),c=r.left+l.scrollLeft-a.x-h.x,d=r.top+l.scrollTop-a.y-h.y;return{x:c,y:d,width:r.width,height:r.height}}function At(e){return z(e).position==="static"}function Zt(e,t){if(!$(e)||z(e).position==="fixed")return null;if(t)return t(e);let i=e.offsetParent;return W(e)===i&&(i=i.ownerDocument.body),i}function de(e,t){const i=D(e);if(Ct(e))return i;if(!$(e)){let o=J(e);for(;o&&!nt(o);){if(F(o)&&!At(o))return o;o=J(o)}return i}let n=Zt(e,t);for(;n&&Ge(n)&&At(n);)n=Zt(n,t);return n&&nt(n)&&At(n)&&!Wt(n)?i:n||Xe(e)||i}const ai=async function(e){const t=this.getOffsetParent||de,i=this.getDimensions,n=await i(e.floating);return{reference:li(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function ci(e){return z(e).direction==="rtl"}const hi={convertOffsetParentRelativeRectToViewportRelativeRect:Ze,getDocumentElement:W,getClippingRect:si,getOffsetParent:de,getElementRects:ai,getClientRects:ti,getDimensions:ri,getScale:et,isElement:F,isRTL:ci};function ue(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function di(e,t){let i=null,n;const o=W(e);function s(){var l;clearTimeout(n),(l=i)==null||l.disconnect(),i=null}function r(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),s();const h=e.getBoundingClientRect(),{left:c,top:d,width:f,height:u}=h;if(l||t(),!f||!u)return;const p=pt(d),m=pt(o.clientWidth-(c+f)),v=pt(o.clientHeight-(d+u)),g=pt(c),w={rootMargin:-p+"px "+-m+"px "+-v+"px "+-g+"px",threshold:A(0,G(1,a))||1};let x=!0;function b(L){const C=L[0].intersectionRatio;if(C!==a){if(!x)return r();C?r(!1,C):n=setTimeout(()=>{r(!1,1e-7)},1e3)}C===1&&!ue(h,e.getBoundingClientRect())&&r(),x=!1}try{i=new IntersectionObserver(b,{...w,root:o.ownerDocument})}catch{i=new IntersectionObserver(b,w)}i.observe(e)}return r(!0),s}function te(e,t,i,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=n,h=It(e),c=o||s?[...h?at(h):[],...at(t)]:[];c.forEach(g=>{o&&g.addEventListener("scroll",i,{passive:!0}),s&&g.addEventListener("resize",i)});const d=h&&l?di(h,i):null;let f=-1,u=null;r&&(u=new ResizeObserver(g=>{let[y]=g;y&&y.target===h&&u&&(u.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=u)==null||w.observe(t)})),i()}),h&&!a&&u.observe(h),u.observe(t));let p,m=a?Z(e):null;a&&v();function v(){const g=Z(e);m&&!ue(m,g)&&i(),m=g,p=requestAnimationFrame(v)}return i(),()=>{var g;c.forEach(y=>{o&&y.removeEventListener("scroll",i),s&&y.removeEventListener("resize",i)}),d==null||d(),(g=u)==null||g.disconnect(),u=null,a&&cancelAnimationFrame(p)}}const ui=je,pi=Ke,ee=Ve,fi=Ye,mi=Be,gi=(e,t,i)=>{const n=new Map,o={platform:hi,...i},s={...o.platform,_c:n};return Ie(e,t,{...o,platform:s})};function ft(e){if(e===void 0)return 0;const t=window.devicePixelRatio||1;return Math.round(e*t)/t}const mt=8,vi=100,yi=e=>({left:["right","bottom","top"],"left-start":["right-start","bottom","top"],"left-end":["right-end","bottom","top"],right:["left","bottom","top"],"right-start":["left-start","bottom","top"],"right-end":["left-end","bottom","top"],top:["bottom","left","right"],"top-start":["bottom-start","left","right"],"top-end":["bottom-end","left","right"],bottom:["top","left","right"],"bottom-start":["top-start","left","right"],"bottom-end":["top-end","left","right"]})[e]??[e],wi=Symbol("placement updated");class pe{constructor(t){this.originalPlacements=new WeakMap,this.allowPlacementUpdate=!1,this.closeForAncestorUpdate=()=>{!this.allowPlacementUpdate&&this.options.type!=="modal"&&this.cleanup&&this.target.dispatchEvent(new Event("close",{bubbles:!0})),this.allowPlacementUpdate=!1},this.updatePlacement=()=>{this.computePlacement()},this.resetOverlayPosition=()=>{!this.target||!this.options||(this.clearOverlayPosition(),this.host.offsetHeight,this.computePlacement())},this.host=t,this.host.addController(this)}placeOverlay(t=this.target,i=this.options){if(this.target=t,this.options=i,!t||!i)return;const n=te(i.trigger,t,this.closeForAncestorUpdate,{ancestorResize:!1,elementResize:!1,layoutShift:!1}),o=te(i.trigger,t,this.updatePlacement,{ancestorScroll:!1});this.cleanup=()=>{var s;(s=this.host.elements)==null||s.forEach(r=>{r.addEventListener("luzmo-closed",()=>{const l=this.originalPlacements.get(r);l&&r.setAttribute("placement",l),this.originalPlacements.delete(r)},{once:!0})}),n(),o()}}async computePlacement(){var f,u;const{options:t,target:i}=this;await(document.fonts?document.fonts.ready:Promise.resolve());const n=t.trigger instanceof HTMLElement?ee():ee({padding:mt,fallbackPlacements:yi(t.placement)}),[o=0,s=0]=Array.isArray(t==null?void 0:t.offset)?t.offset:[t.offset,0],r=(f=this.host.elements.find(p=>p.tipElement))==null?void 0:f.tipElement,l=[ui({mainAxis:o,crossAxis:s}),pi({padding:mt}),n,fi({padding:mt,apply:({availableWidth:p,availableHeight:m,rects:{floating:v}})=>{const g=Math.max(vi,Math.floor(m)),y=v.height;this.initialHeight=this.isConstrained&&this.initialHeight||y,this.isConstrained=y<this.initialHeight||g<=y;const w=this.isConstrained?`${g}px`:"";Object.assign(i.style,{maxWidth:`${Math.floor(p)}px`,maxHeight:w})}}),...r?[mi({element:r,padding:t.tipPadding||mt})]:[]],{x:a,y:h,placement:c,middlewareData:d}=await gi(t.trigger,i,{placement:t.placement,middleware:l,strategy:"fixed"});if(Object.assign(i.style,{top:"0px",left:"0px",translate:`${ft(a)}px ${ft(h)}px`}),i.setAttribute("actual-placement",c),(u=this.host.elements)==null||u.forEach(p=>{this.originalPlacements.has(p)||this.originalPlacements.set(p,p.getAttribute("placement")),p.setAttribute("placement",c)}),r&&d.arrow){const{x:p,y:m}=d.arrow;Object.assign(r.style,{top:c.startsWith("right")||c.startsWith("left")?"0px":"",left:c.startsWith("bottom")||c.startsWith("top")?"0px":"",translate:`${ft(p)}px ${ft(m)}px`})}}clearOverlayPosition(){this.target&&(this.target.style.removeProperty("max-height"),this.target.style.removeProperty("max-width"),this.initialHeight=void 0,this.isConstrained=!1)}hostConnected(){document.addEventListener("luzmo-update-overlays",this.resetOverlayPosition)}hostUpdated(){var t;this.host.open||((t=this.cleanup)==null||t.call(this),this.cleanup=void 0)}hostDisconnected(){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0,document.removeEventListener("luzmo-update-overlays",this.resetOverlayPosition)}}var ut=(e=>(e[e.click=0]="click",e[e.hover=1]="hover",e[e.longpress=2]="longpress",e))(ut||{});class Ot{constructor(t,{overlay:i,isPersistent:n,handleOverlayReady:o}){this.target=t,this.isLazilyOpen=!1,this.isPersistent=!1,this.isPersistent=!!n,this.handleOverlayReady=o,this.isPersistent&&this.init(),this.overlay=i}get activelyOpening(){return!1}get open(){var t;return((t=this.overlay)==null?void 0:t.open)??this.isLazilyOpen}set open(t){if(t!==this.open){if(this.isLazilyOpen=t,this.overlay){this.overlay.open=t;return}t&&(customElements.whenDefined("luzmo-overlay").then(async()=>{const{LuzmoOverlay:i}=await Promise.resolve().then(()=>bt);this.overlay=new i,this.overlay.open=!0}),Promise.resolve().then(()=>bt))}}get overlay(){return this._overlay}set overlay(t){var i;t&&this.overlay!==t&&(this.overlay&&this.overlay.removeController(this),this._overlay=t,this.overlay.addController(this),this.initOverlay(),this.prepareDescription(this.target),(i=this.handleOverlayReady)==null||i.call(this,this.overlay))}prepareDescription(t){}releaseDescription(){}shouldCompleteOpen(){}init(){}initOverlay(){}abort(){var t;this.releaseDescription(),(t=this.abortController)==null||t.abort()}hostConnected(){this.init()}hostDisconnected(){this.isPersistent||this.abort()}}class fe extends Ot{constructor(){super(...arguments),this.type=ut.click,this.preventNextToggle=!1}handleClick(){this.preventNextToggle||(this.open=!this.open),this.preventNextToggle=!1}handlePointerdown(){this.preventNextToggle=this.open}init(){var i;(i=this.abortController)==null||i.abort(),this.abortController=new AbortController;const{signal:t}=this.abortController;this.target.addEventListener("click",()=>this.handleClick(),{signal:t}),this.target.addEventListener("pointerdown",()=>this.handlePointerdown(),{signal:t})}}const bi=300;class me extends Ot{constructor(){super(...arguments),this.type=ut.hover,this.elementIds=[],this.focusedin=!1,this.pointerentered=!1}handleTargetFocusin(){this.target.matches(":focus-visible")&&(this.open=!0,this.focusedin=!0)}handleTargetFocusout(){this.focusedin=!1,!this.pointerentered&&(this.open=!1)}handleTargetPointerenter(){var t;this.hoverTimeout&&(clearTimeout(this.hoverTimeout),this.hoverTimeout=void 0),!((t=this.overlay)!=null&&t.disabled)&&(this.open=!0,this.pointerentered=!0)}handleTargetPointerleave(){this.doPointerleave()}handleHostPointerenter(){this.hoverTimeout&&(clearTimeout(this.hoverTimeout),this.hoverTimeout=void 0)}handleHostPointerleave(){this.doPointerleave()}prepareDescription(){if(this.overlay.elements.length===0)return;const t=this.target.getRootNode(),i=this.overlay.elements[0].getRootNode(),n=this.overlay.getRootNode();t===n?this.prepareOverlayRelativeDescription():t===i&&this.prepareContentRelativeDescription()}prepareOverlayRelativeDescription(){const t=Rt.conditionAttributeWithId(this.target,"aria-describedby",[this.overlay.id]);this.releaseDescription=()=>{t(),this.releaseDescription=Y}}prepareContentRelativeDescription(){const t=[],i=this.overlay.elements.map(o=>(t.push(o.id),o.id||(o.id=`${this.overlay.tagName.toLowerCase()}-helper-${kt.randomID()}`),o.id));this.elementIds=t;const n=Rt.conditionAttributeWithId(this.target,"aria-describedby",i);this.releaseDescription=()=>{n(),this.overlay.elements.map((o,s)=>{o.id=this.elementIds[s]}),this.releaseDescription=Y}}doPointerleave(){this.pointerentered=!1;const t=this.target;this.focusedin&&t.matches(":focus-visible")||(this.hoverTimeout=setTimeout(()=>{this.open=!1},bi))}init(){var i;(i=this.abortController)==null||i.abort(),this.abortController=new AbortController;const{signal:t}=this.abortController;this.target.addEventListener("focusin",()=>this.handleTargetFocusin(),{signal:t}),this.target.addEventListener("focusout",()=>this.handleTargetFocusout(),{signal:t}),this.target.addEventListener("pointerenter",()=>this.handleTargetPointerenter(),{signal:t}),this.target.addEventListener("pointerleave",()=>this.handleTargetPointerleave(),{signal:t}),this.overlay&&this.initOverlay()}initOverlay(){if(!this.abortController)return;const{signal:t}=this.abortController;this.overlay.addEventListener("pointerenter",()=>this.handleHostPointerenter(),{signal:t}),this.overlay.addEventListener("pointerleave",()=>this.handleHostPointerleave(),{signal:t})}}const xi=300,ge={touch:"Double tap and long press for additional options",keyboard:"Press Space or Alt+Down Arrow for additional options",mouse:"Click and hold for additional options"};class ve extends Ot{constructor(){super(...arguments),this.type=ut.longpress,this.longpressState=null,this.releaseDescription=Y,this.handlePointerup=()=>{var t;clearTimeout(this.timeout),this.target&&(this.longpressState=((t=this.overlay)==null?void 0:t.state)==="opening"?"pressed":null,document.removeEventListener("pointerup",this.handlePointerup),document.removeEventListener("pointercancel",this.handlePointerup))}}get activelyOpening(){return this.longpressState==="opening"||this.longpressState==="pressed"}handleLongpress(){this.open=!0,this.longpressState=this.longpressState==="potential"?"opening":"pressed"}handlePointerdown(t){!this.target||t.button!==0||(this.longpressState="potential",document.addEventListener("pointerup",this.handlePointerup),document.addEventListener("pointercancel",this.handlePointerup),"holdAffordance"in this.target)||(this.timeout=setTimeout(()=>{this.target&&this.target.dispatchEvent(new CustomEvent("longpress",{bubbles:!0,composed:!0,detail:{source:"pointer"}}))},xi))}handleKeydown(t){const{code:i,altKey:n}=t;n&&i==="ArrowDown"&&(t.stopPropagation(),t.stopImmediatePropagation())}handleKeyup(t){const{code:i,altKey:n}=t;if(i==="Space"||n&&i==="ArrowDown"){if(!this.target)return;t.stopPropagation(),this.target.dispatchEvent(new CustomEvent("longpress",{bubbles:!0,composed:!0,detail:{source:"keyboard"}})),setTimeout(()=>{this.longpressState=null})}}prepareDescription(t){if(this.releaseDescription!==Y||this.overlay.elements.length===0)return;const i=document.createElement("div");i.id=`longpress-describedby-descriptor-${kt.randomID()}`;const n=Kt.isIOS()||Kt.isAndroid()?"touch":"keyboard";i.textContent=ge[n],i.slot="longpress-describedby-descriptor";const o=t.getRootNode(),s=this.overlay.getRootNode();o===s?this.overlay.append(i):(i.hidden=!("host"in o),t.after(i));const r=Rt.conditionAttributeWithId(t,"aria-describedby",[i.id]);this.releaseDescription=()=>{r(),i.remove(),this.releaseDescription=Y}}shouldCompleteOpen(){this.longpressState=this.longpressState==="pressed"?null:this.longpressState}init(){var i;(i=this.abortController)==null||i.abort(),this.abortController=new AbortController;const{signal:t}=this.abortController;this.target.addEventListener("longpress",()=>this.handleLongpress(),{signal:t}),this.target.addEventListener("pointerdown",n=>this.handlePointerdown(n),{signal:t}),this.prepareDescription(this.target),!this.target.holdAffordance&&(this.target.addEventListener("keydown",n=>this.handleKeydown(n),{signal:t}),this.target.addEventListener("keyup",n=>this.handleKeyup(n),{signal:t}))}}const ye={click:fe,longpress:ve,hover:me};var Ei=Object.defineProperty,Ci=Object.getOwnPropertyDescriptor,T=(e,t,i,n)=>{for(var o=n>1?void 0:n?Ci(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=(n?r(t,i,o):r(o))||o);return n&&o&&Ei(t,i,o),o};const Pi="showPopover"in document.createElement("div");let gt=Re(it);gt=Pi?Se(gt):De(gt);var B;const P=(B=class extends gt{constructor(){super(...arguments),this._delayed=!1,this._disabled=!1,this.offset=0,this._open=!1,this.lastRequestSlottableState=!1,this.receivesFocus="auto",this._state="closed",this.triggerElement=null,this.type="auto",this.wasOpen=!1,this.closeOnFocusOut=t=>{if(!t.relatedTarget)return;const i=new Event("overlay-relation-query",{bubbles:!0,composed:!0});t.relatedTarget.addEventListener(i.type,n=>{n.composedPath().includes(this)||(this.open=!1)}),t.relatedTarget.dispatchEvent(i)}}get delayed(){var t;return((t=this.elements.at(-1))==null?void 0:t.hasAttribute("delayed"))||this._delayed}set delayed(t){this._delayed=t}get disabled(){return this._disabled}set disabled(t){var i;this._disabled=t,t?((i=this.strategy)==null||i.abort(),this.wasOpen=this.open,this.open=!1):(this.bindEvents(),this.open=this.open||this.wasOpen,this.wasOpen=!1)}get hasNonVirtualTrigger(){return!!this.triggerElement&&!(this.triggerElement instanceof ht)}get placementController(){return this._placementController||(this._placementController=new pe(this)),this._placementController}get open(){return this._open}set open(t){var i;t&&this.disabled||t!==this.open&&((i=this.strategy)!=null&&i.activelyOpening&&!t||(this._open=t,this.open&&(B.openCount+=1),this.requestUpdate("open",!this.open),this.open&&this.requestSlottable()))}get state(){return this._state}set state(t){var n;if(t===this.state)return;const i=this.state;this._state=t,(this.state==="opened"||this.state==="closed")&&((n=this.strategy)==null||n.shouldCompleteOpen()),this.requestUpdate("state",i)}get elementResolver(){return this._elementResolver||(this._elementResolver=new Ut.ElementResolutionController(this)),this._elementResolver}get usesDialog(){return this.type==="modal"||this.type==="page"}get popoverValue(){if("popover"in this)switch(this.type){case"modal":case"page":return;case"hint":return"manual";default:return this.type}}get requiresPositioning(){return!(this.type==="page"||!this.open||!this.triggerElement||!this.placement&&this.type!=="hint")}managePosition(){if(!this.requiresPositioning||!this.open)return;const t=this.offset||0,i=this.triggerElement,n=this.placement||"right",o=this.tipPadding;this.placementController.placeOverlay(this.dialogEl,{offset:t,placement:n,tipPadding:o,trigger:i,type:this.type})}async managePopoverOpen(){super.managePopoverOpen();const t=this.open;if(this.open!==t||(await this.manageDelay(t),this.open!==t)||(await this.ensureOnDOM(t),this.open!==t))return;const i=await this.makeTransition(t);this.open===t&&await this.applyFocus(t,i)}async applyFocus(t,i){if(!(this.receivesFocus==="false"||this.type==="hint")){if(await R(),await R(),t===this.open&&!this.open){this.hasNonVirtualTrigger&&this.contains(this.getRootNode().activeElement)&&this.triggerElement.focus();return}i==null||i.focus()}}returnFocus(){var i;if(this.open||this.type==="hint")return;const t=()=>{var s,r;const n=[];let o=document.activeElement;for(;(s=o==null?void 0:o.shadowRoot)!=null&&s.activeElement;)o=o.shadowRoot.activeElement;for(;o;){const l=o.assignedSlot||o.parentElement||((r=o.getRootNode())==null?void 0:r.host);l&&n.push(l),o=l}return n};this.receivesFocus!=="false"&&((i=this.triggerElement)!=null&&i.focus)&&(this.contains(this.getRootNode().activeElement)||t().includes(this)||document.activeElement===document.body)&&this.triggerElement.focus()}async manageOpen(t){if(!(!this.isConnected&&this.open)&&(this.hasUpdated||await this.updateComplete,this.open?(Gt.add(this),this.willPreventClose&&(document.addEventListener("pointerup",()=>{this.dialogEl.classList.toggle("not-immediately-closable",!1),this.willPreventClose=!1},{once:!0}),this.dialogEl.classList.toggle("not-immediately-closable",!0))):(t&&this.dispose(),Gt.remove(this)),this.open&&this.state!=="opened"?this.state="opening":!this.open&&this.state!=="closed"&&(this.state="closing"),this.usesDialog?this.manageDialogOpen():this.managePopoverOpen(),this.type==="auto")){const i=this.getRootNode();this.open?i.addEventListener("focusout",this.closeOnFocusOut,{capture:!0}):i.removeEventListener("focusout",this.closeOnFocusOut,{capture:!0})}}bindEvents(){var t;(t=this.strategy)==null||t.abort(),this.strategy=void 0,this.hasNonVirtualTrigger&&this.triggerInteraction&&(this.strategy=new ye[this.triggerInteraction](this.triggerElement,{overlay:this}))}handleBeforetoggle(t){t.newState!=="open"&&this.handleBrowserClose(t)}handleBrowserClose(t){var i;if(t.stopPropagation(),!((i=this.strategy)!=null&&i.activelyOpening)){this.open=!1;return}this.manuallyKeepOpen()}manuallyKeepOpen(){this.open=!0,this.placementController.allowPlacementUpdate=!0,this.manageOpen(!1)}handleSlotchange(){var t,i;this.elements.length===0?(t=this.strategy)==null||t.releaseDescription():this.hasNonVirtualTrigger&&((i=this.strategy)==null||i.prepareDescription(this.triggerElement))}shouldPreventClose(){const t=this.willPreventClose;return this.willPreventClose=!1,t}requestSlottable(){this.lastRequestSlottableState!==this.open&&(this.open||document.body.offsetHeight,this.dispatchEvent(new jt.SlottableRequestEvent("overlay-content",this.open?{}:jt.removeSlottableRequest)),this.lastRequestSlottableState=this.open)}willUpdate(t){var n;if(this.hasAttribute("id")||this.setAttribute("id",`${this.tagName.toLowerCase()}-${kt.randomID()}`),t.has("open")&&(this.hasUpdated||this.open)&&this.manageOpen(t.get("open")),t.has("trigger")){const[o,s]=((n=this.trigger)==null?void 0:n.split("@"))||[];this.elementResolver.selector=o?`#${o}`:"",this.triggerInteraction=s}let i=!1;t.has(Ut.elementResolverUpdatedSymbol)&&(i=this.triggerElement,this.triggerElement=this.elementResolver.element),t.has("triggerElement")&&(i=t.get("triggerElement")),i!==!1&&this.bindEvents()}updated(t){super.updated(t),t.has("placement")&&(this.placement?this.dialogEl.setAttribute("actual-placement",this.placement):this.dialogEl.removeAttribute("actual-placement"),this.open&&t.get("placement")!==void 0&&this.placementController.resetOverlayPosition()),t.has("state")&&this.state==="closed"&&t.get("state")!==void 0&&this.placementController.clearOverlayPosition()}renderContent(){return E.x` <slot @slotchange=${this.handleSlotchange}></slot> `}get dialogStyleMap(){return{"--luzmo-overlay-open-count":B.openCount.toString()}}renderDialog(){return E.x`
19
+ <dialog
20
+ class="dialog"
21
+ part="dialog"
22
+ placement=${Tt.o(this.requiresPositioning?this.placement||"right":void 0)}
23
+ style=${Vt.o(this.dialogStyleMap)}
24
+ @close=${this.handleBrowserClose}
25
+ @cancel=${this.handleBrowserClose}
26
+ @beforetoggle=${this.handleBeforetoggle}
27
+ ?is-visible=${this.state!=="closed"}
28
+ >
29
+ ${this.renderContent()}
30
+ </dialog>
31
+ `}renderPopover(){return E.x`
32
+ <div
33
+ class="dialog"
34
+ part="dialog"
35
+ placement=${Tt.o(this.requiresPositioning?this.placement||"right":void 0)}
36
+ popover=${Tt.o(this.popoverValue)}
37
+ style=${Vt.o(this.dialogStyleMap)}
38
+ @beforetoggle=${this.handleBeforetoggle}
39
+ @close=${this.handleBrowserClose}
40
+ ?is-visible=${this.state!=="closed"}
41
+ >
42
+ ${this.renderContent()}
43
+ </div>
44
+ `}render(){const t=this.type==="modal"||this.type==="page";return E.x`
45
+ ${t?this.renderDialog():this.renderPopover()}
46
+ <slot name="longpress-describedby-descriptor"></slot>
47
+ `}connectedCallback(){super.connectedCallback(),this.addEventListener("close",()=>{this.open=!1}),this.hasUpdated&&this.bindEvents()}disconnectedCallback(){var t;(t=this.strategy)==null||t.releaseDescription(),this.open=!1,super.disconnectedCallback()}},B.styles=[E.r(ze)],B.openCount=1,B);T([E.n({type:Boolean})],P.prototype,"delayed",1);T([ie.e(".dialog")],P.prototype,"dialogEl",2);T([E.n({type:Boolean})],P.prototype,"disabled",1);T([Ee.o({flatten:!0,selector:':not([slot="longpress-describedby-descriptor"], slot)'})],P.prototype,"elements",2);T([E.n({type:Number})],P.prototype,"offset",2);T([E.n({type:Boolean,reflect:!0})],P.prototype,"open",1);T([E.n()],P.prototype,"placement",2);T([E.n({attribute:"receives-focus"})],P.prototype,"receivesFocus",2);T([ie.e("slot")],P.prototype,"slotEl",2);T([xe.r()],P.prototype,"state",1);T([E.n({type:Number,attribute:"tip-padding"})],P.prototype,"tipPadding",2);T([E.n()],P.prototype,"trigger",2);T([E.n({attribute:!1})],P.prototype,"triggerElement",2);T([E.n({attribute:!1})],P.prototype,"triggerInteraction",2);T([E.n()],P.prototype,"type",2);let we=P;const bt=Object.freeze(Object.defineProperty({__proto__:null,LuzmoOverlay:we},Symbol.toStringTag,{value:"Module"}));exports.ClickController=fe;exports.HoverController=me;exports.InteractionController=Ot;exports.InteractionTypes=ut;exports.LONGPRESS_INSTRUCTIONS=ge;exports.LongpressController=ve;exports.LuzmoAbstractOverlay=it;exports.LuzmoOverlay=we;exports.PlacementController=pe;exports.VirtualTrigger=ht;exports.guaranteedAllTransitionend=xt;exports.nextFrame=R;exports.noop=Y;exports.overlay=bt;exports.overlayTimer=lt;exports.placementUpdatedSymbol=wi;exports.strategies=ye;