@luzmo/lucero 0.0.3 → 0.0.6

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 (323) hide show
  1. package/components/accordion/accordion-item.d.ts +24 -0
  2. package/components/accordion/accordion.d.ts +42 -0
  3. package/components/accordion/index.cjs +43 -0
  4. package/components/accordion/index.d.ts +10 -0
  5. package/components/accordion/index.js +181 -0
  6. package/components/action-bar/action-bar.d.ts +42 -0
  7. package/components/action-bar/index.cjs +39 -0
  8. package/components/action-bar/index.d.ts +7 -0
  9. package/components/action-bar/index.js +107 -0
  10. package/components/action-button/action-button.d.ts +81 -0
  11. package/components/action-button/index.cjs +24 -0
  12. package/components/action-button/index.d.ts +7 -0
  13. package/components/action-button/index.js +161 -0
  14. package/components/action-group/action-group.d.ts +50 -0
  15. package/components/action-group/index.cjs +18 -0
  16. package/components/action-group/index.d.ts +7 -0
  17. package/components/action-group/index.js +29 -0
  18. package/components/action-group-B7oQXv30.js +258 -0
  19. package/components/action-group-C8YUQzt8.cjs +20 -0
  20. package/components/action-menu/action-menu.d.ts +40 -0
  21. package/components/action-menu/index.cjs +56 -0
  22. package/components/action-menu/index.d.ts +7 -0
  23. package/components/action-menu/index.js +126 -0
  24. package/components/async-directive-BhRGSTWB.js +82 -0
  25. package/components/async-directive-_65ULPLK.cjs +22 -0
  26. package/components/avatar/avatar.d.ts +31 -0
  27. package/components/avatar/index.cjs +24 -0
  28. package/components/avatar/index.d.ts +7 -0
  29. package/components/avatar/index.js +81 -0
  30. package/components/base-BjTwmyRF.cjs +22 -0
  31. package/components/base-CxUap9HL.js +665 -0
  32. package/components/base-D76d76ww.js +26 -0
  33. package/components/base-rtxi7uaR.cjs +40 -0
  34. package/components/button/button-base.d.ts +44 -0
  35. package/components/button/button.d.ts +59 -0
  36. package/components/button/clear-button.d.ts +22 -0
  37. package/components/button/close-button.d.ts +24 -0
  38. package/components/button/index.cjs +20 -0
  39. package/components/button/index.d.ts +13 -0
  40. package/components/button/index.js +127 -0
  41. package/components/button-base-CgrTYVgq.js +142 -0
  42. package/components/button-base-DjqSZyn2.cjs +25 -0
  43. package/components/button-group/button-group.d.ts +19 -0
  44. package/components/button-group/index.cjs +18 -0
  45. package/components/button-group/index.d.ts +7 -0
  46. package/components/button-group/index.js +59 -0
  47. package/components/checkbox/checkbox-base.d.ts +9 -0
  48. package/components/checkbox/checkbox-mixin.d.ts +14 -0
  49. package/components/checkbox/checkbox.d.ts +54 -0
  50. package/components/checkbox/index.cjs +25 -0
  51. package/components/checkbox/index.d.ts +7 -0
  52. package/components/checkbox/index.js +96 -0
  53. package/components/checkbox-mixin-BRluTF9s.js +70 -0
  54. package/components/checkbox-mixin-iB-0ivgo.cjs +27 -0
  55. package/components/clear-button-CyLF5dx_.js +53 -0
  56. package/components/clear-button-DFXE6MLx.cjs +18 -0
  57. package/components/close-button-CcD-aVqh.cjs +18 -0
  58. package/components/close-button-CzpdWCWI.js +51 -0
  59. package/components/color-Bg3tYsAQ.js +178 -0
  60. package/components/color-DphK4hwx.cjs +18 -0
  61. package/components/color-area/color-area.d.ts +67 -0
  62. package/components/color-area/index.cjs +80 -0
  63. package/components/color-area/index.d.ts +7 -0
  64. package/components/color-area/index.js +372 -0
  65. package/components/color-field/color-field.d.ts +20 -0
  66. package/components/color-field/index.cjs +23 -0
  67. package/components/color-field/index.d.ts +7 -0
  68. package/components/color-field/index.js +80 -0
  69. package/components/color-handle/color-handle.d.ts +13 -0
  70. package/components/color-handle/index.cjs +24 -0
  71. package/components/color-handle/index.d.ts +7 -0
  72. package/components/color-handle/index.js +73 -0
  73. package/components/color-loupe/color-loupe.d.ts +7 -0
  74. package/components/color-loupe/index.cjs +18 -0
  75. package/components/color-loupe/index.d.ts +7 -0
  76. package/components/color-loupe/index.js +29 -0
  77. package/components/color-loupe-BN3k1ACF.cjs +56 -0
  78. package/components/color-loupe-CD-dhmB1.js +81 -0
  79. package/components/color-menu/color-menu.d.ts +54 -0
  80. package/components/color-menu/index.cjs +86 -0
  81. package/components/color-menu/index.d.ts +7 -0
  82. package/components/color-menu/index.js +203 -0
  83. package/components/color-picker/color-picker.d.ts +39 -0
  84. package/components/color-picker/index.cjs +48 -0
  85. package/components/color-picker/index.d.ts +7 -0
  86. package/components/color-picker/index.js +141 -0
  87. package/components/color-slider/color-slider.d.ts +57 -0
  88. package/components/color-slider/index.cjs +57 -0
  89. package/components/color-slider/index.d.ts +7 -0
  90. package/components/color-slider/index.js +317 -0
  91. package/components/condition-attribute-with-id-DrQYZzFS.cjs +18 -0
  92. package/components/condition-attribute-with-id-Dv4lSRbe.js +31 -0
  93. package/components/dependency-manger-C5HCkMMB.cjs +18 -0
  94. package/components/dependency-manger-CEXvGQUV.js +54 -0
  95. package/components/directive-C7oCP5Bh.cjs +22 -0
  96. package/components/directive-helpers-C3pAxRR3.cjs +22 -0
  97. package/components/directive-helpers-D0vm0gvF.js +28 -0
  98. package/components/directive-oAbCiebi.js +44 -0
  99. package/components/divider/divider.d.ts +24 -0
  100. package/components/divider/index.cjs +18 -0
  101. package/components/divider/index.d.ts +7 -0
  102. package/components/divider/index.js +61 -0
  103. package/components/divider.module-CXMNveQc.cjs +18 -0
  104. package/components/divider.module-DwOuLGU3.js +21 -0
  105. package/components/element-resolution-BvRLGqIU.cjs +18 -0
  106. package/components/element-resolution-FCUT-wql.js +91 -0
  107. package/components/field-group/field-group.d.ts +24 -0
  108. package/components/field-group/index.cjs +18 -0
  109. package/components/field-group/index.d.ts +7 -0
  110. package/components/field-group/index.js +29 -0
  111. package/components/field-group-DAImvhSF.js +66 -0
  112. package/components/field-group-d5Hkb8UW.cjs +23 -0
  113. package/components/field-label/field-label.d.ts +50 -0
  114. package/components/field-label/index.cjs +18 -0
  115. package/components/field-label/index.d.ts +7 -0
  116. package/components/field-label/index.js +29 -0
  117. package/components/field-label-D1zKXSG6.cjs +25 -0
  118. package/components/field-label-DY9iRmRI.js +106 -0
  119. package/components/focus-group-DHeTq18L.js +218 -0
  120. package/components/focus-group-DnxZUBhQ.cjs +18 -0
  121. package/components/focus-visible-B0P9aY_G.cjs +18 -0
  122. package/components/focus-visible-DBlJGoEW.js +74 -0
  123. package/components/focusable-Bze9xE25.js +153 -0
  124. package/components/focusable-DyyBr-J-.cjs +18 -0
  125. package/components/focusable-selectors-B4YgbghQ.js +31 -0
  126. package/components/focusable-selectors-BgFlyFcY.cjs +18 -0
  127. package/components/icon/icon-base.d.ts +11 -0
  128. package/components/icon/icon.d.ts +12 -0
  129. package/components/icon/index.cjs +18 -0
  130. package/components/icon/index.d.ts +7 -0
  131. package/components/icon/index.js +88 -0
  132. package/components/if-defined-C-8FyBSN.cjs +22 -0
  133. package/components/if-defined-XzWkhMhg.js +27 -0
  134. package/components/index-C1chwzNp.js +727 -0
  135. package/components/index-CNtoBntg.cjs +77 -0
  136. package/components/index-Ci6Jnhu4.js +927 -0
  137. package/components/index-DCKCHDTt.cjs +18 -0
  138. package/components/index.cjs +27 -0
  139. package/components/index.js +207 -0
  140. package/components/infield-button/index.cjs +22 -0
  141. package/components/infield-button/index.d.ts +7 -0
  142. package/components/infield-button/index.js +64 -0
  143. package/components/infield-button/infield-button.d.ts +25 -0
  144. package/components/label/index.cjs +18 -0
  145. package/components/label/index.d.ts +7 -0
  146. package/components/label/index.js +51 -0
  147. package/components/label/label.d.ts +7 -0
  148. package/components/legend-position/index.d.ts +7 -0
  149. package/components/legend-position/legend-position.d.ts +10 -0
  150. package/components/like-anchor-DKuw8fJA.cjs +32 -0
  151. package/components/like-anchor-DnsAwo_O.js +69 -0
  152. package/components/manage-help-text-B-FXFXgT.js +92 -0
  153. package/components/manage-help-text-I5aYDAKT.cjs +30 -0
  154. package/components/menu/index.cjs +18 -0
  155. package/components/menu/index.d.ts +16 -0
  156. package/components/menu/index.js +32 -0
  157. package/components/menu/menu-divider.d.ts +14 -0
  158. package/components/menu/menu-group.d.ts +17 -0
  159. package/components/menu/menu-item.d.ts +125 -0
  160. package/components/menu/menu.d.ts +119 -0
  161. package/components/multi-language-field/index.cjs +39 -0
  162. package/components/multi-language-field/index.d.ts +7 -0
  163. package/components/multi-language-field/index.js +148 -0
  164. package/components/multi-language-field/multi-language-field.d.ts +41 -0
  165. package/components/mutation-controller-DH7YOCyj.js +52 -0
  166. package/components/mutation-controller-DkOMCW-c.cjs +22 -0
  167. package/components/number-field/index.cjs +57 -0
  168. package/components/number-field/index.d.ts +7 -0
  169. package/components/number-field/index.js +735 -0
  170. package/components/number-field/number-field.d.ts +113 -0
  171. package/components/observe-slot-text-DeSKIzvP.cjs +18 -0
  172. package/components/observe-slot-text-DrM71me1.js +87 -0
  173. package/components/overlay/abstract-overlay.d.ts +72 -0
  174. package/components/overlay/click-controller.d.ts +14 -0
  175. package/components/overlay/events.d.ts +23 -0
  176. package/components/overlay/full-size-plugin.d.ts +12 -0
  177. package/components/overlay/hover-controller.d.ts +20 -0
  178. package/components/overlay/index.cjs +73 -0
  179. package/components/overlay/index.d.ts +22 -0
  180. package/components/overlay/index.js +342 -0
  181. package/components/overlay/interaction-controller.d.ts +38 -0
  182. package/components/overlay/loader.d.ts +4 -0
  183. package/components/overlay/longpress-controller.d.ts +21 -0
  184. package/components/overlay/overlay-dialog.d.ts +4 -0
  185. package/components/overlay/overlay-events.d.ts +11 -0
  186. package/components/overlay/overlay-no-popover.d.ts +4 -0
  187. package/components/overlay/overlay-popover.d.ts +4 -0
  188. package/components/overlay/overlay-stack.d.ts +44 -0
  189. package/components/overlay/overlay-timer.d.ts +21 -0
  190. package/components/overlay/overlay-trigger-directive.d.ts +26 -0
  191. package/components/overlay/overlay-trigger.d.ts +53 -0
  192. package/components/overlay/overlay-types.d.ts +50 -0
  193. package/components/overlay/overlay.d.ts +464 -0
  194. package/components/overlay/placement-controller.d.ts +157 -0
  195. package/components/overlay/slottable-request-directive.d.ts +17 -0
  196. package/components/overlay/slottable-request-event.d.ts +12 -0
  197. package/components/overlay/strategies.d.ts +8 -0
  198. package/components/overlay/virtual-trigger.d.ts +7 -0
  199. package/components/overlay-C2Cck0Az.js +2712 -0
  200. package/components/overlay-dn6Xe_vz.cjs +47 -0
  201. package/components/pending-state--XOfTjzE.js +61 -0
  202. package/components/pending-state-BeJ7iP-O.cjs +26 -0
  203. package/components/picker/desktop-controller.d.ts +7 -0
  204. package/components/picker/index.cjs +18 -0
  205. package/components/picker/index.d.ts +7 -0
  206. package/components/picker/index.js +32 -0
  207. package/components/picker/interaction-controller.d.ts +43 -0
  208. package/components/picker/mobile-controller.d.ts +9 -0
  209. package/components/picker/picker.d.ts +154 -0
  210. package/components/picker/strategies.d.ts +6 -0
  211. package/components/picker-8cOc-jjh.cjs +127 -0
  212. package/components/picker-BZAWrSDk.js +655 -0
  213. package/components/platform-CQzYNWKq.cjs +18 -0
  214. package/components/platform-DQYMG7JI.js +54 -0
  215. package/components/popover/index.cjs +18 -0
  216. package/components/popover/index.d.ts +7 -0
  217. package/components/popover/index.js +29 -0
  218. package/components/popover/popover.d.ts +29 -0
  219. package/components/popover-CCzs4VH8.cjs +30 -0
  220. package/components/popover-D0EliN0L.js +67 -0
  221. package/components/progress-circle/index.cjs +18 -0
  222. package/components/progress-circle/index.d.ts +7 -0
  223. package/components/progress-circle/index.js +29 -0
  224. package/components/progress-circle/progress-circle.d.ts +35 -0
  225. package/components/progress-circle-DYSSkjlY.cjs +33 -0
  226. package/components/progress-circle-_-9sAlMM.js +97 -0
  227. package/components/query-BL-TJj7K.cjs +22 -0
  228. package/components/query-D_KR_GUc.js +51 -0
  229. package/components/query-assigned-elements-DjfhL1cl.js +36 -0
  230. package/components/query-assigned-elements-DsKsfk7G.cjs +22 -0
  231. package/components/query-assigned-nodes-BcKWmGzy.cjs +22 -0
  232. package/components/query-assigned-nodes-C76XVPWY.js +36 -0
  233. package/components/radio/index.cjs +22 -0
  234. package/components/radio/index.d.ts +10 -0
  235. package/components/radio/index.js +191 -0
  236. package/components/radio/radio-group.d.ts +27 -0
  237. package/components/radio/radio.d.ts +39 -0
  238. package/components/random-id-ByCz1xaq.js +26 -0
  239. package/components/random-id-CqvckpWe.cjs +18 -0
  240. package/components/roving-tabindex-By_fCy_e.cjs +18 -0
  241. package/components/roving-tabindex-DOg4z6ZU.js +66 -0
  242. package/components/search/index.cjs +45 -0
  243. package/components/search/index.d.ts +7 -0
  244. package/components/search/index.js +131 -0
  245. package/components/search/search.d.ts +27 -0
  246. package/components/sized-mixin-BAI6NiE2.cjs +18 -0
  247. package/components/sized-mixin-DcJTTohI.js +63 -0
  248. package/components/slider/index.cjs +18 -0
  249. package/components/slider/index.d.ts +7 -0
  250. package/components/slider/index.js +1158 -0
  251. package/components/slider/slider.d.ts +24 -0
  252. package/components/slottable-request-event-BfUUt1Mh.cjs +18 -0
  253. package/components/slottable-request-event-DggLA4Rx.js +31 -0
  254. package/components/state-D8vot9IB.js +29 -0
  255. package/components/state-WWHLNMRG.cjs +22 -0
  256. package/components/streaming-listener-BbmNyKWO.js +125 -0
  257. package/components/streaming-listener-C2A7ZJZP.cjs +18 -0
  258. package/components/style-map-CoBJRbvu.js +53 -0
  259. package/components/style-map-DH0jkl7s.cjs +22 -0
  260. package/components/swatch/index.cjs +49 -0
  261. package/components/swatch/index.d.ts +10 -0
  262. package/components/swatch/index.js +342 -0
  263. package/components/swatch/swatch-group.d.ts +41 -0
  264. package/components/swatch/swatch.d.ts +40 -0
  265. package/components/switch/index.cjs +22 -0
  266. package/components/switch/index.d.ts +7 -0
  267. package/components/switch/index.js +73 -0
  268. package/components/switch/switch.d.ts +27 -0
  269. package/components/tags/index.cjs +32 -0
  270. package/components/tags/index.d.ts +10 -0
  271. package/components/tags/index.js +173 -0
  272. package/components/tags/tag.d.ts +29 -0
  273. package/components/tags/tags.d.ts +28 -0
  274. package/components/text-field/help-text-manager.d.ts +19 -0
  275. package/components/text-field/help-text.d.ts +20 -0
  276. package/components/text-field/index.cjs +21 -0
  277. package/components/text-field/index.d.ts +14 -0
  278. package/components/text-field/index.js +62 -0
  279. package/components/text-field/manage-help-text.d.ts +13 -0
  280. package/components/text-field/text-field.d.ts +142 -0
  281. package/components/text-field-05QNK_Lj.js +313 -0
  282. package/components/text-field-BU7yxiOR.cjs +85 -0
  283. package/components/toast/index.cjs +51 -0
  284. package/components/toast/index.d.ts +7 -0
  285. package/components/toast/index.js +153 -0
  286. package/components/toast/toast.d.ts +77 -0
  287. package/components/tooltip/index.cjs +45 -0
  288. package/components/tooltip/index.d.ts +8 -0
  289. package/components/tooltip/index.js +220 -0
  290. package/components/tooltip/tooltip-directive.d.ts +5 -0
  291. package/components/tooltip/tooltip.d.ts +55 -0
  292. package/components/unit-input/index.cjs +43 -0
  293. package/components/unit-input/index.d.ts +7 -0
  294. package/components/unit-input/index.js +183 -0
  295. package/components/unit-input/unit-input.d.ts +33 -0
  296. package/components/when-CDK1Tt5Y.js +28 -0
  297. package/components/when-CDZyJPvd.cjs +22 -0
  298. package/index.d.ts +39 -0
  299. package/package.json +139 -101
  300. package/utils/base.d.ts +16 -0
  301. package/utils/condition-attribute-with-id.d.ts +2 -0
  302. package/utils/first-focusable-in.d.ts +3 -0
  303. package/utils/focus-visible.d.ts +29 -0
  304. package/utils/focusable-selectors.d.ts +2 -0
  305. package/utils/focusable.d.ts +58 -0
  306. package/utils/get-css-variable.d.ts +1 -0
  307. package/utils/get-label-from-slot.d.ts +1 -0
  308. package/utils/like-anchor.d.ts +23 -0
  309. package/utils/observe-slot-presence.d.ts +12 -0
  310. package/utils/observe-slot-text.d.ts +11 -0
  311. package/utils/platform.d.ts +10 -0
  312. package/utils/random-id.d.ts +1 -0
  313. package/utils/reactive-controllers/color.d.ts +54 -0
  314. package/utils/reactive-controllers/dependency-manger.d.ts +26 -0
  315. package/utils/reactive-controllers/element-resolution.d.ts +23 -0
  316. package/utils/reactive-controllers/focus-group.d.ts +62 -0
  317. package/utils/reactive-controllers/language-resolution.d.ts +11 -0
  318. package/utils/reactive-controllers/match-media.d.ts +13 -0
  319. package/utils/reactive-controllers/pending-state.d.ts +41 -0
  320. package/utils/reactive-controllers/roving-tabindex.d.ts +19 -0
  321. package/utils/reparent-child.d.ts +4 -0
  322. package/utils/sized-mixin.d.ts +17 -0
  323. package/utils/streaming-listener.d.ts +48 -0
@@ -0,0 +1,2712 @@
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
+ import { L as ue, r as pe, x as ht, n as z } from "./base-CxUap9HL.js";
19
+ import { r as fe } from "./state-D8vot9IB.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-XzWkhMhg.js";
23
+ import { o as Ut } from "./style-map-CoBJRbvu.js";
24
+ import { r as St } from "./random-id-ByCz1xaq.js";
25
+ import { E as ge, e as ve } from "./element-resolution-FCUT-wql.js";
26
+ import { u as lt } from "./focusable-selectors-B4YgbghQ.js";
27
+ import { S as ye, r as we } from "./slottable-request-event-DggLA4Rx.js";
28
+ import { c as At } from "./condition-attribute-with-id-Dv4lSRbe.js";
29
+ import { a as be, i as xe } from "./platform-DQYMG7JI.js";
30
+ function Ee(e, t, i = []) {
31
+ for (const [n, o] of t.entries()) {
32
+ const s = e[n], r = s.parentElement || s.getRootNode();
33
+ i[n] && i[n](o), r && r !== s && s.replaceWith(o), delete e[n];
34
+ }
35
+ return t;
36
+ }
37
+ const Pe = (e, t, {
38
+ position: i,
39
+ prepareCallback: n
40
+ } = { position: "beforeend" }) => {
41
+ let { length: o } = e;
42
+ if (o === 0)
43
+ return () => e;
44
+ let s = 1, r = 0;
45
+ (i === "afterbegin" || i === "afterend") && (s = -1, r = o - 1);
46
+ const a = new Array(o), l = new Array(o), h = document.createComment(
47
+ "placeholder for reparented element"
48
+ );
49
+ do {
50
+ const c = e[r];
51
+ n && (l[r] = n(c)), a[r] = h.cloneNode();
52
+ const d = c.parentElement || c.getRootNode();
53
+ d && d !== c && d.replaceChild(a[r], c), t.insertAdjacentElement(i, c), r += s;
54
+ } while (--o > 0);
55
+ return function() {
56
+ return Ee(a, e, l);
57
+ };
58
+ }, Ce = 1e3, Oe = 1e3;
59
+ class Ae {
60
+ constructor(t = {}) {
61
+ this.warmUpDelay = Ce, this.coolDownDelay = Oe, this.isWarm = !1, this.timeout = 0, Object.assign(this, t);
62
+ }
63
+ openTimer(t) {
64
+ if (this.cancelCooldownTimer(), !this.component || t !== this.component)
65
+ return this.component && (this.close(this.component), this.cancelCooldownTimer()), this.component = t, this.isWarm ? Promise.resolve(!1) : (this.promise = new Promise((i) => {
66
+ this.resolve = i, this.timeout = window.setTimeout(() => {
67
+ this.resolve && (this.resolve(!1), this.isWarm = !0);
68
+ }, this.warmUpDelay);
69
+ }), this.promise);
70
+ if (this.promise)
71
+ return this.promise;
72
+ throw new Error("Inconsistent state");
73
+ }
74
+ close(t) {
75
+ 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);
76
+ }
77
+ resetCooldownTimer() {
78
+ this.isWarm && (this.cooldownTimeout && window.clearTimeout(this.cooldownTimeout), this.cooldownTimeout = window.setTimeout(() => {
79
+ this.isWarm = !1, delete this.cooldownTimeout;
80
+ }, this.coolDownDelay));
81
+ }
82
+ cancelCooldownTimer() {
83
+ this.cooldownTimeout && window.clearTimeout(this.cooldownTimeout), delete this.cooldownTimeout;
84
+ }
85
+ }
86
+ const mt = new Ae(), J = () => {
87
+ }, kt = (e, t, i) => {
88
+ const n = new AbortController(), o = /* @__PURE__ */ new Map(), s = () => {
89
+ n.abort(), i();
90
+ };
91
+ let r, a;
92
+ const l = requestAnimationFrame(() => {
93
+ r = requestAnimationFrame(() => {
94
+ a = requestAnimationFrame(() => {
95
+ s();
96
+ });
97
+ });
98
+ }), h = (d) => {
99
+ d.target === e && (o.set(
100
+ d.propertyName,
101
+ o.get(d.propertyName) - 1
102
+ ), o.get(d.propertyName) || o.delete(d.propertyName), o.size === 0 && s());
103
+ }, c = (d) => {
104
+ d.target === e && (o.has(d.propertyName) || o.set(d.propertyName, 0), o.set(
105
+ d.propertyName,
106
+ o.get(d.propertyName) + 1
107
+ ), cancelAnimationFrame(l), cancelAnimationFrame(r), cancelAnimationFrame(a));
108
+ };
109
+ e.addEventListener("transitionrun", c, {
110
+ signal: n.signal
111
+ }), e.addEventListener("transitionend", h, {
112
+ signal: n.signal
113
+ }), e.addEventListener("transitioncancel", h, {
114
+ signal: n.signal
115
+ }), t();
116
+ };
117
+ function R() {
118
+ return new Promise((e) => requestAnimationFrame(() => e()));
119
+ }
120
+ class rt extends ue {
121
+ constructor() {
122
+ super(...arguments), this.dispose = J, this.offset = 0, this.willPreventClose = !1;
123
+ }
124
+ applyFocus(t, i) {
125
+ }
126
+ /* c8 ignore next 6 */
127
+ get delayed() {
128
+ return !1;
129
+ }
130
+ set delayed(t) {
131
+ }
132
+ /* c8 ignore next 6 */
133
+ get disabled() {
134
+ return !1;
135
+ }
136
+ set disabled(t) {
137
+ }
138
+ get elementResolver() {
139
+ return this._elementResolver;
140
+ }
141
+ set elementResolver(t) {
142
+ this._elementResolver = t;
143
+ }
144
+ /* c8 ignore next 3 */
145
+ ensureOnDOM(t) {
146
+ }
147
+ /* c8 ignore next 5 */
148
+ makeTransition(t) {
149
+ return null;
150
+ }
151
+ manageDelay(t) {
152
+ }
153
+ /* c8 ignore next 3 */
154
+ manageDialogOpen() {
155
+ }
156
+ /* c8 ignore next 3 */
157
+ managePopoverOpen() {
158
+ }
159
+ /* c8 ignore next 3 */
160
+ managePosition() {
161
+ }
162
+ /* c8 ignore next 6 */
163
+ get open() {
164
+ return !1;
165
+ }
166
+ set open(t) {
167
+ }
168
+ get placementController() {
169
+ return this._placementController;
170
+ }
171
+ set placementController(t) {
172
+ this._placementController = t;
173
+ }
174
+ requestSlottable() {
175
+ }
176
+ returnFocus() {
177
+ }
178
+ /* c8 ignore next 6 */
179
+ get state() {
180
+ return "closed";
181
+ }
182
+ set state(t) {
183
+ }
184
+ /* c8 ignore next 3 */
185
+ manuallyKeepOpen() {
186
+ }
187
+ static update() {
188
+ const t = new CustomEvent("luzmo-update-overlays", {
189
+ bubbles: !0,
190
+ composed: !0,
191
+ cancelable: !0
192
+ });
193
+ document.dispatchEvent(t);
194
+ }
195
+ static async open(t, i, n, o) {
196
+ await Promise.resolve().then(() => Lt);
197
+ const s = arguments.length === 2, r = n || t, a = new this();
198
+ let l = !1;
199
+ const h = Pe([r], a, {
200
+ position: "beforeend",
201
+ prepareCallback: (f) => {
202
+ const u = f.slot;
203
+ return f.removeAttribute("slot"), () => {
204
+ f.slot = u;
205
+ };
206
+ }
207
+ });
208
+ if (a.dispose = () => {
209
+ a.addEventListener("luzmo-closed", () => {
210
+ l || (h(), l = !0), requestAnimationFrame(() => {
211
+ a.remove();
212
+ });
213
+ }), a.open = !1, a.dispose = J;
214
+ }, !s && r && o) {
215
+ const f = t, u = i, p = o;
216
+ return rt.applyOptions(a, {
217
+ ...p,
218
+ delayed: p.delayed || r.hasAttribute("delayed"),
219
+ trigger: p.virtualTrigger || f,
220
+ type: u === "modal" ? "modal" : u === "hover" ? "hint" : "auto"
221
+ }), f.after(a), await a.updateComplete, a.open = !0, a.dispose;
222
+ }
223
+ const d = i;
224
+ return a.append(r), rt.applyOptions(a, {
225
+ ...d,
226
+ delayed: d.delayed || r.hasAttribute("delayed")
227
+ }), a.updateComplete.then(() => {
228
+ a.open = !0;
229
+ }), a;
230
+ }
231
+ static applyOptions(t, i) {
232
+ 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;
233
+ }
234
+ }
235
+ const Ft = (e) => e.querySelector(
236
+ lt
237
+ ), zt = (e) => e.assignedElements().find((i) => i.matches(lt));
238
+ class Nt extends Event {
239
+ constructor() {
240
+ super("beforetoggle", {
241
+ bubbles: !1,
242
+ composed: !1
243
+ }), this.currentState = "open", this.newState = "closed";
244
+ }
245
+ }
246
+ class _t extends Event {
247
+ constructor() {
248
+ super("beforetoggle", {
249
+ bubbles: !1,
250
+ composed: !1
251
+ }), this.currentState = "closed", this.newState = "open";
252
+ }
253
+ }
254
+ class S extends Event {
255
+ constructor(t, i, {
256
+ publish: n,
257
+ interaction: o,
258
+ reason: s
259
+ }) {
260
+ super(t, {
261
+ bubbles: n,
262
+ composed: n
263
+ }), this.overlay = i, this.detail = {
264
+ interaction: o,
265
+ reason: s
266
+ };
267
+ }
268
+ }
269
+ class wt {
270
+ constructor(t, i) {
271
+ this.x = 0, this.y = 0, this.x = t, this.y = i;
272
+ }
273
+ updateBoundingClientRect(t, i) {
274
+ this.x = t, this.y = i, rt.update();
275
+ }
276
+ getBoundingClientRect() {
277
+ return {
278
+ width: 0,
279
+ height: 0,
280
+ top: this.y,
281
+ right: this.x,
282
+ y: this.y,
283
+ x: this.x,
284
+ bottom: this.y,
285
+ left: this.x,
286
+ /* c8 ignore next 3 */
287
+ toJSON() {
288
+ }
289
+ };
290
+ }
291
+ }
292
+ function Te(e) {
293
+ class t extends e {
294
+ async manageDialogOpen() {
295
+ const n = this.open;
296
+ if (await R(), await this.managePosition(), this.open !== n)
297
+ return;
298
+ const o = await this.dialogMakeTransition(n);
299
+ this.open === n && await this.dialogApplyFocus(n, o);
300
+ }
301
+ dialogMakeTransition(n) {
302
+ let o = null;
303
+ const s = (a, l) => () => {
304
+ if (a.open = n, !n) {
305
+ const c = () => {
306
+ a.removeEventListener("close", c);
307
+ };
308
+ a.addEventListener("close", c);
309
+ }
310
+ if (l > 0)
311
+ return;
312
+ const h = n ? _t : Nt;
313
+ this.dispatchEvent(new h()), n && (a.matches(lt) && (o = a), o = o || Ft(a), o || a.querySelectorAll("slot").forEach((d) => {
314
+ o || (o = zt(d));
315
+ }), !(!this.isConnected || this.dialogEl.open) && this.dialogEl.showModal());
316
+ }, r = (a, l) => () => {
317
+ if (this.open !== n)
318
+ return;
319
+ const h = n ? "luzmo-opened" : "luzmo-closed";
320
+ if (l > 0) {
321
+ a.dispatchEvent(
322
+ new S(h, this, {
323
+ interaction: this.type,
324
+ publish: !1
325
+ })
326
+ );
327
+ return;
328
+ }
329
+ if (!this.isConnected || n !== this.open)
330
+ return;
331
+ const c = async () => {
332
+ const d = this.triggerElement instanceof wt;
333
+ this.dispatchEvent(
334
+ new S(h, this, {
335
+ interaction: this.type,
336
+ publish: d
337
+ })
338
+ ), a.dispatchEvent(
339
+ new S(h, this, {
340
+ interaction: this.type,
341
+ publish: !1
342
+ })
343
+ ), this.triggerElement && !d && this.triggerElement.dispatchEvent(
344
+ new S(h, this, {
345
+ interaction: this.type,
346
+ publish: !0
347
+ })
348
+ ), this.state = n ? "opened" : "closed", this.returnFocus(), await R(), await R(), n === this.open && n === !1 && this.requestSlottable();
349
+ };
350
+ !n && this.dialogEl.open ? (this.dialogEl.addEventListener(
351
+ "close",
352
+ () => {
353
+ c();
354
+ },
355
+ { once: !0 }
356
+ ), this.dialogEl.close()) : c();
357
+ };
358
+ return this.elements.forEach((a, l) => {
359
+ kt(a, s(a, l), r(a, l));
360
+ }), o;
361
+ }
362
+ dialogApplyFocus(n, o) {
363
+ this.applyFocus(n, o);
364
+ }
365
+ }
366
+ return t;
367
+ }
368
+ function Re(e) {
369
+ class t extends e {
370
+ async managePopoverOpen() {
371
+ await this.managePosition();
372
+ }
373
+ async manageDelay(n) {
374
+ if (n === !1 || n !== this.open) {
375
+ mt.close(this);
376
+ return;
377
+ }
378
+ this.delayed && await mt.openTimer(this) && (this.open = !n);
379
+ }
380
+ ensureOnDOM(n) {
381
+ document.body.offsetHeight;
382
+ }
383
+ makeTransition(n) {
384
+ if (this.open !== n)
385
+ return null;
386
+ let o = null;
387
+ const s = (a, l) => () => {
388
+ if (n !== this.open)
389
+ return;
390
+ if (a.open = n, l === 0) {
391
+ const c = n ? _t : Nt;
392
+ this.dispatchEvent(new c());
393
+ }
394
+ if (n !== !0 || (a.matches(lt) && (o = a), o = o || Ft(a), o))
395
+ return;
396
+ a.querySelectorAll("slot").forEach((c) => {
397
+ o || (o = zt(c));
398
+ });
399
+ }, r = (a, l) => async () => {
400
+ if (this.open !== n)
401
+ return;
402
+ const h = n ? "luzmo-opened" : "luzmo-closed";
403
+ if (a.dispatchEvent(
404
+ new S(h, this, {
405
+ interaction: this.type
406
+ })
407
+ ), l > 0)
408
+ return;
409
+ const c = this.triggerElement instanceof wt;
410
+ this.dispatchEvent(
411
+ new S(h, this, {
412
+ interaction: this.type,
413
+ publish: c
414
+ })
415
+ ), this.triggerElement && !c && this.triggerElement.dispatchEvent(
416
+ new S(h, this, {
417
+ interaction: this.type,
418
+ publish: !0
419
+ })
420
+ ), this.state = n ? "opened" : "closed", this.returnFocus(), await R(), await R(), n === this.open && n === !1 && this.requestSlottable();
421
+ };
422
+ return this.elements.forEach((a, l) => {
423
+ kt(a, s(a, l), r(a, l));
424
+ }), o;
425
+ }
426
+ }
427
+ return t;
428
+ }
429
+ const De = CSS.supports("(overlay: auto)");
430
+ function jt(e) {
431
+ let t = !1;
432
+ try {
433
+ t = e.matches(":popover-open");
434
+ } catch {
435
+ }
436
+ let i = !1;
437
+ try {
438
+ i = e.matches(":open");
439
+ } catch {
440
+ }
441
+ return t || i;
442
+ }
443
+ function Le(e) {
444
+ class t extends e {
445
+ async manageDelay(n) {
446
+ if (n === !1 || n !== this.open) {
447
+ mt.close(this);
448
+ return;
449
+ }
450
+ this.delayed && await mt.openTimer(this) && (this.open = !n);
451
+ }
452
+ /**
453
+ * A popover should be hidden _after_ it is no longer on top-layer because
454
+ * the position metrics will have changed from when it was originally positioned.
455
+ */
456
+ shouldHidePopover(n) {
457
+ if (n && this.open !== n)
458
+ return;
459
+ const o = async ({
460
+ newState: s
461
+ } = {}) => {
462
+ s !== "open" && await this.placementController.resetOverlayPosition();
463
+ };
464
+ if (!jt(this.dialogEl)) {
465
+ o();
466
+ return;
467
+ }
468
+ this.dialogEl.addEventListener("toggle", o, {
469
+ once: !0
470
+ });
471
+ }
472
+ shouldShowPopover(n) {
473
+ let o = !1;
474
+ try {
475
+ o = this.dialogEl.matches(":popover-open");
476
+ } catch {
477
+ }
478
+ let s = !1;
479
+ try {
480
+ s = this.dialogEl.matches(":open");
481
+ } catch {
482
+ }
483
+ n && this.open === n && !o && !s && this.isConnected && (this.dialogEl.showPopover(), this.managePosition());
484
+ }
485
+ async ensureOnDOM(n) {
486
+ await R(), De || await this.shouldHidePopover(n), this.shouldShowPopover(n), await R();
487
+ }
488
+ makeTransition(n) {
489
+ if (this.open !== n)
490
+ return null;
491
+ let o = null;
492
+ const s = (a, l) => () => {
493
+ if (a.open = n, l === 0) {
494
+ const c = n ? _t : Nt;
495
+ this.dispatchEvent(new c());
496
+ }
497
+ if (!n || (a.matches(lt) && (o = a), o = o || Ft(a), o))
498
+ return;
499
+ a.querySelectorAll("slot").forEach((c) => {
500
+ o || (o = zt(c));
501
+ });
502
+ }, r = (a, l) => () => {
503
+ if (this.open !== n)
504
+ return;
505
+ const h = n ? "luzmo-opened" : "luzmo-closed";
506
+ if (l > 0) {
507
+ a.dispatchEvent(
508
+ new S(h, this, {
509
+ interaction: this.type,
510
+ publish: !1
511
+ })
512
+ );
513
+ return;
514
+ }
515
+ const c = async () => {
516
+ if (this.open !== n)
517
+ return;
518
+ await R();
519
+ const f = this.triggerElement instanceof wt;
520
+ this.dispatchEvent(
521
+ new S(h, this, {
522
+ interaction: this.type,
523
+ publish: f
524
+ })
525
+ ), a.dispatchEvent(
526
+ new S(h, this, {
527
+ interaction: this.type,
528
+ publish: !1
529
+ })
530
+ ), this.triggerElement && !f && this.triggerElement.dispatchEvent(
531
+ new S(h, this, {
532
+ interaction: this.type,
533
+ publish: !0
534
+ })
535
+ ), this.state = n ? "opened" : "closed", this.returnFocus(), await R(), await R(), n === this.open && n === !1 && this.requestSlottable();
536
+ };
537
+ if (this.open !== n)
538
+ return;
539
+ const d = jt(this.dialogEl);
540
+ n !== !0 && d && this.isConnected ? (this.dialogEl.addEventListener(
541
+ "beforetoggle",
542
+ () => {
543
+ c();
544
+ },
545
+ { once: !0 }
546
+ ), this.dialogEl.hidePopover()) : c();
547
+ };
548
+ return this.elements.forEach((a, l) => {
549
+ kt(a, s(a, l), r(a, l));
550
+ }), o;
551
+ }
552
+ }
553
+ return t;
554
+ }
555
+ const Se = "showPopover" in document.createElement("div");
556
+ class ke {
557
+ constructor() {
558
+ this.root = document.body, this.stack = [], this.handlePointerdown = (t) => {
559
+ this.pointerdownPath = t.composedPath(), this.lastOverlay = this.stack.at(-1);
560
+ }, this.handlePointerup = () => {
561
+ const t = this.pointerdownPath;
562
+ if (this.pointerdownPath = void 0, this.stack.length === 0 || !(t != null && t.length))
563
+ return;
564
+ const i = this.lastOverlay;
565
+ this.lastOverlay = void 0;
566
+ const n = this.stack.length - 1, o = this.stack.filter((s, r) => !t.find(
567
+ (l) => (
568
+ // The Overlay is in the stack
569
+ l === s || // The Overlay trigger is in the stack and the Overlay is a "hint"
570
+ l === (s == null ? void 0 : s.triggerElement) && (s == null ? void 0 : s.type) === "hint" || // The last Overlay in the stack is not the last Overlay at `pointerdown` time and has a
571
+ // `triggerInteraction` of "longpress", meaning it was opened by this poitner interaction
572
+ r === n && s !== i && s.triggerInteraction === "longpress"
573
+ )
574
+ ) && !s.shouldPreventClose() && s.type !== "manual" && // Don't close if this overlay is modal and not on top of the overlay stack.
575
+ !(s.type === "modal" && i !== s));
576
+ o.reverse(), o.forEach((s) => {
577
+ this.closeOverlay(s);
578
+ let r = s.parentOverlayToForceClose;
579
+ for (; r; )
580
+ this.closeOverlay(r), r = r.parentOverlayToForceClose;
581
+ });
582
+ }, this.handleBeforetoggle = (t) => {
583
+ const { target: i, newState: n } = t;
584
+ n !== "open" && this.closeOverlay(i);
585
+ }, this.handleKeydown = (t) => {
586
+ if (t.code !== "Escape" || this.stack.length === 0)
587
+ return;
588
+ const i = this.stack.at(-1);
589
+ if ((i == null ? void 0 : i.type) === "page") {
590
+ t.preventDefault();
591
+ return;
592
+ }
593
+ Se || (i == null ? void 0 : i.type) !== "manual" && i && this.closeOverlay(i);
594
+ }, this.bindEvents();
595
+ }
596
+ get document() {
597
+ return this.root.ownerDocument || document;
598
+ }
599
+ bindEvents() {
600
+ this.document.addEventListener("pointerdown", this.handlePointerdown), this.document.addEventListener("pointerup", this.handlePointerup), this.document.addEventListener("keydown", this.handleKeydown);
601
+ }
602
+ closeOverlay(t) {
603
+ const i = this.stack.indexOf(t);
604
+ i !== -1 && this.stack.splice(i, 1), t.open = !1;
605
+ }
606
+ /**
607
+ * Get an array of Overlays that all share the same trigger element.
608
+ *
609
+ * @param triggerElement {HTMLELement}
610
+ * @returns
611
+ */
612
+ overlaysByTriggerElement(t) {
613
+ return this.stack.filter(
614
+ (i) => i.triggerElement === t
615
+ );
616
+ }
617
+ /**
618
+ * When overlays are added manage the open state of exisiting overlays appropriately:
619
+ * - 'modal': should close other non-'modal' and non-'manual' overlays
620
+ * - 'page': should close other non-'modal' and non-'manual' overlays
621
+ * - 'auto': should close other 'auto' overlays and other 'hint' overlays, but not 'manual' overlays
622
+ * - 'manual': shouldn't close other overlays
623
+ * - 'hint': shouldn't close other overlays and give way to all other overlays on a trigger
624
+ */
625
+ add(t) {
626
+ if (this.stack.includes(t)) {
627
+ const i = this.stack.indexOf(t);
628
+ i !== -1 && (this.stack.splice(i, 1), this.stack.push(t));
629
+ return;
630
+ }
631
+ if (t.type === "auto" || t.type === "modal" || t.type === "page") {
632
+ const i = "luzmo-overlay-query-path", n = new Event(i, {
633
+ composed: !0,
634
+ bubbles: !0
635
+ });
636
+ t.addEventListener(
637
+ i,
638
+ (o) => {
639
+ const s = o.composedPath();
640
+ this.stack.forEach((r) => {
641
+ !s.find((l) => l === r) && r.type !== "manual" && r.type !== "modal" && this.closeOverlay(r);
642
+ });
643
+ },
644
+ { once: !0 }
645
+ ), t.dispatchEvent(n);
646
+ } else if (t.type === "hint") {
647
+ if (this.stack.some(
648
+ (n) => n.type !== "manual" && n.triggerElement && n.triggerElement === t.triggerElement
649
+ )) {
650
+ t.open = !1;
651
+ return;
652
+ }
653
+ this.stack.forEach((n) => {
654
+ n.type === "hint" && this.closeOverlay(n);
655
+ });
656
+ }
657
+ requestAnimationFrame(() => {
658
+ this.stack.push(t), t.addEventListener("beforetoggle", this.handleBeforetoggle, {
659
+ once: !0
660
+ });
661
+ });
662
+ }
663
+ remove(t) {
664
+ this.closeOverlay(t);
665
+ }
666
+ }
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, A = Math.max, gt = Math.round, dt = Math.floor, M = (e) => ({
668
+ x: e,
669
+ y: e
670
+ }), ze = {
671
+ left: "right",
672
+ right: "left",
673
+ bottom: "top",
674
+ top: "bottom"
675
+ }, Ne = {
676
+ start: "end",
677
+ end: "start"
678
+ };
679
+ function Tt(e, t, i) {
680
+ return A(e, Y(t, i));
681
+ }
682
+ function nt(e, t) {
683
+ return typeof e == "function" ? e(t) : e;
684
+ }
685
+ function X(e) {
686
+ return e.split("-")[0];
687
+ }
688
+ function ot(e) {
689
+ return e.split("-")[1];
690
+ }
691
+ function ee(e) {
692
+ return e === "x" ? "y" : "x";
693
+ }
694
+ function $t(e) {
695
+ return e === "y" ? "height" : "width";
696
+ }
697
+ function Q(e) {
698
+ return ["top", "bottom"].includes(X(e)) ? "y" : "x";
699
+ }
700
+ function Mt(e) {
701
+ return ee(Q(e));
702
+ }
703
+ function _e(e, t, i) {
704
+ i === void 0 && (i = !1);
705
+ const n = ot(e), o = Mt(e), s = $t(o);
706
+ let r = o === "x" ? n === (i ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
707
+ return t.reference[s] > t.floating[s] && (r = vt(r)), [r, vt(r)];
708
+ }
709
+ function $e(e) {
710
+ const t = vt(e);
711
+ return [Rt(e), t, Rt(t)];
712
+ }
713
+ function Rt(e) {
714
+ return e.replace(/start|end/g, (t) => Ne[t]);
715
+ }
716
+ function Me(e, t, i) {
717
+ const n = ["left", "right"], o = ["right", "left"], s = ["top", "bottom"], r = ["bottom", "top"];
718
+ switch (e) {
719
+ case "top":
720
+ case "bottom":
721
+ return i ? t ? o : n : t ? n : o;
722
+ case "left":
723
+ case "right":
724
+ return t ? s : r;
725
+ default:
726
+ return [];
727
+ }
728
+ }
729
+ function He(e, t, i, n) {
730
+ const o = ot(e);
731
+ let s = Me(X(e), i === "start", n);
732
+ return o && (s = s.map((r) => r + "-" + o), t && (s = s.concat(s.map(Rt)))), s;
733
+ }
734
+ function vt(e) {
735
+ return e.replace(/left|right|bottom|top/g, (t) => ze[t]);
736
+ }
737
+ function Be(e) {
738
+ return {
739
+ top: 0,
740
+ right: 0,
741
+ bottom: 0,
742
+ left: 0,
743
+ ...e
744
+ };
745
+ }
746
+ function ie(e) {
747
+ return typeof e != "number" ? Be(e) : {
748
+ top: e,
749
+ right: e,
750
+ bottom: e,
751
+ left: e
752
+ };
753
+ }
754
+ function yt(e) {
755
+ const {
756
+ x: t,
757
+ y: i,
758
+ width: n,
759
+ height: o
760
+ } = e;
761
+ return {
762
+ width: n,
763
+ height: o,
764
+ top: i,
765
+ left: t,
766
+ right: t + n,
767
+ bottom: i + o,
768
+ x: t,
769
+ y: i
770
+ };
771
+ }
772
+ function Yt(e, t, i) {
773
+ let {
774
+ reference: n,
775
+ floating: o
776
+ } = e;
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;
778
+ let u;
779
+ switch (l) {
780
+ case "top":
781
+ u = {
782
+ x: c,
783
+ y: n.y - o.height
784
+ };
785
+ break;
786
+ case "bottom":
787
+ u = {
788
+ x: c,
789
+ y: n.y + n.height
790
+ };
791
+ break;
792
+ case "right":
793
+ u = {
794
+ x: n.x + n.width,
795
+ y: d
796
+ };
797
+ break;
798
+ case "left":
799
+ u = {
800
+ x: n.x - o.width,
801
+ y: d
802
+ };
803
+ break;
804
+ default:
805
+ u = {
806
+ x: n.x,
807
+ y: n.y
808
+ };
809
+ }
810
+ switch (ot(t)) {
811
+ case "start":
812
+ u[r] -= f * (i && h ? -1 : 1);
813
+ break;
814
+ case "end":
815
+ u[r] += f * (i && h ? -1 : 1);
816
+ break;
817
+ }
818
+ return u;
819
+ }
820
+ const We = async (e, t, i) => {
821
+ const {
822
+ placement: n = "bottom",
823
+ strategy: o = "absolute",
824
+ middleware: s = [],
825
+ platform: r
826
+ } = i, a = s.filter(Boolean), l = await (r.isRTL == null ? void 0 : r.isRTL(t));
827
+ let h = await r.getElementRects({
828
+ reference: e,
829
+ floating: t,
830
+ strategy: o
831
+ }), {
832
+ x: c,
833
+ y: d
834
+ } = Yt(h, n, l), f = n, u = {}, p = 0;
835
+ for (let m = 0; m < a.length; m++) {
836
+ const {
837
+ name: v,
838
+ fn: g
839
+ } = a[m], {
840
+ x: y,
841
+ y: w,
842
+ data: x,
843
+ reset: b
844
+ } = await g({
845
+ x: c,
846
+ y: d,
847
+ initialPlacement: n,
848
+ placement: f,
849
+ strategy: o,
850
+ middlewareData: u,
851
+ rects: h,
852
+ platform: r,
853
+ elements: {
854
+ reference: e,
855
+ floating: t
856
+ }
857
+ });
858
+ c = y ?? c, d = w ?? d, u = {
859
+ ...u,
860
+ [v]: {
861
+ ...u[v],
862
+ ...x
863
+ }
864
+ }, b && p <= 50 && (p++, typeof b == "object" && (b.placement && (f = b.placement), b.rects && (h = b.rects === !0 ? await r.getElementRects({
865
+ reference: e,
866
+ floating: t,
867
+ strategy: o
868
+ }) : b.rects), {
869
+ x: c,
870
+ y: d
871
+ } = Yt(h, f, l)), m = -1);
872
+ }
873
+ return {
874
+ x: c,
875
+ y: d,
876
+ placement: f,
877
+ strategy: o,
878
+ middlewareData: u
879
+ };
880
+ };
881
+ async function Ht(e, t) {
882
+ var i;
883
+ t === void 0 && (t = {});
884
+ const {
885
+ x: n,
886
+ y: o,
887
+ platform: s,
888
+ rects: r,
889
+ elements: a,
890
+ strategy: l
891
+ } = e, {
892
+ boundary: h = "clippingAncestors",
893
+ rootBoundary: c = "viewport",
894
+ elementContext: d = "floating",
895
+ altBoundary: f = !1,
896
+ padding: u = 0
897
+ } = nt(t, e), p = ie(u), v = a[f ? d === "floating" ? "reference" : "floating" : d], g = yt(await s.getClippingRect({
898
+ element: (i = await (s.isElement == null ? void 0 : s.isElement(v))) == null || i ? v : v.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(a.floating)),
899
+ boundary: h,
900
+ rootBoundary: c,
901
+ strategy: l
902
+ })), y = d === "floating" ? {
903
+ x: n,
904
+ y: o,
905
+ width: r.floating.width,
906
+ height: r.floating.height
907
+ } : r.reference, w = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(a.floating)), x = await (s.isElement == null ? void 0 : s.isElement(w)) ? await (s.getScale == null ? void 0 : s.getScale(w)) || {
908
+ x: 1,
909
+ y: 1
910
+ } : {
911
+ x: 1,
912
+ y: 1
913
+ }, b = yt(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
914
+ elements: a,
915
+ rect: y,
916
+ offsetParent: w,
917
+ strategy: l
918
+ }) : y);
919
+ return {
920
+ top: (g.top - b.top + p.top) / x.y,
921
+ bottom: (b.bottom - g.bottom + p.bottom) / x.y,
922
+ left: (g.left - b.left + p.left) / x.x,
923
+ right: (b.right - g.right + p.right) / x.x
924
+ };
925
+ }
926
+ const qe = (e) => ({
927
+ name: "arrow",
928
+ options: e,
929
+ async fn(t) {
930
+ const {
931
+ x: i,
932
+ y: n,
933
+ placement: o,
934
+ rects: s,
935
+ platform: r,
936
+ elements: a,
937
+ middlewareData: l
938
+ } = t, {
939
+ element: h,
940
+ padding: c = 0
941
+ } = nt(e, t) || {};
942
+ if (h == null)
943
+ return {};
944
+ const d = ie(c), f = {
945
+ x: i,
946
+ y: n
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));
948
+ let E = D ? D[w] : 0;
949
+ (!E || !await (r.isElement == null ? void 0 : r.isElement(D))) && (E = a.floating[w] || s.floating[p]);
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 = Tt(_, 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;
951
+ return {
952
+ [u]: f[u] + $,
953
+ data: {
954
+ [u]: tt,
955
+ centerOffset: C - tt - $,
956
+ ...q && {
957
+ alignmentOffset: $
958
+ }
959
+ },
960
+ reset: q
961
+ };
962
+ }
963
+ }), Ie = function(e) {
964
+ return e === void 0 && (e = {}), {
965
+ name: "flip",
966
+ options: e,
967
+ async fn(t) {
968
+ var i, n;
969
+ const {
970
+ placement: o,
971
+ middlewareData: s,
972
+ rects: r,
973
+ initialPlacement: a,
974
+ platform: l,
975
+ elements: h
976
+ } = t, {
977
+ mainAxis: c = !0,
978
+ crossAxis: d = !0,
979
+ fallbackPlacements: f,
980
+ fallbackStrategy: u = "bestFit",
981
+ fallbackAxisSideDirection: p = "none",
982
+ flipAlignment: m = !0,
983
+ ...v
984
+ } = nt(e, t);
985
+ if ((i = s.arrow) != null && i.alignmentOffset)
986
+ return {};
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";
988
+ !f && D && b.push(...He(a, m, p, x));
989
+ const E = [a, ...b], W = await Ht(t, v), N = [];
990
+ let L = ((n = s.flip) == null ? void 0 : n.overflows) || [];
991
+ if (c && N.push(W[g]), d) {
992
+ const C = _e(o, r, x);
993
+ N.push(W[C[0]], W[C[1]]);
994
+ }
995
+ if (L = [...L, {
996
+ placement: o,
997
+ overflows: N
998
+ }], !N.every((C) => C <= 0)) {
999
+ var V, _;
1000
+ const C = (((V = s.flip) == null ? void 0 : V.index) || 0) + 1, tt = E[C];
1001
+ if (tt)
1002
+ return {
1003
+ data: {
1004
+ index: C,
1005
+ overflows: L
1006
+ },
1007
+ reset: {
1008
+ placement: tt
1009
+ }
1010
+ };
1011
+ let q = (_ = L.filter(($) => $.overflows[0] <= 0).sort(($, j) => $.overflows[1] - j.overflows[1])[0]) == null ? void 0 : _.placement;
1012
+ if (!q)
1013
+ switch (u) {
1014
+ case "bestFit": {
1015
+ var U;
1016
+ const $ = (U = L.filter((j) => {
1017
+ if (D) {
1018
+ const K = Q(j.placement);
1019
+ return K === y || // Create a bias to the `y` side axis due to horizontal
1020
+ // reading directions favoring greater width.
1021
+ K === "y";
1022
+ }
1023
+ return !0;
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];
1025
+ $ && (q = $);
1026
+ break;
1027
+ }
1028
+ case "initialPlacement":
1029
+ q = a;
1030
+ break;
1031
+ }
1032
+ if (o !== q)
1033
+ return {
1034
+ reset: {
1035
+ placement: q
1036
+ }
1037
+ };
1038
+ }
1039
+ return {};
1040
+ }
1041
+ };
1042
+ };
1043
+ async function Ve(e, t) {
1044
+ const {
1045
+ placement: i,
1046
+ platform: n,
1047
+ elements: o
1048
+ } = e, s = await (n.isRTL == null ? void 0 : n.isRTL(o.floating)), r = X(i), a = ot(i), l = Q(i) === "y", h = ["left", "top"].includes(r) ? -1 : 1, c = s && l ? -1 : 1, d = nt(t, e);
1049
+ let {
1050
+ mainAxis: f,
1051
+ crossAxis: u,
1052
+ alignmentAxis: p
1053
+ } = typeof d == "number" ? {
1054
+ mainAxis: d,
1055
+ crossAxis: 0,
1056
+ alignmentAxis: null
1057
+ } : {
1058
+ mainAxis: d.mainAxis || 0,
1059
+ crossAxis: d.crossAxis || 0,
1060
+ alignmentAxis: d.alignmentAxis
1061
+ };
1062
+ return a && typeof p == "number" && (u = a === "end" ? p * -1 : p), l ? {
1063
+ x: u * c,
1064
+ y: f * h
1065
+ } : {
1066
+ x: f * h,
1067
+ y: u * c
1068
+ };
1069
+ }
1070
+ const Ue = function(e) {
1071
+ return e === void 0 && (e = 0), {
1072
+ name: "offset",
1073
+ options: e,
1074
+ async fn(t) {
1075
+ var i, n;
1076
+ const {
1077
+ x: o,
1078
+ y: s,
1079
+ placement: r,
1080
+ middlewareData: a
1081
+ } = t, l = await Ve(t, e);
1082
+ return r === ((i = a.offset) == null ? void 0 : i.placement) && (n = a.arrow) != null && n.alignmentOffset ? {} : {
1083
+ x: o + l.x,
1084
+ y: s + l.y,
1085
+ data: {
1086
+ ...l,
1087
+ placement: r
1088
+ }
1089
+ };
1090
+ }
1091
+ };
1092
+ }, je = function(e) {
1093
+ return e === void 0 && (e = {}), {
1094
+ name: "shift",
1095
+ options: e,
1096
+ async fn(t) {
1097
+ const {
1098
+ x: i,
1099
+ y: n,
1100
+ placement: o
1101
+ } = t, {
1102
+ mainAxis: s = !0,
1103
+ crossAxis: r = !1,
1104
+ limiter: a = {
1105
+ fn: (v) => {
1106
+ let {
1107
+ x: g,
1108
+ y
1109
+ } = v;
1110
+ return {
1111
+ x: g,
1112
+ y
1113
+ };
1114
+ }
1115
+ },
1116
+ ...l
1117
+ } = nt(e, t), h = {
1118
+ x: i,
1119
+ y: n
1120
+ }, c = await Ht(t, l), d = Q(X(o)), f = ee(d);
1121
+ let u = h[f], p = h[d];
1122
+ if (s) {
1123
+ const v = f === "y" ? "top" : "left", g = f === "y" ? "bottom" : "right", y = u + c[v], w = u - c[g];
1124
+ u = Tt(y, u, w);
1125
+ }
1126
+ if (r) {
1127
+ const v = d === "y" ? "top" : "left", g = d === "y" ? "bottom" : "right", y = p + c[v], w = p - c[g];
1128
+ p = Tt(y, p, w);
1129
+ }
1130
+ const m = a.fn({
1131
+ ...t,
1132
+ [f]: u,
1133
+ [d]: p
1134
+ });
1135
+ return {
1136
+ ...m,
1137
+ data: {
1138
+ x: m.x - i,
1139
+ y: m.y - n,
1140
+ enabled: {
1141
+ [f]: s,
1142
+ [d]: r
1143
+ }
1144
+ }
1145
+ };
1146
+ }
1147
+ };
1148
+ }, Ke = function(e) {
1149
+ return e === void 0 && (e = {}), {
1150
+ name: "size",
1151
+ options: e,
1152
+ async fn(t) {
1153
+ var i, n;
1154
+ const {
1155
+ placement: o,
1156
+ rects: s,
1157
+ platform: r,
1158
+ elements: a
1159
+ } = t, {
1160
+ apply: l = () => {
1161
+ },
1162
+ ...h
1163
+ } = nt(e, t), c = await Ht(t, h), d = X(o), f = ot(o), u = Q(o) === "y", {
1164
+ width: p,
1165
+ height: m
1166
+ } = s.floating;
1167
+ let v, g;
1168
+ d === "top" || d === "bottom" ? (v = d, g = f === (await (r.isRTL == null ? void 0 : r.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (g = d, v = f === "end" ? "top" : "bottom");
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;
1170
+ let E = x, W = b;
1171
+ if ((i = t.middlewareData.shift) != null && i.enabled.x && (W = w), (n = t.middlewareData.shift) != null && n.enabled.y && (E = y), D && !f) {
1172
+ const L = A(c.left, 0), V = A(c.right, 0), _ = A(c.top, 0), U = A(c.bottom, 0);
1173
+ 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));
1174
+ }
1175
+ await l({
1176
+ ...t,
1177
+ availableWidth: W,
1178
+ availableHeight: E
1179
+ });
1180
+ const N = await r.getDimensions(a.floating);
1181
+ return p !== N.width || m !== N.height ? {
1182
+ reset: {
1183
+ rects: !0
1184
+ }
1185
+ } : {};
1186
+ }
1187
+ };
1188
+ };
1189
+ function bt() {
1190
+ return typeof window < "u";
1191
+ }
1192
+ function st(e) {
1193
+ return ne(e) ? (e.nodeName || "").toLowerCase() : "#document";
1194
+ }
1195
+ function T(e) {
1196
+ var t;
1197
+ return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
1198
+ }
1199
+ function B(e) {
1200
+ var t;
1201
+ return (t = (ne(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
1202
+ }
1203
+ function ne(e) {
1204
+ return bt() ? e instanceof Node || e instanceof T(e).Node : !1;
1205
+ }
1206
+ function k(e) {
1207
+ return bt() ? e instanceof Element || e instanceof T(e).Element : !1;
1208
+ }
1209
+ function H(e) {
1210
+ return bt() ? e instanceof HTMLElement || e instanceof T(e).HTMLElement : !1;
1211
+ }
1212
+ function Xt(e) {
1213
+ return !bt() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof T(e).ShadowRoot;
1214
+ }
1215
+ function ct(e) {
1216
+ const {
1217
+ overflow: t,
1218
+ overflowX: i,
1219
+ overflowY: n,
1220
+ display: o
1221
+ } = F(e);
1222
+ return /auto|scroll|overlay|hidden|clip/.test(t + n + i) && !["inline", "contents"].includes(o);
1223
+ }
1224
+ function Ye(e) {
1225
+ return ["table", "td", "th"].includes(st(e));
1226
+ }
1227
+ function xt(e) {
1228
+ return [":popover-open", ":modal"].some((t) => {
1229
+ try {
1230
+ return e.matches(t);
1231
+ } catch {
1232
+ return !1;
1233
+ }
1234
+ });
1235
+ }
1236
+ function Bt(e) {
1237
+ const t = Wt(), i = k(e) ? F(e) : e;
1238
+ 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));
1239
+ }
1240
+ function Xe(e) {
1241
+ let t = G(e);
1242
+ for (; H(t) && !it(t); ) {
1243
+ if (Bt(t))
1244
+ return t;
1245
+ if (xt(t))
1246
+ return null;
1247
+ t = G(t);
1248
+ }
1249
+ return null;
1250
+ }
1251
+ function Wt() {
1252
+ return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
1253
+ }
1254
+ function it(e) {
1255
+ return ["html", "body", "#document"].includes(st(e));
1256
+ }
1257
+ function F(e) {
1258
+ return T(e).getComputedStyle(e);
1259
+ }
1260
+ function Et(e) {
1261
+ return k(e) ? {
1262
+ scrollLeft: e.scrollLeft,
1263
+ scrollTop: e.scrollTop
1264
+ } : {
1265
+ scrollLeft: e.scrollX,
1266
+ scrollTop: e.scrollY
1267
+ };
1268
+ }
1269
+ function G(e) {
1270
+ if (st(e) === "html")
1271
+ return e;
1272
+ const t = (
1273
+ // Step into the shadow DOM of the parent of a slotted node.
1274
+ e.assignedSlot || // DOM Element detected.
1275
+ e.parentNode || // ShadowRoot detected.
1276
+ Xt(e) && e.host || // Fallback.
1277
+ B(e)
1278
+ );
1279
+ return Xt(t) ? t.host : t;
1280
+ }
1281
+ function oe(e) {
1282
+ const t = G(e);
1283
+ return it(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : H(t) && ct(t) ? t : oe(t);
1284
+ }
1285
+ function at(e, t, i) {
1286
+ var n;
1287
+ t === void 0 && (t = []), i === void 0 && (i = !0);
1288
+ const o = oe(e), s = o === ((n = e.ownerDocument) == null ? void 0 : n.body), r = T(o);
1289
+ if (s) {
1290
+ const a = Dt(r);
1291
+ return t.concat(r, r.visualViewport || [], ct(o) ? o : [], a && i ? at(a) : []);
1292
+ }
1293
+ return t.concat(o, at(o, [], i));
1294
+ }
1295
+ function Dt(e) {
1296
+ return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
1297
+ }
1298
+ function se(e) {
1299
+ const t = F(e);
1300
+ let i = parseFloat(t.width) || 0, n = parseFloat(t.height) || 0;
1301
+ const o = H(e), s = o ? e.offsetWidth : i, r = o ? e.offsetHeight : n, a = gt(i) !== s || gt(n) !== r;
1302
+ return a && (i = s, n = r), {
1303
+ width: i,
1304
+ height: n,
1305
+ $: a
1306
+ };
1307
+ }
1308
+ function qt(e) {
1309
+ return k(e) ? e : e.contextElement;
1310
+ }
1311
+ function et(e) {
1312
+ const t = qt(e);
1313
+ if (!H(t))
1314
+ return M(1);
1315
+ const i = t.getBoundingClientRect(), {
1316
+ width: n,
1317
+ height: o,
1318
+ $: s
1319
+ } = se(t);
1320
+ let r = (s ? gt(i.width) : i.width) / n, a = (s ? gt(i.height) : i.height) / o;
1321
+ return (!r || !Number.isFinite(r)) && (r = 1), (!a || !Number.isFinite(a)) && (a = 1), {
1322
+ x: r,
1323
+ y: a
1324
+ };
1325
+ }
1326
+ const Ge = /* @__PURE__ */ M(0);
1327
+ function re(e) {
1328
+ const t = T(e);
1329
+ return !Wt() || !t.visualViewport ? Ge : {
1330
+ x: t.visualViewport.offsetLeft,
1331
+ y: t.visualViewport.offsetTop
1332
+ };
1333
+ }
1334
+ function Je(e, t, i) {
1335
+ return t === void 0 && (t = !1), !i || t && i !== T(e) ? !1 : t;
1336
+ }
1337
+ function Z(e, t, i, n) {
1338
+ t === void 0 && (t = !1), i === void 0 && (i = !1);
1339
+ const o = e.getBoundingClientRect(), s = qt(e);
1340
+ let r = M(1);
1341
+ t && (n ? k(n) && (r = et(n)) : r = et(e));
1342
+ const a = Je(s, i, n) ? re(s) : M(0);
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;
1344
+ if (s) {
1345
+ const f = T(s), u = n && k(n) ? T(n) : n;
1346
+ let p = f, m = Dt(p);
1347
+ for (; m && n && u !== p; ) {
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;
1349
+ l *= v.x, h *= v.y, c *= v.x, d *= v.y, l += w, h += x, p = T(m), m = Dt(p);
1350
+ }
1351
+ }
1352
+ return yt({
1353
+ width: c,
1354
+ height: d,
1355
+ x: l,
1356
+ y: h
1357
+ });
1358
+ }
1359
+ function It(e, t) {
1360
+ const i = Et(e).scrollLeft;
1361
+ return t ? t.left + i : Z(B(e)).left + i;
1362
+ }
1363
+ function ae(e, t, i) {
1364
+ i === void 0 && (i = !1);
1365
+ const n = e.getBoundingClientRect(), o = n.left + t.scrollLeft - (i ? 0 : (
1366
+ // RTL <body> scrollbar.
1367
+ It(e, n)
1368
+ )), s = n.top + t.scrollTop;
1369
+ return {
1370
+ x: o,
1371
+ y: s
1372
+ };
1373
+ }
1374
+ function Qe(e) {
1375
+ let {
1376
+ elements: t,
1377
+ rect: i,
1378
+ offsetParent: n,
1379
+ strategy: o
1380
+ } = e;
1381
+ const s = o === "fixed", r = B(n), a = t ? xt(t.floating) : !1;
1382
+ if (n === r || a && s)
1383
+ return i;
1384
+ let l = {
1385
+ scrollLeft: 0,
1386
+ scrollTop: 0
1387
+ }, h = M(1);
1388
+ const c = M(0), d = H(n);
1389
+ if ((d || !d && !s) && ((st(n) !== "body" || ct(r)) && (l = Et(n)), H(n))) {
1390
+ const u = Z(n);
1391
+ h = et(n), c.x = u.x + n.clientLeft, c.y = u.y + n.clientTop;
1392
+ }
1393
+ const f = r && !d && !s ? ae(r, l, !0) : M(0);
1394
+ return {
1395
+ width: i.width * h.x,
1396
+ height: i.height * h.y,
1397
+ x: i.x * h.x - l.scrollLeft * h.x + c.x + f.x,
1398
+ y: i.y * h.y - l.scrollTop * h.y + c.y + f.y
1399
+ };
1400
+ }
1401
+ function Ze(e) {
1402
+ return Array.from(e.getClientRects());
1403
+ }
1404
+ function ti(e) {
1405
+ 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);
1406
+ let r = -i.scrollLeft + It(e);
1407
+ const a = -i.scrollTop;
1408
+ return F(n).direction === "rtl" && (r += A(t.clientWidth, n.clientWidth) - o), {
1409
+ width: o,
1410
+ height: s,
1411
+ x: r,
1412
+ y: a
1413
+ };
1414
+ }
1415
+ function ei(e, t) {
1416
+ const i = T(e), n = B(e), o = i.visualViewport;
1417
+ let s = n.clientWidth, r = n.clientHeight, a = 0, l = 0;
1418
+ if (o) {
1419
+ s = o.width, r = o.height;
1420
+ const h = Wt();
1421
+ (!h || h && t === "fixed") && (a = o.offsetLeft, l = o.offsetTop);
1422
+ }
1423
+ return {
1424
+ width: s,
1425
+ height: r,
1426
+ x: a,
1427
+ y: l
1428
+ };
1429
+ }
1430
+ function ii(e, t) {
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;
1432
+ return {
1433
+ width: r,
1434
+ height: a,
1435
+ x: l,
1436
+ y: h
1437
+ };
1438
+ }
1439
+ function Gt(e, t, i) {
1440
+ let n;
1441
+ if (t === "viewport")
1442
+ n = ei(e, i);
1443
+ else if (t === "document")
1444
+ n = ti(B(e));
1445
+ else if (k(t))
1446
+ n = ii(t, i);
1447
+ else {
1448
+ const o = re(e);
1449
+ n = {
1450
+ x: t.x - o.x,
1451
+ y: t.y - o.y,
1452
+ width: t.width,
1453
+ height: t.height
1454
+ };
1455
+ }
1456
+ return yt(n);
1457
+ }
1458
+ function le(e, t) {
1459
+ const i = G(e);
1460
+ return i === t || !k(i) || it(i) ? !1 : F(i).position === "fixed" || le(i, t);
1461
+ }
1462
+ function ni(e, t) {
1463
+ const i = t.get(e);
1464
+ if (i)
1465
+ return i;
1466
+ let n = at(e, [], !1).filter((a) => k(a) && st(a) !== "body"), o = null;
1467
+ const s = F(e).position === "fixed";
1468
+ let r = s ? G(e) : e;
1469
+ for (; k(r) && !it(r); ) {
1470
+ const a = F(r), l = Bt(r);
1471
+ !l && a.position === "fixed" && (o = null), (s ? !l && !o : !l && a.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || ct(r) && !l && le(e, r)) ? n = n.filter((c) => c !== r) : o = a, r = G(r);
1472
+ }
1473
+ return t.set(e, n), n;
1474
+ }
1475
+ function oi(e) {
1476
+ let {
1477
+ element: t,
1478
+ boundary: i,
1479
+ rootBoundary: n,
1480
+ strategy: o
1481
+ } = e;
1482
+ const r = [...i === "clippingAncestors" ? xt(t) ? [] : ni(t, this._c) : [].concat(i), n], a = r[0], l = r.reduce((h, c) => {
1483
+ const d = Gt(t, c, o);
1484
+ 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;
1485
+ }, Gt(t, a, o));
1486
+ return {
1487
+ width: l.right - l.left,
1488
+ height: l.bottom - l.top,
1489
+ x: l.left,
1490
+ y: l.top
1491
+ };
1492
+ }
1493
+ function si(e) {
1494
+ const {
1495
+ width: t,
1496
+ height: i
1497
+ } = se(e);
1498
+ return {
1499
+ width: t,
1500
+ height: i
1501
+ };
1502
+ }
1503
+ function ri(e, t, i) {
1504
+ const n = H(t), o = B(t), s = i === "fixed", r = Z(e, !0, s, t);
1505
+ let a = {
1506
+ scrollLeft: 0,
1507
+ scrollTop: 0
1508
+ };
1509
+ const l = M(0);
1510
+ if (n || !n && !s)
1511
+ if ((st(t) !== "body" || ct(o)) && (a = Et(t)), n) {
1512
+ const f = Z(t, !0, s, t);
1513
+ l.x = f.x + t.clientLeft, l.y = f.y + t.clientTop;
1514
+ } else o && (l.x = It(o));
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;
1516
+ return {
1517
+ x: c,
1518
+ y: d,
1519
+ width: r.width,
1520
+ height: r.height
1521
+ };
1522
+ }
1523
+ function Ot(e) {
1524
+ return F(e).position === "static";
1525
+ }
1526
+ function Jt(e, t) {
1527
+ if (!H(e) || F(e).position === "fixed")
1528
+ return null;
1529
+ if (t)
1530
+ return t(e);
1531
+ let i = e.offsetParent;
1532
+ return B(e) === i && (i = i.ownerDocument.body), i;
1533
+ }
1534
+ function ce(e, t) {
1535
+ const i = T(e);
1536
+ if (xt(e))
1537
+ return i;
1538
+ if (!H(e)) {
1539
+ let o = G(e);
1540
+ for (; o && !it(o); ) {
1541
+ if (k(o) && !Ot(o))
1542
+ return o;
1543
+ o = G(o);
1544
+ }
1545
+ return i;
1546
+ }
1547
+ let n = Jt(e, t);
1548
+ for (; n && Ye(n) && Ot(n); )
1549
+ n = Jt(n, t);
1550
+ return n && it(n) && Ot(n) && !Bt(n) ? i : n || Xe(e) || i;
1551
+ }
1552
+ const ai = async function(e) {
1553
+ const t = this.getOffsetParent || ce, i = this.getDimensions, n = await i(e.floating);
1554
+ return {
1555
+ reference: ri(e.reference, await t(e.floating), e.strategy),
1556
+ floating: {
1557
+ x: 0,
1558
+ y: 0,
1559
+ width: n.width,
1560
+ height: n.height
1561
+ }
1562
+ };
1563
+ };
1564
+ function li(e) {
1565
+ return F(e).direction === "rtl";
1566
+ }
1567
+ const ci = {
1568
+ convertOffsetParentRelativeRectToViewportRelativeRect: Qe,
1569
+ getDocumentElement: B,
1570
+ getClippingRect: oi,
1571
+ getOffsetParent: ce,
1572
+ getElementRects: ai,
1573
+ getClientRects: Ze,
1574
+ getDimensions: si,
1575
+ getScale: et,
1576
+ isElement: k,
1577
+ isRTL: li
1578
+ };
1579
+ function he(e, t) {
1580
+ return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
1581
+ }
1582
+ function hi(e, t) {
1583
+ let i = null, n;
1584
+ const o = B(e);
1585
+ function s() {
1586
+ var a;
1587
+ clearTimeout(n), (a = i) == null || a.disconnect(), i = null;
1588
+ }
1589
+ function r(a, l) {
1590
+ a === void 0 && (a = !1), l === void 0 && (l = 1), s();
1591
+ const h = e.getBoundingClientRect(), {
1592
+ left: c,
1593
+ top: d,
1594
+ width: f,
1595
+ height: u
1596
+ } = h;
1597
+ if (a || t(), !f || !u)
1598
+ return;
1599
+ const p = dt(d), m = dt(o.clientWidth - (c + f)), v = dt(o.clientHeight - (d + u)), g = dt(c), w = {
1600
+ rootMargin: -p + "px " + -m + "px " + -v + "px " + -g + "px",
1601
+ threshold: A(0, Y(1, l)) || 1
1602
+ };
1603
+ let x = !0;
1604
+ function b(D) {
1605
+ const E = D[0].intersectionRatio;
1606
+ if (E !== l) {
1607
+ if (!x)
1608
+ return r();
1609
+ E ? r(!1, E) : n = setTimeout(() => {
1610
+ r(!1, 1e-7);
1611
+ }, 1e3);
1612
+ }
1613
+ E === 1 && !he(h, e.getBoundingClientRect()) && r(), x = !1;
1614
+ }
1615
+ try {
1616
+ i = new IntersectionObserver(b, {
1617
+ ...w,
1618
+ // Handle <iframe>s
1619
+ root: o.ownerDocument
1620
+ });
1621
+ } catch {
1622
+ i = new IntersectionObserver(b, w);
1623
+ }
1624
+ i.observe(e);
1625
+ }
1626
+ return r(!0), s;
1627
+ }
1628
+ function Qt(e, t, i, n) {
1629
+ n === void 0 && (n = {});
1630
+ const {
1631
+ ancestorScroll: o = !0,
1632
+ ancestorResize: s = !0,
1633
+ elementResize: r = typeof ResizeObserver == "function",
1634
+ layoutShift: a = typeof IntersectionObserver == "function",
1635
+ animationFrame: l = !1
1636
+ } = n, h = qt(e), c = o || s ? [...h ? at(h) : [], ...at(t)] : [];
1637
+ c.forEach((g) => {
1638
+ o && g.addEventListener("scroll", i, {
1639
+ passive: !0
1640
+ }), s && g.addEventListener("resize", i);
1641
+ });
1642
+ const d = h && a ? hi(h, i) : null;
1643
+ let f = -1, u = null;
1644
+ r && (u = new ResizeObserver((g) => {
1645
+ let [y] = g;
1646
+ y && y.target === h && u && (u.unobserve(t), cancelAnimationFrame(f), f = requestAnimationFrame(() => {
1647
+ var w;
1648
+ (w = u) == null || w.observe(t);
1649
+ })), i();
1650
+ }), h && !l && u.observe(h), u.observe(t));
1651
+ let p, m = l ? Z(e) : null;
1652
+ l && v();
1653
+ function v() {
1654
+ const g = Z(e);
1655
+ m && !he(m, g) && i(), m = g, p = requestAnimationFrame(v);
1656
+ }
1657
+ return i(), () => {
1658
+ var g;
1659
+ c.forEach((y) => {
1660
+ o && y.removeEventListener("scroll", i), s && y.removeEventListener("resize", i);
1661
+ }), d == null || d(), (g = u) == null || g.disconnect(), u = null, l && cancelAnimationFrame(p);
1662
+ };
1663
+ }
1664
+ const di = Ue, ui = je, Zt = Ie, pi = Ke, fi = qe, mi = (e, t, i) => {
1665
+ const n = /* @__PURE__ */ new Map(), o = {
1666
+ platform: ci,
1667
+ ...i
1668
+ }, s = {
1669
+ ...o.platform,
1670
+ _c: n
1671
+ };
1672
+ return We(e, t, {
1673
+ ...o,
1674
+ platform: s
1675
+ });
1676
+ };
1677
+ function ut(e) {
1678
+ if (e === void 0)
1679
+ return 0;
1680
+ const t = window.devicePixelRatio || 1;
1681
+ return Math.round(e * t) / t;
1682
+ }
1683
+ const pt = 8, gi = 100, vi = (e) => ({
1684
+ left: ["right", "bottom", "top"],
1685
+ "left-start": ["right-start", "bottom", "top"],
1686
+ "left-end": ["right-end", "bottom", "top"],
1687
+ right: ["left", "bottom", "top"],
1688
+ "right-start": ["left-start", "bottom", "top"],
1689
+ "right-end": ["left-end", "bottom", "top"],
1690
+ top: ["bottom", "left", "right"],
1691
+ "top-start": ["bottom-start", "left", "right"],
1692
+ "top-end": ["bottom-end", "left", "right"],
1693
+ bottom: ["top", "left", "right"],
1694
+ "bottom-start": ["top-start", "left", "right"],
1695
+ "bottom-end": ["top-end", "left", "right"]
1696
+ })[e] ?? [e], qi = Symbol("placement updated");
1697
+ class yi {
1698
+ /**
1699
+ * Creates an instance of the PlacementController.
1700
+ *
1701
+ * @param host - The host element that uses this controller.
1702
+ */
1703
+ constructor(t) {
1704
+ this.originalPlacements = /* @__PURE__ */ new WeakMap(), this.allowPlacementUpdate = !1, this.closeForAncestorUpdate = () => {
1705
+ !this.allowPlacementUpdate && this.options.type !== "modal" && this.cleanup && this.target.dispatchEvent(new Event("close", { bubbles: !0 })), this.allowPlacementUpdate = !1;
1706
+ }, this.updatePlacement = () => {
1707
+ this.computePlacement();
1708
+ }, this.resetOverlayPosition = () => {
1709
+ !this.target || !this.options || (this.clearOverlayPosition(), this.host.offsetHeight, this.computePlacement());
1710
+ }, this.host = t, this.host.addController(this);
1711
+ }
1712
+ /**
1713
+ * Places the overlay relative to the target element.
1714
+ *
1715
+ * This method sets up the necessary configurations and event listeners to manage the
1716
+ * positioning and constraints of the overlay element.
1717
+ *
1718
+ * @param [target=this.target] - The target element for the overlay.
1719
+ * @param [options=this.options] - The options for configuring the overlay placement.
1720
+ * @returns A promise that resolves when the overlay has been placed.
1721
+ */
1722
+ placeOverlay(t = this.target, i = this.options) {
1723
+ if (this.target = t, this.options = i, !t || !i)
1724
+ return;
1725
+ const n = Qt(
1726
+ i.trigger,
1727
+ t,
1728
+ this.closeForAncestorUpdate,
1729
+ {
1730
+ ancestorResize: !1,
1731
+ elementResize: !1,
1732
+ layoutShift: !1
1733
+ }
1734
+ ), o = Qt(
1735
+ i.trigger,
1736
+ t,
1737
+ this.updatePlacement,
1738
+ {
1739
+ ancestorScroll: !1
1740
+ }
1741
+ );
1742
+ this.cleanup = () => {
1743
+ var s;
1744
+ (s = this.host.elements) == null || s.forEach((r) => {
1745
+ r.addEventListener(
1746
+ "luzmo-closed",
1747
+ () => {
1748
+ const a = this.originalPlacements.get(r);
1749
+ a && r.setAttribute("placement", a), this.originalPlacements.delete(r);
1750
+ },
1751
+ { once: !0 }
1752
+ );
1753
+ }), n(), o();
1754
+ };
1755
+ }
1756
+ /**
1757
+ * Computes the placement of the overlay relative to the target element.
1758
+ *
1759
+ * This method calculates the necessary positioning and constraints for the overlay element
1760
+ * using various middleware functions. It updates the overlay's style and attributes based
1761
+ * on the computed position.
1762
+ *
1763
+ * @returns A promise that resolves when the placement has been computed.
1764
+ */
1765
+ async computePlacement() {
1766
+ var f, u;
1767
+ const { options: t, target: i } = this;
1768
+ await (document.fonts ? document.fonts.ready : Promise.resolve());
1769
+ const n = t.trigger instanceof HTMLElement ? Zt() : Zt({
1770
+ padding: pt,
1771
+ fallbackPlacements: vi(t.placement)
1772
+ }), [o = 0, s = 0] = Array.isArray(t == null ? void 0 : t.offset) ? t.offset : [t.offset, 0], r = (f = this.host.elements.find(
1773
+ (p) => p.tipElement
1774
+ )) == null ? void 0 : f.tipElement, a = [
1775
+ di({
1776
+ mainAxis: o,
1777
+ crossAxis: s
1778
+ }),
1779
+ ui({ padding: pt }),
1780
+ n,
1781
+ pi({
1782
+ padding: pt,
1783
+ apply: ({ availableWidth: p, availableHeight: m, rects: { floating: v } }) => {
1784
+ const g = Math.max(
1785
+ gi,
1786
+ Math.floor(m)
1787
+ ), y = v.height;
1788
+ this.initialHeight = this.isConstrained && this.initialHeight || y, this.isConstrained = y < this.initialHeight || g <= y;
1789
+ const w = this.isConstrained ? `${g}px` : "";
1790
+ Object.assign(i.style, {
1791
+ maxWidth: `${Math.floor(p)}px`,
1792
+ maxHeight: w
1793
+ });
1794
+ }
1795
+ }),
1796
+ ...r ? [
1797
+ fi({
1798
+ element: r,
1799
+ padding: t.tipPadding || pt
1800
+ })
1801
+ ] : []
1802
+ ], { x: l, y: h, placement: c, middlewareData: d } = await mi(
1803
+ t.trigger,
1804
+ i,
1805
+ {
1806
+ placement: t.placement,
1807
+ middleware: a,
1808
+ strategy: "fixed"
1809
+ }
1810
+ );
1811
+ if (Object.assign(i.style, {
1812
+ top: "0px",
1813
+ left: "0px",
1814
+ translate: `${ut(l)}px ${ut(h)}px`
1815
+ }), i.setAttribute("actual-placement", c), (u = this.host.elements) == null || u.forEach((p) => {
1816
+ this.originalPlacements.has(p) || this.originalPlacements.set(
1817
+ p,
1818
+ p.getAttribute("placement")
1819
+ ), p.setAttribute("placement", c);
1820
+ }), r && d.arrow) {
1821
+ const { x: p, y: m } = d.arrow;
1822
+ Object.assign(r.style, {
1823
+ top: c.startsWith("right") || c.startsWith("left") ? "0px" : "",
1824
+ left: c.startsWith("bottom") || c.startsWith("top") ? "0px" : "",
1825
+ translate: `${ut(p)}px ${ut(m)}px`
1826
+ });
1827
+ }
1828
+ }
1829
+ /**
1830
+ * Clears the overlay's position styles.
1831
+ *
1832
+ * This method removes the max-height and max-width styles from the target element,
1833
+ * and resets the initial height and constrained state of the overlay.
1834
+ */
1835
+ clearOverlayPosition() {
1836
+ this.target && (this.target.style.removeProperty("max-height"), this.target.style.removeProperty("max-width"), this.initialHeight = void 0, this.isConstrained = !1);
1837
+ }
1838
+ /**
1839
+ * Lifecycle method called when the host element is connected to the DOM.
1840
+ *
1841
+ * This method sets up an event listener to reset the overlay's position when the 'luzmo-update-overlays' event is dispatched.
1842
+ */
1843
+ hostConnected() {
1844
+ document.addEventListener(
1845
+ "luzmo-update-overlays",
1846
+ this.resetOverlayPosition
1847
+ );
1848
+ }
1849
+ /**
1850
+ * Lifecycle method called when the host element is updated.
1851
+ *
1852
+ * This method cleans up resources if the overlay is not open.
1853
+ */
1854
+ hostUpdated() {
1855
+ var t;
1856
+ this.host.open || ((t = this.cleanup) == null || t.call(this), this.cleanup = void 0);
1857
+ }
1858
+ /**
1859
+ * Lifecycle method called when the host element is disconnected from the DOM.
1860
+ *
1861
+ * This method removes the event listener and cleans up resources.
1862
+ */
1863
+ hostDisconnected() {
1864
+ var t;
1865
+ (t = this.cleanup) == null || t.call(this), this.cleanup = void 0, document.removeEventListener(
1866
+ "luzmo-update-overlays",
1867
+ this.resetOverlayPosition
1868
+ );
1869
+ }
1870
+ }
1871
+ var Pt = /* @__PURE__ */ ((e) => (e[e.click = 0] = "click", e[e.hover = 1] = "hover", e[e.longpress = 2] = "longpress", e))(Pt || {});
1872
+ class Vt {
1873
+ constructor(t, { overlay: i, isPersistent: n, handleOverlayReady: o }) {
1874
+ this.target = t, this.isLazilyOpen = !1, this.isPersistent = !1, this.isPersistent = !!n, this.handleOverlayReady = o, this.isPersistent && this.init(), this.overlay = i;
1875
+ }
1876
+ get activelyOpening() {
1877
+ return !1;
1878
+ }
1879
+ get open() {
1880
+ var t;
1881
+ return ((t = this.overlay) == null ? void 0 : t.open) ?? this.isLazilyOpen;
1882
+ }
1883
+ /**
1884
+ * Set `open` against the associated Overlay lazily.
1885
+ */
1886
+ set open(t) {
1887
+ if (t !== this.open) {
1888
+ if (this.isLazilyOpen = t, this.overlay) {
1889
+ this.overlay.open = t;
1890
+ return;
1891
+ }
1892
+ t && (customElements.whenDefined("luzmo-overlay").then(async () => {
1893
+ const { Overlay: i } = await Promise.resolve().then(() => Lt);
1894
+ this.overlay = new i(), this.overlay.open = !0;
1895
+ }), Promise.resolve().then(() => Lt));
1896
+ }
1897
+ }
1898
+ get overlay() {
1899
+ return this._overlay;
1900
+ }
1901
+ set overlay(t) {
1902
+ var i;
1903
+ 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));
1904
+ }
1905
+ prepareDescription(t) {
1906
+ }
1907
+ releaseDescription() {
1908
+ }
1909
+ shouldCompleteOpen() {
1910
+ }
1911
+ /* c8 ignore next 3 */
1912
+ init() {
1913
+ }
1914
+ /* c8 ignore next 3 */
1915
+ initOverlay() {
1916
+ }
1917
+ abort() {
1918
+ var t;
1919
+ this.releaseDescription(), (t = this.abortController) == null || t.abort();
1920
+ }
1921
+ hostConnected() {
1922
+ this.init();
1923
+ }
1924
+ hostDisconnected() {
1925
+ this.isPersistent || this.abort();
1926
+ }
1927
+ }
1928
+ class wi extends Vt {
1929
+ constructor() {
1930
+ super(...arguments), this.type = Pt.click, this.preventNextToggle = !1;
1931
+ }
1932
+ handleClick() {
1933
+ this.preventNextToggle || (this.open = !this.open), this.preventNextToggle = !1;
1934
+ }
1935
+ handlePointerdown() {
1936
+ this.preventNextToggle = this.open;
1937
+ }
1938
+ init() {
1939
+ var i;
1940
+ (i = this.abortController) == null || i.abort(), this.abortController = new AbortController();
1941
+ const { signal: t } = this.abortController;
1942
+ this.target.addEventListener("click", () => this.handleClick(), {
1943
+ signal: t
1944
+ }), this.target.addEventListener(
1945
+ "pointerdown",
1946
+ () => this.handlePointerdown(),
1947
+ { signal: t }
1948
+ );
1949
+ }
1950
+ }
1951
+ const bi = 300;
1952
+ class xi extends Vt {
1953
+ constructor() {
1954
+ super(...arguments), this.type = Pt.hover, this.elementIds = [], this.focusedin = !1, this.pointerentered = !1;
1955
+ }
1956
+ handleTargetFocusin() {
1957
+ this.target.matches(":focus-visible") && (this.open = !0, this.focusedin = !0);
1958
+ }
1959
+ handleTargetFocusout() {
1960
+ this.focusedin = !1, !this.pointerentered && (this.open = !1);
1961
+ }
1962
+ handleTargetPointerenter() {
1963
+ var t;
1964
+ this.hoverTimeout && (clearTimeout(this.hoverTimeout), this.hoverTimeout = void 0), !((t = this.overlay) != null && t.disabled) && (this.open = !0, this.pointerentered = !0);
1965
+ }
1966
+ handleTargetPointerleave() {
1967
+ this.doPointerleave();
1968
+ }
1969
+ // set a timeout once the pointer enters and the overlay is shown
1970
+ // give the user time to enter the overlay
1971
+ handleHostPointerenter() {
1972
+ this.hoverTimeout && (clearTimeout(this.hoverTimeout), this.hoverTimeout = void 0);
1973
+ }
1974
+ handleHostPointerleave() {
1975
+ this.doPointerleave();
1976
+ }
1977
+ prepareDescription() {
1978
+ if (this.overlay.elements.length === 0)
1979
+ return;
1980
+ const t = this.target.getRootNode(), i = this.overlay.elements[0].getRootNode(), n = this.overlay.getRootNode();
1981
+ t === n ? this.prepareOverlayRelativeDescription() : t === i && this.prepareContentRelativeDescription();
1982
+ }
1983
+ prepareOverlayRelativeDescription() {
1984
+ const t = At(
1985
+ this.target,
1986
+ "aria-describedby",
1987
+ [this.overlay.id]
1988
+ );
1989
+ this.releaseDescription = () => {
1990
+ t(), this.releaseDescription = J;
1991
+ };
1992
+ }
1993
+ prepareContentRelativeDescription() {
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));
1995
+ this.elementIds = t;
1996
+ const n = At(
1997
+ this.target,
1998
+ "aria-describedby",
1999
+ i
2000
+ );
2001
+ this.releaseDescription = () => {
2002
+ n(), this.overlay.elements.map((o, s) => {
2003
+ o.id = this.elementIds[s];
2004
+ }), this.releaseDescription = J;
2005
+ };
2006
+ }
2007
+ doPointerleave() {
2008
+ this.pointerentered = !1;
2009
+ const t = this.target;
2010
+ this.focusedin && t.matches(":focus-visible") || (this.hoverTimeout = setTimeout(() => {
2011
+ this.open = !1;
2012
+ }, bi));
2013
+ }
2014
+ init() {
2015
+ var i;
2016
+ (i = this.abortController) == null || i.abort(), this.abortController = new AbortController();
2017
+ const { signal: t } = this.abortController;
2018
+ this.target.addEventListener("focusin", () => this.handleTargetFocusin(), {
2019
+ signal: t
2020
+ }), this.target.addEventListener(
2021
+ "focusout",
2022
+ () => this.handleTargetFocusout(),
2023
+ { signal: t }
2024
+ ), this.target.addEventListener(
2025
+ "pointerenter",
2026
+ () => this.handleTargetPointerenter(),
2027
+ { signal: t }
2028
+ ), this.target.addEventListener(
2029
+ "pointerleave",
2030
+ () => this.handleTargetPointerleave(),
2031
+ { signal: t }
2032
+ ), this.overlay && this.initOverlay();
2033
+ }
2034
+ initOverlay() {
2035
+ if (!this.abortController)
2036
+ return;
2037
+ const { signal: t } = this.abortController;
2038
+ this.overlay.addEventListener(
2039
+ "pointerenter",
2040
+ () => this.handleHostPointerenter(),
2041
+ { signal: t }
2042
+ ), this.overlay.addEventListener(
2043
+ "pointerleave",
2044
+ () => this.handleHostPointerleave(),
2045
+ { signal: t }
2046
+ );
2047
+ }
2048
+ }
2049
+ const Ei = 300, Pi = {
2050
+ touch: "Double tap and long press for additional options",
2051
+ keyboard: "Press Space or Alt+Down Arrow for additional options",
2052
+ mouse: "Click and hold for additional options"
2053
+ };
2054
+ class Ci extends Vt {
2055
+ constructor() {
2056
+ super(...arguments), this.type = Pt.longpress, this.longpressState = null, this.releaseDescription = J, this.handlePointerup = () => {
2057
+ var t;
2058
+ 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));
2059
+ };
2060
+ }
2061
+ get activelyOpening() {
2062
+ return this.longpressState === "opening" || this.longpressState === "pressed";
2063
+ }
2064
+ handleLongpress() {
2065
+ this.open = !0, this.longpressState = this.longpressState === "potential" ? "opening" : "pressed";
2066
+ }
2067
+ handlePointerdown(t) {
2068
+ !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(() => {
2069
+ this.target && this.target.dispatchEvent(
2070
+ new CustomEvent("longpress", {
2071
+ bubbles: !0,
2072
+ composed: !0,
2073
+ detail: {
2074
+ source: "pointer"
2075
+ }
2076
+ })
2077
+ );
2078
+ }, Ei));
2079
+ }
2080
+ handleKeydown(t) {
2081
+ const { code: i, altKey: n } = t;
2082
+ n && i === "ArrowDown" && (t.stopPropagation(), t.stopImmediatePropagation());
2083
+ }
2084
+ handleKeyup(t) {
2085
+ const { code: i, altKey: n } = t;
2086
+ if (i === "Space" || n && i === "ArrowDown") {
2087
+ if (!this.target)
2088
+ return;
2089
+ t.stopPropagation(), this.target.dispatchEvent(
2090
+ new CustomEvent("longpress", {
2091
+ bubbles: !0,
2092
+ composed: !0,
2093
+ detail: {
2094
+ source: "keyboard"
2095
+ }
2096
+ })
2097
+ ), setTimeout(() => {
2098
+ this.longpressState = null;
2099
+ });
2100
+ }
2101
+ }
2102
+ prepareDescription(t) {
2103
+ if (
2104
+ // do not reapply until target is recycled
2105
+ this.releaseDescription !== J || // require "longpress content" to apply relationship
2106
+ this.overlay.elements.length === 0
2107
+ )
2108
+ return;
2109
+ const i = document.createElement("div");
2110
+ i.id = `longpress-describedby-descriptor-${St()}`;
2111
+ const n = be() || xe() ? "touch" : "keyboard";
2112
+ i.textContent = Pi[n], i.slot = "longpress-describedby-descriptor";
2113
+ const o = t.getRootNode(), s = this.overlay.getRootNode();
2114
+ o === s ? this.overlay.append(i) : (i.hidden = !("host" in o), t.after(i));
2115
+ const r = At(
2116
+ t,
2117
+ "aria-describedby",
2118
+ [i.id]
2119
+ );
2120
+ this.releaseDescription = () => {
2121
+ r(), i.remove(), this.releaseDescription = J;
2122
+ };
2123
+ }
2124
+ shouldCompleteOpen() {
2125
+ this.longpressState = this.longpressState === "pressed" ? null : this.longpressState;
2126
+ }
2127
+ init() {
2128
+ var i;
2129
+ (i = this.abortController) == null || i.abort(), this.abortController = new AbortController();
2130
+ const { signal: t } = this.abortController;
2131
+ this.target.addEventListener("longpress", () => this.handleLongpress(), {
2132
+ signal: t
2133
+ }), this.target.addEventListener(
2134
+ "pointerdown",
2135
+ (n) => this.handlePointerdown(n),
2136
+ { signal: t }
2137
+ ), this.prepareDescription(this.target), !this.target.holdAffordance && (this.target.addEventListener(
2138
+ "keydown",
2139
+ (n) => this.handleKeydown(n),
2140
+ { signal: t }
2141
+ ), this.target.addEventListener(
2142
+ "keyup",
2143
+ (n) => this.handleKeyup(n),
2144
+ { signal: t }
2145
+ ));
2146
+ }
2147
+ }
2148
+ const Oi = {
2149
+ click: wi,
2150
+ longpress: Ci,
2151
+ hover: xi
2152
+ };
2153
+ var Ai = Object.defineProperty, Ti = Object.getOwnPropertyDescriptor, O = (e, t, i, n) => {
2154
+ for (var o = n > 1 ? void 0 : n ? Ti(t, i) : t, s = e.length - 1, r; s >= 0; s--)
2155
+ (r = e[s]) && (o = (n ? r(t, i, o) : r(o)) || o);
2156
+ return n && o && Ai(t, i, o), o;
2157
+ };
2158
+ const Ri = "showPopover" in document.createElement("div");
2159
+ let ft = Te(rt);
2160
+ ft = Ri ? Le(ft) : Re(ft);
2161
+ var I;
2162
+ const P = (I = class extends ft {
2163
+ constructor() {
2164
+ 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) => {
2165
+ if (!t.relatedTarget)
2166
+ return;
2167
+ const i = new Event("overlay-relation-query", {
2168
+ bubbles: !0,
2169
+ composed: !0
2170
+ });
2171
+ t.relatedTarget.addEventListener(i.type, (n) => {
2172
+ n.composedPath().includes(this) || (this.open = !1);
2173
+ }), t.relatedTarget.dispatchEvent(i);
2174
+ };
2175
+ }
2176
+ get delayed() {
2177
+ var t;
2178
+ return ((t = this.elements.at(-1)) == null ? void 0 : t.hasAttribute("delayed")) || this._delayed;
2179
+ }
2180
+ set delayed(t) {
2181
+ this._delayed = t;
2182
+ }
2183
+ get disabled() {
2184
+ return this._disabled;
2185
+ }
2186
+ set disabled(t) {
2187
+ var i;
2188
+ 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);
2189
+ }
2190
+ /**
2191
+ * Determines if the overlay has a non-virtual trigger element.
2192
+ *
2193
+ * @returns `true` if the trigger element is not a virtual trigger, otherwise `false`.
2194
+ */
2195
+ get hasNonVirtualTrigger() {
2196
+ return !!this.triggerElement && !(this.triggerElement instanceof wt);
2197
+ }
2198
+ /**
2199
+ * Provides an instance of the `PlacementController` for managing the positioning
2200
+ * of the overlay relative to its trigger element.
2201
+ *
2202
+ * If the `PlacementController` instance does not already exist, it is created and
2203
+ * assigned to the `_placementController` property.
2204
+ *
2205
+ * @protected
2206
+ * @returns The `PlacementController` instance.
2207
+ */
2208
+ get placementController() {
2209
+ return this._placementController || (this._placementController = new yi(this)), this._placementController;
2210
+ }
2211
+ get open() {
2212
+ return this._open;
2213
+ }
2214
+ set open(t) {
2215
+ var i;
2216
+ t && this.disabled || t !== this.open && ((i = this.strategy) != null && i.activelyOpening && !t || (this._open = t, this.open && (I.openCount += 1), this.requestUpdate("open", !this.open), this.open && this.requestSlottable()));
2217
+ }
2218
+ get state() {
2219
+ return this._state;
2220
+ }
2221
+ set state(t) {
2222
+ var n;
2223
+ if (t === this.state)
2224
+ return;
2225
+ const i = this.state;
2226
+ this._state = t, (this.state === "opened" || this.state === "closed") && ((n = this.strategy) == null || n.shouldCompleteOpen()), this.requestUpdate("state", i);
2227
+ }
2228
+ /**
2229
+ * Provides an instance of the `ElementResolutionController` for managing the element
2230
+ * that the overlay should be associated with. If the instance does not already exist,
2231
+ * it is created and assigned to the `_elementResolver` property.
2232
+ *
2233
+ * @protected
2234
+ * @returns The `ElementResolutionController` instance.
2235
+ */
2236
+ get elementResolver() {
2237
+ return this._elementResolver || (this._elementResolver = new ge(this)), this._elementResolver;
2238
+ }
2239
+ /**
2240
+ * Determines if the overlay uses a dialog.
2241
+ * Returns `true` if the overlay type is "modal" or "page".
2242
+ *
2243
+ * @private
2244
+ * @returns `true` if the overlay uses a dialog, otherwise `false`.
2245
+ */
2246
+ get usesDialog() {
2247
+ return this.type === "modal" || this.type === "page";
2248
+ }
2249
+ /**
2250
+ * Determines the value for the popover attribute based on the overlay type.
2251
+ *
2252
+ * @private
2253
+ * @returns The popover value or undefined if not applicable.
2254
+ */
2255
+ get popoverValue() {
2256
+ if ("popover" in this)
2257
+ switch (this.type) {
2258
+ case "modal":
2259
+ case "page":
2260
+ return;
2261
+ case "hint":
2262
+ return "manual";
2263
+ default:
2264
+ return this.type;
2265
+ }
2266
+ }
2267
+ /**
2268
+ * Determines if the overlay requires positioning based on its type and state.
2269
+ *
2270
+ * @protected
2271
+ * @returns True if the overlay requires positioning, otherwise false.
2272
+ */
2273
+ get requiresPositioning() {
2274
+ return !(this.type === "page" || !this.open || !this.triggerElement || !this.placement && this.type !== "hint");
2275
+ }
2276
+ /**
2277
+ * Manages the positioning of the overlay relative to its trigger element.
2278
+ *
2279
+ * This method calculates the necessary parameters for positioning the overlay,
2280
+ * such as offset, placement, and tip padding, and then delegates the actual
2281
+ * positioning to the `PlacementController`.
2282
+ *
2283
+ * @protected
2284
+ * @override
2285
+ */
2286
+ managePosition() {
2287
+ if (!this.requiresPositioning || !this.open)
2288
+ return;
2289
+ const t = this.offset || 0, i = this.triggerElement, n = this.placement || "right", o = this.tipPadding;
2290
+ this.placementController.placeOverlay(this.dialogEl, {
2291
+ offset: t,
2292
+ placement: n,
2293
+ tipPadding: o,
2294
+ trigger: i,
2295
+ type: this.type
2296
+ });
2297
+ }
2298
+ /**
2299
+ * Manages the process of opening the popover.
2300
+ *
2301
+ * This method handles the necessary steps to open the popover, including managing delays,
2302
+ * ensuring the popover is in the DOM, making transitions, and applying focus.
2303
+ *
2304
+ * @protected
2305
+ * @override
2306
+ * @returns A promise that resolves when the popover has been fully opened.
2307
+ */
2308
+ async managePopoverOpen() {
2309
+ super.managePopoverOpen();
2310
+ const t = this.open;
2311
+ if (this.open !== t || (await this.manageDelay(t), this.open !== t) || (await this.ensureOnDOM(t), this.open !== t))
2312
+ return;
2313
+ const i = await this.makeTransition(t);
2314
+ this.open === t && await this.applyFocus(t, i);
2315
+ }
2316
+ /**
2317
+ * Applies focus to the appropriate element after the popover has been opened.
2318
+ *
2319
+ * This method handles the focus management for the overlay, ensuring that the correct
2320
+ * element receives focus based on the overlay's type and state.
2321
+ *
2322
+ * @protected
2323
+ * @override
2324
+ * @param targetOpenState - The target open state of the overlay.
2325
+ * @param focusEl - The element to focus after opening the popover.
2326
+ * @returns A promise that resolves when the focus has been applied.
2327
+ */
2328
+ async applyFocus(t, i) {
2329
+ if (!(this.receivesFocus === "false" || this.type === "hint")) {
2330
+ if (await R(), await R(), t === this.open && !this.open) {
2331
+ this.hasNonVirtualTrigger && this.contains(this.getRootNode().activeElement) && this.triggerElement.focus();
2332
+ return;
2333
+ }
2334
+ i == null || i.focus();
2335
+ }
2336
+ }
2337
+ /**
2338
+ * Returns focus to the trigger element if the overlay is closed.
2339
+ *
2340
+ * This method ensures that focus is returned to the trigger element when the overlay is closed,
2341
+ * unless the overlay is of type "hint" or the focus is already outside the overlay.
2342
+ *
2343
+ * @protected
2344
+ * @override
2345
+ */
2346
+ returnFocus() {
2347
+ var i;
2348
+ if (this.open || this.type === "hint")
2349
+ return;
2350
+ const t = () => {
2351
+ var s, r;
2352
+ const n = [];
2353
+ let o = document.activeElement;
2354
+ for (; (s = o == null ? void 0 : o.shadowRoot) != null && s.activeElement; )
2355
+ o = o.shadowRoot.activeElement;
2356
+ for (; o; ) {
2357
+ const a = o.assignedSlot || o.parentElement || ((r = o.getRootNode()) == null ? void 0 : r.host);
2358
+ a && n.push(a), o = a;
2359
+ }
2360
+ return n;
2361
+ };
2362
+ this.receivesFocus !== "false" && ((i = this.triggerElement) != null && i.focus) && (this.contains(this.getRootNode().activeElement) || t().includes(this) || document.activeElement === document.body) && this.triggerElement.focus();
2363
+ }
2364
+ /**
2365
+ * Manages the process of opening or closing the overlay.
2366
+ *
2367
+ * This method handles the necessary steps to open or close the overlay, including updating the state,
2368
+ * managing the overlay stack, and handling focus events.
2369
+ *
2370
+ * @protected
2371
+ * @param oldOpen - The previous open state of the overlay.
2372
+ * @returns A promise that resolves when the overlay has been fully managed.
2373
+ */
2374
+ async manageOpen(t) {
2375
+ if (!(!this.isConnected && this.open) && (this.hasUpdated || await this.updateComplete, this.open ? (Kt.add(this), this.willPreventClose && (document.addEventListener(
2376
+ "pointerup",
2377
+ () => {
2378
+ this.dialogEl.classList.toggle("not-immediately-closable", !1), this.willPreventClose = !1;
2379
+ },
2380
+ { once: !0 }
2381
+ ), this.dialogEl.classList.toggle("not-immediately-closable", !0))) : (t && this.dispose(), Kt.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")) {
2382
+ const i = this.getRootNode();
2383
+ this.open ? i.addEventListener("focusout", this.closeOnFocusOut, {
2384
+ capture: !0
2385
+ }) : i.removeEventListener("focusout", this.closeOnFocusOut, {
2386
+ capture: !0
2387
+ });
2388
+ }
2389
+ }
2390
+ /**
2391
+ * Binds event handling strategies to the overlay based on the specified trigger interaction.
2392
+ *
2393
+ * This method sets up the appropriate event handling strategy for the overlay, ensuring that
2394
+ * it responds correctly to user interactions such as clicks, hovers, or long presses.
2395
+ *
2396
+ * @protected
2397
+ */
2398
+ bindEvents() {
2399
+ var t;
2400
+ (t = this.strategy) == null || t.abort(), this.strategy = void 0, this.hasNonVirtualTrigger && this.triggerInteraction && (this.strategy = new Oi[this.triggerInteraction](
2401
+ this.triggerElement,
2402
+ {
2403
+ overlay: this
2404
+ }
2405
+ ));
2406
+ }
2407
+ /**
2408
+ * Handles the `beforetoggle` event to manage the overlay's state.
2409
+ *
2410
+ * This method checks the new state of the event and calls `handleBrowserClose`
2411
+ * if the new state is not 'open'.
2412
+ *
2413
+ * @protected
2414
+ * @param event - The `beforetoggle` event with the new state.
2415
+ */
2416
+ handleBeforetoggle(t) {
2417
+ t.newState !== "open" && this.handleBrowserClose(t);
2418
+ }
2419
+ /**
2420
+ * Handles the browser's close event to manage the overlay's state.
2421
+ *
2422
+ * This method stops the propagation of the event and closes the overlay if it is not
2423
+ * actively opening. If the overlay is actively opening, it calls `manuallyKeepOpen`.
2424
+ *
2425
+ * @protected
2426
+ * @param event - The browser's close event.
2427
+ */
2428
+ handleBrowserClose(t) {
2429
+ var i;
2430
+ if (t.stopPropagation(), !((i = this.strategy) != null && i.activelyOpening)) {
2431
+ this.open = !1;
2432
+ return;
2433
+ }
2434
+ this.manuallyKeepOpen();
2435
+ }
2436
+ /**
2437
+ * Manually keeps the overlay open.
2438
+ *
2439
+ * This method sets the overlay to open, allows placement updates, and manages the open state.
2440
+ *
2441
+ * @public
2442
+ * @override
2443
+ */
2444
+ manuallyKeepOpen() {
2445
+ this.open = !0, this.placementController.allowPlacementUpdate = !0, this.manageOpen(!1);
2446
+ }
2447
+ /**
2448
+ * Handles the `slotchange` event to manage the overlay's state.
2449
+ *
2450
+ * This method checks if there are any elements in the slot. If there are no elements,
2451
+ * it releases the description from the strategy. If there are elements and the trigger
2452
+ * is non-virtual, it prepares the description for the trigger element.
2453
+ *
2454
+ * @protected
2455
+ */
2456
+ handleSlotchange() {
2457
+ var t, i;
2458
+ this.elements.length === 0 ? (t = this.strategy) == null || t.releaseDescription() : this.hasNonVirtualTrigger && ((i = this.strategy) == null || i.prepareDescription(this.triggerElement));
2459
+ }
2460
+ /**
2461
+ * Determines whether the overlay should prevent closing.
2462
+ *
2463
+ * This method checks the `willPreventClose` flag and resets it to `false`.
2464
+ * It returns the value of the `willPreventClose` flag.
2465
+ *
2466
+ * @public
2467
+ * @returns `true` if the overlay should prevent closing, otherwise `false`.
2468
+ */
2469
+ shouldPreventClose() {
2470
+ const t = this.willPreventClose;
2471
+ return this.willPreventClose = !1, t;
2472
+ }
2473
+ /**
2474
+ * Requests slottable content for the overlay.
2475
+ *
2476
+ * This method dispatches a `SlottableRequestEvent` to request or remove slottable content
2477
+ * based on the current open state of the overlay. It ensures that the same state is not
2478
+ * dispatched twice in a row.
2479
+ *
2480
+ * @protected
2481
+ * @override
2482
+ */
2483
+ requestSlottable() {
2484
+ this.lastRequestSlottableState !== this.open && (this.open || document.body.offsetHeight, this.dispatchEvent(
2485
+ new ye(
2486
+ "overlay-content",
2487
+ this.open ? {} : we
2488
+ )
2489
+ ), this.lastRequestSlottableState = this.open);
2490
+ }
2491
+ /**
2492
+ * Lifecycle method called before the component updates.
2493
+ *
2494
+ * This method handles various tasks before the component updates, such as setting an ID,
2495
+ * managing the open state, resolving the trigger element, and binding events.
2496
+ *
2497
+ * @override
2498
+ * @param changes - The properties that have changed.
2499
+ */
2500
+ willUpdate(t) {
2501
+ var n;
2502
+ if (this.hasAttribute("id") || this.setAttribute("id", `${this.tagName.toLowerCase()}-${St()}`), t.has("open") && (this.hasUpdated || this.open) && this.manageOpen(t.get("open")), t.has("trigger")) {
2503
+ const [o, s] = ((n = this.trigger) == null ? void 0 : n.split("@")) || [];
2504
+ this.elementResolver.selector = o ? `#${o}` : "", this.triggerInteraction = s;
2505
+ }
2506
+ let i = !1;
2507
+ t.has(ve) && (i = this.triggerElement, this.triggerElement = this.elementResolver.element), t.has("triggerElement") && (i = t.get("triggerElement")), i !== !1 && this.bindEvents();
2508
+ }
2509
+ /**
2510
+ * Lifecycle method called after the component updates.
2511
+ *
2512
+ * This method handles various tasks after the component updates, such as updating the placement
2513
+ * attribute, resetting the overlay position, and clearing the overlay position based on the state.
2514
+ *
2515
+ * @override
2516
+ * @param changes - The properties that have changed.
2517
+ */
2518
+ updated(t) {
2519
+ 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();
2520
+ }
2521
+ /**
2522
+ * Renders the content of the overlay.
2523
+ *
2524
+ * This method returns a template result containing a slot element. The slot element
2525
+ * listens for the `slotchange` event to manage the overlay's state.
2526
+ *
2527
+ * @protected
2528
+ * @returns The template result containing the slot element.
2529
+ */
2530
+ renderContent() {
2531
+ return ht` <slot @slotchange=${this.handleSlotchange}></slot> `;
2532
+ }
2533
+ /**
2534
+ * Generates a style map for the dialog element.
2535
+ *
2536
+ * This method returns an object containing CSS custom properties for the dialog element.
2537
+ * The `--luzmo-overlay-open-count` custom property is set to the current open count of overlays.
2538
+ *
2539
+ * @private
2540
+ * @returns The style map for the dialog element.
2541
+ */
2542
+ get dialogStyleMap() {
2543
+ return {
2544
+ "--luzmo-overlay-open-count": I.openCount.toString()
2545
+ };
2546
+ }
2547
+ /**
2548
+ * Renders the dialog element for the overlay.
2549
+ *
2550
+ * This method returns a template result containing a dialog element. The dialog element
2551
+ * includes various attributes and event listeners to manage the overlay's state and behavior.
2552
+ *
2553
+ * @protected
2554
+ * @returns The template result containing the dialog element.
2555
+ */
2556
+ renderDialog() {
2557
+ return ht`
2558
+ <dialog
2559
+ class="dialog"
2560
+ part="dialog"
2561
+ placement=${Ct(
2562
+ this.requiresPositioning ? this.placement || "right" : void 0
2563
+ )}
2564
+ style=${Ut(this.dialogStyleMap)}
2565
+ @close=${this.handleBrowserClose}
2566
+ @cancel=${this.handleBrowserClose}
2567
+ @beforetoggle=${this.handleBeforetoggle}
2568
+ ?is-visible=${this.state !== "closed"}
2569
+ >
2570
+ ${this.renderContent()}
2571
+ </dialog>
2572
+ `;
2573
+ }
2574
+ /**
2575
+ * Renders the popover element for the overlay.
2576
+ *
2577
+ * This method returns a template result containing a div element styled as a popover.
2578
+ * The popover element includes various attributes and event listeners to manage the overlay's state and behavior.
2579
+ *
2580
+ * @protected
2581
+ * @returns The template result containing the popover element.
2582
+ */
2583
+ renderPopover() {
2584
+ return ht`
2585
+ <div
2586
+ class="dialog"
2587
+ part="dialog"
2588
+ placement=${Ct(
2589
+ this.requiresPositioning ? this.placement || "right" : void 0
2590
+ )}
2591
+ popover=${Ct(this.popoverValue)}
2592
+ style=${Ut(this.dialogStyleMap)}
2593
+ @beforetoggle=${this.handleBeforetoggle}
2594
+ @close=${this.handleBrowserClose}
2595
+ ?is-visible=${this.state !== "closed"}
2596
+ >
2597
+ ${this.renderContent()}
2598
+ </div>
2599
+ `;
2600
+ }
2601
+ /**
2602
+ * Renders the overlay component.
2603
+ *
2604
+ * This method returns a template result containing either a dialog or popover element
2605
+ * based on the overlay type. It also includes a slot for longpress descriptors.
2606
+ *
2607
+ * @override
2608
+ * @returns The template result containing the overlay content.
2609
+ */
2610
+ render() {
2611
+ const t = this.type === "modal" || this.type === "page";
2612
+ return ht`
2613
+ ${t ? this.renderDialog() : this.renderPopover()}
2614
+ <slot name="longpress-describedby-descriptor"></slot>
2615
+ `;
2616
+ }
2617
+ /**
2618
+ * Lifecycle method called when the component is added to the DOM.
2619
+ *
2620
+ * This method sets up event listeners and binds events if the component has already updated.
2621
+ *
2622
+ * @override
2623
+ */
2624
+ connectedCallback() {
2625
+ super.connectedCallback(), this.addEventListener("close", () => {
2626
+ this.open = !1;
2627
+ }), this.hasUpdated && this.bindEvents();
2628
+ }
2629
+ /**
2630
+ * Lifecycle method called when the component is removed from the DOM.
2631
+ *
2632
+ * This method releases the description from the strategy and updates the 'open' property.
2633
+ *
2634
+ * @override
2635
+ */
2636
+ disconnectedCallback() {
2637
+ var t;
2638
+ (t = this.strategy) == null || t.releaseDescription(), this.open = !1, super.disconnectedCallback();
2639
+ }
2640
+ }, I.styles = [pe(Fe)], I.openCount = 1, I);
2641
+ O([
2642
+ z({ type: Boolean })
2643
+ ], P.prototype, "delayed", 1);
2644
+ O([
2645
+ te(".dialog")
2646
+ ], P.prototype, "dialogEl", 2);
2647
+ O([
2648
+ z({ type: Boolean })
2649
+ ], P.prototype, "disabled", 1);
2650
+ O([
2651
+ me({
2652
+ flatten: !0,
2653
+ selector: ':not([slot="longpress-describedby-descriptor"], slot)'
2654
+ })
2655
+ ], P.prototype, "elements", 2);
2656
+ O([
2657
+ z({ type: Number })
2658
+ ], P.prototype, "offset", 2);
2659
+ O([
2660
+ z({ type: Boolean, reflect: !0 })
2661
+ ], P.prototype, "open", 1);
2662
+ O([
2663
+ z()
2664
+ ], P.prototype, "placement", 2);
2665
+ O([
2666
+ z({ attribute: "receives-focus" })
2667
+ ], P.prototype, "receivesFocus", 2);
2668
+ O([
2669
+ te("slot")
2670
+ ], P.prototype, "slotEl", 2);
2671
+ O([
2672
+ fe()
2673
+ ], P.prototype, "state", 1);
2674
+ O([
2675
+ z({ type: Number, attribute: "tip-padding" })
2676
+ ], P.prototype, "tipPadding", 2);
2677
+ O([
2678
+ z()
2679
+ ], P.prototype, "trigger", 2);
2680
+ O([
2681
+ z({ attribute: !1 })
2682
+ ], P.prototype, "triggerElement", 2);
2683
+ O([
2684
+ z({ attribute: !1 })
2685
+ ], P.prototype, "triggerInteraction", 2);
2686
+ O([
2687
+ z()
2688
+ ], P.prototype, "type", 2);
2689
+ let Di = P;
2690
+ const Lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2691
+ __proto__: null,
2692
+ Overlay: Di
2693
+ }, Symbol.toStringTag, { value: "Module" }));
2694
+ export {
2695
+ rt as A,
2696
+ wi as C,
2697
+ xi as H,
2698
+ Pt as I,
2699
+ Pi as L,
2700
+ Di as O,
2701
+ yi as P,
2702
+ wt as V,
2703
+ R as a,
2704
+ Vt as b,
2705
+ Ci as c,
2706
+ Lt as d,
2707
+ kt as g,
2708
+ J as n,
2709
+ mt as o,
2710
+ qi as p,
2711
+ Oi as s
2712
+ };